Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.ui.web.rest.services
Class URLPolicyServiceImpl

java.lang.Object
  extended by org.nuxeo.ecm.platform.ui.web.rest.services.URLPolicyServiceImpl
All Implemented Interfaces:
URLPolicyService

public class URLPolicyServiceImpl
extends java.lang.Object
implements URLPolicyService


Field Summary
static java.lang.String NAME
           
 
Fields inherited from interface org.nuxeo.ecm.platform.ui.web.rest.api.URLPolicyService
DISABLE_REDIRECT_REQUEST_KEY, DOCUMENT_VIEW_REQUEST_KEY, FORCE_URL_ENCODING_REQUEST_KEY, POST_OUTCOME_REQUEST_KEY
 
Constructor Summary
URLPolicyServiceImpl()
           
 
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 appendParametersToRequest(javax.faces.context.FacesContext facesContext, java.lang.String pattern)
           
 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 patternName, 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 patternName, 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 facesContext)
          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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
Constructor Detail

URLPolicyServiceImpl

public URLPolicyServiceImpl()
Method Detail

getDefaultPatternName

public java.lang.String getDefaultPatternName()
Specified by:
getDefaultPatternName in interface URLPolicyService

isCandidateForDecoding

public boolean isCandidateForDecoding(javax.servlet.http.HttpServletRequest httpRequest)
Description copied from interface: URLPolicyService
Returns true if request is a GET request and filter preprocessing is turned on.

Specified by:
isCandidateForDecoding in interface URLPolicyService

isCandidateForEncoding

public boolean isCandidateForEncoding(javax.servlet.http.HttpServletRequest httpRequest)
Description copied from interface: URLPolicyService
Returns true if request is a POST request and filter redirection is turned on.

Specified by:
isCandidateForEncoding in interface URLPolicyService

setDocumentViewInRequest

public void setDocumentViewInRequest(javax.servlet.http.HttpServletRequest request,
                                     DocumentView docView)
Description copied from interface: URLPolicyService
Adds document view to the request for later retrieval.

Specified by:
setDocumentViewInRequest in interface URLPolicyService
Parameters:
request - the current request.
docView - to save

getDocumentViewFromRequest

public DocumentView getDocumentViewFromRequest(javax.servlet.http.HttpServletRequest request)
Description copied from interface: URLPolicyService
Builds the document view from request information.

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

Specified by:
getDocumentViewFromRequest in interface URLPolicyService

getDocumentViewFromRequest

public DocumentView getDocumentViewFromRequest(java.lang.String patternName,
                                               javax.servlet.http.HttpServletRequest request)
Description copied from interface: URLPolicyService
Builds the document view from request information.

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

Specified by:
getDocumentViewFromRequest in interface URLPolicyService

getUrlFromDocumentView

public java.lang.String getUrlFromDocumentView(DocumentView docView,
                                               java.lang.String baseUrl)
Description copied from interface: URLPolicyService
Returns a URL given a document view.

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

Specified by:
getUrlFromDocumentView in interface URLPolicyService

getUrlFromDocumentView

public java.lang.String getUrlFromDocumentView(java.lang.String patternName,
                                               DocumentView docView,
                                               java.lang.String baseUrl)
Description copied from interface: URLPolicyService
Returns a URL given a document view.

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

Specified by:
getUrlFromDocumentView in interface URLPolicyService

applyRequestParameters

public void applyRequestParameters(javax.faces.context.FacesContext facesContext)
Description copied from interface: URLPolicyService
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.

Specified by:
applyRequestParameters in interface URLPolicyService

appendParametersToRequest

public void appendParametersToRequest(javax.faces.context.FacesContext facesContext)
Description copied from interface: URLPolicyService
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.

Specified by:
appendParametersToRequest in interface URLPolicyService

appendParametersToRequest

public void appendParametersToRequest(javax.faces.context.FacesContext facesContext,
                                      java.lang.String pattern)

navigate

public java.lang.String navigate(javax.faces.context.FacesContext facesContext)
Description copied from interface: URLPolicyService
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).

Specified by:
navigate in interface URLPolicyService

addPatternDescriptor

public void addPatternDescriptor(URLPatternDescriptor pattern)
Specified by:
addPatternDescriptor in interface URLPolicyService

removePatternDescriptor

public void removePatternDescriptor(URLPatternDescriptor pattern)
Specified by:
removePatternDescriptor in interface URLPolicyService

clear

public void clear()
Specified by:
clear in interface URLPolicyService

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.