Draft example using API template

cancel
Showing results for 
Search instead for 
Did you mean: 

Draft example using API template

resplin
Intermediate
0 0 1,061

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



Example of using the API template with the 3.0 Thumbnail Service.



Link to the template for API References.


Introduction


The Alfresco Thumbnail Service API provides developers with programmatic access to thumbnail images for the home pages of web sites.  

The Alfresco Thumbnail Service API allows script writers to develop enhanced web sites, search results, web directories, blog entries, and other web real estate with thumbnail images.

Using the API, script writers can:


  • Improve the user experience by allowing end users to preview sites before clicking on the thumbnail's associated link.
  • another business example

Provide other references (external and internal)...

These interfaces and classes make up the fundamental Thumbnail Service API.


Package: com.alfresco.cmr.thumbnail


Interface: ThumbnailService

Description: Thumbnail service API to create, update and retrieve thumbnails.


Methods Summary



Interface MethodsDescription
createThumbnail(NodeRef node, QName contentProperty, CreateOptions createOptions)Creates a new thumbnail for the given node and content property.
updateThumbnail(NodeRef thumbnail)Updates the content of a thumbnail.
getThumbnailByName(NodeRef node, QName contentProperty, String thumbnailName)Gets the thumbnail for a given content property with a given name.
getThumbnails(NodeRef node, QName contentProperty, String mimetype, TransformationOptions options)Gets a list of thumbnail nodes for a given content property that match the provided mimetype and transformation options.

createThumbnail(NodeRef node, QName contentProperty, CreateOptions createOptions)


Low-level description.
The passed create options specify the details of the thumbnail, including the mime type, size, and location of the thumbnail. Once created, the source node will have the tn:thumbnailed aspect applied and an association to the thumbnail node (or type tn:thumbnail) will be created.

The returned node reference is to the tn:thumbnail content node that contains the thumnail content in the standard cm:content property.


Parameters


node:The source content node.
contentProperty:The content property.
createOptions:The create options.

Return values


Return value: List all possible return values and meaning.

NodeRef:node reference to the newly created thumbnail

Exceptions


Exception: List all exceptions thrown.

Comments


Comment: Additional information.

See also


Other methods: List of related methods.

updateThumbnail(NodeRef thumbnail)


Low-level description.
The original creation options are used when updating the thumbnail. The content of the associated thumbnailed node is used to update. An error is raised if the original content no longer exists.


Parameters


thumbnail:The thumbnail node.

Return values


There are no return values.


Exceptions


Exception: List all exceptions thrown.

Comments


Comment: Additional information.

See also


Other methods: List of related methods.

getThumbnailByName(NodeRef node, QName contentProperty, String thumbnailName)


Low-level description.
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


thumbnail:The node reference.
contentProperty:The content property name.
thumbnailName:The thumbnail name.

Return values


Return value: List all possible return values and meaning.

NodeRef:the thumbnail node reference, null if not found

Exceptions


Exception: List all exceptions thrown.

Comments


Comment: Additional information.

See also


Other methods: List of related methods.

getThumbnails(NodeRef node, QName contentProperty, String mimetype, TransformationOptions options)


Low-level description.
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

Return values


Return value: List all possible return values and meaning.

List<NodeRef>:list of matching thumbnail node references, empty if no matches found

Exceptions


Exception: List all exceptions thrown.

Comments


Comment: Additional information.

See also


Other methods: List of related methods.

Package: com.alfresco.cmr.thumbnail


Type: CreateOptions

Description: Provides the thumbnail create options to the thumbnail service


Methods Summary



Interface MethodsDescription
createThumbnail(NodeRef node, QName contentProperty, CreateOptions createOptions)Creates a new thumbnail for the given node and content property.
updateThumbnail(NodeRef thumbnail)Updates the content of a thumbnail.
getThumbnailByName(NodeRef node, QName contentProperty, String thumbnailName)Gets the thumbnail for a given content property with a given name.
getThumbnails(NodeRef node, QName contentProperty, String mimetype, TransformationOptions options)Gets a list of thumbnail nodes for a given content property that match the provided mimetype and transformation options.

Draft Pages