public class DocumentSearchGeneratorImpl extends Object implements DocumentSearchGenerator
DocumentSearchGenerator
.Constructor and Description |
---|
DocumentSearchGeneratorImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addChildDocumentTypes(StringBuilder whereSql,
Collection<DocumentType> childDocumentTypes) |
void |
addDocumentTypeLikeNameToSearchOn(StringBuilder whereSql,
String documentTypeName,
String clause) |
void |
addDocumentTypeNameToSearchOn(StringBuilder whereSql,
String documentTypeName) |
void |
addDocumentTypeNameToSearchOn(StringBuilder whereSql,
String documentTypeName,
String clause) |
DocumentSearchCriteria |
clearSearch(DocumentSearchCriteria criteria) |
StringBuilder |
constructWhereClauseElement(String clauseStarter,
String queryTableColumnName,
String operand,
String valueToSearch,
String valuePrefix,
String valueSuffix) |
String |
establishDateString(org.joda.time.DateTime fromDate,
org.joda.time.DateTime toDate,
String tableName,
String tableAlias,
String colName,
String whereStatementClause) |
StringBuilder |
generateSearchableAttributeFromSql(String tableName,
String tableIdentifier) |
QueryComponent |
generateSearchableAttributeSql(String tableName,
String documentAttributeName,
String whereSqlStarter,
int tableIndex) |
StringBuilder |
generateSearchableAttributeWhereClauseJoin(String whereSqlStarter,
String tableIdentifier,
String attributeTableKeyColumnName) |
String |
generateSearchSql(DocumentSearchCriteria criteria,
List<RemotableAttributeField> searchFields) |
protected DocumentTypeService |
getApiDocumentTypeService() |
String |
getAppDocIdSql(String appDocId,
String whereClausePredicatePrefix) |
String |
getAppDocStatusesSql(List<String> appDocStatuses,
String whereClausePredicatePrefix,
int statusTransitionWhereClauseLength)
This method generates the where clause fragment related to Application Document Status.
|
String |
getApproverIdSql(String approverId,
String whereClausePredicatePrefix) |
String |
getApproverSql(String approver,
String whereClausePredicatePrefix) |
String |
getDateApprovedSql(org.joda.time.DateTime fromDateApproved,
org.joda.time.DateTime toDateApproved,
String whereClausePredicatePrefix) |
String |
getDateCreatedSql(org.joda.time.DateTime fromDateCreated,
org.joda.time.DateTime toDateCreated,
String whereClausePredicatePrefix) |
String |
getDateFinalizedSql(org.joda.time.DateTime fromDateFinalized,
org.joda.time.DateTime toDateFinalized,
String whereClausePredicatePrefix) |
String |
getDateLastModifiedSql(org.joda.time.DateTime fromDateLastModified,
org.joda.time.DateTime toDateLastModified,
String whereClausePredicatePrefix) |
DatabasePlatform |
getDbPlatform() |
String |
getDocRouteNodeSql(String documentTypeFullName,
String routeNodeName,
RouteNodeLookupLogic docRouteLevelLogic,
String whereClausePredicatePrefix) |
String |
getDocTitleSql(String docTitle,
String whereClausePredicatePrefix) |
String |
getDocTypeFullNameWhereSql(DocumentSearchCriteria criteria,
String whereClausePredicatePrefix) |
String |
getDocumentIdSql(String documentId,
String whereClausePredicatePrefix,
String tableAlias) |
String |
getDocumentStatusSql(List<DocumentStatus> documentStatuses,
List<DocumentStatusCategory> categories,
String whereClausePredicatePrefix) |
String |
getGeneratedPredicatePrefix(int whereClauseSize) |
String |
getGroupViewerSql(String groupId,
String whereClausePredicatePrefix) |
String |
getInitiatorIdSql(String initiatorPrincipalId,
String whereClausePredicatePrefix) |
String |
getInitiatorSql(String initiatorPrincipalName,
String whereClausePredicatePrefix) |
QueryComponent |
getSearchableAttributeJoinSql(String tableName,
String tableIdentifier,
String whereSqlStarter,
String attributeTableKeyColumnName) |
QueryComponent |
getSearchableAttributeSql(Map<String,List<String>> documentAttributeValues,
List<RemotableAttributeField> searchFields,
String whereClausePredicatePrefix) |
SqlBuilder |
getSqlBuilder() |
String |
getStatusTransitionDateSql(org.joda.time.DateTime fromStatusTransitionDate,
org.joda.time.DateTime toStatusTransitionDate,
String whereClausePredicatePrefix) |
DocumentType |
getValidDocumentType(String documentTypeFullName) |
String |
getViewerIdSql(String viewerId,
String whereClausePredicatePrefix) |
String |
getViewerSql(String viewer,
String whereClausePredicatePrefix) |
protected boolean |
isUsingAtLeastOneSearchAttribute(DocumentSearchCriteria criteria)
A helper method for determining whether any searchable attributes are in use for the search.
|
void |
populateDocumentAttributesValues(DocumentSearchResult.Builder resultBuilder,
Statement searchAttributeStatement)
This method performs searches against the search attribute value tables (see classes implementing
SearchableAttributeValue ) to get data to fill in search attribute values on the given resultBuilder parameter |
DocumentSearchResults.Builder |
processResultSet(DocumentSearchCriteria criteria,
boolean criteriaModified,
Statement searchAttributeStatement,
ResultSet resultSet,
int maxResultCap,
int fetchLimit) |
protected DocumentSearchResult.Builder |
processRow(DocumentSearchCriteria criteria,
Statement searchAttributeStatement,
ResultSet rs)
Processes the search result row, returning a DocumentSearchResult
|
protected void |
setApiDocumentTypeService(DocumentTypeService apiDocumentTypeService) |
void |
setSqlBuilder(SqlBuilder sqlBuilder) |
List<RemotableAttributeError> |
validateSearchableAttributes(DocumentSearchCriteria.Builder criteria) |
public DocumentSearchGeneratorImpl()
public DocumentSearchCriteria clearSearch(DocumentSearchCriteria criteria)
clearSearch
in interface DocumentSearchGenerator
public DocumentType getValidDocumentType(String documentTypeFullName)
public List<RemotableAttributeError> validateSearchableAttributes(DocumentSearchCriteria.Builder criteria)
validateSearchableAttributes
in interface DocumentSearchGenerator
public QueryComponent getSearchableAttributeSql(Map<String,List<String>> documentAttributeValues, List<RemotableAttributeField> searchFields, String whereClausePredicatePrefix)
public QueryComponent generateSearchableAttributeSql(String tableName, String documentAttributeName, String whereSqlStarter, int tableIndex)
public QueryComponent getSearchableAttributeJoinSql(String tableName, String tableIdentifier, String whereSqlStarter, String attributeTableKeyColumnName)
public StringBuilder generateSearchableAttributeWhereClauseJoin(String whereSqlStarter, String tableIdentifier, String attributeTableKeyColumnName)
public StringBuilder generateSearchableAttributeFromSql(String tableName, String tableIdentifier)
public StringBuilder constructWhereClauseElement(String clauseStarter, String queryTableColumnName, String operand, String valueToSearch, String valuePrefix, String valueSuffix)
public DocumentSearchResults.Builder processResultSet(DocumentSearchCriteria criteria, boolean criteriaModified, Statement searchAttributeStatement, ResultSet resultSet, int maxResultCap, int fetchLimit) throws SQLException
processResultSet
in interface DocumentSearchGenerator
SQLException
protected DocumentSearchResult.Builder processRow(DocumentSearchCriteria criteria, Statement searchAttributeStatement, ResultSet rs) throws SQLException
criteria
- the original search criteriasearchAttributeStatement
- statement being used to call the database for queriesrs
- the search result setSQLException
public void populateDocumentAttributesValues(DocumentSearchResult.Builder resultBuilder, Statement searchAttributeStatement) throws SQLException
SearchableAttributeValue
) to get data to fill in search attribute values on the given resultBuilder parameterresultBuilder
- - document search result object getting search attributes added to itsearchAttributeStatement
- - statement being used to call the database for queriesSQLException
public String generateSearchSql(DocumentSearchCriteria criteria, List<RemotableAttributeField> searchFields)
generateSearchSql
in interface DocumentSearchGenerator
public String getDocumentIdSql(String documentId, String whereClausePredicatePrefix, String tableAlias)
public String getDocTitleSql(String docTitle, String whereClausePredicatePrefix)
public String getAppDocIdSql(String appDocId, String whereClausePredicatePrefix)
public String getDateCreatedSql(org.joda.time.DateTime fromDateCreated, org.joda.time.DateTime toDateCreated, String whereClausePredicatePrefix)
public String getDateApprovedSql(org.joda.time.DateTime fromDateApproved, org.joda.time.DateTime toDateApproved, String whereClausePredicatePrefix)
public String getDateFinalizedSql(org.joda.time.DateTime fromDateFinalized, org.joda.time.DateTime toDateFinalized, String whereClausePredicatePrefix)
public String getDateLastModifiedSql(org.joda.time.DateTime fromDateLastModified, org.joda.time.DateTime toDateLastModified, String whereClausePredicatePrefix)
public String getStatusTransitionDateSql(org.joda.time.DateTime fromStatusTransitionDate, org.joda.time.DateTime toStatusTransitionDate, String whereClausePredicatePrefix)
public String getViewerSql(String viewer, String whereClausePredicatePrefix)
public String getViewerIdSql(String viewerId, String whereClausePredicatePrefix)
public String getGroupViewerSql(String groupId, String whereClausePredicatePrefix)
public String getInitiatorSql(String initiatorPrincipalName, String whereClausePredicatePrefix)
public String getInitiatorIdSql(String initiatorPrincipalId, String whereClausePredicatePrefix)
public String getApproverSql(String approver, String whereClausePredicatePrefix)
public String getApproverIdSql(String approverId, String whereClausePredicatePrefix)
public String getDocTypeFullNameWhereSql(DocumentSearchCriteria criteria, String whereClausePredicatePrefix)
public void addChildDocumentTypes(StringBuilder whereSql, Collection<DocumentType> childDocumentTypes)
public void addDocumentTypeNameToSearchOn(StringBuilder whereSql, String documentTypeName)
public void addDocumentTypeNameToSearchOn(StringBuilder whereSql, String documentTypeName, String clause)
public void addDocumentTypeLikeNameToSearchOn(StringBuilder whereSql, String documentTypeName, String clause)
public String getDocRouteNodeSql(String documentTypeFullName, String routeNodeName, RouteNodeLookupLogic docRouteLevelLogic, String whereClausePredicatePrefix)
public String getDocumentStatusSql(List<DocumentStatus> documentStatuses, List<DocumentStatusCategory> categories, String whereClausePredicatePrefix)
public String getAppDocStatusesSql(List<String> appDocStatuses, String whereClausePredicatePrefix, int statusTransitionWhereClauseLength)
public String getGeneratedPredicatePrefix(int whereClauseSize)
public String establishDateString(org.joda.time.DateTime fromDate, org.joda.time.DateTime toDate, String tableName, String tableAlias, String colName, String whereStatementClause)
public DatabasePlatform getDbPlatform()
public SqlBuilder getSqlBuilder()
public void setSqlBuilder(SqlBuilder sqlBuilder)
protected boolean isUsingAtLeastOneSearchAttribute(DocumentSearchCriteria criteria)
protected DocumentTypeService getApiDocumentTypeService()
protected void setApiDocumentTypeService(DocumentTypeService apiDocumentTypeService)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.