Class DocumentSearchCriteriaProcessorKEWAdapter
- All Implemented Interfaces:
DocumentSearchCriteriaProcessor
Implementation note:
This implementation relies on applicationDocumentStatus, and dateApplicationDocumentStatusChanged conditional fields being defined in the DD for basic display purposes. These fields are conditionally shown depending on whether a document supporting application document statuses has been specified. Further, the applicationDocumentStatus field is dynamically switched to a multiselect when the document specifies an explicit enumeration of valid statuses (this control switching is something that is not possible via declarative DD, at the time of this writing).
In addition the routeNodeName field is dynamically populated with the list of route nodes for the specified document type.
Note: an alternative to programmatically providing dynamic select values is to define a value finder declaratively in
DD. KeyValueFinder however does not have access to request state, including the required document type, which would mean
resorting to GlobalVariables inspection. In reluctance to add yet another dependency on this external state, the fixups
are done programmatically in this class. (see applyApplicationDocumentStatusCustomizations(org.kuali.rice.kns.web.ui.Field, org.kuali.rice.kew.doctype.bo.DocumentType),
applyRouteNodeNameCustomizations(org.kuali.rice.kns.web.ui.Field, org.kuali.rice.kew.doctype.bo.DocumentType)).
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddHiddenFields(List<org.kuali.rice.kns.web.ui.Row> rows, boolean advancedSearch, boolean superUserSearch) protected voidapplyApplicationDocumentStatusCustomizations(org.kuali.rice.kns.web.ui.Field field, DocumentType documentType) Modifies the DataDictionary-defined applicationDocumentStatus field control to reflect whether the DocumentType has specified a list of valid application document statuses (in which case a select control is rendered), or whether it is free form (in which case a text control is rendered)protected voidapplyRouteNodeNameCustomizations(org.kuali.rice.kns.web.ui.Field field, DocumentType documentType) protected List<org.kuali.rice.kns.web.ui.Row> getDocumentAttributeRows(DocumentType documentType) Returns fields for the search attributes defined on the documentgetRouteNodesByDocumentType(DocumentType documentType, boolean includeBlankNodes) Return route nodes based on the documentList<org.kuali.rice.kns.web.ui.Row> getRows(DocumentType documentType, List<org.kuali.rice.kns.web.ui.Row> defaultRows, boolean advancedSearch, boolean superUserSearch) Constructs the list of rows and fields to display in the lookup criteria section of the document search screen.protected List<org.kuali.rice.kns.web.ui.Row> loadRowsForAdvancedSearch(List<org.kuali.rice.kns.web.ui.Row> defaultRows, DocumentType documentType) protected List<org.kuali.rice.kns.web.ui.Row> loadRowsForBasicSearch(List<org.kuali.rice.kns.web.ui.Row> defaultRows, DocumentType documentType) protected voidloadRowsWithFields(List<org.kuali.rice.kns.web.ui.Row> rowsToLoad, List<org.kuali.rice.kns.web.ui.Row> defaultRows, String[] fieldNames, DocumentType documentType) Generates the document search form fields given the DataDictionary-defined fields, the DocumentType, and whether basic, detailed, or superuser search is being rendered.
-
Field Details
-
SUPERUSER_SEARCH_FIELD
Name if the hidden input field containing non-superuser/superuser search toggle state- See Also:
-
CLEARSAVED_SEARCH_FIELD
Name if the hidden input field containing the clear saved search flag- See Also:
-
-
Constructor Details
-
DocumentSearchCriteriaProcessorKEWAdapter
public DocumentSearchCriteriaProcessorKEWAdapter()
-
-
Method Details
-
getRows
public List<org.kuali.rice.kns.web.ui.Row> getRows(DocumentType documentType, List<org.kuali.rice.kns.web.ui.Row> defaultRows, boolean advancedSearch, boolean superUserSearch) Description copied from interface:DocumentSearchCriteriaProcessorConstructs the list of rows and fields to display in the lookup criteria section of the document search screen. The documentType parameter passed to this method will generally be supplied in cases where the document type name was supplied to the lookup via a query parameter or when refreshing the criteria after making a change to it (like the user doing a document type lookup to fill in the value and then returning it back to the document search).This method should look at the given document type (if there is one) to determine if there are any custom rows to render for that document type. It should also look at the request for detailed and super user search and adjust the rows accordingly for either of those conditions.
- Specified by:
getRowsin interfaceDocumentSearchCriteriaProcessor- Parameters:
documentType- supplies the document type in use on this search if one is specified, will be null otherwisedefaultRows- the default set of rows that are supplied from the data dictionary for the document searchadvancedSearch- indicates whether or not a detailed search has been requestedsuperUserSearch- indicates whether or not a super user search has been requested- Returns:
- the rows to render is the criteria section of the document search.
-
loadRowsForAdvancedSearch
protected List<org.kuali.rice.kns.web.ui.Row> loadRowsForAdvancedSearch(List<org.kuali.rice.kns.web.ui.Row> defaultRows, DocumentType documentType) -
loadRowsForBasicSearch
protected List<org.kuali.rice.kns.web.ui.Row> loadRowsForBasicSearch(List<org.kuali.rice.kns.web.ui.Row> defaultRows, DocumentType documentType) -
loadRowsWithFields
protected void loadRowsWithFields(List<org.kuali.rice.kns.web.ui.Row> rowsToLoad, List<org.kuali.rice.kns.web.ui.Row> defaultRows, String[] fieldNames, DocumentType documentType) Generates the document search form fields given the DataDictionary-defined fields, the DocumentType, and whether basic, detailed, or superuser search is being rendered. If the document type policy DOCUMENT_STATUS_POLICY is set to "app", or "both" Then display the doc search criteria fields. If the documentType.validApplicationStatuses are defined, then the criteria field is a drop down. If the validApplication statuses are NOT defined, then the criteria field is a text input.- Parameters:
rowsToLoad- the list of rows to updatedefaultRows- the DataDictionary-derived default form rowsfieldNames- a list of field names corresponding to the fields to render according to the current document search statedocumentType- the document type, if specified in the search form
-
getDocumentAttributeRows
Returns fields for the search attributes defined on the document -
applyApplicationDocumentStatusCustomizations
protected void applyApplicationDocumentStatusCustomizations(org.kuali.rice.kns.web.ui.Field field, DocumentType documentType) Modifies the DataDictionary-defined applicationDocumentStatus field control to reflect whether the DocumentType has specified a list of valid application document statuses (in which case a select control is rendered), or whether it is free form (in which case a text control is rendered)- Parameters:
field- the applicationDocumentStatus fielddocumentType- the document type
-
getRouteNodesByDocumentType
protected List<RouteNode> getRouteNodesByDocumentType(DocumentType documentType, boolean includeBlankNodes) Return route nodes based on the document- Parameters:
documentType-- Returns:
- List
-
applyRouteNodeNameCustomizations
protected void applyRouteNodeNameCustomizations(org.kuali.rice.kns.web.ui.Field field, DocumentType documentType) -
addHiddenFields
protected void addHiddenFields(List<org.kuali.rice.kns.web.ui.Row> rows, boolean advancedSearch, boolean superUserSearch)
-