You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Lane Sharman <la...@san.rr.com> on 2001/09/01 05:09:27 UTC

Re: AW: Velocity, JSP, and XP practices

>
>
> If you are going to allow dynamic changing of Layouts, then you should have
> a page that allows the user to define the overall "layout" which is then
> stored in the data associated with the User and then reflected in the
> rendered pages.

That is a good idea until the user has several roles and then you need to adopt
a parametric pattern.

-lane

>
>
> -jon

--
Lane Sharman
http://corporate.acctiva.com/lane



Re: AW: Velocity, JSP, and XP practices

Posted by "Jeroen C. van Gelderen" <je...@vangelderen.org>.
Jon Stevens wrote:
> on 9/2/01 10:26 AM, "Lane Sharman" <la...@san.rr.com> wrote:
> 
> 
>>Setting behaviors, preferences in the user object is, to use your vernacular,
>>a "duh".  I can't think of a modern app today that does not persist user
>>preferences. And, sure, these can drive a variety of layout scenarios.
>>
>>I was referring to applications which lay themselves out dynamically based on
>>input or current environment.
>>
>>EG, a report, a request, a form, a frame lays itself out based on input or
>>behavior or device, eg, "summary || detail", "25 items || 50 items || all
>>items", "1 employee || 2-10 employees || 11 or greater employees, "swing
>>client || applet client || html client".
>>
> 
> In all of these examples, they are user preferences (a user could be you,
> me, a swing client, etc). So, the layout can be determined based on what the
> user prefers, not what is passed around in a query string.

The two are however not mutually exclusive as the above paragraph seems
to imply. What if the user's preferences are encoded in the query string
for whatever reason? Whether or not that is bad is a matter of cost.

I have often tried but seem unable to bookmark a cookie with my user
preferences...

Cheers,
Jeroen


Re: AW: Velocity, JSP, and XP practices

Posted by Gunnar Rønning <gu...@polygnosis.com>.
* Lane Sharman <la...@san.rr.com> wrote:
|
| Jon Stevens wrote:
| 
| >
| > See my point yet?
| 
| Yes, Jon, I see your point.
| 
| Did you see mine?

I do at least. Both ways would be useful at times. URLs with meaningful 
parameters are helpful, e.g. when you are referring to an URL as part of 
a discussion. 

-- 
Gunnar Rønning - gunnar@polygnosis.com
Senior Consultant, Polygnosis AS, http://www.polygnosis.com/

Re: AW: Velocity, JSP, and XP practices

Posted by Lane Sharman <la...@san.rr.com>.
Jon Stevens wrote:

>
> See my point yet?

Yes, Jon, I see your point.

Did you see mine?

-lane


Re: IllegalAccessException ??

Posted by Bill Burton <bi...@progress.com>.
"Geir Magnusson Jr." wrote:
> > Only question remains is how can I detect the encoding of a page written in
> > velocity at runtime? I have it hardcoded now for 8859-1.
> 
> You can't.  It is something that you have to know, just like you have to
> know what template you want to render to show a page.
> 
> I think that the majority of people will be using only one encoding.  Maybe
> we should undeprecate the merge call that assumes the encoding default?

Yes, please do.  If the encoding has already been configured via
properties, it shouldn't be a requirement to also specify it when calling
mergeTemplate.  I ran into this and was wondering why using the default
wasn't acceptable.

Thanks,
-Bill

Re: Page encoding

Posted by Nick Bauman <ni...@cortexity.com>.
> On 9/7/01 12:59 PM, "Nick Bauman" <ni...@cortexity.com> wrote:
> 
>>>  
>>>> Only question remains is how can I detect the encoding of a page
>>>> written in velocity at runtime? I have it hardcoded now for 8859-1.
>>> 
>>> You can't.  It is something that you have to know, just like you have
>>> to know what template you want to render to show a page.
>> 
>> So it's something I have to set on a webapp-level basis with an
>> init-param. Maybe I can figure out how to map certain file extenstions
>> to certain accept-language headers  or something...? I'll rub on it a
>> bit more and report back.
> 
> Yes, it would be something like that - because there is no way for
> velocity to tell automatically what the character representation of
> your bytestreams (files) are...
>> 
>> JSP has this kind of thing set in the page directive (although it
>> never seemed to work in Jasper, but that was a while ago) so you
>> could, according to the spec, set the encoding on a per-page basis.
> 
> Isn't that output encoding?

