001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }