Hi all,
On 9/12/06, Nicolas Modrzyk <[email protected]> wrote:
See below for an example of the serilization of a bean on a magnolia
instance.
We are trying, from the JcrBeanCoder, to just use the JCR interfaces,
which limits and complicates a bit what we want to achieve.
I think we should start taking care of namespaces.
The current (HEAD) implementation has the namespace code commented
out. It didn't work, but this was probably related to the fact we were
not using nt:unstructured at this point.
We should try putting it back in.
I need to create
first an nt:unstructured node, where the bean can be serialized.
(Otherwise the magnolia hierachy prevents from adding non-regular
children to the main node)
I'd be happy to get a bit of feedback on this.
Nicolas,
========================================================================
========================================
The java code used to call the bean:
Content node = magnoliaHierarchyManager.createContent
("/","fakeName",ItemType.NT_UNSTRUCTURED);
JcrBeanCoder coder = new JcrBeanCoder(node.getJCRNode());
coder.encode(o);
node.getParent().save();
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.
Best regards,
John
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------