Package org.kuali.rice.kew.docsearch.xml
Class StandardGenericXMLSearchableAttribute
java.lang.Object
org.kuali.rice.kew.docsearch.xml.StandardGenericXMLSearchableAttribute
- All Implemented Interfaces:
org.kuali.rice.kew.framework.document.attribute.SearchableAttribute
- Direct Known Subclasses:
KualiXmlSearchableAttributeImpl
public class StandardGenericXMLSearchableAttribute
extends Object
implements org.kuali.rice.kew.framework.document.attribute.SearchableAttribute
Implementation of a
SearchableAttribute whose configuration is driven from XML.
XML configuration must be supplied in the ExtensionDefinition configuration parameter KewApiConstants.ATTRIBUTE_XML_CONFIG_DATA.
Parsing of XML search configuration and generation of XML search content proceeds in an analogous fashion to StandardGenericXMLRuleAttribute.
Namely, if an searchingConfig/xmlSearchContentelement is provided, its content is used as a template. Otherwise a standard XML template is used. This template is parameterized with variables of the notation
%name%which are resolved by
searchingConfig/fieldDef[@name]definitions. The XML content is not validated, but it must be well formed. Example 1:
<searchingConfig>
<fieldDef name="def1" ...other attrs/>
... other config
</fieldDef>
<fieldDef name="def2" ...other attrs/>
... other config
</fieldDef>
</searchingConfig>
Produces, when supplied with the workflow definition parameters: { def1: val1, def2: val2 }:
<xmlRouting>
<field name="def1"><value>val1</value></field>
<field name="def2"><value>val2</value></field>
</xmlRouting>
Example 2:
<searchingConfig>
<xmlSearchContent>
<myGeneratedContent>
<version>whatever</version>
<anythingIWant>Once upon a %def1%...</anythingIWant>
<conclusion>Happily ever %def2%.</conclusion>
</myGeneratedContent>
</xmlSearchContent>
<fieldDef name="def1" ...other attrs/>
... other config
</fieldDef=>
<fieldDef name="def2" ...other attrs/>
... other config
</fieldDef>
</searchingConfig>
Produces, when supplied with the workflow definition parameters: { def1: val1, def2: val2 }:
<myGeneratedContent>
<version>whatever</version>
<anythingIWant>Once upon a val1...</anythingIWant>
<conclusion>Happily ever val2.</conclusion>
</myGeneratedContent>
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractDocumentAttributes(ExtensionDefinition extensionDefinition, DocumentWithContent documentWithContent) generateSearchContent(ExtensionDefinition extensionDefinition, String documentTypeName, WorkflowAttributeDefinition attributeDefinition) protected ElementgetConfigXML(ExtensionDefinition extensionDefinition) getSearchFields(ExtensionDefinition extensionDefinition, String documentTypeName) validateDocumentAttributeCriteria(ExtensionDefinition extensionDefinition, DocumentSearchCriteria documentSearchCriteria)
-
Constructor Details
-
StandardGenericXMLSearchableAttribute
public StandardGenericXMLSearchableAttribute()
-
-
Method Details
-
generateSearchContent
public String generateSearchContent(ExtensionDefinition extensionDefinition, String documentTypeName, WorkflowAttributeDefinition attributeDefinition) - Specified by:
generateSearchContentin interfaceorg.kuali.rice.kew.framework.document.attribute.SearchableAttribute
-
extractDocumentAttributes
public List<DocumentAttribute> extractDocumentAttributes(ExtensionDefinition extensionDefinition, DocumentWithContent documentWithContent) - Specified by:
extractDocumentAttributesin interfaceorg.kuali.rice.kew.framework.document.attribute.SearchableAttribute
-
getSearchFields
public List<RemotableAttributeField> getSearchFields(ExtensionDefinition extensionDefinition, String documentTypeName) - Specified by:
getSearchFieldsin interfaceorg.kuali.rice.kew.framework.document.attribute.SearchableAttribute
-
validateDocumentAttributeCriteria
public List<RemotableAttributeError> validateDocumentAttributeCriteria(ExtensionDefinition extensionDefinition, DocumentSearchCriteria documentSearchCriteria) - Specified by:
validateDocumentAttributeCriteriain interfaceorg.kuali.rice.kew.framework.document.attribute.SearchableAttribute
-
getConfigXML
-