Class ViewerPath
java.lang.Object
io.goobi.viewer.model.urlresolution.ViewerPath
- All Implemented Interfaces:
Serializable
Stores the url path of a http request organized by its logical parts so application url, application name, view type and parameter urls can be
retrieved independendly. If applicable, the
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.booleanDepending on the page type, a page is considered the same in the context of the navigation history if its base pagePath is the same vs also considering page parameters for certain pagesPath values.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 fieldapplicationUrl.- Returns:
- the
applicationUrl
-
setApplicationUrl
Setter for the fieldapplicationUrl.- Parameters:
applicationUrl- TheapplicationUrlto set
-
getPagePath
Getter for the fieldpagePath.- Returns:
- the
pagePath
-
setPagePath
Setter for the fieldpagePath.- Parameters:
pagePath- thepagePathto set
-
getParameterPath
Getter for the fieldparameterPath.- Returns:
- the
parameterPath
-
setParameterPath
Setter for the fieldparameterPath.- Parameters:
parameterPath- theparameterPathto set
-
getQueryString
-
setQueryString
-
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 fieldpageType.- Parameters:
pageType- thePageTypeto set
-
getPageType
Getter for the fieldpageType.- Returns:
- the
pageType
-
matches
matches. -
getCmsPage
Getter for the fieldcmsPage.- Returns:
- the
cmsPageif one is associated with this path. Otherwise null
-
setCmsPage
Setter for the fieldcmsPage.- Parameters:
cmsPage- thecmsPageto set
-
getCampaign
Getter for the fieldcampaign.- Returns:
- the crowdsourcing campaign associated with this path
-
setCampaign
Setter for the fieldcampaign.- Parameters:
campaign- the crowdsourcing campaign associated with this path
-
getApplicationName
Getter for the fieldapplicationName.- Returns:
- the
applicationName
-
setApplicationName
Setter for the fieldapplicationName.- Parameters:
applicationName- theapplicationNameto set
-
isCmsPage
public boolean isCmsPage()isCmsPage.- Returns:
- true if this viewer path resolves to a CMS page, false otherwise
-