OK, as I understand the problem, it's mainly that you want to have a single
MediaFilter-implementing class that is differentiated at runtime into many
different plugins. This is a classic use case for the "self-named" plugin in
the PluginManager -- see http://wiki.dspace.org/index.php/PluginManager
However, the MediaFilterManager expects to find a the media filters in
a single sequence plugin. This was only done to simplify the configuration;
there's no good reason not to make all the MediaFilter plugins regular
"named" plugins (like e.g. the crosswalks) and then add a configuration
line explicitly listing them by name. This would solve your problem,
since you coudl implement one OpenOfficeMediaFilter that is configured
as a self-named plugin, and gets those names from its own config entries.
For example, the config lines would look like:
mediafilter.plugins = PDF, HTML, IMAGE, BRAND, OORTF, OOPS
plugin.named.org.dspace.app.mediafilter.MediaFilter = \
org.dspace.app.mediafilter.PDFFilter = PDF, \
org.dspace.app.mediafilter.HTMLFilter = HTML, \
org.dspace.app.mediafilter.JPEGFilter = IMAGE, \
org.dspace.app.mediafilter.BrandedPreviewJPEGFilter = BRAND
plugin.selfnamed.org.dspace.app.mediafilter.MediaFilter = \
# name the plugins implemented by OpenOfficeMediaFilter
oofilter.format.OORTF = RTF
oofilter.format.OOPS = PostScript
Hope this helps.. It'd still take a change to the MFM, but perhaps
it'd be accepted as a patch since it seems like an overall improvement.
> The biggest issue I'm currently having with MediaFilter is that it only
> provides for a list of "inputFormats" (in dspace.cfg), and then each
> input format is processed in the exact same manner, and placed in the
> exact same bundle each time. However, since OpenOffice.org supports
> such a wide variety of output formats, I've determined I would need to
> create up to 11 separate MediaFilters to support even just conversion to
> the "major" textual formats (Word, Excel, PPT, CSV, XML, Text, RTF,
> HTML, OO Writer, OO Impress, OO Calc). (Obviously, that's assuming I
> wanted to create a Media Filter to convert *to* Word/Excel/PPT). This
> doesn't even include the various image formats also supported by
> OpenOffice.org. The frustrating thing from my point of view is that
> even if I created these 11 MediaFilters, the majority of them would
> differ by a single line (namely, which Export Filter to use to export
> the correct output format from OpenOffice). I cannot seem to figure
> out a way to just create a single OpenOfficeMediaFilter which can
> support converting all the various input formats into all the desired
> output formats.
> (For reference, here's a list of the Import/Export Filters available in
> OpenOffice.org 2.x:
> This implies to me a need to take a closer look at MediaFilterManager
> itself, and determine if there is a better way to structure it, so that
> each MediaFilter can specify a variety of input formats and a variety of
> export formats it supports. This in turn may imply a need to create a
> better way to "configure" the MediaFilterManager, most likely by some
> form of XML schema or properties file.
> What do others think about this? Does anyone see any "easy solution"
> that I'm overlooking? Or is this an area that we may want to start
> discussing (on the Wiki), some sort of re-design (which I'll gladly lead)?
> - Tim
> Tim Donohue
> Research Programmer, Illinois Digital Environment for
> Access to Learning and Scholarship (IDEALS)
> 52 Grainger Engineering Library
> University of Illinois at Urbana-Champaign
> email: tdonohue@...
> web: http://ideals.uiuc.edu
> phone: (217) 333-4648
> fax: (217) 244-7764
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> Dspace-devel mailing list