You could also directly do :
...
JcrBeanCoder.encode(node.getJCRNode(), o);
the save() is included in it.
(...)
<sv:node sv:name="bean">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:unstructured</sv:value>
</sv:property>
<sv:property sv:name="class" sv:type="String">
<sv:value>com.irb3.xmlrpc.server.XmlRpcHandler$MrBean</
sv:value>
</sv:property>
<sv:property sv:name="field__Me" sv:type="String">
<sv:value>niko</sv:value>
</sv:property>
</sv:node>
</sv:node>
I'd particularly like some feedback and suggestions on how I named
nodes and properties. It's XML inspired for now and I think Xpath
wouldn't mind such names, but JCR vets here have probably better
ideas.
I would say that the name of the node should be the name of then bean
(name of the property or variable). Perhaps you have to provide a
name to the encode method:
myBean = new MyBean();
myBean.setName("gugu");
Encoder.encode(myBean, "myBean");
-->
<sv:node sv:name="myBean">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:unstructured</sv:value>
Is there a reason for the prefix field_? I think we should avoid this
prefixes if possible to make the properties transparent. If we use
the code for the configuration we will have this field_ prefix
everywhere. I think we better use prefixes/namespaces for persisting
related information like the class or similar.
Philipp
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------