On Tue, Oct 24, 2006 at 09:15:25PM +0200, Lars Geldner wrote: > Dear Cocoon users and developers, > > in a pilot project I want to write a CForms tree widget to visualize a > hierarchical structure stored in a database. I've studied the CForms tutorial > at Apache's Cocoon site but the information was very "basic". > Is there any best practice guide/samples how to write a (Java-) Tree Model > based on a database for a tree widget? > > Thanks in advance! > > Regards, > > Lars Geldner
Hello Lars (and Tino), Making a Tree model based on the samples is not easy. For a pilot project we started about a year ago at work, we needed a tree model based on an XML document. I managed to create a working 'thing', but that reads an XML document using an URI, like "file:///path/to/document.xml" or "http://my.domain.org/my/document.xml". It cannot use SAX events, so it cannot use "cocoon:", it uses an extra library (xom) and uses code from the samples. People asked me to submit my code, but I think it's not a good idea to use it, unless you don't have a choice. I'm not an experienced Cocoon developer. The CForms stuff is really difficult to comprehend and I think the tree widget is the most complicated of all widgets. You'll see that the code of the tree widget still has an experimental/demo status. If we had a tree widget that could be initialized with a static piece of XML in the form definition or with an 'external' XML document or using javascript, that would suffice everyone's needs. See the selection list widget. I tried to find out how to change the code for this, but one needs a lot of time to do that, and a tutor. If someone wants to introduce me or others to the CForms code, I'd like to build this, in cooperation with others. Next years hackaton? Anyone? For your tree widget, based on a database, you can use my code as a sample and I can help you getting this tree model working, but I still think the solution in the previous paragraph is the way to go. If you want my code, send me an e-mail and I'll help you until it works. Fred -- |E R | D F | |fred at fredvos dot org |5235 DG 52 NL +31 73 6411833 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]