01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.workflow.module.purap.docsearch;
17:
18: import java.util.ArrayList;
19: import java.util.List;
20:
21: import org.kuali.core.service.DataDictionaryService;
22: import org.kuali.kfs.KFSPropertyConstants;
23: import org.kuali.kfs.context.SpringContext;
24: import org.kuali.module.chart.bo.Org;
25:
26: /**
27: * This class...
28: */
29: public class RequisitionDocSearchGenerator extends
30: PurApDocumentSearchGenerator {
31: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
32: .getLogger(RequisitionDocSearchGenerator.class);
33:
34: /**
35: * @see org.kuali.workflow.module.purap.docsearch.KualiPurApDocumentSearchGenerator#getErrorMessageForNonSpecialUserInvalidCriteria()
36: */
37: @Override
38: public String getErrorMessageForNonSpecialUserInvalidCriteria() {
39: String chartCodeLabel = SpringContext.getBean(
40: DataDictionaryService.class).getAttributeLabel(
41: Org.class, KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE);
42: String orgCodeLabel = SpringContext.getBean(
43: DataDictionaryService.class).getAttributeLabel(
44: Org.class, KFSPropertyConstants.ORGANIZATION_CODE);
45: return "User must enter a valid " + chartCodeLabel
46: + " and a valid " + orgCodeLabel;
47: }
48:
49: /**
50: * @see org.kuali.workflow.module.purap.docsearch.KualiPurApDocumentSearchGenerator#getGeneralSearchUserRequiredFormFieldNames()
51: */
52: @Override
53: public List<String> getGeneralSearchUserRequiredFormFieldNames() {
54: List<String> fieldNames = new ArrayList<String>();
55: fieldNames.add("purapDocumentChartOfAccountsCode");
56: fieldNames.add("purapDocumentOrganizationCode");
57: return fieldNames;
58: }
59:
60: /**
61: * @see org.kuali.workflow.module.purap.docsearch.KualiPurApDocumentSearchGenerator#getSearchAttributeFormFieldNamesToIgnore()
62: */
63: @Override
64: public List<String> getSearchAttributeFormFieldNamesToIgnore() {
65: List<String> fieldNames = new ArrayList<String>();
66: fieldNames.add("displayType");
67: return fieldNames;
68: }
69:
70: /**
71: * @see org.kuali.workflow.module.purap.docsearch.KualiPurApDocumentSearchGenerator#getSpecificSearchCriteriaFormFieldNames()
72: */
73: @Override
74: public List<String> getSpecificSearchCriteriaFormFieldNames() {
75: List<String> fieldNames = new ArrayList<String>();
76: fieldNames.add("requisitionDocumentRequisitionId");
77: // doc id should be in list but is standard workflow field
78: fieldNames.add("requisitionDocumentRequestorName");
79: fieldNames.add("requisitionDocumentDeliverToName");
80: fieldNames.add("purapDocumentChartOfAccountsCode");
81: fieldNames.add("purapDocumentOrganizationCode");
82: fieldNames.add("requisitionDocumentOrganizationReference1Text");
83: fieldNames.add("requisitionDocumentOrganizationReference2Text");
84: fieldNames.add("requisitionDocumentOrganizationReference3Text");
85: return fieldNames;
86: }
87:
88: }
|