/**
  * Constructs the list of Proposal Narrative Statuses. Each entry in the list is a <key,
  * value> pair, where the "key" is the unique status code and the "value" is the textual
  * description that is viewed by a user. The list is obtained from the NARRATIVE_STATUS database
  * table via the "KeyValueFinderService".
  *
  * @return the list of <key, value> pairs of abstract types. The first entry is always
  *     <"", "select:">.
  * @see org.kuali.rice.kns.lookup.keyvalues.KeyValuesFinder#getKeyValues()
  */
 public List<KeyLabelPair> getKeyValues() {
   KeyValuesService keyValuesService =
       (KeyValuesService) KraServiceLocator.getService("keyValuesService");
   Collection<NarrativeStatus> statuses = keyValuesService.findAll(NarrativeStatus.class);
   List<KeyLabelPair> keyValues = new ArrayList<KeyLabelPair>();
   for (NarrativeStatus status : statuses) {
     keyValues.add(new KeyLabelPair(status.getNarrativeStatusCode(), status.getDescription()));
   }
   return keyValues;
 }
Ejemplo n.º 2
0
  /**
   * Returns code/description pairs of all Item Types.
   *
   * @see org.kuali.rice.kns.lookup.keyvalues.KeyValuesFinder#getKeyValues()
   */
  public List getKeyValues() {
    KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
    Collection codes = boService.findAll(ItemType.class);
    List labels = new ArrayList();
    for (Object code : codes) {
      ItemType it = (ItemType) code;
      // exclude certain item types from the list
      if (it.isLineItemIndicator()
          && !PurapConstants.ItemTypeCodes.EXCLUDED_ITEM_TYPES.contains(it.getItemTypeCode())) {
        labels.add(new KeyLabelPair(it.getItemTypeCode(), it.getItemTypeDescription()));
      }
    }

    return labels;
  }