RE: [Mav-user] Multiple shunts [1] and more dynamic LanguageShuntFactory [2]

2003-09-25 Thread Aapo Laakkonen
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]

2003-09-25 Thread Schnitzer, Jeff
#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]


RE: [Mav-user] Multiple shunts

2003-03-19 Thread Schnitzer, Jeff
The Maverick distribution includes an example LanguageShunt and a
trivial sample application that uses it.

The shunt mechanism can accommodate composition, but you will have to
build the composite yourself.  ShuntFactory implementations are very
easy to build.  Since everyone's defaulting logic will likely be
different, I didn't try to put a composite in the distribution.

Jeff

 -Original Message-
 From: Scott Chun [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 19, 2003 3:07 PM
 To: [EMAIL PROTECTED]
 Subject: [Mav-user] Multiple shunts
 
 Is it possible to use more than one shunt per Maverick app (i.e. one
for
 language and another for browser type)? If yes:
 
 1) How do I declare it in the Maverick configuration file
 2) How do I define the modes
 
 Thanks!
 


--
 
 This message may contain confidential information, and is intended
only
 for the use of the individual(s) to whom it is addressed.
 
 


==
 
 
 
 
 ---
 This SF.net email is sponsored by: Does your code think in ink?
 You could win a Tablet PC. Get a free Tablet PC hat just for playing.
 What are you waiting for?
 http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
 [INVALID FOOTER]



---
This SF.net email is sponsored by: Does your code think in ink?
You could win a Tablet PC. Get a free Tablet PC hat just for playing.
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
[INVALID FOOTER]