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,org.kuali.rice.kns.lookup.LookupableHelperService
public class DocumentSearchCriteriaBoLookupableHelperService
extends org.kuali.rice.kns.lookup.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 voidapplyCriteriaChangesToFields(org.kuali.rice.kew.api.document.search.DocumentSearchCriteriaContract criteria) Applies 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(org.kuali.rice.kns.web.ui.ResultRow resultRow, org.kuali.rice.kew.api.document.search.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 org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlDatagenerateDocumentHandlerUrl(String documentId, DocumentType documentType, boolean superUserSearch) Generates the appropriate document handler url for the given document.protected org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlDatagenerateInitiatorUrl(String principalId) protected org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlDatagenerateRouteLogUrl(String documentId) org.kuali.rice.kns.web.ui.Fieldprotected org.kuali.rice.kew.impl.document.search.FormFieldsReturns wrapper around current form fieldsorg.kuali.rice.kns.lookup.HtmlDatagetInquiryUrl(org.kuali.rice.krad.bo.BusinessObject bo, String propertyName) Custom implementation of getInquiryUrl that sets up doc handler link.protected Stringprotected List<? extends org.kuali.rice.krad.bo.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 org.kuali.rice.kew.api.document.search.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 voidoverrideFieldValue(org.kuali.rice.kns.web.ui.Field field, Map<String, String[]> newValues, Map<String, String[]> oldValues) Overrides a Field value; sets a fallback/restored value if there is no new valuevoidperformClear(org.kuali.rice.kns.web.struts.form.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 org.kuali.rice.krad.bo.BusinessObject> performLookup(org.kuali.rice.kns.web.struts.form.LookupForm lookupForm, Collection<org.kuali.rice.kns.web.ui.ResultRow> resultTable, boolean bounded) protected voidpopulateCustomColumns(List<org.kuali.rice.kns.web.ui.Column> customColumns, org.kuali.rice.kew.api.document.search.DocumentSearchResult searchResult) protected voidpopulateResultWarningMessages(org.kuali.rice.kew.api.document.search.DocumentSearchResults searchResults) Inspects the lookup results to determine if any warning messages should be published to the message map.protected List<DocumentSearchCriteriaBo> populateSearchResults(List<org.kuali.rice.kew.api.document.search.DocumentSearchResult> lookupResults) protected voidpostProcessResults(Collection<org.kuali.rice.kns.web.ui.ResultRow> resultRows, org.kuali.rice.kew.api.document.search.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 org.kuali.rice.krad.bo.BusinessObject> getSearchResultsHelper(Map<String, String> fieldValues, boolean unbounded) - Overrides:
getSearchResultsHelperin classorg.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl
-
populateResultWarningMessages
protected void populateResultWarningMessages(org.kuali.rice.kew.api.document.search.DocumentSearchResults searchResults) Inspects the lookup results to determine if any warning messages should be published to the message map. -
applyCriteriaChangesToFields
protected void applyCriteriaChangesToFields(org.kuali.rice.kew.api.document.search.DocumentSearchCriteriaContract criteria) 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
protected org.kuali.rice.kew.api.document.search.DocumentSearchCriteria loadCriteria(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 fields -
populateSearchResults
protected List<DocumentSearchCriteriaBo> populateSearchResults(List<org.kuali.rice.kew.api.document.search.DocumentSearchResult> lookupResults) -
performLookup
public Collection<? extends org.kuali.rice.krad.bo.BusinessObject> performLookup(org.kuali.rice.kns.web.struts.form.LookupForm lookupForm, Collection<org.kuali.rice.kns.web.ui.ResultRow> resultTable, boolean bounded) - Specified by:
performLookupin interfaceorg.kuali.rice.kns.lookup.LookupableHelperService- Overrides:
performLookupin classorg.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
-
overrideFieldValue
protected void overrideFieldValue(org.kuali.rice.kns.web.ui.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 interfaceorg.kuali.rice.kns.lookup.LookupableHelperService- Overrides:
performCustomActionin classorg.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl- Parameters:
ignoreErrors-- Returns:
- whether to rerun the previous search; false in cases 1-3 because we are just updating the form
-
getInquiryUrl
public org.kuali.rice.kns.lookup.HtmlData getInquiryUrl(org.kuali.rice.krad.bo.BusinessObject bo, String propertyName) Custom implementation of getInquiryUrl that sets up doc handler link.- Specified by:
getInquiryUrlin interfaceorg.kuali.rice.kns.lookup.LookupableHelperService- Overrides:
getInquiryUrlin classorg.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
-
generateDocumentHandlerUrl
protected org.kuali.rice.kns.lookup.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
protected org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData generateInitiatorUrl(String principalId) -
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 classorg.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
-
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 interfaceorg.kuali.rice.kns.lookup.LookupableHelperService- Overrides:
getSupplementalMenuBarin classorg.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
-
shouldDisplayHeaderNonMaintActions
public boolean shouldDisplayHeaderNonMaintActions()- Specified by:
shouldDisplayHeaderNonMaintActionsin interfaceorg.kuali.rice.kns.lookup.LookupableHelperService- Overrides:
shouldDisplayHeaderNonMaintActionsin classorg.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
-
shouldDisplayLookupCriteria
public boolean shouldDisplayLookupCriteria()- Specified by:
shouldDisplayLookupCriteriain interfaceorg.kuali.rice.kns.lookup.LookupableHelperService- Overrides:
shouldDisplayLookupCriteriain classorg.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
-
checkForAdditionalFields
Determines if there should be more search fields rendered based on already entered search criteria, and generates additional form rows.- Specified by:
checkForAdditionalFieldsin interfaceorg.kuali.rice.kns.lookup.LookupableHelperService- Overrides:
checkForAdditionalFieldsin classorg.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
-
getExtraField
public org.kuali.rice.kns.web.ui.Field getExtraField()- Specified by:
getExtraFieldin interfaceorg.kuali.rice.kns.lookup.LookupableHelperService- Overrides:
getExtraFieldin classorg.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
-
performClear
public void performClear(org.kuali.rice.kns.web.struts.form.LookupForm lookupForm) - Specified by:
performClearin interfaceorg.kuali.rice.kns.lookup.LookupableHelperService- Overrides:
performClearin classorg.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
-
repopulateSearchTypeFlags
protected void repopulateSearchTypeFlags()Repopulate the fields indicating advanced/superuser search type. -
postProcessResults
protected void postProcessResults(Collection<org.kuali.rice.kns.web.ui.ResultRow> resultRows, org.kuali.rice.kew.api.document.search.DocumentSearchResults searchResults) Takes a collection of result rows and does final processing on them. -
executeColumnCustomization
protected void executeColumnCustomization(org.kuali.rice.kns.web.ui.ResultRow resultRow, org.kuali.rice.kew.api.document.search.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
protected void populateCustomColumns(List<org.kuali.rice.kns.web.ui.Column> customColumns, org.kuali.rice.kew.api.document.search.DocumentSearchResult searchResult) -
setDocumentSearchService
-
getDocumentSearchService
-
getDocumentSearchCriteriaProcessor
-
setDocumentSearchCriteriaProcessor
public void setDocumentSearchCriteriaProcessor(DocumentSearchCriteriaProcessor documentSearchCriteriaProcessor) -
getDocumentSearchCriteriaTranslator
-
setDocumentSearchCriteriaTranslator
public void setDocumentSearchCriteriaTranslator(DocumentSearchCriteriaTranslator documentSearchCriteriaTranslator)
-