Well, you'd think that was the case, otherwise they'd have to do strange
things like read the file as unicode to find the encoding header, then
switch encodings and convert the file... 

>>> I think that the majority of people will be using only one encoding.
>>> Maybe we should undeprecate the merge call that assumes the encoding
>>> default?
>> 
>> I have no strong opinion on this one way or the other. I only wish I'd
>> found Velocity sooner. I'm going to be teaching 2 newbies how to write
>> templates for Velocity using my framework this weekend. I taught 1
>> newbie already and he got it in 10 minutes. "It's fun, it's fast, it's
>> furry!" (okay, I have to come up with some other "f" word there...)
> 
> That's great!
> 
> I personally don't mix encodings, and I would be your average site, in
> whatever locale, does the same.   Of course, there are sites that
> support mixing based on user, for example, but I would assume that the
> template encoding is only part of their worries - other things such as
> string resources, date/currency format, idioms, etc matter just as, or
> even more.
> 

I have gotten requests before to make multilingual sites that autodetect the
language preference of the user's browser and serve up appropriately. (We do
it at work with our sites webhelp.fr in Mauritus, webhelp.de in Czeck
Republic and webhelp.com in Montreal using redirects, but its similar)
Apache can do that with static HTML and file extensions (Content
negotiation), but of course doing it with Velocity without some kind of
dynamic detection using file extensions mapped to accept-language headers,
there's no way I can think of to do that. 

> geir
> 
> -- 
> Geir Magnusson Jr.     geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> If you look up, there are no limits - Japanese Proverb

Thanks again.

-- 
Nick Bauman
3600 N. Dupont
Minneapolis, MN 55412
Mobile: (612) 232-7120
Home: (612) 522-0165


Re: Page encoding (was IllegalAccessException ??)

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 9/7/01 12:59 PM, "Nick Bauman" <ni...@cortexity.com> wrote:

>>  
>>> Only question remains is how can I detect the encoding of a page
>>> written in velocity at runtime? I have it hardcoded now for 8859-1.
>> 
>> You can't.  It is something that you have to know, just like you have
>> to know what template you want to render to show a page.
> 
> So it's something I have to set on a webapp-level basis with an init-param.
> Maybe I can figure out how to map certain file extenstions to certain
> accept-language headers  or something...? I'll rub on it a bit more and
> report back.

Yes, it would be something like that - because there is no way for velocity
to tell automatically what the character representation of your bytestreams
(files) are...
> 
> JSP has this kind of thing set in the page directive (although it never
> seemed to work in Jasper, but that was a while ago) so you could, according
> to the spec, set the encoding on a per-page basis.

Isn't that output encoding?
 
>> I think that the majority of people will be using only one encoding.
>> Maybe we should undeprecate the merge call that assumes the encoding
>> default?
> 
> I have no strong opinion on this one way or the other. I only wish I'd found
> Velocity sooner. I'm going to be teaching 2 newbies how to write templates
> for Velocity using my framework this weekend. I taught 1 newbie already and
> he got it in 10 minutes. "It's fun, it's fast, it's furry!" (okay, I have to
> come up with some other "f" word there...)

That's great!

I personally don't mix encodings, and I would be your average site, in
whatever locale, does the same.   Of course, there are sites that support
mixing based on user, for example, but I would assume that the template
encoding is only part of their worries - other things such as string
resources, date/currency format, idioms, etc matter just as, or even more.

geir


-- 
Geir Magnusson Jr.     geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
If you look up, there are no limits - Japanese Proverb


Page encoding (was IllegalAccessException ??)

Posted by Nick Bauman <ni...@cortexity.com>.
>  
>> Only question remains is how can I detect the encoding of a page
>> written in velocity at runtime? I have it hardcoded now for 8859-1.
> 
> You can't.  It is something that you have to know, just like you have
> to know what template you want to render to show a page.

So it's something I have to set on a webapp-level basis with an init-param.
Maybe I can figure out how to map certain file extenstions to certain
accept-language headers  or something...? I'll rub on it a bit more and
report back.

