Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.url.ejb
Class DocumentViewCodecManagerBean

java.lang.Object
  extended by org.nuxeo.ecm.platform.url.ejb.DocumentViewCodecManagerBean
All Implemented Interfaces:
java.io.Serializable, DocumentViewCodecManager

public class DocumentViewCodecManagerBean
extends java.lang.Object
implements DocumentViewCodecManager

Document view codec manager bean

Author:
Anahide Tchertchian
See Also:
Serialized Form

Constructor Summary
DocumentViewCodecManagerBean()
           
 
Method Summary
 java.lang.String getDefaultCodecName()
          Returns the default codec name.
 DocumentView getDocumentViewFromUrl(java.lang.String url, boolean hasBaseUrl, java.lang.String baseUrl)
          Returns a DocumentView applying for given url, or null.
 DocumentView getDocumentViewFromUrl(java.lang.String codecName, java.lang.String url, boolean hasBaseUrl, java.lang.String baseUrl)
          Returns a DocumentView calling DocumentViewCodec#getDocumentViewFromUrl(String, boolean, String) on codec with given name.
 java.lang.String getUrlFromDocumentView(DocumentView docView, boolean needBaseUrl, java.lang.String baseUrl)
          Returns an URL applying for given document view, or null.
 java.lang.String getUrlFromDocumentView(java.lang.String codecName, DocumentView docView, boolean needBaseUrl, java.lang.String baseUrl)
          Returns an URL calling {@link DocumentViewCodec#getUrlFromDocumentView(DocumentView) on codec with given name.
 void initialize()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentViewCodecManagerBean

public DocumentViewCodecManagerBean()
Method Detail

initialize

@PostConstruct
public void initialize()

remove

public void remove()

getDefaultCodecName

public java.lang.String getDefaultCodecName()
Description copied from interface: DocumentViewCodecManager
Returns the default codec name.

This information is set on codec descriptors.

Specified by:
getDefaultCodecName in interface DocumentViewCodecManager

getDocumentViewFromUrl

public DocumentView getDocumentViewFromUrl(java.lang.String url,
                                           boolean hasBaseUrl,
                                           java.lang.String baseUrl)
Description copied from interface: DocumentViewCodecManager
Returns a DocumentView applying for given url, or null.

Iterates over registered codecs, starting from the default codec, and if DocumentViewCodec.handleUrl(String) returns true, calls DocumentViewCodec.getDocumentViewFromUrl(String). Stops iterating when a codec returns a non-null value.

Specified by:
getDocumentViewFromUrl in interface DocumentViewCodecManager
Parameters:
url - the original url from request, including request parameters if any.
hasBaseUrl - boolean indicating if base url should be removed from given url.
baseUrl - value of the base url.

getDocumentViewFromUrl

public DocumentView getDocumentViewFromUrl(java.lang.String codecName,
                                           java.lang.String url,
                                           boolean hasBaseUrl,
                                           java.lang.String baseUrl)
Description copied from interface: DocumentViewCodecManager
Returns a DocumentView calling DocumentViewCodec#getDocumentViewFromUrl(String, boolean, String) on codec with given name.

Specified by:
getDocumentViewFromUrl in interface DocumentViewCodecManager
url - the original url from request, including request parameters if any.
hasBaseUrl - boolean indicating if base url should be removed from given url.
baseUrl - value of the base url.

getUrlFromDocumentView

public java.lang.String getUrlFromDocumentView(DocumentView docView,
                                               boolean needBaseUrl,
                                               java.lang.String baseUrl)
Description copied from interface: DocumentViewCodecManager
Returns an URL applying for given document view, or null.

Iterates over registered codecs, starting from the default codec, and if DocumentViewCodec.handleDocumentView(DocumentView) returns true, calls DocumentViewCodec.getUrlFromDocumentView(DocumentView). Stops iterating when a codec returns a non-null value. am docView the original document view from request

Specified by:
getUrlFromDocumentView in interface DocumentViewCodecManager
Parameters:
docView - the original document view from request
baseUrl - value of the base url.

getUrlFromDocumentView

public java.lang.String getUrlFromDocumentView(java.lang.String codecName,
                                               DocumentView docView,
                                               boolean needBaseUrl,
                                               java.lang.String baseUrl)
Description copied from interface: DocumentViewCodecManager
Returns an URL calling {@link DocumentViewCodec#getUrlFromDocumentView(DocumentView) on codec with given name.

Specified by:
getUrlFromDocumentView in interface DocumentViewCodecManager
docView - the original document view from request
baseUrl - value of the base url.

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.