com.liferay.portlet.documentlibrary.util
Class PDFProcessorImpl

java.lang.Object
  extended by com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor
      extended by com.liferay.portlet.documentlibrary.util.DefaultPreviewableProcessor
          extended by com.liferay.portlet.documentlibrary.util.PDFProcessorImpl
All Implemented Interfaces:
com.liferay.portlet.documentlibrary.util.DLProcessor, com.liferay.portlet.documentlibrary.util.PDFProcessor

public class PDFProcessorImpl
extends com.liferay.portlet.documentlibrary.util.DefaultPreviewableProcessor
implements com.liferay.portlet.documentlibrary.util.PDFProcessor

Author:
Alexander Chow, Mika Koivisto, Juan González, Sergio González

Field Summary
 
Fields inherited from class com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor
PREVIEW_PATH, PREVIEW_TMP_PATH, REPOSITORY_ID, THUMBNAIL_INDEX_CUSTOM_1, THUMBNAIL_INDEX_CUSTOM_2, THUMBNAIL_INDEX_DEFAULT, THUMBNAIL_PATH, THUMBNAIL_TMP_PATH
 
Fields inherited from interface com.liferay.portlet.documentlibrary.util.PDFProcessor
PREVIEW_TYPE, THUMBNAIL_TYPE
 
Method Summary
 void generateImages(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 java.lang.String getGlobalSearchPath()
           
static PDFProcessorImpl getInstance()
           
 java.io.InputStream getPreviewAsStream(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, int index)
           
 int getPreviewFileCount(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 long getPreviewFileSize(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, int index)
           
protected  java.lang.String getPreviewType(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 java.io.InputStream getThumbnailAsStream(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, int thumbnailIndex)
           
 long getThumbnailFileSize(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, int thumbnailIndex)
           
protected  java.lang.String getThumbnailType(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 boolean hasImages(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
protected  void initialize()
           
 boolean isDocumentSupported(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 boolean isDocumentSupported(java.lang.String mimeType)
           
 boolean isImageMagickEnabled()
           
 boolean isSupported(java.lang.String mimeType)
           
 void reset()
           
 void trigger(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 
Methods inherited from class com.liferay.portlet.documentlibrary.util.DefaultPreviewableProcessor
cleanUp, cleanUp, doGetPreviewAsStream, doGetPreviewAsStream, doGetPreviewFileSize, doGetPreviewFileSize, getPreviewFilePath, getPreviewFilePath, getPreviewTempFile, getPreviewTempFile, getPreviewTempFileCount, getPreviewTempFilePath, getPreviewTempFilePath, getPreviewType, getPreviewType, getPreviewTypes, getThumbnailFilePath, getThumbnailTempFile, getThumbnailTempFilePath, getThumbnailType
 
Methods inherited from class com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor
addFileToStore, deleteFiles, deleteFiles, deleteFiles, deleteFiles, doGetPreviewAsStream, doGetPreviewAsStream, doGetPreviewFileCount, doGetPreviewFileSize, doGetPreviewFileSize, doGetThumbnailAsStream, doGetThumbnailFileSize, getPathSegment, getPathSegment, getPreviewFilePath, getPreviewFilePath, getPreviewTempFile, getPreviewTempFile, getPreviewTempFileCount, getPreviewTempFilePath, getPreviewTempFilePath, getThumbnailFilePath, getThumbnailTempFile, getThumbnailTempFilePath, hasThumbnail, isCustomThumbnailsEnabled, isSupported, storeThumbnailImages, storeThumbnailImages, storeThumbnailmage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PDFProcessorImpl getInstance()

generateImages

public void generateImages(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
                    throws java.lang.Exception
Specified by:
generateImages in interface com.liferay.portlet.documentlibrary.util.PDFProcessor
Throws:
java.lang.Exception

getGlobalSearchPath

public java.lang.String getGlobalSearchPath()
                                     throws java.lang.Exception
Specified by:
getGlobalSearchPath in interface com.liferay.portlet.documentlibrary.util.PDFProcessor
Throws:
java.lang.Exception

getPreviewAsStream

public java.io.InputStream getPreviewAsStream(com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
                                              int index)
                                       throws java.lang.Exception
Specified by:
getPreviewAsStream in interface com.liferay.portlet.documentlibrary.util.PDFProcessor
Throws:
java.lang.Exception

getPreviewFileCount

public int getPreviewFileCount(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
getPreviewFileCount in interface com.liferay.portlet.documentlibrary.util.PDFProcessor

getPreviewFileSize

public long getPreviewFileSize(com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
                               int index)
                        throws java.lang.Exception
Specified by:
getPreviewFileSize in interface com.liferay.portlet.documentlibrary.util.PDFProcessor
Throws:
java.lang.Exception

getThumbnailAsStream

public java.io.InputStream getThumbnailAsStream(com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
                                                int thumbnailIndex)
                                         throws java.lang.Exception
Specified by:
getThumbnailAsStream in interface com.liferay.portlet.documentlibrary.util.PDFProcessor
Throws:
java.lang.Exception

getThumbnailFileSize

public long getThumbnailFileSize(com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
                                 int thumbnailIndex)
                          throws java.lang.Exception
Specified by:
getThumbnailFileSize in interface com.liferay.portlet.documentlibrary.util.PDFProcessor
Throws:
java.lang.Exception

hasImages

public boolean hasImages(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
hasImages in interface com.liferay.portlet.documentlibrary.util.PDFProcessor

isDocumentSupported

public boolean isDocumentSupported(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
isDocumentSupported in interface com.liferay.portlet.documentlibrary.util.PDFProcessor

isDocumentSupported

public boolean isDocumentSupported(java.lang.String mimeType)
Specified by:
isDocumentSupported in interface com.liferay.portlet.documentlibrary.util.PDFProcessor

isImageMagickEnabled

public boolean isImageMagickEnabled()
                             throws java.lang.Exception
Specified by:
isImageMagickEnabled in interface com.liferay.portlet.documentlibrary.util.PDFProcessor
Throws:
java.lang.Exception

isSupported

public boolean isSupported(java.lang.String mimeType)
Specified by:
isSupported in interface com.liferay.portlet.documentlibrary.util.DLProcessor
Specified by:
isSupported in interface com.liferay.portlet.documentlibrary.util.PDFProcessor

reset

public void reset()
           throws java.lang.Exception
Specified by:
reset in interface com.liferay.portlet.documentlibrary.util.PDFProcessor
Throws:
java.lang.Exception

trigger

public void trigger(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
trigger in interface com.liferay.portlet.documentlibrary.util.DLProcessor
Specified by:
trigger in interface com.liferay.portlet.documentlibrary.util.PDFProcessor

getPreviewType

protected java.lang.String getPreviewType(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
getPreviewType in class com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor

getThumbnailType

protected java.lang.String getThumbnailType(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
getThumbnailType in class com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor

initialize

protected void initialize()