JSP has this kind of thing set in the page directive (although it never
seemed to work in Jasper, but that was a while ago) so you could, according
to the spec, set the encoding on a per-page basis.

> I think that the majority of people will be using only one encoding. 
> Maybe we should undeprecate the merge call that assumes the encoding
> default?

I have no strong opinion on this one way or the other. I only wish I'd found
Velocity sooner. I'm going to be teaching 2 newbies how to write templates
for Velocity using my framework this weekend. I taught 1 newbie already and
he got it in 10 minutes. "It's fun, it's fast, it's furry!" (okay, I have to
come up with some other "f" word there...)

> geir
> 
> -- 
> Geir Magnusson Jr.     geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> If you look up, there are no limits - Japanese Proverb



-- 
Nick Bauman
3600 N. Dupont
Minneapolis, MN 55412
Mobile: (612) 232-7120
Home: (612) 522-0165


Re: IllegalAccessException ??

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 9/6/01 3:19 PM, "Nick Bauman" <ni...@cortexity.com> wrote:

> Geir,
> 
> I have since updated to yesterday's nightly and this has totally fixed the
> problem. I no longer see the exception and I can freely access request
> parameters and attributes and session variables from pages that were
> forwarded. CooooOOOOooooOOOOooooOOOOL!!!
> 
> The only thing I had to do was add the init() method to my LoggingSystem
> impl and change my merge() call to pass the encoding. (deprecated API
> warnings)

Great.  This is good validation of 1.2
 
> Only question remains is how can I detect the encoding of a page written in
> velocity at runtime? I have it hardcoded now for 8859-1.

You can't.  It is something that you have to know, just like you have to
know what template you want to render to show a page.

I think that the majority of people will be using only one encoding.  Maybe
we should undeprecate the merge call that assumes the encoding default?

geir

-- 
Geir Magnusson Jr.     geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
If you look up, there are no limits - Japanese Proverb


Re: IllegalAccessException ??

Posted by Nick Bauman <ni...@cortexity.com>.
Geir,

I have since updated to yesterday's nightly and this has totally fixed the 
problem. I no longer see the exception and I can freely access request 
parameters and attributes and session variables from pages that were 
forwarded. CooooOOOOooooOOOOooooOOOOL!!!

The only thing I had to do was add the init() method to my LoggingSystem 
impl and change my merge() call to pass the encoding. (deprecated API 
warnings)

Only question remains is how can I detect the encoding of a page written in 
velocity at runtime? I have it hardcoded now for 8859-1.

> On 9/5/01 1:00 AM, "Nick Bauman" <ni...@cortexity.com> wrote:
> 
>> I have a Velocity Template that can't seem to render attributes from a
>> request dispacher's forward. What am I missing here?
>> 
>> 04Sep-23:50:22.588[nnection-6802-0] INFO
>> |pache.velocity.VelocityContext|   [info] ResourceManager :
>> found /diagnostic.vtl with loader
>> org.apache.velocity.runtime.resource.loader.FileResourceLoader
>> ASTMethod.execute() : exception invoking method 'getParameterNames' in
>> class com.caucho.server.http.DispatchRequest :
>> java.lang.IllegalAccessException
>> ASTMethod.execute() : exception invoking method 'getAttributeNames' in
>> class com.caucho.server.http.DispatchRequest :
>> java.lang.IllegalAccessException
>> 
>> Thanks for the clue.
> 
> Are you using 1.2-dev ?  Looks like an introspector issue.
> 
> Geir
> 
> -- 
> Geir Magnusson Jr.     geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> If you look up, there are no limits - Japanese Proverb


-- 
Nick Bauman
3600 N. Dupont
Minneapolis, MN 55412
Mobile: (612) 232-7120
SMS: 6122327120@voicestream.net
Home: (612) 522-0165


Re: IllegalAccessException ?? LogSystem changed in 1.2

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 9/5/01 11:15 PM, "Nick Bauman" <ni...@cortexity.com> wrote:

