mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-16 17:55:15 +00:00
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8950 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
109 lines
4.8 KiB
Java
109 lines
4.8 KiB
Java
/*
|
|
* Copyright (C) 2005-2008 Alfresco Software Limited.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
* As a special exception to the terms and conditions of version 2.0 of
|
|
* the GPL, you may redistribute this Program in connection with Free/Libre
|
|
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
|
* FLOSS exception. You should have recieved a copy of the text describing
|
|
* the FLOSS exception, and it is also available here:
|
|
* http://www.alfresco.com/legal/licensing"
|
|
*/
|
|
package org.alfresco.service.cmr.thumbnail;
|
|
|
|
import java.util.List;
|
|
|
|
import org.alfresco.service.Auditable;
|
|
import org.alfresco.service.cmr.repository.NodeRef;
|
|
import org.alfresco.service.cmr.repository.TransformationOptions;
|
|
import org.alfresco.service.namespace.QName;
|
|
|
|
/**
|
|
* Thumbnail Service API
|
|
*
|
|
* @author Roy Wetherall (based on original contribution by Ray Gauss II)
|
|
*/
|
|
public interface ThumbnailService
|
|
{
|
|
/**
|
|
* Creates a new thumbnail for the given node and content property.
|
|
*
|
|
* The passed create options specify the details of the thumbnail, including the
|
|
* mimetpye, 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.
|
|
*
|
|
* @see org.alfresco.service.cmr.thumnail.GenerateOptions
|
|
*
|
|
* @param node the source content node
|
|
* @param contentProperty the content property
|
|
* @param createOptions the create options
|
|
* @return NodeRef node reference to the newly created thumbnail
|
|
*/
|
|
@Auditable(key = Auditable.Key.ARG_0, parameters = {"node", "contentProperty", "createOptions"})
|
|
NodeRef createThumbnail(NodeRef node, QName contentProperty, CreateOptions createOptions);
|
|
|
|
/**
|
|
* Updates the content of a thumbnail.
|
|
*
|
|
* 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 exisits.
|
|
*
|
|
* @param thumbnail the thumbnail node
|
|
*/
|
|
@Auditable(key = Auditable.Key.ARG_0, parameters = {"thumbnail"})
|
|
void updateThumbnail(NodeRef thumbnail);
|
|
|
|
/**
|
|
* Get's 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.
|
|
*
|
|
* @param node node reference
|
|
* @param contentProperty content property name
|
|
* @param thumbnailName thumbnail name
|
|
* @return NodeRef the thumbnail node reference, null if not found
|
|
*/
|
|
@Auditable(key = Auditable.Key.ARG_0, parameters = {"node", "contentProperty", "thumbnailName"})
|
|
NodeRef getThumbnailByName(NodeRef node, QName contentProperty, String thumbnailName);
|
|
|
|
/**
|
|
* Get's 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.
|
|
*
|
|
* @param node node reference
|
|
* @param contentProperty content property name
|
|
* @param mimetype mimetype
|
|
* @param options transformation options
|
|
* @return List<NodeRef> list of matching thumbnail node references, empty if no matches found
|
|
*/
|
|
@Auditable(key = Auditable.Key.ARG_0, parameters = {"node", "contentProperty", "mimetype", "options"})
|
|
List<NodeRef> getThumbnails(NodeRef node, QName contentProperty, String mimetype, TransformationOptions options);
|
|
|
|
}
|