com.liferay.portlet.documentlibrary.util
Class DLPreviewableProcessor
java.lang.Object
com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor
- All Implemented Interfaces:
- DLProcessor
public abstract class DLPreviewableProcessor
- extends Object
- implements DLProcessor
Method Summary |
protected void |
addFileToStore(long companyId,
String dirName,
String filePath,
File srcFile)
|
protected void |
addFileToStore(long companyId,
String dirName,
String filePath,
InputStream is)
|
void |
cleanUp(FileEntry fileEntry)
|
void |
cleanUp(FileVersion fileVersion)
|
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 abstract void |
doExportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement)
|
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)
|
protected long |
doGetPreviewFileSize(FileVersion fileVersion,
int index,
String type)
|
protected long |
doGetPreviewFileSize(FileVersion fileVersion,
String type)
|
protected InputStream |
doGetThumbnailAsStream(FileVersion fileVersion,
int index)
|
protected long |
doGetThumbnailFileSize(FileVersion fileVersion,
int index)
|
protected abstract void |
doImportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement)
|
protected void |
exportBinary(PortletDataContext portletDataContext,
Element fileEntryElement,
FileVersion fileVersion,
InputStream is,
String binPath,
String binPathName)
|
void |
exportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement)
|
protected void |
exportPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathSuffix,
String previewType)
|
protected void |
exportPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathSuffix,
String previewType,
int fileIndex)
|
protected void |
exportThumbnail(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathName,
int index)
|
protected void |
exportThumbnails(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathSuffix)
|
protected String |
getBinPath(PortletDataContext portletDataContext,
FileEntry fileEntry,
int index)
|
protected String |
getBinPath(PortletDataContext portletDataContext,
FileEntry fileEntry,
String type)
|
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)
|
protected String |
getPreviewFilePath(FileVersion fileVersion,
int index)
|
protected String |
getPreviewFilePath(FileVersion fileVersion,
int index,
String type)
|
protected String |
getPreviewFilePath(FileVersion fileVersion,
String type)
|
protected File |
getPreviewTempFile(String id)
|
protected File |
getPreviewTempFile(String id,
int index)
|
protected File |
getPreviewTempFile(String id,
int index,
String type)
|
protected File |
getPreviewTempFile(String id,
String type)
|
protected int |
getPreviewTempFileCount(FileVersion fileVersion)
|
protected int |
getPreviewTempFileCount(FileVersion fileVersion,
String type)
|
protected String |
getPreviewTempFilePath(String id)
|
protected String |
getPreviewTempFilePath(String id,
int index)
|
protected String |
getPreviewTempFilePath(String id,
int index,
String type)
|
protected String |
getPreviewTempFilePath(String id,
String type)
|
protected String |
getPreviewType()
|
protected abstract String |
getPreviewType(FileVersion fileVersion)
|
protected String |
getPreviewType(int index)
|
protected String[] |
getPreviewTypes()
|
protected String |
getThumbnailFilePath(FileVersion fileVersion,
int index)
|
protected String |
getThumbnailFilePath(FileVersion fileVersion,
String type,
int index)
|
protected File |
getThumbnailTempFile(String id)
|
protected File |
getThumbnailTempFile(String id,
String type)
|
protected String |
getThumbnailTempFilePath(String id)
|
protected String |
getThumbnailTempFilePath(String id,
String type)
|
protected String |
getThumbnailType()
|
protected abstract String |
getThumbnailType(FileVersion fileVersion)
|
protected boolean |
hasPreview(FileVersion fileVersion,
String type)
|
protected boolean |
hasPreviews(FileVersion fileVersion)
|
protected boolean |
hasThumbnail(FileVersion fileVersion,
int index)
|
protected boolean |
hasThumbnails(FileVersion fileVersion)
|
void |
importGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement)
|
protected void |
importPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
String binPathSuffix,
String previewType)
|
protected void |
importPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
String binPathSuffix,
String previewType,
int fileIndex)
|
protected void |
importPreviewFromLAR(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathSuffix,
String previewType,
int fileIndex)
|
protected void |
importThumbnail(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
String binPathName,
int index)
|
protected void |
importThumbnailFromLAR(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathName,
int index)
|
protected void |
importThumbnails(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
String binPathSuffix)
|
boolean |
isSupported(FileVersion fileVersion)
|
protected boolean |
isThumbnailEnabled(int index)
|
protected void |
storeThumbnailImages(FileVersion fileVersion,
File file)
|
protected void |
storeThumbnailImages(FileVersion fileVersion,
RenderedImage renderedImage)
|
protected void |
storeThumbnailmage(FileVersion fileVersion,
RenderedImage renderedImage,
int index)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 final int THUMBNAIL_INDEX_CUSTOM_1
- See Also:
- Constant Field Values
THUMBNAIL_INDEX_CUSTOM_2
public static final int THUMBNAIL_INDEX_CUSTOM_2
- See Also:
- Constant Field Values
THUMBNAIL_INDEX_DEFAULT
public static final int THUMBNAIL_INDEX_DEFAULT
- See Also:
- Constant Field Values
THUMBNAIL_PATH
public static final String THUMBNAIL_PATH
- See Also:
- Constant Field Values
THUMBNAIL_TMP_PATH
public static final String THUMBNAIL_TMP_PATH
DLPreviewableProcessor
public DLPreviewableProcessor()
deleteFiles
public static void deleteFiles()
deleteFiles
public static void deleteFiles(FileEntry fileEntry,
String thumbnailType)
deleteFiles
public static void deleteFiles(FileVersion fileVersion,
String thumbnailType)
cleanUp
public void cleanUp(FileEntry fileEntry)
- Specified by:
cleanUp
in interface DLProcessor
cleanUp
public void cleanUp(FileVersion fileVersion)
- Specified by:
cleanUp
in interface DLProcessor
exportGeneratedFiles
public void exportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement)
throws Exception
- Specified by:
exportGeneratedFiles
in interface DLProcessor
- Throws:
Exception
importGeneratedFiles
public void importGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement)
throws Exception
- Specified by:
importGeneratedFiles
in interface DLProcessor
- Throws:
Exception
isSupported
public boolean isSupported(FileVersion fileVersion)
- Specified by:
isSupported
in interface DLProcessor
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)
addFileToStore
protected void addFileToStore(long companyId,
String dirName,
String filePath,
File srcFile)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
addFileToStore
protected void addFileToStore(long companyId,
String dirName,
String filePath,
InputStream is)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
doExportGeneratedFiles
protected abstract void doExportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement)
throws Exception
- Throws:
Exception
doGetPreviewAsStream
protected InputStream doGetPreviewAsStream(FileVersion fileVersion,
int index,
String type)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
doGetPreviewAsStream
protected InputStream doGetPreviewAsStream(FileVersion fileVersion,
String type)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
doGetPreviewFileCount
protected int doGetPreviewFileCount(FileVersion fileVersion)
throws Exception
- Throws:
Exception
doGetPreviewFileSize
protected long doGetPreviewFileSize(FileVersion fileVersion,
int index)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
doGetPreviewFileSize
protected long doGetPreviewFileSize(FileVersion fileVersion,
int index,
String type)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
doGetPreviewFileSize
protected long doGetPreviewFileSize(FileVersion fileVersion,
String type)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
doGetThumbnailAsStream
protected InputStream doGetThumbnailAsStream(FileVersion fileVersion,
int index)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
doGetThumbnailFileSize
protected long doGetThumbnailFileSize(FileVersion fileVersion,
int index)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
doImportGeneratedFiles
protected abstract void doImportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement)
throws Exception
- Throws:
Exception
exportBinary
protected void exportBinary(PortletDataContext portletDataContext,
Element fileEntryElement,
FileVersion fileVersion,
InputStream is,
String binPath,
String binPathName)
throws SystemException
- Throws:
SystemException
exportPreview
protected void exportPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathSuffix,
String previewType)
throws Exception
- Throws:
Exception
exportPreview
protected void exportPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathSuffix,
String previewType,
int fileIndex)
throws Exception
- Throws:
Exception
exportThumbnail
protected void exportThumbnail(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathName,
int index)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
exportThumbnails
protected void exportThumbnails(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathSuffix)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
getBinPath
protected String getBinPath(PortletDataContext portletDataContext,
FileEntry fileEntry,
int index)
getBinPath
protected String getBinPath(PortletDataContext portletDataContext,
FileEntry fileEntry,
String type)
getPreviewFilePath
protected String getPreviewFilePath(FileVersion fileVersion)
getPreviewFilePath
protected String getPreviewFilePath(FileVersion fileVersion,
int index)
getPreviewFilePath
protected String getPreviewFilePath(FileVersion fileVersion,
int index,
String type)
getPreviewFilePath
protected String getPreviewFilePath(FileVersion fileVersion,
String type)
getPreviewTempFile
protected File getPreviewTempFile(String id)
getPreviewTempFile
protected File getPreviewTempFile(String id,
int index)
getPreviewTempFile
protected File getPreviewTempFile(String id,
int index,
String type)
getPreviewTempFile
protected File getPreviewTempFile(String id,
String type)
getPreviewTempFileCount
protected int getPreviewTempFileCount(FileVersion fileVersion)
getPreviewTempFileCount
protected int getPreviewTempFileCount(FileVersion fileVersion,
String type)
getPreviewTempFilePath
protected String getPreviewTempFilePath(String id)
getPreviewTempFilePath
protected String getPreviewTempFilePath(String id,
int index)
getPreviewTempFilePath
protected String getPreviewTempFilePath(String id,
int index,
String type)
getPreviewTempFilePath
protected String getPreviewTempFilePath(String id,
String type)
getPreviewType
protected String getPreviewType()
getPreviewType
protected abstract String getPreviewType(FileVersion fileVersion)
getPreviewType
protected String getPreviewType(int index)
getPreviewTypes
protected String[] getPreviewTypes()
getThumbnailFilePath
protected String getThumbnailFilePath(FileVersion fileVersion,
int index)
getThumbnailFilePath
protected String getThumbnailFilePath(FileVersion fileVersion,
String type,
int index)
getThumbnailTempFile
protected File getThumbnailTempFile(String id)
getThumbnailTempFile
protected File getThumbnailTempFile(String id,
String type)
getThumbnailTempFilePath
protected String getThumbnailTempFilePath(String id)
getThumbnailTempFilePath
protected String getThumbnailTempFilePath(String id,
String type)
getThumbnailType
protected String getThumbnailType()
getThumbnailType
protected abstract String getThumbnailType(FileVersion fileVersion)
hasPreview
protected boolean hasPreview(FileVersion fileVersion,
String type)
throws Exception
- Throws:
Exception
hasPreviews
protected boolean hasPreviews(FileVersion fileVersion)
throws Exception
- Throws:
Exception
hasThumbnail
protected boolean hasThumbnail(FileVersion fileVersion,
int index)
hasThumbnails
protected boolean hasThumbnails(FileVersion fileVersion)
importPreview
protected void importPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
String binPathSuffix,
String previewType)
throws Exception
- Throws:
Exception
importPreview
protected void importPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
String binPathSuffix,
String previewType,
int fileIndex)
throws Exception
- Throws:
Exception
importPreviewFromLAR
protected void importPreviewFromLAR(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathSuffix,
String previewType,
int fileIndex)
throws Exception
- Throws:
Exception
importThumbnail
protected void importThumbnail(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
String binPathName,
int index)
throws Exception
- Throws:
Exception
importThumbnailFromLAR
protected void importThumbnailFromLAR(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
String binPathName,
int index)
throws Exception
- Throws:
Exception
importThumbnails
protected void importThumbnails(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
String binPathSuffix)
throws Exception
- Throws:
Exception
isThumbnailEnabled
protected boolean isThumbnailEnabled(int index)
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 index)
throws Exception
- Throws:
Exception