public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
{
String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
SaleFacadeHome sfh = (SaleFacadeHome)CVUtility.getHomeObject("com.centraview.sale.salefacade.SaleFacadeHome", "SaleFacade");
try{
HttpSession session = request.getSession();
UserObject userObject = (UserObject)session.getAttribute("userobject");
int individualID = userObject.getIndividualID();
request.setAttribute("newProposal", new Boolean(true));
ProposalListForm proposalListForm = (ProposalListForm)form;
String oppId = request.getParameter("oppId");
String oppTitle = request.getParameter("oppTitle");
if ((oppId == null) && (oppTitle == null)) {
oppId = (String)request.getAttribute("oppId");
oppTitle = (String)request.getAttribute("oppTitle");
}
if ((oppId != null) && (oppTitle != null)) {
proposalListForm.setOpportunityid(oppId);
proposalListForm.setOpportunity(oppTitle);
SaleFacade remote = (SaleFacade)sfh.create();
remote.setDataSource(dataSource);
int opportunityId = (new Integer(oppId)).intValue();
OpportunityVO oppVO = remote.getOpportunity(individualID, opportunityId);
proposalListForm.setIndividualid(String.valueOf(oppVO.getIndividualID()));