|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.configuration.sitemap.HstSiteMapItemService
public class HstSiteMapItemService
Constructor Summary | |
---|---|
HstSiteMapItemService(HstNode node,
Mount mount,
HstSiteMapItemHandlersConfiguration siteMapItemHandlersConfiguration,
HstSiteMapItem parentItem,
HstSiteMap hstSiteMap,
int depth)
|
Method Summary | |
---|---|
void |
addAnyPrefixedChildSiteMapItems(HstSiteMapItemService hstSiteMapItem)
|
void |
addWildCardPrefixedChildSiteMapItems(HstSiteMapItemService hstSiteMapItem)
|
boolean |
containsAny()
|
boolean |
containsWildCard()
|
HstSiteMapItem |
getAnyPatternChild(String[] elements,
int position,
List<HstSiteMapItem> excludeList)
|
HstSiteMapItem |
getChild(String value)
Return the child HstSiteMapItem that has the corresponding value (HstSiteMapItem.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 |
getDepth()
|
int |
getErrorCode()
A HstSiteMapItem can specify an error-code. |
String |
getExtension()
|
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 because
must uniquely return a HstSiteMapItem . |
Map<String,String> |
getKeyToPropertyPlaceHolderMap()
|
String |
getLocale()
the locale for this sitemapItem or null when it does not contain one. |
String |
getLocalParameter(String name)
see HstSiteMapItem.getParameter(String) , only this method returns parameters without inheritance |
Map<String,String> |
getLocalParameters()
see HstSiteMapItem.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. |
String |
getParameterizedPath()
|
Map<String,String> |
getParameters()
See HstSiteMapItem.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 |
getPostfix()
|
String |
getPrefix()
|
String |
getQualifiedId()
The qualified id, which might contain more info then just HstSiteMapItem.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 because
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 HstSiteMapItem.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 HstSiteMapItem.isAuthenticated() is true. |
String |
getValue()
Returns the logical path element of this SiteMapItem . |
int |
getWildCardAnyOccurences()
|
HstSiteMapItem |
getWildCardPatternChild(String value,
List<HstSiteMapItem> excludeList)
|
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 HstSiteMapItem.getRelativeContentPath() , we cannot choose which one is the one you want, so, one of the items is used. |
boolean |
isUseableInRightContextOnly()
|
boolean |
isWildCard()
Returns a boolean indicating whether this HstSiteMapItem represents a path with a wildcard value * |
boolean |
patternMatch(String value,
String prefix,
String postfix)
|
void |
setKeyToPropertyPlaceHolderMap(Map<String,String> keyToPropertyPlaceHolderMap)
|
void |
setUseableInRightContextOnly(boolean useableInRightContextOnly)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HstSiteMapItemService(HstNode node, Mount mount, HstSiteMapItemHandlersConfiguration siteMapItemHandlersConfiguration, HstSiteMapItem parentItem, HstSiteMap hstSiteMap, int depth) throws ServiceException
ServiceException
Method Detail |
---|
public HstSiteMapItem getChild(String value)
HstSiteMapItem
HstSiteMapItem
that has the corresponding value
(HstSiteMapItem.getValue()
)
and null
otherwise
getChild
in interface HstSiteMapItem
value
- the value of the child HstSiteMapItem
as it would be return by HstSiteMapItem.getValue()
value
and null
if no HstSiteMapItem
exists with this value
in this HstSiteMapItem
object.public List<HstSiteMapItem> getChildren()
HstSiteMapItem
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
getChildren
in interface HstSiteMapItem
public String getComponentConfigurationId()
HstSiteMapItem
HstComponentConfiguration
.
getComponentConfigurationId
in interface HstSiteMapItem
SiteMapItem
or null
public String getPortletComponentConfigurationId()
HstSiteMapItem
HstComponentConfiguration
.
getPortletComponentConfigurationId
in interface HstSiteMapItem
SiteMapItem
or null
public String getId()
HstSiteMapItem
HstSiteMapItem
is mandatory and must be unique within its containing HstSiteMap
because
HstSiteMap.getSiteMapItemById(String)
must uniquely return a HstSiteMapItem
.
getId
in interface HstSiteMapItem
public String getRefId()
HstSiteMapItem
HstSiteMapItem
is non-mandatory and must be unique within its containing HstSiteMap
because
HstSiteMap.getSiteMapItemByRefId(String)
must uniquely return a HstSiteMapItem
. The difference with HstSiteMapItem.getId()
is that
that id
is in general an auto-generated id, where this HstSiteMapItem.getRefId()
is an optional id to get hold of this HstSiteMapItem
.
getRefId
in interface HstSiteMapItem
null
when no refId is defined on the HstSiteMapItem
public String getRelativeContentPath()
HstSiteMapItem
Mount.getContentPath()
. This value can
contain property placeholders, like ${1}/${2}, which should be resolved in the ResolvedSiteMapItem.getRelativeContentPath()
getRelativeContentPath
in interface HstSiteMapItem
Mount.getContentPath()
public String getParameter(String name)
HstSiteMapItem
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
HstSiteMapItem.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)
getParameter
in interface HstSiteMapItem
name
- the name of the parameter
null
when not presentpublic Map<String,String> getParameters()
HstSiteMapItem
HstSiteMapItem.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()
getParameters
in interface HstSiteMapItem
HstSiteMapItem
. If no parameters present, and empty map is returnedpublic String getLocalParameter(String name)
HstSiteMapItem
HstSiteMapItem.getParameter(String)
, only this method returns parameters without inheritance
getLocalParameter
in interface HstSiteMapItem
name
- the name of the parameter
null
when not presentpublic Map<String,String> getLocalParameters()
HstSiteMapItem
HstSiteMapItem.getParameters()
, only this method returns parameters (unmodifiable map) without inheritance
getLocalParameters
in interface HstSiteMapItem
HstSiteMapItem
. If no parameters present, and empty map is returnedpublic HstSiteMapItemHandlerConfiguration getSiteMapItemHandlerConfiguration(String handlerId)
getSiteMapItemHandlerConfiguration
in interface HstSiteMapItem
HstSiteMapItemHandlerConfiguration
for handlerId
or null
if no handler present for handlerId
public List<HstSiteMapItemHandlerConfiguration> getSiteMapItemHandlerConfigurations()
HstSiteMapItem
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
getSiteMapItemHandlerConfigurations
in interface HstSiteMapItem
HstSiteMapItemHandlerConfiguration
s and an empty list if this SiteMapItem does not contain HstSiteMapItemHandlerConfiguration
spublic int getStatusCode()
HstSiteMapItem
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.
getStatusCode
in interface HstSiteMapItem
0
public int getErrorCode()
HstSiteMapItem
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.
getErrorCode
in interface HstSiteMapItem
0
public boolean isAuthenticated()
HstSiteMapItem
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 HstSiteMapItem.isAuthenticated()
when no configuration is set for authenticated.
isAuthenticated
in interface HstSiteMapItem
true
if the sitemap item is authenticated.public Set<String> getRoles()
HstSiteMapItem
HstSiteMapItem.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 HstSiteMapItem.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.
getRoles
in interface HstSiteMapItem
public Set<String> getUsers()
HstSiteMapItem
HstSiteMapItem.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 HstSiteMapItem.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.
getUsers
in interface HstSiteMapItem
public String getValue()
HstSiteMapItem
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 HstSiteMapItem.getChild(String)
and HstSiteMap.getSiteMapItem(String)
getValue
in interface HstSiteMapItem
SiteMapItem
which represents the logical path element for this SiteMapItem
public String getLocale()
HstSiteMapItem
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.
getLocale
in interface HstSiteMapItem
null
when it does not contain one.public boolean isWildCard()
HstSiteMapItem
HstSiteMapItem
represents a path with a wildcard
value *
isWildCard
in interface HstSiteMapItem
true
if this HstSiteMapItem
represents *
public boolean isAny()
HstSiteMapItem
HstSiteMapItem
represents a path with a any
value **
isAny
in interface HstSiteMapItem
true
if this HstSiteMapItem
represents **
public HstSiteMap getHstSiteMap()
HstSiteMapItem
HstSiteMap
that is the container of this HstSiteMapItem
getHstSiteMap
in interface HstSiteMapItem
HstSiteMap
that is the container of this HstSiteMapItem
public HstSiteMapItem getParentItem()
HstSiteMapItem
HstSiteMapItem
and null
when the item does not have a parent (in other words, it is a
root HstSiteMapItem
)
getParentItem
in interface HstSiteMapItem
HstSiteMapItem
and null
when the item does not have a parentpublic String getParameterizedPath()
public int getWildCardAnyOccurences()
public void addWildCardPrefixedChildSiteMapItems(HstSiteMapItemService hstSiteMapItem)
public void addAnyPrefixedChildSiteMapItems(HstSiteMapItemService hstSiteMapItem)
public HstSiteMapItem getWildCardPatternChild(String value, List<HstSiteMapItem> excludeList)
public HstSiteMapItem getAnyPatternChild(String[] elements, int position, List<HstSiteMapItem> excludeList)
public boolean patternMatch(String value, String prefix, String postfix)
public String getNamedPipeline()
HstSiteMapItem
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
getNamedPipeline
in interface HstSiteMapItem
null
when it does not contain one.public String getPostfix()
public String getExtension()
public String getPrefix()
public boolean containsWildCard()
public boolean containsAny()
public void setUseableInRightContextOnly(boolean useableInRightContextOnly)
public boolean isUseableInRightContextOnly()
public void setKeyToPropertyPlaceHolderMap(Map<String,String> keyToPropertyPlaceHolderMap)
public Map<String,String> getKeyToPropertyPlaceHolderMap()
public int getDepth()
public String getQualifiedId()
HstSiteMapItem
HstSiteMapItem.getId()
as the getId might return an id which is meaningfull only within it's current HstSiteMap
getQualifiedId
in interface HstSiteMapItem
public boolean isExcludedForLinkRewriting()
HstSiteMapItem
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 HstSiteMapItem.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
isExcludedForLinkRewriting
in interface HstSiteMapItem
true
when this sitemap item should be ignored for linkrewriting
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |