|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ViewHelperService
Provides methods for implementing the various phases of a View
Method Summary | |
---|---|
void |
addCustomContainerComponents(ViewModel model,
Container container)
Hook for creating new components with code and adding them to a container |
void |
applyDefaultValues(Component component)
Iterates through the view components picking up data fields and applying an default value configured |
void |
applyDefaultValuesForCollectionLine(CollectionGroup collectionGroup,
Object line)
Populate default values the model backing a line in a collection group. |
String |
buildGrowlScript()
Builds JS script that will invoke the show growl method to display a growl message when the page is rendered |
void |
buildInquiryLink(Object dataObject,
String propertyName,
Inquiry inquiry)
Invoked by the Inquiry widget to build the inquiry link |
Object |
getDefaultValueForField(Object object,
DataField dataField)
Retrieves the default value that is configured for the given data field |
ExpressionEvaluatorFactory |
getExpressionEvaluatorFactory()
Gets an expression evaluator factory for use with the current view. |
void |
performCustomApplyModel(LifecycleElement component,
Object model)
Hook for service overrides to perform custom apply model logic on the component |
void |
performCustomFinalize(LifecycleElement component,
Object model,
LifecycleElement parent)
Hook for service overrides to perform custom component finalization |
void |
performCustomInitialization(LifecycleElement component)
Hook for service overrides to perform custom initialization on the component |
void |
performCustomViewFinalize(Object model)
Hook for service overrides to perform view component finalization |
void |
performCustomViewInitialization(Object model)
Hook for service overrides to perform custom initialization prior to view initialization. |
void |
populateDefaultValueForField(Object object,
DataField dataField,
String bindingPath)
Applies the default value configured for the given field (if any) to the line given object property that is determined by the given binding path |
void |
populateViewFromRequestParameters(Map<String,String> parameters)
Uses reflection to find all fields defined on the View instance that have the
RequestParameter annotation (which indicates the field may be populated by the
request). |
void |
processAfterAddLine(ViewModel model,
Object addLine,
String collectionId,
String collectionPath,
boolean isValidLine)
Hook for service overrides to process the new collection line after it has been added to the collection |
void |
processAfterDeleteLine(ViewModel model,
String collectionId,
String collectionPath,
int lineIndex)
Hook for service overrides to process the collection line after it has been deleted |
void |
processAfterSaveLine(ViewModel model,
Object lineObject,
String collectionId,
String collectionPath)
Hook for service overrides to process the save collection line after it has been validated |
void |
processBeforeAddLine(ViewModel model,
Object addLine,
String collectionId,
String collectionPath)
Hook for service overrides to process the new collection line before it is added to the collection |
void |
processBeforeSaveLine(ViewModel model,
Object lineObject,
String collectionId,
String collectionPath)
Hook for service overrides to process the save collection line before it is validated |
void |
processCollectionAddBlankLine(ViewModel model,
String collectionId,
String collectionPath)
Adds a blank line to the collection |
void |
processCollectionAddLine(ViewModel model,
String collectionId,
String collectionPath)
Invoked when the add line action is chosen for a collection. |
void |
processCollectionDeleteLine(ViewModel model,
String collectionId,
String collectionPath,
int lineIndex)
Invoked when the delete line action is chosen for a collection. |
void |
processCollectionSaveLine(ViewModel model,
String collectionId,
String collectionPath,
int selectedLineIndex)
Invoked when the save line action is chosen for a collection. |
void |
processMultipleValueLookupResults(ViewModel model,
String collectionId,
String collectionPath,
String multiValueReturnFields,
String lookupResultValues)
Process the results returned from a multi-value lookup populating the lines for the collection given by the path |
void |
refreshReference(Object parentObject,
String referenceObjectName)
Perform a database or data dictionary based refresh of a specific property object |
void |
refreshReferences(String referencesToRefresh)
Update the reference objects listed in referencesToRefresh of the model |
void |
retrieveEditModesAndActionFlags()
Invokes the configured PresentationController and Authorizer for
the view to get the exported action flags and edit modes that can be used in conditional
logic |
void |
setViewContext()
Sets up the view context which will be available to other components through their context for conditional logic evaluation. |
Method Detail |
---|
void performCustomViewInitialization(Object model)
model
- The model.void performCustomInitialization(LifecycleElement component)
component
- component instance to initializevoid performCustomApplyModel(LifecycleElement component, Object model)
component
- component instance to apply model tomodel
- Top level object containing the data (could be the model or a top level business
object, dto)void performCustomFinalize(LifecycleElement component, Object model, LifecycleElement parent)
component
- component instance to updatemodel
- Top level object containing the dataparent
- Parent component for the component being finalizedvoid performCustomViewFinalize(Object model)
model
- Top level object containing the datavoid processBeforeAddLine(ViewModel model, Object addLine, String collectionId, String collectionPath)
model
- object instance that contain's the view's dataaddLine
- the new line instance to be processedcollectionId
- the id of the collection being added tocollectionPath
- the path to the collection being modifiedvoid processAfterAddLine(ViewModel model, Object addLine, String collectionId, String collectionPath, boolean isValidLine)
model
- object instance that contain's the views dataaddLine
- the new line that was addedcollectionId
- the id of the collection being added tocollectionPath
- the path to the collection being modifiedisValidLine
- indicates if the line is validvoid processBeforeSaveLine(ViewModel model, Object lineObject, String collectionId, String collectionPath)
model
- object instance that contain's the views datalineObject
- the line instance to be processedcollectionId
- the id of the collection being added tocollectionPath
- the path to the collection being modifiedvoid processAfterSaveLine(ViewModel model, Object lineObject, String collectionId, String collectionPath)
model
- object instance that contains the views datalineObject
- the line instance to be processedcollectionId
- the id of the collection being added tocollectionPath
- the path to the collection being modifiedvoid processAfterDeleteLine(ViewModel model, String collectionId, String collectionPath, int lineIndex)
model
- object instance that contains the views datacollectionId
- the id of the collection being added tocollectionPath
- the path to the collection being modifiedlineIndex
- index of the line that was deletedvoid addCustomContainerComponents(ViewModel model, Container container)
Subclasses can override this method to check for one or more containers by id and then adding components created in code. This is invoked before the initialize method on the container component, so the full lifecycle will be run on the components returned.
New components instances can be retrieved using ComponentFactory
model
- object containing the view datacontainer
- container instance to add components tovoid processCollectionAddLine(ViewModel model, String collectionId, String collectionPath)
MessageMap
model
- Top level object containing the view data including the
collection and new linecollectionId
- the id of the collection being added tocollectionPath
- the path to the collection being modifiedvoid processCollectionAddBlankLine(ViewModel model, String collectionId, String collectionPath)
Adds a new collection item to the collection and applies any default values.
model
- Top level object containing the view data including the collection and new linecollectionId
- the id of the collection being added tocollectionPath
- the path to the collection being modifiedvoid processCollectionSaveLine(ViewModel model, String collectionId, String collectionPath, int selectedLineIndex)
model
- Top level object containing the view data including the collection and new linecollectionId
- the id of the collection being added tocollectionPath
- the path to the collection being modifiedselectedLineIndex
- The index within the collection of the line to save.void processCollectionDeleteLine(ViewModel model, String collectionId, String collectionPath, int lineIndex)
MessageMap
model
- Top level object containing the view data including the collectioncollectionId
- the id of the collection being added tocollectionPath
- the path to the collection being modifiedlineIndex
- index of the collection line that was selected for removalvoid processMultipleValueLookupResults(ViewModel model, String collectionId, String collectionPath, String multiValueReturnFields, String lookupResultValues)
model
- object containing the view datacollectionId
- the id of the collection being added tocollectionPath
- the path to the collection being modifiedmultiValueReturnFields
- String containing the selected line field nameslookupResultValues
- String containing the selected line valuesvoid buildInquiryLink(Object dataObject, String propertyName, Inquiry inquiry)
Inquiry
widget to build the inquiry link
Note this is used primarily for custom Inquirable
implementations to customize the inquiry class or parameters for an
inquiry. Instead of building the full inquiry link, implementations can
make a callback to
org.kuali.rice.krad.uif.widget.Inquiry.buildInquiryLink(Object, String,
Class>, Map
dataObject
- parent object for the inquiry propertypropertyName
- name of the property the inquiry is being built forinquiry
- instance of the inquiry widget being built for the propertyvoid setViewContext()
void retrieveEditModesAndActionFlags()
PresentationController
and Authorizer for
the view to get the exported action flags and edit modes that can be used in conditional
logic
void refreshReference(Object parentObject, String referenceObjectName)
The object needs to be of type PersistableBusinessObject.
parentObject
- parent object that references the object to be refreshedreferenceObjectName
- property name of the parent object to be refreshedvoid refreshReferences(String referencesToRefresh)
The the individual references in the referencesToRefresh string are separated by KRADConstants.REFERENCES_TO_REFRESH_SEPARATOR).
referencesToRefresh
- list of references to refresh (Object getDefaultValueForField(Object object, DataField dataField)
The field's default value is determined in the following order:
object
- object that should be populateddataField
- field to retrieve default value for
void populateDefaultValueForField(Object object, DataField dataField, String bindingPath)
object
- object that should be populateddataField
- field to check for configured default valuebindingPath
- path to the property on the object that should be populatedString buildGrowlScript()
A growl call will be created for any explicit growl messages added to the message map.
Growls are only generated if @{link org.kuali.rice.krad.uif.view.View#isGrowlMessagingEnabled()} is enabled. If not, the growl messages are set as info messages for the page
void applyDefaultValues(Component component)
component
- component that should be checked for default valuesvoid applyDefaultValuesForCollectionLine(CollectionGroup collectionGroup, Object line)
collectionGroup
- The collection group.line
- The model object backing the line.void populateViewFromRequestParameters(Map<String,String> parameters)
View
instance that have the
RequestParameter
annotation (which indicates the field may be populated by the
request).
The View
instance is inspected for fields that have the
RequestParameter
annotation and if corresponding parameters are found in the
request parameter map, the request value is used to set the view property. The Map of
parameter name/values that match are placed in the view so they can be later retrieved to
rebuild the view. Custom ViewServiceHelper
implementations can add additional
parameter key/value pairs to the returned map if necessary.
For each field found, if there is a corresponding key/value pair in the request parameters,
the value is used to populate the field. In addition, any conditional properties of
PropertyReplacers
configured for the field are cleared so that the request
parameter value does not get overridden by the dictionary conditional logic
parameters
- The request parameters that apply to the view.RequestParameter
ExpressionEvaluatorFactory getExpressionEvaluatorFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |