Return-Path: X-Original-To: apmail-cocoon-users-archive@www.apache.org Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 87BC110A9B for ; Fri, 14 Mar 2014 05:14:30 +0000 (UTC) Received: (qmail 90012 invoked by uid 500); 14 Mar 2014 05:14:28 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 89547 invoked by uid 500); 14 Mar 2014 05:14:27 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 89534 invoked by uid 99); 14 Mar 2014 05:14:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Mar 2014 05:14:26 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [212.82.96.83] (HELO nm2-vm3.bullet.mail.ir2.yahoo.com) (212.82.96.83) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Mar 2014 05:14:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1394774037; bh=MruWfklEkEyFxAUBNGmP3J1lTDeV6ealT2ClCeO5Iu0=; h=Received:Received:Received:DKIM-Signature:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type; b=YMKC9wD16Vsi+0zGMBnTZXb/hMzA67EEFMCeU7m+hjqyTEaRd5HNykE3YPWf+SaJNe4J23L0yXW38H08YBNB2ihXGxwvSoK92MBZBz5f2PWSSMryXXm+QjTw9iS7QW86t+2KvUvDV3r/eKG6HOhmhG+tuNM3vVCMinklbbIpovw= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; b=fpWPktBXnXB5cN7ptygcl0hyUgxRAVCltWTCWMnvpcPXY03aDScyaOg4rYDuTX9f/TUoSKu3YKoUO5FEb2Ku3zpNnVVJAamVY4BCB+qBTlatkm2ZeKJV9T5limXKFL1RmtOEmFqdhU4nCfFF6wEKqgTA86FCsWCCeqgiKn56n98=; Received: from [212.82.98.54] by nm2.bullet.mail.ir2.yahoo.com with NNFMP; 14 Mar 2014 05:13:57 -0000 Received: from [46.228.39.86] by tm7.bullet.mail.ir2.yahoo.com with NNFMP; 14 Mar 2014 05:13:57 -0000 Received: from [127.0.0.1] by smtp123.mail.ir2.yahoo.com with NNFMP; 14 Mar 2014 05:13:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1394774037; bh=MruWfklEkEyFxAUBNGmP3J1lTDeV6ealT2ClCeO5Iu0=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type; b=FSOEBAVKxU9rL8IyID7EGbSkHdCbsSP2tNfghH9s4rlDEU8vx+tMAzPiewVKjRpnN2dr4eDtH2GdKnUKEXmiPuLUrDbuMxu7tjuaE/FZxAktDiyK2YZazNk/UGRulIbr9Bn8fObs/3d2lMGyhfOOsrrzvHwTe04RDTqFHarsmkI= X-Yahoo-Newman-Id: 489271.66240.bm@smtp123.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: uTWj.WUVM1nF0CQJCw_F8gXaifGBRZFh6qlA19bR1kvAW_t LvmcV6F3pY6KyULXLuUaYb_Kg8S_xI6eBeXUqJvDDrlDgrl3kmGWq7RTFLma f3ZjePvHX.fy9aQDiM787j5Bb3MpqlPApqSLDxIcvBpNhGNtSeF6WOGlkc3w WYsNmSyvKB092oorvSbsMumwFxLa0dqzOpWJyXb49FiIIJW.uL7MIq0ttobC oP2xezwJFyhBiPWp8NdsMrJYpnlIPVVbHqjGR3aMF3UE4Bna7iywvwiho0J9 cHv.bjdv6QVTKjEA9F8uPJYYLa_VVlcDT1PzYDHns4TssbUgc9y_dmKfUFjc zdGeqpzlLDxWg4lYrTddJwgEkwGxRA6dLUwOxOMJdfhUeHGnfBuOFv6CM1Q7 djc2mOIzIYysHjz3Po1KgsQAo2FjF9QMlF7TW.ULp9CpNNGdzJz8YcNQFlrg I1Ad99gHcdeXcrDFVxK6_J6GCZ_8Te5In9OvIRhESMU6wh3gbkLCgGFKCog. 3T56pt72XaA35TZpEx7Jjnqcn.pE.h5yPfeK_Wv_T4RdHNlOkMAsbYfSXPej R93.kG4BLajDCxapBHfRxvcxklq1WdtVumM3UxhqpEVO.BXdTMfddLj7egxc SuS0ygzfwfXQsBTRgtW43xlhUd8TT7jJ41d8YNGNJFJHsLu3Y6J6djcU7VfG k3KMA35dYLqtIsxhE47eJNsnTRLXOv57u7Gs.10kPMbiqbUlMe0CHk0zaeu4 A3P.IMiRSa.bEVuaijctNn1VpZTtD.ac0l0O4sZ6j3KpIFF7a.3SG X-Yahoo-SMTP: yxbNXPWswBAlrg8tAOg0RpIwMcOTVqlEn8R052g3 X-Rocket-Received: from [192.168.178.25] (hansheinrichbraun@77.187.32.169 with plain [188.125.69.59]) by smtp123.mail.ir2.yahoo.com with SMTP; 14 Mar 2014 05:13:57 +0000 UTC Message-ID: <53229014.7020708@yahoo.de> Date: Fri, 14 Mar 2014 06:13:56 +0100 From: Yahoo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: Jexl in embedded Pipeline References: <5313F8D2.4080000@yahoo.de> <53142A94.30407@apache.org> <531645D5.9050506@yahoo.de> <53198E35.4090002@yahoo.de> <531AB7FE.10400@yahoo.de> <532183D3.1060707@yahoo.de> <5321A4FE.9020108@yahoo.de> <5321BA77.10100@yahoo.de> In-Reply-To: Content-Type: multipart/alternative; boundary="------------030209040107050402020002" X-Virus-Checked: Checked by ClamAV on apache.org --------------030209040107050402020002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I found what I want todo. It's not Jexl it's the VelocityEngine I need. Here is the example from spring mail. MimeMessageHelper message = new MimeMessageHelper(mimeMessage); message.setTo(user.getEmailAddress()); message.setFrom("webmaster@csonth.gov.uk");/// could be parameterized.../ Map model = new HashMap(); model.put("user", user); String text = VelocityEngineUtils.mergeTemplateIntoString( velocityEngine, "com/dns/registration-confirmation.vm", model); message.setText(text, true); In my case the text comes from an inline Cocoon Pipeline. I could first import the template use the Velocity Engine and then give it to the Pipeline. or is there possibility to make the job done by the pipeline . Am 13.03.2014 19:34, schrieb gelo1234: > I don't know about the attachments but a clean Cocoon3 extension for > sending emails you can find here: > > https://github.com/alveolo/butterfly/blob/master/cocoon/src/test/java/org/alveolo/butterfly/test/cocoon/email/MailSerializerTest.java > > Greetings, > Greg > > > 2014-03-13 15:02 GMT+01:00 Piratenvisier >: > > An application like this I use already. > Thorsten Scherler made this email Application for me. > The important point: I want to send an email and the Email Text > and the attachements are produced by cocoon pipelines. > This a an important part of my cocoon 2.10 application which I > wanted to transfer to 3.0 > > Am 13.03.2014 14:23, schrieb gelo1234: >> I got lost with your explanation :) It's a kind of awkward thing >> to me that you are actually trying to do with that code. >> >> >> Why not making it clean: >> >> 1. First you need a String-Template match to serialize the >> Hibernate bean -> output XML with final values >> >> >> >> >> >> where bean.xml is your [input] >> >> You can now feed angebot bean data into hibernate/bean pipe above >> (to get it serialized): >> >> >> >> >> >> >> >> @RESTController >> public class BeanController implements Get { >> >> @SitemapParameter >> private String id; >> >> @RequestParameter >> private String name; >> >> // through injection or other way >> >> HibernateDAO dao; >> >> public RestResponse doGet() throws Exception { >> Map data= new HashMap(); >> data.put("angebot", dao.getAngebotBean(id)); >> data.put("name", this.name); >> >> return new Page("servlet:/hibernate/bean", data); >> } >> } >> At this point you got your Hibernate bean serialized (into XML data). >> >> 2. Second you can go for XSLT Transformer and transform XML into >> anything you want >> >> You don't need any JEXL here. >> >> >> Greetings, >> Greg >> >> >> >> >> 2014-03-13 13:30 GMT+01:00 Yahoo > >: >> >> I used the EmailPlainPipe from the distribution: >> byte[] bytes = (byte[]) parameters.get("input"); >> XMLGenerator generator = new XMLGenerator(bytes); >> this.addComponent(generator); >> byte[] xsl = (byte[]) parameters.get("xsl"); >> Source xslSource = new StreamSource(new >> ByteArrayInputStream(xsl)); >> XSLTTransformer transformer = new XSLTTransformer( >> xslSource, new Date().getTime()); >> // pass all parameter to the xslTransformer >> transformer.setParameters(parameters); >> this.addComponent(transformer); >> this.addComponent(TextSerializer.createPlainSerializer()); >> super.setup(outputStream, parameters); >> where input is: >> >> >> $name$$angebot.id $ >> $angebot.anganz$ >> $angebot.angkurzbeschreibung$ >> >> xsl is the identity >> angebot is a Hibernate Bean. >> how do feed the pipeline with this Bean that it is used by >> Jexl to resolve the input String. >> >> >> Am 13.03.2014 12:55, schrieb gelo1234: >>> With servlet-sitemaps Jexl can be used within any pipeline >>> as {jexl:.....} value. >>> >>> Please show example of your embedded pipeline ? >>> >>> Greetings, >>> Greg >>> >>> >>> 2014-03-13 11:09 GMT+01:00 Yahoo >> >: >>> >>> How can I use Jexl in an embadded Pipline ? >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: >>> users-unsubscribe@cocoon.apache.org >>> >>> For additional commands, e-mail: >>> users-help@cocoon.apache.org >>> >>> >>> >> >> > > --------------030209040107050402020002 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I found what I want todo. It's not  Jexl it's the VelocityEngine I need.
Here is the example from spring mail.

   MimeMessageHelper message = new MimeMessageHelper(mimeMessage);
            message.setTo(user.getEmailAddress());
            message.setFrom("webmaster@csonth.gov.uk"); // could be parameterized...
            Map model = new HashMap();
            model.put("user", user);
            String text = VelocityEngineUtils.mergeTemplateIntoString(
               velocityEngine, "com/dns/registration-confirmation.vm", model);
            message.setText(text, true);

