org.alfresco.service.cmr.thumbnail
Interface ThumbnailService

All Known Implementing Classes:
ThumbnailServiceImpl

public interface ThumbnailService

Thumbnail Service API


Method Summary
 org.alfresco.service.cmr.repository.NodeRef createThumbnail(org.alfresco.service.cmr.repository.NodeRef node, org.alfresco.service.namespace.QName contentProperty, java.lang.String mimetype, TransformationOptions transformationOptions, java.lang.String name)
          Creates a new thumbnail for the given node and content property.
 org.alfresco.service.cmr.repository.NodeRef createThumbnail(org.alfresco.service.cmr.repository.NodeRef node, org.alfresco.service.namespace.QName contentProperty, java.lang.String mimetype, TransformationOptions transformationOptions, java.lang.String name, ThumbnailParentAssociationDetails assocDetails)
           
 java.util.Map getFailedThumbnails(org.alfresco.service.cmr.repository.NodeRef sourceNode)
          This method returns a Map of failed thumbnails for the specified source node.
 org.alfresco.service.cmr.repository.NodeRef getThumbnailByName(org.alfresco.service.cmr.repository.NodeRef node, org.alfresco.service.namespace.QName contentProperty, java.lang.String thumbnailName)
          Gets the thumbnail for a given content property with a given name.
 ThumbnailRegistry getThumbnailRegistry()
          Gets the thumbnail registry
 java.util.List getThumbnails(org.alfresco.service.cmr.repository.NodeRef node, org.alfresco.service.namespace.QName contentProperty, java.lang.String mimetype, TransformationOptions options)
          Gets a list of thumbnail nodes for a given content property that match the provided mimetype and transformation options.
 void updateThumbnail(org.alfresco.service.cmr.repository.NodeRef thumbnail, TransformationOptions transformationOptions)
          Updates the content of a thumbnail.
 

Method Detail

getThumbnailRegistry

@NotAuditable
ThumbnailRegistry getThumbnailRegistry()
Gets the thumbnail registry

Returns:
ThumbnailRegistry thumbnail registry

createThumbnail

@Auditable(parameters={"node", "contentProperty", "mimetype", "transformationOptions", "name"})
org.alfresco.service.cmr.repository.NodeRef createThumbnail(org.alfresco.service.cmr.repository.NodeRef node,
                                                                      org.alfresco.service.namespace.QName contentProperty,
                                                                      java.lang.String mimetype,
                                                                      TransformationOptions transformationOptions,
                                                                      java.lang.String name)
Creates a new thumbnail for the given node and content property. The mimetype and transformation options are used to determine the content transformer that will be best suited to create the thumbnail. The thumbnail name is optional, but is usually set to provide an easy way to identify a particular 'type' of thumbnail. Once created the source node will have the 'rn:renditioned' aspect applied and an association to the thumbnail node (of type 'rn:rendition') will be created. The returned node reference is to the 'rn:rendition' content node that contains the thumbnail content in the standard 'cm:content' property.

Parameters:
node - the source content node
contentProperty - the content property
mimetype - the thumbnail mimetype
transformationOptions - the thumbnail transformation options
name - the name of the thumbnail (optional, pass null for unnamed thumbnail)
Returns:
NodeRef node reference to the newly created thumbnail
See Also:
org.alfresco.service.cmr.thumnail.ThumbnailDefinition

createThumbnail

@Auditable(parameters={"node", "contentProperty", "mimetype", "transformationOptions", "name", "assocDetails"})
org.alfresco.service.cmr.repository.NodeRef createThumbnail(org.alfresco.service.cmr.repository.NodeRef node,
                                                                      org.alfresco.service.namespace.QName contentProperty,
                                                                      java.lang.String mimetype,
                                                                      TransformationOptions transformationOptions,
                                                                      java.lang.String name,
                                                                      ThumbnailParentAssociationDetails assocDetails)
Parameters:
node - the source content node
contentProperty - the content property
mimetype - the thumbnail mimetype
transformationOptions - the thumbnail transformation options
name - the name of the thumbnail (optional, pass null for unnamed thumbnail)
assocDetails - the thumbnail parent association details
Returns:
NodeRef node reference to the newly created thumbnail
See Also:
If parent association details are specified then the thumbnail is created as a child of the specified parent and linked via a non-primary association to the original content node.

updateThumbnail

@Auditable(parameters={"thumbnail", "transformationOptions"})
void updateThumbnail(org.alfresco.service.cmr.repository.NodeRef thumbnail,
                               TransformationOptions transformationOptions)
Updates the content of a thumbnail. The original thumbnail content is updated from the source content using the transformation options provided. The mimetype and name of the thumbnail remain unchanged. To change the name or mimetype of an updated thumbnail it should be deleted and recreated. An error is raised if the original content no longer exists.

Parameters:
thumbnail - the thumbnail node
transformationOptions - the transformation options used when updating the thumbnail

getThumbnailByName

@Auditable(parameters={"node", "contentProperty", "thumbnailName"})
org.alfresco.service.cmr.repository.NodeRef getThumbnailByName(org.alfresco.service.cmr.repository.NodeRef node,
                                                                         org.alfresco.service.namespace.QName contentProperty,
                                                                         java.lang.String thumbnailName)
Gets the thumbnail for a given content property with a given name. Returns null if no thumbnail with that name for that content property is found.

Parameters:
node - node reference
contentProperty - content property name
thumbnailName - thumbnail name
Returns:
NodeRef the thumbnail node reference, null if not found

getThumbnails

@Auditable(parameters={"node", "contentProperty", "mimetype", "options"})
java.util.List getThumbnails(org.alfresco.service.cmr.repository.NodeRef node,
                                       org.alfresco.service.namespace.QName contentProperty,
                                       java.lang.String mimetype,
                                       TransformationOptions options)
Gets a list of thumbnail nodes for a given content property that match the provided mimetype and transformation options. Both mimetype and transformation options are optional parameters. If only one or other is specified the only the other is considered during. If neither are provided all thumbnails for that content property are returned. If no matches are found then an empty list is returned.

Parameters:
node - node reference
contentProperty - content property name
mimetype - mimetype
options - transformation options
Returns:
List list of matching thumbnail node references, empty if no matches found

getFailedThumbnails

@Auditable(parameters="sourceNode")
java.util.Map getFailedThumbnails(org.alfresco.service.cmr.repository.NodeRef sourceNode)
This method returns a Map of failed thumbnails for the specified source node. The map is keyed by thumbnail definition name and the values are the failed thumbnails.

Parameters:
sourceNode - the node whose thumbnails are to be checked.
Returns:
a Map of failed thumbnails, if any. If there are no such failures, an empty Map will be returned.
Since:
3.5.0


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.