com.liferay.portlet.documentlibrary.util
Class ImageProcessorImpl
java.lang.Object
com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor
com.liferay.portlet.documentlibrary.util.ImageProcessorImpl
- All Implemented Interfaces:
- DLProcessor, ImageProcessor
public class ImageProcessorImpl
- extends DLPreviewableProcessor
- implements ImageProcessor
|
Method Summary |
void |
afterPropertiesSet()
|
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. |
protected void |
doExportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement)
|
protected void |
doImportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement)
|
protected void |
exportPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement)
|
void |
generateImages(FileVersion sourceFileVersion,
FileVersion destinationFileVersion)
|
protected List<Long> |
getFileVersionIds()
|
Set<String> |
getImageMimeTypes()
|
InputStream |
getPreviewAsStream(FileVersion fileVersion)
|
long |
getPreviewFileSize(FileVersion fileVersion)
|
String |
getPreviewType(FileVersion fileVersion)
|
InputStream |
getThumbnailAsStream(FileVersion fileVersion,
int index)
|
long |
getThumbnailFileSize(FileVersion fileVersion,
int index)
|
String |
getThumbnailType(FileVersion fileVersion)
|
String |
getType()
Returns the processor's type. |
boolean |
hasImages(FileVersion fileVersion)
|
boolean |
isImageSupported(FileVersion fileVersion)
|
boolean |
isImageSupported(String mimeType)
|
boolean |
isSupported(String mimeType)
Returns true if the given file MIME type is supported by
this processor. |
void |
storeThumbnail(long companyId,
long groupId,
long fileEntryId,
long fileVersionId,
long custom1ImageId,
long custom2ImageId,
InputStream is,
String type)
|
void |
trigger(FileVersion sourceFileVersion,
FileVersion destinationFileVersion)
Launches the processor's work with respect to the destination file
version. |
| Methods inherited from class com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor |
addFileToStore, addFileToStore, copy, copyPreviews, copyThumbnail, copyThumbnails, deleteFiles, deleteFiles, deleteFiles, deleteFiles, deletePreviews, deleteThumbnail, deleteThumbnails, destroyProcess, doGetPreviewAsStream, doGetPreviewAsStream, doGetPreviewFileCount, doGetPreviewFileSize, doGetPreviewFileSize, doGetPreviewFileSize, doGetThumbnailAsStream, doGetThumbnailFileSize, exportBinary, exportGeneratedFiles, exportPreview, exportPreview, exportThumbnail, exportThumbnails, getBinPath, getBinPath, getPathSegment, getPathSegment, getPreviewFilePath, getPreviewFilePath, getPreviewFilePath, getPreviewFilePath, getPreviewFilePath, getPreviewFilePath, getPreviewTempFile, getPreviewTempFile, getPreviewTempFile, getPreviewTempFile, getPreviewTempFileCount, getPreviewTempFileCount, getPreviewTempFilePath, getPreviewTempFilePath, getPreviewTempFilePath, getPreviewTempFilePath, getPreviewType, getPreviewType, getPreviewTypes, getThumbnailFilePath, getThumbnailFilePath, getThumbnailFilePath, getThumbnailTempFile, getThumbnailTempFile, getThumbnailTempFilePath, getThumbnailTempFilePath, getThumbnailType, hasPreview, hasPreviews, hasThumbnail, hasThumbnails, importGeneratedFiles, importPreview, importPreview, importPreviewFromLAR, importThumbnail, importThumbnailFromLAR, importThumbnails, isSupported, isThumbnailEnabled, sendGenerationMessage, storeThumbnailImage, storeThumbnailImages, storeThumbnailImages |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ImageProcessorImpl
public ImageProcessorImpl()
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet in interface DLProcessor
cleanUp
public void cleanUp(FileEntry fileEntry)
- Description copied from interface:
DLProcessor
- Cleans up any resources that the processor created for the file entry.
Note that all resources for all file versions of this file entry are
permanently deleted.
- Specified by:
cleanUp in interface DLProcessor- Specified by:
cleanUp in interface ImageProcessor- Overrides:
cleanUp in class DLPreviewableProcessor
- Parameters:
fileEntry - the file entry for which resources are cleaned up
cleanUp
public void cleanUp(FileVersion fileVersion)
- Description copied from interface:
DLProcessor
- Cleans up any resources that the processor created for the given file
version. Note that other resources associated with other file versions
for the same file entry aren't affected; use
DLProcessor.cleanUp(FileEntry)
if you want to clean up everything.
- Specified by:
cleanUp in interface DLProcessor- Specified by:
cleanUp in interface ImageProcessor- Overrides:
cleanUp in class DLPreviewableProcessor
- Parameters:
fileVersion - the file version for which resources will be cleaned
up
generateImages
public void generateImages(FileVersion sourceFileVersion,
FileVersion destinationFileVersion)
throws Exception
- Specified by:
generateImages in interface ImageProcessor
- Throws:
Exception
getImageMimeTypes
public Set<String> getImageMimeTypes()
- Specified by:
getImageMimeTypes in interface ImageProcessor
getPreviewAsStream
public InputStream getPreviewAsStream(FileVersion fileVersion)
throws Exception
- Specified by:
getPreviewAsStream in interface ImageProcessor
- Throws:
Exception
getPreviewFileSize
public long getPreviewFileSize(FileVersion fileVersion)
throws Exception
- Specified by:
getPreviewFileSize in interface ImageProcessor
- Throws:
Exception
getPreviewType
public String getPreviewType(FileVersion fileVersion)
- Specified by:
getPreviewType in interface ImageProcessor- Specified by:
getPreviewType in class DLPreviewableProcessor
getThumbnailAsStream
public InputStream getThumbnailAsStream(FileVersion fileVersion,
int index)
throws Exception
- Specified by:
getThumbnailAsStream in interface ImageProcessor
- Throws:
Exception
getThumbnailFileSize
public long getThumbnailFileSize(FileVersion fileVersion,
int index)
throws Exception
- Specified by:
getThumbnailFileSize in interface ImageProcessor
- Throws:
Exception
getThumbnailType
public String getThumbnailType(FileVersion fileVersion)
- Specified by:
getThumbnailType in interface ImageProcessor- Specified by:
getThumbnailType in class DLPreviewableProcessor
getType
public String getType()
- Description copied from interface:
DLProcessor
- Returns the processor's type. See
DLProcessorConstants for the
set of predefined processor types.
- Specified by:
getType in interface DLProcessor
- Returns:
- the type of this processor
hasImages
public boolean hasImages(FileVersion fileVersion)
- Specified by:
hasImages in interface ImageProcessor
isImageSupported
public boolean isImageSupported(FileVersion fileVersion)
- Specified by:
isImageSupported in interface ImageProcessor
isImageSupported
public boolean isImageSupported(String mimeType)
- Specified by:
isImageSupported in interface ImageProcessor
isSupported
public boolean isSupported(String mimeType)
- Description copied from interface:
DLProcessor
- Returns
true if the given file MIME type is supported by
this processor.
- Specified by:
isSupported in interface DLProcessor- Specified by:
isSupported in interface ImageProcessor
- Parameters:
mimeType - the MIME type
- Returns:
true if this processor supports the MIME type;
false otherwise
storeThumbnail
public void storeThumbnail(long companyId,
long groupId,
long fileEntryId,
long fileVersionId,
long custom1ImageId,
long custom2ImageId,
InputStream is,
String type)
throws Exception
- Specified by:
storeThumbnail in interface ImageProcessor
- Throws:
Exception
trigger
public void trigger(FileVersion sourceFileVersion,
FileVersion destinationFileVersion)
- Description copied from interface:
DLProcessor
- Launches the processor's work with respect to the destination file
version.
- Specified by:
trigger in interface DLProcessor- Specified by:
trigger in interface ImageProcessor- Overrides:
trigger in class DLPreviewableProcessor
- Parameters:
sourceFileVersion - the file version to copy previews and thumbnails
from (optionally null)destinationFileVersion - the latest file version to process
doExportGeneratedFiles
protected void doExportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement)
throws Exception
- Specified by:
doExportGeneratedFiles in class DLPreviewableProcessor
- Throws:
Exception
doImportGeneratedFiles
protected void doImportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement)
throws Exception
- Specified by:
doImportGeneratedFiles in class DLPreviewableProcessor
- Throws:
Exception
exportPreview
protected void exportPreview(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement)
throws Exception
- Throws:
Exception
getFileVersionIds
protected List<Long> getFileVersionIds()
- Specified by:
getFileVersionIds in class DLPreviewableProcessor