In my case the text comes from an inline Cocoon Pipeline.
I could first import the template use the Velocity Engine and then give it to the Pipeline.
or is there possibility to make the job done by the pipeline .

Am 13.03.2014 19:34, schrieb gelo1234:
I don't know about the attachments but a clean Cocoon3 extension for sending emails you can find here:

https://github.com/alveolo/butterfly/blob/master/cocoon/src/test/java/org/alveolo/butterfly/test/cocoon/email/MailSerializerTest.java

Greetings,
Greg


2014-03-13 15:02 GMT+01:00 Piratenvisier <hansheinrichbraun@yahoo.de>:
An application like this I use already.
Thorsten Scherler made this email Application for me.
The important point: I want to send an email and the Email Text and the attachements are produced by cocoon pipelines.
This a an important part of my cocoon 2.10 application which I wanted to transfer to 3.0

Am 13.03.2014 14:23, schrieb gelo1234:
I got lost with your explanation :) It's a kind of awkward thing to me that you are actually trying to do with that code.


Why not making it clean:

1. First you need a String-Template match to serialize the Hibernate bean -> output XML with final values

<map:match pattern="hibernate/bean">
        <map:generate src="bean.xml" type="stringtemplate" />
        <map:serialize type="xml" />
</map:match>
where bean.xml is your [input]