> OK Geir, upgrading to 1.2-dev, I see the interface to LogSystem has
> changed...
> 
> [javac] /home/nick/projects/ttmor/src/com/cortexity/util/VelocityLoggerAdapt
> er.java:27: com.cortexity.util.VelocityLoggerAdapter should be declared
> abstract; it does not define init
> (org.apache.velocity.runtime.RuntimeServices) in
> com.cortexity.util.VelocityLoggerAdapter
>   [javac] public final class VelocityLoggerAdapter implements LogSystem {
>   [javac]              ^
>   [javac] 
> Note: /home/nick/projects/ttmor/src/com/cortexity/servlet/VTLDispatcher.java
> uses or overrides a deprecated API.
>   [javac] Note: Recompile with -deprecation for details.
>   [javac] 1 error
> 
> So I need to implement RuntimeServices interface in my LogSystem impl. and
> make my logging interface consume that so that initializing Velocity
> logging and my app's logging is done the same way? Sorry if this comes
> across as Thick As A Whale Omlette (tm) as usual.

Not sure about how you phrased it, but you simply must add an init method
that takes a RuntimeServices argument.

Your logger has no responsibilities re that, just that the interface has to
have it for others that may want access to the runtime instance they are
running in.

Hope it isn't too much trouble.  This is the obvious downside to using
interfaces rather than base classes...

geir



Re: IllegalAccessException ?? LogSystem changed in 1.2

Posted by Nick Bauman <ni...@cortexity.com>.
OK Geir, upgrading to 1.2-dev, I see the interface to LogSystem has 
changed...

[javac] /home/nick/projects/ttmor/src/com/cortexity/util/VelocityLoggerAdapt
er.java:27: com.cortexity.util.VelocityLoggerAdapter should be declared 
abstract; it does not define init
(org.apache.velocity.runtime.RuntimeServices) in 
com.cortexity.util.VelocityLoggerAdapter
    [javac] public final class VelocityLoggerAdapter implements LogSystem {
    [javac]              ^
    [javac] 
Note: /home/nick/projects/ttmor/src/com/cortexity/servlet/VTLDispatcher.java
 uses or overrides a deprecated API.
    [javac] Note: Recompile with -deprecation for details.
    [javac] 1 error

So I need to implement RuntimeServices interface in my LogSystem impl. and 
make my logging interface consume that so that initializing Velocity 
logging and my app's logging is done the same way? Sorry if this comes 
across as Thick As A Whale Omlette (tm) as usual.
 

> On 9/5/01 1:00 AM, "Nick Bauman" <ni...@cortexity.com> wrote:
> 
>> I have a Velocity Template that can't seem to render attributes from a
>> request dispacher's forward. What am I missing here?
>> 
>> 04Sep-23:50:22.588[nnection-6802-0] INFO
>> |pache.velocity.VelocityContext|   [info] ResourceManager :
>> found /diagnostic.vtl with loader
>> org.apache.velocity.runtime.resource.loader.FileResourceLoader
>> ASTMethod.execute() : exception invoking method 'getParameterNames' in
>> class com.caucho.server.http.DispatchRequest :
>> java.lang.IllegalAccessException
>> ASTMethod.execute() : exception invoking method 'getAttributeNames' in
>> class com.caucho.server.http.DispatchRequest :
>> java.lang.IllegalAccessException
>> 
>> Thanks for the clue.
> 
> Are you using 1.2-dev ?  Looks like an introspector issue.
> 
> Geir
> 
> -- 
> Geir Magnusson Jr.     geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> If you look up, there are no limits - Japanese Proverb


-- 
Nick Bauman
3600 N. Dupont
Minneapolis, MN 55412
Mobile: (612) 232-7120
Home: (612) 522-0165


Re: IllegalAccessException ??

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 9/5/01 4:44 PM, "Nick Bauman" <ni...@cortexity.com> wrote:

>> On 9/5/01 1:00 AM, "Nick Bauman" <ni...@cortexity.com> wrote:
>> 
>>> I have a Velocity Template that can't seem to render attributes from a
>>> request dispacher's forward. What am I missing here?
>>> 
>>> 04Sep-23:50:22.588[nnection-6802-0] INFO
>>> |pache.velocity.VelocityContext|   [info] ResourceManager :
>>> found /diagnostic.vtl with loader
>>> org.apache.velocity.runtime.resource.loader.FileResourceLoader
>>> ASTMethod.execute() : exception invoking method 'getParameterNames' in
>>> class com.caucho.server.http.DispatchRequest :
>>> java.lang.IllegalAccessException
>>> ASTMethod.execute() : exception invoking method 'getAttributeNames' in
>>> class com.caucho.server.http.DispatchRequest :
>>> java.lang.IllegalAccessException
>>> 
>>> Thanks for the clue.
>> 
>> Are you using 1.2-dev ?  Looks like an introspector issue.
>> 
>> Geir
>> 
>> -- 
>> Geir Magnusson Jr.     geirm@optonline.net
>> System and Software Consulting
>> Developing for the web?  See http://jakarta.apache.org/velocity/
>> If you look up, there are no limits - Japanese Proverb
> 
> 
> I'm using 1.1 final. Do I have to upgrade to a nightly build to get around
> this?

Yes.  I bet then it is the introspector issue - try the 1.2-dev.  It's very
stable.  There will be a release Real Soon Now as soon as I get the last
bits in...

geir



Re: IllegalAccessException ??

Posted by Nick Bauman <ni...@cortexity.com>.
> On 9/5/01 1:00 AM, "Nick Bauman" <ni...@cortexity.com> wrote:
> 
>> I have a Velocity Template that can't seem to render attributes from a
>> request dispacher's forward. What am I missing here?
>> 
>> 04Sep-23:50:22.588[nnection-6802-0] INFO
>> |pache.velocity.VelocityContext|   [info] ResourceManager :
>> found /diagnostic.vtl with loader
>> org.apache.velocity.runtime.resource.loader.FileResourceLoader
>> ASTMethod.execute() : exception invoking method 'getParameterNames' in
>> class com.caucho.server.http.DispatchRequest :
>> java.lang.IllegalAccessException
>> ASTMethod.execute() : exception invoking method 'getAttributeNames' in
>> class com.caucho.server.http.DispatchRequest :
>> java.lang.IllegalAccessException
>> 
>> Thanks for the clue.
> 
> Are you using 1.2-dev ?  Looks like an introspector issue.
> 
> Geir
> 
> -- 
> Geir Magnusson Jr.     geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> If you look up, there are no limits - Japanese Proverb


I'm using 1.1 final. Do I have to upgrade to a nightly build to get around this?

-- 
Nick Bauman
3600 N. Dupont
Minneapolis, MN 55412
Mobile: (612) 232-7120
Home: (612) 522-0165


Re: IllegalAccessException ??

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 9/5/01 1:00 AM, "Nick Bauman" <ni...@cortexity.com> wrote:

> I have a Velocity Template that can't seem to render attributes from a
> request dispacher's forward. What am I missing here?
> 
> 04Sep-23:50:22.588[nnection-6802-0] INFO
> |pache.velocity.VelocityContext|   [info] ResourceManager :
> found /diagnostic.vtl with loader
> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> ASTMethod.execute() : exception invoking method 'getParameterNames' in
> class com.caucho.server.http.DispatchRequest :
> java.lang.IllegalAccessException
> ASTMethod.execute() : exception invoking method 'getAttributeNames' in
> class com.caucho.server.http.DispatchRequest :
> java.lang.IllegalAccessException
> 
> Thanks for the clue.

Are you using 1.2-dev ?  Looks like an introspector issue.

Geir

-- 
Geir Magnusson Jr.     geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
If you look up, there are no limits - Japanese Proverb


IllegalAccessException ??

Posted by Nick Bauman <ni...@cortexity.com>.
I have a Velocity Template that can't seem to render attributes from a 
request dispacher's forward. What am I missing here?

04Sep-23:50:22.588[nnection-6802-0] INFO  
|pache.velocity.VelocityContext|   [info] ResourceManager : 
found /diagnostic.vtl with loader 
org.apache.velocity.runtime.resource.loader.FileResourceLoader
ASTMethod.execute() : exception invoking method 'getParameterNames' in 
class com.caucho.server.http.DispatchRequest : 
java.lang.IllegalAccessException
ASTMethod.execute() : exception invoking method 'getAttributeNames' in 
class com.caucho.server.http.DispatchRequest : 
java.lang.IllegalAccessException

Thanks for the clue.

-- 
Nick Bauman
3600 N. Dupont
Minneapolis, MN 55412
Mobile: (612) 232-7120
Home: (612) 522-0165


AW: AW: Velocity, JSP, and XP practices

Posted by Thomas Fahrmeyer <th...@einsurance.de>.
Hi,

inline ...

> on 9/3/01 5:49 PM, "Huy Do" <hu...@tramada.com> wrote:
>
> > What about when the layout does not depend on the user but for
> example is a
> > link from an associate site. The associate site would maybe
> want a slightly
> > different layout for certain pages but keep the layout the same
> for others.
> > I've actually come across this before.
>
> You know where the person has come from with the referrer field. The link
> could also go to a specific domain which you could use as your
> 'key'. Doing
> this also opens up the possibilities of more than just layout
> determination.
>
> > I'm sure there are many solutions for this, but if it's just the home
> > page/first page which has it's layout changed, eg. logo on the
> right instead
> > of on the right and a different footer, would passing the
> layout as a cgi
> > var be the simplest solution.
>

> Right, but you missed my point originally, which is that you do
> not want to
> continue to pass it through each request once you get it the first time.
>

Absolutely, passing the layout as an parameter is not the way to go. I
introduced this parameter to change
the layout only for special cases. The best example to present a template
which has an optimized layout for printing.
The normal layout contains something like header, footer, navigation bar and
so on. If the user wanna print a template rendered with all the additional
stuff, he would get a link to the same template with a different layout as
parameter.
	http://host/demo/view/results.htm?layout=printable.html

This printable.html - layout has no nav-bar and the other stuff.

The common way we are using layouts is by providing a "look and feel". We
are working with many external partners referring our page and products.
Each of this partner has an id which will be given by the partner at the
link to the start page. With this Id a L&F is created (configured with an
property file), contains a default Layout, images, stylesheets ...

The L&F is stored in the session. Every time a template is requested it will
be rendered with the default layout of the partner. Only in special cases
(like printing) it is necessary to change the layout temporarily.

bye
Thomas



Re: AW: Velocity, JSP, and XP practices

Posted by Jon Stevens <jo...@latchkey.com>.
on 9/3/01 5:49 PM, "Huy Do" <hu...@tramada.com> wrote:

> What about when the layout does not depend on the user but for example is a
> link from an associate site. The associate site would maybe want a slightly
> different layout for certain pages but keep the layout the same for others.
> I've actually come across this before.

You know where the person has come from with the referrer field. The link
could also go to a specific domain which you could use as your 'key'. Doing
this also opens up the possibilities of more than just layout determination.

> I'm sure there are many solutions for this, but if it's just the home
> page/first page which has it's layout changed, eg. logo on the right instead
> of on the right and a different footer, would passing the layout as a cgi
> var be the simplest solution.

Right, but you missed my point originally, which is that you do not want to
continue to pass it through each request once you get it the first time.

-jon


RE: AW: Velocity, JSP, and XP practices

Posted by Huy Do <hu...@tramada.com>.
What about when the layout does not depend on the user but for example is a
link from an associate site. The associate site would maybe want a slightly
different layout for certain pages but keep the layout the same for others.
I've actually come across this before.

I'm sure there are many solutions for this, but if it's just the home
page/first page which has it's layout changed, eg. logo on the right instead
of on the right and a different footer, would passing the layout as a cgi
var be the simplest solution.

Thanks

Huy

> -----Original Message-----
> From: Jon Stevens [mailto:jon@latchkey.com]
> Sent: Monday, 3 September 2001 4:19 AM
> To: velocity-user
> Subject: Re: AW: Velocity, JSP, and XP practices
>
>
> on 9/2/01 10:26 AM, "Lane Sharman" <la...@san.rr.com> wrote:
>
> > Setting behaviors, preferences in the user object is, to use
> your vernacular,
> > a "duh".  I can't think of a modern app today that does not persist user
> > preferences. And, sure, these can drive a variety of layout scenarios.
> >
> > I was referring to applications which lay themselves out
> dynamically based on
> > input or current environment.
> >
> > EG, a report, a request, a form, a frame lays itself out based
> on input or
> > behavior or device, eg, "summary || detail", "25 items || 50
> items || all
> > items", "1 employee || 2-10 employees || 11 or greater employees, "swing
> > client || applet client || html client".
>
> In all of these examples, they are user preferences (a user could be you,
> me, a swing client, etc). So, the layout can be determined based
> on what the
> user prefers, not what is passed around in a query string.
>
> See my point yet?
>
> -jon
>
>


Re: AW: Velocity, JSP, and XP practices

Posted by Jon Stevens <jo...@latchkey.com>.
on 9/2/01 10:26 AM, "Lane Sharman" <la...@san.rr.com> wrote:

> Setting behaviors, preferences in the user object is, to use your vernacular,
> a "duh".  I can't think of a modern app today that does not persist user
> preferences. And, sure, these can drive a variety of layout scenarios.
> 
> I was referring to applications which lay themselves out dynamically based on
> input or current environment.
> 
> EG, a report, a request, a form, a frame lays itself out based on input or
> behavior or device, eg, "summary || detail", "25 items || 50 items || all
> items", "1 employee || 2-10 employees || 11 or greater employees, "swing
> client || applet client || html client".

In all of these examples, they are user preferences (a user could be you,
me, a swing client, etc). So, the layout can be determined based on what the
user prefers, not what is passed around in a query string.

See my point yet?

-jon


Re: AW: Velocity, JSP, and XP practices

Posted by Lane Sharman <la...@san.rr.com>.
Hi Jon,

Jon Stevens wrote:

> on 9/1/01 1:40 PM, "Lane Sharman" <la...@san.rr.com> wrote:

...

>
>
>     data.getUser().setPerm("layout","Foo.html");
>
> Needless to say, how about qualifying your "legitimate way" with a reason
> for what makes it legitimate.

Setting behaviors, preferences in the user object is, to use your vernacular,  a
"duh".  I can't think of a modern app today that does not persist user preferences.
And, sure, these can drive a variety of layout scenarios.

I was referring to applications which lay themselves out dynamically based on input
or current environment.

EG, a report, a request, a form, a frame lays itself out based on input or behavior
or device, eg, "summary || detail", "25 items || 50 items || all items", "1
employee || 2-10 employees || 11 or greater employees, "swing client || applet
client || html client".

I am certain you account for this in your design work so this thread is probably
closed unless I am misunderstanding your last couple of posts on the subject.

regards,

lane


Re: AW: Velocity, JSP, and XP practices

Posted by Jon Stevens <jo...@latchkey.com>.
on 9/1/01 1:40 PM, "Lane Sharman" <la...@san.rr.com> wrote:

> Jon Stevens wrote:
> 
>> on 8/31/01 8:09 PM, "Lane Sharman" <la...@san.rr.com> wrote:
>> 
>>>> If you are going to allow dynamic changing of Layouts, then you should have
>>>> a page that allows the user to define the overall "layout" which is then
>>>> stored in the data associated with the User and then reflected in the
>>>> rendered pages.
>>> 
>>> That is a good idea until the user has several roles and then you need to
>>> adopt a parametric pattern.
>>> 
>>> -lane
>> 
>> Huh? :-)
> 
> The developer proposed an http parameter to drive the layout. Your comment
> suggests that is the wrong way to do things. My point is that a parameter is a
> perfectly legitimate way to drive a dynamic layout.

Right. I was simply expressing my opinion (and I clearly stated that it was
MY OPINION) that a parameter is NOT a legitimate way to drive dynamic
layout. I gave reasons for why and an example for why not. There are cleaner
ways to implement the same functionality without the requirement of putting
something into the URI.

Additionally, placing something into the URI means that you are required to
also re-write all of the URI's in order to carry that parameter (or user
preference) across several pages. If someone leaves the website and then
comes back, their "preference" is lost and the whole point of putting it
into the URI in the first place becomes wasted effort. Sure, you could store
it in a cookie, but if you are going to go to that expense, then you might
as well put it into a users preferences management system. In Turbine, this
is simple:

    data.getUser().setPerm("layout","Foo.html");

