Examples of TicketVO


Examples of com.centraview.support.ticket.TicketVO

      } else {
        tVO = remote.getThread(individualId, Integer.parseInt(request.getAttribute("rowId").toString()));
      }

      if (tVO != null) {
        TicketVO ticketVO = remote.getTicketBasicRelations(individualId, tVO.getTicketId());

        if (ticketVO != null) {
          TicketForm ticketForm = new TicketForm();
          ticketForm.setSubject(ticketVO.getTitle());
          ticketForm.setDetail(ticketVO.getDetail());
          ticketForm.setId(new Integer(ticketVO.getId()).toString());
          ticketForm.setEntityid(new Integer(ticketVO.getRefEntityId()).toString());
          ticketForm.setContactid(new Integer(ticketVO.getRefIndividualId()).toString());
          ticketForm.setContact(ticketVO.getRefIndividualName());
         
          EntityVO entityVO = ticketVO.getEntityVO();
          if (entityVO != null) {
            String entityName = entityVO.getName();
            ticketForm.setEntityname(entityName);
           
            AddressVO primaryAdd = entityVO.getPrimaryAddress();
           
            if (primaryAdd != null) {
              String address = "";
              if (primaryAdd.getStreet1() != null && !primaryAdd.getStreet1().equals("")) {
                address += primaryAdd.getStreet1();
              }
              if (primaryAdd.getStreet2() != null && !primaryAdd.getStreet2().equals("")) {
                address +=", "+ primaryAdd.getStreet2()+"\n";
              } else {
                address += "\n";
              }
              if (primaryAdd.getCity() != null && !primaryAdd.getCity().equals("")) {
                address += primaryAdd.getCity();
              }
              if (primaryAdd.getStateName() != null && !primaryAdd.getStateName().equals("")) {
                address += ", "+ primaryAdd.getStateName();
              }
              if (primaryAdd.getZip() != null && !primaryAdd.getZip().equals("")) {
                address += " "+ primaryAdd.getZip();
              }
              if (primaryAdd.getCountryName() != null && !primaryAdd.getCountryName().equals("")) {
                address += ", "+ primaryAdd.getCountryName();
              }
              ticketForm.setAddress(address);
              if (primaryAdd.getWebsite() != null) {
                ticketForm.setWebsite(primaryAdd.getWebsite());
              }
            }
           
            Collection mocList = entityVO.getMOC();
            Iterator iterator = mocList.iterator();
            while (iterator.hasNext()) {
              MethodOfContactVO moc  = (MethodOfContactVO) iterator.next();
              if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
                ticketForm.setEmail(moc.getContent());
              } else if (moc.getMocType() == 4) {
                ticketForm.setPhone(moc.getContent());
              }
            }
          }
          request.setAttribute("ticketform", ticketForm);
         
          DynaActionForm dynaForm = (DynaActionForm)form;
         
          if (tVO != null) {
            dynaForm.set("threadid", new Integer(tVO.getId()).toString());
            dynaForm.set("ticketnumber", new Integer(ticketVO.getId()).toString());
            dynaForm.set("title", tVO.getTitle());
            dynaForm.set("threaddetail", tVO.getDetail());
            dynaForm.set("priority", new Integer(tVO.getPriorityId()).toString());

            if (tVO.getCreatedByVO() != null) {
View Full Code Here

Examples of com.centraview.support.ticket.TicketVO

    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    try {
      HttpSession session = request.getSession();
      int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
      TicketVO ticketVO = new TicketVO();
      TicketForm ticketForm = (TicketForm)form;

      SupportFacadeHome supportFacade = (SupportFacadeHome)CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome", "SupportFacade");
      SupportFacade remote = (SupportFacade)supportFacade.create();
      remote.setDataSource(dataSource);

      if (ticketForm.getSubject() != null) {
        ticketVO.setTitle(ticketForm.getSubject());
      }
     
      if (ticketForm.getDetail() != null) {
        ticketVO.setDetail(ticketForm.getDetail());
      }

      if (ticketForm.getPriority() != null) {
        ticketVO.setPriorityId(Integer.parseInt(ticketForm.getPriority()));
      }else{
        ticketVO.setPriorityId(Integer.parseInt(request.getParameter("priority")));
      }
     
      if (ticketForm.getStatus() != null) {
        ticketVO.setStatusId(Integer.parseInt(ticketForm.getStatus()));
      }

      if ((ticketForm.getManagerid() != null) && (!ticketForm.getManagerid().equals(""))) {
        ticketVO.setManagerId(Integer.parseInt(ticketForm.getManagerid()));
      }
     
      if ((ticketForm.getAssignedtoid() != null) && (!ticketForm.getAssignedtoid().equals(""))) {
        ticketVO.setAssignedToId(Integer.parseInt(ticketForm.getAssignedtoid()));
      }

      if ((ticketForm.getEntityid() != null) && (!ticketForm.getEntityid().equals(""))) {
        ticketVO.setRefEntityId(Integer.parseInt(ticketForm.getEntityid()));
      }

      if ((ticketForm.getContactid() != null) && (!ticketForm.getContactid().equals(""))) {
        ticketVO.setRefIndividualId(Integer.parseInt(ticketForm.getContactid()));
      }
      ticketVO.setCreatedBy(individualId);
      ticketVO.setCustomField(getCustomFieldVO(request, response));

      remote.addTicket(individualId, ticketVO);

      FORWARD_final = FORWARD_editsavefile;
    } catch (Exception e) {
View Full Code Here

Examples of com.centraview.support.ticket.TicketVO

    try {
      HttpSession session = request.getSession();
      int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();

      TicketVO ticketVO = new TicketVO();
      TicketForm ticketForm = (TicketForm)form;

      SupportFacadeHome supportFacade = (SupportFacadeHome)CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome", "SupportFacade");
      SupportFacade remote = (SupportFacade)supportFacade.create();
      remote.setDataSource(dataSource);

      if (ticketForm.getSubject() != null) {
        ticketVO.setTitle(ticketForm.getSubject());
      }
     
      if (ticketForm.getDetail() != null) {
        ticketVO.setDetail(ticketForm.getDetail());
      }

      if (ticketForm.getPriority() != null) {
        ticketVO.setPriorityId(Integer.parseInt(ticketForm.getPriority()));
      }else{
        ticketVO.setPriorityId(Integer.parseInt(request.getParameter("priority")));
      }
     
      if (ticketForm.getStatus() != null) {
        ticketVO.setStatusId(Integer.parseInt(ticketForm.getStatus()));
      }

      if ((ticketForm.getManagerid() != null) && (!ticketForm.getManagerid().equals(""))) {
        ticketVO.setManagerId(Integer.parseInt(ticketForm.getManagerid()));
      }
     
      if ((ticketForm.getAssignedtoid() != null) && (!ticketForm.getAssignedtoid().equals(""))) {
        ticketVO.setAssignedToId(Integer.parseInt(ticketForm.getAssignedtoid()));
      }

      if ((ticketForm.getEntityid() != null) && (!ticketForm.getEntityid().equals(""))) {
        ticketVO.setRefEntityId(Integer.parseInt(ticketForm.getEntityid()));
      }

      if ((ticketForm.getContactid() != null) && (!ticketForm.getContactid().equals(""))) {
        ticketVO.setRefIndividualId(Integer.parseInt(ticketForm.getContactid()));
      }

      ticketVO.setCreatedBy(individualId);
      ticketVO.setCustomField(getCustomFieldVO(request, response));
      ticketVO.setId(Integer.parseInt(ticketForm.getId()));
      remote.updateTicket(individualId, ticketVO);

      String closeornew = (String)request.getParameter("closeornew");
      String saveandclose = null;
      String saveandnew = null;
View Full Code Here

Examples of com.centraview.support.ticket.TicketVO

      SupportFacadeHome sfh = (SupportFacadeHome)CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome", "SupportFacade");
      SupportFacade remote = (SupportFacade)sfh.create();
      remote.setDataSource(dataSource);

      TicketVO tVO = remote.getTicketBasicRelations(individualId, Integer.parseInt(request.getParameter("ticketId").toString()));

      TicketForm ticketForm = (TicketForm)form;

      if (tVO != null) {
        if (ticketForm != null) {
          ticketForm.setSubject(tVO.getTitle());
          ticketForm.setDetail(tVO.getDetail());
          ticketForm.setId(new Integer(tVO.getId()).toString());
          ticketForm.setEntityid(new Integer(tVO.getRefEntityId()).toString());
          ticketForm.setContactid(new Integer(tVO.getRefIndividualId()).toString());
          ticketForm.setContact(tVO.getRefIndividualName());
         
          EntityVO entityVO = tVO.getEntityVO();
         
          if (entityVO != null) {
            String entityName = entityVO.getName();
            ticketForm.setEntityname(entityName);
            AddressVO primaryAdd = entityVO.getPrimaryAddress();
View Full Code Here

Examples of com.centraview.support.ticket.TicketVO

          FORWARD_final = FORWARD_showticketlist;
          return mapping.findForward(FORWARD_final);
        }
      }
     
      TicketVO ticketVO = new TicketVO();
      TicketForm dynaForm = (TicketForm)form;

      TicketHome th = (TicketHome)CVUtility.getHomeObject("com.centraview.support.ticket.TicketHome", "Ticket");
      Ticket t = th.create();
      t.setDataSource(dataSource);

      TicketVO tVO = t.getTicketBasicRelations(individualId, ticketId);

      SupportFacadeHome supFacade = (SupportFacadeHome)CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome", "SupportFacade");
      SupportFacade remote = supFacade.create();
      remote.setDataSource(dataSource);

      CvFileHome fileHome = (CvFileHome)CVUtility.getHomeObject("com.centraview.file.CvFileHome", "CvFile");
      CvFile cvFile = fileHome.create();
      cvFile.setDataSource(dataSource);
      FileList fileList = null;
     
      if (tVO.getId() != 0) {
        fileList = cvFile.getAllTicketFiles(individualId, tVO.getId());
        fileList = setLinksFunction(fileList);
      }

      ThreadList threadList = remote.getThreadList(individualId, tVO.getId());
      threadList = setLinksfunction(threadList);

      ListGenerator lg1 = ListGenerator.getListGenerator(dataSource);
      HashMap hmDispLists = lg1.getDisplayLists();

      if (hmDispLists != null) {
        hmDispLists.put(new Long(threadList.getListID()), threadList);
      }

      Vector timeSlipColumns = new Vector();

      timeSlipColumns.addElement("Description");
      timeSlipColumns.addElement("Duration");
      timeSlipColumns.addElement("CreatedBy");
      timeSlipColumns.addElement("Date");
      timeSlipColumns.addElement("StartTime");
      timeSlipColumns.addElement("EndTime");

      TimeSlipList timesliplist = new TimeSlipList();

      ListGenerator lg = ListGenerator.getListGenerator(dataSource); //get the List Generator object for Listing

      String searchTimeSlipString =
        "ADVANCE:select ts.TimeSlipID, ts.Description, ts.CreatedBy, individual.FirstName,"
          + "individual.LastName, ts.BreakTime, ts.Date, ts.Start, ts.End "
          + "from timeslip  ts left outer join individual on "
          + "ts.CreatedBy = individual.IndividualID where ts.ticketid="
          + ticketId;

      timesliplist = (TimeSlipList)lg.getTimeSlipList(individualId, 1, 200, searchTimeSlipString, "Description");
      timesliplist = setTimeSlipLinks(timesliplist, ticketId);

      Vector expenseColumns = new Vector();

      expenseColumns.addElement("Reference");
      expenseColumns.addElement("Amount");
      expenseColumns.addElement("Created");
      expenseColumns.addElement("Creator");

      ExpenseList expenselist = new ExpenseList();

      String searchExpenseString =
        "ADVANCE:select expense.ExpenseID,expense.Amount,expense.Created,entity.name as Reference ,expense.Status, concat(individual.firstname,' ',individual.lastname) as Creator,individual.IndividualID "
          + "from expense left outer join individual on expense.creator = individual.individualid left outer join entity on expense.entityid = entity.entityid "
          + " where expense.linestatus != 'deleted'  and expense.ticket="
          + ticketId
          + " group by expense.ExpenseID,expense.Amount,expense.Created,Reference ,expense.Status, Creator";

      expenselist = (ExpenseList)lg.getExpenseList(individualId, 1, 200, searchExpenseString, "Reference"); //called when the request for the list is for first time
      expenselist = setExpenseLinks(expenselist, ticketId);

      request.setAttribute("closeDate", tVO.getCloseDate());
      request.setAttribute("openDate", tVO.getCreatedOn());
      request.setAttribute("modifyDate", tVO.getModifiedOn());
      request.setAttribute("threadlist", threadList);
      request.setAttribute("filelist", fileList);
      request.setAttribute("OCStatus", tVO.getOCStatus());
      request.setAttribute("timesliplist", timesliplist);
      request.setAttribute("timeSlipColumns", timeSlipColumns);
      request.setAttribute("expenselist", expenselist);
      request.setAttribute("expenseColumns", expenseColumns);

      dynaForm.setId(new Integer(tVO.getId()).toString());
      dynaForm.setSubject(tVO.getTitle());
      dynaForm.setDetail(tVO.getDetail());
      dynaForm.setStatus(new Integer(tVO.getStatusId()).toString());
      dynaForm.setPriority(new Integer(tVO.getPriorityId()).toString());
      dynaForm.setEntityid(new Integer(tVO.getRefEntityId()).toString());
      dynaForm.setAssignedto(tVO.getAssignedToName());
      dynaForm.setAssignedtoid(new Integer(tVO.getAssignedToId()).toString());
      dynaForm.setContact(tVO.getRefIndividualName());
     
      EntityVO entityVO = tVO.getEntityVO();
      if (entityVO != null) {
        String entityName = entityVO.getName();
        dynaForm.setEntityname(entityName);
        AddressVO primaryAdd = entityVO.getPrimaryAddress();
       
        if (primaryAdd != null) {
          String address = "";
          if (primaryAdd.getStreet1() != null && !primaryAdd.getStreet1().equals("")) {
            address += primaryAdd.getStreet1();
          }
          if (primaryAdd.getStreet2() != null && !primaryAdd.getStreet2().equals("")) {
            address +=", "+ primaryAdd.getStreet2()+"\n";
          } else {
            address += "\n";
          }
          if (primaryAdd.getCity() != null && !primaryAdd.getCity().equals("")) {
            address += primaryAdd.getCity();
          }
          if (primaryAdd.getStateName() != null && !primaryAdd.getStateName().equals("")) {
            address += ", "+ primaryAdd.getStateName();
          }
          if (primaryAdd.getZip() != null && !primaryAdd.getZip().equals("")) {
            address += " "+ primaryAdd.getZip();
          }
          if (primaryAdd.getCountryName() != null && !primaryAdd.getCountryName().equals("")) {
            address += ", "+ primaryAdd.getCountryName();
          }
          dynaForm.setAddress(address);
          if (primaryAdd.getWebsite() != null) {
            dynaForm.setWebsite(primaryAdd.getWebsite());
          }
        }
       
        Collection mocList = entityVO.getMOC();
        Iterator iterator = mocList.iterator();
        while (iterator.hasNext()) {
          MethodOfContactVO moc  = (MethodOfContactVO) iterator.next();
          if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) // this is for email
          {
            dynaForm.setEmail(moc.getContent());
          } else if (moc.getMocType() == 4) {
            dynaForm.setPhone(moc.getContent());
          }
        }
      }

      dynaForm.setContactid(new Integer(tVO.getRefIndividualId()).toString());
      dynaForm.setManagername(tVO.getManagerName() );
      dynaForm.setManagerid(new Integer(tVO.getManagerId()).toString());

System.out.println("dynaForm = [" + dynaForm + "]");

      FORWARD_final = FORWARD_newticket;
      request.setAttribute(SupportConstantKeys.TYPEOFSUBMODULE, "Ticket");
View Full Code Here

Examples of com.centraview.support.ticket.TicketVO

    return thVO;
  }

  public TicketVO getTicketBasicRelations(int userId, int ticketId) throws TicketException, AuthorizationFailedException
  {
    TicketVO tv = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      TicketLocalHome home = (TicketLocalHome) ic.lookup("local/Ticket");
      TicketLocal remote = home.create();
      remote.setDataSource(this.dataSource);
View Full Code Here

Examples of com.centraview.support.ticket.TicketVO

    }
  }

  public TicketVO getTicketBasic(int userId, int ticketId)
  {
    TicketVO tv = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      TicketLocalHome home = (TicketLocalHome) ic.lookup("local/Ticket");
      TicketLocal remote = home.create();
      remote.setDataSource(this.dataSource);
View Full Code Here

Examples of com.centraview.support.ticket.TicketVO

              ticketID = Integer.parseInt(tempTicketID);
            }
          }

          if (ticketID == 0) {
            TicketVO ticketVO = new TicketVO();
            ticketVO.setTitle(messageSubject);
            ticketVO.setDetail(plainMessageBody.getPlainText());
            ticketVO.setPriorityId(1);
            ticketVO.setStatusId(1);
            ticketVO.setCreatedBy(ownerID);

            HashMap contactInfo = contactHelperRemote.getContactInfoForEmailAddress(messageFrom);

            int assignedId = 0;
            int entityId = 0;
            int individualId = 0;

            if (strAssignedID != null && !strAssignedID.equals("")) {
              try {
                assignedId = Integer.parseInt(strAssignedID);
              } catch(NumberFormatException nfe){
                // already set a default value
              }
            }

            if (contactInfo != null && contactInfo.size() != 0) {
              entityId = ((Number) contactInfo.get("EntityID")).intValue();
              individualId = ((Number) contactInfo.get("IndividualID")).intValue();
            }else{
              // initialize thread vo
              ThreadVO tVO = new ThreadVO();
              tVO.setTitle(messageFrom+": "+messageSubject);
              tVO.setDetail("");
              tVO.setPriorityId(1);
              tVO.setCreatedBy(ownerID);
              tVO.setOwner(ownerID);

              ticketVO.setThreadVO(tVO);
            } // end of else if (contactInfo != null && contactInfo.size() != 0)

            ticketVO.setAssignedToId(assignedId);
            ticketVO.setRefEntityId(entityId);
            ticketVO.setRefIndividualId(individualId);

            defaultMessageBody = ticketTemplateForm.getBody();
            String ticketSubject = ticketTemplateForm.getSubject();

            try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.