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.agreement.bo.OleAgreementMethod;
19  import org.kuali.rice.core.api.util.ConcreteKeyValue;
20  import org.kuali.rice.core.api.util.KeyValue;
21  import org.kuali.rice.krad.keyvalues.KeyValuesBase;
22  import org.kuali.rice.krad.service.KRADServiceLocator;
23  
24  import java.util.ArrayList;
25  import java.util.Collection;
26  import java.util.List;
27  
28  /**
29   * OleAgreementMethodKeyValues is the value finder class for OleAgreementMethod Maintenance Document
30   */
31  public class OleAgreementMethodKeyValues extends KeyValuesBase {
32  
33      private boolean blankOption;
34  
35      /**
36       *  Gets the blankOption attribute.
37       * @return  Returns the blankOption
38       */
39      public boolean isBlankOption() {
40          return this.blankOption;
41      }
42  
43      /**
44       * Sets the blankOption attribute value.
45       * @param blankOption The blankOption to set.
46       */
47      public void setBlankOption(boolean blankOption) {
48          this.blankOption = blankOption;
49      }
50  
51      /**
52       *  Gets the keyValues attribute.
53       * @return  Returns the keyValues
54       */
55      @Override
56      public List getKeyValues() {
57          List<KeyValue> keyValues = new ArrayList<KeyValue>();
58          Collection<OleAgreementMethod> oleAgreementMethodCollection = KRADServiceLocator.getBusinessObjectService().findAll(OleAgreementMethod.class);
59          keyValues.add(new ConcreteKeyValue("", ""));
60          for (OleAgreementMethod oleAgreementMethod : oleAgreementMethodCollection) {
61              keyValues.add(new ConcreteKeyValue(oleAgreementMethod.getAgreementMethodName(), oleAgreementMethod.getAgreementMethodName()));
62          }
63          return keyValues;
64      }
65  
66  }