You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Daniel Ruiz <da...@websolucoes.com.br> on 2007/07/27 21:39:38 UTC

[T4] Gerenating Response -- Component

Hello, 

I´ve been looking the docs and I couldn't find how to do this in the proper
way..

Using the following structure:

public abstract class Viewer extends BasePage {

	@InitialValue("literal:default value message..")
	public abstract void setMessage(String message);
	public abstract String getMessage();

}

pubic abstract class Sender extends BasePage {
	
	@InjectPage("Viewer")
	public abstract Viewer getViewer();

	public IPage onSend() {
		Viewer viewer = getViewer();
		viewer.setMessage("test message");
	***********
		String response = viewer.executeAndGetResponseAsHtml();	//
How to do this?..
	}
}


Little explanation, I just clicked on a DirectLink in Sender class, I need
this method do call another Component with a set of attributes and execute
it background, and get the generated HTML into a string (which I will add as
the the body of an e-mail I will send).. 

I can't find a way to do this, but I think its pretty possible and I'm just
too new in Tapestry to make this work..

Can someone help me in how to get this step to work? - About the method
'executeAndGetResponseAsHtml', I don’t have this method implemented, this is
the part I need help.


Thanks in advance, 



[]'s Daniel Ruiz

Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007
3:59 PM
 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T4] Gerenating Response -- Component

Posted by Igor Drobiazko <ig...@gmail.com>.
Hi,

we tried this approach in our project as well and didn't succeed.
Then we found the approach proposed by Marcus Matern.
After modifying the sources it worked very well.
You can see the sources here:

http://bookie.googlecode.com/svn/trunk/bookie-framework/src/main/java/org/bookie/framework/services/
http://bookie.googlecode.com/svn/trunk/bookie-framework/src/main/java/org/bookie/framework/services/impl/

Best regards

Igor

On 7/27/07, Ben Dotte <be...@gmail.com> wrote:
>
> Hi Daniel,
>
> You might want to take a look at the wiki for some suggestions about
> sending HTML e-mail generated by Tapestry:
>
> http://wiki.apache.org/tapestry/SendingHtmlEmailWithTap
>
> To be honest we have abandoned this approach due to the complexity
> involved and now use FreeMarker for that.
>
> Ben
>
> On 7/27/07, Daniel Ruiz <da...@websolucoes.com.br> wrote:
> > Hello,
> >
> > I´ve been looking the docs and I couldn't find how to do this in the
> proper
> > way..
> >
> > Using the following structure:
> >
> > public abstract class Viewer extends BasePage {
> >
> >         @InitialValue("literal:default value message..")
> >         public abstract void setMessage(String message);
> >         public abstract String getMessage();
> >
> > }
> >
> > pubic abstract class Sender extends BasePage {
> >
> >         @InjectPage("Viewer")
> >         public abstract Viewer getViewer();
> >
> >         public IPage onSend() {
> >                 Viewer viewer = getViewer();
> >                 viewer.setMessage("test message");
> >         ***********
> >                 String response = viewer.executeAndGetResponseAsHtml();
> //
> > How to do this?..
> >         }
> > }
> >
> >
> > Little explanation, I just clicked on a DirectLink in Sender class, I
> need
> > this method do call another Component with a set of attributes and
> execute
> > it background, and get the generated HTML into a string (which I will
> add as
> > the the body of an e-mail I will send)..
> >
> > I can't find a way to do this, but I think its pretty possible and I'm
> just
> > too new in Tapestry to make this work..
> >
> > Can someone help me in how to get this step to work? - About the method
> > 'executeAndGetResponseAsHtml', I don't have this method implemented,
> this is
> > the part I need help.
> >
> >
> > Thanks in advance,
> >
> >
> >
> > []'s Daniel Ruiz
> >
> > Internal Virus Database is out-of-date.
> > Checked by AVG Free Edition.
> > Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007
> > 3:59 PM
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

RE: [T4] Gerenating Response -- Component

Posted by Daniel Ruiz <da...@websolucoes.com.br>.
Thanks Ben, 

I think that's what I need! :D

