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.util.ArrayList;
20 import java.util.List;
21 import java.util.Map;
22
23 import org.kuali.rice.kew.rule.WorkflowAttributeValidationError;
24 import org.kuali.rice.kns.web.ui.Field;
25 import org.kuali.rice.kns.web.ui.Row;
26
27
28 public class TestXMLSearchableAttributeLong implements 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(DocumentSearchContext documentSearchContext) {
36 return "TestXMLSearchableAttributeLong";
37 }
38
39 public List<SearchableAttributeValue> getSearchStorageValues(DocumentSearchContext documentSearchContext) {
40 List<SearchableAttributeValue> savs = new ArrayList<SearchableAttributeValue>();
41 SearchableAttributeLongValue sav = new SearchableAttributeLongValue();
42 sav.setSearchableAttributeKey(SEARCH_STORAGE_KEY);
43 sav.setSearchableAttributeValue(SEARCH_STORAGE_VALUE);
44 savs.add(sav);
45 return savs;
46 }
47
48 public List<Row> getSearchingRows(DocumentSearchContext documentSearchContext) {
49 List<Field> fields = new ArrayList<Field>();
50 Field myField = new Field(SEARCH_STORAGE_KEY,"title");
51 myField.setFieldDataType((new SearchableAttributeLongValue()).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(Map<Object, Object> paramMap, DocumentSearchContext documentSearchContext) {
60 List<WorkflowAttributeValidationError> waves = new ArrayList<WorkflowAttributeValidationError>();
61
62
63 return waves;
64 }
65 }