Return-Path: X-Original-To: apmail-cocoon-dev-archive@www.apache.org Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED1B29A94 for ; Fri, 16 Dec 2011 15:06:49 +0000 (UTC) Received: (qmail 32451 invoked by uid 500); 16 Dec 2011 15:06:49 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 32394 invoked by uid 500); 16 Dec 2011 15:06:49 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 32387 invoked by uid 99); 16 Dec 2011 15:06:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2011 15:06:49 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of simone.tripodi@gmail.com designates 209.85.220.179 as permitted sender) Received: from [209.85.220.179] (HELO mail-vx0-f179.google.com) (209.85.220.179) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2011 15:06:40 +0000 Received: by vcbf13 with SMTP id f13so2058453vcb.24 for ; Fri, 16 Dec 2011 07:06:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=d8LjMEAQVYOD/q+dazcZNq59mwspwMbfK6CIGojnASg=; b=ChqPcLS38IPkswwwZZUHtXfjZM0eZL/B+Dhp9eXgiWy06G28Rut0bpiqLKcO835XZk 8iiassJHYPKWdj8mNuGQlWWQSM0xX+vWEiCozJzHQmftkUK0eQKefhEQUOVpv3w6NYbY 2VziDCu7dPv9ijlWdc6eAYA8gka+s5yP2HuVU= MIME-Version: 1.0 Received: by 10.220.214.73 with SMTP id gz9mr3427847vcb.5.1324047979675; Fri, 16 Dec 2011 07:06:19 -0800 (PST) Sender: simone.tripodi@gmail.com Received: by 10.52.75.161 with HTTP; Fri, 16 Dec 2011 07:06:19 -0800 (PST) In-Reply-To: References: <78B923726E7D59429936580CF127E943A1F35896CD@eu1rdcrdc1wx032.exi.nxp.com> <78B923726E7D59429936580CF127E943A1F35897E9@eu1rdcrdc1wx032.exi.nxp.com> Date: Fri, 16 Dec 2011 16:06:19 +0100 X-Google-Sender-Auth: ihqtmKRXsYp5zVj-JnSd7ngsOMQ Message-ID: Subject: Re: [C3] new pipeline component: variabelExpander From: Simone Tripodi To: dev@cocoon.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Nathaniel! *terrific* feedback, you already put me in the condition I'm going to modify the transformer adoption your suggestion! Clear, simple, linear - priceless! I'll let you know when terminated! -Simo http://people.apache.org/~simonetripodi/ http://simonetripodi.livejournal.com/ http://twitter.com/simonetripodi http://www.99soft.org/ On Fri, Dec 16, 2011 at 1:38 PM, Nathaniel, Alfred wrote: > Hi Simone, > > Why this special API call to add it to the pipeline? > > I think is should be a regular transformer you can add any number of time= wherever you need it: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0VariableExpander expander =3D new VariableExpa= nder(); > =C2=A0 =C2=A0 =C2=A0 =C2=A0expander.addProperty( "build.base", "/Users/co= coon" ); > =C2=A0 =C2=A0 =C2=A0 =C2=A0expander.addProperty( "build.home", "${build.b= ase}/workspace" ); > =C2=A0 =C2=A0 =C2=A0 =C2=A0expander.addProperty( "dist.home", "${build.ba= se}/downloads" ); > =C2=A0 =C2=A0 =C2=A0 =C2=A0expander.addProperty( "text.property", "Cocoon= 3 rocks!" ); > > then creating and run their pipeline adding the VariableExpander: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0newNonCachingPipeline().setURLGenerator( > getClass().getResource( "/variables-expander.xml" ) ) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .addTransformer( expander ) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .addSerializer() > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .withEmptyConfiguration() > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .setup( System.out ) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .execute(); > > That makes it also easier to add configuration to the expander, for examp= le: > > * use other marker than ${}, in case you may want generate generate a fil= e using that syntax for its own purposes > * what to do if there if the property name is undefined: replace it by no= thing / leave as is / throw exception > > Also by not just using a stupid property map, it is much easier to avoid = infinite recursions such as setProperty("build.home","${build.home}/workspa= ce"). > > Cheers, Alfred. > > -----Original Message----- > From: simone.tripodi@gmail.com [mailto:simone.tripodi@gmail.com] On Behal= f Of Simone Tripodi > Sent: Donnerstag, 15. Dezember 2011 18:02 > To: dev@cocoon.apache.org > Subject: Re: [C3] new pipeline component: variabelExpander > > Hi Robby :) > > On Thu, Dec 15, 2011 at 5:56 PM, Robby Pelssers = wrote: >> Would it be justified to say that it acts as some kind of transformer (a= lthough non-xslt based) in this case which replaces all variable references= with the value from the Map or Properties provided? > > exactly, it just replaces plain text inside attributes/body elements :P > >>=C2=A0And I suppose it works on any text, not just XML?! >> > > Not ATM, it works as XmlTransformer :( > >> Bring it on ;-) >> > > I'll do, thanks! :) > best; > -Simo > > http://people.apache.org/~simonetripodi/ > http://simonetripodi.livejournal.com/ > http://twitter.com/simonetripodi > http://www.99soft.org/ > > The content of this e-mail is intended only for the confidential use of t= he person addressed. > If you are not the intended recipient, please notify the sender and delet= e this e-mail immediately. > Thank you.