Needless to say, how about qualifying your "legitimate way" with a reason
for what makes it legitimate.

-jon


Re: AW: Velocity, JSP, and XP practices

Posted by Lane Sharman <la...@san.rr.com>.
> C'mon Lane - there is a difference between
>
> "A parameter is a perfectly legitimate way to drive a dynamic layout."
>
> Is a whole lot different than
>
> "That is a good idea util the user has several roles and then you need to
> adopt a parametric pattern."
>
> Which, standing by itself, is a bit hard to parse...
>
> I think jon was saying that in shorthand...

agreed that my shorthand was not parseable. mathematics is to blame :).

i've made a resolution to keep it clear and legible on this list!

-l


Re: AW: Velocity, JSP, and XP practices

Posted by "Geir Magnusson Jr." <ge...@earthlink.net>.
On 9/1/01 4:40 PM, "Lane Sharman" <la...@san.rr.com> wrote:

> Jon Stevens wrote:
> 
>> on 8/31/01 8:09 PM, "Lane Sharman" <la...@san.rr.com> wrote:
>> 
>>>> If you are going to allow dynamic changing of Layouts, then you should have
>>>> a page that allows the user to define the overall "layout" which is then
>>>> stored in the data associated with the User and then reflected in the
>>>> rendered pages.
>>> 
>>> That is a good idea until the user has several roles and then you need to
>>> adopt a parametric pattern.
>>> 
>>> -lane
>> 
>> Huh? :-)
> 
> The developer proposed an http parameter to drive the layout. Your comment
> suggests that is the wrong way to do things. My point is that a parameter is a
> perfectly legitimate way to drive a dynamic layout.

