Class DocumentSearchCriteriaBoLookupableHelperService
java.lang.Object
org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl
org.kuali.rice.kew.impl.document.search.DocumentSearchCriteriaBoLookupableHelperService
- All Implemented Interfaces:
Serializable,LookupableHelperService
public class DocumentSearchCriteriaBoLookupableHelperService
extends KualiLookupableHelperServiceImpl
Implementation of lookupable helper service which handles the complex lookup behavior required by the KEW
document search screen.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
Fields inherited from class org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl
LOG, searchUsingOnlyPrimaryKeyValuesFields inherited from class org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
ACTION_URLS_CHILDREN_END, ACTION_URLS_CHILDREN_SEPARATOR, ACTION_URLS_CHILDREN_STARTER, ACTION_URLS_EMPTY, ACTION_URLS_SEPARATOR, backLocation, businessObjectAuthorizationService, businessObjectClass, businessObjectDictionaryService, businessObjectMetaDataService, businessObjectService, configurationService, dataDictionaryService, docFormKey, docNum, encryptionService, fieldConversions, forceLookupResultFieldInquiryCache, inquirableClassCache, kualiInquirable, lookupResultsService, lookupService, maintenanceDocumentDictionaryService, noLookupResultFieldInquiryCache, parameters, parameterService, persistenceStructureService, readOnlyFieldsList, referencesToRefresh, resultColumns, RESULTS_DEFAULT_MAX_COLUMN_LENGTH, rows, sequenceAccessorService, TITLE_ACTION_URL_PREPENDTEXT_PROPERTY, TITLE_RETURN_URL_PREPENDTEXT_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidApplies changes that might have happened to the criteria back to the fields so that they show up on the form.booleancheckForAdditionalFields(Map<String, String> fieldValues) Determines if there should be more search fields rendered based on already entered search criteria, and generates additional form rows.Cleans up various issues with fieldValues coming from the lookup form (namely, that they don't include multi-valued field values!).protected voidexecuteColumnCustomization(ResultRow resultRow, DocumentSearchResult searchResult, org.kuali.rice.kew.framework.document.search.DocumentSearchResultSetConfiguration resultSetConfiguration, org.kuali.rice.kew.framework.document.search.DocumentSearchCriteriaConfiguration criteriaConfiguration) Executes customization of columns, could include removing certain columns or adding additional columns to the result row (in cases where columns are added by document search customization, such as searchable attributes).protected HtmlData.AnchorHtmlDatagenerateDocumentHandlerUrl(String documentId, DocumentType documentType, boolean superUserSearch) Generates the appropriate document handler url for the given document.protected HtmlData.AnchorHtmlDatagenerateInitiatorUrl(String principalId) protected HtmlData.AnchorHtmlDatagenerateRouteLogUrl(String documentId) protected org.kuali.rice.kew.impl.document.search.FormFieldsReturns wrapper around current form fieldsgetInquiryUrl(BusinessObject bo, String propertyName) Custom implementation of getInquiryUrl that sets up doc handler link.protected Stringprotected List<? extends BusinessObject>getSearchResultsHelper(Map<String, String> fieldValues, boolean unbounded) getValidSearchableAttributeNames(String documentTypeName) This method takes in a document type name and returns a set containing the names of valid searchable attributes for that document typeprotected booleanReturns true if the current search being executed is an "advanced" search.protected booleanReturns true if the current "search" being executed is an "clear" search.protected booleanReturns true if the document handler should open in a new window.protected booleanParses a boolean request parameterbooleanReturns true if the route log should open in a new window.protected booleanReturns true if the current search being executed is a super user search.protected DocumentSearchCriterialoadCriteria(Map<String, String> fieldValues) Loads the document search criteria from the given map of field values as submitted from the search screen, and populates the current form Rows/Fields with the saved criteria fieldsprotected booleanloadSavedSearch(boolean ignoreErrors) Loads a saved searchprotected voidOverrides a Field value; sets a fallback/restored value if there is no new valuevoidperformClear(LookupForm lookupForm) booleanperformCustomAction(boolean ignoreErrors) Performs custom document search/lookup actions. 1) switching between simple/detailed search 2) switching between non-superuser/superuser search 3) clearing saved search results 4) restoring a saved search and executing the searchCollection<? extends BusinessObject>performLookup(LookupForm lookupForm, Collection<ResultRow> resultTable, boolean bounded) protected voidpopulateCustomColumns(List<Column> customColumns, DocumentSearchResult searchResult) protected voidpopulateResultWarningMessages(DocumentSearchResults searchResults) Inspects the lookup results to determine if any warning messages should be published to the message map.protected List<DocumentSearchCriteriaBo>populateSearchResults(List<DocumentSearchResult> lookupResults) protected voidpostProcessResults(Collection<ResultRow> resultRows, DocumentSearchResults searchResults) Takes a collection of result rows and does final processing on them.protected static voidreplaceCurrentUserInFields(Map<String, String> fields) protected static StringreplaceCurrentUserToken(String value, org.kuali.rice.kim.api.identity.Person person) protected voidRepopulate the fields indicating advanced/superuser search type.voidsetDocumentSearchCriteriaProcessor(DocumentSearchCriteriaProcessor documentSearchCriteriaProcessor) voidsetDocumentSearchCriteriaTranslator(DocumentSearchCriteriaTranslator documentSearchCriteriaTranslator) voidsetDocumentSearchService(DocumentSearchService documentSearchService) protected voidsetRows()Override setRows in order to post-process and add documenttype-dependent fieldsprotected voidSets the rows for the search criteria.booleanbooleanprotected voidHandles toggling between form views.Methods inherited from class org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl
getExternalBusinessObjectProperty, getExternalizableBusinessObjectClass, getExternalizableBusinessObjectFieldValues, getExternalizableBusinessObjectProperties, getPrimaryKeyFieldLabels, getSearchResults, getSearchResultsUnbounded, hasExternalBusinessObjectProperty, isExternalBusinessObjectProperty, isSearchUsingOnlyPrimaryKeyValues, removeExternalizableBusinessObjectFieldValuesMethods inherited from class org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
addToReturnHref, allowsMaintenanceDeleteAction, allowsMaintenanceEditAction, allowsMaintenanceNewOrCopyAction, allowsNewOrCopyAction, applyConditionalLogicForFieldDisplay, applyFieldAuthorizationsFromNestedLookups, getActionUrlHref, getActionUrls, getActionUrlTitleText, getBackLocation, getBusinessObjectAuthorizationService, getBusinessObjectClass, getBusinessObjectDictionaryService, getBusinessObjectMetaDataService, getBusinessObjectService, getColumnMaxLength, getColumns, getConditionallyHiddenPropertyNames, getConditionallyReadOnlyPropertyNames, getConditionallyRequiredPropertyNames, getCurrentSearchFieldValue, getCustomActionUrls, getDataDictionaryService, getDefaultSortColumns, getDocFormKey, getDocNum, getEmptyActionUrls, getEmptyAnchorHtmlData, getEncryptionService, getKualiConfigurationService, getKualiInquirable, getLookupResultsService, getLookupService, getMaintenanceDocumentDictionaryService, getMaintenanceDocumentTypeName, getMaintenanceUrl, getParameters, getParameters, getParameterService, getParametersFromPrimaryKey, getPersistenceStructureService, getPropertyClass, getReadOnlyFieldsList, getReferencesToRefresh, getReturnAnchorHtmlData, getReturnHref, getReturnHref, getReturnInputHtmlData, getReturnKeys, getReturnLocation, getReturnUrl, getReturnUrl, getRows, getSearchResultsActualSizeKnown, getSequenceAccessorService, getTitle, getUrlData, getUrlData, isResultReturnable, maskValueIfNecessary, setBackLocation, setBusinessObjectClass, setBusinessObjectDictionaryService, setBusinessObjectMetaDataService, setBusinessObjectService, setDataDictionaryService, setDocFormKey, setDocNum, setEncryptionService, setFieldConversions, setKualiInquirable, setLookupResultsService, setLookupService, setMaintenanceDocumentDictionaryService, setParameters, setParameterService, setParameterService, setPersistenceStructureService, setReadOnlyFieldsList, setReferencesToRefresh, setSequenceAccessorService, validateSearchParameters, validateSearchParameterWildcardAndOperators
-
Constructor Details
-
DocumentSearchCriteriaBoLookupableHelperService
public DocumentSearchCriteriaBoLookupableHelperService()
-
-
Method Details
-
getSearchResultsHelper
protected List<? extends BusinessObject> getSearchResultsHelper(Map<String, String> fieldValues, boolean unbounded) - Overrides:
getSearchResultsHelperin classKualiLookupableHelperServiceImpl
-
populateResultWarningMessages
Inspects the lookup results to determine if any warning messages should be published to the message map. -
applyCriteriaChangesToFields
Applies changes that might have happened to the criteria back to the fields so that they show up on the form. Namely, this handles populating the form with today's date if the create date was not filled in on the form. -
replaceCurrentUserToken
-
cleanupFieldValues
protected static Map<String,String> cleanupFieldValues(Map<String, String> fieldValues, Map<String, String[]> parameters) Cleans up various issues with fieldValues coming from the lookup form (namely, that they don't include multi-valued field values!). Handles these by adding them comma-separated. -
getValidSearchableAttributeNames
This method takes in a document type name and returns a set containing the names of valid searchable attributes for that document type- Parameters:
documentTypeName- The name of the document type to find attributes for- Returns:
- A set containing the names of the searchable attributes for the given document type
-
replaceCurrentUserInFields
-
loadCriteria
Loads the document search criteria from the given map of field values as submitted from the search screen, and populates the current form Rows/Fields with the saved criteria fields -
populateSearchResults
protected List<DocumentSearchCriteriaBo> populateSearchResults(List<DocumentSearchResult> lookupResults) -
performLookup
public Collection<? extends BusinessObject> performLookup(LookupForm lookupForm, Collection<ResultRow> resultTable, boolean bounded) - Specified by:
performLookupin interfaceLookupableHelperService- Overrides:
performLookupin classAbstractLookupableHelperServiceImpl
-
overrideFieldValue
protected void overrideFieldValue(Field field, Map<String, String[]> newValues, Map<String, String[]> oldValues) Overrides a Field value; sets a fallback/restored value if there is no new value -
toggleFormView
protected void toggleFormView()Handles toggling between form views. Reads and sets the Rows state. -
loadSavedSearch
protected boolean loadSavedSearch(boolean ignoreErrors) Loads a saved search- Returns:
- returns true on success to run the loaded search, false on error.
-
performCustomAction
public boolean performCustomAction(boolean ignoreErrors) Performs custom document search/lookup actions. 1) switching between simple/detailed search 2) switching between non-superuser/superuser search 3) clearing saved search results 4) restoring a saved search and executing the search- Specified by:
performCustomActionin interfaceLookupableHelperService- Overrides:
performCustomActionin classAbstractLookupableHelperServiceImpl- Parameters:
ignoreErrors-- Returns:
- whether to rerun the previous search; false in cases 1-3 because we are just updating the form
-
getInquiryUrl
Custom implementation of getInquiryUrl that sets up doc handler link.- Specified by:
getInquiryUrlin interfaceLookupableHelperService- Overrides:
getInquiryUrlin classAbstractLookupableHelperServiceImpl
-
generateDocumentHandlerUrl
protected HtmlData.AnchorHtmlData generateDocumentHandlerUrl(String documentId, DocumentType documentType, boolean superUserSearch) Generates the appropriate document handler url for the given document. If superUserSearch is true then a super user doc handler link will be generated if the document type policy allows it. -
generateRouteLogUrl
-
generateInitiatorUrl
-
isDocumentHandlerPopup
protected boolean isDocumentHandlerPopup()Returns true if the document handler should open in a new window. -
isRouteLogPopup
public boolean isRouteLogPopup()Returns true if the route log should open in a new window. -
isFlagSet
Parses a boolean request parameter -
isSuperUserSearch
protected boolean isSuperUserSearch()Returns true if the current search being executed is a super user search. -
isAdvancedSearch
protected boolean isAdvancedSearch()Returns true if the current search being executed is an "advanced" search. -
isClearSavedSearch
protected boolean isClearSavedSearch()Returns true if the current "search" being executed is an "clear" search. -
getSavedSearchName
-
setRows
protected void setRows()Override setRows in order to post-process and add documenttype-dependent fields- Overrides:
setRowsin classAbstractLookupableHelperServiceImpl
-
getFormFields
protected org.kuali.rice.kew.impl.document.search.FormFields getFormFields()Returns wrapper around current form fields -
setRows
Sets the rows for the search criteria. This method will delegate to the DocumentSearchCriteriaProcessor in order to pull in fields for custom search attributes.- Parameters:
documentTypeName- the name of the document type currently entered on the form, if this is a valid document type then it may have search attribute fields that need to be displayed; documentType name may also be loaded via a saved search
-
getSupplementalMenuBar
- Specified by:
getSupplementalMenuBarin interfaceLookupableHelperService- Overrides:
getSupplementalMenuBarin classAbstractLookupableHelperServiceImpl
-
shouldDisplayHeaderNonMaintActions
public boolean shouldDisplayHeaderNonMaintActions()- Specified by:
shouldDisplayHeaderNonMaintActionsin interfaceLookupableHelperService- Overrides:
shouldDisplayHeaderNonMaintActionsin classAbstractLookupableHelperServiceImpl
-
shouldDisplayLookupCriteria
public boolean shouldDisplayLookupCriteria()- Specified by:
shouldDisplayLookupCriteriain interfaceLookupableHelperService- Overrides:
shouldDisplayLookupCriteriain classAbstractLookupableHelperServiceImpl
-
checkForAdditionalFields
Determines if there should be more search fields rendered based on already entered search criteria, and generates additional form rows.- Specified by:
checkForAdditionalFieldsin interfaceLookupableHelperService- Overrides:
checkForAdditionalFieldsin classAbstractLookupableHelperServiceImpl
-
getExtraField
- Specified by:
getExtraFieldin interfaceLookupableHelperService- Overrides:
getExtraFieldin classAbstractLookupableHelperServiceImpl
-
performClear
- Specified by:
performClearin interfaceLookupableHelperService- Overrides:
performClearin classAbstractLookupableHelperServiceImpl
-
repopulateSearchTypeFlags
protected void repopulateSearchTypeFlags()Repopulate the fields indicating advanced/superuser search type. -
postProcessResults
protected void postProcessResults(Collection<ResultRow> resultRows, DocumentSearchResults searchResults) Takes a collection of result rows and does final processing on them. -
executeColumnCustomization
protected void executeColumnCustomization(ResultRow resultRow, DocumentSearchResult searchResult, org.kuali.rice.kew.framework.document.search.DocumentSearchResultSetConfiguration resultSetConfiguration, org.kuali.rice.kew.framework.document.search.DocumentSearchCriteriaConfiguration criteriaConfiguration) Executes customization of columns, could include removing certain columns or adding additional columns to the result row (in cases where columns are added by document search customization, such as searchable attributes). -
populateCustomColumns
-
setDocumentSearchService
-
getDocumentSearchService
-
getDocumentSearchCriteriaProcessor
-
setDocumentSearchCriteriaProcessor
public void setDocumentSearchCriteriaProcessor(DocumentSearchCriteriaProcessor documentSearchCriteriaProcessor) -
getDocumentSearchCriteriaTranslator
-
setDocumentSearchCriteriaTranslator
public void setDocumentSearchCriteriaTranslator(DocumentSearchCriteriaTranslator documentSearchCriteriaTranslator)
-