Interface RenditionService
-
- All Known Implementing Classes:
RenditionServiceImpl
public interface RenditionService
Service 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 void
deleteStoredRenditions(String repositoryName)
Query and delete stored renditions where the related version or live document does not exist anymore.RenditionDefinition
getAvailableRenditionDefinition(DocumentModel doc, String renditionName)
Returns theRenditionDefinition
available on the given document for the given rendition definition name.List<RenditionDefinition>
getAvailableRenditionDefinitions(DocumentModel doc)
Returns aList
ofRenditionDefinition
available on the given Document.List<Rendition>
getAvailableRenditions(DocumentModel doc)
Returns aList
ofRendition
available on the given Document.List<Rendition>
getAvailableRenditions(DocumentModel doc, boolean onlyVisible)
Returns aList
ofRendition
available on the given Document.List<RenditionDefinition>
getDeclaredRenditionDefinitions()
Returns aList
of registeredRenditionDefinition
.List<RenditionDefinition>
getDeclaredRenditionDefinitionsForProviderType(String providerType)
Deprecated.since 7.2 because unused, except in JSFRendition
getDefaultRendition(DocumentModel doc, String reason, boolean store, Map<String,Serializable> extendedInfos)
Return the defaultRendition
object for the givenDocumentModel
.Rendition
getDefaultRendition(DocumentModel doc, String reason, Map<String,Serializable> extendedInfos)
Same asgetDefaultRendition(DocumentModel, String, boolean, Map)
with store parameter set to false.Rendition
getRendition(DocumentModel doc, String renditionName)
Return theRendition
object for the givenDocumentModel
and a rendition definition name.Rendition
getRendition(DocumentModel doc, String renditionName, boolean store)
Return theRendition
object for the givenDocumentModel
and a rendition definition name.DocumentModel
publishRendition(DocumentModel doc, DocumentModel target, String renditionName, boolean override)
Publish a document's rendition.DocumentRef
storeRendition(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 aList
of 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 aList
of registeredRenditionDefinition
matching a given provider type
-
getAvailableRenditionDefinitions
List<RenditionDefinition> getAvailableRenditionDefinitions(DocumentModel doc)
Returns aList
ofRenditionDefinition
available on the given Document. The order of the List does not depend on the registering order.
-
getAvailableRenditionDefinition
RenditionDefinition getAvailableRenditionDefinition(DocumentModel doc, String renditionName)
Returns theRenditionDefinition
available 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
DocumentRef
of the newly created Rendition document.
-
getRendition
Rendition getRendition(DocumentModel doc, String renditionName)
Return theRendition
object for the givenDocumentModel
and 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
Rendition
object
-
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
Rendition
object - Since:
- 9.10
-
getDefaultRendition
Rendition getDefaultRendition(DocumentModel doc, String reason, boolean store, Map<String,Serializable> extendedInfos)
Return the defaultRendition
object 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
Rendition
object - Since:
- 10.3
-
getRendition
Rendition getRendition(DocumentModel doc, String renditionName, boolean store)
Return theRendition
object for the givenDocumentModel
and 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
Rendition
object
-
getAvailableRenditions
List<Rendition> getAvailableRenditions(DocumentModel doc)
Returns aList
ofRendition
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
List<Rendition> getAvailableRenditions(DocumentModel doc, boolean onlyVisible)
Returns aList
ofRendition
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
- 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
-
-