Exemplo n.º 1
0
 @Override
 public List getKeyValues() {
   KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
   Collection codes = boService.findAll(OleCategory.class);
   List labels = new ArrayList();
   labels.add(new ConcreteKeyValue("", ""));
   labels.add(new ConcreteKeyValue("percentage", OLEConstants.PERCENTAGE));
   labels.add(new ConcreteKeyValue("Hash", OLEConstants.HASH));
   return labels;
 }
  /** @see org.kuali.rice.kns.lookup.keyvalues.KeyValuesFinder#getKeyValues() */
  public List getKeyValues() {
    KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
    Collection codes = boService.findAll(ClassCodeType.class);
    List labels = new ArrayList();

    labels.add(new ConcreteKeyValue("", ""));
    for (Iterator iter = codes.iterator(); iter.hasNext(); ) {
      ClassCodeType classCodeType = (ClassCodeType) iter.next();
      labels.add(new ConcreteKeyValue(classCodeType.getCode(), classCodeType.getName()));
    }

    return labels;
  }
Exemplo n.º 3
0
  /*
   * @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues()
   */
  public List getKeyValues() {

    KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
    Collection codes = boService.findAll(ShippingTitle.class);
    List labels = new ArrayList();
    labels.add(new ConcreteKeyValue("", ""));
    for (Iterator iter = codes.iterator(); iter.hasNext(); ) {
      ShippingTitle st = (ShippingTitle) iter.next();
      labels.add(
          new ConcreteKeyValue(
              st.getVendorShippingTitleCode(), st.getVendorShippingTitleDescription()));
    }

    return labels;
  }
Exemplo n.º 4
0
  /*
   * @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues()
   */
  public List getKeyValues() {

    KeyValuesService boService = SpringContext.getBean(KeyValuesService.class);
    Collection codes = boService.findAll(AddressType.class);
    List labels = new ArrayList();
    labels.add(new ConcreteKeyValue("", ""));
    for (Iterator iter = codes.iterator(); iter.hasNext(); ) {
      AddressType AddressType = (AddressType) iter.next();
      labels.add(
          new ConcreteKeyValue(
              AddressType.getVendorAddressTypeCode(),
              AddressType.getVendorAddressTypeDescription()));
    }

    return labels;
  }
 /**
  * Constructs the list of Proposal Abstract Types. Each entry in the list is a <key, value>
  * pair, where the "key" is the unique type code and the "value" is the textual description that
  * is viewed by a user. The list is obtained from the Abstract Type database table via the
  * "keyValuesService". The intent of this method is to provide a list which is viewed in a GUI. As
  * such, the first entry in the list is the generic <"", "select:"> option.
  *
  * <p>The list is also filtered based upon the abstracts currently in the proposal development
  * document. Users are not allowed to create two or more abstracts with the same abstract type.
  * Therefore, if an abstract type is already being used, it is removed from the list. If the
  * document cannot be found, the entire list is returned (it is not filtered).
  *
  * @return the list of &lt;key, value&gt; pairs of abstract types. The first entry is always
  *     &lt;"", "select:"&gt;.
  * @see org.kuali.rice.krad.keyvalues.KeyValuesFinder#getKeyValues()
  */
 @Override
 public List<KeyValue> getKeyValues() {
   ProposalDevelopmentDocument doc = (ProposalDevelopmentDocument) getDocument();
   KeyValuesService keyValuesService =
       (KeyValuesService) KraServiceLocator.getService("keyValuesService");
   Collection<AbstractType> abstractTypes = keyValuesService.findAll(AbstractType.class);
   List<KeyValue> keyValues = new ArrayList<KeyValue>();
   keyValues.add(new ConcreteKeyValue("", "select"));
   for (AbstractType abstractType : abstractTypes) {
     if (!hasAbstract(doc, abstractType)) {
       keyValues.add(
           new ConcreteKeyValue(
               abstractType.getAbstractTypeCode(), abstractType.getDescription()));
     }
   }
   return keyValues;
 }
 /**
  * Searches for all awards with the same award id and grabs all sequence numbers for that award
  * returning the sequence number as both the key and the value for the pair.
  *
  * @return the list of &lt;key, value&gt; pairs of the current award sequence numbers
  * @see org.kuali.rice.krad.keyvalues.KeyValuesFinder#getKeyValues()
  */
 @Override
 public List<KeyValue> getKeyValues() {
   AwardDocument doc = (AwardDocument) getDocument();
   String awardNumber = doc.getAward().getAwardNumber();
   KeyValuesService keyValuesService =
       (KeyValuesService) KcServiceLocator.getService("keyValuesService");
   Map<String, Object> idMatch = new HashMap<String, Object>();
   idMatch.put("awardNumber", awardNumber);
   Collection<Award> awards = keyValuesService.findMatching(Award.class, idMatch);
   List<Integer> sortedList = new ArrayList<Integer>();
   for (Award award : awards) {
     sortedList.add(award.getSequenceNumber());
   }
   Collections.sort(sortedList, Collections.reverseOrder());
   List<KeyValue> keyValues = new ArrayList<KeyValue>();
   for (Integer num : sortedList) {
     keyValues.add(new ConcreteKeyValue(num.toString(), num.toString()));
   }
   return keyValues;
 }
  @Override
  public List<KeyValue> getKeyValues() {

    if (subModuleCodes == null) {
      List<KeyValue> labels = new ArrayList<KeyValue>();
      labels.add(new ConcreteKeyValue("0", "select"));
      if (StringUtils.isNotBlank(moduleCode)) {
        KeyValuesService boService = KNSServiceLocator.getKeyValuesService();
        Map<String, Object> fieldValues = new HashMap<String, Object>();
        fieldValues.put("moduleCode", moduleCode);
        Collection<CoeusSubModule> codes =
            (Collection<CoeusSubModule>) boService.findMatching(CoeusSubModule.class, fieldValues);
        for (CoeusSubModule coeusSubModule : codes) {
          labels.add(
              new ConcreteKeyValue(
                  coeusSubModule.getSubModuleCode(), coeusSubModule.getDescription()));
        }
      }
      subModuleCodes = labels;
    }
    return subModuleCodes;
  }