You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Frank Hamilton <ii...@hotmail.com> on 2009/03/24 14:46:59 UTC

jx:marco TAG

Hello,

I try make a rss reader in my publication with apache Rome.
I integrate Rome with lenya. In the java usecase handler get the content of
notice like:

List<String> lst =   "<div >  ...  Notice1... </div>","<div >  ... 
Notice1... </div>",...

then setParameter("lst",lst) and I need put this html code in my jx file.

Using <jx:macro tag 

<jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml">
	<jx:parameter name="list" />
	<jx:forEach var="item" items="${list}">
			${item}
	</jx:forEach>
</jx:macro>

<rss list="${usecase.getParameter('lst')}" />

But the xhtml result is :

 &lt;div &gt;&lt;img
src='http://infocar.dgt.es/etraffic/img/ICONenTABLAS/INCIDtablRETE.gif'
alt='RETENCION' title='RETENCION' class='ftl' /&gt;&lt;img ...

html entities apear in the code, i need write the <div tag ... to include in
xhtml page.

It´s possible pass the ${item} like a html code not like a text.

Thank very much.







-- 
View this message in context: http://www.nabble.com/jx%3Amarco-TAG-tp22680769p22680769.html
Sent from the Lenya - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: jx:marco TAG

Posted by Frank Hamilton <ii...@hotmail.com>.


Thorsten Scherler-4 wrote:
> 
> On Tue, 2009-03-24 at 07:06 -0700, Frank Hamilton wrote:
>> 
>> 
>> Andreas Hartmann wrote:
>> > 
>> > Hi Frank,
>> > 
>> > Frank Hamilton schrieb:
>> >> I try make a rss reader in my publication with apache Rome.
>> >> I integrate Rome with lenya. In the java usecase handler get the
>> content
>  > >> of
>> >> notice like:
>> >> 
>> >> List<String> lst =   "<div >  ...  Notice1... </div>","<div >  ... 
>> >> Notice1... </div>",...
>> > 
>> > I would strongly discourage this, since you're mixing business logic 
>> > with layout.
> 
> My question is why you are not using a transformer or a simple pipeline
> to do he transformation. I echo Andreas concerns here. There are
> examples in the cocoon samples that are working with rss a more standard
> way then to inject the feed via a usecase.
> 
> salu2
> 
>> > 
>> >> then setParameter("lst",lst) and I need put this html code in my jx
>> file.
>> >> 
>> >> Using <jx:macro tag 
>> >> 
>> >> <jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml">
>> >> 	<jx:parameter name="list" />
>> >> 	<jx:forEach var="item" items="${list}">
>> >> 			${item}
>> >> 	</jx:forEach>
>> >> </jx:macro>
>> >> 
>> >> <rss list="${usecase.getParameter('lst')}" />
>> >> 
>> >> But the xhtml result is :
>> >> 
>> >>  &lt;div &gt;&lt;img
>> >>
>> src='http://infocar.dgt.es/etraffic/img/ICONenTABLAS/INCIDtablRETE.gif'
>> >> alt='RETENCION' title='RETENCION' class='ftl' /&gt;&lt;img ...
>> >> 
>> >> html entities apear in the code, i need write the <div tag ... to
>> include
>> >> in
>> >> xhtml page.
>> >> 
>> >> It´s possible pass the ${item} like a html code not like a text.
>> > 
>> > Can't you use something like this?
>> > 
>> > List<String> lst = "Notice1", "Notice2", …
>> > 
>> > <jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml">
>> >    <jx:parameter name="list" />
>> >    <jx:forEach var="item" items="${list}">
>> >      <div>${item}</div>
>> >    </jx:forEach>
>> > </jx:macro>
>> > 
>> > If you include the XML markup in the parameters, generating the view 
>> > will be very difficult, since you have to apply subsequent 
>> > transformations to parse the entities etc. I'd recommend to add all 
>> > markup in the JX template or in XSLT transformations.
>> > 
>> > -- Andreas
>> > 
>> > 
>> > -- 
>> > Andreas Hartmann, CTO
>> > BeCompany GmbH
>> > http://www.becompany.ch
>> > Tel.: +41 (0) 43 818 57 01
>> > 
>> > 
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
>> > For additional commands, e-mail: dev-help@lenya.apache.org
>> > 
>> > 
>> > 
>> 
>> 
>> Thank Andreas, the problem is that the param is like this:
>> 
>> <div class="incidenciaHome"  >
>> http://infocar.dgt.es/etraffic/img/ICONenTABLAS/INCIDtablCON.gif	 
>> http://infocar.dgt.es/etraffic/img/ICONenTABLAS/NIVtablVERD.gif
>> <strong>A-4
>> </strong>/ CARRIL INCORPORACION  CONOS / 07:06<abbr
>> title='horas'>h</abbr> -
>> 24-03-2009<br/> <p> SEVILLA  (SEVILLA) del km. 546.0 al 545.0. Sentido:
>> DECRECIENTE DE LA KILOMETRICA </p> </div>
>> 
>> Then I need to reparsen the outPut form Rome api and add all markup in
>> jx.
>> 
>> Thanks.
> 
> -- 
> Thorsten Scherler <scherler.at.gmail.com>
> Open Source <consulting, training and solutions>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
> 
> 
> 


