org.hippoecm.hst.configuration.sitemap

Interface HstSiteMapItem

    • Method Detail

      • getQualifiedId

        String getQualifiedId()
        The qualified id, which might contain more info then just getId() as the getId might return an id which is meaningfull only within it's current HstSiteMap
        Returns:
        the qualified id of this HstSiteMapItem
      • getValue

        String getValue()
        Returns the logical path element of this SiteMapItem. The constraint to the return value is, that it needs to be unique within the sibbling HstSiteMapItem's because it is used as a key for getChild(String) and HstSiteMap.getSiteMapItem(String)
        Returns:
        the value of this SiteMapItem which represents the logical path element for this SiteMapItem
      • isWildCard

        boolean isWildCard()
        Returns a boolean indicating whether this HstSiteMapItem represents a path with a wildcard value *
        Returns:
        true if this HstSiteMapItem represents *
      • isAny

        boolean isAny()
        Returns a boolean indicating whether this HstSiteMapItem represents a path with a any value **
        Returns:
        true if this HstSiteMapItem represents **
      • getComponentConfigurationId

        String getComponentConfigurationId()
        If a HstSiteMapItem can be used to resolve a url, it must have a componentConfigurationId referencing the component configuration the will handle the request processing. This component configuration can be the root of a component configuration tree, see HstComponentConfiguration.
        Returns:
        the componentConfigurationId for this SiteMapItem or null
      • getPortletComponentConfigurationId

        @Deprecated
        String getPortletComponentConfigurationId()
        Deprecated. portlet support will be removed after 2.26.xx
        If a HstSiteMapItem can be used to resolve a url, it must have a portletComponentConfigurationId referencing the portlet component configuration the will handle the request processing. This component configuration can be the root of a component configuration tree, see HstComponentConfiguration.
        Returns:
        the portletComponentConfigurationId for this SiteMapItem or null
      • isAuthenticated

        boolean isAuthenticated()
        If this method returns true, then only if the user is explicitly allowed or servletRequest.isUserInRole(role) returns true this sitemap item is accessible for the request. If a sitemap item does not have a configuration for authenticated, the value from the parent item is taken. The root sitemap items return by default false for isAuthenticated() when no configuration is set for authenticated.
        Returns:
        true if the sitemap item is authenticated.
      • getRoles

        Set<String> getRoles()
        Returns the roles that are allowed to access this sitemap item when isAuthenticated() is true. If the sitemap items does not have any roles defined by itself, it inherits them from the parent. If it defines roles, the roles from any ancestor are ignored. An empty set of roles in combination with isAuthenticated() return true means nobody has access to the item HstComponent instances can access HstSiteMapItem but should not be able to modify them, implementations should return an unmodifiable set.
        Returns:
        The set of roles that are allowed to access this sitemap item. When no roles defined, the roles from the parent item are inherited. If none of the parent items have a role defined, an empty set is returned
      • getUsers

        Set<String> getUsers()
        Returns the users that are allowed to access this sitemap item when isAuthenticated() is true. If the sitemap items does not have any users defined by itself, it inherits them from the parent. If it defines users, the users from any ancestor are ignored. An empty set of users in combination with isAuthenticated() return true means nobody has access to the item HstComponent instances can access HstSiteMapItem but should not be able to modify them, implementations should return an unmodifiable set.
        Returns:
        The set of users that are allowed to access this sitemap item. When no users defined, the users from the parent item are inherited. If none of the parent items have a user defined, an empty set is returned
      • isExcludedForLinkRewriting

        boolean isExcludedForLinkRewriting()

        When having more sitemapitem as sibblings, for example foo.xml, foo.html and foo.rss, you might not want all three being used for linkrewriting: Even worse, if they all three have the same getRelativeContentPath(), we cannot choose which one is the one you want, so, one of the items is used. When configuring a SiteMapItem to return true for isExcludedForLinkRewriting(), you can exclude the item to be used for linkrewriting. Thus, setting the .rss and .xml version to true will make sure that linkrewriting returns you the .html links.

        Note that this value is not inherited from ancestor HstSiteMapItem's

        Returns:
        true when this sitemap item should be ignored for linkrewriting
      • getChildren

        List<HstSiteMapItem> getChildren()
        Returns a List of all child HstSiteMapItem's of this HstSiteMapItem. Implementations should return an unmodifiable list, for example Collections.unmodifiableList(java.util.List<? extends T>) to avoid client code changing configuration
        Returns:
        the List of HstSiteMapItem children. If there are no children, an empty list is returned
      • getChild

        HstSiteMapItem getChild(String value)
        Return the child HstSiteMapItem that has the corresponding value (getValue() ) and null otherwise
        Parameters:
        value - the value of the child HstSiteMapItem as it would be return by getValue()
        Returns:
        Returns the HstSiteMapItem object corresponding to the unique value and null if no HstSiteMapItem exists with this value in this HstSiteMapItem object.
      • getParameter

        String getParameter(String name)
        A HstSiteMapItem can contain a Map of parameters. These parameters can be accessed from HstComponent's instances through a parameter in the HstComponentConfiguration. For example, if this SiteMapItem would have a parameter named foo and value bar, the HstComponentConfiguration linked through the getComponentConfigurationId() can access this parameters by having an own parameter, for example named lux and the value ${foo}. If the HstSiteMapItem is a WILDCARD or any of its ancestors, you can also set the parameter values to ${1}, ${2} etc where ${1} refers to the first matched wildcard, ${2} to the second, etc. Parameters are inherited from ancestor sitemap items. When this sitemap item configures the same parameter as an ancestor, the value from the ancestor is overwritten. Thus, child items have precedence. Note that this is opposite to HstComponentConfiguration.getParameter(String)
        Parameters:
        name - the name of the parameter
        Returns:
        the value of the parameter or null when not present
      • getLocalParameter

        String getLocalParameter(String name)
        see getParameter(String), only this method returns parameters without inheritance
        Parameters:
        name - the name of the parameter
        Returns:
        the value of the parameter or null when not present
      • getLocalParameters

        Map<String,String> getLocalParameters()
        see getParameters(), only this method returns parameters (unmodifiable map) without inheritance
        Returns:
        the Map of parameters contained in this HstSiteMapItem. If no parameters present, and empty map is returned
      • getParentItem

        HstSiteMapItem getParentItem()
        Returns parent HstSiteMapItem and null when the item does not have a parent (in other words, it is a root HstSiteMapItem)
        Returns:
        the parent HstSiteMapItem and null when the item does not have a parent
      • getHstSiteMap

        HstSiteMap getHstSiteMap()
        Return the HstSiteMap that is the container of this HstSiteMapItem
        Returns:
        the HstSiteMap that is the container of this HstSiteMapItem
      • getStatusCode

        int getStatusCode()
        A HstSiteMapItem can specify the status-code that needs to be set on the webpage header. If a status-code is specified, it can be retrieved through this method. 0 is return is non is specified.
        Returns:
        if a status code is set, return this, otherwise 0
      • getErrorCode

        int getErrorCode()
        A HstSiteMapItem can specify an error-code. If an error-code is specified, the framework will invoke a sendError(int code) where the code is the value returned by this method . 0 is return is non is specified.
        Returns:
        if an error code is set, return this, otherwise 0
      • getNamedPipeline

        String getNamedPipeline()
        the namedPipeline for this sitemapItem or null when it does not contain one. Note that if an ancestor sitemapItem contains a namedPipeline, this value is inherited unless this sitemapItem explicitly defines its own
        Returns:
        the namedPipeline for this sitemapItem or null when it does not contain one.
      • getLocale

        String getLocale()
        the locale for this sitemapItem or null when it does not contain one. Note that if an ancestor sitemapItem contains a locale, this value is inherited unless this sitemapItem explicitly defines its own.
        Returns:
        the locale for this sitemapItem or null when it does not contain one.
      • isCacheable

        boolean isCacheable()
        Returns:
        true if rendering / resource requests can have their entire page http responses cached.
      • getScheme

        String getScheme()
        The scheme of a site map item specifies which scheme is to be used for serving this site map item. The value of this property is derived in the following order:
        1. If the hst:scheme property is set for this site map item, then that is used
        2. If this site map item has a parent, it will use the parent's scheme
        3. If the mount that this site map item belongs to has a scheme set, then that is used
        If a site map item has an hst:scheme property, but it is left blank then the scheme defaults to VirtualHosts.DEFAULT_SCHEME
        Returns:
        the scheme of this site map item
      • isSchemeAgnostic

        boolean isSchemeAgnostic()
        If a HstSiteMapItem is scheme agnostic, the request gets served regardless whether it is http or https
        Returns:
        true when this HstSiteMapItem is scheme agnostic
      • getSchemeNotMatchingResponseCode

        int getSchemeNotMatchingResponseCode()

        the response code the HST sets when HttpServletRequest scheme does not match getScheme(). Default response code is HttpServletResponse.SC_MOVED_PERMANENTLY. The following response codes are supported and result in:

        1. 200 : no behavior, ignored
        2. 301 : when request has different scheme than getScheme(), permanent redirect to the correct scheme is done
        3. 302 | 303 | 307 : when request has different scheme than getScheme(), temporal redirect to the correct scheme is done
        4. 403 : when request has different scheme than getScheme(), a page forbidden is returned
        5. 404 : when request has different scheme than getScheme(), a page not found is returned

        Any other response code than above will result in inheriting the response code from parent HstSiteMapItem or Mount

      • getResourceBundleId

        String getResourceBundleId()
        Deprecated. Use #getDefaultResourceBundleIds() instead.
        Returns:
        the first item of default resource bundle IDs or null if not configured or empty.
      • getResourceBundleIds

        String[] getResourceBundleIds()
        Returns:
        resource bundle IDs for this sitemapitem and descendants to use, for example { "org.example.resources.MyResources" }, or an empty array when not configured on this HstSiteMapItem and empty from ancestor HstSiteMapItem or when root sitemapitem from Mount.getDefaultResourceBundleIds()

Copyright © 2008-2013 Hippo B.V. (http://www.onehippo.com). All Rights Reserved.