Re: T5 which button did you hit?

2007-10-31 Thread Nick Westgate

There are some docs about this here:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/event.html

To get the "success" event from the component named Form, use:
onSuccessFromForm()

To get the "submit" event from the component named Submit, so use:
onSuccessFromSubmit()

It's good practice to add a t:id="ComponentName" to your components.
(Otherwise the default name is the component type.) Then you can use:
onEventFromComponentName()

Cheers,
Nick.


Marcus wrote:

Hi,

SomePage.java:
...
public Object onSubmit() {  System.out.println("Button1");  }
public Object onSuccess()  {  System.out.println("Button 2"); }
...

SomePage.tml:
...

  



...

localhost:8080/SomeTest/SomePage

How do you know, in java class, which button did you hit?
Console always display:
Button2
Button1

Thanks,

Marcus



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5 which button did you hit?

2007-10-31 Thread Marcus
Hi,

SomePage.java:
...
public Object onSubmit() {  System.out.println("Button1");  }
public Object onSuccess()  {  System.out.println("Button 2"); }
...

SomePage.tml:
...

  



...

localhost:8080/SomeTest/SomePage

How do you know, in java class, which button did you hit?
Console always display:
Button2
Button1

Thanks,

Marcus


Re: T5 book: update

2007-10-31 Thread Donyee
Where is the book?
Can someone give me a copy? or the download url ?


2007/11/1, Eko S.W. <[EMAIL PROTECTED]>:
>
> I am sorry, but How can we use DateField in 5.0.6?
> I am so late on 5.0.6
>
> Thanks
>
> 2007/10/26, Ted Steen <[EMAIL PROTECTED]>:
> >
> > Very nice!
> > Dont forget to update the part about the DatePicker. It is now
> > obsolete. T5.0.6 now includes a DateField as a part of the core.
> >
>
> --
> Best wishes,
> Eko SW
> http://swdev.blogs.friendster.com/my_blog/
>



-- 
徐 依伟


Re: T5 book: update

2007-10-31 Thread Eko S.W.
I am sorry, but How can we use DateField in 5.0.6?
I am so late on 5.0.6

Thanks

2007/10/26, Ted Steen <[EMAIL PROTECTED]>:
>
> Very nice!
> Dont forget to update the part about the DatePicker. It is now
> obsolete. T5.0.6 now includes a DateField as a part of the core.
>

-- 
Best wishes,
Eko SW
http://swdev.blogs.friendster.com/my_blog/


Re: T5 book: update

2007-10-31 Thread Eko S.W.
Woaw, can I had the PDF, or I must pay ?
thanks
my personal email is at [EMAIL PROTECTED]

-- 
Best wishes,
Eko SW
http://swdev.blogs.friendster.com/my_blog/


T5: How can I inject a different resource type?

2007-10-31 Thread Michael Lake
Basically, I want to be able to store my component .tml files in a database.
I've been looking at the code, stepping through the debugger, and it seems
that I need to implement org.apache.tapestry.ioc.Resource or perhaps extend
AbstractResource.
ClasspathResouce and ContextResource are classes that already extend
AbstractResource. I assume these are what load the .tml files either from
classpath or from a file on the context.

I'm having trouble navigating the code to the point where I could tell a
component to choose a resource( content of .tml) from an alternate storage.
Can someone point me in the right direction?

I'm not afraid of editing tapesty base code if I have to, although I'd
rather not (perhaps I can inject a custom implementation?)

I'm scared I might be limited to providing the .tml content via URL..is that
so?

Thanks
Michael Lake


T5: persist a list

2007-10-31 Thread Angelo Chen

Hi,

I got a list for a loop:

@Persist("flash")
private List files;

Questions:

1. do i have to files = new List() in my page constructor?
2. why this files never got empty, I can see it even from another browser?
how to empty this list?

Thanks,

A.C.
-- 
View this message in context: 
http://www.nabble.com/T5%3A-persist-a-list-tf4729017.html#a13522171
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: file uploader validation

2007-10-31 Thread Angelo Chen

hi,

solution is very simple, just check the extension in onValidate, if not jpg
recorderror, same as other validation.


Angelo Chen wrote:
> 
> Hi,
> 
> Is there a way to check if file selected by the user is a jpeg file name
> before the uploading starts? thanks.
> 
> A.C.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-file-uploader-validation-tf4725955.html#a13521865
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help with forgetPage method

