Package com.centraview.support.ticket

Examples of com.centraview.support.ticket.ThreadVO


   
    try {
      HttpSession session = request.getSession();
      int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
      DynaActionForm dynaForm = (DynaActionForm)form;
      ThreadVO tVO = new ThreadVO();

      tVO.setTitle(dynaForm.get("title").toString());
      tVO.setTicketId(Integer.parseInt(request.getParameter("ticketId")));
      tVO.setPriorityId(Integer.parseInt((dynaForm.get("priority")).toString()));
      tVO.setDetail((String)dynaForm.get("threaddetail"));
      tVO.setCreatedBy(individualId);
      tVO.setOwner(individualId);

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


      int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();

      SupportFacadeHome sfh = (SupportFacadeHome)CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome", "SupportFacade");
      SupportFacade remote = (SupportFacade)sfh.create();
      remote.setDataSource(dataSource);
      ThreadVO tVO = null;
     
      if (request.getParameter("rowId") != null) {
        tVO = remote.getThread(individualId, Integer.parseInt(request.getParameter("rowId")));
      } 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) {
              dynaForm.set("createdby", tVO.getCreatedByVO().getFirstName() + " " + tVO.getCreatedByVO().getLastName());
            }
            dynaForm.set("createdbyid", new Integer(tVO.getCreatedBy()).toString());
            dynaForm.set("createddate", tVO.getCreatedOn().toString());

            if (tVO.getModifiedOn() != null) {
              dynaForm.set("modifieddate", tVO.getModifiedOn().toString());
            }
          }
          request.setAttribute(SupportConstantKeys.TYPEOFSUBMODULE, "Ticket");
          FORWARD_final = FORWARD_vieweditthread;
        }
View Full Code Here

    return returnCode;
  }

  public ThreadVO getThread(int userId, int threadId)
  {
    ThreadVO thVO = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      TicketLocalHome home = (TicketLocalHome) ic.lookup("local/Ticket");
      TicketLocal remote = home.create();
      ctx.getUserTransaction().begin();
View Full Code Here

            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 {
              ticketID = ticketRemote.addTicket(ownerID, ticketVO);
            }catch(Exception e){
              defaultMessageBody = errorTemplateForm.getBody();
            }// end of catch block

            messageSubject = ticketSubject+"-["+messageSubject+"] TICKET#"+ticketID+"#";
            int arrBlank[] = {};
            authRemote.saveRecordPermission(ownerID,-1,"Ticket",ticketID,arrBlank,arrBlank,arrBlank);
          }else{
            // initialize thread vo
            ThreadVO tVO = new ThreadVO();
            tVO.setTitle(messageSubject);
            tVO.setDetail(plainMessageBody.getPlainText());
            tVO.setTicketId(ticketID);
            tVO.setPriorityId(1);
            tVO.setCreatedBy(ownerID);
            tVO.setOwner(ownerID);

            defaultMessageBody = threadTemplateForm.getBody();

            try {
              ticketRemote.addThread(ownerID, tVO);
View Full Code Here

TOP

Related Classes of com.centraview.support.ticket.ThreadVO

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.