01: /*
02: * Copyright 2005-2007 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: // Created on Mar 20, 2007
18: package edu.iu.uis.eden.docsearch;
19:
20: import java.util.ArrayList;
21: import java.util.List;
22: import java.util.Map;
23:
24: import edu.iu.uis.eden.lookupable.Field;
25: import edu.iu.uis.eden.lookupable.Row;
26: import edu.iu.uis.eden.routeheader.DocumentRouteHeaderValue;
27: import edu.iu.uis.eden.routetemplate.WorkflowAttributeValidationError;
28:
29: public class MockSearchableAttribute implements SearchableAttribute {
30:
31: public String getSearchContent() {
32: return "MockSearchableAttribute Search Content";
33: }
34:
35: public List<SearchableAttributeValue> getSearchStorageValues(
36: String docContent) {
37: List<SearchableAttributeValue> savs = new ArrayList<SearchableAttributeValue>();
38: SearchableAttributeValue sav = new SearchableAttributeStringValue();
39: sav.setRouteHeader(new DocumentRouteHeaderValue());
40: sav.setSearchableAttributeKey("MockSearchableAttributeKey");
41: sav.setupAttributeValue("MockSearchableAttributeValue");
42: savs.add(sav);
43: return savs;
44: }
45:
46: public List<Row> getSearchingRows() {
47: List fields = new ArrayList();
48: Field myField = new Field("title", "", "", false,
49: "MockSearchableAttributeKey", "", null, "");
50: myField.setFieldDataType((new SearchableAttributeStringValue())
51: .getAttributeDataType());
52: fields.add(myField);
53: Row row = new Row(fields);
54: List<Row> rows = new ArrayList<Row>();
55: rows.add(row);
56: return rows;
57: }
58:
59: public List<WorkflowAttributeValidationError> validateUserSearchInputs(
60: Map<Object, String> paramMap) {
61: return new ArrayList<WorkflowAttributeValidationError>(0);
62: }
63: }
|