1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.kew.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 org.kuali.rice.kew.rule.WorkflowAttributeValidationError;
25 import org.kuali.rice.kns.web.ui.Field;
26 import org.kuali.rice.kns.web.ui.Row;
27
28
29 public class TestXMLSearchableAttributeDateTime implements 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("1173995646535"));
35 public static final Timestamp SEARCH_STORAGE_VALUE = new Timestamp(SEARCH_STORAGE_VALUE_IN_MILLS.longValue());
36
37 public String getSearchContent(DocumentSearchContext documentSearchContext) {
38 return "TestXMLSearchableAttributeDateTime";
39 }
40
41 public List<SearchableAttributeValue> getSearchStorageValues(DocumentSearchContext documentSearchContext) {
42 List<SearchableAttributeValue> savs = new ArrayList<SearchableAttributeValue>();
43 SearchableAttributeDateTimeValue sav = new SearchableAttributeDateTimeValue();
44 sav.setSearchableAttributeKey(SEARCH_STORAGE_KEY);
45 sav.setSearchableAttributeValue(SEARCH_STORAGE_VALUE);
46 savs.add(sav);
47 return savs;
48 }
49
50 public List<Row> getSearchingRows(DocumentSearchContext documentSearchContext) {
51 List fields = new ArrayList();
52 Field myField = new Field(SEARCH_STORAGE_KEY,"title");
53 myField.setColumnVisible(true);
54 myField.setFieldDataType((new SearchableAttributeDateTimeValue()).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(Map<Object, Object> paramMap, DocumentSearchContext documentSearchContext) {
63 List<WorkflowAttributeValidationError> waves = new ArrayList<WorkflowAttributeValidationError>();
64
65
66 return waves;
67 }
68 }