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, searchUsingOnlyPrimaryKeyValues

    Fields 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 Type
    Method
    Description
    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.
    boolean
    Determines if there should be more search fields rendered based on already entered search criteria, and generates additional form rows.
    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!).
    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).
    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.
    protected org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData
     
    protected org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData
     
     
     
     
    org.kuali.rice.kns.web.ui.Field
     
    protected org.kuali.rice.kew.impl.document.search.FormFields
    Returns wrapper around current form fields
    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.
    protected String
     
    protected List<? extends org.kuali.rice.krad.bo.BusinessObject>
    getSearchResultsHelper(Map<String,String> fieldValues, boolean unbounded)
     
     
    protected static Set<String>
    This method takes in a document type name and returns a set containing the names of valid searchable attributes for that document type
    protected boolean
    Returns true if the current search being executed is an "advanced" search.
    protected boolean
    Returns true if the current "search" being executed is an "clear" search.
    protected boolean
    Returns true if the document handler should open in a new window.
    protected boolean
    isFlagSet(String flagName)
    Parses a boolean request parameter
    boolean
    Returns true if the route log should open in a new window.
    protected boolean
    Returns true if the current search being executed is a super user search.
    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
    protected boolean
    loadSavedSearch(boolean ignoreErrors)
    Loads a saved search
    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
    void
    performClear(org.kuali.rice.kns.web.struts.form.LookupForm lookupForm)
     
    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
    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)
     
    protected void
    populateCustomColumns(List<org.kuali.rice.kns.web.ui.Column> customColumns, org.kuali.rice.kew.api.document.search.DocumentSearchResult searchResult)
     
    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.
    populateSearchResults(List<org.kuali.rice.kew.api.document.search.DocumentSearchResult> lookupResults)
     
    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.
    protected static void
     
    protected static String
    replaceCurrentUserToken(String value, org.kuali.rice.kim.api.identity.Person person)
     
    protected void
    Repopulate the fields indicating advanced/superuser search type.
    void
     
    void
     
    void
     
    protected void
    Override setRows in order to post-process and add documenttype-dependent fields
    protected void
    setRows(String documentTypeName)
    Sets the rows for the search criteria.
    boolean
     
    boolean
     
    protected void
    Handles toggling between form views.

    Methods inherited from class org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl

    getExternalBusinessObjectProperty, getExternalizableBusinessObjectClass, getExternalizableBusinessObjectFieldValues, getExternalizableBusinessObjectProperties, getPrimaryKeyFieldLabels, getSearchResults, getSearchResultsUnbounded, hasExternalBusinessObjectProperty, isExternalBusinessObjectProperty, isSearchUsingOnlyPrimaryKeyValues, removeExternalizableBusinessObjectFieldValues

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      getSearchResultsHelper in class org.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

      protected static String replaceCurrentUserToken(String value, org.kuali.rice.kim.api.identity.Person person)
    • 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

      protected static Set<String> 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 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

      protected static void replaceCurrentUserInFields(Map<String,String> fields)
    • 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:
      performLookup in interface org.kuali.rice.kns.lookup.LookupableHelperService
      Overrides:
      performLookup in class org.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:
      performCustomAction in interface org.kuali.rice.kns.lookup.LookupableHelperService
      Overrides:
      performCustomAction in class org.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:
      getInquiryUrl in interface org.kuali.rice.kns.lookup.LookupableHelperService
      Overrides:
      getInquiryUrl in class org.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

      protected org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData generateRouteLogUrl(String documentId)
    • 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

      protected boolean isFlagSet(String flagName)
      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

      protected String getSavedSearchName()
    • setRows

      protected void setRows()
      Override setRows in order to post-process and add documenttype-dependent fields
      Overrides:
      setRows in class org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
    • getFormFields

      protected org.kuali.rice.kew.impl.document.search.FormFields getFormFields()
      Returns wrapper around current form fields
    • setRows

      protected void setRows(String documentTypeName)
      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

      public String getSupplementalMenuBar()
      Specified by:
      getSupplementalMenuBar in interface org.kuali.rice.kns.lookup.LookupableHelperService
      Overrides:
      getSupplementalMenuBar in class org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
    • shouldDisplayHeaderNonMaintActions

      public boolean shouldDisplayHeaderNonMaintActions()
      Specified by:
      shouldDisplayHeaderNonMaintActions in interface org.kuali.rice.kns.lookup.LookupableHelperService
      Overrides:
      shouldDisplayHeaderNonMaintActions in class org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
    • shouldDisplayLookupCriteria

      public boolean shouldDisplayLookupCriteria()
      Specified by:
      shouldDisplayLookupCriteria in interface org.kuali.rice.kns.lookup.LookupableHelperService
      Overrides:
      shouldDisplayLookupCriteria in class org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
    • checkForAdditionalFields

      public boolean checkForAdditionalFields(Map<String,String> fieldValues)
      Determines if there should be more search fields rendered based on already entered search criteria, and generates additional form rows.
      Specified by:
      checkForAdditionalFields in interface org.kuali.rice.kns.lookup.LookupableHelperService
      Overrides:
      checkForAdditionalFields in class org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
    • getExtraField

      public org.kuali.rice.kns.web.ui.Field getExtraField()
      Specified by:
      getExtraField in interface org.kuali.rice.kns.lookup.LookupableHelperService
      Overrides:
      getExtraField in class org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl
    • performClear

      public void performClear(org.kuali.rice.kns.web.struts.form.LookupForm lookupForm)
      Specified by:
      performClear in interface org.kuali.rice.kns.lookup.LookupableHelperService
      Overrides:
      performClear in class org.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

      public void setDocumentSearchService(DocumentSearchService documentSearchService)
    • getDocumentSearchService

      public DocumentSearchService getDocumentSearchService()
    • getDocumentSearchCriteriaProcessor

      public DocumentSearchCriteriaProcessor getDocumentSearchCriteriaProcessor()
    • setDocumentSearchCriteriaProcessor

      public void setDocumentSearchCriteriaProcessor(DocumentSearchCriteriaProcessor documentSearchCriteriaProcessor)
    • getDocumentSearchCriteriaTranslator

      public DocumentSearchCriteriaTranslator getDocumentSearchCriteriaTranslator()
    • setDocumentSearchCriteriaTranslator

      public void setDocumentSearchCriteriaTranslator(DocumentSearchCriteriaTranslator documentSearchCriteriaTranslator)