Package com.agiletec.plugins.jpwtt.aps.system.services.ticket.model

Examples of com.agiletec.plugins.jpwtt.aps.system.services.ticket.model.TicketSearchBean


  public Map<Integer, String> getPriorities() {
    return this.getTicketManager().getPriorities();
  }
 
  protected ITicketSearchBean prepareSearchBean() {
    TicketSearchBean searchBean = new TicketSearchBean();
    searchBean.setMessage(this.getMessage());
    searchBean.setAuthor(this.getAuthor());
    Integer status = this.getStatus();
    if (status!=null) {
      searchBean.setStates(new int[] { this.getStatus().intValue() });
    }
    searchBean.setPriority(this.getPriority());
    searchBean.setUserInterventionType(this.getUserInterventionType());
    searchBean.setAssignedInterventionType(this.getAssignedInterventionType());
    Boolean resolved = (this.getResolved()==null) ? null : (new Boolean(this.getResolved().intValue()==1));
    searchBean.setResolved(resolved);
    return searchBean;
  }
View Full Code Here


      Ticket t4 = this._helper.createTicket("code4", new Date(), null, "message4", "pageManagerCustomers",
          1, 0, "editorCustomers", null, Ticket.STATES_WORKING, new Date(), true);
      this._ticketDAO.addTicket(t4);

      // message = 'message2'
      TicketSearchBean searchBean = this._helper.createSearchBean("message2", null, null, null, null, null, null, null, null);
      List<String> ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code2" }, ticketIds);

      // Tutti i message
      searchBean.setMessage("ess");
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code1", "code2", "code3", "code4" }, ticketIds);

      // author = 'mainEditor'
      searchBean.setAuthor("mainEditor");
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code1", "code3" }, ticketIds);

      // author = 'mainEditor', operator = 'editorCustomers'
      searchBean.setOperator("editorCustomers");
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code3" }, ticketIds);

      // operator = 'editorCustomers', priority = 0, status = { DISPATCHED, OPENED }
      searchBean.setAuthor(null);
      searchBean.setPriority(0);
      searchBean.setStates(new int[] { Ticket.STATES_WORKING, Ticket.STATES_OPENED });
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code4" }, ticketIds);

      // operator = 'editorCustomers', priority = 0
      searchBean.setStates(null);
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code4" }, ticketIds);

      // priority = 0, wttRoles = { }
      searchBean.setOperator(null);
      searchBean.setWttRoles(new String[] { "pageManager" });
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code1" }, ticketIds);

      // priority = 0
      searchBean.setOperator(null);
      searchBean.setWttRoles(new String[] { });
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code1", "code4" }, ticketIds);

      // priority = 0, userInterventionType = 0, assignedInterventionType = 1
      searchBean.setUserInterventionType(0);
      searchBean.setAssignedInterventionType(1);
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code1" }, ticketIds);

      // userInterventionType = 1
      searchBean.setPriority(null);
      searchBean.setUserInterventionType(1);
      searchBean.setAssignedInterventionType(null);
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code2", "code4" }, ticketIds);

      // userInterventionType = 1, resolved = true
      searchBean.setResolved(new Boolean(true));
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code4" }, ticketIds);

      // userInterventionType = 1, resolved = false
      searchBean.setResolved(new Boolean(false));
      ticketIds = this._ticketDAO.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { "code2" }, ticketIds);
    } catch (Throwable t) {
      throw t;
    } finally {
View Full Code Here

    return operation;
  }

  public TicketSearchBean createSearchBean(String message, String author, String operator, String[] wttRoles,
      int[] states, Integer priority, Integer userInterventionType, Integer opInterventionType, Boolean resolved) {
    TicketSearchBean searchBean = new TicketSearchBean();
    searchBean.setMessage(message);
    searchBean.setAuthor(author);
    searchBean.setOperator(operator);
    searchBean.setWttRoles(wttRoles);
    searchBean.setStates(states);
    searchBean.setPriority(priority);
    searchBean.setUserInterventionType(userInterventionType);
    searchBean.setAssignedInterventionType(opInterventionType);
    searchBean.setResolved(resolved);
    return searchBean;
  }
View Full Code Here

      Ticket t4 = this._helper.createTicket("code4", new Date(), null, "message4", "pageManagerCustomers",
          1, 0, "editorCustomers", null, Ticket.STATES_WORKING, new Date(), true);
      this._ticketManager.addTicket(t4);

      // subject = 'subject2'
      TicketSearchBean searchBean = this._helper.createSearchBean("message2", null, null, null, null, null, null, null, null);
      List<String> ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t2.getCode() }, ticketIds);

      // Tutti i subject
      searchBean.setMessage("ess");
      ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t1.getCode(), t2.getCode(), t3.getCode(), t4.getCode() }, ticketIds);

      // author = 'mainEditor'
      searchBean.setAuthor("mainEditor");
      ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t1.getCode(), t3.getCode() }, ticketIds);

      // author = 'mainEditor', operator = 'editorCustomers'
      searchBean.setOperator("editorCustomers");
      ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t3.getCode() }, ticketIds);

      // operator = 'editorCustomers', priority = 0, status = RESOLVED
      searchBean.setAuthor(null);
      searchBean.setPriority(0);
      searchBean.setStates(new int[] { Ticket.STATES_WORKING });
      ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t4.getCode() }, ticketIds);

      // operator = 'editorCustomers', priority = 0
      searchBean.setStates(null);
      ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t4.getCode() }, ticketIds);

      // priority = 0
      searchBean.setOperator(null);
      ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t1.getCode(), t4.getCode() }, ticketIds);

      // priority = 0, interventionType = 1
      searchBean.setUserInterventionType(1);
      ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t4.getCode() }, ticketIds);

      // interventionType = 1
      searchBean.setPriority(null);
      ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t2.getCode(), t4.getCode() }, ticketIds);

      // interventionType = 1, resolved = true
      searchBean.setResolved(new Boolean(true));
      ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t4.getCode() }, ticketIds);

      // interventionType = 1, resolved = false
      searchBean.setResolved(new Boolean(false));
      ticketIds = this._ticketManager.searchTicketIds(searchBean);
      this.verifyTicketIds(new String[] { t2.getCode() }, ticketIds);
    } catch (Throwable t) {
      throw t;
    } finally {
View Full Code Here

    List<String> ticketIds = null;
    try {
      if (this.isAdmin().booleanValue()) {
        return super.getTicketIds();
      } else {
        TicketSearchBean searchBean = (TicketSearchBean) this.prepareSearchBean();
        Integer status = this.getStatus();
        if (status!=null) {
          int statusInt = status.intValue();
          switch (statusInt) {
            case Ticket.STATES_ASSIGNABLE:
View Full Code Here

    return ticketIds;
  }
 
  @Override
  protected ITicketSearchBean prepareSearchBean() {
    TicketSearchBean searchBean = (TicketSearchBean) super.prepareSearchBean();
    searchBean.setOperator(this.getOperator());
    return searchBean;
  }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpwtt.aps.system.services.ticket.model.TicketSearchBean

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.