C'mon Lane - there is a difference between

"A parameter is a perfectly legitimate way to drive a dynamic layout."

Is a whole lot different than

"That is a good idea util the user has several roles and then you need to
adopt a parametric pattern."

Which, standing by itself, is a bit hard to parse...

I think jon was saying that in shorthand...

Geir
 
> Please don't take the following personally. You have a tendency to make claims
> as
> axioms or say "Huh?" to ideas which differ from yours and thus close the door
> on
> a thorough examination of differring experiences. This is OK if you have a
> asdreally
> good idea to start with and there is not a lot of improvement to be made. But,
> we
> know that rarely is our first approach as good as the one subjected to debate
> with others.
> 
> As to Beavis versus Butthead, the readers of this list know that you enjoy
> both
> titles. :).
> 
> Again, this is not personal, nor meant to create a war of words. I think the
> velocity project has a lot of talent and ideas to go with it and I just want
> to
> make sure they can be spoken without fear of ridicule.
> 
> thanks,
> 
> -lane
> 

-- 
Geir Magnusson Jr.     geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
If you look up, there are no limits - Japanese Proverb


Re: AW: Velocity, JSP, and XP practices

Posted by Lane Sharman <la...@san.rr.com>.
Jon Stevens wrote:

> on 8/31/01 8:09 PM, "Lane Sharman" <la...@san.rr.com> wrote:
>
> >> If you are going to allow dynamic changing of Layouts, then you should have
> >> a page that allows the user to define the overall "layout" which is then
> >> stored in the data associated with the User and then reflected in the
> >> rendered pages.
> >
> > That is a good idea until the user has several roles and then you need to
> > adopt a parametric pattern.
> >
> > -lane
>
> Huh? :-)

