public class RenditionServiceImpl extends DefaultComponent implements RenditionService
RenditionService
.Modifier and Type | Field and Description |
---|---|
protected AutomationService |
automationService
Deprecated.
since 7.2. Not used.
|
static String |
DEFAULT_RENDITION_EP |
protected static StoredRenditionManager |
DEFAULT_STORED_RENDITION_MANAGER |
protected DefaultRenditionDescriptor |
defaultRenditionDescriptor |
protected List<DefaultRenditionDescriptor> |
defaultRenditionDescriptors |
static String |
RENDITION_DEFINITIONS_EP |
protected RenditionDefinitionProviderRegistry |
renditionDefinitionProviderRegistry |
protected RenditionDefinitionRegistry |
renditionDefinitionRegistry |
protected Map<String,RenditionDefinition> |
renditionDefinitions
Deprecated.
since 7.3.
|
static String |
RENDITON_DEFINION_PROVIDERS_EP |
protected ScriptEngineManager |
scriptEngineManager |
static String |
STORED_RENDITION_MANAGERS_EP |
protected Deque<StoredRenditionManagerDescriptor> |
storedRenditionManagerDescriptors |
lastModified
Constructor and Description |
---|
RenditionServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
protected DocumentRef |
createVersionIfNeeded(DocumentModel source,
CoreSession session) |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
void |
deleteStoredRenditions(String repositoryName)
Query and delete stored renditions where the related version or live document does not exist anymore.
|
protected AutomationService |
getAutomationService()
Deprecated.
since 7.2. Not used.
|
protected RenditionDefinition |
getAvailableRenditionDefinition(DocumentModel doc,
String renditionName) |
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<Rendition> |
getAvailableRenditions(DocumentModel doc,
boolean onlyVisible)
Returns a
List of Rendition available on the given Document. |
List<RenditionDefinition> |
getDeclaredRenditionDefinitions()
Deprecated.
since 7.2 because unused
|
List<RenditionDefinition> |
getDeclaredRenditionDefinitionsForProviderType(String providerType)
Deprecated.
since 7.2 because unused
|
Rendition |
getDefaultRendition(DocumentModel doc,
String reason,
Map<String,Serializable> extendedInfos)
Return the default
Rendition object for the given DocumentModel . |
protected Rendition |
getRendition(DocumentModel doc,
RenditionDefinition renditionDefinition,
boolean store) |
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. |
RenditionDefinition |
getRenditionDefinition(String name) |
StoredRenditionManager |
getStoredRenditionManager() |
protected RenditionDefinition |
mergeRenditions(RenditionDefinition oldRenditionDefinition,
RenditionDefinition newRenditionDefinition) |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
protected void |
registerRendition(RenditionDefinition renditionDefinition)
Deprecated.
since 7.3. RenditionDefinitions are store in
renditionDefinitionRegistry . |
protected void |
setupProvider(RenditionDefinition definition)
Deprecated.
since 7.3. RenditionDefinitions are store in
renditionDefinitionRegistry . |
protected StoredRendition |
storeRendition(DocumentModel sourceDocument,
Rendition rendition) |
protected DocumentModel |
storeRendition(DocumentModel sourceDocument,
Rendition rendition,
String name)
Deprecated.
since 8.1
|
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) |
protected void |
unregisterRendition(RenditionDefinition renditionDefinition)
Deprecated.
since 7.3. RenditionDefinitions are store in
renditionDefinitionRegistry . |
getAdapter, getLastModified, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
public static final String RENDITION_DEFINITIONS_EP
public static final String RENDITON_DEFINION_PROVIDERS_EP
public static final String DEFAULT_RENDITION_EP
public static final String STORED_RENDITION_MANAGERS_EP
@Deprecated protected AutomationService automationService
@Deprecated protected Map<String,RenditionDefinition> renditionDefinitions
protected RenditionDefinitionRegistry renditionDefinitionRegistry
renditionDefinitionRegistry
.protected RenditionDefinitionProviderRegistry renditionDefinitionProviderRegistry
protected List<DefaultRenditionDescriptor> defaultRenditionDescriptors
protected DefaultRenditionDescriptor defaultRenditionDescriptor
protected static final StoredRenditionManager DEFAULT_STORED_RENDITION_MANAGER
protected Deque<StoredRenditionManagerDescriptor> storedRenditionManagerDescriptors
protected final ScriptEngineManager scriptEngineManager
public RenditionServiceImpl()
public StoredRenditionManager getStoredRenditionManager()
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic RenditionDefinition getRenditionDefinition(String name)
@Deprecated public List<RenditionDefinition> getDeclaredRenditionDefinitions()
RenditionService
List
of registered RenditionDefinition
. The order of the List does not depend on the
registering order.getDeclaredRenditionDefinitions
in interface RenditionService
@Deprecated public List<RenditionDefinition> getDeclaredRenditionDefinitionsForProviderType(String providerType)
RenditionService
List
of registered RenditionDefinition
matching a given provider typegetDeclaredRenditionDefinitionsForProviderType
in interface RenditionService
public List<RenditionDefinition> getAvailableRenditionDefinitions(DocumentModel doc)
RenditionService
List
of RenditionDefinition
available on the given Document. The order of the List does
not depend on the registering order.getAvailableRenditionDefinitions
in interface RenditionService
public DocumentRef storeRendition(DocumentModel source, String renditionDefinitionName)
RenditionService
DocumentRef
.
Only the user launching the render operation has the Read right on the returned document.
storeRendition
in interface RenditionService
source
- the document to renderrenditionDefinitionName
- the rendition definition to useDocumentRef
of the newly created Rendition document.@Deprecated protected DocumentModel storeRendition(DocumentModel sourceDocument, Rendition rendition, String name)
protected StoredRendition storeRendition(DocumentModel sourceDocument, Rendition rendition)
protected DocumentRef createVersionIfNeeded(DocumentModel source, CoreSession session)
@Deprecated protected AutomationService getAutomationService()
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
@Deprecated protected void registerRendition(RenditionDefinition renditionDefinition)
renditionDefinitionRegistry
.@Deprecated protected void setupProvider(RenditionDefinition definition)
renditionDefinitionRegistry
.protected RenditionDefinition mergeRenditions(RenditionDefinition oldRenditionDefinition, RenditionDefinition newRenditionDefinition)
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
@Deprecated protected void unregisterRendition(RenditionDefinition renditionDefinition)
renditionDefinitionRegistry
.public Rendition getRendition(DocumentModel doc, String renditionName)
RenditionService
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.
getRendition
in interface RenditionService
doc
- the document to renderrenditionName
- the name of the rendition definitionRendition
objectpublic Rendition getRendition(DocumentModel doc, String renditionName, boolean store)
RenditionService
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
getRendition
in interface RenditionService
doc
- the document to renderrenditionName
- the name of the rendition definitionstore
- indicates if the rendition must be storedRendition
objectprotected Rendition getRendition(DocumentModel doc, RenditionDefinition renditionDefinition, boolean store)
protected RenditionDefinition getAvailableRenditionDefinition(DocumentModel doc, String renditionName)
public List<Rendition> getAvailableRenditions(DocumentModel doc)
RenditionService
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
getAvailableRenditions
in interface RenditionService
public List<Rendition> getAvailableRenditions(DocumentModel doc, boolean onlyVisible)
RenditionService
List
of Rendition
available on the given Document.
If onlyVisible
is true, returns only the rendition marked as visible.
The order of the List does not depend on the registering order.
The returned rendition may be live or stored
getAvailableRenditions
in interface RenditionService
public void deleteStoredRenditions(String repositoryName)
RenditionService
deleteStoredRenditions
in interface RenditionService
public Rendition getDefaultRendition(DocumentModel doc, String reason, Map<String,Serializable> extendedInfos)
RenditionService
Rendition
object for the given DocumentModel
.
A stored rendition is returned if found and up to date, a new Rendition is created otherwise.
getDefaultRendition
in interface RenditionService
doc
- the document to renderreason
- the reason the rendition is being rendered (optional)extendedInfos
- map of extended info added in the default rendition computation (optional)Rendition
objectCopyright © 2018 Nuxeo. All rights reserved.