public class HTTPControllerClient extends Object implements Controller
The class is supposed to be used in JSP pages in order to make sure that the remote URI is requested through the browser, so communication with the HTTPControllerServer is done to the one currently set as viewer proxy.
Constructor and Description |
---|
HTTPControllerClient(javax.servlet.http.HttpServletResponse response,
javax.servlet.jsp.JspWriter out,
String returnURL)
Make an HTTP controller client.
|
Modifier and Type | Method and Description |
---|---|
void |
changeIndex(Set<Long> jobList,
String label)
Change current index to work on these jobs.
|
void |
clearRecordedURIs()
Clear recorded URIs and return to return URL.
|
Set<URI> |
getRecordedURIs()
Write recorded URIs to response.
|
String |
getStatus(Locale locale)
Write the current status of viewerproxy to response.
|
protected void |
redirectForSimpleCommand(String command,
boolean useReturnURL)
Perform the necessary redirection to execute a simple (parameterless) command.
|
void |
startRecordingURIs()
Start recording URIs and return to return URL.
|
void |
stopRecordingURIs()
Stop recording URIs and return to return URL.
|
public HTTPControllerClient(javax.servlet.http.HttpServletResponse response, javax.servlet.jsp.JspWriter out, String returnURL)
response
- The response object to use for redirect.out
- The JspWriter used to communicate with the users.returnURL
- The URL to return to afterwards if no output is given. This must not be null or not empty if
either startRecordingURIs, stopRecordingURIs, changeIndex or clearRecordedURIs are called.public void startRecordingURIs()
startRecordingURIs
in interface Controller
public void stopRecordingURIs()
stopRecordingURIs
in interface Controller
public void clearRecordedURIs()
clearRecordedURIs
in interface Controller
protected void redirectForSimpleCommand(String command, boolean useReturnURL)
command
- One of the three parameterless commands START_COMMAND,useReturnURL
- Whether to append the returnURL parameterpublic Set<URI> getRecordedURIs()
getRecordedURIs
in interface Controller
public void changeIndex(Set<Long> jobList, String label)
Since post data cannot be transferred through a regular redirect, we instead build a page that uses javascript to immediately repost the data to the url.
changeIndex
in interface Controller
jobList
- The list of jobs.label
- An arbitrary label that will be used to indicate this indexpublic String getStatus(Locale locale)
getStatus
in interface Controller
locale
- The locale (da, en, ...) that the response should be written using.Copyright © 2005–2018 The Royal Danish Library, the National Library of France and the Austrian National Library.. All rights reserved.