Re: CForms tree-model using xml as source?
Simone Gianni <s.gianni <at> thebug.it>
2006-06-01 04:02:49 GMT
this seems to be nice stuff, if you can, why don't you contribute it?
You can do that opening a JIRA issue with "[PATCH]" in the title, a
description of what your code does and how it works, and then attaching
your source code to it.
Fred Vos wrote:
>On Tue, May 30, 2006 at 04:11:57PM +0200, Martijn C. Vos wrote:
>>Is there an easy way to get the data for my tree widget from XML instead of a file
>>structure? I'm reading http://cocoon.apache.org/2.1/userdocs/widgets/widget_tree.html
>>and looking at the samples, and while I think basing a tree on an xml structure is
>>a very cocoon thing to do, I'm getting the impression I'd have to write that
>>What I'd like to be able to do is something like:
>> <fd:tree id="foo" selection="multiple|single">
>> <fd:tree-model type="xml" src="cocoon://tree.xml">
>> <fd:nodes xpath="//node" label=" <at> name"/>
>>Or something along those lines. Doesn't sound too unreasonable, but it looks
>>like it doesn't exist yet. Or am I wrong?
>We needed such an extension too at work. Based on
>org.apache.cocoon.forms.formmodel.tree.DefaultTreeModel, I was able to create
>a widget that reads its contents from an XML document. The current
>implementation is a little ugly but it works. The widget parses the XML
>document (using XOM) and then this document is transformed into the tree
>structure used in DefaultTreeModel.
>I'll send you the sources.
>One improvement we need is the possibility to access extra data in the XML