Class ViewerPath
- All Implemented Interfaces:
Serializable
PageType
of the requested view and an associated
CMSPage
are also referenced
This information helps calling the correct url in different contexts and is also used to redirect to CMSPages and store a brief view history to
allow returning to a previous view The entire url always consists of the properties applicationUrl
+ pagePath
+
parameterPath
The easiest way to create ViewerPath based on a http request is by calling
ViewerPathBuilder.createPath(HttpServletRequest)
or
ViewerPathBuilder.createPath(String, String, String, String)
- Author:
- Florian Alpers
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates an emptyViewerPath
.ViewerPath
(ViewerPath blueprint) Creates an exact copy of the passedblueprint
. -
Method Summary
Modifier and TypeMethodDescriptionGetter for the fieldapplicationName
.Getter for the fieldapplicationUrl
.Getter for the fieldcampaign
.Getter for the fieldcmsPage
.getCombinedPath.getCombinedPrettyfiedPath.getCombinedPrettyfiedUrl.getCombinedUrl.Getter for the fieldpagePath
.Getter for the fieldpageType
.Getter for the fieldparameterPath
.getPrettifiedPagePath.boolean
isCmsPage.boolean
isPage()
isPage.boolean
matches.void
setApplicationName
(String applicationName) Setter for the fieldapplicationName
.void
setApplicationUrl
(String applicationUrl) Setter for the fieldapplicationUrl
.void
setCampaign
(Campaign campaign) Setter for the fieldcampaign
.void
setCmsPage
(CMSPage cmsPage) Setter for the fieldcmsPage
.void
setPagePath
(URI pagePath) Setter for the fieldpagePath
.void
setPageType
(PageType pageType) Setter for the fieldpageType
.void
setParameterPath
(URI parameterPath) Setter for the fieldparameterPath
.void
setQueryString
(String queryString) toString()
-
Constructor Details
-
ViewerPath
public ViewerPath()Creates an emptyViewerPath
. Usually this does not need to be called directly. Instead a ViewerPath should be created by callingViewerPathBuilder.createPath(HttpServletRequest)
orViewerPathBuilder.createPath(String, String, String, String)
-
ViewerPath
Creates an exact copy of the passedblueprint
. This only creates a shallow copy, which is irrelevant to almost all properties which are immutables,cmsPage
being the only exception (but that is ok since all paths should indeed point to the same CMSPage)- Parameters:
blueprint
- The ViewerPath to be copied
-
-
Method Details
-
getApplicationUrl
Getter for the field
applicationUrl
.- Returns:
- the
applicationUrl
-
setApplicationUrl
Setter for the field
applicationUrl
.- Parameters:
applicationUrl
- TheapplicationUrl
to set
-
getPagePath
Getter for the field
pagePath
.- Returns:
- the
pagePath
-
setPagePath
Setter for the field
pagePath
.- Parameters:
pagePath
- thepagePath
to set
-
getParameterPath
Getter for the field
parameterPath
.- Returns:
- the
parameterPath
-
setParameterPath
Setter for the field
parameterPath
.- Parameters:
parameterPath
- theparameterPath
to set
-
getQueryString
- Returns:
- the queryString
-
setQueryString
- Parameters:
queryString
- the queryString to set
-
getPrettifiedPagePath
getPrettifiedPagePath.
- Returns:
- The alternative url or static page url of a CMSPage if present, otherwise
pagePath
-
getCombinedPrettyfiedPath
getCombinedPrettyfiedPath.
- Returns:
- the entire
prettified
url except the application url
-
getCombinedPrettyfiedUrl
getCombinedPrettyfiedUrl.
- Returns:
- the entire
prettified
url as a path except the application url
-
getCombinedPath
getCombinedPath.
- Returns:
- the entire request url as a path except the application url
-
getCombinedUrl
getCombinedUrl.
- Returns:
- the entire request url except the application url
-
toString
-
isPage
public boolean isPage()isPage.
- Returns:
- true if this path has been associated with a pageType other than 'other'
-
setPageType
Setter for the field
pageType
.- Parameters:
pageType
- thePageType
to set
-
getPageType
Getter for the field
pageType
.- Returns:
- the
pageType
-
matches
matches.
-
getCmsPage
Getter for the field
cmsPage
.- Returns:
- the
cmsPage
if one is associated with this path. Otherwise null
-
setCmsPage
Setter for the field
cmsPage
.- Parameters:
cmsPage
- thecmsPage
to set
-
getCampaign
Getter for the field
campaign
.- Returns:
- the campaign
-
setCampaign
Setter for the field
campaign
.- Parameters:
campaign
- the campaign to set
-
getApplicationName
Getter for the field
applicationName
.- Returns:
- the
applicationName
-
setApplicationName
Setter for the field
applicationName
.- Parameters:
applicationName
- theapplicationName
to set
-
isCmsPage
public boolean isCmsPage()isCmsPage.
- Returns:
- a boolean.
-