org.hippoecm.hst.core.sitemenu
Class HstSiteMenuItemImpl

java.lang.Object
  extended by org.hippoecm.hst.core.sitemenu.AbstractMenuItem
      extended by org.hippoecm.hst.core.sitemenu.HstSiteMenuItemImpl
All Implemented Interfaces:
CommonMenuItem, HstSiteMenuItem

public class HstSiteMenuItemImpl
extends AbstractMenuItem
implements HstSiteMenuItem


Field Summary
 
Fields inherited from class org.hippoecm.hst.core.sitemenu.AbstractMenuItem
depth, expanded, hstLink, name, properties, repositoryBased, selected
 
Constructor Summary
HstSiteMenuItemImpl(HstSiteMenu hstSiteMenu, HstSiteMenuItem parent, HstSiteMenuItemConfiguration hstSiteMenuItemConfiguration, HstRequestContext hstRequestContext)
           
 
Method Summary
 List<HstSiteMenuItem> getChildMenuItems()
           
 HstSiteMenuItem getDeepestExpandedItem()
           
 int getDepth()
           
 String getExternalLink()
          When this method does not return null, then by default will return null even if the sitemenu item has a sitemap reference path defined
 HstLink getHstLink()
           
 HstSiteMenu getHstSiteMenu()
           
 String getLocalParameter(String name)
          The value of the local (no parameters inherited from ancestor items) parameter with possible property placeholders substituted
 Map<String,String> getLocalParameters()
           
 String getParameter(String name)
          A HstSiteMenuItem can contain a Map of parameters.
 Map<String,String> getParameters()
          Parameters are inherited from ancestor sitemenu items.
 HstSiteMenuItem getParentItem()
           
 Map<String,Object> getProperties()
          When developers have customized SiteMenuItem configuration with extra properties, these properties can be accessed through this Map
 boolean isRepositoryBased()
           
 void setExpanded()
           
 
Methods inherited from class org.hippoecm.hst.core.sitemenu.AbstractMenuItem
getName, isExpanded, isSelected, resolveToSiteMapItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hippoecm.hst.core.sitemenu.CommonMenuItem
getName, isExpanded, isSelected, resolveToSiteMapItem
 

Constructor Detail

HstSiteMenuItemImpl

public HstSiteMenuItemImpl(HstSiteMenu hstSiteMenu,
                           HstSiteMenuItem parent,
                           HstSiteMenuItemConfiguration hstSiteMenuItemConfiguration,
                           HstRequestContext hstRequestContext)
Method Detail

getChildMenuItems

public List<HstSiteMenuItem> getChildMenuItems()
Specified by:
getChildMenuItems in interface HstSiteMenuItem
Returns:
all direct child SiteMenuItem's of this item

getHstLink

public HstLink getHstLink()
Specified by:
getHstLink in interface CommonMenuItem
Overrides:
getHstLink in class AbstractMenuItem
Returns:
a HstLink that contains a link for this SiteMenuItem

getExternalLink

public String getExternalLink()
Description copied from interface: CommonMenuItem
When this method does not return null, then by default will return null even if the sitemenu item has a sitemap reference path defined

Specified by:
getExternalLink in interface CommonMenuItem
Overrides:
getExternalLink in class AbstractMenuItem
Returns:
an external (http/https etc) link or null if no external link is defined

getParentItem

public HstSiteMenuItem getParentItem()
Specified by:
getParentItem in interface HstSiteMenuItem
Returns:
parent HstSiteMenuItem or null if it is a root item

setExpanded

public void setExpanded()

getHstSiteMenu

public HstSiteMenu getHstSiteMenu()
Specified by:
getHstSiteMenu in interface HstSiteMenuItem
Returns:
the container HstSiteMenu of this HstSiteMenuItem

getDepth

public int getDepth()
Specified by:
getDepth in interface CommonMenuItem
Overrides:
getDepth in class AbstractMenuItem
Returns:
the depth of repository based items in case of repository based navigation

isRepositoryBased

public boolean isRepositoryBased()
Specified by:
isRepositoryBased in interface CommonMenuItem
Overrides:
isRepositoryBased in class AbstractMenuItem
Returns:
true when below this sitemenu item repository based navigation is expected

getDeepestExpandedItem

public HstSiteMenuItem getDeepestExpandedItem()

getProperties

public Map<String,Object> getProperties()
Description copied from interface: CommonMenuItem
When developers have customized SiteMenuItem configuration with extra properties, these properties can be accessed through this Map

Specified by:
getProperties in interface CommonMenuItem
Overrides:
getProperties in class AbstractMenuItem
Returns:
a Map containing the value for every property in the backing content provider for this SiteMenuItem

getParameters

public Map<String,String> getParameters()
Description copied from interface: HstSiteMenuItem
Parameters are inherited from ancestor sitemenu items. When this sitemenu item configures the same parameter as an ancestor, the value from the ancestor is overwritten.

Specified by:
getParameters in interface HstSiteMenuItem
Returns:
the Map of parameters contained in this HstSiteMenu. If no parameters present, and empty map is returned
See Also:
#getParameter(String)}, only now the entire parameters map is returned.

getParameter

public String getParameter(String name)
Description copied from interface: HstSiteMenuItem
A HstSiteMenuItem can contain a Map of parameters. A parameter from this Map can be accessed through this method. If it is not present, null will be returned. The parameters are fetched from the HstSiteMenuItemConfiguration.getParameter(String), but in the value possible property placeholders in the value are replaced by the wildcards from HstSiteMapItem that was matched. When there are property placeholders that can not be resolved, the value is set to null Parameters are inherited from ancestor HstSiteMenuItem's. When this HstSiteMenuItem configures the same parameter as an ancestor, the value from the ancestor is overwritten.

Specified by:
getParameter in interface HstSiteMenuItem
Parameters:
name - the name of the parameter
Returns:
the value of the parameter or null when not present or has unresolved property placeholders

getLocalParameters

public Map<String,String> getLocalParameters()
Specified by:
getLocalParameters in interface HstSiteMenuItem
Returns:
the Map of parameters contained in this HstSiteMapItem. If no parameters present, and empty map is returned
See Also:
#getParameters()}, only this method returns parameters without inheritance

getLocalParameter

public String getLocalParameter(String name)
Description copied from interface: HstSiteMenuItem
The value of the local (no parameters inherited from ancestor items) parameter with possible property placeholders substituted

Specified by:
getLocalParameter in interface HstSiteMenuItem
Parameters:
name - the name of the parameter
Returns:
the value of the parameter or null when not present or has unresolved property placeholders
See Also:
#getParameter(String)}, only this method returns parameters without inheritance


Copyright © 2008-2012 Hippo. All Rights Reserved.