2007-10-31 Thread Bill Holloway
lalap,

Using the back/forward button on the browser invokes the browser's
internal caching mechanism and is largely beyond the scope of the
server (tapestry) to control.  It is when the browser is *redirected*
back to that page or when the contents of that page are streamed back
to the browser from some listener method that the session data for
that page and that particular user will be "forgotten."

Bill

On 10/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I saw that you had some problems with forgetPage() method, and I was 
> wondering if you could please tell me how can I use this method, I've been 
> searching a lot on the Internet , but I did not find an exemple. I don't even 
> know if this method will be useful to my problem…
>
> So, the problem is when the user refresh/ back / forward the page, these 
> situations can't happen.
>
> Thanks a lot!
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T4.1.3 loop index issues, migrating from 4.0.2

2007-10-31 Thread Dom Couldwell
Any ideas as to when we might get a fix for this?

We're stuck in terms of migrating to 4.1.3 until we get a fix.

Thanks,

Dom

---

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Will there be OGNLsupport

2007-10-31 Thread Jesse Kuhnert
It's possible,  but there are probably a couple things that need to be
addressed properly first.   I think one of Drew's remaining wishes is
to see some of the static classes/configuration re-factored to be more
IoC friendly.   I plan on doing this at some point but am still trying
to keep up with bug reports first.

Of course, it is an open source project - so anyone can try and help
with that if they want.  (with all the usual caveats said help would
have to endure)

On Oct 31, 2007 12:05 PM, Charles Mason <[EMAIL PROTECTED]> wrote:
> Hi All
>
> I was just wondering if there is any way to add OGNL support to
> Tapestry 5 or if there are any plans to do so. I am finding the prop:
> quite limiting. I appreciate it does have extremly good performance
> compared to OGNL but it would be nice to have the choice.
>
> Would it be possible to have an OGNL: prefix for the occasions where
> OGNL would be better than prop:
>
> Charlie M
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Simple servlet with xml output - to tapestry

2007-10-31 Thread llonely

Thank you very much both.

Fernando, I just voted for on bug. Will try to use the patch as well, as I
need namespaces.
Will keep you posted

regards
thanos



Fernando Padilla wrote:
> 
> Yes you can output XML directly from the template with some caveats.
> 
> 1) By default the contentType is "text/html", if you want to change that 
> you can override it by using this annotation on your page class file:
> @Meta("tapestry.response-content-type=text/xml")
> 
> 2) namespaces are totally ignored and stripped out.
> 
> 3) if you use any of the special html elements, then it uses the old 
> html method of not actually closing the tags ( ,  , etc ).  So 
> essentially it outputs invalid xml.  You might have to do some post 
> processing to clean it up..
> 
> 
> possible work around:
> 
> If you need namespaces, or if you need to avoid the "special html tag" 
> handling, you need to look at JIRA issue TAPESTRY-1600.  Go there and 
> vote on the bug, it also has a patch if you're stuck and feeling 
> adventurous.  I have been using the patch for over a month on 
> production, and have gotten response from another person that they are 
> pretty happy with it.
> 
> Go vote for it, for some reason we have gotten zero response from the T5 
> developers on reviewing the patch.  If applying the patch is too much 
> for you and there is still interest, maybe I'll have to maintain a 
> tapestry build with the patch applied..
> 
> 
> 
> 
> 
> llonely wrote:
>> Many thanks Thiago,
>> this is surprisingly helpful!
>> 
>> Is XML output possible on template level? Having a template with the
>> basic
>> structure and update it based on parameter values.
>> 
>> BR
>> 
>> 
>> 
>> 
>> Thiago H de Paula Figueiredo-2 wrote:
>>> On Wed, 31 Oct 2007 09:22:47 -0200, llonely <[EMAIL PROTECTED]> wrote:
>>>
 Hi all,

 I am currently testing tapestry and trying to convert a simple servlet.

 I have a typical servlet that gets parameters and returns xml
