| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kew.rule.bo; |
| 17 | |
|
| 18 | |
import java.util.ArrayList; |
| 19 | |
import java.util.Collections; |
| 20 | |
import java.util.List; |
| 21 | |
|
| 22 | |
import org.kuali.rice.core.util.ConcreteKeyValue; |
| 23 | |
import org.kuali.rice.core.util.KeyValue; |
| 24 | |
import org.kuali.rice.kew.api.action.DelegationType; |
| 25 | |
import org.kuali.rice.kew.util.KEWConstants; |
| 26 | |
import org.kuali.rice.kns.util.KNSGlobalVariables; |
| 27 | |
import org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm; |
| 28 | |
import org.kuali.rice.krad.keyvalues.KeyValuesBase; |
| 29 | |
import org.kuali.rice.krad.util.GlobalVariables; |
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | 0 | public class DelegationTypeValuesFinder extends KeyValuesBase { |
| 37 | |
|
| 38 | |
private static final List<KeyValue> C_DELEGATION_TYPES; |
| 39 | |
private static final List<KeyValue> C_DELEGATION_TYPES_FOR_MAIN_DOCS; |
| 40 | |
static { |
| 41 | |
|
| 42 | 0 | final List<KeyValue> delegationTypes = new ArrayList<KeyValue>(); |
| 43 | 0 | final List<KeyValue> delegationTypesForMaintDocs = new ArrayList<KeyValue>(); |
| 44 | |
|
| 45 | 0 | for (DelegationType delegationType : DelegationType.values()) { |
| 46 | 0 | delegationTypes.add(new ConcreteKeyValue(delegationType.getCode(), delegationType.getLabel())); |
| 47 | 0 | delegationTypesForMaintDocs.add(new ConcreteKeyValue(delegationType.getCode(), delegationType.getLabel())); |
| 48 | |
} |
| 49 | |
|
| 50 | 0 | delegationTypes.add(new ConcreteKeyValue(KEWConstants.DELEGATION_BOTH, KEWConstants.DELEGATION_BOTH_LABEL)); |
| 51 | |
|
| 52 | 0 | C_DELEGATION_TYPES = Collections.unmodifiableList(delegationTypes); |
| 53 | 0 | C_DELEGATION_TYPES_FOR_MAIN_DOCS = Collections.unmodifiableList(delegationTypesForMaintDocs); |
| 54 | 0 | } |
| 55 | |
|
| 56 | |
@Override |
| 57 | |
public List<KeyValue> getKeyValues() { |
| 58 | |
|
| 59 | 0 | return (KNSGlobalVariables.getKualiForm() instanceof KualiMaintenanceForm) ? C_DELEGATION_TYPES_FOR_MAIN_DOCS : C_DELEGATION_TYPES; |
| 60 | |
} |
| 61 | |
|
| 62 | |
} |