Coverage Report - org.kuali.rice.kew.impl.type.KewTypeOptionsFinder
 
Classes in this File Line Coverage Branch Coverage Complexity
KewTypeOptionsFinder
0%
0/7
0%
0/4
3
 
 1  
 /**
 2  
  * Copyright 2005-2011 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.rice.kew.impl.type;
 17  
 
 18  
 import org.kuali.rice.core.api.util.ConcreteKeyValue;
 19  
 import org.kuali.rice.core.api.util.KeyValue;
 20  
 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
 21  
 import org.kuali.rice.krad.service.KRADServiceLocator;
 22  
 import org.kuali.rice.krad.uif.control.UifKeyValuesFinderBase;
 23  
 import org.kuali.rice.krad.uif.view.View;
 24  
 import org.kuali.rice.krad.uif.view.ViewModel;
 25  
 
 26  
 import java.util.ArrayList;
 27  
 import java.util.Collection;
 28  
 import java.util.List;
 29  
 
 30  
 /**
 31  
  * Builds options list for all active {@link KewTypeBo} records
 32  
  *
 33  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 34  
  */
 35  0
 public class KewTypeOptionsFinder extends UifKeyValuesFinderBase {
 36  
 
 37  
     @Override
 38  
     public List<KeyValue> getKeyValues(ViewModel model) {
 39  0
         List<KeyValue> kewTypes = new ArrayList<KeyValue>();
 40  
 
 41  0
         Collection<KewTypeBo> kewTypeBos = KRADServiceLocator.getBusinessObjectService().findAllOrderBy(KewTypeBo.class,
 42  
                 "namespace", true);
 43  0
         for (KewTypeBo typeBo : kewTypeBos) {
 44  0
             if (typeBo.isActive()) {
 45  0
                 kewTypes.add(new ConcreteKeyValue(typeBo.getId(), typeBo.getNamespace() + " - " + typeBo.getName()));
 46  
             }
 47  
         }
 48  
 
 49  0
         return kewTypes;
 50  
     }
 51  
 }