org.hippoecm.hst.configuration.sitemap
Interface HstSiteMapItem
- All Known Implementing Classes:
- HstSiteMapItemService
public interface HstSiteMapItem
A HstSiteMapItem is used as a representation of a logical path (element) for matching (part of a) external URL
to a repository content location. Through its id it can be directly accessed by the HstSiteMap
, to for example
create a link to it. Obviously, creating a link to a HstSiteMapItem
does only make sense when its path in the
HstSiteMap
does not contain WILDCARD's ( *
or **
)
NOTE: As HstComponent
instances can access HstSiteMapItem
instances but should not be able to modify them,
implementations must make sure that through the api a HstSiteMapItem
instance cannot be changed. Returned List and Map
should be therefor unmodifiable.
Method Summary |
HstSiteMapItem |
getChild(String value)
Return the child HstSiteMapItem that has the corresponding value (getValue() )
and null otherwise |
List<HstSiteMapItem> |
getChildren()
Returns a List of all child HstSiteMapItem 's of this HstSiteMapItem . |
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. |
int |
getErrorCode()
A HstSiteMapItem can specify an error-code. |
HstSiteMap |
getHstSiteMap()
Return the HstSiteMap that is the container of this HstSiteMapItem |
String |
getId()
The id of a HstSiteMapItem is mandatory and must be unique within its containing HstSiteMap because
HstSiteMap.getSiteMapItemById(String) must uniquely return a HstSiteMapItem . |
String |
getLocale()
the locale for this sitemapItem or null when it does not contain one. |
String |
getLocalParameter(String name)
see getParameter(String) , only this method returns parameters without inheritance |
Map<String,String> |
getLocalParameters()
see getParameters() , only this method returns parameters (unmodifiable map) without inheritance |
String |
getNamedPipeline()
the namedPipeline for this sitemapItem or null when it does not contain one. |
String |
getParameter(String name)
A HstSiteMapItem can contain a Map of parameters. |
Map<String,String> |
getParameters()
See getParameter(String) , only now entire the parameters map is returned. |
HstSiteMapItem |
getParentItem()
Returns parent HstSiteMapItem and null when the item does not have a parent (in other words, it is a
root HstSiteMapItem ) |
String |
getPortletComponentConfigurationId()
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. |
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 |
String |
getRefId()
The refId of a HstSiteMapItem is non-mandatory and must be unique within its containing HstSiteMap because
HstSiteMap.getSiteMapItemByRefId(String) must uniquely return a HstSiteMapItem . |
String |
getRelativeContentPath()
This method returns a content path, relative to the Mount.getContentPath() . |
Set<String> |
getRoles()
Returns the roles that are allowed to access this sitemap item when isAuthenticated() is true. |
HstSiteMapItemHandlerConfiguration |
getSiteMapItemHandlerConfiguration(String handlerId)
|
List<HstSiteMapItemHandlerConfiguration> |
getSiteMapItemHandlerConfigurations()
The List of HstSiteMapItemHandlerConfiguration s and an empty list if this SiteMapItem does not contain HstSiteMapItemHandlerConfiguration s. |
int |
getStatusCode()
A HstSiteMapItem can specify the status-code that needs to be set on the webpage header. |
Set<String> |
getUsers()
Returns the users that are allowed to access this sitemap item when isAuthenticated() is true. |
String |
getValue()
Returns the logical path element of this SiteMapItem . |
boolean |
isAny()
Returns a boolean indicating whether this HstSiteMapItem represents a path with a any value ** |
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. |
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. |
boolean |
isWildCard()
Returns a boolean indicating whether this HstSiteMapItem represents a path with a wildcard value * |
getId
String getId()
- The id of a
HstSiteMapItem
is mandatory and must be unique within its containing HstSiteMap
because
HstSiteMap.getSiteMapItemById(String)
must uniquely return a HstSiteMapItem
.
- Returns:
- the id of this HstSiteMapItem
getRefId
String getRefId()
- The refId of a
HstSiteMapItem
is non-mandatory and must be unique within its containing HstSiteMap
because
HstSiteMap.getSiteMapItemByRefId(String)
must uniquely return a HstSiteMapItem
. The difference with getId()
is that
that id
is in general an auto-generated id, where this getRefId()
is an optional id to get hold of this HstSiteMapItem
.
- Returns:
- the refId of this HstSiteMapItem or
null
when no refId is defined on the HstSiteMapItem
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 **
getRelativeContentPath
String getRelativeContentPath()
- This method returns a content path, relative to the
Mount.getContentPath()
. This value can
contain property placeholders, like ${1}/${2}, which should be resolved in the ResolvedSiteMapItem.getRelativeContentPath()
- Returns:
- the content path relative to the
Mount.getContentPath()
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
String getPortletComponentConfigurationId()
- 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
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
getParameters
Map<String,String> getParameters()
- See
getParameter(String)
, only now entire the parameters map is returned.
Implementations should return an unmodifiable map, for example Collections.UnmodifiableMap
to avoid
client code changing configuration
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.getParameters()
- Returns:
- the Map of parameters contained in this
HstSiteMapItem
. If no parameters present, and empty map is returned
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.
getSiteMapItemHandlerConfiguration
HstSiteMapItemHandlerConfiguration getSiteMapItemHandlerConfiguration(String handlerId)
- Parameters:
handlerId
-
- Returns:
- the
HstSiteMapItemHandlerConfiguration
for handlerId
or null
if no handler present for handlerId
getSiteMapItemHandlerConfigurations
List<HstSiteMapItemHandlerConfiguration> getSiteMapItemHandlerConfigurations()
The List of HstSiteMapItemHandlerConfiguration
s and an empty list if this SiteMapItem does not contain HstSiteMapItemHandlerConfiguration
s.
Note that HstSiteMapItemHandlerConfiguration
s are NOT inherited from parent/ancestor HstSiteMapItem's.
Implementations should return an unmodifiable list, for example Collections.UnmodifiableList
to avoid
client code changing configuration
- Returns:
- The List of
HstSiteMapItemHandlerConfiguration
s and an empty list if this SiteMapItem does not contain HstSiteMapItemHandlerConfiguration
s
Copyright © 2008-2012 Hippo. All Rights Reserved.