org.kuali.rice.kew.docsearch
Class DocumentSearchCustomizationMediatorImpl

java.lang.Object
  extended by org.kuali.rice.kew.docsearch.DocumentSearchCustomizationMediatorImpl
All Implemented Interfaces:
DocumentSearchCustomizationMediator

public class DocumentSearchCustomizationMediatorImpl
extends Object
implements DocumentSearchCustomizationMediator

Reference implementation of DocumentSearchCustomizationMediator.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
DocumentSearchCustomizationMediatorImpl()
           
 
Method Summary
 DocumentSearchCriteria customizeClearCriteria(DocumentType documentType, DocumentSearchCriteria documentSearchCriteria)
          Optionally performs a custom clearing of the given document search criteria if the given document type implements a customized clear algorithm.
 DocumentSearchCriteria customizeCriteria(DocumentType documentType, DocumentSearchCriteria documentSearchCriteria)
          Optionally performs customization of the given document search criteria in the cases where the document type implements criteria customization.
 DocumentSearchResultValues customizeResults(DocumentType documentType, DocumentSearchCriteria documentSearchCriteria, DocumentSearchResults results)
          Optionally performs customization on the given set of document search results.
 DocumentSearchResultSetConfiguration customizeResultSetConfiguration(DocumentType documentType, DocumentSearchCriteria documentSearchCriteria)
          Optionally provides configuration information that allows for document search result set customization to occur.
protected  List<AttributeFields> flattenOrderedFieldMap(LinkedHashMap<String,AttributeFields> orderedFieldMap)
           
 DocumentSearchCriteriaConfiguration getDocumentSearchCriteriaConfiguration(DocumentType documentType)
          Retrieves the document search criteria configuration for the given document type.
protected  DocumentSearchCustomizationHandlerService loadCustomizationService(String applicationId)
           
protected  void mergeAttributeFields(List<AttributeFields> attributeFieldsList, LinkedHashMap<String,AttributeFields> orderedFieldMap)
           
 List<RemotableAttributeError> validateLookupFieldParameters(DocumentType documentType, DocumentSearchCriteria documentSearchCriteria)
          Performs optional validation of document search criteria prior to execution of the search.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentSearchCustomizationMediatorImpl

public DocumentSearchCustomizationMediatorImpl()
Method Detail

getDocumentSearchCriteriaConfiguration

public DocumentSearchCriteriaConfiguration getDocumentSearchCriteriaConfiguration(DocumentType documentType)
Description copied from interface: DocumentSearchCustomizationMediator
Retrieves the document search criteria configuration for the given document type. This should include attribute fields that should be included in the document search user interface when displaying criteria by which a user can search for documents. If this method returns null then no additional criteria should be presented on the search screen.

Specified by:
getDocumentSearchCriteriaConfiguration in interface DocumentSearchCustomizationMediator
Parameters:
documentType - the document type for which to find document search criteria configuration, must not be null
Returns:
configuration information containing additional criteria (beyond the default set) which should be displayed to the user when performing a search against documents of the given type, if null is returned this indicates that the default document search criteria configuration should be used

validateLookupFieldParameters

public List<RemotableAttributeError> validateLookupFieldParameters(DocumentType documentType,
                                                                   DocumentSearchCriteria documentSearchCriteria)
Description copied from interface: DocumentSearchCustomizationMediator
Performs optional validation of document search criteria prior to execution of the search.

Specified by:
validateLookupFieldParameters in interface DocumentSearchCustomizationMediator
Parameters:
documentType - the document type against which the lookup is being performed
documentSearchCriteria - the criteria representing the submission of the document search
Returns:
a list of error messages generated by the validation, may an empty list in which case the calling code may safely ignore the response and assume that the given criteria validated successfully

customizeCriteria

public DocumentSearchCriteria customizeCriteria(DocumentType documentType,
                                                DocumentSearchCriteria documentSearchCriteria)
Description copied from interface: DocumentSearchCustomizationMediator
Optionally performs customization of the given document search criteria in the cases where the document type implements criteria customization. If this method returns a non-null value, then the calling code should use the returned criteria in order to execute the search. If this method returns a null value, it means the criteria that was given did not require any customization. In this case, the calling code should proceed with search execution using the originally provided criteria.

Specified by:
customizeCriteria in interface DocumentSearchCustomizationMediator
Parameters:
documentType - the document type against which to perform the criteria customization, should never be null
documentSearchCriteria - the criteria to use as the starting point for customization
Returns:
a customized version of the given criteria, or null if the criteria was not customized

customizeClearCriteria

public DocumentSearchCriteria customizeClearCriteria(DocumentType documentType,
                                                     DocumentSearchCriteria documentSearchCriteria)
Description copied from interface: DocumentSearchCustomizationMediator
Optionally performs a custom clearing of the given document search criteria if the given document type implements a customized clear algorithm. If this method returns a non-null value, then the value returned should be instated by the calling code as the "cleared" version of the criteria. If null is returned, then the default implementation of criteria clearing should be used.

Specified by:
customizeClearCriteria in interface DocumentSearchCustomizationMediator
Parameters:
documentType - the document type against which to check for a custom implementation of criteria clearing
documentSearchCriteria - the current criteria of the document search prior to being cleared
Returns:
the result of clearing the criteria, if this returns null it means the given document type does not implement custom clearing and the default behavior should be used

customizeResults

public DocumentSearchResultValues customizeResults(DocumentType documentType,
                                                   DocumentSearchCriteria documentSearchCriteria,
                                                   DocumentSearchResults results)
Description copied from interface: DocumentSearchCustomizationMediator
Optionally performs customization on the given set of document search results. This could include changing existing document values or synthesizing new ones. The results of this method include a list of DocumentSearchResultValue objects, each of which are mapped to a specific document id from the results and include additional key-value pairs for customized or synthesized values for that document. This method can return a null value if no customization was performed.

Specified by:
customizeResults in interface DocumentSearchCustomizationMediator
Parameters:
documentType - the document type to use when determining what customization logic (if any) should be invoked
documentSearchCriteria - the criteria of the document search which produced the supplied results
results - the results of the document search which are being considered for customization
Returns:
the customized result values, or null if not result customization was performed

customizeResultSetConfiguration

public DocumentSearchResultSetConfiguration customizeResultSetConfiguration(DocumentType documentType,
                                                                            DocumentSearchCriteria documentSearchCriteria)
Description copied from interface: DocumentSearchCustomizationMediator
Optionally provides configuration information that allows for document search result set customization to occur. The resulting DocumentSearchResultSetConfiguration can be used by the calling code to determine how best to render the lookup results.

Specified by:
customizeResultSetConfiguration in interface DocumentSearchCustomizationMediator
Parameters:
documentType - the document type for which to customize result set configuration
documentSearchCriteria - the criteria that was used to perform the lookup
Returns:
the customized document search result set configuration, or null if no result set customization was performed

loadCustomizationService

protected DocumentSearchCustomizationHandlerService loadCustomizationService(String applicationId)

mergeAttributeFields

protected void mergeAttributeFields(List<AttributeFields> attributeFieldsList,
                                    LinkedHashMap<String,AttributeFields> orderedFieldMap)

flattenOrderedFieldMap

protected List<AttributeFields> flattenOrderedFieldMap(LinkedHashMap<String,AttributeFields> orderedFieldMap)


Copyright © 2005-2011 The Kuali Foundation. All Rights Reserved.