>>> Generate the XML output using any method you fancy and then return a  
>>> StreamResponse (in this case, a TextStreamResponse) in your onActivate  
>>> method. Tapestry 5 will not issue a redirect as it does with normal
>>> pages.  
>>> One example is in Howard's blog:  
>>> http://tapestryjava.blogspot.com/2007/08/handling-direct-urls-in-tapestry-5.html.
>>>   
>>> :)
>>>
>>> In previous versions this kind of situation was hard to implement, but
>>> in  
>>> Tapestry 5 it's a piece of cake. :)
>>>
>>> -- 
>>> Thiago H. de Paula Figueiredo
>>> Desenvolvedor, Instrutor e Consultor de Tecnologia
>>> Eteg Tecnologia da Informação Ltda.
>>> http://www.eteg.com.br
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Simple-servlet-with-xml-output---to-tapestry-tf4724274.html#a13512908
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: Will there be OGNLsupport

2007-10-31 Thread Charles Mason
Hi All

I was just wondering if there is any way to add OGNL support to
Tapestry 5 or if there are any plans to do so. I am finding the prop:
quite limiting. I appreciate it does have extremly good performance
compared to OGNL but it would be nice to have the choice.

Would it be possible to have an OGNL: prefix for the occasions where
OGNL would be better than prop:

Charlie M

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: file uploader validation

2007-10-31 Thread Angelo Chen

Hi,

Is there a way to check if file selected by the user is a jpeg file name
before the uploading starts? thanks.

A.C.


-- 
View this message in context: 
http://www.nabble.com/T5%3A-file-uploader-validation-tf4725955.html#a13512340
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 : Localization of input validation

2007-10-31 Thread Nick Westgate

Or just look on the wiki:
http://wiki.apache.org/tapestry/Tapestry5HowToOverrideTheDefaultErrorMessageBanner

Cheers,
Nick.


Marcus wrote:

Hi Stephane,

search this forum for "*T5 How to Override the default banner message"
*
Marcus



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Expression syntax Tapestry 5

2007-10-31 Thread Nick Westgate

Details of prop are here:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/parameters.html

Cheers,
Nick.


Peter Stavrinides wrote:

Thanks Chris, that helps answer my question.
Peter

Chris Lewis wrote:
I could be mistaken, but I think you'll find the "language", if you 
can call it that, pleasantly dumb compared to OGNL. Let me disclaim 
once more - you should consult the docs - but I don't believe there 
are any operators at all. In templates you simply have 3 constructs:


1) Expansions. These are similar to what you find in ant (and maven?), 
where expressions with in ${} are resolved depending on the binding 
prefix.
2) Binding prefixes. Things like "prop:" and "message:" instruct T5 to 
either attempt to resolve a property or a message. There are several 
default prefixes and you can write your own. If you saw fit to have 
operators of some sort, my guess is you'd need to write a binding 
prefix for it (see docs).
3) Property access. The default prefix for component parameters is 
"prop:". Properties are resolved from the containing page or 
component, and are expressed as: object.property. Say you want to 
print the email of the logged in user; your page contains a property 
"user" that in turn has a property "email". T5 uses bean naming 
conventions, so your page must provide access to the "user" property 
via a method getUser(). For it to resolve the "email" property on the 
user object, the user object must have a method getEmail().


hope that helps.

chris

Peter Stavrinides wrote:

Hi all

Can anyone point me to some documentation on writing expressions in 
tapestry templates. I am looking for some examples of  operators and 
general syntax.


Thanks
Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Simple servlet with xml output - to tapestry

2007-10-31 Thread Fernando Padilla

Yes you can output XML directly from the template with some caveats.

1) By default the contentType is "text/html", if you want to change that 
you can override it by using this annotation on your page class file:

@Meta("tapestry.response-content-type=text/xml")

2) namespaces are totally ignored and stripped out.

3) if you use any of the special html elements, then it uses the old 
html method of not actually closing the tags ( , , etc ).  So 
essentially it outputs invalid xml.  You might have to do some post 
processing to clean it up..



possible work around:

If you need namespaces, or if you need to avoid the "special html tag" 
handling, you need to look at JIRA issue TAPESTRY-1600.  Go there and 
vote on the bug, it also has a patch if you're stuck and feeling 
adventurous.  I have been using the patch for over a month on 
production, and have gotten response from another person that they are 
pretty happy with it.


Go vote for it, for some reason we have gotten zero response from the T5 
developers on reviewing the patch.  If applying the patch is too much 
for you and there is still interest, maybe I'll have to maintain a 
tapestry build with the patch applied..






llonely wrote:

