Liferay 6.1.0-ce-b4

com.liferay.portlet.documentlibrary.util
Class RawMetadataProcessor

java.lang.Object
  extended by com.liferay.portlet.documentlibrary.util.RawMetadataProcessor
All Implemented Interfaces:
DLProcessor

public class RawMetadataProcessor
extends Object
implements DLProcessor

Document library processor responsible for the generation of raw metadata associated with all of the the files stored in the document library.

This processor automatically and assynchronously extracts the metadata from all of the files stored in the document library. The metadata extraction is done with the help of TikaRawMetadataProcessor


Constructor Summary
RawMetadataProcessor()
           
 
Method Summary
 void cleanUp(FileEntry fileEntry)
           
 void cleanUp(FileVersion fileVersion)
           
static void generateMetadata(FileVersion fileVersion)
          Generates the raw metadata associated with the file entry.
 boolean isSupported(FileVersion fileVersion)
           
 boolean isSupported(String mimeType)
           
static void saveMetadata(FileVersion fileVersion)
          Saves the raw metadata present in the file version.
 void trigger(FileVersion fileVersion)
          Launches extraction of raw metadata from the file version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawMetadataProcessor

public RawMetadataProcessor()
Method Detail

cleanUp

public void cleanUp(FileEntry fileEntry)
Specified by:
cleanUp in interface DLProcessor

cleanUp

public void cleanUp(FileVersion fileVersion)
Specified by:
cleanUp in interface DLProcessor

generateMetadata

public static void generateMetadata(FileVersion fileVersion)
                             throws PortalException,
                                    SystemException
Generates the raw metadata associated with the file entry.

Parameters:
fileVersion - the file version from which the raw metatada is to be generated
Throws:
PortalException - if an error occurred in the metadata extraction
SystemException - if a system exception occurred

isSupported

public boolean isSupported(FileVersion fileVersion)
Specified by:
isSupported in interface DLProcessor

isSupported

public boolean isSupported(String mimeType)
Specified by:
isSupported in interface DLProcessor

saveMetadata

public static void saveMetadata(FileVersion fileVersion)
                         throws PortalException,
                                SystemException
Saves the raw metadata present in the file version.

The raw metadata present in the file version is extracted and persisted using TikaRawMetadataProcessor.

Parameters:
fileVersion - the file version from which the raw metatada is to be extracted and persisted
Throws:
PortalException - if an error occurred in the metadata extraction
SystemException - if a system exception occurred

trigger

public void trigger(FileVersion fileVersion)
Launches extraction of raw metadata from the file version.

The raw metadata extraction is done asynchronously.

Specified by:
trigger in interface DLProcessor
Parameters:
fileVersion - the latest file version from which the raw metadata is to be generated

Liferay 6.1.0-ce-b4