obtaining markup in a page class to send in email

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

obtaining markup in a page class to send in email

Qbyte Consulting
Hi,

What would be the way to implement an email button on a page that sends
some of the markup to someone? Is there a slick way to do this, or is it
more messy like grabbing the markup in JS and passing through the ajax
request?

Anything that would make easier to perform an XML transformation would be
nice as well.

thanks,
John
Reply | Threaded
Open this post in threaded view
|

Re: obtaining markup in a page class to send in email

Thiago H. de Paula Figueiredo
On Thu, 23 Jun 2016 10:25:52 -0300, Qbyte Consulting  
<[hidden email]> wrote:

> Hi,

Hi!

> What would be the way to implement an email button on a page that sends
> some of the markup to someone? Is there a slick way to do this, or is it
> more messy like grabbing the markup in JS and passing through the ajax
> request?

If you're using Tapestry 5.4, use the PartialTemplateRenderer service.  
You'll find one example of its usage in this mailing list's archives.

> Anything that would make easier to perform an XML transformation would be
> nice as well.

That's what XSLT is for. :) Or do you mean making it easier to use XSLT in  
Tapestry?

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: obtaining markup in a page class to send in email

Qbyte Consulting
I am using T5.3.6 and sending the html hidden in the form causes jetty
exceptions, it's too much payload. Look like I have to do something server
side, template rendering from the page class would be ideal. Can I enhance
my app with this Tapestry 5.4 service, or is it incompatible?

Yes some smooth xslt integration would be nice. :)

On Thu, Jun 23, 2016 at 3:08 PM, Thiago H de Paula Figueiredo <
[hidden email]> wrote:

> On Thu, 23 Jun 2016 10:25:52 -0300, Qbyte Consulting <
> [hidden email]> wrote:
>
> Hi,
>>
>
> Hi!
>
> What would be the way to implement an email button on a page that sends
>> some of the markup to someone? Is there a slick way to do this, or is it
>> more messy like grabbing the markup in JS and passing through the ajax
>> request?
>>
>
> If you're using Tapestry 5.4, use the PartialTemplateRenderer service.
> You'll find one example of its usage in this mailing list's archives.
>
> Anything that would make easier to perform an XML transformation would be
>> nice as well.
>>
>
> That's what XSLT is for. :) Or do you mean making it easier to use XSLT in
> Tapestry?
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: obtaining markup in a page class to send in email

Thiago H. de Paula Figueiredo
On Thu, 23 Jun 2016 12:14:42 -0300, Qbyte Consulting  
<[hidden email]> wrote:

> I am using T5.3.6 and sending the html hidden in the form causes jetty
> exceptions, it's too much payload. Look like I have to do something  
> server side, template rendering from the page class would be ideal. Can  
> I enhance my app with this Tapestry 5.4 service, or is it incompatible?

If by "enhance" you mean copying it from the Tapestry 5.4 sources and  
including it in your 5.3 project, it should work. It doesn't use anything  
which isn't in Tapestry for many ears.

> Yes some smooth xslt integration would be nice. :)

JIRA ticket? :)

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: obtaining markup in a page class to send in email

Barry Books-2
While 5.4 has the ability to render templates outside a request i think the
best way to send email is to create a page that renders the HTML you want
to send as email and call it like a web service. This makes development
easy because it's just like building any other Tapestry page. Here is a
service that will call it

https://github.com/trsvax/Jacquard/blob/master/src/main/java/com/trsvax/jacquard/services/WebServiceImpl.java

As far as XSLT goes I'm not sure what you mean. I do a lot of XML/XSLT and
I just have a service that can do transforms. If you want to do XSLT on the
Tapestry render pipeline I've thought about that but the Tapestry DOM can
do mostly the same thing although it a completely different way. Here is
some code that does considerable reworking of the DOM using a MarkupWriter
listener.

https://github.com/trsvax/Jacquard/blob/master/src/main/java/com/trsvax/jacquard/mixins/BeanEditTemplate.java




On Thursday, June 23, 2016, Thiago H de Paula Figueiredo <[hidden email]>
wrote:

> On Thu, 23 Jun 2016 12:14:42 -0300, Qbyte Consulting <
> [hidden email]> wrote:
>
> I am using T5.3.6 and sending the html hidden in the form causes jetty
>> exceptions, it's too much payload. Look like I have to do something
>> server side, template rendering from the page class would be ideal. Can I
>> enhance my app with this Tapestry 5.4 service, or is it incompatible?
>>
>
> If by "enhance" you mean copying it from the Tapestry 5.4 sources and
> including it in your 5.3 project, it should work. It doesn't use anything
> which isn't in Tapestry for many ears.
>
> Yes some smooth xslt integration would be nice. :)
>>
>
> JIRA ticket? :)
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: obtaining markup in a page class to send in email

Thiago H. de Paula Figueiredo
On Fri, 24 Jun 2016 09:58:45 -0300, Barry Books <[hidden email]> wrote:

> As far as XSLT goes I'm not sure what you mean. I do a lot of XML/XSLT  
> and I just have a service that can do transforms. If you want to do XSLT  
> on the Tapestry render pipeline I've thought about that but the Tapestry  
> DOM can
> do mostly the same thing although it a completely different way. Here is
> some code that does considerable reworking of the DOM using a  
> MarkupWriter
> listener.

In my day job, which uses XSLT a lot, we have a  
org.xml.sax.helpers.DefaultHandler (basically, the handler of a SAX  
parser) subclass which pipes the results of an XSLT transformation  
directly into Tapestry DOM elements.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]