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
ConstructorsConstructorDescriptionCreates 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(boolean addQueryString) getCombinedPrettyfiedPath.getCombinedPrettyfiedUrl.getCombinedPrettyfiedUrl(boolean addQueryString) getCombinedPrettyfiedUrl.getCombinedUrl.Getter for the fieldpagePath.Getter for the fieldpageType.Getter for the fieldparameterPath.getPrettifiedPagePath.booleanisCmsPage.booleanisPage()isPage.booleanmatches.voidsetApplicationName(String applicationName) Setter for the fieldapplicationName.voidsetApplicationUrl(String applicationUrl) Setter for the fieldapplicationUrl.voidsetCampaign(Campaign campaign) Setter for the fieldcampaign.voidsetCmsPage(CMSPage cmsPage) Setter for the fieldcmsPage.voidsetPagePath(URI pagePath) Setter for the fieldpagePath.voidsetPageType(PageType pageType) Setter for the fieldpageType.voidsetParameterPath(URI parameterPath) Setter for the fieldparameterPath.voidsetQueryString(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,cmsPagebeing 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- TheapplicationUrlto set
-
getPagePath
Getter for the field
pagePath.- Returns:
- the
pagePath
-
setPagePath
Setter for the field
pagePath.- Parameters:
pagePath- thepagePathto set
-
getParameterPath
Getter for the field
parameterPath.- Returns:
- the
parameterPath
-
setParameterPath
Setter for the field
parameterPath.- Parameters:
parameterPath- theparameterPathto 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.
- Parameters:
addQueryString- If true, the GET query parameter part will be added- Returns:
- the entire
prettifiedurl except the application url
-
getCombinedPrettyfiedUrl
getCombinedPrettyfiedUrl.
- Parameters:
addQueryString- If true, the GET query parameter part will be added- Returns:
- the entire
prettifiedurl as a path except the application url
-
getCombinedPrettyfiedUrl
getCombinedPrettyfiedUrl.
- Returns:
- the entire
prettifiedurl 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- thePageTypeto set
-
getPageType
Getter for the field
pageType.- Returns:
- the
pageType
-
matches
matches.
-
getCmsPage
Getter for the field
cmsPage.- Returns:
- the
cmsPageif one is associated with this path. Otherwise null
-
setCmsPage
Setter for the field
cmsPage.- Parameters:
cmsPage- thecmsPageto 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- theapplicationNameto set
-
isCmsPage
public boolean isCmsPage()isCmsPage.
- Returns:
- a boolean.
-