Liferay 6.1.0-ce-ga1

com.liferay.portlet.documentlibrary.util
Class DLPreviewableProcessor

java.lang.Object
  extended by com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor
All Implemented Interfaces:
DLProcessor
Direct Known Subclasses:
DefaultPreviewableProcessor, ImageProcessorImpl

public abstract class DLPreviewableProcessor
extends Object
implements DLProcessor


Field Summary
static String PREVIEW_PATH
           
static String PREVIEW_TMP_PATH
           
static long REPOSITORY_ID
           
static int THUMBNAIL_INDEX_CUSTOM_1
           
static int THUMBNAIL_INDEX_CUSTOM_2
           
static int THUMBNAIL_INDEX_DEFAULT
           
static String THUMBNAIL_PATH
           
static String THUMBNAIL_TMP_PATH
           
 
Constructor Summary
DLPreviewableProcessor()
           
 
Method Summary
protected  void addFileToStore(long companyId, String dirName, String filePath, File srcFile)
           
static void deleteFiles()
           
static void deleteFiles(FileEntry fileEntry, String thumbnailType)
           
static void deleteFiles(FileVersion fileVersion, String thumbnailType)
           
protected static void deleteFiles(long companyId, long groupId, long fileEntryId, long fileVersionId, String thumbnailType)
           
protected  InputStream doGetPreviewAsStream(FileVersion fileVersion, int index, String type)
           
protected  InputStream doGetPreviewAsStream(FileVersion fileVersion, String type)
           
protected  int doGetPreviewFileCount(FileVersion fileVersion)
           
protected  long doGetPreviewFileSize(FileVersion fileVersion, int index, String type)
           
protected  long doGetPreviewFileSize(FileVersion fileVersion, String type)
           
protected  InputStream doGetThumbnailAsStream(FileVersion fileVersion, int thumbnailIndex)
           
protected  long doGetThumbnailFileSize(FileVersion fileVersion, int thumbnailIndex)
           
protected static String getPathSegment(FileVersion fileVersion, boolean preview)
           
protected static String getPathSegment(long groupId, long fileEntryId, long fileVersionId, boolean preview)
           
protected  String getPreviewFilePath(FileVersion fileVersion, int index, String type)
           
protected  String getPreviewFilePath(FileVersion fileVersion, String type)
           
protected  File getPreviewTempFile(String id, int index, String type)
           
protected  File getPreviewTempFile(String id, String type)
           
protected  int getPreviewTempFileCount(FileVersion fileVersion, String type)
           
protected  String getPreviewTempFilePath(String id, int index, String type)
           
protected  String getPreviewTempFilePath(String id, String type)
           
protected abstract  String getPreviewType(FileVersion fileVersion)
           
protected  String getThumbnailFilePath(FileVersion fileVersion, String type, int index)
           
protected  File getThumbnailTempFile(String id, String type)
           
protected  String getThumbnailTempFilePath(String id, String type)
           
protected abstract  String getThumbnailType(FileVersion fileVersion)
           
protected  boolean hasThumbnail(FileVersion fileVersion, int thumbnailIndex)
           
protected  boolean isCustomThumbnailsEnabled(int thumbnailIndex)
           
 boolean isSupported(FileVersion fileVersion)
           
protected  void storeThumbnailImages(FileVersion fileVersion, File file)
           
protected  void storeThumbnailImages(FileVersion fileVersion, RenderedImage renderedImage)
           