Hello Thor, thanks for you response.

All my new module, will work with transformer and pipeline, sure, but you
known that have a lot of work make with usecase framework and my boss need
the work for yesterday, you know.
I need some time for think like cocoon pipeline, and look the documentation. 
Any rate, I´m parse the output from Rome and my rss usecase work fine.

:drunk:
-- 
View this message in context: http://www.nabble.com/jx%3Amarco-TAG-tp22680769p22696396.html
Sent from the Lenya - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: jx:marco TAG

Posted by Thorsten Scherler <sc...@gmail.com>.
On Tue, 2009-03-24 at 07:06 -0700, Frank Hamilton wrote:
> 
> 
> Andreas Hartmann wrote:
> > 
> > Hi Frank,
> > 
> > Frank Hamilton schrieb:
> >> I try make a rss reader in my publication with apache Rome.
> >> I integrate Rome with lenya. In the java usecase handler get the content
> >> of
> >> notice like:
> >> 
> >> List<String> lst =   "<div >  ...  Notice1... </div>","<div >  ... 
> >> Notice1... </div>",...
> > 
> > I would strongly discourage this, since you're mixing business logic 
> > with layout.

My question is why you are not using a transformer or a simple pipeline
to do he transformation. I echo Andreas concerns here. There are
examples in the cocoon samples that are working with rss a more standard
way then to inject the feed via a usecase.

salu2

> > 
> >> then setParameter("lst",lst) and I need put this html code in my jx file.
> >> 
> >> Using <jx:macro tag 
> >> 
> >> <jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml">
> >> 	<jx:parameter name="list" />
> >> 	<jx:forEach var="item" items="${list}">
> >> 			${item}
> >> 	</jx:forEach>
> >> </jx:macro>
> >> 
> >> <rss list="${usecase.getParameter('lst')}" />
> >> 
> >> But the xhtml result is :
> >> 
> >>  &lt;div &gt;&lt;img
> >> src='http://infocar.dgt.es/etraffic/img/ICONenTABLAS/INCIDtablRETE.gif'
> >> alt='RETENCION' title='RETENCION' class='ftl' /&gt;&lt;img ...
> >> 
> >> html entities apear in the code, i need write the <div tag ... to include
> >> in
> >> xhtml page.
> >> 
> >> It´s possible pass the ${item} like a html code not like a text.
> > 
> > Can't you use something like this?
> > 
> > List<String> lst = "Notice1", "Notice2", …
> > 
> > <jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml">
> >    <jx:parameter name="list" />
> >    <jx:forEach var="item" items="${list}">
> >      <div>${item}</div>
> >    </jx:forEach>
> > </jx:macro>
> > 
> > If you include the XML markup in the parameters, generating the view 
> > will be very difficult, since you have to apply subsequent 
> > transformations to parse the entities etc. I'd recommend to add all 
> > markup in the JX template or in XSLT transformations.
> > 
> > -- Andreas
> > 
> > 
> > -- 
> > Andreas Hartmann, CTO
> > BeCompany GmbH
> > http://www.becompany.ch
> > Tel.: +41 (0) 43 818 57 01
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> > For additional commands, e-mail: dev-help@lenya.apache.org
> > 
> > 
> > 
> 
> 
> Thank Andreas, the problem is that the param is like this:
> 
> <div class="incidenciaHome"  >
> http://infocar.dgt.es/etraffic/img/ICONenTABLAS/INCIDtablCON.gif	 
> http://infocar.dgt.es/etraffic/img/ICONenTABLAS/NIVtablVERD.gif <strong>A-4
> </strong>/ CARRIL INCORPORACION  CONOS / 07:06<abbr title='horas'>h</abbr> -
> 24-03-2009<br/> <p> SEVILLA  (SEVILLA) del km. 546.0 al 545.0. Sentido:
> DECRECIENTE DE LA KILOMETRICA </p> </div>
> 
> Then I need to reparsen the outPut form Rome api and add all markup in jx.
> 
> Thanks.

-- 
Thorsten Scherler <scherler.at.gmail.com>
Open Source <consulting, training and solutions>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: jx:marco TAG

Posted by Andreas Hartmann <an...@apache.org>.
Hi Frank,

Frank Hamilton schrieb:

[…]

> Thank Andreas, the problem is that the param is like this:
> 
> <div class="incidenciaHome"  >
> http://infocar.dgt.es/etraffic/img/ICONenTABLAS/INCIDtablCON.gif	 
> http://infocar.dgt.es/etraffic/img/ICONenTABLAS/NIVtablVERD.gif <strong>A-4
> </strong>/ CARRIL INCORPORACION  CONOS / 07:06<abbr title='horas'>h</abbr> -
> 24-03-2009<br/> <p> SEVILLA  (SEVILLA) del km. 546.0 al 545.0. Sentido:
> DECRECIENTE DE LA KILOMETRICA </p> </div>
> 
> Then I need to reparsen the outPut form Rome api and add all markup in jx.

