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.| 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.
|
java.lang.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(java.lang.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 java.lang.Exception
java.lang.Exceptionvoid 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 java.lang.Exception
java.lang.Exceptionvoid exportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement) throws java.lang.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 intojava.lang.Exception - if an error occurred while exporting the file entry
resourcesjava.lang.String 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 java.lang.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 supportedjava.lang.Exception - 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(java.lang.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