org.kuali.rice.krad.uif.util
Class ParentLocation

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      extended by org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
          extended by org.kuali.rice.krad.uif.util.ParentLocation
All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean

public class ParentLocation
extends UifDictionaryBeanBase
implements Serializable

ParentLocation is used to provide automatic generation/determination of Views/Pages that occur before the current View. Essentially, this class provides a way to determine a conceptual hierarchy of view/page locations. This information is used internally to generate BreadcrumbItems that can appear before the View's breadcrumbs.

See Also:
Serialized Form

Field Summary
protected  List<BreadcrumbItem> resolvedBreadcrumbItems
           
 
Fields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode
 
Constructor Summary
ParentLocation()
           
 
Method Summary
 List<BreadcrumbItem> constructParentLocationBreadcrumbItems(View view, Object currentModel, Map<String,Object> currentContext)
          Construct the parent location breadcrumbItems that represent all the parent views/pages configured through parentLocation by traversing through each view by id referenced in parentViewUrl in a chain recursively.
 BreadcrumbItem getPageBreadcrumbItem()
          The pageBreadcrumbItem to use for the parent location view breadcrumb.
 String getParentPageLabel()
          The parentPageLabel is the text used for breadcrumbItem label of the parent page.
 UrlInfo getParentPageUrl()
          The parentPageUrl representing a page url that is the parent of this View.
 String getParentViewLabel()
          The parentViewLabel is the text used for breadcrumbItem label of the parent view.
 UrlInfo getParentViewUrl()
          The parentViewUrl representing the url that is the parent of this View.
 List<BreadcrumbItem> getResolvedBreadcrumbItems()
          The resolved/generated breadcrumbItems determined by traversing the parentLocation chain.
 BreadcrumbItem getViewBreadcrumbItem()
          The viewBreadcrumbItem to use for the parent location view breadcrumb.
 void setPageBreadcrumbItem(BreadcrumbItem pageBreadcrumbItem)
          Set the pageBreadcrumbItem
 void setParentPageLabel(String parentPageLabel)
          Set the parentPageLabel
 void setParentPageUrl(UrlInfo parentPageUrl)
          Set the parentPageUrl
 void setParentViewLabel(String parentViewLabel)
          Set the parentViewLabel
 void setParentViewUrl(UrlInfo parentViewUrl)
          Set the parentViewUrl
 void setViewBreadcrumbItem(BreadcrumbItem breadcrumbItem)
          Set the viewBreadcrumbItem
 
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
clone, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode
 

Field Detail

resolvedBreadcrumbItems

protected List<BreadcrumbItem> resolvedBreadcrumbItems
Constructor Detail

ParentLocation

public ParentLocation()
Method Detail

constructParentLocationBreadcrumbItems

public List<BreadcrumbItem> constructParentLocationBreadcrumbItems(View view,
                                                                   Object currentModel,
                                                                   Map<String,Object> currentContext)
Construct the parent location breadcrumbItems that represent all the parent views/pages configured through parentLocation by traversing through each view by id referenced in parentViewUrl in a chain recursively. A url which is not using viewId and instead set the href explicitly ends the chain.

Parameters:
view - the current view being processed
currentModel - the currentModel
currentContext - the currentContext
Returns:
list of breadcrumbItems (the final list is set into the top most View's parentLocation.resolvedBreadcrumbItems)

getParentViewUrl

public UrlInfo getParentViewUrl()
The parentViewUrl representing the url that is the parent of this View.

This url can explicitly set an href or can set a controller and viewId. Parent view traversal is only performed if the controller and viewId properties are set and NOT the explicit href (this affects if breadcrumbs are generated in a recursive chain).

Returns:
the parent view url

setParentViewUrl

public void setParentViewUrl(UrlInfo parentViewUrl)
Set the parentViewUrl

Parameters:
parentViewUrl -

getParentPageUrl

public UrlInfo getParentPageUrl()
The parentPageUrl representing a page url that is the parent of this View. In order for automated label determination to work for the page breadcrumbItem, the viewId and controllerMapping must match with the parentViewUrl.

This url can explicitly set an href or can set a pageId. The parentViewUrl MUST be set before this option can be set. If the needed behavior is such that the parent view breadcrumbItem should not be shown and only this item should be shown, set 'parentLocation.viewBreadcrumbItem.render' to false.

Returns:
the parent page url

setParentPageUrl

public void setParentPageUrl(UrlInfo parentPageUrl)
Set the parentPageUrl

Parameters:
parentPageUrl -

getParentViewLabel

public String getParentViewLabel()
The parentViewLabel is the text used for breadcrumbItem label of the parent view.

If not set, the the label is determined by looking at the parent View's breadcrumbItem and then its headerText. If the parent view's retrieved value contain expressions, those expressions must be able to be evaluated in the current context (ie, the properties they reference must also exist on the current form at the same location) or an exception will be thrown.

Returns:
the parentViewLabel set

setParentViewLabel

public void setParentViewLabel(String parentViewLabel)
Set the parentViewLabel

Parameters:
parentViewLabel -

getParentPageLabel

public String getParentPageLabel()
The parentPageLabel is the text used for breadcrumbItem label of the parent page.

If not set, the the label is determined by looking at the parent PageGroup's breadcrumbItem and then its headerText. This retrieval can only happen if the parentViewUrl is set. If the parent PageGroup's retrieved value contain expressions, those expressions must be able to be evaluated in the current context (ie, the properties they reference must also exist on the current form at the same location) or an exception will be thrown.

Returns:
the parentPageLabel set

setParentPageLabel

public void setParentPageLabel(String parentPageLabel)
Set the parentPageLabel

Parameters:
parentPageLabel -

getViewBreadcrumbItem

public BreadcrumbItem getViewBreadcrumbItem()
The viewBreadcrumbItem to use for the parent location view breadcrumb. Url should NOT be set here because parentViewUrl is ALWAYS set into this breadcrumbItem, regardless of value.

Returns:
the viewBreadcrumbItem

setViewBreadcrumbItem

public void setViewBreadcrumbItem(BreadcrumbItem breadcrumbItem)
Set the viewBreadcrumbItem

Parameters:
breadcrumbItem -

getPageBreadcrumbItem

public BreadcrumbItem getPageBreadcrumbItem()
The pageBreadcrumbItem to use for the parent location view breadcrumb. Url should NOT be set here because parentPageUrl is ALWAYS set into this breadcrumbItem, regardless of value.

Returns:
the pageBreadcrumbItem

setPageBreadcrumbItem

public void setPageBreadcrumbItem(BreadcrumbItem pageBreadcrumbItem)
Set the pageBreadcrumbItem

Parameters:
pageBreadcrumbItem -

getResolvedBreadcrumbItems

public List<BreadcrumbItem> getResolvedBreadcrumbItems()
The resolved/generated breadcrumbItems determined by traversing the parentLocation chain. These cannot be set and must be generated by calling constructParentLocationBreadcrumbItems.

Returns:
the resolved breadcrumbItem list


Copyright © 2005–2015 The Kuali Foundation. All rights reserved.