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 edu.iu.uis.eden.docsearch.SearchAttributeCriteriaComponent;
22: import edu.iu.uis.eden.docsearch.StandardDocumentSearchResultProcessor;
23: import edu.iu.uis.eden.lookupable.Column;
24:
25: public abstract class PurApDocumentSearchResultProcessor extends
26: StandardDocumentSearchResultProcessor {
27:
28: private static final String DOC_SEARCH_RESULTS_STANDARD_WORKFLOW = "workflow_standard";
29: private static final String DOC_SEARCH_RESULTS_CUSTOM_DOCUMENT_INFO = "document_info";
30:
31: /**
32: * @see edu.iu.uis.eden.docsearch.StandardDocumentSearchResultProcessor#getShowAllStandardFields()
33: */
34: @Override
35: public boolean getShowAllStandardFields() {
36: if (searchUsingDocumentInformationResults()) {
37: return false;
38: }
39: return true;
40: }
41:
42: /**
43: * @see edu.iu.uis.eden.docsearch.StandardDocumentSearchResultProcessor#getOverrideSearchableAttributes()
44: */
45: @Override
46: public boolean getOverrideSearchableAttributes() {
47: return true;
48: }
49:
50: /**
51: * @see edu.iu.uis.eden.docsearch.StandardDocumentSearchResultProcessor#getCustomDisplayColumns()
52: */
53: @Override
54: public List<Column> getCustomDisplayColumns() {
55: List<Column> columns = new ArrayList<Column>();
56: if (searchUsingDocumentInformationResults()) {
57: columns = getDocumentSpecificCustomColumns();
58: }
59: return columns;
60: }
61:
62: public abstract List<Column> getDocumentSpecificCustomColumns();
63:
64: private boolean searchUsingDocumentInformationResults() {
65: SearchAttributeCriteriaComponent displayCriteria = getSearchableAttributeByFieldName("displayType");
66: return ((displayCriteria != null) && (DOC_SEARCH_RESULTS_CUSTOM_DOCUMENT_INFO
67: .equals(displayCriteria.getValue())));
68: }
69:
70: }
|