RE: [Mav-user] Multiple shunts [1] and more dynamic LanguageShuntFactory [2]
Ok, I did write a patch to LanguageShuntFactory. I attached the files in this mail. - LanguageShuntFactory.java is the new patched LanguageShuntFactory - LanguageShuntFactory.java.old is the old LanguageShuntFactory (in current CVS) - LanguageShuntFactory.diff is diff file that can be applied to LanguageShuntFactory.java.old (or to the version that exists in repository. Changes: LanguageShuntFactory can now be initialized with default-language attribute like this: maverick version=2.0 default-view-type=document modules shunt-factory provider=org.infohazard.maverick.shunt.LanguageShuntFactory default-language=en/ /modules /maverick User can override default-language or Accept-Language headers by using request attribute: request.setAttribute(language, en); New LanguageShuntFactory tries at first to find a proper mode by using request attribute (language). Next it will try to find proper mode by using default-language attribute and finally it tries to find mode that matches to one of Accept-Language headers. If all these fail then it tries to find default mode. If also this fails, it will throw an exception. Kind regards Aapo -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aapo Laakkonen Sent: Thursday, September 25, 2003 3:16 PM To: [EMAIL PROTECTED] Subject: [Mav-user] Multiple shunts [1] and more dynamic LanguageShuntFactory [2] [1] http://www.mail-archive.com/[EMAIL PROTECTED]/msg00584.html [2] http://www.mail-archive.com/[EMAIL PROTECTED]/msg00545.html Has anyone done anything to these? I could do a patch to LanguageShuntFactory [2] to have override capability depending on Session language attribute. What should we do to case [1]? --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf [INVALID FOOTER] LanguageShuntFactory.java Description: Binary data LanguageShuntFactory.java.old Description: Binary data LanguageShuntFactory.diff Description: Binary data
RE: [Mav-user] Multiple shunts [1] and more dynamic LanguageShuntFactory [2]
#1 has to be addressed by a custom ShuntFactory. You can't have multiple mode attributes, but the value of a mode attribute can be a composite: command name=runQuery controller class=org.foo.Query/ view name=success mode=content:wap path=wap/en/queryResults.jsp/ view name=success mode=content:wap,lang:fr path=wap/fr/queryResults.jsp/ view name=success mode=content:wap,lang:de path=wap/de/queryResults.jsp/ ... etc /command It's just a question of how smart you want the ShuntFactory to be. I'm not sure it's possible to provide a generic tool in the Maverick package because everyone will likely want to handle the edge cases (in particular, the defaulting process) differently. It's super easy to make a ShuntFactory, so I just figure that anyone who needs something more sophisticated than LanguageShuntFactory can build their own custom logic. Jeff Schnitzer [EMAIL PROTECTED] -Original Message- From: Aapo Laakkonen [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 5:16 AM To: [EMAIL PROTECTED] Subject: [Mav-user] Multiple shunts [1] and more dynamic LanguageShuntFactory [2] [1] http://www.mail-archive.com/[EMAIL PROTECTED]/msg00584.html [2] http://www.mail-archive.com/[EMAIL PROTECTED]/msg00545.html Has anyone done anything to these? I could do a patch to LanguageShuntFactory [2] to have override capability depending on Session language attribute. What should we do to case [1]? --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf [INVALID FOOTER] --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf [INVALID FOOTER]