public abstract class DLPreviewableProcessor extends java.lang.Object implements DLProcessor
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.util.concurrent.Future<?>> |
futures |
static java.lang.String |
PREVIEW_PATH |
static java.lang.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 java.lang.String |
THUMBNAIL_PATH |
static java.lang.String |
THUMBNAIL_TMP_PATH |
| Constructor and Description |
|---|
DLPreviewableProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFileToStore(long companyId,
java.lang.String dirName,
java.lang.String filePath,
java.io.File srcFile) |
protected void |
addFileToStore(long companyId,
java.lang.String dirName,
java.lang.String filePath,
java.io.InputStream is) |
void |
cleanUp(FileEntry fileEntry)
Cleans up any resources that the processor created for the file entry.
|
void |
cleanUp(FileVersion fileVersion)
Cleans up any resources that the processor created for the given file
version.
|
void |
copy(FileVersion sourceFileVersion,
FileVersion destinationFileVersion)
Copies all resources generated for the source file version, reusing them
for destination file version.
|
protected void |
copyPreviews(FileVersion sourceFileVersion,
FileVersion destinationFileVersion) |
protected void |
copyThumbnail(FileVersion sourceFileVersion,
FileVersion destinationFileVersion,
int index) |
protected void |
copyThumbnails(FileVersion sourceFileVersion,
FileVersion destinationFileVersion) |
static void |
deleteFiles() |
void |
deleteFiles(FileEntry fileEntry,
java.lang.String thumbnailType) |
void |
deleteFiles(FileVersion fileVersion,
java.lang.String thumbnailType) |
protected void |
deleteFiles(long companyId,
long groupId,
long fileEntryId,
long fileVersionId,
java.lang.String thumbnailType) |
protected void |
deletePreviews(long companyId,
long groupId,
long fileEntryId,
long fileVersionId) |
protected void |
deleteThumbnail(long companyId,
long groupId,
long fileEntryId,
long fileVersionId,
java.lang.String thumbnailType,
int index) |
protected void |
deleteThumbnails(long companyId,
long groupId,
long fileEntryId,
long fileVersionId,
java.lang.String thumbnailType) |
protected void |
destroyProcess(java.lang.String processIdentity) |
protected abstract void |
doExportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement) |
protected java.io.InputStream |
doGetPreviewAsStream(FileVersion fileVersion,
int index,
java.lang.String type) |
protected java.io.InputStream |
doGetPreviewAsStream(FileVersion fileVersion,
java.lang.String type) |
protected int |
doGetPreviewFileCount(FileVersion fileVersion) |
protected long |
doGetPreviewFileSize(FileVersion fileVersion,
int index) |
protected long |
doGetPreviewFileSize(FileVersion fileVersion,
int index,
java.lang.String type) |
protected long |
doGetPreviewFileSize(FileVersion fileVersion,
java.lang.String type) |
protected java.io.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,
java.io.InputStream is,
java.lang.String binPath,
java.lang.String binPathName) |
void |
exportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement)
Exports any resources generated for the file entry into file entry
element.
|
protected void |
exportPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
java.lang.String binPathSuffix,
java.lang.String previewType) |
protected void |
exportPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
java.lang.String binPathSuffix,
java.lang.String previewType,
int fileIndex) |
protected void |
exportThumbnail(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
java.lang.String binPathName,
int index) |
protected void |
exportThumbnails(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
java.lang.String binPathSuffix) |
protected java.lang.String |
getBinPath(PortletDataContext portletDataContext,
FileEntry fileEntry,
int index) |
protected java.lang.String |
getBinPath(PortletDataContext portletDataContext,
FileEntry fileEntry,
java.lang.String type) |
protected abstract java.util.List<java.lang.Long> |
getFileVersionIds() |
protected static java.lang.String |
getPathSegment(FileVersion fileVersion,
boolean preview) |
protected static java.lang.String |
getPathSegment(long groupId,
long fileEntryId,
long fileVersionId,
boolean preview) |
protected java.lang.String |
getPreviewFilePath(FileVersion fileVersion) |
protected java.lang.String |
getPreviewFilePath(FileVersion fileVersion,
int index) |
protected java.lang.String |
getPreviewFilePath(FileVersion fileVersion,
int index,
java.lang.String type) |
protected java.lang.String |
getPreviewFilePath(FileVersion fileVersion,
java.lang.String type) |
protected java.lang.String |
getPreviewFilePath(long groupId,
long fileEntryId,
long fileVersionId,
int index,
java.lang.String type) |
protected java.lang.String |
getPreviewFilePath(long groupId,
long fileEntryId,
long fileVersionId,
java.lang.String type) |
protected java.io.File |
getPreviewTempFile(java.lang.String id) |
protected java.io.File |
getPreviewTempFile(java.lang.String id,
int index) |
protected java.io.File |
getPreviewTempFile(java.lang.String id,
int index,
java.lang.String type) |
protected java.io.File |
getPreviewTempFile(java.lang.String id,
java.lang.String type) |
protected int |
getPreviewTempFileCount(FileVersion fileVersion) |
protected int |
getPreviewTempFileCount(FileVersion fileVersion,
java.lang.String type) |
protected java.lang.String |
getPreviewTempFilePath(java.lang.String id) |
protected java.lang.String |
getPreviewTempFilePath(java.lang.String id,
int index) |
protected java.lang.String |
getPreviewTempFilePath(java.lang.String id,
int index,
java.lang.String type) |
protected java.lang.String |
getPreviewTempFilePath(java.lang.String id,
java.lang.String type) |
protected java.lang.String |
getPreviewType() |
protected abstract java.lang.String |
getPreviewType(FileVersion fileVersion) |
protected java.lang.String |
getPreviewType(int index) |
protected java.lang.String[] |
getPreviewTypes() |
protected java.lang.String |
getThumbnailFilePath(FileVersion fileVersion,
int index) |
protected java.lang.String |
getThumbnailFilePath(FileVersion fileVersion,
java.lang.String type,
int index) |
protected java.lang.String |
getThumbnailFilePath(long groupId,
long fileEntryId,
long fileVersionId,
java.lang.String thumbnailType,
int index) |
protected java.io.File |
getThumbnailTempFile(java.lang.String id) |
protected java.io.File |
getThumbnailTempFile(java.lang.String id,
java.lang.String type) |
protected java.lang.String |
getThumbnailTempFilePath(java.lang.String id) |
protected java.lang.String |
getThumbnailTempFilePath(java.lang.String id,
java.lang.String type) |
protected java.lang.String |
getThumbnailType() |
protected abstract java.lang.String |
getThumbnailType(FileVersion fileVersion) |
protected boolean |
hasPreview(FileVersion fileVersion,
java.lang.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)
Imports any existing resources from the file entry or file entry element.
|
protected void |
importPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
java.lang.String binPathSuffix,
java.lang.String previewType) |
protected void |
importPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
java.lang.String binPathSuffix,
java.lang.String previewType,
int fileIndex) |
protected void |
importPreviewFromLAR(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
java.lang.String binPathSuffix,
java.lang.String previewType,
int fileIndex) |
protected void |
importThumbnail(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
java.lang.String binPathName,
int index) |
protected void |
importThumbnailFromLAR(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement,
java.lang.String binPathName,
int index) |
protected void |
importThumbnails(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement,
java.lang.String binPathSuffix) |
boolean |
isSupported(FileVersion fileVersion)
Returns
true if the file version is supported by this
processor. |
protected boolean |
isThumbnailEnabled(int index) |
protected void |
sendGenerationMessage(java.lang.String destinationName,
FileVersion sourceFileVersion,
FileVersion destinationFileVersion) |
protected void |
storeThumbnailImage(FileVersion fileVersion,
java.awt.image.RenderedImage renderedImage,
int index) |
protected void |
storeThumbnailImages(FileVersion fileVersion,
java.io.File file) |
protected void |
storeThumbnailImages(FileVersion fileVersion,
java.awt.image.RenderedImage renderedImage) |
void |
trigger(FileVersion sourceFileVersion,
FileVersion destinationFileVersion)
Launches the processor's work with respect to the destination file
version.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterPropertiesSet, getType, isSupportedpublic static final java.lang.String PREVIEW_PATH
public static final java.lang.String PREVIEW_TMP_PATH
public static final long REPOSITORY_ID
public static final int THUMBNAIL_INDEX_CUSTOM_1
public static final int THUMBNAIL_INDEX_CUSTOM_2
public static final int THUMBNAIL_INDEX_DEFAULT
public static final java.lang.String THUMBNAIL_PATH
public static final java.lang.String THUMBNAIL_TMP_PATH
protected java.util.Map<java.lang.String,java.util.concurrent.Future<?>> futures
public static void deleteFiles()
public void cleanUp(FileEntry fileEntry)
DLProcessorcleanUp in interface DLProcessorfileEntry - the file entry for which resources are cleaned uppublic void cleanUp(FileVersion fileVersion)
DLProcessorDLProcessor.cleanUp(FileEntry)
if you want to clean up everything.cleanUp in interface DLProcessorfileVersion - the file version for which resources will be cleaned
uppublic void copy(FileVersion sourceFileVersion, FileVersion destinationFileVersion)
DLProcessorcopy in interface DLProcessorsourceFileVersion - the file version to copy resources fromdestinationFileVersion - the file version to copy resources topublic void deleteFiles(FileEntry fileEntry, java.lang.String thumbnailType)
public void deleteFiles(FileVersion fileVersion, java.lang.String thumbnailType)
public void exportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement) throws java.lang.Exception
DLProcessorexportGeneratedFiles in interface DLProcessorportletDataContext - the portlet data context to use during this
export operationfileEntry - the file entry for which resources are exportedfileEntryElement - the file entry element to save resources intojava.lang.Exception - if an error occurred while exporting the file entry
resourcespublic void importGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry, FileEntry importedFileEntry, Element fileEntryElement) throws java.lang.Exception
DLProcessorPortletDataContext.isPerformDirectBinaryImport()), the resources are
directly copied from the file entry; otherwise, they're extracted from
the file entry element.importGeneratedFiles in interface DLProcessorportletDataContext - the portlet data context to use during this
import operationfileEntry - the file entry to import resources from, if direct
binary import is supportedimportedFileEntry - the file entry for which resources are importedfileEntryElement - the file entry element to import resources from,
if direct binary import is not supportedjava.lang.Exception - if an error occurred while importing the file entry
resourcespublic boolean isSupported(FileVersion fileVersion)
DLProcessortrue if the file version is supported by this
processor.isSupported in interface DLProcessorfileVersion - the file versiontrue if this processor supports the file version;
false otherwisepublic void trigger(FileVersion sourceFileVersion, FileVersion destinationFileVersion)
DLProcessortrigger in interface DLProcessorsourceFileVersion - the file version to copy previews and thumbnails
from (optionally null)destinationFileVersion - the latest file version to processprotected static java.lang.String getPathSegment(FileVersion fileVersion, boolean preview)
protected static java.lang.String getPathSegment(long groupId,
long fileEntryId,
long fileVersionId,
boolean preview)
protected void addFileToStore(long companyId,
java.lang.String dirName,
java.lang.String filePath,
java.io.File srcFile)
throws PortalException
PortalExceptionprotected void addFileToStore(long companyId,
java.lang.String dirName,
java.lang.String filePath,
java.io.InputStream is)
throws PortalException
PortalExceptionprotected void copyPreviews(FileVersion sourceFileVersion, FileVersion destinationFileVersion)
protected void copyThumbnail(FileVersion sourceFileVersion, FileVersion destinationFileVersion, int index)
protected void copyThumbnails(FileVersion sourceFileVersion, FileVersion destinationFileVersion)
protected void deleteFiles(long companyId,
long groupId,
long fileEntryId,
long fileVersionId,
java.lang.String thumbnailType)
protected void deletePreviews(long companyId,
long groupId,
long fileEntryId,
long fileVersionId)
protected void deleteThumbnail(long companyId,
long groupId,
long fileEntryId,
long fileVersionId,
java.lang.String thumbnailType,
int index)
protected void deleteThumbnails(long companyId,
long groupId,
long fileEntryId,
long fileVersionId,
java.lang.String thumbnailType)
protected void destroyProcess(java.lang.String processIdentity)
protected abstract void doExportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement) throws java.lang.Exception
java.lang.Exceptionprotected java.io.InputStream doGetPreviewAsStream(FileVersion fileVersion, int index, java.lang.String type) throws PortalException
PortalExceptionprotected java.io.InputStream doGetPreviewAsStream(FileVersion fileVersion, java.lang.String type) throws PortalException
PortalExceptionprotected int doGetPreviewFileCount(FileVersion fileVersion) throws java.lang.Exception
java.lang.Exceptionprotected long doGetPreviewFileSize(FileVersion fileVersion, int index) throws PortalException
PortalExceptionprotected long doGetPreviewFileSize(FileVersion fileVersion, int index, java.lang.String type) throws PortalException
PortalExceptionprotected long doGetPreviewFileSize(FileVersion fileVersion, java.lang.String type) throws PortalException
PortalExceptionprotected java.io.InputStream doGetThumbnailAsStream(FileVersion fileVersion, int index) throws PortalException
PortalExceptionprotected long doGetThumbnailFileSize(FileVersion fileVersion, int index) throws PortalException
PortalExceptionprotected abstract void doImportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry, FileEntry importedFileEntry, Element fileEntryElement) throws java.lang.Exception
java.lang.Exceptionprotected void exportBinary(PortletDataContext portletDataContext, Element fileEntryElement, FileVersion fileVersion, java.io.InputStream is, java.lang.String binPath, java.lang.String binPathName)
protected void exportPreview(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement, java.lang.String binPathSuffix, java.lang.String previewType) throws java.lang.Exception
java.lang.Exceptionprotected void exportPreview(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement, java.lang.String binPathSuffix, java.lang.String previewType, int fileIndex) throws java.lang.Exception
java.lang.Exceptionprotected void exportThumbnail(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement, java.lang.String binPathName, int index) throws PortalException
PortalExceptionprotected void exportThumbnails(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement, java.lang.String binPathSuffix) throws PortalException
PortalExceptionprotected java.lang.String getBinPath(PortletDataContext portletDataContext, FileEntry fileEntry, int index)
protected java.lang.String getBinPath(PortletDataContext portletDataContext, FileEntry fileEntry, java.lang.String type)
protected abstract java.util.List<java.lang.Long> getFileVersionIds()
protected java.lang.String getPreviewFilePath(FileVersion fileVersion)
protected java.lang.String getPreviewFilePath(FileVersion fileVersion, int index)
protected java.lang.String getPreviewFilePath(FileVersion fileVersion, int index, java.lang.String type)
protected java.lang.String getPreviewFilePath(FileVersion fileVersion, java.lang.String type)
protected java.lang.String getPreviewFilePath(long groupId,
long fileEntryId,
long fileVersionId,
int index,
java.lang.String type)
protected java.lang.String getPreviewFilePath(long groupId,
long fileEntryId,
long fileVersionId,
java.lang.String type)
protected java.io.File getPreviewTempFile(java.lang.String id)
protected java.io.File getPreviewTempFile(java.lang.String id,
int index)
protected java.io.File getPreviewTempFile(java.lang.String id,
int index,
java.lang.String type)
protected java.io.File getPreviewTempFile(java.lang.String id,
java.lang.String type)
protected int getPreviewTempFileCount(FileVersion fileVersion)
protected int getPreviewTempFileCount(FileVersion fileVersion, java.lang.String type)
protected java.lang.String getPreviewTempFilePath(java.lang.String id)
protected java.lang.String getPreviewTempFilePath(java.lang.String id,
int index)
protected java.lang.String getPreviewTempFilePath(java.lang.String id,
int index,
java.lang.String type)
protected java.lang.String getPreviewTempFilePath(java.lang.String id,
java.lang.String type)
protected java.lang.String getPreviewType()
protected abstract java.lang.String getPreviewType(FileVersion fileVersion)
protected java.lang.String getPreviewType(int index)
protected java.lang.String[] getPreviewTypes()
protected java.lang.String getThumbnailFilePath(FileVersion fileVersion, int index)
protected java.lang.String getThumbnailFilePath(FileVersion fileVersion, java.lang.String type, int index)
protected java.lang.String getThumbnailFilePath(long groupId,
long fileEntryId,
long fileVersionId,
java.lang.String thumbnailType,
int index)
protected java.io.File getThumbnailTempFile(java.lang.String id)
protected java.io.File getThumbnailTempFile(java.lang.String id,
java.lang.String type)
protected java.lang.String getThumbnailTempFilePath(java.lang.String id)
protected java.lang.String getThumbnailTempFilePath(java.lang.String id,
java.lang.String type)
protected java.lang.String getThumbnailType()
protected abstract java.lang.String getThumbnailType(FileVersion fileVersion)
protected boolean hasPreview(FileVersion fileVersion, java.lang.String type) throws java.lang.Exception
java.lang.Exceptionprotected boolean hasPreviews(FileVersion fileVersion) throws java.lang.Exception
java.lang.Exceptionprotected boolean hasThumbnail(FileVersion fileVersion, int index)
protected boolean hasThumbnails(FileVersion fileVersion)
protected void importPreview(PortletDataContext portletDataContext, FileEntry fileEntry, FileEntry importedFileEntry, Element fileEntryElement, java.lang.String binPathSuffix, java.lang.String previewType) throws java.lang.Exception
java.lang.Exceptionprotected void importPreview(PortletDataContext portletDataContext, FileEntry fileEntry, FileEntry importedFileEntry, Element fileEntryElement, java.lang.String binPathSuffix, java.lang.String previewType, int fileIndex) throws java.lang.Exception
java.lang.Exceptionprotected void importPreviewFromLAR(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement, java.lang.String binPathSuffix, java.lang.String previewType, int fileIndex) throws java.lang.Exception
java.lang.Exceptionprotected void importThumbnail(PortletDataContext portletDataContext, FileEntry fileEntry, FileEntry importedFileEntry, Element fileEntryElement, java.lang.String binPathName, int index) throws java.lang.Exception
java.lang.Exceptionprotected void importThumbnailFromLAR(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement, java.lang.String binPathName, int index) throws java.lang.Exception
java.lang.Exceptionprotected void importThumbnails(PortletDataContext portletDataContext, FileEntry fileEntry, FileEntry importedFileEntry, Element fileEntryElement, java.lang.String binPathSuffix) throws java.lang.Exception
java.lang.Exceptionprotected boolean isThumbnailEnabled(int index)
protected void sendGenerationMessage(java.lang.String destinationName,
FileVersion sourceFileVersion,
FileVersion destinationFileVersion)
protected void storeThumbnailImage(FileVersion fileVersion, java.awt.image.RenderedImage renderedImage, int index) throws java.lang.Exception
java.lang.Exceptionprotected void storeThumbnailImages(FileVersion fileVersion, java.io.File file) throws java.lang.Exception
java.lang.Exceptionprotected void storeThumbnailImages(FileVersion fileVersion, java.awt.image.RenderedImage renderedImage) throws java.lang.Exception
java.lang.Exception