The developer proposed an http parameter to drive the layout. Your comment
suggests that is the wrong way to do things. My point is that a parameter is a
perfectly legitimate way to drive a dynamic layout.

Please don't take the following personally. You have a tendency to make claims as
axioms or say "Huh?" to ideas which differ from yours and thus close the door on
a thorough examination of differring experiences. This is OK if you have a really
good idea to start with and there is not a lot of improvement to be made. But, we
know that rarely is our first approach as good as the one subjected to debate
with others.

As to Beavis versus Butthead, the readers of this list know that you enjoy both
titles. :).

Again, this is not personal, nor meant to create a war of words. I think the
velocity project has a lot of talent and ideas to go with it and I just want to
make sure they can be spoken without fear of ridicule.

thanks,

-lane


Re: AW: Velocity, JSP, and XP practices

Posted by Jon Stevens <jo...@latchkey.com>.
on 8/31/01 8:09 PM, "Lane Sharman" <la...@san.rr.com> wrote:

>> If you are going to allow dynamic changing of Layouts, then you should have
>> a page that allows the user to define the overall "layout" which is then
>> stored in the data associated with the User and then reflected in the
>> rendered pages.
> 
> That is a good idea until the user has several roles and then you need to
> adopt a parametric pattern.
> 
> -lane

Huh? :-)

The angle of the dangle is inversely proportional to the heat of the meat.
    -Beavis (or was it Butthead?)

-jon