and how do you pass parameters to the commands? or would you create a 'MakeVersionable' command?
well, just another 2 libraries we depend on... but i'll give it a try and maybe i discover the beauty of commons-chain :-) cheers, tobi On Apr 8, 2005 5:35 PM, Brian Moseley <[EMAIL PROTECTED]> wrote: > Tobias Strasser wrote: > > > well, i guess, this is a bit overkill and we would need 2 more > > libraries. maybe its just my personal feeling. how would a typical > > chain configuration look like? > > why do you think it's overkill? it implements almost exactly what you > described in your earlier message :) > > the config might look something like this: > > <catalog name="simple-webdav"> > <chain name="import-content"> > <command id="import-file" > className="org.apache.jackrabbit...FileImportHandler"> > <command id="import-xml" > className="...XmlImportHandler"> > </chain> > <chain name="export-content"> > <command id="export-file" > className="...FileExportHandler"> > <command id="export-html-collection" > className="...HtmlCollectionExportHandler"> > <command id="export-ics-collection" > className="...IcsCollectionExportHandler"> > <command id="export-xml-collection" > className="...XmlCollectionExportHandler"> > </chain> > </catalog> > > concise but expressive. > > here's a very good article on commons chain that might help you become > more comfortable with the idea: > > <http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains.html> > > surprisingly, new requirements for my project came to light yesterday > which almost mandate a chain of responsibility approach. i need to be > able to offer different views (xml, html, ics) of the same collection > based on the request's content type, user agent, and possibly other > dimensions. so i'm motivated to work on this in the short term (probably > the next couple weeks). > -- ------------------------------------------< [EMAIL PROTECTED] >--- Tobias Strasser, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel T +41 61 226 98 98, F +41 61 226 98 97 -----------------------------------------------< http://www.day.com >---