maybe this thread helps:

http://www.nabble.com/JX-templating---XML-td14701516.html

-- Andreas



-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: jx:marco TAG

Posted by Frank Hamilton <ii...@hotmail.com>.


Andreas Hartmann wrote:
> 
> Hi Frank,
> 
> Frank Hamilton schrieb:
>> I try make a rss reader in my publication with apache Rome.
>> I integrate Rome with lenya. In the java usecase handler get the content
>> of
>> notice like:
>> 
>> List<String> lst =   "<div >  ...  Notice1... </div>","<div >  ... 
>> Notice1... </div>",...
> 
> I would strongly discourage this, since you're mixing business logic 
> with layout.
> 
>> then setParameter("lst",lst) and I need put this html code in my jx file.
>> 
>> Using <jx:macro tag 
>> 
>> <jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml">
>> 	<jx:parameter name="list" />
>> 	<jx:forEach var="item" items="${list}">
>> 			${item}
>> 	</jx:forEach>
>> </jx:macro>
>> 
>> <rss list="${usecase.getParameter('lst')}" />
>> 
>> But the xhtml result is :
>> 
>>  &lt;div &gt;&lt;img
>> src='http://infocar.dgt.es/etraffic/img/ICONenTABLAS/INCIDtablRETE.gif'
>> alt='RETENCION' title='RETENCION' class='ftl' /&gt;&lt;img ...
>> 
>> html entities apear in the code, i need write the <div tag ... to include
>> in
>> xhtml page.
>> 
>> It´s possible pass the ${item} like a html code not like a text.
> 
> Can't you use something like this?
> 
> List<String> lst = "Notice1", "Notice2", …
> 
> <jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml">
>    <jx:parameter name="list" />
>    <jx:forEach var="item" items="${list}">
>      <div>${item}</div>
>    </jx:forEach>
> </jx:macro>
> 
> If you include the XML markup in the parameters, generating the view 
> will be very difficult, since you have to apply subsequent 
> transformations to parse the entities etc. I'd recommend to add all 
> markup in the JX template or in XSLT transformations.
> 
> -- Andreas
> 
> 
> -- 
> Andreas Hartmann, CTO
> BeCompany GmbH
> http://www.becompany.ch
> Tel.: +41 (0) 43 818 57 01
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
> 
> 
> 


Thank Andreas, the problem is that the param is like this:

<div class="incidenciaHome"  >
http://infocar.dgt.es/etraffic/img/ICONenTABLAS/INCIDtablCON.gif	 
http://infocar.dgt.es/etraffic/img/ICONenTABLAS/NIVtablVERD.gif <strong>A-4
</strong>/ CARRIL INCORPORACION  CONOS / 07:06<abbr title='horas'>h</abbr> -
24-03-2009<br/> <p> SEVILLA  (SEVILLA) del km. 546.0 al 545.0. Sentido:
DECRECIENTE DE LA KILOMETRICA </p> </div>

Then I need to reparsen the outPut form Rome api and add all markup in jx.

Thanks.

-- 
View this message in context: http://www.nabble.com/jx%3Amarco-TAG-tp22680769p22681172.html
Sent from the Lenya - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: jx:marco TAG

Posted by Andreas Hartmann <an...@apache.org>.
Hi Frank,

Frank Hamilton schrieb:
> I try make a rss reader in my publication with apache Rome.
> I integrate Rome with lenya. In the java usecase handler get the content of
> notice like:
> 
> List<String> lst =   "<div >  ...  Notice1... </div>","<div >  ... 
> Notice1... </div>",...

I would strongly discourage this, since you're mixing business logic 
with layout.

> then setParameter("lst",lst) and I need put this html code in my jx file.
> 
> Using <jx:macro tag 
> 
> <jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml">
> 	<jx:parameter name="list" />
> 	<jx:forEach var="item" items="${list}">
> 			${item}
> 	</jx:forEach>
> </jx:macro>
> 
> <rss list="${usecase.getParameter('lst')}" />
> 
> But the xhtml result is :
> 
>  &lt;div &gt;&lt;img
> src='http://infocar.dgt.es/etraffic/img/ICONenTABLAS/INCIDtablRETE.gif'
> alt='RETENCION' title='RETENCION' class='ftl' /&gt;&lt;img ...
> 
> html entities apear in the code, i need write the <div tag ... to include in
> xhtml page.
> 
> It´s possible pass the ${item} like a html code not like a text.

Can't you use something like this?

List<String> lst = "Notice1", "Notice2", …

<jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml">
   <jx:parameter name="list" />
   <jx:forEach var="item" items="${list}">
     <div>${item}</div>
   </jx:forEach>
</jx:macro>

If you include the XML markup in the parameters, generating the view 
will be very difficult, since you have to apply subsequent 
transformations to parse the entities etc. I'd recommend to add all 
markup in the JX template or in XSLT transformations.

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org