event : "changeLoadState"\r
},\r
nodeProvider : {\r
- check : "org.argeo.jcr.ria.provider.INodeProvider" \r
+ check : "org.argeo.jcr.ria.provider.INodeProvider",\r
+ nullable : true\r
}\r
},\r
\r
- construct : function(nodeName, isRoot){\r
+ construct : function(nodeName, nodeProvider, isRoot){\r
this.base(arguments);\r
this._children = {};\r
this._properties = {}; \r
this.setName(nodeName);\r
+ if(nodeProvider){\r
+ this.setNodeProvider(nodeProvider); \r
+ }\r
if(isRoot){\r
this.setPath("");\r
this.setRoot(this);\r
this.getParent().removeChild(this.getName());\r
},\r
\r
- fromXmlString : function(xmlString){\r
- var domDocument = qx.xml.Document.fromString(xmlString);\r
- var root = domDocument.documentElement;\r
- this.fromDomElement(root);\r
- },\r
- \r
fromDomElement : function(domElement){\r
if(domElement.nodeType != 1) return;\r
for(var i=0;i<domElement.attributes.length;i++){\r
var att = domElement.attributes[i];\r
+ if(!this.itemIsRoot() && att.nodeName.substring(0,5) == "xmlns"){\r
+ continue;\r
+ }\r
var property = new org.argeo.jcr.ria.model.Property(att.nodeName);\r
this.addProperty(property);\r
property.fromDomElement(att);\r
for(var i=0;i<domElement.childNodes.length;i++){\r
var child = domElement.childNodes[i];\r
if(child.nodeType != 1) continue;\r
- var jcrChild = new org.argeo.jcr.ria.model.Node(child.nodeName);\r
+ var jcrChild = new org.argeo.jcr.ria.model.Node(child.nodeName, this.getNodeProvider());\r
this.addChild(jcrChild);\r
jcrChild.fromDomElement(child);\r
}\r
- this.setLoadState("loaded");\r
+ //this.setLoadState("loaded");\r
+ },\r
+ \r
+ fromXmlString : function(xmlString){\r
+ var domDocument = qx.xml.Document.fromString(xmlString);\r
+ var root = domDocument.documentElement;\r
+ this.fromDomElement(root);\r
},\r
\r
toXmlString : function(recurse, childrenWriter){\r