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: package edu.iu.uis.eden.docsearch;
18:
19: import java.util.ArrayList;
20: import java.util.List;
21: import java.util.Map;
22:
23: import edu.iu.uis.eden.lookupable.Field;
24: import edu.iu.uis.eden.lookupable.Row;
25: import edu.iu.uis.eden.routetemplate.WorkflowAttributeValidationError;
26:
27: public class TestXMLSearchableAttributeLong implements
28: SearchableAttribute {
29:
30: private static final long serialVersionUID = 1309952222293029643L;
31:
32: public static final String SEARCH_STORAGE_KEY = "testLongKey";
33: public static final Long SEARCH_STORAGE_VALUE = new Long(123456);
34:
35: public String getSearchContent() {
36: return "TestXMLSearchableAttributeLong";
37: }
38:
39: public List<SearchableAttributeValue> getSearchStorageValues(
40: String docContent) {
41: List<SearchableAttributeValue> savs = new ArrayList<SearchableAttributeValue>();
42: SearchableAttributeLongValue sav = new SearchableAttributeLongValue();
43: sav.setSearchableAttributeKey(SEARCH_STORAGE_KEY);
44: sav.setSearchableAttributeValue(SEARCH_STORAGE_VALUE);
45: savs.add(sav);
46: return savs;
47: }
48:
49: public List<Row> getSearchingRows() {
50: List fields = new ArrayList();
51: Field myField = new Field("title", "", "", false,
52: SEARCH_STORAGE_KEY, "", null, "");
53: myField.setFieldDataType((new SearchableAttributeLongValue())
54: .getAttributeDataType());
55: fields.add(myField);
56: Row row = new Row(fields);
57: List<Row> rows = new ArrayList<Row>();
58: rows.add(row);
59: return rows;
60: }
61:
62: public List<WorkflowAttributeValidationError> validateUserSearchInputs(
63: Map<Object, String> paramMap) {
64: List<WorkflowAttributeValidationError> waves = new ArrayList<WorkflowAttributeValidationError>();
65: // WorkflowAttributeValidationError wave = new WorkflowAttributeValidationError("key1", "message1");
66: // waves.add(wave);
67: return waves;
68: }
69: }
|