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.image.ImageTool;
018    import com.liferay.portal.kernel.lar.PortletDataContext;
019    import com.liferay.portal.kernel.repository.model.FileEntry;
020    import com.liferay.portal.kernel.repository.model.FileVersion;
021    import com.liferay.portal.kernel.xml.Element;
022    
023    import java.io.InputStream;
024    
025    /**
026     * @author Sergio González
027     */
028    public interface PDFProcessor {
029    
030            public static final String PREVIEW_TYPE = ImageTool.TYPE_PNG;
031    
032            public static final String THUMBNAIL_TYPE = ImageTool.TYPE_PNG;
033    
034            public void exportGeneratedFiles(
035                            PortletDataContext portletDataContext, FileEntry fileEntry,
036                            Element fileEntryElement)
037                    throws Exception;
038    
039            public void generateImages(
040                            FileVersion sourceFileVersion, FileVersion destinationFileVersion)
041                    throws Exception;
042    
043            public InputStream getPreviewAsStream(FileVersion fileVersion, int index)
044                    throws Exception;
045    
046            public int getPreviewFileCount(FileVersion fileVersion);
047    
048            public long getPreviewFileSize(FileVersion fileVersion, int index)
049                    throws Exception;
050    
051            public InputStream getThumbnailAsStream(FileVersion fileVersion, int index)
052                    throws Exception;
053    
054            public long getThumbnailFileSize(FileVersion fileVersion, int index)
055                    throws Exception;
056    
057            public boolean hasImages(FileVersion fileVersion);
058    
059            public void importGeneratedFiles(
060                            PortletDataContext portletDataContext, FileEntry fileEntry,
061                            FileEntry importedFileEntry, Element fileEntryElement)
062                    throws Exception;
063    
064            public boolean isDocumentSupported(FileVersion fileVersion);
065    
066            public boolean isDocumentSupported(String mimeType);
067    
068            public boolean isSupported(String mimeType);
069    
070            public void trigger(
071                    FileVersion sourceFileVersion, FileVersion destinationFileVersion);
072    
073    }