Many thanks Thiago,
this is surprisingly helpful!

Is XML output possible on template level? Having a template with the basic
structure and update it based on parameter values.

BR




Thiago H de Paula Figueiredo-2 wrote:

On Wed, 31 Oct 2007 09:22:47 -0200, llonely <[EMAIL PROTECTED]> wrote:


Hi all,

I am currently testing tapestry and trying to convert a simple servlet.

I have a typical servlet that gets parameters and returns xml
Generate the XML output using any method you fancy and then return a  
StreamResponse (in this case, a TextStreamResponse) in your onActivate  
method. Tapestry 5 will not issue a redirect as it does with normal pages.  
One example is in Howard's blog:  
http://tapestryjava.blogspot.com/2007/08/handling-direct-urls-in-tapestry-5.html.  
:)


In previous versions this kind of situation was hard to implement, but in  
Tapestry 5 it's a piece of cake. :)


--
Thiago H. de Paula Figueiredo
Desenvolvedor, Instrutor e Consultor de Tecnologia
Eteg Tecnologia da Informação Ltda.
http://www.eteg.com.br

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 : Localization of input validation

2007-10-31 Thread Marcus
Hi Stephane,

search this forum for "*T5 How to Override the default banner message"
*
Marcus


Help with forgetPage method

2007-10-31 Thread lalapj2706
Hello!

I saw that you had some problems with forgetPage() method, and I was wondering 
if you could please tell me how can I use this method, I’ve been searching a 
lot on the Internet , but I did not find an exemple. I don’t even know if this 
method will be useful to my problem…

So, the problem is when the user refresh/ back / forward the page, these 
situations can’t happen. 

Thanks a lot!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How do I use forgetPage method.

2007-10-31 Thread Laís
Hello!

 

I’d like to know how can I use the forgetPage() method, I’ve been searching
a lot, but I did not find an exemple. I don’t even know if this method will
be useful to my problem…

 

So, the problem is when the user refresh/ back / forward the page, these
situations can’t happen.

 

Thanks a lot!

 

 



Re: Is Tapestry 5 ready?

2007-10-31 Thread Robin Helgelin
On 10/31/07, Galam <[EMAIL PROTECTED]> wrote:
> hi everyone,

Hi.

> Last time when I check the Tapestry mailing list was probably a year a go. I
> have been waited patiently for the arrival of Tapestry 5. Now, it seems it
> is almost there, but technologies evoves fast. Is Tapestry still a better
> framework for building medium to large scale websites when comparing to
> other frameworks like Spring?

That depends what you are looking for, there are people on this list
that run public sites on T5 since many months back.

The general impression is that the current code works really good,
it's more about missing components, synthetic suger, etc.

> What is the final release date for Tapestry 5? How much will change between
> the current 5.0.6 release and the final version? Should I start playing with
> it now or wait until it is final?

I've seen Q1 2008 for 5.0, but don't quote me. I'll say start playing
now, it won't change that much.

-- 
regards,
Robin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Is Tapestry 5 ready?

2007-10-31 Thread Galam
hi everyone,

Last time when I check the Tapestry mailing list was probably a year a go. I
have been waited patiently for the arrival of Tapestry 5. Now, it seems it
is almost there, but technologies evoves fast. Is Tapestry still a better
framework for building medium to large scale websites when comparing to
other frameworks like Spring?

What is the final release date for Tapestry 5? How much will change between
the current 5.0.6 release and the final version? Should I start playing with
it now or wait until it is final?

Thanks.

galam.


Re: Mixing T5 and Guice --- best practices

2007-10-31 Thread Jesse Kuhnert
You may run in to issues wrt hot class reloading,  but maybe not.
Only one way for you to find out. ;)

FYI - I was witness to at least a couple tiny email exchanges between
Howard and Bob discussing their implementations and what kind of
options there might be.   The T5 IoC feature set is just too rich to
be handled by Guice right now without a lot of work being done on the
Guice side. Just didn't want people thinking that Howard just
blindly does his own thing without collaborating with anyone.   They
both understand the issues involved and seem to sort of agree that
things really do work a little differently in many areas.

Maybe someday Guice will support all of the features T5 needs,  but in
the meantime it doesn't - so there's not really anything that can be
done about it without a lot of re-write work being done in Guice.

