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

java.lang.Object
  extended by org.kuali.rice.krad.uif.service.impl.ViewServiceImpl
All Implemented Interfaces:
ViewService

public class ViewServiceImpl
extends Object
implements ViewService

Implementation of ViewService

Provides methods for retrieving View instances and carrying out the View lifecycle methods. Interacts with the configured ViewHelperService during the view lifecycle

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

Constructor Summary
ViewServiceImpl()
           
 
Method Summary
 void buildView(View view, Object model, Map<String,String> parameters)
          Executes the view lifecycle on the given View instance which will prepare it for rendering
protected  DataDictionaryService getDataDictionaryService()
           
 View getViewById(String viewId)
          Returns the View entry identified by the given id
 View getViewByType(UifConstants.ViewType viewType, Map<String,String> parameters)
          Retrieves the ViewTypeService for the given view type, then builds up the index based on the supported view type parameters and queries the dictionary service to retrieve the view based on its type and index
 String getViewIdForViewType(UifConstants.ViewType viewType, Map<String,String> parameters)
          Retrieves the view id for the view associated with the given view type and view type parameters
 ViewTypeService getViewTypeService(UifConstants.ViewType viewType)
           
 List<ViewTypeService> getViewTypeServices()
           
protected  void performViewLifecycle(View view, Object model, Map<String,String> parameters)
          Initializes a newly created View instance.
 void setDataDictionaryService(DataDictionaryService dataDictionaryService)
           
 void setViewTypeServices(List<ViewTypeService> viewTypeServices)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewServiceImpl

public ViewServiceImpl()
Method Detail

getViewById

public View getViewById(String viewId)
Description copied from interface: ViewService
Returns the View entry identified by the given id

The id matches the id configured for the View through the dictionary. A new view instance is returned that is in the created state

Specified by:
getViewById in interface ViewService
Parameters:
viewId - - unique id for view configured on its definition
Returns:
View instance associated with the id or Null if id is not found
See Also:
ViewService.getViewById(java.lang.String)

getViewByType

public View getViewByType(UifConstants.ViewType viewType,
                          Map<String,String> parameters)
Retrieves the ViewTypeService for the given view type, then builds up the index based on the supported view type parameters and queries the dictionary service to retrieve the view based on its type and index

Specified by:
getViewByType in interface ViewService
Parameters:
viewType - - name that identifies the view type
parameters - - Map of parameter key/value pairs that are used to select the view, the parameters allowed depend on the view type
Returns:
View instance or Null if a matching view was not found
See Also:
org.kuali.rice.krad.uif.service.ViewService#getViewByType(org.kuali.rice.krad.uif.UifConstants.ViewType, java.util.Map)

getViewIdForViewType

public String getViewIdForViewType(UifConstants.ViewType viewType,
                                   Map<String,String> parameters)
Description copied from interface: ViewService
Retrieves the view id for the view associated with the given view type and view type parameters

Specified by:
getViewIdForViewType in interface ViewService
Parameters:
viewType - name that identifies the view type
parameters - Map of parameter key/value pairs that are used to select the view, the parameters allowed depend on the view type
Returns:
id for the view or null if a matching view was not found
See Also:
org.kuali.rice.krad.uif.service.ViewService#getViewIdForViewType(org.kuali.rice.krad.uif.UifConstants.ViewType, java.util.Map)

buildView

public void buildView(View view,
                      Object model,
                      Map<String,String> parameters)
Description copied from interface: ViewService
Executes the view lifecycle on the given View instance which will prepare it for rendering

Any configuration sent through the options Map is used to initialize the View. This map contains present options the view is aware of and will typically come from request parameters. e.g. For maintenance Views there is the maintenance type option (new, edit, copy)

After view retrieval, applies updates to the view based on the model data which Performs dynamic generation of fields (such as collection rows), conditional logic, and state updating (conditional hidden, read-only, required).

Specified by:
buildView in interface ViewService
Parameters:
view - - view instance that should be built
model - - object instance containing the view data
parameters - - Map of key values pairs that provide configuration for the View, this is generally comes from the request and can be the request parameter Map itself. Any parameters not valid for the View will be filtered out
See Also:
org.kuali.rice.krad.uif.service.ViewService#buildView(org.kuali.rice.krad.uif.view.View, java.lang.Object, java.util.Map)

performViewLifecycle

protected void performViewLifecycle(View view,
                                    Object model,
                                    Map<String,String> parameters)
Initializes a newly created View instance. Each component of the tree is invoked to perform setup based on its configuration. In addition helper service methods are invoked to perform custom initialization

Parameters:
view - - view instance to initialize
model - - object instance containing the view data
parameters - - Map of key values pairs that provide configuration for the View, this is generally comes from the request and can be the request parameter Map itself. Any parameters not valid for the View will be filtered out

getViewTypeService

public ViewTypeService getViewTypeService(UifConstants.ViewType viewType)
Specified by:
getViewTypeService in interface ViewService

getViewTypeServices

public List<ViewTypeService> getViewTypeServices()

setViewTypeServices

public void setViewTypeServices(List<ViewTypeService> viewTypeServices)

getDataDictionaryService

protected DataDictionaryService getDataDictionaryService()

setDataDictionaryService

public void setDataDictionaryService(DataDictionaryService dataDictionaryService)


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