Package org.nuxeo.ecm.platform.url.api
Interface DocumentViewCodecManager
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
DocumentViewCodecManagerLocal
,DocumentViewCodecManagerRemote
- All Known Implementing Classes:
DocumentViewCodecService
public interface DocumentViewCodecManager extends Serializable
Service used generate meaningful and permanent urls.It handles a set of codecs, used to code/decode a document information between a url and a
DocumentView
instance.- Author:
- Anahide Tchertchian
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DocumentViewCodec
getCodec(String name)
Returns theDocumentViewCodec
with the given name ornull
if ot doesn't exist.String
getDefaultCodecName()
Returns the default codec name.DocumentView
getDocumentViewFromUrl(String url, boolean hasBaseUrl, String baseUrl)
Returns a DocumentView applying for given url, or null.DocumentView
getDocumentViewFromUrl(String codecName, String url, boolean hasBaseUrl, String baseUrl)
Returns a DocumentView callingDocumentViewCodec.getDocumentViewFromUrl(String)
on codec with given name.String
getUrlFromDocumentView(String codecName, DocumentView docView, boolean needBaseUrl, String baseUrl)
Returns an URL callingDocumentViewCodec.getUrlFromDocumentView(DocumentView)
on codec with given name.String
getUrlFromDocumentView(DocumentView docView, boolean needBaseUrl, String baseUrl)
Returns an URL applying for given document view, or null.
-
-
-
Method Detail
-
getDefaultCodecName
String getDefaultCodecName()
Returns the default codec name.This information is set on codec descriptors.
-
getCodec
DocumentViewCodec getCodec(String name)
Returns theDocumentViewCodec
with the given name ornull
if ot doesn't exist.- Since:
- 8.10
-
getDocumentViewFromUrl
DocumentView getDocumentViewFromUrl(String url, boolean hasBaseUrl, String baseUrl)
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, callsDocumentViewCodec.getDocumentViewFromUrl(String)
. Stops iterating when a codec returns a non-null value.- 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
DocumentView getDocumentViewFromUrl(String codecName, String url, boolean hasBaseUrl, String baseUrl)
Returns a DocumentView callingDocumentViewCodec.getDocumentViewFromUrl(String)
on codec with given name.- 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.
-
getUrlFromDocumentView
String getUrlFromDocumentView(DocumentView docView, boolean needBaseUrl, String baseUrl)
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, callsDocumentViewCodec.getUrlFromDocumentView(DocumentView)
. Stops iterating when a codec returns a non-null value. am docView the original document view from request- Parameters:
docView
- the original document view from requestneedBaseUrl
- boolean indicating if base url should be added to the url returned by the codec.baseUrl
- value of the base url.
-
getUrlFromDocumentView
String getUrlFromDocumentView(String codecName, DocumentView docView, boolean needBaseUrl, String baseUrl)
Returns an URL callingDocumentViewCodec.getUrlFromDocumentView(DocumentView)
on codec with given name.- Parameters:
codecName
- the codec name to usedocView
- the original document view from requestneedBaseUrl
- boolean indicating if base url should be added to the url returned by the codec.baseUrl
- value of the base url.
-
-