You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Daniel Süpke <su...@gmx.de> on 2007/01/31 10:43:57 UTC

Using flowscript vars inside xsl files

Hi

I have a xml file from which a form with checkboxes (only) is created
through xslt. The parameter names (from the boxes) are accessed within a
flowscript (cocoon.request.getParameterNames()). Now I want to redisplay
the form site some time later with the according checkboxes already
selected. How would I accomplish that? I somehow need to access the
stored values inside a xsl file.

Regards,
Daniel Süpke

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


Re: Using flowscript vars inside xsl files

Posted by Daniel Süpke <su...@gmx.de>.
Hi,

I've been off for quite I while and just wanted to say thanks to Tobia
and Grzegorz for helping me out (topic from Jan 31).

I've done some good progress, but will surely have some more questions
in the future ;).

Regards,
Daniel Süpke

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


Re: Using flowscript vars inside xsl files

Posted by Tobia <to...@linux.it>.
Daniel,

You can use the JX transformer instead of the JX generator.

Set up a pipeline like this and call it from your flowscript:
 - read the source xml
 - use xslt to fill in jx expressions
 - pass through the jx transformer, which runs the jx expressions
 - use another xslt to adjust the results, if needed

I don't know if you can access the flowscript variables directly from
xslt, that would surely make things simpler, although it would possibly
make stylesheet compilation and inteaction with the cache more complex.


Tobia

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


Re: Using flowscript vars inside xsl files

Posted by Daniel Süpke <su...@gmx.de>.
Hi Jeroen,

I want to avoid using jx as the source xml file may change (the
parameter names/checkboxes might also change) and it would be better if
the source would be left as it is. If I unterstand jx, I need to modify
the source / generate path of the pipeline.

Regards,
Daniel Süpke

Jeroen Reijn schrieb:
> Hi Daniel,
> 
> I think it's best to send the result of your flowscript to a pipeline
> that generates the values within a jx template. Then you can transform
> that XML to your resulting form with the checkboxes enabled.
> 
> Kind regards,
> 
> Jeroen Reijn

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


Re: Using flowscript vars inside xsl files

Posted by Jeroen Reijn <j....@hippo.nl>.
Hi Daniel,

I think it's best to send the result of your flowscript to a pipeline 
that generates the values within a jx template. Then you can transform 
that XML to your resulting form with the checkboxes enabled.

Kind regards,

Jeroen Reijn

Daniel Süpke wrote:
> Hi
> 
> I have a xml file from which a form with checkboxes (only) is created
> through xslt. The parameter names (from the boxes) are accessed within a
> flowscript (cocoon.request.getParameterNames()). Now I want to redisplay
> the form site some time later with the according checkboxes already
> selected. How would I accomplish that? I somehow need to access the
> stored values inside a xsl file.
> 
> Regards,
> Daniel Süpke
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

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


Re: Using flowscript vars inside xsl files

Posted by "Steven D. Majewski" <sd...@virginia.edu>.
On Jan 31, 2007, at 4:43 AM, Daniel Süpke wrote:

> Hi
>
> I have a xml file from which a form with checkboxes (only) is created
> through xslt. The parameter names (from the boxes) are accessed  
> within a
> flowscript (cocoon.request.getParameterNames()). Now I want to  
> redisplay
> the form site some time later with the according checkboxes already
> selected. How would I accomplish that? I somehow need to access the
> stored values inside a xsl file.
>

I'm doing something that may be similar.
I keep info on member institutions in an xml file, which is transformed
and used in several places -- trying to move to having a single file to
update when adding a new user. In one place, I'm transforming this list
into a <select>...<option>... menu with an initial selection via xslt.

Flowscript calls pipeline that begins with jx generator and then calls
xinclude transformer. jx gets parameters passed from flowscript, and
appends default selection param onto xinclude href.
   That pipeline is set get-request-parameters=true, and generates
the menu with the default selection from the xml.

Is this at all similar to what you want to do?

-- Steve Majewski / UVA Alderman Library


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


Re: Using flowscript vars inside xsl files

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Daniel Süpke napisał(a):
> Hi Grzegorz,
>
> it's not for validation; the source file will be transformed to
> different forms depending on the area the user has currently selected
> and he might later select earlier parts again to modify previous
> choices. Validation is not of concern in this part.
>   
I see, your use-case is little bit more complex, but Forms framework
should handle it perfectly. What about generating whole form model
(definition) from xml file and using union and group widgets? This way
Forms will show/hide parts of form accordingly to the user's selections.

Also please provide detailed description of what you want to achieve
then we could tell you how easy it can be done with Cocoon ;-)

-- 
Grzegorz Kossakowski

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


Re: Using flowscript vars inside xsl files

Posted by Daniel Süpke <su...@gmx.de>.
Hi Grzegorz,

it's not for validation; the source file will be transformed to
different forms depending on the area the user has currently selected
and he might later select earlier parts again to modify previous
choices. Validation is not of concern in this part.

Regards,
Daniel Süpke

Grzegorz Kossakowski schrieb:
> Daniel Süpke napisał(a):
> I'm not sure if I understand you correctly but you just want to generate
> your form from data stored in some xml file, and want to redisplay this
> form with information about whick checkboxes were checked, right? Why do
> you want to do this? To display information that user must check more
> checkboxes or so?
> 
> If it's the case (redisplaying form because of some validation error)
> you should use Forms blocks, then just generate form definition and form
> template (rather trivial task this case). That's all, rest belongs to
> the framework.
> 


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


Re: Using flowscript vars inside xsl files

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Daniel Süpke napisał(a):
> Hi
>
> I have a xml file from which a form with checkboxes (only) is created
> through xslt. The parameter names (from the boxes) are accessed within a
> flowscript (cocoon.request.getParameterNames()). Now I want to redisplay
> the form site some time later with the according checkboxes already
> selected. How would I accomplish that? I somehow need to access the
> stored values inside a xsl file.
>   
I'm not sure if I understand you correctly but you just want to generate
your form from data stored in some xml file, and want to redisplay this
form with information about whick checkboxes were checked, right? Why do
you want to do this? To display information that user must check more
checkboxes or so?

If it's the case (redisplaying form because of some validation error)
you should use Forms blocks, then just generate form definition and form
template (rather trivial task this case). That's all, rest belongs to
the framework.

-- 
Grzegorz Kossakowski

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