You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Florian Leinberger <le...@seitenbau.com> on 2006/01/17 09:57:02 UTC

Dynamic CF Forms: JX, XSLT or Flowscript? (Performance!)

Hi,

I have a Cocon Form. Depending on the rights of the User, parts of the form
(i.e. a repeater, a group, widgets) should be shown or hidden. In the flowscript
I have the information weather the user has the right to see a special part of
the form or not.

I see three possibilities how to achieve this:

a) Setting the widgetstate in the flowscript depending on the rights of the user
(desadvantage: I don`t really have full control over the layout of the form in
just showing/hiding the widgets, difficult for groups,...).

b) Parsing the form-template with an additional own xsl-Stylesheet (we have done
this before, works allright, problem though when reloading the form)

c) Using jx-Templates (probably the easiest solution to handle)

Performance is very much of a concern for us. The portal we have built on Cocoon
is frequented by many users and performance isn´t very well already today. So we
are hesitating to apply JX to a huge part of our forms. But maybe this is wrong
and it´s better than adding own xsl-transformations to the forms? Can anybody
share any experiences or thoughts on this? 

a) b) or c) ?

Thanks a lot, Florian 



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


Re: Dynamic CF Forms: JX, XSLT or Flowscript? (Performance!)

Posted by Florian Leinberger <le...@seitenbau.com>.
Jason Johnston <cocoon <at> lojjic.net> writes:

Thanks a lot for your advice. As we are stuck with Cocoon 2.17 I guess I have to
live with layout limitations and use setWidgetState in the flowscript.

Cheers, Florian


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


Re: Dynamic CF Forms: JX, XSLT or Flowscript? (Performance!)

Posted by Jason Johnston <co...@lojjic.net>.
Florian Leinberger wrote:
> Hi,
> 
> I have a Cocon Form. Depending on the rights of the User, parts of the form
> (i.e. a repeater, a group, widgets) should be shown or hidden. In the flowscript
> I have the information weather the user has the right to see a special part of
> the form or not.
> 
> I see three possibilities how to achieve this:
> 
> a) Setting the widgetstate in the flowscript depending on the rights of the user
> (desadvantage: I don`t really have full control over the layout of the form in
> just showing/hiding the widgets, difficult for groups,...).
> 
> b) Parsing the form-template with an additional own xsl-Stylesheet (we have done
> this before, works allright, problem though when reloading the form)
> 
> c) Using jx-Templates (probably the easiest solution to handle)
> 
> Performance is very much of a concern for us. The portal we have built on Cocoon
> is frequented by many users and performance isn´t very well already today. So we
> are hesitating to apply JX to a huge part of our forms. But maybe this is wrong
> and it´s better than adding own xsl-transformations to the forms? Can anybody
> share any experiences or thoughts on this? 

There is a known issue with performance of JX macros that affects CForms 
template evaluation, in the version of JX currently included in Cocoon 
2.1.x.  However, on the dev list there is currently a vote underway to 
include the new refactored version of JX from the 2.2 trunk into 2.1.9, 
which IIUC solves that performance issue so that it is now as fast or 
faster than the FormsTransformer.  FWIW.

> a) b) or c) ?

I'd probably suggest a combination of a) and c).  c) will give you the 
most control over the template, but keep in mind that the template is 
merely a view of the form model, it doesn't lock down parts of that 
model.  So if you were to hide a section of the form in the template but 
leave those widgets active in the form model, then a crafty user could 
still manipulate those parts of the model by sending the appropriate 
request parameters manually.  If security is at all a concern for you 
then you'll also want to make sure the form model is locked down. 
Widget states are probably the best way to achieve that (another way is 
to dynamically generate your definition/binding via cocoon:// requests 
but that's messy and slow.)

If you're worried about widget states not giving you enough control over 
presentation, keep in mind that if you use JX you have access to the 
form model in the JX expressions, so in your template you could use the 
widget states of certain fields/groups to perform more complex 
conditionals than just showing/hiding fields or groups.

Just my thoughts, hope that helps.
--Jason






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