Interface MediaFilterService
-
- All Known Implementing Classes:
MediaFilterServiceImpl
public interface MediaFilterServiceMediaFilterManager 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
Fields Modifier and Type Field Description static StringFILTER_PLUGIN_SEPARATOR
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyFiltersAllItems(Context context)voidapplyFiltersCollection(Context context, Collection collection)voidapplyFiltersCommunity(Context context, Community community)voidapplyFiltersItem(Context c, Item item)booleanfilterBitstream(Context c, Item myItem, Bitstream myBitstream)Attempt to filter a bitstream.booleanfilterItem(Context context, Item myItem)Iterate through the item's bitstreams in the ORIGINAL bundle, applying filters if possible.ItemgetCurrentItem()Return the item that is currently being processed/filtered by the MediaFilterManager.booleaninSkipList(String identifier)Check whether or not to skip processing the given identifier.booleanprocessBitstream(Context context, Item item, Bitstream source, FormatFilter formatFilter)A utility class that calls the virtual methods from the current MediaFilter class.voidsetFilterClasses(List<FormatFilter> filterClasses)voidsetFilterFormats(Map<String,List<String>> filterFormats)voidsetForce(boolean isForce)voidsetLogHandler(DSpaceRunnableHandler handler)Set the log handler used in the DSpace scripts and processes frameworkvoidsetMax2Process(int max2Process)voidsetQuiet(boolean isQuiet)voidsetSkipList(List<String> skipList)voidsetVerbose(boolean isVerbose)voidupdatePoliciesOfDerivativeBitstreams(Context context, Item item, Bitstream source)update resource polices of derivative bitstreams related to source bitstream.
-
-
-
Field Detail
-
FILTER_PLUGIN_SEPARATOR
static final String FILTER_PLUGIN_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
applyFiltersCommunity
void applyFiltersCommunity(Context context, Community community) throws Exception
- Throws:
Exception
-
applyFiltersCollection
void applyFiltersCollection(Context context, Collection collection) throws Exception
- Throws:
Exception
-
filterItem
boolean filterItem(Context context, Item myItem) throws Exception
Iterate through the item's bitstreams in the ORIGINAL bundle, applying filters if possible.- Parameters:
context- contextmyItem- item- Returns:
- true if any bitstreams processed, false if none
- Throws:
Exception- if error
-
filterBitstream
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.- Parameters:
c- contextmyItem- itemmyBitstream- bitstream- Returns:
- true if bitstream processed, false if no applicable filter or already processed
- Throws:
Exception- if error
-
processBitstream
boolean processBitstream(Context context, Item item, Bitstream source, FormatFilter formatFilter) throws Exception
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:
context- contextitem- item containing bitstream to processsource- source bitstream to processformatFilter- FormatFilter to perform filtering- Returns:
- true if new rendition is created, false if rendition already exists and overWrite is not set
- Throws:
Exception- if error occurs
-
updatePoliciesOfDerivativeBitstreams
void updatePoliciesOfDerivativeBitstreams(Context context, Item item, Bitstream source) throws SQLException, AuthorizeException
update resource polices of derivative bitstreams related to source bitstream. set derivative bitstreams to be publicly accessible or replace derivative bitstreams policies using the same in the source bitstream.- Parameters:
context- contextitem- item containing bitstreamssource- source bitstream- Throws:
SQLException- If something goes wrong in the databaseAuthorizeException- if authorization error
-
getCurrentItem
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
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.
-
setVerbose
void setVerbose(boolean isVerbose)
-
setQuiet
void setQuiet(boolean isQuiet)
-
setForce
void setForce(boolean isForce)
-
setMax2Process
void setMax2Process(int max2Process)
-
setFilterClasses
void setFilterClasses(List<FormatFilter> filterClasses)
-
setLogHandler
void setLogHandler(DSpaceRunnableHandler handler)
Set the log handler used in the DSpace scripts and processes framework- Parameters:
handler-
-
-