cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Gianni <s.gia...@thebug.it>
Subject Re: CForms tree-model using xml as source?
Date Thu, 01 Jun 2006 04:02:49 GMT
Hi Fred,
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.

Simone

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
>>tree-model myself.
>>
>>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="@name"/>
>>      </fd:tree-model>
>>    </fd:tree>
>>
>>Or something along those lines. Doesn't sound too unreasonable, but it looks
>>like it doesn't exist yet. Or am I wrong?
>>    
>>
>
>Hello Martijn,
>
>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
>document.
>
>Fred
>
>  
>
-- 
Simone Gianni

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


Mime
View raw message