Class DocumentSearchGeneratorImpl
java.lang.Object
org.kuali.rice.kew.impl.document.search.DocumentSearchGeneratorImpl
- All Implemented Interfaces:
DocumentSearchGenerator
Reference implementation of the
DocumentSearchGenerator.- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildDocumentTypes(StringBuilder whereSql, Collection<DocumentType> childDocumentTypes) voidaddDocumentTypeLikeNameToSearchOn(StringBuilder whereSql, String documentTypeName, String clause) voidaddDocumentTypeNameToSearchOn(StringBuilder whereSql, String documentTypeName) voidaddDocumentTypeNameToSearchOn(StringBuilder whereSql, String documentTypeName, String clause) org.kuali.rice.kew.api.document.search.DocumentSearchCriteriaclearSearch(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria) constructWhereClauseElement(String clauseStarter, String queryTableColumnName, String operand, String valueToSearch, String valuePrefix, String valueSuffix) establishDateString(org.joda.time.DateTime fromDate, org.joda.time.DateTime toDate, String tableName, String tableAlias, String colName, String whereStatementClause) generateSearchableAttributeFromSql(String tableName, String tableIdentifier) generateSearchableAttributeSql(String tableName, String documentAttributeName, String whereSqlStarter, int tableIndex) generateSearchableAttributeWhereClauseJoin(String whereSqlStarter, String tableIdentifier, String attributeTableKeyColumnName) generateSearchSql(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, List<org.kuali.rice.core.api.uif.RemotableAttributeField> searchFields) protected org.kuali.rice.kew.api.doctype.DocumentTypeServicegetAppDocIdSql(String appDocId, String whereClausePredicatePrefix) getAppDocStatusesSql(List<String> appDocStatuses, String whereClausePredicatePrefix, int statusTransitionWhereClauseLength) This method generates the where clause fragment related to Application Document Status.getApproverIdSql(String approverId, String whereClausePredicatePrefix) getApproverSql(String approver, String whereClausePredicatePrefix) getDateApprovedSql(org.joda.time.DateTime fromDateApproved, org.joda.time.DateTime toDateApproved, String whereClausePredicatePrefix) getDateCreatedSql(org.joda.time.DateTime fromDateCreated, org.joda.time.DateTime toDateCreated, String whereClausePredicatePrefix) getDateFinalizedSql(org.joda.time.DateTime fromDateFinalized, org.joda.time.DateTime toDateFinalized, String whereClausePredicatePrefix) getDateLastModifiedSql(org.joda.time.DateTime fromDateLastModified, org.joda.time.DateTime toDateLastModified, String whereClausePredicatePrefix) org.kuali.rice.core.framework.persistence.platform.DatabasePlatformgetDocRouteNodeSql(String documentTypeFullName, String routeNodeName, org.kuali.rice.kew.api.document.search.RouteNodeLookupLogic docRouteLevelLogic, String whereClausePredicatePrefix) getDocTitleSql(String docTitle, String whereClausePredicatePrefix) getDocTypeFullNameWhereSql(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, String whereClausePredicatePrefix) getDocumentIdSql(String documentId, String whereClausePredicatePrefix, String tableAlias) getDocumentStatusSql(List<org.kuali.rice.kew.api.document.DocumentStatus> documentStatuses, List<org.kuali.rice.kew.api.document.DocumentStatusCategory> categories, String whereClausePredicatePrefix) getGeneratedPredicatePrefix(int whereClauseSize) getGroupViewerSql(String groupId, String whereClausePredicatePrefix) getInitiatorIdSql(String initiatorPrincipalId, String whereClausePredicatePrefix) getInitiatorSql(String initiatorPrincipalName, String whereClausePredicatePrefix) getSearchableAttributeJoinSql(String tableName, String tableIdentifier, String whereSqlStarter, String attributeTableKeyColumnName) getSearchableAttributeSql(Map<String, List<String>> documentAttributeValues, List<org.kuali.rice.core.api.uif.RemotableAttributeField> searchFields, String whereClausePredicatePrefix) org.kuali.rice.core.framework.persistence.jdbc.sql.SqlBuildergetStatusTransitionDateSql(org.joda.time.DateTime fromStatusTransitionDate, org.joda.time.DateTime toStatusTransitionDate, String whereClausePredicatePrefix) getValidDocumentType(String documentTypeFullName) getViewerIdSql(String viewerId, String whereClausePredicatePrefix) getViewerSql(String viewer, String whereClausePredicatePrefix) protected booleanisUsingAtLeastOneSearchAttribute(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria) A helper method for determining whether any searchable attributes are in use for the search.voidpopulateDocumentAttributesValues(org.kuali.rice.kew.api.document.search.DocumentSearchResult.Builder resultBuilder, Statement searchAttributeStatement) This method performs searches against the search attribute value tables (see classes implementingSearchableAttributeValue) to get data to fill in search attribute values on the given resultBuilder parameterorg.kuali.rice.kew.api.document.search.DocumentSearchResults.BuilderprocessResultSet(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, boolean criteriaModified, Statement searchAttributeStatement, ResultSet resultSet, int maxResultCap, int fetchLimit) protected org.kuali.rice.kew.api.document.search.DocumentSearchResult.BuilderprocessRow(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, Statement searchAttributeStatement, ResultSet rs) Processes the search result row, returning a DocumentSearchResultprotected voidsetApiDocumentTypeService(org.kuali.rice.kew.api.doctype.DocumentTypeService apiDocumentTypeService) voidsetSqlBuilder(org.kuali.rice.core.framework.persistence.jdbc.sql.SqlBuilder sqlBuilder) List<org.kuali.rice.core.api.uif.RemotableAttributeError> validateSearchableAttributes(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria.Builder criteria)
-
Constructor Details
-
DocumentSearchGeneratorImpl
public DocumentSearchGeneratorImpl()
-
-
Method Details
-
clearSearch
public org.kuali.rice.kew.api.document.search.DocumentSearchCriteria clearSearch(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria) - Specified by:
clearSearchin interfaceDocumentSearchGenerator
-
getValidDocumentType
-
validateSearchableAttributes
public List<org.kuali.rice.core.api.uif.RemotableAttributeError> validateSearchableAttributes(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria.Builder criteria) - Specified by:
validateSearchableAttributesin interfaceDocumentSearchGenerator
-
getSearchableAttributeSql
-
generateSearchableAttributeSql
public QueryComponent generateSearchableAttributeSql(String tableName, String documentAttributeName, String whereSqlStarter, int tableIndex) -
getSearchableAttributeJoinSql
public QueryComponent getSearchableAttributeJoinSql(String tableName, String tableIdentifier, String whereSqlStarter, String attributeTableKeyColumnName) -
generateSearchableAttributeWhereClauseJoin
public StringBuilder generateSearchableAttributeWhereClauseJoin(String whereSqlStarter, String tableIdentifier, String attributeTableKeyColumnName) -
generateSearchableAttributeFromSql
-
constructWhereClauseElement
-
processResultSet
public org.kuali.rice.kew.api.document.search.DocumentSearchResults.Builder processResultSet(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, boolean criteriaModified, Statement searchAttributeStatement, ResultSet resultSet, int maxResultCap, int fetchLimit) throws SQLException - Specified by:
processResultSetin interfaceDocumentSearchGenerator- Throws:
SQLException
-
processRow
protected org.kuali.rice.kew.api.document.search.DocumentSearchResult.Builder processRow(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, Statement searchAttributeStatement, ResultSet rs) throws SQLException Processes the search result row, returning a DocumentSearchResult- Parameters:
criteria- the original search criteriasearchAttributeStatement- statement being used to call the database for queriesrs- the search result set- Returns:
- a DocumentSearchResult representing the current ResultSet row
- Throws:
SQLException
-
populateDocumentAttributesValues
public void populateDocumentAttributesValues(org.kuali.rice.kew.api.document.search.DocumentSearchResult.Builder resultBuilder, Statement searchAttributeStatement) throws SQLException This method performs searches against the search attribute value tables (see classes implementingSearchableAttributeValue) to get data to fill in search attribute values on the given resultBuilder parameter- Parameters:
resultBuilder- - document search result object getting search attributes added to itsearchAttributeStatement- - statement being used to call the database for queries- Throws:
SQLException
-
generateSearchSql
public String generateSearchSql(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria, List<org.kuali.rice.core.api.uif.RemotableAttributeField> searchFields) - Specified by:
generateSearchSqlin interfaceDocumentSearchGenerator
-
getDocumentIdSql
-
getDocTitleSql
-
getAppDocIdSql
-
getDateCreatedSql
-
getDateApprovedSql
-
getDateFinalizedSql
-
getDateLastModifiedSql
-
getStatusTransitionDateSql
-
getViewerSql
-
getViewerIdSql
-
getGroupViewerSql
-
getInitiatorSql
-
getInitiatorIdSql
-
getApproverSql
-
getApproverIdSql
-
getDocTypeFullNameWhereSql
-
addChildDocumentTypes
public void addChildDocumentTypes(StringBuilder whereSql, Collection<DocumentType> childDocumentTypes) -
addDocumentTypeNameToSearchOn
-
addDocumentTypeNameToSearchOn
public void addDocumentTypeNameToSearchOn(StringBuilder whereSql, String documentTypeName, String clause) -
addDocumentTypeLikeNameToSearchOn
public void addDocumentTypeLikeNameToSearchOn(StringBuilder whereSql, String documentTypeName, String clause) -
getDocRouteNodeSql
-
getDocumentStatusSql
-
getAppDocStatusesSql
public String getAppDocStatusesSql(List<String> appDocStatuses, String whereClausePredicatePrefix, int statusTransitionWhereClauseLength) This method generates the where clause fragment related to Application Document Status. If the Status values only are defined, search for the appDocStatus value in the route header. If either the transition from/to dates are defined, search agains the status transition history. -
getGeneratedPredicatePrefix
-
establishDateString
-
getDbPlatform
public org.kuali.rice.core.framework.persistence.platform.DatabasePlatform getDbPlatform() -
getSqlBuilder
public org.kuali.rice.core.framework.persistence.jdbc.sql.SqlBuilder getSqlBuilder() -
setSqlBuilder
public void setSqlBuilder(org.kuali.rice.core.framework.persistence.jdbc.sql.SqlBuilder sqlBuilder) -
isUsingAtLeastOneSearchAttribute
protected boolean isUsingAtLeastOneSearchAttribute(org.kuali.rice.kew.api.document.search.DocumentSearchCriteria criteria) A helper method for determining whether any searchable attributes are in use for the search.- Returns:
- True if the search criteria contains at least one searchable attribute or the criteria's doc type name is non-blank; false otherwise.
-
getApiDocumentTypeService
protected org.kuali.rice.kew.api.doctype.DocumentTypeService getApiDocumentTypeService() -
setApiDocumentTypeService
protected void setApiDocumentTypeService(org.kuali.rice.kew.api.doctype.DocumentTypeService apiDocumentTypeService)
-