protected  void storeThumbnailmage(FileVersion fileVersion, RenderedImage renderedImage, int thumbnailIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.liferay.portlet.documentlibrary.util.DLProcessor
cleanUp, cleanUp, isSupported, trigger
 

Field Detail

PREVIEW_PATH

public static final String PREVIEW_PATH
See Also:
Constant Field Values

PREVIEW_TMP_PATH

public static final String PREVIEW_TMP_PATH

REPOSITORY_ID

public static final long REPOSITORY_ID
See Also:
Constant Field Values

THUMBNAIL_INDEX_CUSTOM_1

public static int THUMBNAIL_INDEX_CUSTOM_1

THUMBNAIL_INDEX_CUSTOM_2

public static int THUMBNAIL_INDEX_CUSTOM_2

THUMBNAIL_INDEX_DEFAULT

public static int THUMBNAIL_INDEX_DEFAULT

THUMBNAIL_PATH

public static final String THUMBNAIL_PATH
See Also:
Constant Field Values

THUMBNAIL_TMP_PATH

public static final String THUMBNAIL_TMP_PATH
Constructor Detail

DLPreviewableProcessor

public DLPreviewableProcessor()
Method Detail

deleteFiles

public static void deleteFiles()

deleteFiles

public static void deleteFiles(FileEntry fileEntry,
                               String thumbnailType)

deleteFiles

public static void deleteFiles(FileVersion fileVersion,
                               String thumbnailType)

deleteFiles

protected static void deleteFiles(long companyId,
                                  long groupId,
                                  long fileEntryId,
                                  long fileVersionId,
                                  String thumbnailType)

getPathSegment

protected static String getPathSegment(FileVersion fileVersion,
                                       boolean preview)

getPathSegment

protected static String getPathSegment(long groupId,
                                       long fileEntryId,
                                       long fileVersionId,
                                       boolean preview)

isSupported

public boolean isSupported(FileVersion fileVersion)
Specified by:
isSupported in interface DLProcessor

addFileToStore

protected void addFileToStore(long companyId,
                              String dirName,
                              String filePath,
                              File srcFile)
                       throws Exception
Throws:
Exception

doGetPreviewAsStream

protected InputStream doGetPreviewAsStream(FileVersion fileVersion,
                                           int index,
                                           String type)
                                    throws Exception
Throws:
Exception

doGetPreviewAsStream

protected InputStream doGetPreviewAsStream(FileVersion fileVersion,
                                           String type)
                                    throws Exception
Throws:
Exception

doGetPreviewFileCount

protected int doGetPreviewFileCount(FileVersion fileVersion)
                             throws Exception
Throws:
Exception

doGetPreviewFileSize

protected long doGetPreviewFileSize(FileVersion fileVersion,
                                    int index,
                                    String type)
                             throws Exception
Throws:
Exception

doGetPreviewFileSize

protected long doGetPreviewFileSize(FileVersion fileVersion,
                                    String type)
                             throws Exception
Throws:
Exception

doGetThumbnailAsStream

protected InputStream doGetThumbnailAsStream(FileVersion fileVersion,
                                             int thumbnailIndex)
                                      throws Exception
Throws:
Exception

doGetThumbnailFileSize

protected long doGetThumbnailFileSize(FileVersion fileVersion,
                                      int thumbnailIndex)
                               throws Exception
Throws:
Exception

getPreviewFilePath

protected String getPreviewFilePath(FileVersion fileVersion,
                                    int index,
                                    String type)

getPreviewFilePath

protected String getPreviewFilePath(FileVersion fileVersion,
                                    String type)

getPreviewTempFile

protected File getPreviewTempFile(String id,
                                  int index,
                                  String type)

getPreviewTempFile

protected File getPreviewTempFile(String id,
                                  String type)

getPreviewTempFileCount

protected int getPreviewTempFileCount(FileVersion fileVersion,
                                      String type)

getPreviewTempFilePath

protected String getPreviewTempFilePath(String id,
                                        int index,
                                        String type)

getPreviewTempFilePath

protected String getPreviewTempFilePath(String id,
                                        String type)

getPreviewType

protected abstract String getPreviewType(FileVersion fileVersion)

getThumbnailFilePath

protected String getThumbnailFilePath(FileVersion fileVersion,
                                      String type,
                                      int index)

getThumbnailTempFile

protected File getThumbnailTempFile(String id,
                                    String type)

getThumbnailTempFilePath

protected String getThumbnailTempFilePath(String id,
                                          String type)

getThumbnailType

protected abstract String getThumbnailType(FileVersion fileVersion)

hasThumbnail

protected boolean hasThumbnail(FileVersion fileVersion,
                               int thumbnailIndex)

isCustomThumbnailsEnabled

protected boolean isCustomThumbnailsEnabled(int thumbnailIndex)
                                     throws Exception
Throws:
Exception

storeThumbnailImages

protected void storeThumbnailImages(FileVersion fileVersion,
                                    File file)
                             throws Exception
Throws:
Exception

storeThumbnailImages

protected void storeThumbnailImages(FileVersion fileVersion,
                                    RenderedImage renderedImage)
                             throws Exception
Throws:
Exception

storeThumbnailmage

protected void storeThumbnailmage(FileVersion fileVersion,
                                  RenderedImage renderedImage,
                                  int thumbnailIndex)
                           throws Exception
Throws:
Exception

Liferay 6.1.0-ce-ga1