01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.docsearch;
18:
19: import java.io.Serializable;
20: import java.util.Arrays;
21: import java.util.List;
22: import java.util.Map;
23:
24: import edu.iu.uis.eden.lookupable.Row;
25: import edu.iu.uis.eden.routetemplate.WorkflowAttributeValidationError;
26:
27: /**
28: * SearchableAttribute must implement this interface
29: *
30: * @author Bryan Hutchinson
31: */
32: public interface SearchableAttribute extends Serializable {
33:
34: public static final String SEARCH_WILDCARD_CHARACTER = "*";
35: public static final String SEARCH_WILDCARD_CHARACTER_REGEX_ESCAPED = "\\"
36: + SEARCH_WILDCARD_CHARACTER;
37:
38: public static final String DATA_TYPE_STRING = "string";
39: public static final String DATA_TYPE_DATE = "datetime";
40: public static final String DATA_TYPE_LONG = "long";
41: public static final String DATA_TYPE_FLOAT = "float";
42:
43: public static final String DEFAULT_SEARCHABLE_ATTRIBUTE_TYPE_NAME = DATA_TYPE_STRING;
44:
45: public static final String DEFAULT_RANGE_SEARCH_LOWER_BOUND_LABEL = "From";
46: public static final String DEFAULT_RANGE_SEARCH_UPPER_BOUND_LABEL = "To";
47:
48: public static final String RANGE_LOWER_BOUND_PROPERTY_PREFIX = "rangeLowerBoundKeyPrefix_";
49: public static final String RANGE_UPPER_BOUND_PROPERTY_PREFIX = "rangeUpperBoundKeyPrefix_";
50:
51: public static final List SEARCHABLE_ATTRIBUTE_BASE_CLASS_LIST = Arrays
52: .asList(new Class[] { SearchableAttributeStringValue.class,
53: SearchableAttributeFloatValue.class,
54: SearchableAttributeLongValue.class,
55: SearchableAttributeDateTimeValue.class });
56:
57: /**
58: * this gives the xml representation of the attribute;
59: * returning a standard java xml object might be a better approach here
60: *
61: * @return
62: */
63: public String getSearchContent();
64:
65: /**
66: * this will return the loaded data objects for storage in workflow’s database
67: * to be related to the document the attributes xml content was loaded with
68: * @return
69: */
70: public List<SearchableAttributeValue> getSearchStorageValues(
71: String docContent);
72:
73: /**
74: * this will return a list of field objects to be rendered in the docsearch interface
75: * @return
76: */
77: public List<Row> getSearchingRows();
78:
79: /**
80: * this will return a list of error objects if the user has made an input error
81: * @return
82: */
83: public List<WorkflowAttributeValidationError> validateUserSearchInputs(
84: Map<Object, String> paramMap);
85: }
|