View Javadoc

1   /*
2    * Copyright 2013 The Kuali Foundation.
3    *
4    * Licensed under the Educational Community License, Version 1.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/ecl1.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.select.businessobject.options;
17  
18  import org.kuali.ole.sys.OLEConstants;
19  import org.kuali.rice.core.api.util.ConcreteKeyValue;
20  import org.kuali.rice.kew.doctype.ApplicationDocumentStatus;
21  import org.kuali.rice.kew.doctype.bo.DocumentType;
22  import org.kuali.rice.kew.service.KEWServiceLocator;
23  import org.kuali.rice.krad.keyvalues.KeyValuesBase;
24  
25  import java.util.ArrayList;
26  import java.util.List;
27  
28  public class OleOrderQueueRequisitionStatusValuesFinder extends KeyValuesBase {
29  
30      private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
31              .getLogger(OleOrderQueueRequisitionStatusValuesFinder.class);
32  
33      @Override
34      public List getKeyValues() {
35          LOG.debug("Inside getKeyValues of OleOrderQueueRequisitionStatusValuesFinder");
36          DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findByNameCaseInsensitive(
37                  OLEConstants.OHQ_REQUISITION_STATUS);
38          List<ApplicationDocumentStatus> applicationDocumentStatus = documentType.getValidApplicationStatuses();
39          List labels = new ArrayList();
40          labels.add(new ConcreteKeyValue("", ""));
41          for (ApplicationDocumentStatus status : applicationDocumentStatus) {
42              labels.add(new ConcreteKeyValue(status.getStatusName(), status.getStatusName()));
43          }
44          return labels;
45      }
46  
47  }