View Javadoc

1   /**
2    * Copyright 2005-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.license.keyvalue;
17  
18  import org.kuali.ole.license.bo.OleLicenseRequestLocation;
19  import org.kuali.ole.license.bo.OleLicenseRequestStatus;
20  import org.kuali.rice.core.api.util.ConcreteKeyValue;
21  import org.kuali.rice.core.api.util.KeyValue;
22  import org.kuali.rice.krad.keyvalues.KeyValuesBase;
23  import org.kuali.rice.krad.service.KRADServiceLocator;
24  
25  import java.util.ArrayList;
26  import java.util.Collection;
27  import java.util.List;
28  
29  /**
30   * OleLicenseRequestLocationKeyValues is the value finder class for OleLicenseRequestLocation
31   */
32  public class OleLicenseRequestLocationKeyValues extends KeyValuesBase {
33  
34      private boolean blankOption;
35  
36      /**
37       *  Gets the blankOption attribute.
38       * @return  Returns the blankOption
39       */
40      public boolean isBlankOption() {
41          return this.blankOption;
42      }
43  
44      /**
45       * Sets the blankOption attribute value.
46       * @param blankOption The blankOption to set.
47       */
48      public void setBlankOption(boolean blankOption) {
49          this.blankOption = blankOption;
50      }
51  
52      /**
53       *  Gets the keyValues attribute.
54       * @return  Returns the keyValues
55       */
56      @Override
57      public List getKeyValues() {
58          List<KeyValue> keyValues = new ArrayList<KeyValue>();
59          Collection<OleLicenseRequestLocation> licenseRequestCodes = KRADServiceLocator.getBusinessObjectService().findAll(OleLicenseRequestLocation.class);
60          keyValues.add(new ConcreteKeyValue("", ""));
61          for (OleLicenseRequestLocation licenseRequestCode : licenseRequestCodes) {
62              keyValues.add(new ConcreteKeyValue(licenseRequestCode.getId(), licenseRequestCode.getName()));
63          }
64          return keyValues;
65      }
66  
67  }