« Return to Thread: Re: dynamic cForm generation

Re: RE: dynamic cForm generation

by Gabriel Gruber-2 :: Rate this Message:

Reply to Author | View in Thread


Hi Patrick!

In order to dynamically create a JX-Template you have to make sure through your pipeline machinery, that you are *NOT* using jx-template generator to create the initial form template.

what you can do however is to delegate the creation to another pipeline, f.i.

            <!-- generate Form Template here without using JX -->
            <map:match pattern="getReportFilterFormTemplate">
                <map:generate type="file" src="resource://at/workflow/webdesk/rp/resources/views/filterSkeleton.xml"/>
                <map:transform type="include"/>
                <map:serialize type="xml"/>
            </map:match>
           
            <!-- Report Form-->
            <map:match pattern="forms/rp/testReportFilter">
                <map:generate type="jx" src="cocoon:/getReportFilterFormTemplate" label="raw"/>
                <map:transform type="browser-update"/>
                    <map:select type="ajax-request">
                        <map:when test="true">
                            <map:select type="request-parameter">
                                <map:parameter name="parameter-name" value="dojo.transport"/>
                                <map:when test="iframe">
                                    <map:transform src="resource://org/apache/cocoon/forms/resources/IframeTransport-bu-styling.xsl"/>
                                    <map:serialize type="xhtml"/><!-- this is really important !!!! -->
                                </map:when>
                                <map:otherwise>
                                    <map:serialize type="xml"/>
                                </map:otherwise>
                            </map:select>                                
                        </map:when>
                        <map:otherwise>
                            <map:serialize type="html"/>
                        </map:otherwise>
                    </map:select>
            </map:match>


Its crucial to NOT use within that 2nd pipeline. you can use other technologies like include-transformer or xslt to accomplish building your form template xml on the fly...

cheers,
gabriel
______________________
Mag. Gabriel Gruber
Senior Consultant
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Workflow EDV GmbH, Dannebergplatz 6/23, A-1030 Wien
http://www.workflow.at



"Patrick Heiden" <patrickheiden@...>

05.06.2009 16:08
Please respond to
users@...

To
users@...
cc
Subject
Re: RE: dynamic cForm generation





Hi Robby,

thanks for your link!
But I am afrait that form-libs will not solve my problem:

"With this feature, it is now possible to define libraries of form definitions and bindings. Specific support for templates was intentionally left out because of the frequently changing and unstructured nature of it."

Also I was not able to see WHY form-libs are suitable for dynamic form-generation (especially because ft's are not supported!).

When I think it over (as a first-shot) it will be a better way to generate the fd-/ft-/ and fb-files out of the domainlayer (according to some change needed) and save the resulting XML-files inside my block-structure. But upfront I was trying not to reinvent the wheel and generate XML by myself :)

Cheers,
Patrick

-------- Original-Nachricht --------
> Datum: Fri, 5 Jun 2009 14:25:34 +0200
> Von: "Robby Pelssers" <robby.pelssers@...>
> An: users@...
> Betreff: RE: dynamic cForm generation

> We've done the same thing in the past but back then they were already
> working on a form library.
>
> http://cocoon.apache.org/2.1/userdocs/formlibraries.html
>
> Why don't you see if this will fill your needs.
>
> Robby
>
> -----Original Message-----
> From: Patrick Heiden [mailto:patrickheiden@...]
> Sent: Friday, June 05, 2009 2:08 PM
> To: users@...
> Cc: rashel.s@...
> Subject: Re: dynamic cForm generation
>
> Hello together!
>
> Has anybody (maybe Rashel Shehata him/herself) solved the issue mentioned
> in
>
> http://markmail.org/message/delryq7vo2t34keb
>
> There Rashel tries to generate fd and ft dynamically and gets the
> following error:
>
> org.apache.cocoon.forms.FormsRuntimeException: The template cannot find a
> form object
>
> I am stuck at the same point and very interested in solutions!
>
> Best regards,
> Patrick
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...

--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

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


 « Return to Thread: Re: dynamic cForm generation