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    import java.util.Properties;
026    
027    /**
028     * @author Sergio Gonz??lez
029     */
030    public interface PDFProcessor {
031    
032            public static final String PREVIEW_TYPE = ImageTool.TYPE_PNG;
033    
034            public static final String THUMBNAIL_TYPE = ImageTool.TYPE_PNG;
035    
036            public void exportGeneratedFiles(
037                            PortletDataContext portletDataContext, FileEntry fileEntry,
038                            Element fileEntryElement)
039                    throws Exception;
040    
041            public void generateImages(FileVersion fileVersion)
042                    throws Exception;
043    
044            public String getGlobalSearchPath() throws Exception;
045    
046            public InputStream getPreviewAsStream(FileVersion fileVersion, int index)
047                    throws Exception;
048    
049            public int getPreviewFileCount(FileVersion fileVersion);
050    
051            public long getPreviewFileSize(FileVersion fileVersion, int index)
052                    throws Exception;
053    
054            public Properties getResourceLimitsProperties() throws Exception;
055    
056            public InputStream getThumbnailAsStream(FileVersion fileVersion, int index)
057                    throws Exception;
058    
059            public long getThumbnailFileSize(FileVersion fileVersion, int index)
060                    throws Exception;
061    
062            public boolean hasImages(FileVersion fileVersion);
063    
064            public void importGeneratedFiles(
065                            PortletDataContext portletDataContext, FileEntry fileEntry,
066                            FileEntry importedFileEntry, Element fileEntryElement)
067                    throws Exception;
068    
069            public boolean isDocumentSupported(FileVersion fileVersion);
070    
071            public boolean isDocumentSupported(String mimeType);
072    
073            public boolean isImageMagickEnabled() throws Exception;
074    
075            public boolean isSupported(String mimeType);
076    
077            public void reset() throws Exception;
078    
079            public void trigger(FileVersion fileVersion);
080    
081    }