01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in
05: * compliance with the License. You may obtain a copy of the License at
06: *
07: * http://www.opensource.org/licenses/ecl1.php
08: *
09: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS
10: * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
11: * language governing permissions and limitations under the License.
12: */
13: package org.kuali.core.lookup.keyvalues;
14:
15: import java.util.ArrayList;
16: import java.util.List;
17:
18: import org.kuali.core.service.KualiConfigurationService;
19: import org.kuali.core.web.ui.KeyLabelPair;
20: import org.kuali.rice.KNSServiceLocator;
21:
22: public class ApcValuesFinder extends KeyValuesBase {
23:
24: private String parameterName;
25: private String parameterDetailType;
26: private String parameterNamespace;
27:
28: public String getParameterNamespace() {
29: return this .parameterNamespace;
30: }
31:
32: public void setParameterNamespace(String parameterNamespace) {
33: this .parameterNamespace = parameterNamespace;
34: }
35:
36: public ApcValuesFinder() {
37: super ();
38: }
39:
40: public ApcValuesFinder(String parameterNamesapce,
41: String parameterDetailType, String parameterName) {
42: super ();
43: this .parameterNamespace = parameterNamespace;
44: this .parameterDetailType = parameterDetailType;
45: this .parameterName = parameterName;
46: }
47:
48: public String getParameterName() {
49: return parameterName;
50: }
51:
52: public void setParameterName(String parameterName) {
53: this .parameterName = parameterName;
54: }
55:
56: public List getKeyValues() {
57: KualiConfigurationService configService = KNSServiceLocator
58: .getKualiConfigurationService();
59: List activeLabels = new ArrayList();
60: activeLabels.add(new KeyLabelPair("", ""));
61: for (String parm : configService.getParameterValues(
62: parameterNamespace, parameterDetailType, parameterName)) {
63: activeLabels.add(new KeyLabelPair(parm, parm));
64: }
65: return activeLabels;
66: }
67:
68: public String getParameterDetailType() {
69: return this .parameterDetailType;
70: }
71:
72: public void setParameterDetailType(String parameterDetailType) {
73: this.parameterDetailType = parameterDetailType;
74: }
75:
76: }
|