View Javadoc

1   package org.kuali.ole.select.keyvalue;
2   
3   import org.kuali.ole.select.bo.OleLicenseRequestStatus;
4   import org.kuali.rice.core.api.util.ConcreteKeyValue;
5   import org.kuali.rice.core.api.util.KeyValue;
6   import org.kuali.rice.krad.keyvalues.KeyValuesBase;
7   import org.kuali.rice.krad.service.KRADServiceLocator;
8   import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
9   import org.kuali.rice.krad.service.LookupService;
10  
11  import java.util.ArrayList;
12  import java.util.Collection;
13  import java.util.List;
14  
15  /**
16   * OleLicenseRequestStatusKeyValues is the value finder class for the LicenseRequestStatus in the License Request Document
17   */
18  public class OleLicenseRequestStatusKeyValues extends KeyValuesBase {
19      private boolean blankOption;
20  
21      /**
22       * Gets the blankOption attribute.
23       *
24       * @return Returns the blankOption
25       */
26      public boolean isBlankOption() {
27          return this.blankOption;
28      }
29  
30      /**
31       * Sets the blankOption attribute value.
32       *
33       * @param blankOption The blankOption to set.
34       */
35      public void setBlankOption(boolean blankOption) {
36          this.blankOption = blankOption;
37      }
38  
39      /**
40       * Gets the keyValues attribute.
41       *
42       * @return Returns the keyValues
43       */
44      @Override
45      public List getKeyValues() {
46          List<KeyValue> keyValues = new ArrayList<KeyValue>();
47          Collection<OleLicenseRequestStatus> licenseRequestStatus = KRADServiceLocator.getBusinessObjectService().findAll(OleLicenseRequestStatus.class);
48          keyValues.add(new ConcreteKeyValue("", ""));
49          for (OleLicenseRequestStatus licenseRequestStatusObj : licenseRequestStatus) {
50              keyValues.add(new ConcreteKeyValue(licenseRequestStatusObj.getName(), licenseRequestStatusObj.getName()));
51          }
52          return keyValues;
53      }
54  
55      private LookupService getLookupService() {
56          return KRADServiceLocatorWeb.getLookupService();
57      }
58  }
59