RE: XSP: cinclude and map:parameters problem

2004-04-21 Thread Carmona Perez, David

Another solution:

Create the XSP code dynamically through a cocoon sub-pipeline in this way:











The only drawback is that the XSP could get compiled every time.

-Mensaje original-
De: news [mailto:[EMAIL PROTECTED] nombre de Andreas Hartmann
Enviado el: miƩrcoles, 21 de abril de 2004 16:20
Para: [EMAIL PROTECTED]
Asunto: Re: XSP: cinclude and map:parameters problem



olivier demah wrote:

> Andreas Hartmann a e'crit :
>
>> olivier demah wrote:
>>
>> [...]
>>
>>> So i thought ; i had to do something to pass parameters from xsp to
>>> xsp because i "call" news.xsp with cinclude.
>>
>>
>>
>> This does not work. Your compiled XSP is executed _before_ the
>> CInclude transformation, so "including another XSP" is not possible
>> this way.
>
>
> at least its clear :)

You might consider a logicsheet or a helper class for code
reuse in XSPs.

-- Andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


*
Este correo ha sido procesado por el Antivirus del Grupo FCC.
*

*
Este correo ha sido procesado por el antivirus del Grupo FCC.
*

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XSP: cinclude and map:parameters problem

2004-04-21 Thread Andreas Hartmann
olivier demah wrote:

Andreas Hartmann a e'crit :

olivier demah wrote:

[...]

So i thought ; i had to do something to pass parameters from xsp to 
xsp because i "call" news.xsp with cinclude.


This does not work. Your compiled XSP is executed _before_ the
CInclude transformation, so "including another XSP" is not possible
this way.


at least its clear :)
You might consider a logicsheet or a helper class for code
reuse in XSPs.
-- Andreas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: XSP: cinclude and map:parameters problem

2004-04-21 Thread olivier demah
Andreas Hartmann a e'crit :

olivier demah wrote:

[...]

So i thought ; i had to do something to pass parameters from xsp to 
xsp because i "call" news.xsp with cinclude.


This does not work. Your compiled XSP is executed _before_ the
CInclude transformation, so "including another XSP" is not possible
this way.
at least its clear :)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: XSP: cinclude and map:parameters problem

2004-04-21 Thread Andreas Hartmann
olivier demah wrote:

[...]

So i thought ; i had to do something to pass parameters from xsp to xsp 
because i "call" news.xsp with cinclude.
This does not work. Your compiled XSP is executed _before_ the
CInclude transformation, so "including another XSP" is not possible
this way.
-- Andreas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


XSP: cinclude and map:parameters problem

2004-04-21 Thread olivier demah
hi,

i try to pass a  from a  to a 


example of match : do-home-news.html

[pipeline]
   
   
   
   
   
   
   
   
[/pipeline]
then cocoon calls home.xsp page :

[home.xsp]

http://apache.org/xsp";
   xmlns:xsp-request= "http://apache.org/xsp/request/2.0";
   xmlns:esql="http://apache.org/cocoon/SQL/v2";
   xmlns:cinclude="http://apache.org/cocoon/include/1.0";>








[/home.xsp]
now in my news.xsp script i try to use the "action" parameter with the 
value "news" to build my SQL query
[news.xsp]

http://apache.org/xsp";
   xmlns:xsp-request= "http://apache.org/xsp/request/2.0";
   xmlns:esql="http://apache.org/cocoon/SQL/v2";
   xmlns:cinclude="http://apache.org/cocoon/include/1.0";>


private String dateToString_Fr(String ma_date)
{
   if (ma_date.length() < 9) return "";
   String d = ma_date.substring(8, 10);
   String m = ma_date.substring(5, 7);
   String y = ma_date.substring(0, 4);
   String date_fr = d;
   date_fr = date_fr.concat("-");
   date_fr = date_fr.concat(m);
   date_fr = date_fr.concat("-");
   date_fr = date_fr.concat(y);
   return date_fr;
}



String news_category  = parameters.getParameter("action","");

String sql = "";

sql = "SELECT * FROM m_news WHERE news_category = '"+news_category+"' 
AND news_display = 'oui' ORDER BY  news_date DESC";
   
   vieira
   
   sql
   
   
   
   
   
   
   
   
   
   
dateToString_Fr()
   
   
   
   
   
   




[/news.xsp]
unfortunnatly the action parameter is _empty_ :-/

i also tried to give a constaint (news e.g) instead of {2} but action is 
definitivly empty.

So i thought ; i had to do something to pass parameters from xsp to xsp 
because i "call" news.xsp with cinclude.

Regards.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]