Exemplo n.º 1
0
  public void addQuestions() {
    getAddList().clear();
    setDisplayAddQuestions(true);
    List<Integer> artifactList = new ArrayList<Integer>();
    artifactList.add(getSelCheckList().getAuditDataStandardArtefact().getSartId());
    try {
      // setQuestList(checklistService.searchQuestions(auditStdId,
      // auditTypeId, artifactList));
      List<Object[]> data =
          getChecklistService()
              .searchQuestionsforVersion(
                  getSelCheckList().getAuditMasterStandard().getPkAuditStdId(),
                  getSelCheckList().getAuditMasterType().getPkAuditTypeId(),
                  artifactList);
      setQuestList(data);
      for (Object[] arr : data) {
        System.out.println("questionid: " + arr[0]);
        System.out.println("text: " + arr[1]);
        System.out.println("lookfor: " + arr[2]);
        System.out.println("name: " + arr[3]);
        System.out.println("auditType: " + arr[4]);
      }

    } catch (AuditGeneralException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    List<Integer> currQues = new ArrayList<Integer>();
    for (AuditDataQuestion ques : getQlist()) {
      currQues.add(ques.getPkQuestionId());
    }

    if (getQuestList().size() > 1) {

      for (Object[] objArr : getQuestList()) {
        if (currQues.contains(objArr[0]) == false) {
          getAddList().add(objArr);
        }
      }
    }
    System.out.println("Size of addlist ::" + getAddList().size());
  }
Exemplo n.º 2
0
  @PostConstruct
  public void init() {
    LOGGER.info("Initializing");
    try {
      setLeadAuditorlist(getChecklistService().getAllLAs());
    } catch (AuditGeneralException e1) {
      LOGGER.error(e1.getMessage());
    }
    try {

      auditCheckId = (Integer) servletContext.getAttribute("auditId");
      selCheckList = getChklstSelService().getselectCheckList(auditCheckId);
      if (null != selCheckList) {

        setSelectedValue(selCheckList.getCheckName());
        setDisplayTable(true);
        qlist = getChklstSelService().getChklistQuestions(selCheckList.getPkCheckId());
        setValidColKeys(chklstSelService.getDynamicColumns(selCheckList));
        for (String str : getValidColKeys()) {
          if (getColumnTemplate().length() <= 1) {
            columnTemplate = columnTemplate.concat(str);
          } else {
            columnTemplate = columnTemplate.concat("-").concat(str);
          }
        }
        System.out.println("Vcolumn Template" + columnTemplate);
        createDynamicColumns();
        RequestContext.getCurrentInstance().update(":selChklstForm:tablePanel");
      } else {
        checklists = getChklstSelService().listBaselinedCheckLists();
        rejectedChecklists = getChklstSelService().getVersionedRejectedCheckLists();
        getAllChecklists().addAll(checklists);
        getAllChecklists().addAll(rejectedChecklists);
        setCreateSelectFS(true);
        setEditSelectFS(true);
      }
    } catch (Exception e) {
      LOGGER.error(e.getMessage());
    }
    LOGGER.info("Initialized");
  }