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.math.BigDecimal;
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.routetemplate.WorkflowAttributeValidationError;
27:
28: public class TestXMLSearchableAttributeFloat implements
29: SearchableAttribute {
30:
31: private static final long serialVersionUID = -2656250483031095594L;
32:
33: public static final String SEARCH_STORAGE_KEY = "testFloatKey";
34: public static final BigDecimal SEARCH_STORAGE_VALUE = new BigDecimal(
35: "123456.3456");
36:
37: public String getSearchContent() {
38: return "TestXMLSearchableAttributeFloat";
39: }
40:
41: public List<SearchableAttributeValue> getSearchStorageValues(
42: String docContent) {
43: List<SearchableAttributeValue> savs = new ArrayList<SearchableAttributeValue>();
44: SearchableAttributeFloatValue sav = new SearchableAttributeFloatValue();
45: sav.setSearchableAttributeKey(SEARCH_STORAGE_KEY);
46: sav.setSearchableAttributeValue(SEARCH_STORAGE_VALUE);
47: savs.add(sav);
48: return savs;
49: }
50:
51: public List<Row> getSearchingRows() {
52: List fields = new ArrayList();
53: Field myField = new Field("title", "", "", false,
54: SEARCH_STORAGE_KEY, "", null, "");
55: myField.setFieldDataType((new SearchableAttributeFloatValue())
56: .getAttributeDataType());
57: fields.add(myField);
58: Row row = new Row(fields);
59: List<Row> rows = new ArrayList<Row>();
60: rows.add(row);
61: return rows;
62: }
63:
64: public List<WorkflowAttributeValidationError> validateUserSearchInputs(
65: Map<Object, String> paramMap) {
66: List<WorkflowAttributeValidationError> waves = new ArrayList<WorkflowAttributeValidationError>();
67: // WorkflowAttributeValidationError wave = new WorkflowAttributeValidationError("key1", "message1");
68: // waves.add(wave);
69: return waves;
70: }
71: }
|