On Oct 30, 2007 12:45 PM, Jan Vissers <[EMAIL PROTECTED]> wrote:
> Please, please don't 'shoot' me - but if this is the case what would be
> a reason for me to use T5 IoC, other that for injecting stuff into page
> classes?
>
> Thiago H de Paula Figueiredo wrote:
> > On Mon, 29 Oct 2007 23:08:20 -0200, Jan Vissers
> > <[EMAIL PROTECTED]> wrote:
> >> A different question. If I would chose to use Guice as IoC and T5 IoC
> >> simply as a bridge into Guice - which part(s) of T5 as a web app
> >> framework would I be unable to use?
> >
> > AFAIK, none. Of course, Howard can answer this question better than
> > me. :)
> >
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Simple servlet with xml output - to tapestry

2007-10-31 Thread Thiago H de Paula Figueiredo

On Wed, 31 Oct 2007 11:37:43 -0200, llonely <[EMAIL PROTECTED]> wrote:


Many thanks Thiago,
this is surprisingly helpful!


You're welcome. :)

Is XML output possible on template level? Having a template with the  
basic structure and update it based on parameter values.


As far as I know, you can generate any XML output you want in Tapestry 5  
templates, but a redirect will be made (following the redirect-after-post  
design pattern) and the HTTP response content type will not be set to  
text/xml.


Other option would be using some template engine like Velocity or  
FreeMarker to generate your XML.


--
Thiago H. de Paula Figueiredo
Desenvolvedor, Instrutor e Consultor de Tecnologia
Eteg Tecnologia da Informação Ltda.
http://www.eteg.com.br

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Expression syntax Tapestry 5

2007-10-31 Thread Peter Stavrinides

Thanks Chris, that helps answer my question.
Peter

Chris Lewis wrote:
I could be mistaken, but I think you'll find the "language", if you 
can call it that, pleasantly dumb compared to OGNL. Let me disclaim 
once more - you should consult the docs - but I don't believe there 
are any operators at all. In templates you simply have 3 constructs:


1) Expansions. These are similar to what you find in ant (and maven?), 
where expressions with in ${} are resolved depending on the binding 
prefix.
2) Binding prefixes. Things like "prop:" and "message:" instruct T5 to 
either attempt to resolve a property or a message. There are several 
default prefixes and you can write your own. If you saw fit to have 
operators of some sort, my guess is you'd need to write a binding 
prefix for it (see docs).
3) Property access. The default prefix for component parameters is 
"prop:". Properties are resolved from the containing page or 
component, and are expressed as: object.property. Say you want to 
print the email of the logged in user; your page contains a property 
"user" that in turn has a property "email". T5 uses bean naming 
conventions, so your page must provide access to the "user" property 
via a method getUser(). For it to resolve the "email" property on the 
user object, the user object must have a method getEmail().


hope that helps.

chris

Peter Stavrinides wrote:

Hi all

Can anyone point me to some documentation on writing expressions in 
tapestry templates. I am looking for some examples of  operators and 
general syntax.


Thanks
Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Simple servlet with xml output - to tapestry

2007-10-31 Thread llonely

Many thanks Thiago,
this is surprisingly helpful!

Is XML output possible on template level? Having a template with the basic
structure and update it based on parameter values.

BR




Thiago H de Paula Figueiredo-2 wrote:
> 
> On Wed, 31 Oct 2007 09:22:47 -0200, llonely <[EMAIL PROTECTED]> wrote:
> 
>>
>> Hi all,
>>
>> I am currently testing tapestry and trying to convert a simple servlet.
>>
>> I have a typical servlet that gets parameters and returns xml
> 
> Generate the XML output using any method you fancy and then return a  
> StreamResponse (in this case, a TextStreamResponse) in your onActivate  
> method. Tapestry 5 will not issue a redirect as it does with normal pages.  
> One example is in Howard's blog:  
> http://tapestryjava.blogspot.com/2007/08/handling-direct-urls-in-tapestry-5.html.
>   
> :)
> 
> In previous versions this kind of situation was hard to implement, but in  
> Tapestry 5 it's a piece of cake. :)
> 
> -- 
> Thiago H. de Paula Figueiredo
> Desenvolvedor, Instrutor e Consultor de Tecnologia
> Eteg Tecnologia da Informação Ltda.
> http://www.eteg.com.br
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Simple-servlet-with-xml-output---to-tapestry-tf4724274.html#a13509247
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Expression syntax Tapestry 5

