|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Mount
A Mount object is the mount from a prefix to some (sub)site *or* content location: when the isMapped() property returns true or missing,
the Mount is linked to a HstSite that uses a HstSiteMap. When isMapped() property returns false, the Mount won't use
a URL mapping through the HstSiteMap
Mount is a Composite pattern: Each Mount can contain any descendant
child Mount tree. A Mount 'lives' below a VirtualHost. The Mount directly below a VirtualHost must be called hst:root by definition.
The hst:root Mount is where the Mount matching starts. Once a virtual host is matched for the incoming HttpServletRequest,
we inspect the request path (the path after the context path and before the query string) and try to match the request path as deep as possible to the Mount tree: note that
we try to map to the best matching Mount: This means, that 'exact' matching names have precedence over wildcard names
Mount tree configuration:
127.0.0.1
`- hst:root (hst:mountpoint = /live/myproject, hst:ismapped = true)
`- preview (hst:mountpoint = /preview/myproject, hst:ismapped = true)
The configuration above means, that below the host 127.0.0.1 we have of course the mandatory Mount hst:root, and below it, we have
a Mount preview. Every request path that starts with /preview will be mapped to 'preview' Mount, all other request path's that do not start with '/preview'
resolve to the hst:root item. While the request path does match the next Mount descendant in the tree, the matching is continued to descendant Mount items. Thus, in the current example,
the request path /preview/home will return the Mount with name 'preview'.
VirtualHost also has:
One extra is possible, hst:namedpipeline, see below for an example.
Just as with the virtual hosts, properties are inherited by child Mount items as long as they are not defined by themselves
www.mycompany.com
` hst:root (hst:mountpoint = /live/myproject)
preview.mycompany.com
` hst:root (hst:mountpoint = /preview/myproject)
As can be seen, instead of using the request path prefix to distuinguish between live and preview, we now do so by hostname.
An example with moreMount items is for example:
127.0.0.1
`- hst:root (hst:mountpoint = /live/myproject)
|-myrestservice (hst:mountpoint = /live/myproject, hst:namedpipeline=JaxrsPipeline)
`- preview (hst:mountpoint = /preview/myproject)
`-myrestservice (hst:mountpoint = /preview/myproject, hst:namedpipeline=JaxrsPipeline)
Now, all request path's that start with /myrestservice or /preview/myrestservice resolve to the myrestservice
Mount item. This one has a custom hst:namedpipeline, where you can configure a complete custom hst request processing, in this example
some pipeline exposing some rest interface.
Optionally, wildcard matching support can be implemented, where even the wilcards can be used within the property values. For example:
127.0.0.1
`- hst:root (hst:mountpoint = /live/myproject)
|- * (hst:mountpoint = /live/${1})
`- preview (hst:mountpoint = /preview/myproject)
` - * (hst:mountpoint = /preview/${1})
The above means, that when there is a (sub)site complying to the wildcard, this one is used, and otherwise, the default one pointing
to myproject is used. Thus, a request path like /preview/mysubsite/home will map to the Mount /preview/*
if there is a (sub)site at the mountpoint /preview/${1}, where obviously ${1} is substituted by 'mysubsite'. Assuming that there
is no subsite called 'news', a request path like /preview/news/2010/05/my-news-item will thus be handled by the site 'myproject'
| Field Summary | |
|---|---|
static String |
LIVE_NAME
the string value that indicates 'live' |
static String |
PREVIEW_NAME
the string value that indicates 'preview' |
static String |
PROPERTY_NAME_MOUNT_PREFIX
the predefined property name prefix to indicates mount aliases |
| Method Summary | ||
|---|---|---|
String |
getAlias()
Returns the alias of this Mount item. |
|
String |
getCanonicalContentPath()
Returns the absolute canonical content path for the content of this Mount. |
|
|
getChannelInfo()
The channel properties for this mount. |
|
String |
getChannelPath()
|
|
Mount |
getChildMount(String name)
|
|
List<Mount> |
getChildMounts()
|
|
String |
getContentPath()
Returns the content path for this Mount object. |
|
String[] |
getDefaultSiteMapItemHandlerIds()
|
|
String |
getEmbeddedMountPath()
for embedded delegation of sites a mountpath needs to point to the delegated Mount. |
|
String |
getFormLoginPage()
Returns FORM Login Page |
|
String |
getHomePage()
|
|
HstSite |
getHstSite()
|
|
HstSiteMapMatcher |
getHstSiteMapMatcher()
This is a shortcut method fetching the HstSiteMapMatcher from the backing HstManager |
|
String |
getIdentifier()
|
|
String |
getLocale()
the locale for this Mount or null when it does not contain one. |
|
String |
getMountPath()
Returns the mount path for this Mount object. |
|
String |
getMountPoint()
Returns the mount point for this Mount object. |
|
Map<String,String> |
getMountProperties()
Returns all the properties that start with "hst:mount" and have value of type String. |
|
String |
getName()
|
|
String |
getNamedPipeline()
Note that if an ancestor Mount contains a namedPipeline, this value is inherited unless this Mount explicitly defines its own |
|
String |
getPageNotFound()
|
|
Mount |
getParent()
|
|
int |
getPort()
|
|
String |
getProperty(String name)
the string value of the property or null when the property is not present. |
|
Set<String> |
getRoles()
Returns the roles that are allowed to access this Mount when isAuthenticated() is true. |
|
String |
getScheme()
|
|
String |
getType()
|
|
List<String> |
getTypes()
|
|
Set<String> |
getUsers()
Returns the users that are allowed to access this Mount when isAuthenticated() is true. |
|
VirtualHost |
getVirtualHost()
|
|
boolean |
isAuthenticated()
If this method returns true, then only if the user is explicitly allowed or servletRequest.isUserInRole(role) returns true this
Mount is accessible for the request. |
|
boolean |
isContextPathInUrl()
|
|
boolean |
isMapped()
When this Mount is not using a HstSiteMap for the request processing, this method returns false. |
|
boolean |
isOfType(String type)
When a this Mount is of type type this returns true. |
|
boolean |
isPortInUrl()
|
|
boolean |
isPreview()
This method returns the same as isOfType(String type) with type="preview" |
|
boolean |
isSessionStateful()
Returns true if subject based jcr session should be statefully managed. |
|
boolean |
isSite()
When this method returns false, then HstLink will have the HstLink.PATH_SUBPATH_DELIMITER included even for empty or null HstLink.getSubPath(), if and only if
the VirtualHosts.isExcluded(String) for the path to create a link for returns true. |
|
boolean |
isSubjectBasedSession()
Returns true if subject based jcr session should be used for this Mount |
|
boolean |
isVersionInPreviewHeader()
When this Mount has isPreview() return false, this method always returns false. |
|
String |
onlyForContextPath()
In case the HttpServletRequest.getContextPath() does not matter, this method must return null or empty. |
|
| Field Detail |
|---|
static final String PROPERTY_NAME_MOUNT_PREFIX
static final String LIVE_NAME
static final String PREVIEW_NAME
| Method Detail |
|---|
String getName()
Mount itemString getAlias()
Mount item. The alias of a Mount must be unique in combination with every type getTypes() within a single host group, also
see (VirtualHost.getHostGroupName()). When there is no alias defined on the Mount, null is returned. The Mount can then not be used
to lookup by alias
Mount item or null when it does not have oneboolean isMapped()
Mount is not using a HstSiteMap for the request processing, this method returns false. When it returns false, then
getNamedPipeline() should also be configured, and a pipeline should be invoked that is independent of the ResolvedSiteMapItem as their won't be one.
Note that the getMountPoint() can still point to a HstSite which in that case contains the hst:content node
which is the filtered mirror for accessing the content
Mount getParent()
Mount of this Mount and null if we are at the root MountString getMountPoint()
Returns the mount point for this Mount object. The mount point can be the absolute jcr path to the root site node, for example
something like '/hst:hst/hst:sites/mysite-live', but it can also be some jcr path to some virtual or canonical node in the repository. For example
it can be '/content/gallery' , which might be the case for a Mount suited for REST gallery calls.
Mount and null if there is no mountPoint configured (nor inherited)ResolvedMount.getResolvedMountPath()String getContentPath()
Returns the content path for this Mount object. The content path is the absolute jcr path to the root site node content, for example
something like '/hst:hst/hst:sites/mysite-live/hst:content'. The getContentPath() can be the same as getMountPoint(), but
this is in general only for Mount's that have isMapped() returning false. When the Mount does have
isMapped() equal to true, the getContentPath() can return a different path than getMountPoint(). In general, it will be
then getMountPoint() + "/hst:content".
Mount. It cannot be nullString getCanonicalContentPath()
Mount. Note that it can return the same
value as getContentPath(), but this is in general not the case: When the getContentPath() points
to a virtual node, this method returns the location of the canonical version. When the getContentPath() points to
a node which behaves like a mirror, then this method returns the location where the mirror points to. If
getContentPath() does not point to a virtual node, nor to a mirror, this method returns the same value.
Mount. It can be null in case getContentPath() points to a virtual node
that does not have a canonical version.String getMountPath()
Returns the mount path for this Mount object. The root Mount has an empty String ("") as mount path. A mountPath for a
Mount is its own getName() plus all ancestors up to the root and always starts with a "/" (unless for the root, this one is empty).
It can contain wildcards, for example /preview/*. Typically, these wildcards are replaced by their request specific values in the ResolvedMount.
Note the difference with getMountPoint(): the getMountPoint() returns the jcr location of the (sub)site or of the content
MountResolvedMount.getResolvedMountPath()List<Mount> getChildMounts()
List of all child Mounts and an empty List if there are no child MountsMount getChildMount(String name)
name - of the child Mount
Mount with getName() equal to name or null when there is no such itemVirtualHost getVirtualHost()
Mount belongs toHstSite getHstSite()
HstSite this Mount is pointing to or null when none foundboolean isContextPathInUrl()
true when the created url should have the contextpath in itboolean isPortInUrl()
true when the created url should have contain the port numberboolean isSite()
false, then HstLink will have the HstLink.PATH_SUBPATH_DELIMITER included even for empty or null HstLink.getSubPath(), if and only if
the VirtualHosts.isExcluded(String) for the path to create a link for returns true. This is to avoid that for example a path that ends with .pdf will be skipped by the
HstRequestProcessor due to VirtualHosts.isExcluded(String) : This is undesirable in case of a REST link for a binary for example
Mount is meant to be a site (false in case of for example being used for REST calls)int getPort()
MountString onlyForContextPath()
HttpServletRequest.getContextPath() does not matter, this method must return null or empty. If only this Mount
can be used for a certain contextPath, this method should return that contextPath. . If configured, the contextPath is either an empty String,
or it has to start with a "/" and is not allowed to have any other "/".
null or empty if the contextPath does not matter, otherwise it returns the value the contextPath must have a possible to match to this MountString getHomePage()
Mount or null when not presentString getPageNotFound()
Mount or null when not presentString getScheme()
boolean isPreview()
isOfType(String type) with type="preview"
true when this Mount is configured to be a preview Mount.boolean isOfType(String type)
Mount is of type type this returns true. A Mount can be of multiple types at once.
type - the type to test
true when this Mount is of type typeString getType()
MountList<String> getTypes()
Mount belongs to, including the primary type getType(). The primary type is the first item in the Listboolean isVersionInPreviewHeader()
Mount has isPreview() return false, this method always returns false. When the Mount is preview,
and the Mount is configured to have the hst version number in preview, then this method returns true
true when for this Mount the current hst version should be added as a response headerString getNamedPipeline()
Mount contains a namedPipeline, this value is inherited unless this Mount explicitly defines its own
Mount or null when the default pipeline is to be usedString getLocale()
Mount or null when it does not contain one. Note that if an ancestor Mount contains a
locale, this value is inherited unless this Mount explicitly defines its own. The root Mount inherits the value from
the VirtualHost if the virtual host contains a locale
Mount or null when it does not contain one.HstSiteMapMatcher getHstSiteMapMatcher()
HstManager
String getEmbeddedMountPath()
Mount. This is only relevant for portal environment
Mount path and null if not presentboolean isAuthenticated()
servletRequest.isUserInRole(role) returns true this
Mount is accessible for the request.
If a Mount does not have a configuration for authenticated, the value from the parent item is taken.
true if the Mount is authenticated.Set<String> getRoles()
isAuthenticated() is true. If the Mount 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
Set<String> getUsers()
isAuthenticated() is true. If the Mount 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
boolean isSubjectBasedSession()
boolean isSessionStateful()
String getFormLoginPage()
null if not configuredString getProperty(String name)
null when the property is not present. When the property value is not of
type String, we'll return the Object.toString() value
name - the name of the property
null when the property is not presentMap<String,String> getMountProperties()
Returns all the properties that start with "hst:mount" and have value of type String. This map has as key the
propertyname after "hst:mount".
Note The property called hst:mountpoint is excluded from this map, as it has a complete different purpose
String getIdentifier()
Mount<T extends ChannelInfo> T getChannelInfo()
Blueprint#getChannelInfoClass()).
T - Type of the channel info. Only checked at runtime on assignment.
String getChannelPath()
null if not configuredString[] getDefaultSiteMapItemHandlerIds()
HstSiteMapItem's get or null if non configured
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||