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.math.BigDecimal;
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 TestXMLSearchableAttributeFloat implements 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("123456.3456");
35
36 public String getSearchContent(DocumentSearchContext documentSearchContext) {
37 return "TestXMLSearchableAttributeFloat";
38 }
39
40 public List<SearchableAttributeValue> getSearchStorageValues(DocumentSearchContext documentSearchContext) {
41 List<SearchableAttributeValue> savs = new ArrayList<SearchableAttributeValue>();
42 SearchableAttributeFloatValue sav = new SearchableAttributeFloatValue();
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(DocumentSearchContext documentSearchContext) {
50 List<Field> fields = new ArrayList<Field>();
51 Field myField = new Field(SEARCH_STORAGE_KEY,"title");
52 myField.setFieldDataType((new SearchableAttributeFloatValue()).getAttributeDataType());
53 fields.add(myField);
54 Row row = new Row(fields);
55 List<Row> rows = new ArrayList<Row>();
56 rows.add(row);
57 return rows;
58 }
59
60 public List<WorkflowAttributeValidationError> validateUserSearchInputs(Map<Object, Object> paramMap, DocumentSearchContext documentSearchContext) {
61 List<WorkflowAttributeValidationError> waves = new ArrayList<WorkflowAttributeValidationError>();
62
63
64 return waves;
65 }
66 }