2007-10-31 Thread Chris Lewis
I could be mistaken, but I think you'll find the "language", if you can 
call it that, pleasantly dumb compared to OGNL. Let me disclaim once 
more - you should consult the docs - but I don't believe there are any 
operators at all. In templates you simply have 3 constructs:


1) Expansions. These are similar to what you find in ant (and maven?), 
where expressions with in ${} are resolved depending on the binding prefix.
2) Binding prefixes. Things like "prop:" and "message:" instruct T5 to 
either attempt to resolve a property or a message. There are several 
default prefixes and you can write your own. If you saw fit to have 
operators of some sort, my guess is you'd need to write a binding prefix 
for it (see docs).
3) Property access. The default prefix for component parameters is 
"prop:". Properties are resolved from the containing page or component, 
and are expressed as: object.property. Say you want to print the email 
of the logged in user; your page contains a property "user" that in turn 
has a property "email". T5 uses bean naming conventions, so your page 
must provide access to the "user" property via a method getUser(). For 
it to resolve the "email" property on the user object, the user object 
must have a method getEmail().


hope that helps.

chris

Peter Stavrinides wrote:

Hi all

Can anyone point me to some documentation on writing expressions in 
tapestry templates. I am looking for some examples of  operators and 
general syntax.


Thanks
Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Expression syntax Tapestry 5

2007-10-31 Thread Peter Stavrinides

Hi all

Can anyone point me to some documentation on writing expressions in 
tapestry templates. I am looking for some examples of  operators and 
general syntax.


Thanks
Peter

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Mixing T5 and Guice --- best practices

2007-10-31 Thread Kristian Marinkovic
pages and components can be decorated using mixins!
g,
kris




Ognen Ivanovski <[EMAIL PROTECTED]> 
Gesendet von: news <[EMAIL PROTECTED]>
31.10.2007 12:39
Bitte antworten an
"Tapestry users" 


An
users@tapestry.apache.org
Kopie

Thema
Re: Mixing T5 and Guice --- best practices







Jan Vissers wrote:
> Please, please don't 'shoot' me - but if this is the case what would be 
> a reason for me to use T5 IoC, other that for injecting stuff into page 
> classes?

I think the T5 IoC is great, fast, simple and covers 80% of the things 
you  need an IoC container for. Plug, allows you to override a great 
many parts of tapestry which, to me, is a great value. Contributions, I 
wont even mention (myself a long time RCP developer, I consider them a 
must).

Furthermore, if you need a more powerful container (like spring or 
something) you can always plug it in  via an ObjectProvider.

The only things that might be missed at the moment is:

  a) You can't use decorators on pages and components (you could us the 
request processing chain of command, but that might not be so expressive)
  b) decoration of multiple services might not be as expressive as one 
would like it to be if one would like use declarative transaction 
management. Work is being done here 
(http://tapestry.apache.org/tapestry5/tapestry-ioc/decorator.html see 
Targetting multiple services).



-- 
Ognen Ivanovski | [EMAIL PROTECTED]
phone +389 -2- 30 64 532 | fax +389 -2- 30 79 495
Netcetera | 1000 Skopje | Macedonia | http://netcetera.com.mk


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Mixing T5 and Guice --- best practices

2007-10-31 Thread Thiago H de Paula Figueiredo
On Wed, 31 Oct 2007 09:39:36 -0200, Ognen Ivanovski  
<[EMAIL PROTECTED]> wrote:


  b) decoration of multiple services might not be as expressive as one  
would like it to be if one would like use declarative transaction  
management. Work is being done here  
(http://tapestry.apache.org/tapestry5/tapestry-ioc/decorator.html see  
Targetting multiple services).


That page says:

"Note: Another idea will be other ways of matching services: base on  
inheritance of the service interface and/or based on the presence of  
particular class annotations on the service interface. None of this has  
been implemented yet, and can readily be accompllished inside the  
decorator method (which will return null if it decides the service doesn't  
need decoration)."


Well, it's not entirely true. If you write a @Match("*"), Tapestry-IoC  
throws an exception telling that you cannot decorate internal Tapestry-IoC  
services. I'll file a JIRA about this.


