001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.documentlibrary.util;
016    
017    import com.liferay.portal.kernel.lar.PortletDataContext;
018    import com.liferay.portal.kernel.repository.model.FileEntry;
019    import com.liferay.portal.kernel.repository.model.FileVersion;
020    import com.liferay.portal.kernel.xml.Element;
021    
022    import java.io.InputStream;
023    
024    import java.util.Set;
025    
026    /**
027     * @author Sergio Gonz??lez
028     */
029    public interface VideoProcessor {
030    
031            public static final String THUMBNAIL_TYPE = "jpg";
032    
033            public void exportGeneratedFiles(
034                            PortletDataContext portletDataContext, FileEntry fileEntry,
035                            Element fileEntryElement)
036                    throws Exception;
037    
038            public void generateVideo(
039                            FileVersion sourceFileVersion, FileVersion destinationFileVersion)
040                    throws Exception;
041    
042            public InputStream getPreviewAsStream(FileVersion fileVersion, String type)
043                    throws Exception;
044    
045            public long getPreviewFileSize(FileVersion fileVersion, String type)
046                    throws Exception;
047    
048            public InputStream getThumbnailAsStream(FileVersion fileVersion, int index)
049                    throws Exception;
050    
051            public long getThumbnailFileSize(FileVersion fileVersion, int index)
052                    throws Exception;
053    
054            public Set<String> getVideoMimeTypes();
055    
056            public boolean hasVideo(FileVersion fileVersion);
057    
058            public void importGeneratedFiles(
059                            PortletDataContext portletDataContext, FileEntry fileEntry,
060                            FileEntry importedFileEntry, Element fileEntryElement)
061                    throws Exception;
062    
063            public boolean isSupported(String mimeType);
064    
065            public boolean isVideoSupported(FileVersion fileVersion);
066    
067            public boolean isVideoSupported(String mimeType);
068    
069            public void trigger(
070                    FileVersion sourceFileVersion, FileVersion destinationFileVersion);
071    
072    }