cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist ...@wrinkledog.com>
Subject Re: How to create dynamic CForms Template,Definition and binding
Date Wed, 31 Dec 2008 03:07:01 GMT

On Dec 29, 2008, at 12:48 AM, asif_zzz wrote:

>
> Hi,
> Im new to Cocoon ,and im using Cocoon 2.1.10,Spring ORM,Hibernate.
> Till now i've been using static files(CForms  
> template,definition,binding) to
> generate the pages.
>
> Now I need to create the fields based upon a data file(XML file).
> I've parsed the XML file and i've the field names in a List.
> How to do the above scernario??
>
> Anyone please help to solve this problem.


The Cocoon Way™ :-) to solve this would be to take a step back and use  
XLST and Cocoon's own pipeline machinery to generate the CForms  
artifacts for you.  So, you don't have to parse the XML document  
yourself... instead, what you do is:

1) Create XSLT stylesheets to transform your XML source document into  
the definition, binding and template documents

2) Create Cocoon pipeline(s) to process the XML source document  
through the stylesheets you created in step (1)

3) Change the other bits that use the CForms artifacts to get them by  
invoking your pipelines from step (2) (using the "cocoon://" URI  
scheme).

People do this all the time.  There's not all that much to it.  Note  
that there is no actual "file" created for the CForms artifacts using  
this approach... it's just streams.

Just out of curiosity, where are you getting the XML source document  
that you want to create the CForms artifacts from?  Is this a static  
file, or are you generating it dynamically as well?

HTH,
—ml—
Mime
View raw message