--
Thiago H. de Paula Figueiredo
Desenvolvedor, Instrutor e Consultor de Tecnologia
Eteg Tecnologia da Informação Ltda.
http://www.eteg.com.br

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Simple servlet with xml output - to tapestry

2007-10-31 Thread Thiago H de Paula Figueiredo

On Wed, 31 Oct 2007 09:22:47 -0200, llonely <[EMAIL PROTECTED]> wrote:



Hi all,

I am currently testing tapestry and trying to convert a simple servlet.

I have a typical servlet that gets parameters and returns xml


Generate the XML output using any method you fancy and then return a  
StreamResponse (in this case, a TextStreamResponse) in your onActivate  
method. Tapestry 5 will not issue a redirect as it does with normal pages.  
One example is in Howard's blog:  
http://tapestryjava.blogspot.com/2007/08/handling-direct-urls-in-tapestry-5.html.  
:)


In previous versions this kind of situation was hard to implement, but in  
Tapestry 5 it's a piece of cake. :)


--
Thiago H. de Paula Figueiredo
Desenvolvedor, Instrutor e Consultor de Tecnologia
Eteg Tecnologia da Informação Ltda.
http://www.eteg.com.br

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Tapestry-Hibernate, do we have to save()?

2007-10-31 Thread Thiago H de Paula Figueiredo
On Wed, 31 Oct 2007 09:17:52 -0200, Ognen Ivanovski  
<[EMAIL PROTECTED]> wrote:


The question is - how to do it? Better yet, how to do it without  
boilerplate code all around?


tapestry-ioc allows you to write interceptors on service method calls.


I've already done that: http://tapestry-mine.sourceforge.net/hibertapestry/
Methods with a @Transaction annotation (provided by HiberTapestry) are  
invoked inside a transaction. If the method runs without exceptions, the  
transaction is commited. Otherwise, the transaction is aborted and the  
exception rethrown.


I'm planning to add another features like automatic creation of  
ValueEncoders in the near future.


The source is Apache 2-licensed and was not released yet, but I'll do it  
soon.


--
Thiago H. de Paula Figueiredo
Desenvolvedor, Instrutor e Consultor de Tecnologia
Eteg Tecnologia da Informação Ltda.
http://www.eteg.com.br

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Persist or not? help me understand this

2007-10-31 Thread Marcelo C. de Freitas
Angelo,

 We had a situation using T4.1 where some non-persistent
properties where reused in listeners after the page was rendered. It
used to work relatively fine but as the page got more properties it
begun to fail.

 Sometimes it got the right value, other times an old value (?!?!)
and - what happened more often - it switched from null to the right
value as I clicked again and again in the link for the listener.

 Setting it to persistent seems to have fixed the problem.


-- 
Marcelo C. Freitas

IM's:
MSN: [EMAIL PROTECTED]
ICQ: 24263609
Jabber: [EMAIL PROTECTED]
GTalk: [EMAIL PROTECTED]
Yahoo: baterausp

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Mixing T5 and Guice --- best practices

2007-10-31 Thread Ognen Ivanovski

Jan Vissers wrote:
Please, please don't 'shoot' me - but if this is the case what would be 
a reason for me to use T5 IoC, other that for injecting stuff into page 
classes?


I think the T5 IoC is great, fast, simple and covers 80% of the things 
you  need an IoC container for. Plug, allows you to override a great 
many parts of tapestry which, to me, is a great value. Contributions, I 
wont even mention (myself a long time RCP developer, I consider them a 
must).


Furthermore, if you need a more powerful container (like spring or 
something) you can always plug it in  via an ObjectProvider.


The only things that might be missed at the moment is:

 a) You can't use decorators on pages and components (you could us the 
request processing chain of command, but that might not be so expressive)
 b) decoration of multiple services might not be as expressive as one 
would like it to be if one would like use declarative transaction 
management. Work is being done here 
(http://tapestry.apache.org/tapestry5/tapestry-ioc/decorator.html see 
Targetting multiple services).




--
Ognen Ivanovski | [EMAIL PROTECTED]
phone +389 -2- 30 64 532 | fax +389 -2- 30 79 495
Netcetera | 1000 Skopje | Macedonia | http://netcetera.com.mk


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Multiple onActivate?

