public class NewProjectHandler extends org.apache.struts.action.Action
{
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();
ProjectFacadeHome phh = (ProjectFacadeHome)CVUtility.getHomeObject("com.centraview.projects.projectfacade.ProjectFacadeHome", "ProjectFacade");
try
{
HttpSession session = request.getSession(true);
if (session.getAttribute("highlightmodule") != null)
{
session.setAttribute("highlightmodule", "project");
}
ProjectForm projectForm = new ProjectForm();
if (request.getParameter("entityname") != null)
{
projectForm.setEntity((String) request.getParameter("entityname"));
}
if (request.getParameter("entityid") != null)
{
projectForm.setEntityid(Integer.parseInt(request.getParameter("entityid")));
}
if (request.getParameter("contact") != null)
{
projectForm.setContact((String) request.getParameter("contact"));
}
if (request.getParameter("contactID") != null)
{
projectForm.setContactID(Integer.parseInt(request.getParameter("contactID")));
}
ProjectFacade remote = (ProjectFacade) phh.create();
remote.setDataSource(dataSource);
Vector statusCol = remote.getProjectStatusList();
projectForm.setProjectStatusVec(statusCol);
request.setAttribute("projectForm", projectForm);