Package org.alfresco.rest.api.impl
Class RenditionsImpl
- java.lang.Object
-
- org.alfresco.rest.api.impl.RenditionsImpl
-
- All Implemented Interfaces:
Renditions
,org.springframework.beans.factory.Aware
,org.springframework.context.ResourceLoaderAware
public class RenditionsImpl extends Object implements Renditions, org.springframework.context.ResourceLoaderAware
- Author:
- Jamal Kaabi-Mofrad, janv
-
-
Field Summary
-
Fields inherited from interface org.alfresco.rest.api.Renditions
PARAM_ATTACHMENT, PARAM_PLACEHOLDER, PARAM_STATUS
-
-
Constructor Summary
Constructors Constructor Description RenditionsImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createRendition(NodeRef nodeRef, String versionLabelId, Rendition rendition, boolean executeAsync, Parameters parameters)
Creates a rendition for the given node - either async r syncvoid
createRendition(NodeRef nodeRef, Rendition rendition, boolean executeAsync, Parameters parameters)
Creates a rendition for the given node - either async r syncvoid
createRendition(NodeRef nodeRef, Rendition rendition, Parameters parameters)
Creates a rendition for the given node asynchronously.void
createRenditions(NodeRef nodeRef, String versionLabelId, List<Rendition> renditions, Parameters parameters)
Creates renditions that don't already exist for the given node asynchronously.void
createRenditions(NodeRef nodeRef, List<Rendition> renditions, Parameters parameters)
Creates renditions that don't already exist for the given node asynchronously.void
deleteRendition(NodeRef nodeRef, String versionId, String renditionId, Parameters parameters)
Delete the rendition node.void
deleteRendition(NodeRef nodeRef, String renditionId, Parameters parameters)
Delete the rendition node.BinaryResource
getContent(NodeRef nodeRef, String versionLabelId, String renditionId, Parameters parameters)
Downloads rendition.BinaryResource
getContent(NodeRef nodeRef, String renditionId, Parameters parameters)
Downloads rendition.BinaryResource
getContentNoValidation(NodeRef nodeRef, String versionLabelId, String renditionId, Parameters parameters)
Downloads rendition.BinaryResource
getContentNoValidation(NodeRef nodeRef, String renditionId, Parameters parameters)
Downloads rendition.Rendition
getRendition(NodeRef nodeRef, String versionLabelId, String renditionId, Parameters parameters)
Gets information about a rendition of a node in the repository.Rendition
getRendition(NodeRef nodeRef, String renditionId, Parameters parameters)
Gets information about a rendition of a node in the repository.protected NodeRef
getRenditionByName(NodeRef nodeRef, String renditionId, Parameters parameters)
CollectionWithPagingInfo<Rendition>
getRenditions(NodeRef nodeRef, String versionLabelId, Parameters parameters)
Lists all available renditions includes those that have been created and those that are yet to be created.CollectionWithPagingInfo<Rendition>
getRenditions(NodeRef nodeRef, Parameters parameters)
Lists all available renditions includes those that have been created and those that are yet to be created.void
init()
DirectAccessUrl
requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor)
Gets a presigned URL to directly access content.void
setNodes(Nodes nodes)
void
setRenditionsDataCollector(RenditionsDataCollector renditionsDataCollector)
void
setRenditionService2(RenditionService2 renditionService2)
void
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
void
setScriptThumbnailService(ScriptThumbnailService scriptThumbnailService)
void
setServiceRegistry(ServiceRegistry serviceRegistry)
void
setTenantService(TenantService tenantService)
protected Rendition
toApiRendition(String renditionName)
protected Rendition
toApiRendition(NodeRef renditionNodeRef)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.alfresco.rest.api.Renditions
requestContentDirectUrl, requestContentDirectUrl, requestContentDirectUrl
-
-
-
-
Method Detail
-
setNodes
public void setNodes(Nodes nodes)
-
setScriptThumbnailService
public void setScriptThumbnailService(ScriptThumbnailService scriptThumbnailService)
-
setServiceRegistry
public void setServiceRegistry(ServiceRegistry serviceRegistry)
-
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
- Specified by:
setResourceLoader
in interfaceorg.springframework.context.ResourceLoaderAware
-
setTenantService
public void setTenantService(TenantService tenantService)
-
setRenditionService2
public void setRenditionService2(RenditionService2 renditionService2)
-
setRenditionsDataCollector
public void setRenditionsDataCollector(RenditionsDataCollector renditionsDataCollector)
-
init
public void init()
-
getRenditions
public CollectionWithPagingInfo<Rendition> getRenditions(NodeRef nodeRef, Parameters parameters)
Description copied from interface:Renditions
Lists all available renditions includes those that have been created and those that are yet to be created.- Specified by:
getRenditions
in interfaceRenditions
- Parameters:
nodeRef
- the source/live nodeRefparameters
- theParameters
object to get the parameters passed into the request- Returns:
- the rendition results
-
getRenditions
public CollectionWithPagingInfo<Rendition> getRenditions(NodeRef nodeRef, String versionLabelId, Parameters parameters)
Description copied from interface:Renditions
Lists all available renditions includes those that have been created and those that are yet to be created.- Specified by:
getRenditions
in interfaceRenditions
- Parameters:
nodeRef
- the source/live nodeRefversionLabelId
- the version id (aka version label)parameters
- theParameters
object to get the parameters passed into the request- Returns:
- the rendition results
-
getRendition
public Rendition getRendition(NodeRef nodeRef, String renditionId, Parameters parameters)
Description copied from interface:Renditions
Gets information about a rendition of a node in the repository. If there is no rendition, then returns the available/registered rendition.- Specified by:
getRendition
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live noderenditionId
- the rendition idparameters
- theParameters
object to get the parameters passed into the request- Returns:
- the
Rendition
object
-
getRendition
public Rendition getRendition(NodeRef nodeRef, String versionLabelId, String renditionId, Parameters parameters)
Description copied from interface:Renditions
Gets information about a rendition of a node in the repository. If there is no rendition, then returns the available/registered rendition.- Specified by:
getRendition
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live nodeversionLabelId
- the version id (aka version label)renditionId
- the rendition idparameters
- theParameters
object to get the parameters passed into the request- Returns:
- the
Rendition
object
-
createRendition
public void createRendition(NodeRef nodeRef, Rendition rendition, Parameters parameters)
Description copied from interface:Renditions
Creates a rendition for the given node asynchronously.- Specified by:
createRendition
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live noderendition
- theRendition
requestparameters
- theParameters
object to get the parameters passed into the request
-
createRendition
public void createRendition(NodeRef nodeRef, Rendition rendition, boolean executeAsync, Parameters parameters)
Description copied from interface:Renditions
Creates a rendition for the given node - either async r sync- Specified by:
createRendition
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live noderendition
- theRendition
request
-
createRendition
public void createRendition(NodeRef nodeRef, String versionLabelId, Rendition rendition, boolean executeAsync, Parameters parameters)
Description copied from interface:Renditions
Creates a rendition for the given node - either async r sync- Specified by:
createRendition
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live nodeversionLabelId
- the version id (aka version label)rendition
- theRendition
request
-
createRenditions
public void createRenditions(NodeRef nodeRef, List<Rendition> renditions, Parameters parameters) throws NotFoundException, ConstraintViolatedException
Description copied from interface:Renditions
Creates renditions that don't already exist for the given node asynchronously.- Specified by:
createRenditions
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live noderenditions
- the list ofRendition
requestsparameters
- theParameters
object to get the parameters passed into the request- Throws:
NotFoundException
- if any of the rendition id do not exist.ConstraintViolatedException
- if all of the renditions already exist.
-
createRenditions
public void createRenditions(NodeRef nodeRef, String versionLabelId, List<Rendition> renditions, Parameters parameters) throws NotFoundException, ConstraintViolatedException
Description copied from interface:Renditions
Creates renditions that don't already exist for the given node asynchronously.- Specified by:
createRenditions
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live nodeversionLabelId
- the version id (aka version label)renditions
- the list ofRendition
requestsparameters
- theParameters
object to get the parameters passed into the request- Throws:
NotFoundException
- if any of the rendition id do not exist.ConstraintViolatedException
- if all of the renditions already exist.
-
deleteRendition
public void deleteRendition(NodeRef nodeRef, String renditionId, Parameters parameters)
Description copied from interface:Renditions
Delete the rendition node.- Specified by:
deleteRendition
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live noderenditionId
- the rendition idparameters
- theParameters
object to get the parameters passed into the request
-
deleteRendition
public void deleteRendition(NodeRef nodeRef, String versionId, String renditionId, Parameters parameters)
Description copied from interface:Renditions
Delete the rendition node.- Specified by:
deleteRendition
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live nodeversionId
- the version id (aka version label)renditionId
- the rendition idparameters
- theParameters
object to get the parameters passed into the request
-
getContent
public BinaryResource getContent(NodeRef nodeRef, String renditionId, Parameters parameters)
Description copied from interface:Renditions
Downloads rendition.- Specified by:
getContent
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live noderenditionId
- the rendition idparameters
- theParameters
object to get the parameters passed into the request- Returns:
- the rendition stream
-
getContent
public BinaryResource getContent(NodeRef nodeRef, String versionLabelId, String renditionId, Parameters parameters)
Description copied from interface:Renditions
Downloads rendition.- Specified by:
getContent
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live nodeversionLabelId
- the version id (aka version label)renditionId
- the rendition idparameters
- theParameters
object to get the parameters passed into the request- Returns:
- the rendition stream
-
getContentNoValidation
public BinaryResource getContentNoValidation(NodeRef nodeRef, String renditionId, Parameters parameters)
Description copied from interface:Renditions
Downloads rendition.- Specified by:
getContentNoValidation
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live noderenditionId
- the rendition idparameters
- theParameters
object to get the parameters passed into the request- Returns:
- the rendition stream
-
getContentNoValidation
public BinaryResource getContentNoValidation(NodeRef nodeRef, String versionLabelId, String renditionId, Parameters parameters)
Description copied from interface:Renditions
Downloads rendition.- Specified by:
getContentNoValidation
in interfaceRenditions
- Parameters:
nodeRef
- the source nodeRef, ie. live nodeversionLabelId
- the version id (aka version label)renditionId
- the rendition idparameters
- theParameters
object to get the parameters passed into the request- Returns:
- the rendition stream
-
requestContentDirectUrl
public DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor)
Gets a presigned URL to directly access content.- Specified by:
requestContentDirectUrl
in interfaceRenditions
- Parameters:
nodeRef
- the node reference for which to obtain the direct accessURL
versionId
- the version id (aka version label)renditionId
- the rendition idattachment
-true
if an attachmentURL
is requested,false
for an embeddedURL
validFor
- the time at which the direct accessURL
will expire- Returns:
- a direct access
URL
object for the content.
-
getRenditionByName
protected NodeRef getRenditionByName(NodeRef nodeRef, String renditionId, Parameters parameters)
-
-