1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.docsearch;
17
18 import java.math.BigInteger;
19 import java.util.ArrayList;
20 import java.util.Collections;
21 import java.util.List;
22
23 import org.kuali.rice.core.api.data.DataType;
24 import org.kuali.rice.core.api.uif.RemotableAttributeError;
25 import org.kuali.rice.core.api.uif.RemotableAttributeField;
26 import org.kuali.rice.kew.api.document.DocumentWithContent;
27 import org.kuali.rice.kew.api.document.attribute.DocumentAttribute;
28 import org.kuali.rice.kew.api.document.attribute.DocumentAttributeFactory;
29 import org.kuali.rice.kew.api.document.attribute.WorkflowAttributeDefinition;
30 import org.kuali.rice.kew.api.document.search.DocumentSearchCriteria;
31 import org.kuali.rice.kew.api.extension.ExtensionDefinition;
32 import org.kuali.rice.kew.framework.document.attribute.SearchableAttribute;
33
34 public class TestXMLSearchableAttributeLong implements SearchableAttribute {
35
36 private static final long serialVersionUID = 1309952222293029643L;
37
38 public static final String SEARCH_STORAGE_KEY = "testLongKey";
39 public static final BigInteger SEARCH_STORAGE_VALUE = BigInteger.valueOf(123456);
40
41 @Override
42 public String generateSearchContent(ExtensionDefinition extensionDefinition,
43 String documentTypeName,
44 WorkflowAttributeDefinition attributeDefinition) {
45 return "TestXMLSearchableAttributeLong";
46 }
47
48 @Override
49 public List<DocumentAttribute> extractDocumentAttributes(ExtensionDefinition extensionDefinition,
50 DocumentWithContent documentWithContent) {
51 List<DocumentAttribute> savs = new ArrayList<DocumentAttribute>();
52 savs.add(DocumentAttributeFactory.createIntegerAttribute(SEARCH_STORAGE_KEY, SEARCH_STORAGE_VALUE));
53 return savs;
54 }
55
56 @Override
57 public List<RemotableAttributeField> getSearchFields(ExtensionDefinition extensionDefinition,
58 String documentTypeName) {
59 List<RemotableAttributeField> fields = new ArrayList<RemotableAttributeField>();
60 RemotableAttributeField.Builder builder = RemotableAttributeField.Builder.create(SEARCH_STORAGE_KEY);
61 builder.setLongLabel("title");
62 builder.setDataType(DataType.INTEGER);
63 fields.add(builder.build());
64 return fields;
65 }
66
67 @Override
68 public List<RemotableAttributeError> validateDocumentAttributeCriteria(ExtensionDefinition extensionDefinition,
69 DocumentSearchCriteria documentSearchCriteria) {
70 return Collections.emptyList();
71 }
72
73 }