I'll try to make that work, I've already looked forward in FreeMarker
implementation in case I don’t get that to happen..


[]'s Daniel Ruiz

-----Original Message-----
From: Ben Dotte [mailto:ben.dotte@gmail.com] 
Sent: Friday, July 27, 2007 4:50 PM
To: Tapestry users
Subject: Re: [T4] Gerenating Response -- Component

Hi Daniel,

You might want to take a look at the wiki for some suggestions about sending
HTML e-mail generated by Tapestry:

http://wiki.apache.org/tapestry/SendingHtmlEmailWithTap

To be honest we have abandoned this approach due to the complexity involved
and now use FreeMarker for that.

Ben

On 7/27/07, Daniel Ruiz <da...@websolucoes.com.br> wrote:
> Hello,
>
> I´ve been looking the docs and I couldn't find how to do this in the 
> proper way..
>
> Using the following structure:
>
> public abstract class Viewer extends BasePage {
>
>         @InitialValue("literal:default value message..")
>         public abstract void setMessage(String message);
>         public abstract String getMessage();
>
> }
>
> pubic abstract class Sender extends BasePage {
>
>         @InjectPage("Viewer")
>         public abstract Viewer getViewer();
>
>         public IPage onSend() {
>                 Viewer viewer = getViewer();
>                 viewer.setMessage("test message");
>         ***********
>                 String response = 
> viewer.executeAndGetResponseAsHtml(); // How to do this?..
>         }
> }
>
>
> Little explanation, I just clicked on a DirectLink in Sender class, I 
> need this method do call another Component with a set of attributes 
> and execute it background, and get the generated HTML into a string 
> (which I will add as the the body of an e-mail I will send)..
>
> I can't find a way to do this, but I think its pretty possible and I'm 
> just too new in Tapestry to make this work..
>
> Can someone help me in how to get this step to work? - About the 
> method 'executeAndGetResponseAsHtml', I don't have this method 
> implemented, this is the part I need help.
>
>
> Thanks in advance,
>
>
>
> []'s Daniel Ruiz
>
> Internal Virus Database is out-of-date.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 
> 5/23/2007
> 3:59 PM
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org

Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007
3:59 PM
 

Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007
3:59 PM
 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T4] Gerenating Response -- Component

Posted by Ben Dotte <be...@gmail.com>.
Hi Daniel,

You might want to take a look at the wiki for some suggestions about
sending HTML e-mail generated by Tapestry:

http://wiki.apache.org/tapestry/SendingHtmlEmailWithTap

To be honest we have abandoned this approach due to the complexity
involved and now use FreeMarker for that.

Ben

On 7/27/07, Daniel Ruiz <da...@websolucoes.com.br> wrote:
> Hello,
>
> I´ve been looking the docs and I couldn't find how to do this in the proper
> way..
>
> Using the following structure:
>
> public abstract class Viewer extends BasePage {
>
>         @InitialValue("literal:default value message..")
>         public abstract void setMessage(String message);
>         public abstract String getMessage();
>
> }
>
> pubic abstract class Sender extends BasePage {
>
>         @InjectPage("Viewer")
>         public abstract Viewer getViewer();
>
>         public IPage onSend() {
>                 Viewer viewer = getViewer();
>                 viewer.setMessage("test message");
>         ***********
>                 String response = viewer.executeAndGetResponseAsHtml(); //
> How to do this?..
>         }
> }
>
>
> Little explanation, I just clicked on a DirectLink in Sender class, I need
> this method do call another Component with a set of attributes and execute
> it background, and get the generated HTML into a string (which I will add as
> the the body of an e-mail I will send)..
>
> I can't find a way to do this, but I think its pretty possible and I'm just
> too new in Tapestry to make this work..
>
> Can someone help me in how to get this step to work? - About the method
> 'executeAndGetResponseAsHtml', I don't have this method implemented, this is
> the part I need help.
>
>
> Thanks in advance,
>
>
>
> []'s Daniel Ruiz
>
> Internal Virus Database is out-of-date.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 5/23/2007
> 3:59 PM
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org