Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.ui.web.rest.api
Interface URLPolicyService

All Known Implementing Classes:
URLPolicyServiceImpl

public interface URLPolicyService

Service used on the web layer to handle navigation using meaningful URLs.

It handles a document context description, and also performs JSF model related operations.

It holds pattern descriptors used to interact with the DocumentViewCodecManager.

Author:
Anahide Tchertchian

Field Summary
static java.lang.String DISABLE_REDIRECT_REQUEST_KEY
          Deprecated. 
static java.lang.String DOCUMENT_VIEW_REQUEST_KEY
           
static java.lang.String FORCE_URL_ENCODING_REQUEST_KEY
           
static java.lang.String POST_OUTCOME_REQUEST_KEY
           
 
Method Summary
 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()
           
 java.lang.String getDefaultPatternName()
           
 DocumentView getDocumentViewFromRequest(javax.servlet.http.HttpServletRequest request)
          Builds the document view from request information.
 DocumentView getDocumentViewFromRequest(java.lang.String pattern, javax.servlet.http.HttpServletRequest request)
          Builds the document view from request information.
 java.lang.String getUrlFromDocumentView(DocumentView docView, java.lang.String baseUrl)
          Returns a URL given a document view.
 java.lang.String getUrlFromDocumentView(java.lang.String pattern, DocumentView docView, java.lang.String baseUrl)
          Returns a URL given a document view.
 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.
 java.lang.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.
 

Field Detail

POST_OUTCOME_REQUEST_KEY

static final java.lang.String POST_OUTCOME_REQUEST_KEY
See Also:
Constant Field Values

DOCUMENT_VIEW_REQUEST_KEY

static final java.lang.String DOCUMENT_VIEW_REQUEST_KEY
See Also:
Constant Field Values

DISABLE_REDIRECT_REQUEST_KEY

@Deprecated
static final java.lang.String DISABLE_REDIRECT_REQUEST_KEY
Deprecated. 
See Also:
Constant Field Values

FORCE_URL_ENCODING_REQUEST_KEY

static final java.lang.String FORCE_URL_ENCODING_REQUEST_KEY
See Also:
Constant Field Values
Method Detail

isCandidateForDecoding

boolean isCandidateForDecoding(javax.servlet.http.HttpServletRequest httpRequest)
Returns true if request is a GET request and filter preprocessing is turned on.


isCandidateForEncoding

boolean isCandidateForEncoding(javax.servlet.http.HttpServletRequest httpRequest)
Returns true if request is a POST request and filter redirection is turned on.


setDocumentViewInRequest

void setDocumentViewInRequest(javax.servlet.http.HttpServletRequest request,
                              DocumentView docView)
Adds document view to the request for later retrieval.

Parameters:
request - the current request.
docView - to save

getDocumentViewFromRequest

DocumentView getDocumentViewFromRequest(javax.servlet.http.HttpServletRequest request)
Builds the document view from request information.

Delegates call to a document view codec found thanks to the default URL pattern descriptor.


getDocumentViewFromRequest

DocumentView getDocumentViewFromRequest(java.lang.String pattern,
                                        javax.servlet.http.HttpServletRequest request)
Builds the document view from request information.

Delegates call to a document view codec found thanks given pattern name.


getUrlFromDocumentView

java.lang.String getUrlFromDocumentView(DocumentView docView,
                                        java.lang.String baseUrl)
Returns a URL given a document view.

Delegates call to a document view codec found thanks to the default URL pattern descriptor.


getUrlFromDocumentView

java.lang.String getUrlFromDocumentView(java.lang.String pattern,
                                        DocumentView docView,
                                        java.lang.String baseUrl)
Returns a URL given a document view.

Delegates call to a document view codec found thanks given pattern name.


applyRequestParameters

void applyRequestParameters(javax.faces.context.FacesContext facesContext)
Extracts parameters from request attributes.

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.


appendParametersToRequest

void appendParametersToRequest(javax.faces.context.FacesContext facesContext)
Appends parameters to request so that the model can be restored after request.

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.


navigate

java.lang.String navigate(javax.faces.context.FacesContext context)
Performs redirection action.

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).


getDefaultPatternName

java.lang.String getDefaultPatternName()

addPatternDescriptor

void addPatternDescriptor(URLPatternDescriptor pattern)

removePatternDescriptor

void removePatternDescriptor(URLPatternDescriptor pattern)

clear

void clear()

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.