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