Package com.centraview.projects.helper

Examples of com.centraview.projects.helper.ProjectVO


    CVDal cvdl = new CVDal(dataSource);
    cvdl.setSql("project.getproject");
    cvdl.setInt(1, projectId);
    Collection col = cvdl.executeQuery();
    Iterator ite = col.iterator();
    ProjectVO pvo = new ProjectVO();
    if (ite.hasNext())
    {
      HashMap project = (HashMap)ite.next();
      pvo.setProjectID(((Long)project.get("ProjectID")).intValue());
      pvo.setTitle((String)project.get("ProjectTitle"));
      if (project.get("Description") != null)
        pvo.setDescription((String)project.get("Description"));
      if (project.get("StatusID") != null)
        pvo.setStatusID(((Long)project.get("StatusID")).intValue());
      if (project.get("Start") != null)
        pvo.setStart((java.sql.Date)project.get("Start"));
      if (project.get("End") != null)
        pvo.setEnd((java.sql.Date)project.get("End"));
      if (project.get("BudgetedHours") != null)
        pvo.setBudgetedHours(((Long)project.get("BudgetedHours")).intValue());
      if (project.get("HoursUsed") != null)
        pvo.setUsedHours(((Long)project.get("HoursUsed")).intValue());
      if (project.get("Owner") != null)
        pvo.setOwner(((Long)project.get("Owner")).intValue());
      if (project.get("Manager") != null)
        pvo.setManagerID(((Long)project.get("Manager")).intValue());
      if (project.get("Creator") != null)
        pvo.setCreator(((Long)project.get("Creator")).intValue());
      if (project.get("ModifiedBy") != null)
        pvo.setModifiedBy(((Long)project.get("ModifiedBy")).intValue());
      if (project.get("Modified") != null)
        pvo.setModified((Timestamp)project.get("Modified"));
      if (project.get("Created") != null)
        pvo.setCreated((Timestamp)project.get("Created"));
    }

    cvdl.clearParameters();
    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pvo.getCreator());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setCreatorName((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pvo.getModifiedBy());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setModifierName((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }
    cvdl.clearParameters();

    cvdl.setSql("project.getprojectentitylink");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setEntityID(((Long)hm.get("entityid")).intValue());
      pvo.setEntityName((String)hm.get("name"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getprojectindividuallink");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setContactID(((Long)hm.get("individualid")).intValue());
      pvo.setContactName((String)hm.get("CONCAT(firstname , ' ' , lastname)"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getprojectgrouplink");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setGroupID(((Long)hm.get("groupid")).intValue());
      pvo.setGroupName((String)hm.get("name"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.projecthoursused");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      if (hm.get("sum(hours)") != null)
      {
        pvo.setUsedHours(((Double)hm.get("sum(hours)")).floatValue());
      }
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pvo.getOwner());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setOwnerName((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }
    cvdl.clearParameters();

    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pvo.getManagerID());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setManager((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }
    cvdl.clearParameters();
    return pvo;
  }
View Full Code Here


    return;
  }

  public ProjectVO getProject(int projectId, int userId)
  {
    ProjectVO projectVO = null;

    try {
      InitialContext ic = CVUtility.getInitialContext();
      ProjectLocalHome home = (ProjectLocalHome)ic.lookup("local/Project");
      ProjectLocal remote = (ProjectLocal)home.create();
View Full Code Here

    int individualID = userobject.getIndividualID();

    currentTZ = userobject.getUserPref().getTimeZone();

    ProjectVOX projectVOX = new ProjectVOX(currentTZ, form);
    ProjectVO projectVO = projectVOX.getVO();

    Vector customFieldVec = getCustomFieldVO(request, response);
    projectVO.setCustomFieldVOs(customFieldVec);

    ProjectFacadeHome aa = (ProjectFacadeHome)
      CVUtility.getHomeObject("com.centraview.projects.projectfacade.ProjectFacadeHome", "ProjectFacade");

    try
View Full Code Here

  public boolean saveForm(int indvID, ActionForm form,
    HttpServletRequest request, HttpServletResponse responsethrows CommunicationException,NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    ProjectVOX projectVOX = new ProjectVOX(currentTZ, form);
    ProjectVO projectVO = projectVOX.getVO();
    Vector customFieldVec = getCustomFieldVO(request, response);
    projectVO.setCustomFieldVOs(customFieldVec);

    ProjectFacadeHome pfh = (ProjectFacadeHome)
      CVUtility.getHomeObject("com.centraview.projects.projectfacade.ProjectFacadeHome", "ProjectFacade");

    try
View Full Code Here

      if (request.getParameterValues("rowId") != null)
      {
        rowId = request.getParameterValues("rowId");
      }

      ProjectVO projectVO = remote.getProject(Integer.parseInt(rowId[0]), individualID);
      ProjectForm dynaForm = (ProjectForm) form;

      if (projectVO.getEntityID() != 0)
      {
        dynaForm.setEntity(projectVO.getEntityName());
        dynaForm.setEntityid(projectVO.getEntityID());
      }

      if (projectVO.getContactID() != 0)
      {
        dynaForm.setContact(projectVO.getContactName());
        dynaForm.setContactID(projectVO.getContactID());
      }

      if (projectVO.getGroupID() != 0)
      {
        dynaForm.setTeam(projectVO.getGroupName());
        dynaForm.setTeamID(projectVO.getGroupID());
      }

      if (projectVO.getTitle() != null)
      {
        dynaForm.setTitle(projectVO.getTitle());
      }

      if (projectVO.getDescription() != null)
      {
        dynaForm.setDescription(projectVO.getDescription());
      }

      if (projectVO.getEntityName() != null)
      {
        dynaForm.setEntity(projectVO.getEntityName());
      }

      if (projectVO.getContactName() != null)
      {
        dynaForm.setContact(projectVO.getContactName());
      }

      if (projectVO.getOwner() != 0)
      {
        dynaForm.setManager(projectVO.getOwnerName());
        dynaForm.setManagerID(projectVO.getOwner());
      }
     
    Vector statusCol = remote.getProjectStatusList();
    dynaForm.setProjectStatusVec(statusCol);
   
      if (projectVO.getGroupName() != null)
      {
        dynaForm.setTeam(projectVO.getGroupName());
      }

      if (projectVO.getStart() != null)
      {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(projectVO.getStart());
        dynaForm.setStartday("" + calendar.get(Calendar.DAY_OF_MONTH));
        dynaForm.setStartmonth("" + (calendar.get(Calendar.MONTH) + 1));
        dynaForm.setStartyear("" + calendar.get(Calendar.YEAR));
      }

      if (projectVO.getEnd() != null)
      {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(projectVO.getEnd());
        dynaForm.setEndday("" + calendar.get(Calendar.DAY_OF_MONTH));
        dynaForm.setEndmonth("" + (calendar.get(Calendar.MONTH) + 1));
        dynaForm.setEndyear("" + calendar.get(Calendar.YEAR));
      }

      if (projectVO.getBudgetedHours() != 0)
      {
        dynaForm.setBudhr("" + projectVO.getBudgetedHours());
      }
      HashMap hhmm = projectVO.getStat();

      if (hhmm != null)
      {
        String[] mys = new String[hhmm.size()];

        if (hhmm != null)
        {
          Iterator it = hhmm.keySet().iterator();
          int k = 0;

          while (it.hasNext())
          {
            Object o = it.next();
            mys[k] = "" + ((Integer) o).intValue();
            k++;
          }
        }
      }
      dynaForm.setStatus(("" + projectVO.getStatusID()));

      request.setAttribute("statusmap", hhmm);
      returnStatus = ".view.projects.new.project";
    }
    catch (Exception e)
View Full Code Here

    HttpSession session = request.getSession(true);
    UserObject userobjectd = (UserObject) session.getAttribute("userobject");
    int individualID = userobjectd.getIndividualID();

    ProjectForm dynaForm = (ProjectForm) form;
    ProjectVO projectVO = null;

    ProjectFacadeHome pfh = (ProjectFacadeHome)
      CVUtility.getHomeObject("com.centraview.projects.projectfacade.ProjectFacadeHome", "ProjectFacade");

    try
    {
      ProjectFacade remote = (ProjectFacade) pfh.create();
      remote.setDataSource(dataSource);
      projectVO = remote.getProject(Integer.parseInt(rowId), individualID);

      dynaForm.setProjectid(Integer.parseInt(rowId));
      request.setAttribute("recordId", String.valueOf(rowId));
      if (projectVO.getEntityID() != 0)
      {
        dynaForm.setEntity(projectVO.getEntityName());
        dynaForm.setEntityid(projectVO.getEntityID());
        request.setAttribute("parentId", String.valueOf(projectVO.getEntityID()));
        request.setAttribute("parentName", java.net.URLEncoder.encode(projectVO.getEntityName(), "ISO-8859-1"));
      }

      if (projectVO.getContactID() != 0)
      {
        dynaForm.setContact(projectVO.getContactName());
        dynaForm.setContactID(projectVO.getContactID());
      }

      if (projectVO.getGroupID() != 0)
      {
        dynaForm.setTeam(projectVO.getGroupName());
        dynaForm.setTeamID(projectVO.getGroupID());
      }

      if (projectVO.getTitle() != null)
      {
        String projectTitle = projectVO.getTitle();
        request.setAttribute("recordName", projectTitle);
        dynaForm.setTitle(projectTitle);
      }

      if (projectVO.getDescription() != null)
      {
        dynaForm.setDescription(projectVO.getDescription());
      }

      if (projectVO.getEntityName() != null)
      {
        dynaForm.setEntity(projectVO.getEntityName());
      }

      if (projectVO.getContactName() != null)
      {
        dynaForm.setContact(projectVO.getContactName());
      }

      if (projectVO.getManagerID() != 0)
      {
        dynaForm.setManager(projectVO.getManager());
        dynaForm.setManagerID(projectVO.getManagerID());
      }

      if (projectVO.getGroupName() != null)
      {
        dynaForm.setTeam(projectVO.getGroupName());
      }

      if (projectVO.getStart() != null)
      {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(projectVO.getStart());
        dynaForm.setStartday(String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)));
        dynaForm.setStartmonth(String.valueOf((calendar.get(Calendar.MONTH) + 1)));
        dynaForm.setStartyear(String.valueOf(calendar.get(Calendar.YEAR)));
      }

      if (projectVO.getEnd() != null)
      {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(projectVO.getEnd());
        dynaForm.setEndday(String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)));
        dynaForm.setEndmonth(String.valueOf((calendar.get(Calendar.MONTH) + 1)));
        dynaForm.setEndyear(String.valueOf(calendar.get(Calendar.YEAR)));
      }

    Vector statusCol = remote.getProjectStatusList();
    dynaForm.setProjectStatusVec(statusCol);
   
      if (projectVO.getBudgetedHours() != 0)
      {
        iBudHrs = projectVO.getBudgetedHours();
        dynaForm.setBudhr("" + iBudHrs);
      }

      SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy - h:mm a");

      if (projectVO.getCreated() != null)
      {
        dynaForm.setCreatedOn(dateFormat.format(projectVO.getCreated()));
      }

      if (projectVO.getModified() != null)
      {
        dynaForm.setModifiedOn(dateFormat.format(projectVO.getModified()));
      }

      if (projectVO.getCreatorName() != null)
      {
        dynaForm.setCreatorName(projectVO.getCreatorName());
      }

      if (projectVO.getModifierName() != null)
      {
        dynaForm.setModifierName(projectVO.getModifierName());
      }

      iUsedHrs = projectVO.getUsedHours();
     
      dynaForm.setUsedHours((int) iUsedHrs);
      dynaForm.setAvailable((int) (iBudHrs - iUsedHrs));

      request.setAttribute("projectid", rowId);
      HashMap hhmm = projectVO.getStat();

      if (hhmm != null)
      {
        String[] mys = new String[hhmm.size()];

        if (hhmm != null)
        {
          Iterator it = hhmm.keySet().iterator();
          int k = 0;

          while (it.hasNext())
          {
            Object o = it.next();
            mys[k] = "" + ((Integer) o).intValue();
            k++;
          }
        }
      }

      dynaForm.setStatus(("" + projectVO.getStatusID()));
      request.setAttribute("statusmap", hhmm);
      returnStatus = ".view.projects.edit.project";
    }
    catch (Exception e)
    {
View Full Code Here

TOP

Related Classes of com.centraview.projects.helper.ProjectVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.