2007-10-31 Thread Kevin Menard
In some ways I'd agree, in others I wouldn't.  I'm finding cases where T5
really made some simple well-defined aspects from previous generations much
more difficult than they need be.  These will be getting added to JIRA
though.

All in all though, I do like a lot of the improvements.  I'll have to check
out Alexander's book I suppose as well, since the documentation is a bit
lacking at the moment.

-- 
Kevin


On 10/30/07 9:05 PM, in article
[EMAIL PROTECTED], "Marcus"
<[EMAIL PROTECTED]> wrote:

> Kevin,
> 
> On this process, T3 ->T4 ->T5, just keep in mind that Tapestry 5 is much
> more simple.
> 
> Marcus



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Simple servlet with xml output - to tapestry

2007-10-31 Thread llonely

Hi all, 

I am currently testing tapestry and trying to convert a simple servlet.

I have a typical servlet that gets parameters and returns xml

for example http://localhost:8080/myapp/method=login&user=test
result:
 
  ok 
  

after that, return results for user stored in session
http://localhost:8080/myapp/method=info

 
  test 
  

so basically I want something similar in tapestry that:

- will accept parameters
- will use xml as templates and will generate xml results
- will persist the user credentials into the session

My biggest concern is '2'  (xml output). Its not clear to me how should I
configured it. Should it be a service or I can just edit the template (can't
make it return xml). I am still trying to become familiar with tapestry so I
can't completely understand some forum results regarding outputs.

I am using version 5.0.5

Any advice would be very much appreciated.

Thanks


-- 
View this message in context: 
http://www.nabble.com/Simple-servlet-with-xml-output---to-tapestry-tf4724274.html#a13506986
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Tapestry-Hibernate, do we have to save()?

2007-10-31 Thread Ognen Ivanovski

lasitha wrote:

However, your post brings up an interesting question:  will the
object's state be persisted even after validation fails?  My first


Seems obvious that a transaction should be wrapped around the form 
validation (or around the whole request) which would rollback in case of 
valdation errors.


The question is - how to do it? Better yet, how to do it without 
boilerplate code all around?


tapestry-ioc allows you to write interceptors on service method calls. I 
don't think it allows you to write such interceptors around components 
and pages.


I remember that one of the good things you'd get when you'd combine 
struts 1 and spring was that allowing spring to create your actions you 
had full control over when and where transactions started and ended.


I think that it might be a drawback that tapestry 5 does not allow you 
to use the IoC containers AOP facilities on components and pages.



Ognen

P.S. In my Eclipse-RCP project I also use JSF's approach: values are 
kept in the controls (field components) until the form is submitted (ok 
pressed).



--
Ognen Ivanovski | [EMAIL PROTECTED]
phone +389 -2- 30 64 532 | fax +389 -2- 30 79 495
Netcetera | 1000 Skopje | Macedonia | http://netcetera.com.mk


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Persist or not? help me understand this

2007-10-31 Thread Angelo Chen

Hi,

looks like I have to make it @Persist if Long usrID is private, if just the
default it might be persisted even without a @Persist but a warning during
run time, am I right?

A.C.

Angelo Chen wrote:
> 
> Hi,
> 
> I got a little confused with need to @Persist, example as follow, the
> usrID as not persisted, but when user Submit a form, that value is still
> accessible inside OnSuccess, my understanding is, after rendering the
> page, the variable is gone, when form submitted, only persisted variable
> retains their value, any help on clarifying this question? Thanks,
> 
> A.C.
> 
> public class EditPhoto {
> 
> Long usrID;
>  
> public Long getUsrID() {
> return usrID;
> }
> 
> public void setUsrID(Long usrID) {
> this.usrID = usrID;
> }
> 
>Object onSuccess() {
> System.out.println(getUsrID());
> return resources.createPageLink(... );
> }
> 
> 
> above page is invoked by the following code
> 
>  @InjectPage
>   private EditPhoto editPhoto;
> 
>   Object onActionFromEdit(Long id)
> editPhoto.setUsrID(currentUser.getId());
> return editPhoto;
> }
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Persist-or-not--help-me-understand-this-tf4718768.html#a13506749
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5 : Localization of input validation

2007-10-31 Thread Stephane Decleire

Hi,

I can't find the way to localize the default messages provided by 
Tapestry for input validation like :
"You must correct the following errors before you may continue" or "You 
must provide a value for ..."


Any help is welcome.

Stephane