public interface DLProcessor
DLProcessor
:
@Component(service = DLProcessor.class) public class MyDLProcessor implements DLProcessor { }Implementing classes are responsible for managing any storage required by the generated resources and for providing access to any generated assets. See current implementations for examples.
AudioProcessor
,
DLPreviewableProcessor
,
ImageProcessor
,
PDFProcessor
,
RawMetadataProcessor
,
VideoProcessor
Modifier and Type | Method and Description |
---|---|
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.
|
void |
copy(FileVersion sourceFileVersion,
FileVersion destinationFileVersion)
Copies all resources generated for the source file version, reusing them
for destination file version.
|
default void |
destroy() |
void |
exportGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
Element fileEntryElement)
Exports any resources generated for the file entry into file entry
element.
|
String |
getType()
Returns the processor's type.
|
void |
importGeneratedFiles(PortletDataContext portletDataContext,
FileEntry fileEntry,
FileEntry importedFileEntry,
Element fileEntryElement)
Imports any existing resources from the file entry or file entry element.
|
boolean |
isSupported(FileVersion fileVersion)
Returns
true if the file version is supported by this
processor. |
boolean |
isSupported(String mimeType)
Returns
true if the given file MIME type is supported by
this processor. |
void |
trigger(FileVersion sourceFileVersion,
FileVersion destinationFileVersion)
Launches the processor's work with respect to the destination file
version.
|
void afterPropertiesSet() throws Exception
Exception
void cleanUp(FileEntry fileEntry)
fileEntry
- the file entry for which resources are cleaned upvoid cleanUp(FileVersion fileVersion)
cleanUp(FileEntry)
if you want to clean up everything.fileVersion
- the file version for which resources will be cleaned
upvoid copy(FileVersion sourceFileVersion, FileVersion destinationFileVersion)
sourceFileVersion
- the file version to copy resources fromdestinationFileVersion
- the file version to copy resources todefault void destroy() throws Exception
Exception
void exportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement) throws Exception
portletDataContext
- 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 intoException
- if an error occurred while exporting the file entry
resourcesString getType()
com.liferay.portlet.documentlibrary.model.DLProcessorConstants
for the
set of predefined processor types.void importGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry, FileEntry importedFileEntry, Element fileEntryElement) throws Exception
PortletDataContext.isPerformDirectBinaryImport()
), the resources are
directly copied from the file entry; otherwise, they're extracted from
the file entry element.portletDataContext
- 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 supportedException
- if an error occurred while importing the file entry
resourcesboolean isSupported(FileVersion fileVersion)
true
if the file version is supported by this
processor.fileVersion
- the file versiontrue
if this processor supports the file version;
false
otherwiseboolean isSupported(String mimeType)
true
if the given file MIME type is supported by
this processor.mimeType
- the MIME typetrue
if this processor supports the MIME type;
false
otherwisevoid trigger(FileVersion sourceFileVersion, FileVersion destinationFileVersion)
sourceFileVersion
- the file version to copy previews and thumbnails
from (optionally null
)destinationFileVersion
- the latest file version to process