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:
  • Constructor Details

    • DocumentSearchCriteriaBoLookupableHelperService

      public DocumentSearchCriteriaBoLookupableHelperService()
  • Method Details

    • getSearchResultsHelper

      protected List<? extends BusinessObject> getSearchResultsHelper(Map<String,String> fieldValues, boolean unbounded)
      Overrides:
      getSearchResultsHelper in class KualiLookupableHelperServiceImpl
    • populateResultWarningMessages

      protected void populateResultWarningMessages(DocumentSearchResults searchResults)
      Inspects the lookup results to determine if any warning messages should be published to the message map.
    • applyCriteriaChangesToFields

      protected void applyCriteriaChangesToFields(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 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<DocumentSearchResult> lookupResults)
    • performLookup

      public Collection<? extends BusinessObject> performLookup(LookupForm lookupForm, Collection<ResultRow> resultTable, boolean bounded)
      Specified by:
      performLookup in interface LookupableHelperService
      Overrides:
      performLookup in class AbstractLookupableHelperServiceImpl
    • 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:
      performCustomAction in interface LookupableHelperService
      Overrides:
      performCustomAction in class AbstractLookupableHelperServiceImpl
      Parameters:
      ignoreErrors -
      Returns:
      whether to rerun the previous search; false in cases 1-3 because we are just updating the form
    • getInquiryUrl

      public HtmlData getInquiryUrl(BusinessObject bo, String propertyName)
      Custom implementation of getInquiryUrl that sets up doc handler link.
      Specified by:
      getInquiryUrl in interface LookupableHelperService
      Overrides:
      getInquiryUrl in class AbstractLookupableHelperServiceImpl
    • 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

      protected HtmlData.AnchorHtmlData generateRouteLogUrl(String documentId)
    • generateInitiatorUrl

      protected 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 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 LookupableHelperService
      Overrides:
      getSupplementalMenuBar in class AbstractLookupableHelperServiceImpl
    • shouldDisplayHeaderNonMaintActions

      public boolean shouldDisplayHeaderNonMaintActions()
      Specified by:
      shouldDisplayHeaderNonMaintActions in interface LookupableHelperService
      Overrides:
      shouldDisplayHeaderNonMaintActions in class AbstractLookupableHelperServiceImpl
    • shouldDisplayLookupCriteria

      public boolean shouldDisplayLookupCriteria()
      Specified by:
      shouldDisplayLookupCriteria in interface LookupableHelperService
      Overrides:
      shouldDisplayLookupCriteria in class 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 LookupableHelperService
      Overrides:
      checkForAdditionalFields in class AbstractLookupableHelperServiceImpl
    • getExtraField

      public Field getExtraField()
      Specified by:
      getExtraField in interface LookupableHelperService
      Overrides:
      getExtraField in class AbstractLookupableHelperServiceImpl
    • performClear

      public void performClear(LookupForm lookupForm)
      Specified by:
      performClear in interface LookupableHelperService
      Overrides:
      performClear in class AbstractLookupableHelperServiceImpl
    • 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

      protected void populateCustomColumns(List<Column> customColumns, 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)