public class DocumentSearchCriteriaProcessorKEWAdapter extends Object implements 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)
).
Modifier and Type | Field and Description |
---|---|
static String |
CLEARSAVED_SEARCH_FIELD
Name if the hidden input field containing the clear saved search flag
|
static String |
SUPERUSER_SEARCH_FIELD
Name if the hidden input field containing non-superuser/superuser search toggle state
|
Constructor and Description |
---|
DocumentSearchCriteriaProcessorKEWAdapter() |
Modifier and Type | Method and Description |
---|---|
protected void |
addHiddenFields(List<Row> rows,
boolean advancedSearch,
boolean superUserSearch) |
protected void |
applyApplicationDocumentStatusCustomizations(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 void |
applyRouteNodeNameCustomizations(Field field,
DocumentType documentType) |
protected List<Row> |
getDocumentAttributeRows(DocumentType documentType)
Returns fields for the search attributes defined on the document
|
protected List<RouteNode> |
getRouteNodesByDocumentType(DocumentType documentType,
boolean includeBlankNodes)
Return route nodes based on the document
|
List<Row> |
getRows(DocumentType documentType,
List<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<Row> |
loadRowsForAdvancedSearch(List<Row> defaultRows,
DocumentType documentType) |
protected List<Row> |
loadRowsForBasicSearch(List<Row> defaultRows,
DocumentType documentType) |
protected void |
loadRowsWithFields(List<Row> rowsToLoad,
List<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.
|
public static final String SUPERUSER_SEARCH_FIELD
public static final String CLEARSAVED_SEARCH_FIELD
public DocumentSearchCriteriaProcessorKEWAdapter()
public List<Row> getRows(DocumentType documentType, List<Row> defaultRows, boolean advancedSearch, boolean superUserSearch)
DocumentSearchCriteriaProcessor
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.
getRows
in interface DocumentSearchCriteriaProcessor
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 requestedprotected List<Row> loadRowsForAdvancedSearch(List<Row> defaultRows, DocumentType documentType)
protected List<Row> loadRowsForBasicSearch(List<Row> defaultRows, DocumentType documentType)
protected void loadRowsWithFields(List<Row> rowsToLoad, List<Row> defaultRows, String[] fieldNames, DocumentType documentType)
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 formprotected List<Row> getDocumentAttributeRows(DocumentType documentType)
protected void applyApplicationDocumentStatusCustomizations(Field field, DocumentType documentType)
field
- the applicationDocumentStatus fielddocumentType
- the document typeprotected List<RouteNode> getRouteNodesByDocumentType(DocumentType documentType, boolean includeBlankNodes)
documentType
- protected void applyRouteNodeNameCustomizations(Field field, DocumentType documentType)
protected void addHiddenFields(List<Row> rows, boolean advancedSearch, boolean superUserSearch)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.