You can now feed angebot bean data into hibernate/bean pipe above (to get it serialized):
<map:match pattern="hibernate/{id}">
        <controller:call controller="rest-controller" select="BeanController">
          <map:parameter name="id" value="{map:id}" />
        </controller:call>
</map:match>


@RESTController
public class BeanController implements Get {

    @SitemapParameter
    private String id;

    @RequestParameter
    private String name;
  
    // through injection or other way

    HibernateDAO dao;

    public RestResponse doGet() throws Exception {
        Map<String, Object> data = new HashMap<String, Object>();
        data.put("angebot", dao.getAngebotBean(id));
        data.put("name", this.name);

        return new Page("servlet:/hibernate/bean", data);
    }
}
At this point you got your Hibernate bean serialized (into XML data).

2. Second you can go for XSLT Transformer and transform XML into anything you want

You don't need any JEXL here.


Greetings,
Greg




2014-03-13 13:30 GMT+01:00 Yahoo <hansheinrichbraun@yahoo.de>:
I used the EmailPlainPipe from the distribution:
  byte[] bytes = (byte[]) parameters.get("input");
        XMLGenerator generator = new XMLGenerator(bytes);
        this.addComponent(generator);
        byte[] xsl = (byte[]) parameters.get("xsl");
        Source xslSource = new StreamSource(new ByteArrayInputStream(xsl));
        XSLTTransformer transformer = new XSLTTransformer(
                xslSource, new Date().getTime());
        // pass all parameter to the xslTransformer
        transformer.setParameters(parameters);
        this.addComponent(transformer);
        this.addComponent(TextSerializer.createPlainSerializer());
        super.setup(outputStream, parameters);
where input is:
<?xml version="1.0" encoding="UTF-8"?>
<angebot>
  <id>$name$$angebot.id$</id>
 <anganz>$angebot.anganz$</anganz>
<angkurzbeschreibung>$angebot.angkurzbeschreibung$</angkurzbeschreibung>
</angebot>
xsl is the identity
angebot is a Hibernate Bean.
how do feed the pipeline with this Bean that it is used  by Jexl to resolve the input String.


Am 13.03.2014 12:55, schrieb gelo1234:
With servlet-sitemaps Jexl can be used within any pipeline as {jexl:.....} value.

Please show example of your embedded pipeline ?

Greetings,
Greg


2014-03-13 11:09 GMT+01:00 Yahoo <hansheinrichbraun@yahoo.de>:
How can I use Jexl in an embadded Pipline ?

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







--------------030209040107050402020002--