Interface RenditionService
-
- All Known Implementing Classes:
RenditionServiceImpl
public interface RenditionServiceService handling Rendition Definitions and actual render based on a Rendition Definition- Since:
- 5.4.1
- Author:
- Thomas Roger, Tiry
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddeleteStoredRenditions(String repositoryName)Query and delete stored renditions where the related version or live document does not exist anymore.RenditionDefinitiongetAvailableRenditionDefinition(DocumentModel doc, String renditionName)Returns theRenditionDefinitionavailable on the given document for the given rendition definition name.List<RenditionDefinition>getAvailableRenditionDefinitions(DocumentModel doc)Returns aListofRenditionDefinitionavailable on the given Document.List<Rendition>getAvailableRenditions(DocumentModel doc)Returns aListofRenditionavailable on the given Document.List<Rendition>getAvailableRenditions(DocumentModel doc, boolean onlyVisible)Returns aListofRenditionavailable on the given Document.List<RenditionDefinition>getDeclaredRenditionDefinitions()Returns aListof registeredRenditionDefinition.List<RenditionDefinition>getDeclaredRenditionDefinitionsForProviderType(String providerType)Deprecated.since 7.2 because unused, except in JSFRenditiongetDefaultRendition(DocumentModel doc, String reason, boolean store, Map<String,Serializable> extendedInfos)Return the defaultRenditionobject for the givenDocumentModel.RenditiongetDefaultRendition(DocumentModel doc, String reason, Map<String,Serializable> extendedInfos)Same asgetDefaultRendition(DocumentModel, String, boolean, Map)with store parameter set to false.RenditiongetRendition(DocumentModel doc, String renditionName)Return theRenditionobject for the givenDocumentModeland a rendition definition name.RenditiongetRendition(DocumentModel doc, String renditionName, boolean store)Return theRenditionobject for the givenDocumentModeland a rendition definition name.DocumentModelpublishRendition(DocumentModel doc, DocumentModel target, String renditionName, boolean override)Publish a document's rendition.DocumentRefstoreRendition(DocumentModel sourceDocument, String renditionDefinitionName)Render a document based on the given rendition definition name and returns the stored RenditionDocumentRef.
-
-
-
Method Detail
-
getDeclaredRenditionDefinitions
List<RenditionDefinition> getDeclaredRenditionDefinitions()
Returns aListof registeredRenditionDefinition. The order of the List does not depend on the registering order.
-
getDeclaredRenditionDefinitionsForProviderType
@Deprecated List<RenditionDefinition> getDeclaredRenditionDefinitionsForProviderType(String providerType)
Deprecated.since 7.2 because unused, except in JSFReturns aListof registeredRenditionDefinitionmatching a given provider type
-
getAvailableRenditionDefinitions
List<RenditionDefinition> getAvailableRenditionDefinitions(DocumentModel doc)
Returns aListofRenditionDefinitionavailable on the given Document. The order of the List does not depend on the registering order.
-
getAvailableRenditionDefinition
RenditionDefinition getAvailableRenditionDefinition(DocumentModel doc, String renditionName)
Returns theRenditionDefinitionavailable on the given document for the given rendition definition name.- Since:
- 10.10
-
storeRendition
DocumentRef storeRendition(DocumentModel sourceDocument, String renditionDefinitionName)
Render a document based on the given rendition definition name and returns the stored RenditionDocumentRef.Only the user launching the render operation has the Read right on the returned document.
- Parameters:
sourceDocument- the document to renderrenditionDefinitionName- the rendition definition to use- Returns:
- the
DocumentRefof the newly created Rendition document.
-
getRendition
Rendition getRendition(DocumentModel doc, String renditionName)
Return theRenditionobject for the givenDocumentModeland a rendition definition name.A stored rendition is returned if found and up to date, a new Rendition is created otherwise.
- Parameters:
doc- the document to renderrenditionName- the name of the rendition definition- Returns:
- the
Renditionobject
-
getDefaultRendition
Rendition getDefaultRendition(DocumentModel doc, String reason, Map<String,Serializable> extendedInfos)
Same asgetDefaultRendition(DocumentModel, String, boolean, Map)with store parameter set to false.- Parameters:
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)- Returns:
- the default
Renditionobject - Since:
- 9.10
-
getDefaultRendition
Rendition getDefaultRendition(DocumentModel doc, String reason, boolean store, Map<String,Serializable> extendedInfos)
Return the defaultRenditionobject for the givenDocumentModel.A stored rendition is returned if found and up to date, a new Rendition is created otherwise.
- Parameters:
doc- the document to renderreason- the reason the rendition is being rendered (optional)store- indicates if the rendition must be storedextendedInfos- map of extended info added in the default rendition computation (optional)- Returns:
- the default
Renditionobject - Since:
- 10.3
-
getRendition
Rendition getRendition(DocumentModel doc, String renditionName, boolean store)
Return theRenditionobject for the givenDocumentModeland a rendition definition name.A stored rendition is returned if found and up to date, a new (live) Rendition is created and returned otherwise.
If store parameter is true, the new created rendition is stored too unless it is marked as stale.
- Parameters:
doc- the document to renderrenditionName- the name of the rendition definitionstore- indicates if the rendition must be stored- Returns:
- the
Renditionobject
-
getAvailableRenditions
List<Rendition> getAvailableRenditions(DocumentModel doc)
Returns aListofRenditionavailable 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
List<Rendition> getAvailableRenditions(DocumentModel doc, boolean onlyVisible)
Returns aListofRenditionavailable on the given Document.If
onlyVisibleis 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
- Since:
- 7.2
-
deleteStoredRenditions
void deleteStoredRenditions(String repositoryName)
Query and delete stored renditions where the related version or live document does not exist anymore.- Since:
- 8.4
-
publishRendition
DocumentModel publishRendition(DocumentModel doc, DocumentModel target, String renditionName, boolean override)
Publish a document's rendition. If the rendition name is not given, it publishes its default rendition obtained fromgetDefaultRendition(DocumentModel, String, Map).- Parameters:
doc- the document to be publishedtarget- the location where to publishrenditionName- the rendition to be publishedoverride- if true, will remove existing publication of the document- Returns:
- the published document
- Since:
- 10.3
-
-