Partially answering my own question: 

All you need to do is pass along the dialog you would like to open in the JS 
method:
classDef("mgnl.data.DataTree", {
    create: function(path, dialog){
        ...
    }
    ....
}

So when you klick "New university" in that custom tree, the following 
JavaScript should be executed:
mgnl.data.DataTree.create(${tree}.selectedNode.id, 'university')

So far, so good: The correct dialog is opened. Unfortunately the dialog is now 
also trying to create a node of the type "university" because it uses the 
dialog name for it. So you need to write a custom dialog which gets its type 
info from somewhere else -> most likely from the dialog configuration itself.

So part one is solved: I can configure my tree which opens the dialog I want. 
And I can configure that dialog to create the node type I want.

Next step: Now I need to configure the tree to also use that dialog when 
double-clicking on a node. And since I have multiple node types in my tree I 
somehow need to provide a list like this:
- node type a -> dialog 1
- node type b -> dialog 2
- ...



-will

On 13.09.2011, at 16:34, Will Scheidegger wrote:

> 
> Dear Magnolians
> 
> I'm trying to find a work around for the limitations of hierarchically 
> defined node types. If you have the following node types
> 
> - organization
>       - staff
>               - person
> 
> you cannot have
> 
> - university
>       - staff
>               - person
> 
> You _can_ have it in the JCR node type definitions, but you cannot define the 
> types like this in the data module because it will try to define "staff" and 
> "person" twice and will block it (yes, copying the definitions in the config 
> tree from organization to university does not work either).
> 
> -> IMO it would be better if the data module would define the node types in a 
> flat list and would allow to build the hierarchy separately. 
> 
> But how would you solve the problem above on a short term? My need is to 
> "extend" the organization node with additional attributes. I don't even need 
> a separate node type. The two could be in totally different trees. How can I 
> configure a tree to behave like a organization tree (allowing me to create 
> organizations with staff lists) but display a different dialog for the 
> organizations with additional input elements? The dialogs are selected by the 
> node types. Is there some other way to tell the tree what dialog to use for 
> my node of the type organization?
> 
> Thanks!
> -will
> 
> 
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
> 



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to