Class DocumentViewCodecService
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.platform.url.service.DocumentViewCodecService
- All Implemented Interfaces:
Serializable,DocumentViewCodecManager,Adaptable,Component,Extensible,TimestampedService
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String,DocumentViewCodec> static final Stringprotected Stringprotected final Map<String,DocumentViewCodecDescriptor> static final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeactivate(ComponentContext context) Deactivates the component.<T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.getCodec()Returns theDocumentViewCodecwith the given name ornullif ot doesn't exist.Returns the default codec name.getDocumentViewFromUrl(String url, boolean hasBaseUrl, String baseUrl) Returns a DocumentView applying for given url, or null.getDocumentViewFromUrl(String codecName, String url, boolean hasBaseUrl, String baseUrl) Returns a DocumentView callingDocumentViewCodec.getDocumentViewFromUrl(String)on codec with given name.protected DocumentViewgetDocumentViewFromUrl(DocumentViewCodec codec, String finalUrl) getUrlFromDocumentView(String codecName, DocumentView docView, boolean needBaseUrl, String baseUrl) Returns an URL callingDocumentViewCodec.getUrlFromDocumentView(DocumentView)on codec with given name.getUrlFromDocumentView(DocumentView docView, boolean needBaseUrl, String baseUrl) Returns an URL applying for given document view, or null.protected StringgetUrlFromDocumentView(DocumentViewCodec codec, DocumentView docView, boolean needBaseUrl, String baseUrl) protected StringgetUrlWithoutBase(String url, boolean hasBaseUrl, String baseUrl) voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
NAME
-
CODECS_EXTENSION_POINT
- See Also:
-
defaultCodecName
-
descriptors
-
codecs
-
-
Constructor Details
-
DocumentViewCodecService
public DocumentViewCodecService()
-
-
Method Details
-
deactivate
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein classDefaultComponent- Parameters:
context- the runtime context
-
getAdapter
Description copied from interface:AdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.- Specified by:
getAdapterin interfaceAdaptable- Overrides:
getAdapterin classDefaultComponent- Parameters:
adapter- the adapter class to look up- Returns:
- a object castable to the given class, or
nullif this object does not have an adapter for the given class
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
unregisterContributionin classDefaultComponent
-
getDocumentViewCodecDescriptorNames
-
getDefaultCodecName
Description copied from interface:DocumentViewCodecManagerReturns the default codec name.This information is set on codec descriptors.
- Specified by:
getDefaultCodecNamein interfaceDocumentViewCodecManager
-
getCodec
-
getCodec
Description copied from interface:DocumentViewCodecManagerReturns theDocumentViewCodecwith the given name ornullif ot doesn't exist.- Specified by:
getCodecin interfaceDocumentViewCodecManager
-
getUrlFromDocumentView
Description copied from interface:DocumentViewCodecManagerReturns 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- Specified by:
getUrlFromDocumentViewin interfaceDocumentViewCodecManager- 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
public String getUrlFromDocumentView(String codecName, DocumentView docView, boolean needBaseUrl, String baseUrl) Description copied from interface:DocumentViewCodecManagerReturns an URL callingDocumentViewCodec.getUrlFromDocumentView(DocumentView)on codec with given name.- Specified by:
getUrlFromDocumentViewin interfaceDocumentViewCodecManager- 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.
-
getUrlFromDocumentView
protected String getUrlFromDocumentView(DocumentViewCodec codec, DocumentView docView, boolean needBaseUrl, String baseUrl) -
getDocumentViewFromUrl
Description copied from interface:DocumentViewCodecManagerReturns 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.- Specified by:
getDocumentViewFromUrlin interfaceDocumentViewCodecManager- 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(String codecName, String url, boolean hasBaseUrl, String baseUrl) Description copied from interface:DocumentViewCodecManagerReturns a DocumentView callingDocumentViewCodec.getDocumentViewFromUrl(String)on codec with given name.- Specified by:
getDocumentViewFromUrlin interfaceDocumentViewCodecManagerurl- 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.
-
getUrlWithoutBase
-
getDocumentViewFromUrl
-