|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.site.request.HstRequestContextImpl
public class HstRequestContextImpl
HstRequestContextImpl
Constructor Summary | |
---|---|
HstRequestContextImpl(javax.jcr.Repository repository)
|
|
HstRequestContextImpl(javax.jcr.Repository repository,
ContextCredentialsProvider contextCredentialsProvider)
|
Method Summary | |
---|---|
Object |
getAttribute(String name)
Retrieve the attribute value by the attribute name. |
Enumeration<String> |
getAttributeNames()
Enumerates the attribute names |
Map<String,Object> |
getAttributes()
Returns attribute map which is unmodifiable. |
HstContainerURL |
getBaseURL()
Returns the base container URL ( HstContainerURL ) of the current request lifecycle. |
Set<String> |
getComponentFilterTags()
The tags that will be used to render container items. |
ContainerConfiguration |
getContainerConfiguration()
Returns the container configuration |
HstContainerURLProvider |
getContainerURLProvider()
Returns the HstContainerURLProvider to create HstContainerURLs |
ContextCredentialsProvider |
getContextCredentialsProvider()
Returns the context credentials provider |
String |
getContextNamespace()
Returns the context namespace. |
String |
getEmbeddingContextPath()
Returns the contextPath of the embedding application for an embedded request, otherwise null |
HstLinkCreator |
getHstLinkCreator()
Returns the HstLinkCreator to create navigational links |
HstQueryManagerFactory |
getHstQueryManagerFactory()
Returns a HstQueryManagerFactory instance responsible for creating a query manager |
HstSiteMenus |
getHstSiteMenus()
|
Enumeration<Locale> |
getLocales()
Returns an Enumeration of Locale objects |
Mount |
getMount(String alias)
a mount with Mount.getAlias() equal to alias and at least one common type with the mount from the current request. |
Mount |
getMount(String alias,
String type)
a mount with Mount.getAlias() equal to alias and one of its Mount.getTypes() equal to type . |
HstParameterInfoProxyFactory |
getParameterInfoProxyFactory()
Expert: Returns HstParameterInfoProxyFactory to create a proxy for an interface that is referred to by a ParametersInfo annotation
on a HstComponent
annotated interface getters |
String |
getPathSuffix()
Returns the path suffix from the resolved site map item. |
Locale |
getPreferredLocale()
Gets the preferred locale associated with this request. |
String |
getRenderHost()
|
ResolvedMount |
getResolvedEmbeddingMount()
Returns the ResolvedMount to be used for link rewriting when this request is embedded, otherwise null |
ResolvedMount |
getResolvedMount()
Returns the ResolvedMount for this request |
ResolvedSiteMapItem |
getResolvedSiteMapItem()
Returns the ResolvedSiteMapItem for this request |
javax.servlet.ServletContext |
getServletContext()
Returns the ServletContext for this request |
javax.servlet.http.HttpServletRequest |
getServletRequest()
Returns the current HttpServletRequest |
javax.servlet.http.HttpServletResponse |
getServletResponse()
Returns the current HttpServletResponse |
javax.jcr.Session |
getSession()
Returns a session which is normally retrieved from a session pooling repository. |
javax.jcr.Session |
getSession(boolean create)
Returns a session which can be retrieved from a session pooling repository. |
HstSiteMapMatcher |
getSiteMapMatcher()
Returns the HstSiteMapMatcher to be able to match a path to a sitemap item |
Subject |
getSubject()
Gets the subject associated with the authorized entity. |
String |
getTargetComponentPath()
Returns a target component path relative to HstComponentConfiguration of the {@link #getResolvedSiteMapItem(). |
HstURLFactory |
getURLFactory()
Returns the HstURLFactory to create HstURLs |
VirtualHost |
getVirtualHost()
Returns the matched virtual host object |
boolean |
isCmsRequest()
|
boolean |
isEmbeddedRequest()
Returns true if this request is embedded and link rewriting needs to use the HstRequestContext.getResolvedEmbeddingMount()
for the target Mount path and context path (if to be included). |
boolean |
isFullyQualifiedURLs()
|
boolean |
isPortletContext()
Returns true if invoked from a Portlet. |
boolean |
isPreview()
|
void |
removeAttribute(String name)
Removes the attribute by the attribute name. |
void |
setAttribute(String name,
Object object)
Set an attribute to be shared among each HstComponent windows. |
void |
setBaseURL(HstContainerURL baseURL)
|
void |
setComponentFilterTags(Set<String> componentFilterTags)
set the conditions that will trigger a component to be added to the component window hierarchy. |
void |
setContainerConfiguration(ContainerConfiguration containerConfiguration)
|
void |
setContextNamespace(String contextNamespace)
|
void |
setEmbeddingContextPath(String embeddingContextPath)
|
void |
setFullyQualifiedURLs(boolean fullyQualifiedURLs)
|
void |
setHstQueryManagerFactory(HstQueryManagerFactory hstQueryManagerFactory)
|
void |
setHstSiteMenus(HstSiteMenus siteMenus)
|
void |
setLinkCreator(HstLinkCreator linkCreator)
|
void |
setLocales(List<Locale> locales)
Sets the locales assocaited with this request. |
void |
setParameterInfoProxyFactory(HstParameterInfoProxyFactory parameterInfoProxyFactory)
|
void |
setPathSuffix(String pathSuffix)
Sets the path suffix |
void |
setPreferredLocale(Locale preferredLocale)
Sets the preferred locale associated with this request. |
void |
setRenderHost(String renderHost)
Sets a specific render host. |
void |
setResolvedEmbeddingMount(ResolvedMount resolvedEmbeddingMount)
|
void |
setResolvedMount(ResolvedMount resolvedMount)
|
void |
setResolvedSiteMapItem(ResolvedSiteMapItem resolvedSiteMapItem)
|
void |
setServletContext(javax.servlet.ServletContext servletContext)
|
void |
setServletRequest(javax.servlet.http.HttpServletRequest servletRequest)
|
void |
setServletResponse(javax.servlet.http.HttpServletResponse servletResponse)
|
void |
setSession(javax.jcr.Session session)
|
void |
setSiteMapMatcher(HstSiteMapMatcher siteMapMatcher)
|
void |
setSubject(Subject subject)
|
void |
setTargetComponentPath(String targetComponentPath)
|
void |
setURLFactory(HstURLFactory urlFactory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.servlet.ServletContext servletContext
protected javax.servlet.http.HttpServletRequest servletRequest
protected javax.servlet.http.HttpServletResponse servletResponse
protected javax.jcr.Repository repository
protected ContextCredentialsProvider contextCredentialsProvider
protected javax.jcr.Session session
protected ResolvedMount resolvedMount
protected ResolvedSiteMapItem resolvedSiteMapItem
protected String targetComponentPath
protected HstURLFactory urlFactory
protected HstContainerURL baseURL
protected String contextNamespace
protected HstLinkCreator linkCreator
protected HstParameterInfoProxyFactory parameterInfoProxyFactory
protected HstSiteMapMatcher siteMapMatcher
protected HstSiteMenus siteMenus
protected HstQueryManagerFactory hstQueryManagerFactory
protected volatile Map<String,Object> attributes
protected ContainerConfiguration containerConfiguration
protected String embeddingContextPath
protected ResolvedMount resolvedEmbeddingMount
protected Subject subject
protected Locale preferredLocale
protected List<Locale> locales
protected String pathSuffix
protected Set<String> componentFilterTags
protected boolean fullyQualifiedURLs
protected String renderHost
Constructor Detail |
---|
public HstRequestContextImpl(javax.jcr.Repository repository)
public HstRequestContextImpl(javax.jcr.Repository repository, ContextCredentialsProvider contextCredentialsProvider)
Method Detail |
---|
public boolean isPreview()
isPreview
in interface HstRequestContext
true
when this request is matched to a preview siteMount.isPreview()
public javax.servlet.ServletContext getServletContext()
HstRequestContext
getServletContext
in interface HstRequestContext
public void setServletContext(javax.servlet.ServletContext servletContext)
setServletContext
in interface HstMutableRequestContext
public javax.servlet.http.HttpServletRequest getServletRequest()
HstRequestContext
getServletRequest
in interface HstRequestContext
public void setServletRequest(javax.servlet.http.HttpServletRequest servletRequest)
setServletRequest
in interface HstMutableRequestContext
public javax.servlet.http.HttpServletResponse getServletResponse()
HstRequestContext
getServletResponse
in interface HstRequestContext
public void setServletResponse(javax.servlet.http.HttpServletResponse servletResponse)
setServletResponse
in interface HstMutableRequestContext
public void setContextNamespace(String contextNamespace)
setContextNamespace
in interface HstMutableRequestContext
public String getContextNamespace()
HstRequestContext
getContextNamespace
in interface HstRequestContext
public javax.jcr.Session getSession() throws javax.jcr.LoginException, javax.jcr.RepositoryException
HstRequestContext
Returns the current javax.jcr.Session
associated with this requestContext or, if if there is no
current JCR session, creates and returns a new JCR session.
getSession
in interface HstRequestContext
javax.jcr.LoginException
javax.jcr.RepositoryException
public javax.jcr.Session getSession(boolean create) throws javax.jcr.LoginException, javax.jcr.RepositoryException
HstRequestContext
Returns the current javax.jcr.Session
associated with this requestContext or, if if there is no
current JCR session and create
is true, returns
a new JCR session.
If create
is false
and the requestContext has no javax.jcr.Session
,
this method returns null
.
getSession
in interface HstRequestContext
javax.jcr.LoginException
javax.jcr.RepositoryException
public void setSession(javax.jcr.Session session)
setSession
in interface HstMutableRequestContext
public void setResolvedMount(ResolvedMount resolvedMount)
setResolvedMount
in interface HstMutableRequestContext
public ResolvedMount getResolvedMount()
HstRequestContext
ResolvedMount
for this request
getResolvedMount
in interface HstRequestContext
ResolvedMount
for this requestpublic void setResolvedSiteMapItem(ResolvedSiteMapItem resolvedSiteMapItem)
setResolvedSiteMapItem
in interface HstMutableRequestContext
public ResolvedSiteMapItem getResolvedSiteMapItem()
HstRequestContext
ResolvedSiteMapItem
for this request
getResolvedSiteMapItem
in interface HstRequestContext
public void setTargetComponentPath(String targetComponentPath)
setTargetComponentPath
in interface HstMutableRequestContext
public String getTargetComponentPath()
HstRequestContext
HstComponentConfiguration
of the {@link #getResolvedSiteMapItem().
If not null the targeted sub component configuration will be used as root component for this request instead.
getTargetComponentPath
in interface HstRequestContext
public void setBaseURL(HstContainerURL baseURL)
setBaseURL
in interface HstMutableRequestContext
public HstContainerURL getBaseURL()
HstRequestContext
HstContainerURL
) of the current request lifecycle.
getBaseURL
in interface HstRequestContext
public void setURLFactory(HstURLFactory urlFactory)
setURLFactory
in interface HstMutableRequestContext
public HstURLFactory getURLFactory()
HstRequestContext
HstURLFactory
to create HstURLs
getURLFactory
in interface HstRequestContext
public HstContainerURLProvider getContainerURLProvider()
HstRequestContext
HstContainerURLProvider
to create HstContainerURLs
getContainerURLProvider
in interface HstRequestContext
public void setSiteMapMatcher(HstSiteMapMatcher siteMapMatcher)
setSiteMapMatcher
in interface HstMutableRequestContext
public HstSiteMapMatcher getSiteMapMatcher()
HstRequestContext
HstSiteMapMatcher
to be able to match a path to a sitemap item
getSiteMapMatcher
in interface HstRequestContext
public void setLinkCreator(HstLinkCreator linkCreator)
setLinkCreator
in interface HstMutableRequestContext
public HstLinkCreator getHstLinkCreator()
HstRequestContext
HstLinkCreator
to create navigational links
getHstLinkCreator
in interface HstRequestContext
public void setParameterInfoProxyFactory(HstParameterInfoProxyFactory parameterInfoProxyFactory)
setParameterInfoProxyFactory
in interface HstMutableRequestContext
public HstParameterInfoProxyFactory getParameterInfoProxyFactory()
HstRequestContext
HstParameterInfoProxyFactory
to create a proxy for an interface that is referred to by a ParametersInfo
annotation
on a HstComponent
annotated interface getters
getParameterInfoProxyFactory
in interface HstRequestContext
HstParameterInfoProxyFactory
public void setHstSiteMenus(HstSiteMenus siteMenus)
setHstSiteMenus
in interface HstMutableRequestContext
public HstSiteMenus getHstSiteMenus()
getHstSiteMenus
in interface HstRequestContext
public HstQueryManagerFactory getHstQueryManagerFactory()
HstRequestContext
HstQueryManagerFactory
instance responsible for creating a query manager
getHstQueryManagerFactory
in interface HstRequestContext
public void setHstQueryManagerFactory(HstQueryManagerFactory hstQueryManagerFactory)
setHstQueryManagerFactory
in interface HstMutableRequestContext
public Object getAttribute(String name)
HstRequestContext
getAttribute
in interface HstRequestContext
public Enumeration<String> getAttributeNames()
HstRequestContext
getAttributeNames
in interface HstRequestContext
public void removeAttribute(String name)
HstRequestContext
removeAttribute
in interface HstRequestContext
public void setAttribute(String name, Object object)
HstRequestContext
setAttribute
in interface HstRequestContext
name
- attribute nameobject
- attribute valuepublic Map<String,Object> getAttributes()
HstRequestContext
getAttributes
in interface HstRequestContext
public ContainerConfiguration getContainerConfiguration()
HstRequestContext
getContainerConfiguration
in interface HstRequestContext
public void setContainerConfiguration(ContainerConfiguration containerConfiguration)
setContainerConfiguration
in interface HstMutableRequestContext
public VirtualHost getVirtualHost()
HstRequestContext
getVirtualHost
in interface HstRequestContext
public boolean isEmbeddedRequest()
HstRequestContext
HstRequestContext.getResolvedEmbeddingMount()
for the target Mount path and context path (if to be included).
isEmbeddedRequest
in interface HstRequestContext
public void setEmbeddingContextPath(String embeddingContextPath)
setEmbeddingContextPath
in interface HstMutableRequestContext
public String getEmbeddingContextPath()
HstRequestContext
getEmbeddingContextPath
in interface HstRequestContext
HstRequestContext.isEmbeddedRequest()
public void setResolvedEmbeddingMount(ResolvedMount resolvedEmbeddingMount)
setResolvedEmbeddingMount
in interface HstMutableRequestContext
public ResolvedMount getResolvedEmbeddingMount()
HstRequestContext
ResolvedMount
to be used for link rewriting when this request is embedded, otherwise null
getResolvedEmbeddingMount
in interface HstRequestContext
HstRequestContext.isEmbeddedRequest()
public boolean isPortletContext()
HstRequestContext
isPortletContext
in interface HstRequestContext
public ContextCredentialsProvider getContextCredentialsProvider()
HstRequestContext
getContextCredentialsProvider
in interface HstRequestContext
public void setSubject(Subject subject)
setSubject
in interface HstMutableRequestContext
public Subject getSubject()
HstRequestContext
getSubject
in interface HstRequestContext
public void setPreferredLocale(Locale preferredLocale)
HstMutableRequestContext
setPreferredLocale
in interface HstMutableRequestContext
preferredLocale
- The preferred locale associated with this request.public Locale getPreferredLocale()
HstRequestContext
getPreferredLocale
in interface HstRequestContext
public void setLocales(List<Locale> locales)
HstMutableRequestContext
setLocales
in interface HstMutableRequestContext
public Enumeration<Locale> getLocales()
HstRequestContext
getLocales
in interface HstRequestContext
public void setPathSuffix(String pathSuffix)
HstMutableRequestContext
setPathSuffix
in interface HstMutableRequestContext
public String getPathSuffix()
HstRequestContext
getPathSuffix
in interface HstRequestContext
null
if there is no path suffixpublic void setComponentFilterTags(Set<String> componentFilterTags)
HstMutableRequestContext
setComponentFilterTags
in interface HstMutableRequestContext
public Set<String> getComponentFilterTags()
HstRequestContext
The tags that will be used to render container items.
When tags are available, and there is a container item in a container that matches the tag, those container items will be rendered at the exclusion of the other items. If no tags are provided, or none matches any of the tags on the container items, only those container items that do not have a tag will be rendered.
getComponentFilterTags
in interface HstRequestContext
public Mount getMount(String alias)
HstRequestContext
a mount with Mount.getAlias()
equal to alias
and at least one common type with the mount from the current request. Thus, at least
one of the types of the found Mount.getTypes()
must be equal to one of the types of the mount of the current request.
If there can be found a Mount
with the same primary type ( Mount.getType()
) as the one for the mount of the current request, this
Mount
has precedence. If there is no primary type match, we'll return the mount that has most types in common
There will be looked if the Mount
of the current HstRequestContext
has a property that is called hst:mountXXX
where XXX
is equal to alias
. If so, there will be tried
to return a Mount
that has an alias equal to the value of this mappedAlias property hst:mountXXX
.
If there cannot be found a Mount
for via a mapped hst:mountXXX
property, there will be looked for a Mount
with
which has Mount.getAlias()
equal to alias
.
Thus a mapped alias has precedence!
getMount
in interface HstRequestContext
alias
- the alias the found Mount
or XXX in hst:mountXXX property
Mount.getAlias()
equal to alias
or mappedAlias and at least one common type with the mount from the current request. null
if there is no suitable mount.public Mount getMount(String alias, String type)
HstRequestContext
a mount with Mount.getAlias()
equal to alias
and one of its Mount.getTypes()
equal to type
.
There will be looked if the Mount
of the current HstRequestContext
has a property that is called hst:mountXXX
where XXX
is equal to alias
.
If so, there will be tried to return a Mount
that has an alias equal to the value of this mappedAlias property hst:mountXXX
. If there cannot be found a Mount
for via a mapped hst:mountXXX
property,
there will be looked for a Mount
with which has Mount.getAlias()
equal to alias
.
getMount
in interface HstRequestContext
alias
- the alias the found Mount
or or XXX in hst:mountXXX propertytype
- the type the found Mount
should have
Mount.getAlias()
equal to alias
or mappedAlias and one of its Mount.getTypes()
equal to type
. null
if there is no suitable mount.public void setFullyQualifiedURLs(boolean fullyQualifiedURLs)
setFullyQualifiedURLs
in interface HstMutableRequestContext
fullyQualifiedURLs
- sets whether created URLs will be fully qualifiedpublic boolean isFullyQualifiedURLs()
isFullyQualifiedURLs
in interface HstRequestContext
true
when all URLs must be fully qualified, ie, including scheme, domain and portnumber (if present)public void setRenderHost(String renderHost)
HstMutableRequestContext
renderHost
was the actual
used host in the request.
setRenderHost
in interface HstMutableRequestContext
renderHost
- the host to be used for renderingpublic String getRenderHost()
getRenderHost
in interface HstRequestContext
null
when no specific render host is defined. Typically,
there is only a render host when the request originated from the CMSpublic boolean isCmsRequest()
isCmsRequest
in interface HstRequestContext
true
when the request is from a cms context: This can be some REST call from the cms, or
a channel preview request inside the cms or over the HOST of the cms
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |