Nuxeo ECM Projects 5.6-RC1

org.nuxeo.ecm.platform.rendition.service
Class RenditionServiceImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.platform.rendition.service.RenditionServiceImpl
All Implemented Interfaces:
RenditionService, Adaptable, Component, Extensible, TimestampedService

public class RenditionServiceImpl
extends DefaultComponent
implements RenditionService

Default implementation of RenditionService.

Since:
5.4.1
Author:
Thomas Roger

Field Summary
static String RENDITION_DEFINITIONS_EP
           
 
Constructor Summary
RenditionServiceImpl()
           
 
Method Summary
 void activate(ComponentContext context)
          Activates the component.
 void deactivate(ComponentContext context)
          Deactivates the component.
 List<RenditionDefinition> getAvailableRenditionDefinitions(DocumentModel doc)
          Returns a List of RenditionDefinition available on the given Document.
 List<Rendition> getAvailableRenditions(DocumentModel doc)
          Returns a List of Rendition available on the given Document.
 List<RenditionDefinition> getDeclaredRenditionDefinitions()
          Returns a List of registered RenditionDefinition.
 List<RenditionDefinition> getDeclaredRenditionDefinitionsForProviderType(String providerType)
          Returns a List of registered RenditionDefinition matching a given provider type
 Rendition getRendition(DocumentModel doc, String renditionName)
          Return the Rendition object for the given DocumentModel and a rendition definition name.
 Rendition getRendition(DocumentModel doc, String renditionName, boolean store)
          Return the Rendition object for the given DocumentModel and a rendition definition name.
 void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 DocumentRef storeRendition(DocumentModel source, String renditionDefinitionName)
          Render a document based on the given rendition definition name and returns the stored Rendition DocumentRef.
 void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
applicationStarted, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterExtension
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RENDITION_DEFINITIONS_EP

public static final String RENDITION_DEFINITIONS_EP
See Also:
Constant Field Values
Constructor Detail

RenditionServiceImpl

public RenditionServiceImpl()
Method Detail

activate

public void activate(ComponentContext context)
              throws Exception
Description copied from interface: Component
Activates the component.

This method is called by the runtime when a component is activated.

Specified by:
activate in interface Component
Overrides:
activate in class DefaultComponent
Parameters:
context - the runtime context
Throws:
Exception - if an error occurs during activation

deactivate

public void deactivate(ComponentContext context)
                throws Exception
Description copied from interface: Component
Deactivates the component.

This method is called by the runtime when a component is deactivated.

Specified by:
deactivate in interface Component
Overrides:
deactivate in class DefaultComponent
Parameters:
context - the runtime context
Throws:
Exception - if an error occurs during activation

getDeclaredRenditionDefinitions

public List<RenditionDefinition> getDeclaredRenditionDefinitions()
Description copied from interface: RenditionService
Returns a List of registered RenditionDefinition. The order of the List does not depend on the registering order.

Specified by:
getDeclaredRenditionDefinitions in interface RenditionService

getDeclaredRenditionDefinitionsForProviderType

public List<RenditionDefinition> getDeclaredRenditionDefinitionsForProviderType(String providerType)
Description copied from interface: RenditionService
Returns a List of registered RenditionDefinition matching a given provider type

Specified by:
getDeclaredRenditionDefinitionsForProviderType in interface RenditionService

getAvailableRenditionDefinitions

public List<RenditionDefinition> getAvailableRenditionDefinitions(DocumentModel doc)
Description copied from interface: RenditionService
Returns a List of RenditionDefinition available on the given Document. The order of the List does not depend on the registering order.

Specified by:
getAvailableRenditionDefinitions in interface RenditionService

storeRendition

public DocumentRef storeRendition(DocumentModel source,
                                  String renditionDefinitionName)
                           throws RenditionException
Description copied from interface: RenditionService
Render a document based on the given rendition definition name and returns the stored Rendition DocumentRef.

Only the user launching the render operation has the Read right on the returned document.

Specified by:
storeRendition in interface RenditionService
Parameters:
source - the document to render
renditionDefinitionName - the rendition definition to use
Returns:
the DocumentRef of the newly created Rendition document.
Throws:
RenditionException

registerContribution

public void registerContribution(Object contribution,
                                 String extensionPoint,
                                 ComponentInstance contributor)
                          throws Exception
Overrides:
registerContribution in class DefaultComponent
Throws:
Exception

unregisterContribution

public void unregisterContribution(Object contribution,
                                   String extensionPoint,
                                   ComponentInstance contributor)
                            throws Exception
Overrides:
unregisterContribution in class DefaultComponent
Throws:
Exception

getRendition

public Rendition getRendition(DocumentModel doc,
                              String renditionName)
                       throws RenditionException
Description copied from interface: RenditionService
Return the Rendition object for the given DocumentModel and a rendition definition name.

A stored rendition is returned if found and up to date, a new Rendition is created otherwise.

Specified by:
getRendition in interface RenditionService
Parameters:
doc - the document to render
renditionName - the name of the rendition definition
Returns:
the Rendition object
Throws:
RenditionException

getRendition

public Rendition getRendition(DocumentModel doc,
                              String renditionName,
                              boolean store)
                       throws RenditionException
Description copied from interface: RenditionService
Return the Rendition object for the given DocumentModel and a rendition definition name.

A stored rendition is returned if found and up to date, a new (live) Rendition is created otherwise.

If store parameter is true, the new created rendition is stored too and returned

Specified by:
getRendition in interface RenditionService
Parameters:
doc - the document to render
renditionName - the name of the rendition definition
store - indicates if the rendition must be stored
Returns:
the Rendition object
Throws:
RenditionException

getAvailableRenditions

public List<Rendition> getAvailableRenditions(DocumentModel doc)
                                       throws RenditionException
Description copied from interface: RenditionService
Returns a List of Rendition available on the given Document.

The order of the List does not depend on the registering order.

The returned rendition may be live or stored

Specified by:
getAvailableRenditions in interface RenditionService
Throws:
RenditionException

Nuxeo ECM Projects 5.6-RC1

Copyright © 2012 Nuxeo SA. All Rights Reserved.