Vadim Gritsenko wrote:

Sylvain Wallez wrote:

... edit complex XML documents stored in BLOBs, and provide an advanced GUI that totally hides the fact that it's an XML file.

The document is loaded in a flowscript global variable (i.e. tied to the session), and lots of woody forms modify their respective parts of this document. When finished, the user clicks a save button and the document is stored in database.



Here comes a question: What's the advantage of lots of forms (with lots of bindings, lots of templates) comparing to just one form, and one binding, and lots of templates? :)


This is not possible when you have repetitive structures in the XML document, as you use the same form on the various instances of these structures (e.g. on description[1], description[2], etc).

Also, a woody form won't validate if some required fiels are not filled, even if not shown in the template.

And finally, I'm not sure that managing a single thousand lines long form definition is a good thing from the project organization point of view ;-)

Ah, and about binding: we write it in the form definitions and not in separate files (see def2binding.xsl). This removes 1/3 of the files ;-)

I found out that the only place forbidding this is readFromRequest() method which cleans up value in form when it's not present in request, and thus, you can't use one form with partial templates. Would it be ok (wise/sane/etc) to add request parameters like getFullyQualifiedName() + ".present" to indicate presense of the widget on the form, and act accordingly?


Or check for getParameter(getFullyQualifiedName()) != null ?

Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com




Reply via email to