org.kuali.rice.krad.uif.service.impl
Class ViewHelperServiceImpl

java.lang.Object
  extended by org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl
All Implemented Interfaces:
Serializable, ViewHelperService
Direct Known Subclasses:
DocumentViewHelperServiceImpl, InquirableImpl, LookupableImpl, MaintainableImpl, UIfComponentsViewHelperServiceImpl, UifGeneratedTestViewHelperServiceImpl

public class ViewHelperServiceImpl
extends Object
implements ViewHelperService, Serializable

Default Implementation of ViewHelperService

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Constructor Summary
ViewHelperServiceImpl()
           
 
Method Summary
protected  void addClientSideStateForComponent(Component component, Map<String,Object> clientSideState)
          Reflects the class for the given component to find any fields that are annotated with ClientSideState and adds the corresponding property name/value pair to the client side state map
protected  void addCustomContainerComponents(View view, Object model, Container container)
          Hook for creating new components with code and adding them to a container
protected  void addLine(Collection<Object> collection, Object addLine, boolean insertFirst)
          Add addLine to collection while giving derived classes an opportunity to override for things like sorting.
protected  String adjustIdIfNecessary(String id, Map<String,Integer> visitedIds)
          Checks against the visited ids to see if the id is duplicate, if so it is adjusted to make an unique id by appending an unique sequence number
protected  void applyAuthorizationAndPresentationLogic(View view, Component component, ViewModel model)
          Invokes the view's configured ViewAuthorizer and ViewPresentationController to set state of the component
protected  void applyDefaultValues(View view, Component component, Object model)
          Iterates through the view components picking up data fields and applying an default value configured
 void applyDefaultValuesForCollectionLine(View view, Object model, CollectionGroup collectionGroup, Object line)
          Applies configured default values for the line fields to the line instance
protected  String buildClientSideStateScript(View view, Map<String,Object> clientSideState, boolean updateOnly)
          Builds script that will initialize configuration parameters and component state on the client
protected  String buildGrowlScript(View view)
          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)
          Finds the Inquirable configured for the given data object class and delegates to it for building the inquiry URL
 void cleanViewAfterRender(View view)
          Invoked after the view has been rendered to clear out objects that are not necessary to keep around for the post, this helps reduce the view size and overall cost to store the form in session
protected  AttributeDefinition findNestedDictionaryAttribute(View view, DataField field, String parentPath, String propertyPath)
          Recursively drills down the property path (if nested) to find an AttributeDefinition, the first attribute definition found will be returned
 Map<String,Object> getCommonContext(View view, Component component)
          Gets global objects for the context map and pushes them to the context for the component
 ConfigurationService getConfigurationService()
          Gets the configuration service
protected  DataDictionaryService getDataDictionaryService()
          Gets the data dictionary service
protected  ExpressionEvaluatorService getExpressionEvaluatorService()
          Gets the expression evaluator service
protected  Map<String,Object> getPreModelContext(View view)
          Returns the general context that is available before the apply model phase (during the initialize phase)
 ViewDictionaryService getViewDictionaryService()
          Gets the view dictionary service
protected  void initializeDataFieldFromDataDictionary(View view, DataField field)
          Sets properties of the InputField (if blank) to the corresponding attribute entry in the data dictionary
protected  void invokeMethodFinalizer(View view, Component component, Object model)
          Invokes the finalize method for the component (if configured) and sets the render output for the component to the returned method string (if method is not a void type)
protected  void logAndThrowRuntime(String message)
          Log the error and throw a new runtime exception
protected  boolean performAddLineValidation(View view, CollectionGroup collectionGroup, Object model, Object addLine)
          Performs validation on the new collection line before it is added to the corresponding collection
 void performApplyModel(View view, Object model)
          Executes the ApplyModel phase.
protected  void performComponentApplyModel(View view, Component component, Object model, Map<String,Integer> visitedIds)
          Applies the model data to a component of the View instance
protected  void performComponentFinalize(View view, Component component, Object model, Component parent, Map<String,Object> clientSideState)
          Update state of the given component and does final preparation for rendering
 void performComponentInitialization(View view, Object model, Component component)
          Performs initialization of a component by these steps: For DataField instances, set defaults from the data dictionary. Invoke the initialize method on the component.
 void performComponentLifecycle(View view, Object model, Component component, String origId)
          Performs the complete component lifecycle on the component passed in, in this order: performComponentInitialization, performComponentApplyModel, and performComponentFinalize.
