Class ViewHistory
java.lang.Object
io.goobi.viewer.model.urlresolution.ViewHistory
This class offers methods to store information about the current and previous html-view (page) in the session store
The fullscreen view is explicitly excluded from the recorded views, since it acts only as a magnification of the image view, not as a seperate page
- Author:
- Florian Alpers
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<ViewerPath>
getCurrentView
(javax.servlet.ServletRequest request) Retrieves the stored currentPath from the session associated the the passedrequest
static Optional<ViewerPath>
getPreviousView
(javax.servlet.ServletRequest request) Retrieves the stored previousPath from the session associated the the passedrequest
static void
redirectToUrl
(String url) Directly redirect to the given urlstatic void
setCurrentView
(ViewerPath currentPath, javax.servlet.http.HttpSession session) Saves the givencurrentPath
to the session map, keeping the previously stored currentPath as previousPath if it has a different PageType than the current path The path stored as currentPath can be retrieved bygetCurrentView(ServletRequest)
; the previously stored path can be retrieved bygetPreviousView(ServletRequest)
static void
setCurrentView
(javax.servlet.ServletRequest request) Saves the current view information to the session map.
-
Method Details
-
setCurrentView
public static void setCurrentView(javax.servlet.ServletRequest request) Saves the current view information to the session map. Also saves the previous view information to the session map if it represents a different view than the current view- Parameters:
request
- aServletRequest
object.
-
setCurrentView
Saves the givencurrentPath
to the session map, keeping the previously stored currentPath as previousPath if it has a different PageType than the current path The path stored as currentPath can be retrieved bygetCurrentView(ServletRequest)
; the previously stored path can be retrieved bygetPreviousView(ServletRequest)
- Parameters:
session
- The http session to store the path incurrentPath
- The path to store
-
getCurrentView
Retrieves the stored currentPath from the session associated the the passedrequest
- Parameters:
request
- aServletRequest
object.- Returns:
- An optional containing the last stored current path if available. An empty optional if no session is available or no path has been stored yet
-
getPreviousView
Retrieves the stored previousPath from the session associated the the passedrequest
- Parameters:
request
- aServletRequest
object.- Returns:
- An optional containing the last stored previous path if available. An empty optional if no session is available or no previous path has been stored yet
-
redirectToUrl
Directly redirect to the given url- Parameters:
url
- The url to redirect to- Throws:
IOException
- if any.
-