public class OwStandardSearchTemplate extends Object implements OwSearchTemplate
Standard implementation of the search template for FileNet P8 Designer Compatible XML templates.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Modifier and Type | Class and Description |
---|---|
static class |
OwStandardSearchTemplate.OwFieldDefinitionEnumExchangeWrapper |
static class |
OwStandardSearchTemplate.OwOnTheFlySearchFieldDescription
class description for on the fly created search fields
|
class |
OwStandardSearchTemplate.SearchNodeXMLDeserializer
Utility class for criteria deserialize.
|
class |
OwStandardSearchTemplate.SearchNodeXMLSerializer
Serialize a search node in a XML structure.
|
static class |
OwStandardSearchTemplate.SqlOperatorSingleton
SQL operators singleton.
|
Modifier and Type | Field and Description |
---|---|
static String |
LITERAL_PLACEHOLDER_LEFT_DELIMITER
left delimiter of placeholder token
|
static String |
LITERAL_PLACEHOLDER_RIGHT_DELIMITER
right delimiter of placeholder token
|
protected List |
m_ColumnInfoList
the list of the column info tuple, which describe the result view
|
protected Node |
m_ColumnInfoNode
DOM Node with the column info
|
protected OwFieldDefinitionProvider |
m_fieldDefinitionProvider
the field definition provider to resolve the fields
|
protected OwFieldProvider |
m_fieldProvider
field provider from search
|
protected boolean |
m_isWrittableAttributeBagAvailable
flag indicating if the search can be stored in an attribute bag
|
protected int |
m_iVersionSelection
types of versions to search for as defined with OwSearchTemplate.VERSION_SELECT_...
|
protected OwObject |
m_object |
protected Collection |
m_resourceNames
List of resource IDs the fields should be resolved from, or null to use the default resource
|
protected OwSearchNode |
m_Search
the Search created out of the template
|
protected static OwStandardSearchTemplate.SqlOperatorSingleton |
m_SqlOperators
SQL operators singleton
|
protected String |
m_strHtmlLayout
optional HTML layout
|
protected String |
m_strJspLayoutPage
optional JSP layout page
|
protected String |
m_strName
template name
|
VERSION_SELECT_ALL, VERSION_SELECT_CHECKED_OUT, VERSION_SELECT_CURRENT, VERSION_SELECT_DEFAULT, VERSION_SELECT_IN_PROCESS, VERSION_SELECT_MAJORS, VERSION_SELECT_MINORS, VERSION_SELECT_RELEASED
TYPE_AJAX, TYPE_CHECKIN_OBJECT, TYPE_CREATE_OBJECT, TYPE_META_OBJECT, TYPE_RESULT_LIST, TYPE_SEARCH, TYPE_SMALL
Constructor and Description |
---|
OwStandardSearchTemplate(OwNetworkContext context_p,
Node xmlSearchTemplateNode_p,
String strName_p,
String strResourceName_p)
Creates a new search template with the given DOM node
|
OwStandardSearchTemplate(OwNetworkContext context_p,
Node xmlSearchTemplateNode_p,
String strName_p,
String strResourceName_p,
boolean useSearchPaths_p)
Deprecated.
|
OwStandardSearchTemplate(OwNetworkContext context_p,
OwObject obj_p)
Creates a new search template with the given object
NOTE: The syntax of the XML Template is compatible with FileNet P8 Search designer.
|
OwStandardSearchTemplate(OwNetworkContext context_p,
OwObject obj_p,
boolean useSearchPaths_p)
Deprecated.
since 4.0.0.0 use
OwStandardSearchTemplate(OwNetworkContext, OwObject) constructor |
Modifier and Type | Method and Description |
---|---|
boolean |
canDeleteSearch()
check if saved searches can be deleted
|
boolean |
canSaveSearch()
check if searches can be saved
|
boolean |
canUpdateSearch()
check if saved searches can be updated
|
protected int |
convertOperator(String strOperator_p)
Operator conversion utility
|
protected OwSearchNode |
createSearchNode(int iOp_p,
int iNodeType_p)
(overridable) factory method
|
protected OwSearchNode |
createSearchNode(OwFieldDefinition fieldDefinition_p,
int iOp_p,
Object oInitialAndDefaultValue_p,
int iAttributes_p,
String strUniqueName_p,
String strInstruction_p,
Collection wildcarddefinitions_p)
(overridable) factory method
|
protected OwSearchNode |
createSearchNode(OwFieldDefinition fieldDefinition_p,
int iOp_p,
Object oInitialAndDefaultValue_p,
int iAttributes_p,
String strUniqueName_p,
String strInstruction_p,
Collection wildcarddefinitions_p,
Object minValue_p,
Object maxValue_p,
Object defaultValue_p,
String sJavaClassName_p)
(overridable) factory method
|
protected OwSearchNode |
createSearchNode(OwField field_p,
int iOp_p,
int iAttributes_p,
String strUniqueName_p,
String strInstruction_p,
Collection wildcarddefinitions_p)
(overridable) factory method
|
protected OwSearchNode |
createSubclassNode(OwFieldDefinition fieldDefinition_p,
int iOp_p,
Object oInitialAndDefaultValue_p,
int iAttributes_p,
String strUniqueName_p,
String strInstruction_p,
Collection wildcarddefinitions_p,
Object minValue_p,
Object maxValue_p,
Object defaultValue_p,
String sJavaClassName_p)
(overridable)
|
void |
deleteSavedSearch(String name_p)
delete the saved search
|
protected static Node |
getAttributeByName(Node node_p,
String attributeName_p)
Returns the attribute from given node, the method handles the
requested attributes as "required" and throws exception.
|
Collection |
getColumnInfoList()
get the cached list of the column info tuple, which describe the result view
|
protected OwNetworkContext |
getContext()
get a reference to the network context
|
int |
getDefaultMaxSize()
get the default value for the maximum size of results or 0 if not defined
|
String |
getDisplayName(Locale locale_p)
get the template name, MUST be available before calling init
|
OwField |
getField(String strFieldClassName_p)
implementation of the OwFieldProvider interface
get a field with the given field definition class name
|
protected OwFieldDefinition |
getFieldDefinitionProviderField(String strFieldDefinitionName_p,
String strResourceName_p)
(overridable) method for field definition provider based definition creation
|
String |
getFieldProviderName()
get a name that identifies the field provider, can be used to create IDs
|
Object |
getFieldProviderSource()
get the source object that originally provided the fields.
|
int |
getFieldProviderType()
get the type of field provider as defined with TYPE_...
|
Collection |
getFields()
get all the properties in the form
|
String |
getHtmlLayout()
get the optional HTML layout associated with this template
|
String |
getIcon()
get a optional icon to be displayed with the search template, MUST be available before calling init
|
String |
getJspLayoutPage()
get the optional JSP layout page associated with this template
|
String |
getName()
get the template name, MUST be available before calling init
|
protected Map |
getOnTheFlyClassDescriptions()
get the already created on the fly classes
|
OwPriorityRule |
getPriorityRule()
get a priority rule for priority
|
protected OwFieldDefinition |
getPropertyClassInternal(String strClassName_p,
OwXMLUtil node_p)
resolve the requested search field definition or create a on the fly class description
|
Object |
getSafeFieldValue(String sName_p,
Object defaultvalue_p)
retrieve the value of a Field
|
String |
getSavedSearch()
get the name of the current set search, or null if no saved search is set
|
Collection |
getSavedSearches()
get a collection of saved searches names
|
OwSearchNode |
getSearch(boolean fRefresh_p)
get the cached search tree created out of the template
|
protected int |
getSearchAttributeFromNode(Node node_p,
int iDefaultEditAttribute_p)
compute the criteria attributes from a p8 XML node
|
OwSort |
getSort(int iMinSortCriteria_p)
get the sort to use for the result list
|
int |
getVersionSelection()
get the version selection type
|
boolean |
hasHtmlLayout()
check if the optional HTML layout is available
|
boolean |
hasJspLayoutPage()
check if the optional JSP layout page is available
|
void |
init(OwFieldDefinitionProvider fieldDefinitionProvider_p)
init the search template so that the specified fields can be resolved
|
static boolean |
isDocId(String text_p)
check if given text is a doc ID
|
boolean |
isInitalized()
check if search template is already initialized
|
protected boolean |
isOperator(String strOperator_p) |
protected Object |
resolveLiteralPlaceholder(String contextname_p,
String placeholdername_p)
(overridable) resolve the given literal placeholder name to a property / criteria value
|
protected Object |
resolveLiteralValue(String contextname_p,
OwFieldDefinition propClass_p,
Node literal_p)
resolve the given literal node to a property / criteria value
|
void |
saveSearch(String name_p)
save the current search
|
protected void |
scanCustomInfo(Node searchTemplateNode_p)
(overridable) scan search template for additional custom info
|
protected void |
scanResourceNodeEx(OwSearchNode search_p,
Node foldersNode_p,
Node objectstoresNode_p)
Scan the folders and ObjectStore node and
add resource criteria search nodes to the given search node
as defined by AWD 3.0.0.0 search concepts specification.
|
void |
setField(String sName_p,
Object value_p)
modify a Field value, but does not save the value right away
|
void |
setSavedSearch(String name_p)
init the search template with a saved search
|
public static final String LITERAL_PLACEHOLDER_LEFT_DELIMITER
public static final String LITERAL_PLACEHOLDER_RIGHT_DELIMITER
protected static final OwStandardSearchTemplate.SqlOperatorSingleton m_SqlOperators
protected List m_ColumnInfoList
protected Node m_ColumnInfoNode
protected OwFieldDefinitionProvider m_fieldDefinitionProvider
protected OwFieldProvider m_fieldProvider
protected boolean m_isWrittableAttributeBagAvailable
protected int m_iVersionSelection
protected OwObject m_object
protected Collection m_resourceNames
protected OwSearchNode m_Search
protected String m_strHtmlLayout
protected String m_strJspLayoutPage
protected String m_strName
public OwStandardSearchTemplate(OwNetworkContext context_p, Node xmlSearchTemplateNode_p, String strName_p, String strResourceName_p) throws Exception
context_p
- xmlSearchTemplateNode_p
- XML Search Template DOM Node to be wrappedstrName_p
- Name of the searchstrResourceName_p
- name of the resource where the search template originsException
@Deprecated public OwStandardSearchTemplate(OwNetworkContext context_p, Node xmlSearchTemplateNode_p, String strName_p, String strResourceName_p, boolean useSearchPaths_p) throws Exception
Exception
public OwStandardSearchTemplate(OwNetworkContext context_p, OwObject obj_p) throws Exception
context_p
- obj_p
- Exception
public OwStandardSearchTemplate(OwNetworkContext context_p, OwObject obj_p, boolean useSearchPaths_p) throws Exception
OwStandardSearchTemplate(OwNetworkContext, OwObject)
constructorcontext_p
- obj_p
- useSearchPaths_p
- if true the OwSearchPathField
criteria will be used for search pathsException
protected static Node getAttributeByName(Node node_p, String attributeName_p) throws OwException
node_p
- org.w3c.dom.Node where to retrieve attribute, (non-null)attributeName_p
- String attribute name to retrieve (non-null)OwException
- if node_p or attributeName_p is null
, or attribute not existpublic static boolean isDocId(String text_p)
text_p
- public boolean canDeleteSearch()
canDeleteSearch
in interface OwSearchTemplate
public boolean canSaveSearch()
OwSearchTemplate
canSaveSearch
in interface OwSearchTemplate
public boolean canUpdateSearch()
canUpdateSearch
in interface OwSearchTemplate
protected int convertOperator(String strOperator_p) throws OwConfigurationException
strOperator_p
- the search template defined operator (egg. "in", "eq").OwConfigurationException
- if the operator can not be convertedprotected OwSearchNode createSearchNode(int iOp_p, int iNodeType_p)
iOp_p
- combination operator which should be applied to the child OwSearchNode elements as defined in OwSearchNodeiNodeType_p
- the type of the branch can be one of the NODE_TYPE_... definitionprotected OwSearchNode createSearchNode(OwField field_p, int iOp_p, int iAttributes_p, String strUniqueName_p, String strInstruction_p, Collection wildcarddefinitions_p) throws Exception
field_p
- OwField criteria as fieldiOp_p
- criteria operator which should be applied to the value as defined in OwSearchCriteriaiAttributes_p
- int attributes as defined with ATTRIBUTE_...strUniqueName_p
- String a unique name that identifies this criteriastrInstruction_p
- String instruction to be displayed, can be nullwildcarddefinitions_p
- Collection of OwWildCardDefinition, or null if no wildcards are allowedException
protected OwSearchNode createSearchNode(OwFieldDefinition fieldDefinition_p, int iOp_p, Object oInitialAndDefaultValue_p, int iAttributes_p, String strUniqueName_p, String strInstruction_p, Collection wildcarddefinitions_p)
fieldDefinition_p
- OwFieldDefinition of criteriaiOp_p
- criteria operator which should be applied to the value as defined in OwSearchCriteriaoInitialAndDefaultValue_p
- initial and default value, for range operators it is a two field array, first field for first range criteria, second field for second range criteriaiAttributes_p
- int attributes as defined with ATTRIBUTE_...strUniqueName_p
- String a unique name that identifies this criteriastrInstruction_p
- String instruction to be displayed, can be nullwildcarddefinitions_p
- Collection of OwWildCardDefinition, or null if no wildcards are allowedprotected OwSearchNode createSearchNode(OwFieldDefinition fieldDefinition_p, int iOp_p, Object oInitialAndDefaultValue_p, int iAttributes_p, String strUniqueName_p, String strInstruction_p, Collection wildcarddefinitions_p, Object minValue_p, Object maxValue_p, Object defaultValue_p, String sJavaClassName_p) throws Exception
fieldDefinition_p
- OwFieldDefinitioniOp_p
- criteria operator which should be applied to the value as defined in OwSearchCriteriaoInitialAndDefaultValue_p
- initial and default value, for range operators it is a two field array, first field for first range criteria, second field for second range criteriaiAttributes_p
- int attributes as defined with ATTRIBUTE_...strUniqueName_p
- String a unique name that identifies this criteriastrInstruction_p
- String instruction to be displayed, can be nullwildcarddefinitions_p
- Collection of OwWildCardDefinition, or null if no wildcards are allowedminValue_p
- Object value to override the inherited FieldDefinition with custom valuesmaxValue_p
- Object value to override the inherited FieldDefinition with custom valuesdefaultValue_p
- Object value to override the inherited FieldDefinition with custom valuessJavaClassName_p
- String value to override the inherited FieldDefinition with custom valuesException
public void deleteSavedSearch(String name_p) throws Exception
deleteSavedSearch
in interface OwSearchTemplate
name_p
- Exception
public Collection getColumnInfoList() throws OwObjectNotFoundException, OwConfigurationException
getColumnInfoList
in interface OwSearchTemplate
OwObjectNotFoundException
OwConfigurationException
protected OwNetworkContext getContext()
OwNetworkContext
public int getDefaultMaxSize()
getDefaultMaxSize
in interface OwSearchTemplate
public String getDisplayName(Locale locale_p)
getDisplayName
in interface OwSearchTemplate
locale_p
- Locale to usepublic OwField getField(String strFieldClassName_p) throws Exception, OwObjectNotFoundException
getField
in interface OwFieldProvider
strFieldClassName_p
- String class name of requested fieldsException
OwObjectNotFoundException
protected OwFieldDefinition getFieldDefinitionProviderField(String strFieldDefinitionName_p, String strResourceName_p) throws OwObjectNotFoundException, Exception
strFieldDefinitionName_p
- field definition name like in OwFieldDefinitionProvider.getFieldDefinition(String, String)
strResourceName_p
- resource name like in OwFieldDefinitionProvider.getFieldDefinition(String, String)
OwObjectNotFoundException
Exception
public String getFieldProviderName()
getFieldProviderName
in interface OwFieldProvider
public Object getFieldProviderSource()
getFieldProviderSource
in interface OwFieldProvider
public int getFieldProviderType()
getFieldProviderType
in interface OwFieldProvider
public Collection getFields() throws Exception
getFields
in interface OwFieldProvider
Exception
public String getHtmlLayout()
getHtmlLayout
in interface OwSearchTemplate
public String getIcon()
getIcon
in interface OwSearchTemplate
public String getJspLayoutPage()
getJspLayoutPage
in interface OwSearchTemplate
public String getName()
getName
in interface OwSearchTemplate
protected Map getOnTheFlyClassDescriptions()
public OwPriorityRule getPriorityRule()
getPriorityRule
in interface OwSearchTemplate
protected OwFieldDefinition getPropertyClassInternal(String strClassName_p, OwXMLUtil node_p) throws Exception
strClassName_p
- String requested class name of field definitionnode_p
- OwXMLUtil Node with class attributes for on the fly creationException
public Object getSafeFieldValue(String sName_p, Object defaultvalue_p)
getSafeFieldValue
in interface OwFieldProvider
sName_p
- defaultvalue_p
- public String getSavedSearch() throws Exception
getSavedSearch
in interface OwSearchTemplate
Exception
public Collection getSavedSearches() throws Exception
OwSearchTemplate
getSavedSearches
in interface OwSearchTemplate
Exception
public OwSearchNode getSearch(boolean fRefresh_p) throws Exception
getSearch
in interface OwSearchTemplate
fRefresh_p
- true = reload search from template, false = get cached searchException
protected int getSearchAttributeFromNode(Node node_p, int iDefaultEditAttribute_p) throws OwConfigurationException
node_p
- iDefaultEditAttribute_p
- int default value for the edit attributeOwConfigurationException
public OwSort getSort(int iMinSortCriteria_p)
getSort
in interface OwSearchTemplate
iMinSortCriteria_p
- int min number of sort criteria that the returned sort should supportpublic int getVersionSelection()
getVersionSelection
in interface OwSearchTemplate
public boolean hasHtmlLayout()
hasHtmlLayout
in interface OwSearchTemplate
public boolean hasJspLayoutPage()
hasJspLayoutPage
in interface OwSearchTemplate
public void init(OwFieldDefinitionProvider fieldDefinitionProvider_p) throws Exception
init
in interface OwSearchTemplate
fieldDefinitionProvider_p
- OwFieldDefinitionProvider to resolve fieldsException
public boolean isInitalized()
isInitalized
in interface OwSearchTemplate
protected boolean isOperator(String strOperator_p) throws OwConfigurationException
strOperator_p
- true
if the given String is an operator that can be converted using convertOperator(String)
, false
otherwiseOwConfigurationException
protected Object resolveLiteralPlaceholder(String contextname_p, String placeholdername_p) throws Exception
protected Object resolveLiteralValue(String contextname_p, OwFieldDefinition propClass_p, Node literal_p) throws Exception
public void saveSearch(String name_p) throws Exception
OwSearchTemplate
saveSearch
in interface OwSearchTemplate
Exception
protected OwSearchNode createSubclassNode(OwFieldDefinition fieldDefinition_p, int iOp_p, Object oInitialAndDefaultValue_p, int iAttributes_p, String strUniqueName_p, String strInstruction_p, Collection wildcarddefinitions_p, Object minValue_p, Object maxValue_p, Object defaultValue_p, String sJavaClassName_p) throws Exception
fieldDefinition_p
- iOp_p
- oInitialAndDefaultValue_p
- iAttributes_p
- strUniqueName_p
- strInstruction_p
- wildcarddefinitions_p
- minValue_p
- maxValue_p
- defaultValue_p
- sJavaClassName_p
- Exception
protected void scanCustomInfo(Node searchTemplateNode_p)
searchTemplateNode_p
- Nodeprotected void scanResourceNodeEx(OwSearchNode search_p, Node foldersNode_p, Node objectstoresNode_p) throws Exception
OwSearchPathField
, OwSearchPath
and OwSearchObjectStore
object data.search_p
- OwSearchNode to add tofoldersNode_p
- folder Node to traverseobjectstoresNode_p
- objectstore Node to traverseException
public void setField(String sName_p, Object value_p) throws Exception, OwObjectNotFoundException
setField
in interface OwFieldProvider
sName_p
- value_p
- Exception
OwObjectNotFoundException
public void setSavedSearch(String name_p) throws Exception
OwSearchTemplate
setSavedSearch
in interface OwSearchTemplate
Exception
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.