org.dspace.app.mediafilter
Class MediaFilterManager

java.lang.Object
  extended by org.dspace.app.mediafilter.MediaFilterManager

public class MediaFilterManager
extends Object

MediaFilterManager is the class that invokes the media/format filters over the repository's content. a few command line flags affect the operation of the MFM: -v verbose outputs all extracted text to STDOUT; -f force forces all bitstreams to be processed, even if they have been before; -n noindex does not recreate index after processing bitstreams; -i [identifier] limits processing scope to a community, collection or item; and -m [max] limits processing to a maximum number of items.


Field Summary
static String FILTER_PLUGIN_SEPARATOR
           
static String FILTER_PREFIX
           
static String identifier
           
static String INPUT_FORMATS_SUFFIX
           
static boolean isForce
           
static boolean isQuiet
           
static boolean isVerbose
           
static int max2Process
           
static String MEDIA_FILTER_PLUGINS_KEY
           
static int processed
           
static boolean updateIndex
           
 
Constructor Summary
MediaFilterManager()
           
 
Method Summary
static void applyFiltersAllItems(Context c)
           
static void applyFiltersCollection(Context c, Collection collection)
           
static void applyFiltersCommunity(Context c, Community community)
           
static void applyFiltersItem(Context c, Item item)
           
static boolean filterBitstream(Context c, Item myItem, Bitstream myBitstream)
          Attempt to filter a bitstream An exception will be thrown if the media filter class cannot be instantiated, exceptions from filtering will be logged to STDOUT and swallowed.
static boolean filterItem(Context c, Item myItem)
          iterate through the item's bitstreams in the ORIGINAL bundle, applying filters if possible
static Item getCurrentItem()
          Return the item that is currently being processed/filtered by the MediaFilterManager
static boolean inSkipList(String identifier)
          Check whether or not to skip processing the given identifier
static void main(String[] argv)
           
static boolean processBitstream(Context c, Item item, Bitstream source, FormatFilter formatFilter)
          processBitstream is a utility class that calls the virtual methods from the current MediaFilter class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEDIA_FILTER_PLUGINS_KEY

public static String MEDIA_FILTER_PLUGINS_KEY

FILTER_PREFIX

public static String FILTER_PREFIX

INPUT_FORMATS_SUFFIX

public static String INPUT_FORMATS_SUFFIX

updateIndex

public static boolean updateIndex

isVerbose

public static boolean isVerbose

isQuiet

public static boolean isQuiet

isForce

public static boolean isForce

identifier

public static String identifier

max2Process

public static int max2Process

processed

public static int processed

FILTER_PLUGIN_SEPARATOR

public static String FILTER_PLUGIN_SEPARATOR
Constructor Detail

MediaFilterManager

public MediaFilterManager()
Method Detail

main

public static void main(String[] argv)
                 throws Exception
Throws:
Exception

applyFiltersAllItems

public static void applyFiltersAllItems(Context c)
                                 throws Exception
Throws:
Exception

applyFiltersCommunity

public static void applyFiltersCommunity(Context c,
                                         Community community)
                                  throws Exception
Throws:
Exception

applyFiltersCollection

public static void applyFiltersCollection(Context c,
                                          Collection collection)
                                   throws Exception
Throws:
Exception

applyFiltersItem

public static void applyFiltersItem(Context c,
                                    Item item)
                             throws Exception
Throws:
Exception

filterItem

public static boolean filterItem(Context c,
                                 Item myItem)
                          throws Exception
iterate through the item's bitstreams in the ORIGINAL bundle, applying filters if possible

Returns:
true if any bitstreams processed, false if none
Throws:
Exception

filterBitstream

public static boolean filterBitstream(Context c,
                                      Item myItem,
                                      Bitstream myBitstream)
                               throws Exception
Attempt to filter a bitstream An exception will be thrown if the media filter class cannot be instantiated, exceptions from filtering will be logged to STDOUT and swallowed.

Returns:
true if bitstream processed, false if no applicable filter or already processed
Throws:
Exception

processBitstream

public static boolean processBitstream(Context c,
                                       Item item,
                                       Bitstream source,
                                       FormatFilter formatFilter)
                                throws Exception
processBitstream is a utility class that calls the virtual methods from the current MediaFilter class. It scans the bitstreams in an item, and decides if a bitstream has already been filtered, and if not or if overWrite is set, invokes the filter.

Parameters:
c - context
item - item containing bitstream to process
source - source bitstream to process
formatFilter - FormatFilter to perform filtering
Returns:
true if new rendition is created, false if rendition already exists and overWrite is not set
Throws:
Exception

getCurrentItem

public static Item getCurrentItem()
Return the item that is currently being processed/filtered by the MediaFilterManager

This allows FormatFilters to retrieve the Item object in case they need access to item-level information for their format transformations/conversions.

Returns:
current Item being processed by MediaFilterManager

inSkipList

public static boolean inSkipList(String identifier)
Check whether or not to skip processing the given identifier

Parameters:
identifier - identifier (handle) of a community, collection or item
Returns:
true if this community, collection or item should be skipped during processing. Otherwise, return false.


Copyright © 2010 DuraSpace. All Rights Reserved.