public interface URLPolicyService
It handles a document context description, and also performs JSF model related operations.
It holds pattern descriptors used to interact with the DocumentViewCodecManager
.
Modifier and Type | Field and Description |
---|---|
static String |
DISABLE_ACTION_BINDING_KEY |
static String |
DISABLE_REDIRECT_REQUEST_KEY
Deprecated.
|
static String |
DOCUMENT_VIEW_REQUEST_KEY |
static String |
FORCE_URL_ENCODING_REQUEST_KEY |
static String |
POST_OUTCOME_REQUEST_KEY |
Modifier and Type | Method and Description |
---|---|
void |
addPatternDescriptor(URLPatternDescriptor pattern) |
void |
appendParametersToRequest(javax.faces.context.FacesContext facesContext)
Appends parameters to request so that the model can be restored after request.
|
void |
applyRequestParameters(javax.faces.context.FacesContext facesContext)
Extracts parameters from request attributes.
|
void |
clear() |
void |
flushCache()
Flushes the URLPolicyService cache, to be called when hot reload is performed for instance.
|
String |
getDefaultPatternName()
Returns the default pattern descriptor name
|
DocumentView |
getDocumentViewFromRequest(javax.servlet.http.HttpServletRequest request)
Builds the document view from request information.
|
DocumentView |
getDocumentViewFromRequest(String pattern,
javax.servlet.http.HttpServletRequest request)
Builds the document view from request information.
|
String |
getOutcomeFromUrl(String url,
javax.servlet.http.HttpServletRequest httpRequest)
Returns an outcome given a url, to fill a document view when parsing a standard JSF URL.
|
String |
getOutcomeFromViewId(String viewId,
javax.servlet.http.HttpServletRequest httpRequest)
Returns an outcome given a view id, to fill a document view when parsing a standard JSF URL.
|
String |
getUrlFromDocumentView(DocumentView docView,
String baseUrl)
Returns a URL given a document view.
|
String |
getUrlFromDocumentView(String pattern,
DocumentView docView,
String baseUrl)
Returns a URL given a document view.
|
String |
getViewIdFromOutcome(String outcome,
javax.servlet.http.HttpServletRequest httpRequest)
Returns the view id given an outcome, to dispatch to the right view given an outcome.
|
boolean |
hasPattern(String name)
Returns true if the service holds a pattern descriptor with given name
|
void |
initViewIdManager(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initializes the view id manager
StaticNavigationHandler using the given servlet context. |
boolean |
isCandidateForDecoding(javax.servlet.http.HttpServletRequest httpRequest)
Returns true if request is a GET request and filter preprocessing is turned on.
|
boolean |
isCandidateForEncoding(javax.servlet.http.HttpServletRequest httpRequest)
Returns true if request is a POST request and filter redirection is turned on.
|
String |
navigate(javax.faces.context.FacesContext context)
Performs redirection action.
|
void |
removePatternDescriptor(URLPatternDescriptor pattern) |
void |
setDocumentViewInRequest(javax.servlet.http.HttpServletRequest request,
DocumentView docView)
Adds document view to the request for later retrieval.
|
static final String POST_OUTCOME_REQUEST_KEY
static final String DOCUMENT_VIEW_REQUEST_KEY
static final String DISABLE_ACTION_BINDING_KEY
@Deprecated static final String DISABLE_REDIRECT_REQUEST_KEY
static final String FORCE_URL_ENCODING_REQUEST_KEY
boolean isCandidateForDecoding(javax.servlet.http.HttpServletRequest httpRequest)
boolean isCandidateForEncoding(javax.servlet.http.HttpServletRequest httpRequest)
void setDocumentViewInRequest(javax.servlet.http.HttpServletRequest request, DocumentView docView)
request
- the current request.docView
- to saveDocumentView getDocumentViewFromRequest(javax.servlet.http.HttpServletRequest request)
Delegates call to a document view codec found thanks to the default URL pattern descriptor.
DocumentView getDocumentViewFromRequest(String pattern, javax.servlet.http.HttpServletRequest request)
Delegates call to a document view codec found thanks given pattern name.
String getUrlFromDocumentView(DocumentView docView, String baseUrl)
Delegates call to a document view codec found thanks to the default URL pattern descriptor.
String getUrlFromDocumentView(String pattern, DocumentView docView, String baseUrl)
Delegates call to a document view codec found thanks given pattern name.
void applyRequestParameters(javax.faces.context.FacesContext facesContext)
Apply them to the model using EL value bindings described on URL pattern descriptors.
We look for binding values to set on the request attribute and on the document view parameters.
void appendParametersToRequest(javax.faces.context.FacesContext facesContext)
Extract them using EL value bindings described on URL pattern descriptors.
If the document view is not null, values are set on its parameters. If the document view is null, values are set on the request parameters.
String navigate(javax.faces.context.FacesContext context)
Extract it using an EL action binding described on URL pattern descriptors.
The action binding is called using given document view as parameter. If a sub URI is found, do nothing (may be an invalid resource URL).
String getDefaultPatternName()
boolean hasPattern(String name)
void addPatternDescriptor(URLPatternDescriptor pattern)
void removePatternDescriptor(URLPatternDescriptor pattern)
void clear()
void initViewIdManager(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
StaticNavigationHandler
using the given servlet context.String getViewIdFromOutcome(String outcome, javax.servlet.http.HttpServletRequest httpRequest)
For instance, will return "/view_documents.xhtml" given "view_documents".
String getOutcomeFromViewId(String viewId, javax.servlet.http.HttpServletRequest httpRequest)
For instance, will return "view_documents" given "/view_documents.xhtml" or "/view_documents.faces".
String getOutcomeFromUrl(String url, javax.servlet.http.HttpServletRequest httpRequest)
It parses the given url to extract the outcome, and then calls
getOutcomeFromViewId(String, HttpServletRequest)
void flushCache()
Copyright © 2015 Nuxeo SA. All rights reserved.