Package com.centraview.valuelist

Examples of com.centraview.valuelist.ValueListRow


    parameters.setColumns(columns);
    // results is an arraylist of arraylists, it needs to be converted to an arraylist of ValueListRows
    ArrayList results = reportResults.getResults();
    ArrayList list = new ArrayList();
    for (int j = 0; j < results.size(); j++) {
      list.add(new ValueListRow(j, (ArrayList)results.get(j)));
    }
    ValueListVO valueList = new ValueListVO(list, parameters);
    ValueListDisplay displayParameters = new ValueListDisplay(new ArrayList(), false, false, false, false, false, false);
    valueList.setDisplay(displayParameters);
    request.setAttribute("valueList", valueList);
View Full Code Here


      } else {
        odd = true;
      }

      buffer.append("<tr>\n");
      ValueListRow row = (ValueListRow) list.get(i);
      List rowData = row.getRowData();

      // if this is an Entity list, and we're looking at the Default entity
      // record (id == 1), highlight the row
      if (listType == 1 && row.getRowId() == 1) { // sorry 'bout the magic
                                                  // numbers
        rowClass = "defaultEntityRow";
      }

      if (this.listObject.getDisplay().isCheckboxes() && !this.listObject.getLookupType().equals("SecurityProfile")) {
        if (this.listObject.getParameters().getValueListType() == ValueListConstants.KNOWLEDGEBASE_LIST_TYPE
            || this.listObject.getParameters().getValueListType() == ValueListConstants.FILE_LIST_TYPE) {
          this.addCheckBox(buffer, row.getRowId(), odd, rowClass, rowData, ValueListConstants.FILE_INDEX);
        } else {
          this.addCheckBox(buffer, row.getRowId(), odd, rowClass, null, 0);
        }
      }

      // If the selection widgets are radio boxes instead of the checkboxes
      // (as when the list is a lookup), then we must do the following things:
      if (this.listObject.getDisplay().isRadio()) {
        // Added the selected index value to the javascript function so that it
        // will populate the form
        Integer listTypeInteger = new Integer(this.listObject.getParameters().getValueListType());
        ArrayList radioSelectionIndexList = (ArrayList) ValueListConstants.RADIO_SELECTION_MAP.get(listTypeInteger);
        StringBuffer onSelectParameters = new StringBuffer();
        StringBuffer onRowValues = new StringBuffer();
        onSelectParameters.append("'");
        Iterator thisIndexIterator = radioSelectionIndexList.iterator();
        String typeOfLookup = (String) thisIndexIterator.next();
        String radioType = "radio";

        // This is a special Condition. We have to set the correct lookup type,
        // so that we will make the correct selection of values
        if (this.listObject.getLookupType() != null && this.listObject.getLookupType().equals("lookup_attendee")) {
          typeOfLookup = "lookup_attendee";
          ArrayList radioSelectionIndexAttendee = ValueListConstants.radioSelectedIndexAttendee;

          for (int k = 0; k < radioSelectionIndexAttendee.size(); k++) {
            int currentIndex = ((Integer) radioSelectionIndexAttendee.get(k)).intValue();
            String fieldValue = String.valueOf(rowData.get(currentIndex - 1));

            if (currentIndex == ValueListConstants.ATTENDEEROWID) {
              onRowValues.append(fieldValue + "&");
            } else if (currentIndex == ValueListConstants.ATTENDEEFIRSTNAME) {
              onRowValues.append(fieldValue + " ");
            } else {
              onRowValues.append(fieldValue);
            }
          }
        }

        if (this.listObject.getLookupType() != null && this.listObject.getLookupType().equals("lookupSubItem")) {
          typeOfLookup = "SubItem";
        }

        // First snag the lookupType string from the front of the arrayList.
        onSelectParameters.append(typeOfLookup);
        onSelectParameters.append("','");

        while (thisIndexIterator.hasNext()) {
          int currentIndex = ((Integer) thisIndexIterator.next()).intValue();
          String fieldValue = String.valueOf(rowData.get(currentIndex - 1));

          if (fieldValue != null) {
            Pattern pattern = Pattern.compile("[^a-zA-z_0-9 ]");
            Matcher fieldMatch = pattern.matcher(fieldValue);
            fieldValue = fieldMatch.replaceAll("");
            // fieldValue = fieldValue.replaceAll("'","");
          }

          if (fieldValue == null || fieldValue.equals("null")) {
            fieldValue = "";
          }

          onSelectParameters.append(fieldValue);

          if (thisIndexIterator.hasNext()) {
            onSelectParameters.append("','");
          }
        }
        onSelectParameters.append("'");

        if (this.listObject.getDisplay().isRadioToCheckBox()) {
          radioType = "checkbox";
        }

        boolean flagRadio = true;
        String folderType = null;

        if (listTypeInteger.intValue() == ValueListConstants.FILE_LIST_TYPE) {
          folderType = rowData.get(ValueListConstants.KB_FILE_EMAIL_HACK_INDEX - 1).toString();

          if (folderType != null && folderType.equals("FOLDER")) {
            flagRadio = false;
          }
        }

        if (flagRadio) {
          this.addRadio(buffer, row.getRowId(), onSelectParameters.toString(), onRowValues.toString(), radioType, rowClass);
        }
      }

      if (this.listObject.getLookupType().equals("SecurityProfile")) {
        this.addCheckBox(buffer, row.getRowId(), odd, rowClass, rowData, ValueListConstants.SECURITY_PROFILE);
      }

      if (this.listObject.getDisplay().isIcon()) {
        if (this.listObject.getParameters().getValueListType() == ValueListConstants.EMAIL_LIST_TYPE) {
          this.addIcon(buffer, rowData, ValueListConstants.EMAIL_ICON, rowClass);
        } else if (this.listObject.getParameters().getValueListType() == ValueListConstants.KNOWLEDGEBASE_LIST_TYPE
            || this.listObject.getParameters().getValueListType() == ValueListConstants.FILE_LIST_TYPE) {
          this.addIcon(buffer, rowData, ValueListConstants.KB_FILE_EMAIL_HACK_INDEX, rowClass);
        } else {
          this.addIcon(buffer, rowData, ValueListConstants.ICON_INDEX, rowClass);
        }
      }

      if (this.listObject.getDisplay().isAttachmentIcon()) {
        this.addAttachmentIcon(buffer, rowData, ValueListConstants.ATTACHMENT_ICON, rowClass);
      }

      if (this.listObject.getDisplay().isPriority()) {
        this.addPriorityIcon(buffer, rowData, ValueListConstants.PRIORITY_ICON, rowClass);
      }

      if (this.listObject.getDisplay().isDownloadIcon()) {
        this.addDownloadIcon(buffer, rowData, ValueListConstants.DOWNLOAD_ICON, rowClass);
      }

      // readStatus is NO, that means we haven't read this message
      // we will apply the different Style to it
      if (readStatus != null && readStatus.equals("NO")) {
        rowClass = rowClass + "Bold";
      }

      Iterator selectedIterator = this.selectedColumns.iterator();

      while (selectedIterator.hasNext()) {
        int index = ((Integer) selectedIterator.next()).intValue();
        Object columnData = null;

        // If this a an email lookup list we need extra checkboxes on the front.
        if (this.listObject.isLookup() && this.listObject.getLookupType().equals("Email")) {
          switch (index) {
            case ValueListConstants.TO_INDEX:
            case ValueListConstants.CC_INDEX:
            case ValueListConstants.BCC_INDEX:
              this.addCheckBox(buffer, row.getRowId(), odd, rowClass, rowData, index);
              continue;
          }
        }

        if (index - 1 > rowData.size() || index - 1 < 0) { // Out of bounds,
View Full Code Here

      while (it.hasNext()) {
        String rowId = (String)it.next();
        ArrayList rows = (ArrayList)listObject.getList();
        Iterator iter = rows.iterator();
        while (iter.hasNext()) {
          ValueListRow vlr = (ValueListRow)iter.next();
          if (vlr.getRowId() == Integer.parseInt(rowId)) {
            userList.add(vlr.getRowData().get(2));
          }
        }
        if (userList != null && !userList.isEmpty()) {
          request.setAttribute("usersNotDeleted", userList);
        }
View Full Code Here

        ArrayList rowList = new ArrayList();
        for (int i = 1; i <= columnCount; i++) {
          Object valueString = resultSet.getObject(i);
          rowList.add(valueString);
        }
        results.add(new ValueListRow(rowId, rowList));
      }
    } catch(Exception e) {
      logger.error("[executeQueryList] The Query: "+this.sqlString);
      logger.error("[executeQueryList] Exception thrown.", e);
    } finally { // clean up the resultset resources, it's your heap too!
View Full Code Here

TOP

Related Classes of com.centraview.valuelist.ValueListRow

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.