001/* 002 * (C) Copyright 2010 Nuxeo SAS (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * Contributors: 014 * Nuxeo - initial API and implementation 015 */ 016 017package org.nuxeo.ecm.platform.rendition; 018 019import java.util.Calendar; 020import java.util.List; 021 022import org.nuxeo.ecm.core.api.Blob; 023import org.nuxeo.ecm.core.api.DocumentModel; 024import org.nuxeo.ecm.platform.rendition.service.RenditionDefinition; 025 026/** 027 * Interface hiding the actual rendition implementation and allowing for Lazy computation of the rendition blobs. 028 * <p> 029 * RenditionDefinition is partially wrapper in the {@link Rendition} 030 * 031 * @since 5.6 032 * @author <a href="mailto:tdelprat@nuxeo.com">Tiry</a> 033 */ 034public interface Rendition { 035 036 /** 037 * Returns icon file name 038 */ 039 String getIcon(); 040 041 /** 042 * Returns the {@link RenditionDefinition} name 043 */ 044 String getName(); 045 046 /** 047 * Returns the {@link RenditionDefinition} CMIS name 048 * 049 * @since 7.3 050 */ 051 String getCmisName(); 052 053 /** 054 * Returns the {@link RenditionDefinition} label 055 */ 056 String getLabel(); 057 058 /** 059 * Returns the King of the {@link RenditionDefinition} 060 */ 061 String getKind(); 062 063 /** 064 * Returns the type of the provider that was used to generate the rendition 065 */ 066 String getProviderType(); 067 068 /** 069 * Indicates if the Rendition is stored or live 070 */ 071 boolean isStored(); 072 073 /** 074 * Returns rendered Blob 075 */ 076 Blob getBlob(); 077 078 /** 079 * Returns rendered Blobs 080 */ 081 List<Blob> getBlobs(); 082 083 /** 084 * Return the Document hosting the rendition. 085 * <p> 086 * In case of a Live rendition it will be the target document and in case of stored Rendition it will be the 087 * Rendition document it self 088 */ 089 DocumentModel getHostDocument(); 090 091 /** 092 * Returns last modification date. 093 * <p> 094 * Returns current time for live renditions. 095 */ 096 097 Calendar getModificationDate(); 098 099}