RE: Maverick - Multiple shunt-factories
"Schnitzer, Jeff" <[email protected]>
| Newsgroups | gmane.comp.web.maverick.general |
|---|---|
| Message-ID | <[email protected]> |
The mechanism is very simple - views can have a mode attribute, which is an arbitrary string of your definition. At runtime, the Shunt picks one of the modes based on characteristics of the request. Your Shunt implementation can interpret modes in any way you choose. You might or might not want to try to build a composite Shunt. My guess is that you will probably be better off with a single custom shunt that encompasses all of your logic. The problem with trying to generalize a composite shunt is the defaulting logic: <view mode="lang:en,browser:ie" .../> <view mode="lang:de,browser:ie" .../> ...what do you do if the browser is IE but the lang is ch? Maybe you could just require a view to be defined for every default, but once you hit 3 or more different variables then you have many many default cases... Since Shunts are simple to write, you're probably best off just writing a custom shunt anytime you need complex logic. Jeff Schnitzer [email protected] > -----Original Message----- > From: Stefan Beekman [mailto:[email protected]] > Sent: Tuesday, April 08, 2003 1:01 AM > To: [email protected] > Subject: [Mav-user] Maverick - Multiple shunt-factories > > Hi, > > First of all I want to address that I am new to this list and relatively > new > to Java. > Before dropping this message, I searched the Maverick list archives, but > couldn't find satisfying answers. > Hopefully you can help me. > > We want to use the Maverick framework to develop the presentation layer of > our application. > > Maverick comes with a LanguageShuntFactory, which enables you to make a > language dependend application. > Depending on the preferred language in the http header this class returns > the appropriate view. > > What I would like to do now is to add an extra "shunt-factory" to make the > website also dependend on a second (or even third) paramater, for example > a > customer or department name. > > Does anyone know how to achieve this and how to configure the maverick.xml > file? > Do I have to extend(subclass) the standard LanguageShuntFactory with the > additional dependencies or should I create extra Factories for every > dependency I want to use? > How must the maverick.xml file be configured? Should I nest the modules? > Or > create the two- or three-dimensional dependencies by transforming the > maverick.xml file with a XSLT file? > > If anyone has hints or done this before, your help would be appreciated! > > regards, > > Stefan Beekman > Consultant > _________________________________________ > LogicaCMG > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > [INVALID FOOTER] ------------------------------------------------------- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ [INVALID FOOTER]