protected  void performCustomApplyModel(View view, Component component, Object model)
          Hook for service overrides to perform custom apply model logic on the component
protected  void performCustomFinalize(View view, Component component, Object model, Component parent)
          Hook for service overrides to perform custom component finalization
protected  void performCustomInitialization(View view, Component component)
          Hook for service overrides to perform custom initialization on the component
protected  boolean performDeleteLineValidation(View view, CollectionGroup collectionGroup, Object deleteLine)
          Performs validation on the collection line before it is removed from the corresponding collection
 void performFinalize(View view, Object model)
          The last phase before the view is rendered.
 void performInitialization(View view, Object model)
          Performs the Initialization phase for the View.
protected  void populateDefaultValueForField(View view, 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(View view, 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).
protected  void processAfterAddLine(View view, CollectionGroup collectionGroup, Object model, Object addLine)
          Hook for service overrides to process the new collection line after it has been added to the collection
protected  void processAfterDeleteLine(View view, CollectionGroup collectionGroup, Object model, int lineIndex)
          Hook for service overrides to process the collection line after it has been deleted
protected  void processAfterSaveLine(View view, CollectionGroup collectionGroup, Object model, Object addLine)
          Hook for service overrides to process the save collection line after it has been validated
protected  void processAnyRemoteFieldsHolder(View view, Object model, Container container)
          Iterates through the containers configured items checking for RemotableFieldsHolder, if found the holder is invoked to retrieved the remotable fields and translate to attribute fields.
protected  void processBeforeAddLine(View view, CollectionGroup collectionGroup, Object model, Object addLine)
          Hook for service overrides to process the new collection line before it is added to the collection
protected  void processBeforeSaveLine(View view, CollectionGroup collectionGroup, Object model, Object addLine)
          Hook for service overrides to process the save collection line before it is validated
 void processCollectionAddBlankLine(View view, Object model, String collectionPath)
          Adds a blank line to the collection
 void processCollectionAddLine(View view, Object model, String collectionPath)
          Invoked when the add line action is chosen for a collection.
 void processCollectionDeleteLine(View view, Object model, String collectionPath, int lineIndex)
          Invoked when the delete line action is chosen for a collection.
 void processCollectionSaveLine(View view, Object model, String collectionPath, int selectedLineIndex)
          Invoked when the save line action is chosen for a collection.
 void processMultipleValueLookupResults(View view, Object model, String collectionPath, String lookupResultValues)
          Process the results returned from a multi-value lookup populating the lines for the collection given by the path
protected  void retrieveEditModesAndActionFlags(View view, UifFormBase model)
          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
protected  void runComponentModifiers(View view, Component component, Object model, String runPhase)
          Runs any configured ComponentModifiers for the given component that match the given run phase and who run condition evaluation succeeds
 void setConfigurationService(ConfigurationService configurationService)
          Sets the configuration service
 void setDataDictionaryService(DataDictionaryService dataDictionaryService)
          Sets the data dictionary service
 void setExpressionEvaluatorService(ExpressionEvaluatorService expressionEvaluatorService)
          Sets the expression evaluator service
protected  void setViewContext(View view, Object model)
          Sets up the view context which will be available to other components through their context for conditional logic evaluation
 void setViewDictionaryService(ViewDictionaryService viewDictionaryService)
          Sets the view dictionary service
protected  void syncClientSideStateForComponent(Component component, Map<String,Object> clientSideState)
          Updates the properties of the given component instance with the value found from the corresponding map of client state (if found)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewHelperServiceImpl

public ViewHelperServiceImpl()
Method Detail

populateViewFromRequestParameters

public void populateViewFromRequestParameters(View view,
                                              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).

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

Specified by:
populateViewFromRequestParameters in interface ViewHelperService
See Also:
ViewHelperService.populateViewFromRequestParameters(org.kuali.rice.krad.uif.view.View, java.util.Map)

performInitialization

public void performInitialization(View view,
                                  Object model)
Description copied from interface: ViewHelperService
Performs the Initialization phase for the View. During this phase each component of the tree is invoked to setup state based on the configuration and request options.

The initialize phase is only called once per View lifecycle

Note the View instance also contains the context Map that was created based on the parameters sent to the view service

Specified by:
performInitialization in interface ViewHelperService
Parameters:
view - - View instance that should be initialized
model - - object instance containing the view data
See Also:
ViewHelperService.performInitialization(org.kuali.rice.krad.uif.view.View, java.lang.Object)

performComponentLifecycle

public void performComponentLifecycle(View view,
                                      Object model,
                                      Component component,
                                      String origId)
Performs the complete component lifecycle on the component passed in, in this order: performComponentInitialization, performComponentApplyModel, and performComponentFinalize.

Specified by:
performComponentLifecycle in interface ViewHelperService
Parameters:
view - - view instance the component belongs to
model - - object containing the full view data
component - - component instance to perform lifecycle for
origId - - id of the component within the view, used to pull the current component from the view
See Also:
org.kuali.rice.krad.uif.service.ViewHelperService#performComponentLifecycle( org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component, java.lang.String), #performComponentInitialization(org.kuali.rice.krad.uif.view.View, Object, org.kuali.rice.krad.uif.component.Component)}, #performComponentApplyModel(View, Component, Object)}, #performComponentFinalize(View, Component, Object, Component, Map)}

performComponentInitialization

public void performComponentInitialization(View view,
                                           Object model,
                                           Component component)
Performs initialization of a component by these steps:

Note the order various initialize points are called, this can sometimes be an important factor to consider when initializing a component

Specified by:
performComponentInitialization in interface ViewHelperService
Parameters:
view - - view instance the component belongs to
model - - object instance containing the view data
component - - component instance that should be initialized
Throws:
RiceRuntimeException - if the component id or factoryId is not specified
See Also:
ViewHelperService.performComponentInitialization(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component)

processAnyRemoteFieldsHolder

protected void processAnyRemoteFieldsHolder(View view,
                                            Object model,
                                            Container container)
Iterates through the containers configured items checking for RemotableFieldsHolder, if found the holder is invoked to retrieved the remotable fields and translate to attribute fields. The translated list is then inserted into the container item list at the position of the holder

Parameters:
view - - view instance containing the container
model - - object instance containing the view data
container - - container instance to check for any remotable fields holder

initializeDataFieldFromDataDictionary

protected void initializeDataFieldFromDataDictionary(View view,
                                                     DataField field)
Sets properties of the InputField (if blank) to the corresponding attribute entry in the data dictionary

Parameters:
view - - view instance containing the field
field - - data field instance to initialize

findNestedDictionaryAttribute

protected AttributeDefinition findNestedDictionaryAttribute(View view,
                                                            DataField field,
                                                            String parentPath,
                                                            String propertyPath)
Recursively drills down the property path (if nested) to find an AttributeDefinition, the first attribute definition found will be returned

e.g. suppose parentPath is 'document' and propertyPath is 'account.subAccount.name', first the property type for document will be retrieved using the view metadata and used as the dictionary entry, with the propertyPath as the dictionary attribute, if an attribute definition exists it will be returned. Else, the first part of the property path is added to the parent, making the parentPath 'document.account' and the propertyPath 'subAccount.name', the method is then called again to perform the process with those parameters. The recursion continues until an attribute field is found, or the propertyPath is no longer nested

Parameters:
view - - view instance containing the field
field - - field we are attempting to find a supporting attribute definition for
parentPath - - parent path to use for getting the dictionary entry
propertyPath - - path of the property relative to the parent, to use as dictionary attribute and to drill down on
Returns:
AttributeDefinition if found, or Null

performApplyModel

public void performApplyModel(View view,
                              Object model)
Description copied from interface: ViewHelperService
Executes the ApplyModel phase. During this phase each component of the tree if invoked to setup any state based on the given model data

Part of the view lifecycle that applies the model data to the view. Should be called after the model has been populated before the view is rendered. The main things that occur during this phase are:

The update phase can be called multiple times for the view's lifecycle (typically only once per request)

Specified by:
performApplyModel in interface ViewHelperService
Parameters:
view - - View instance that the model should be applied to
model - - Top level object containing the data (could be the form or a top level business object, dto)
See Also:
ViewHelperService.performApplyModel(org.kuali.rice.krad.uif.view.View, java.lang.Object)

retrieveEditModesAndActionFlags

protected void retrieveEditModesAndActionFlags(View view,
                                               UifFormBase model)
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

Parameters:
view - - view instance that is being built and presentation/authorizer pulled for
model - - Object that contains the model data

setViewContext

protected void setViewContext(View view,
                              Object model)
Sets up the view context which will be available to other components through their context for conditional logic evaluation

Parameters:
view - - view instance to set context for
model - - object containing the view data

getPreModelContext

protected Map<String,Object> getPreModelContext(View view)
Returns the general context that is available before the apply model phase (during the initialize phase)

Parameters:
view - - view instance for context
Returns:
Map context map

performComponentApplyModel

protected void performComponentApplyModel(View view,
                                          Component component,
                                          Object model,
                                          Map<String,Integer> visitedIds)
Applies the model data to a component of the View instance

The component is invoked to to apply the model data. Here the component can generate any additional fields needed or alter the configured fields. After the component is invoked a hook for custom helper service processing is invoked. Finally the method is recursively called for all the component children

Parameters:
view - view instance the component belongs to
component - the component instance the model should be applied to
model - top level object containing the data
visitedIds - tracks components ids that have been seen for adjusting duplicates

adjustIdIfNecessary

protected String adjustIdIfNecessary(String id,
                                     Map<String,Integer> visitedIds)
Checks against the visited ids to see if the id is duplicate, if so it is adjusted to make an unique id by appending an unique sequence number

Parameters:
id - id to adjust if necessary
visitedIds - tracks components ids that have been seen for adjusting duplicates
Returns:
String original or adjusted id

applyAuthorizationAndPresentationLogic

protected void applyAuthorizationAndPresentationLogic(View view,
                                                      Component component,
                                                      ViewModel model)
Invokes the view's configured ViewAuthorizer and ViewPresentationController to set state of the component

The following authorization is done here: Fields: edit, view, required, mask, and partial mask Groups: edit and view Actions: take action

Note additional checks are also done for fields that are part of a collection group. This authorization is found in CollectionGroupBuilder

Parameters:
view - - view instance the component belongs to and from which the authorizer and presentation controller will be pulled
component - - component instance to authorize
model - - model object containing the data for the view

runComponentModifiers

protected void runComponentModifiers(View view,
                                     Component component,
                                     Object model,
                                     String runPhase)
Runs any configured ComponentModifiers for the given component that match the given run phase and who run condition evaluation succeeds

If called during the initialize phase, the performInitialization method will be invoked on the ComponentModifier before running

Parameters:
view - - view instance for context
component - - component instance whose modifiers should be run
model - - model object for context
runPhase - - current phase to match on

getCommonContext

public Map<String,Object> getCommonContext(View view,
                                           Component component)
Gets global objects for the context map and pushes them to the context for the component

Specified by:
getCommonContext in interface ViewHelperService
Parameters:
view - - view instance for component
component - - component instance to push context to

performFinalize

public void performFinalize(View view,
                            Object model)
Description copied from interface: ViewHelperService
The last phase before the view is rendered. Here final preparations can be made based on the updated view state

The finalize phase runs after the apply model phase and can be called multiple times for the view's lifecylce (however typically only once per request)

Specified by:
performFinalize in interface ViewHelperService
Parameters:
view - - view instance that should be finalized for rendering
model - - top level object containing the data
See Also:
ViewHelperService.performFinalize(org.kuali.rice.krad.uif.view.View, java.lang.Object)

buildClientSideStateScript

protected String buildClientSideStateScript(View view,
                                            Map<String,Object> clientSideState,
                                            boolean updateOnly)
Builds script that will initialize configuration parameters and component state on the client

Here client side state is initialized along with configuration variables that need exposed to script

Parameters:
view - - view instance that is being built
clientSideState - - map of key/value pairs that should be exposed as client side state
updateOnly - - boolean that indicates whether we are just updating a component (true), or the full view

buildGrowlScript

protected String buildGrowlScript(View view)
Builds JS script that will invoke the show growl method to display a growl message when the page is rendered

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

Parameters:
view - - view instance for which growls are being generated
Returns:
String JS script string for generated growl messages

performComponentFinalize

protected void performComponentFinalize(View view,
                                        Component component,
                                        Object model,
                                        Component parent,
                                        Map<String,Object> clientSideState)
Update state of the given component and does final preparation for rendering

Parameters:
view - - view instance the component belongs to
component - - the component instance that should be updated
model - - top level object containing the data
parent - - Parent component for the component being finalized
clientSideState - - map to add client state to

addClientSideStateForComponent

protected void addClientSideStateForComponent(Component component,
                                              Map<String,Object> clientSideState)
Reflects the class for the given component to find any fields that are annotated with ClientSideState and adds the corresponding property name/value pair to the client side state map

Note if the component is the View

Parameters:
component - - component instance to get client state for
clientSideState - - map to add client side variable name/values to

syncClientSideStateForComponent

protected void syncClientSideStateForComponent(Component component,
                                               Map<String,Object> clientSideState)
Updates the properties of the given component instance with the value found from the corresponding map of client state (if found)

Parameters:
component - - component instance to update
clientSideState - - map of state to sync with

invokeMethodFinalizer

protected void invokeMethodFinalizer(View view,
                                     Component component,
                                     Object model)
Invokes the finalize method for the component (if configured) and sets the render output for the component to the returned method string (if method is not a void type)

Parameters:
view - - view instance that contains the component
component - - component to run finalize method for
model - - top level object containing the data

cleanViewAfterRender

public void cleanViewAfterRender(View view)
Description copied from interface: ViewHelperService
Invoked after the view has been rendered to clear out objects that are not necessary to keep around for the post, this helps reduce the view size and overall cost to store the form in session

Specified by:
cleanViewAfterRender in interface ViewHelperService
Parameters:
view - - view instance to be cleaned
See Also:
ViewHelperService.cleanViewAfterRender(org.kuali.rice.krad.uif.view.View)

processCollectionAddLine

public void processCollectionAddLine(View view,
                                     Object model,
                                     String collectionPath)
Description copied from interface: ViewHelperService
Invoked when the add line action is chosen for a collection. The collection path gives the full path to the collection that action was selected for. Here validation can be performed on the line as well as further processing on the line such as defaults. If the action is valid the line should be added to the collection, otherwise errors should be added to the global MessageMap

Specified by:
processCollectionAddLine in interface ViewHelperService
Parameters:
view - - view instance that is being presented (the action was taken on)
model - - Top level object containing the view data including the collection and new line
collectionPath - - full path to the collection on the model
See Also:
ViewHelperService.processCollectionAddLine(org.kuali.rice.krad.uif.view.View, java.lang.Object, java.lang.String)

processCollectionSaveLine

public void processCollectionSaveLine(View view,
                                      Object model,
                                      String collectionPath,
                                      int selectedLineIndex)
Description copied from interface: ViewHelperService
Invoked when the save line action is chosen for a collection. This method only does server side validation by default but creates hook for client applications to add additional logic like persisting data.

Specified by:
processCollectionSaveLine in interface ViewHelperService
Parameters:
view - - view instance that is being presented (the action was taken on)
model - - Top level object containing the view data including the collection and new line
collectionPath - - full path to the collection on the model
See Also:
ViewHelperService.processCollectionSaveLine(org.kuali.rice.krad.uif.view.View, java.lang.Object, java.lang.String, int)

processCollectionAddBlankLine

public void processCollectionAddBlankLine(View view,
                                          Object model,
                                          String collectionPath)
Description copied from interface: ViewHelperService
Adds a blank line to the collection

Adds a new collection item to the collection and applies any default values.

Specified by:
processCollectionAddBlankLine in interface ViewHelperService
Parameters:
view - - view instance that is being presented (the action was taken on)
model - - Top level object containing the view data including the collection and new line
collectionPath - - full path to the collection on the model
See Also:
ViewHelperService.processCollectionAddBlankLine(org.kuali.rice.krad.uif.view.View, java.lang.Object, java.lang.String)

addLine

protected void addLine(Collection<Object> collection,
                       Object addLine,
                       boolean insertFirst)
Add addLine to collection while giving derived classes an opportunity to override for things like sorting.

Parameters:
collection - - the Collection to add the given addLine to
addLine - - the line to add to the given collection
insertFirst - - indicates if the item should be inserted as the first item

performAddLineValidation

protected boolean performAddLineValidation(View view,
                                           CollectionGroup collectionGroup,
                                           Object model,
                                           Object addLine)
Performs validation on the new collection line before it is added to the corresponding collection

Parameters:
view - - view instance that the action was taken on
collectionGroup - - collection group component for the collection
addLine - - new line instance to validate
model - - object instance that contain's the views data
Returns:
boolean true if the line is valid and it should be added to the collection, false if it was not valid and should not be added to the collection

processCollectionDeleteLine

public void processCollectionDeleteLine(View view,
                                        Object model,
                                        String collectionPath,
                                        int lineIndex)
Description copied from interface: ViewHelperService
Invoked when the delete line action is chosen for a collection. The collection path gives the full path to the collection that action was selected for. Here validation can be performed to make sure the action is allowed. If the action is valid the line should be deleted from the collection, otherwise errors should be added to the global MessageMap

Specified by:
processCollectionDeleteLine in interface ViewHelperService
Parameters:
view - - view instance that is being presented (the action was taken on)
model - - Top level object containing the view data including the collection
collectionPath - - full path to the collection on the model
lineIndex - - index of the collection line that was selected for removal
See Also:
ViewHelperService.processCollectionDeleteLine(org.kuali.rice.krad.uif.view.View, java.lang.Object, java.lang.String, int)

performDeleteLineValidation

protected boolean performDeleteLineValidation(View view,
                                              CollectionGroup collectionGroup,
                                              Object deleteLine)
Performs validation on the collection line before it is removed from the corresponding collection

Parameters:
view - - view instance that the action was taken on
collectionGroup - - collection group component for the collection
deleteLine - - line that will be removed
Returns:
boolean true if the action is allowed and the line should be removed, false if the line should not be removed

processMultipleValueLookupResults

public void processMultipleValueLookupResults(View view,
                                              Object model,
                                              String collectionPath,
                                              String lookupResultValues)
Description copied from interface: ViewHelperService
Process the results returned from a multi-value lookup populating the lines for the collection given by the path

Specified by:
processMultipleValueLookupResults in interface ViewHelperService
Parameters:
view - - view instance the collection belongs to
model - - object containing the view data
collectionPath - - binding path to the collection to populated
lookupResultValues - - String containing the selected line values
See Also:
processMultipleValueLookupResults(org.kuali.rice.krad.uif.view.View, java.lang.Object, java.lang.String, java.lang.String)

buildInquiryLink

public void buildInquiryLink(Object dataObject,
                             String propertyName,
                             Inquiry inquiry)
Finds the Inquirable configured for the given data object class and delegates to it for building the inquiry URL

Specified by:
buildInquiryLink in interface ViewHelperService
Parameters:
dataObject - - parent object for the inquiry property
propertyName - - name of the property the inquiry is being built for
inquiry - - instance of the inquiry widget being built for the property
See Also:
ViewHelperService.buildInquiryLink(java.lang.Object, java.lang.String, org.kuali.rice.krad.uif.widget.Inquiry)

applyDefaultValuesForCollectionLine

public void applyDefaultValuesForCollectionLine(View view,
                                                Object model,
                                                CollectionGroup collectionGroup,
                                                Object line)
Description copied from interface: ViewHelperService
Applies configured default values for the line fields to the line instance

Specified by:
applyDefaultValuesForCollectionLine in interface ViewHelperService
Parameters:
view - - view instance the collection line belongs to
model - - object containing the full view data
collectionGroup - - collection group component the line belongs to
line - - line instance to apply default values to
See Also:
ViewHelperService.applyDefaultValuesForCollectionLine(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.container.CollectionGroup, java.lang.Object)

applyDefaultValues

protected void applyDefaultValues(View view,
                                  Component component,
                                  Object model)
Iterates through the view components picking up data fields and applying an default value configured

Parameters:
view - - view instance we are applying default values for
component - - component that should be checked for default values
model - - model object that values should be set on

populateDefaultValueForField

protected void populateDefaultValueForField(View view,
                                            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

Checks for a configured default value or default value class for the field. If both are given, the configured static default value will win. In addition, if the default value contains an el expression it is evaluated against the initial context

Parameters:
view - - view instance the field belongs to
object - - object that should be populated
dataField - - field to check for configured default value
bindingPath - - path to the property on the object that should be populated

addCustomContainerComponents

protected void addCustomContainerComponents(View view,
                                            Object model,
                                            Container container)
Hook for creating new components with code and adding them to a 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

Parameters:
view - - view instance the container belongs to
model - - object containing the view data
container - - container instance to add components to

performCustomInitialization

protected void performCustomInitialization(View view,
                                           Component component)
Hook for service overrides to perform custom initialization on the component

Parameters:
view - - view instance containing the component
component - - component instance to initialize

performCustomApplyModel

protected void performCustomApplyModel(View view,
                                       Component component,
                                       Object model)
Hook for service overrides to perform custom apply model logic on the component

Parameters:
view - - view instance containing the component
component - - component instance to apply model to
model - - Top level object containing the data (could be the form or a top level business object, dto)

performCustomFinalize

protected void performCustomFinalize(View view,
                                     Component component,
                                     Object model,
                                     Component parent)
Hook for service overrides to perform custom component finalization

Parameters:
view - - view instance containing the component
component - - component instance to update
model - - Top level object containing the data
parent - - Parent component for the component being finalized

processBeforeAddLine

protected void processBeforeAddLine(View view,
                                    CollectionGroup collectionGroup,
                                    Object model,
                                    Object addLine)
Hook for service overrides to process the new collection line before it is added to the collection

Parameters:
view - - view instance that is being presented (the action was taken on)
collectionGroup - - collection group component for the collection the line will be added to
model - - object instance that contain's the views data
addLine - - the new line instance to be processed

processAfterAddLine

protected void processAfterAddLine(View view,
                                   CollectionGroup collectionGroup,
                                   Object model,
                                   Object addLine)
Hook for service overrides to process the new collection line after it has been added to the collection

Parameters:
view - - view instance that is being presented (the action was taken on)
collectionGroup - - collection group component for the collection the line that was added
model - - object instance that contain's the views data
addLine - - the new line that was added

processBeforeSaveLine

protected void processBeforeSaveLine(View view,
                                     CollectionGroup collectionGroup,
                                     Object model,
                                     Object addLine)
Hook for service overrides to process the save collection line before it is validated

Parameters:
view - - view instance that is being presented (the action was taken on)
collectionGroup - - collection group component for the collection
model - - object instance that contain's the views data
addLine - - the new line instance to be processed

processAfterSaveLine

protected void processAfterSaveLine(View view,
                                    CollectionGroup collectionGroup,
                                    Object model,
                                    Object addLine)
Hook for service overrides to process the save collection line after it has been validated

Parameters:
view - - view instance that is being presented (the action was taken on)
collectionGroup - - collection group component for the collection
model - - object instance that contains the views data
addLine - - the new line that was added

processAfterDeleteLine

protected void processAfterDeleteLine(View view,
                                      CollectionGroup collectionGroup,
                                      Object model,
                                      int lineIndex)
Hook for service overrides to process the collection line after it has been deleted

Parameters:
view - - view instance that is being presented (the action was taken on)
collectionGroup - - collection group component for the collection the line that was added
model - - object instance that contains the views data
lineIndex - - index of the line that was deleted

logAndThrowRuntime

protected void logAndThrowRuntime(String message)
Log the error and throw a new runtime exception

Parameters:
message - - the error message (both to log and throw as a new exception)

getDataDictionaryService

protected DataDictionaryService getDataDictionaryService()
Gets the data dictionary service

Returns:
DataDictionaryService data dictionary service

setDataDictionaryService

public void setDataDictionaryService(DataDictionaryService dataDictionaryService)
Sets the data dictionary service

Parameters:
dataDictionaryService -

getExpressionEvaluatorService

protected ExpressionEvaluatorService getExpressionEvaluatorService()
Gets the expression evaluator service

Returns:
ExpressionEvaluatorService expression evaluator service

setExpressionEvaluatorService

public void setExpressionEvaluatorService(ExpressionEvaluatorService expressionEvaluatorService)
Sets the expression evaluator service

Parameters:
expressionEvaluatorService -

getViewDictionaryService

public ViewDictionaryService getViewDictionaryService()
Gets the view dictionary service

Returns:
ViewDictionaryService view dictionary service

setViewDictionaryService

public void setViewDictionaryService(ViewDictionaryService viewDictionaryService)
Sets the view dictionary service

Parameters:
viewDictionaryService -

getConfigurationService

public ConfigurationService getConfigurationService()
Gets the configuration service

Returns:
ConfigurationService configuration service

setConfigurationService

public void setConfigurationService(ConfigurationService configurationService)
Sets the configuration service

Parameters:
configurationService -


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