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. 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();


This is the bean we want to serialize:

public class MrBean {
   String me = "niko";
   public String getMe() ...
   public void setMe(String me) ...
}

and the resulting exported xml:

<?xml version="1.0" encoding="UTF-8"?>
<sv:node sv:name="MrBean" xmlns:jcr="http://www.jcp.org/jcr/1.0"; xmlns:mgnl="http://www.magnolia.info/jcr/mgnl"; xmlns:mix="http://www.jcp.org/jcr/mix/1.0"; xmlns:rep="internal" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"; xmlns:_pre12="http://www.w3.org/1999/xhtml"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:owfebean="http://www.openwfe.org/owfebean.htm"; xmlns:fn="http://www.w3.org/2004/10/xpath-functions"; xmlns:sv="http://www.jcp.org/jcr/sv/1.0"; xmlns="" xmlns:jcrfn="http://www.jcp.org/jcr/xpath-functions/1.0";>
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>nt:unstructured</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:mixinTypes" sv:type="Name">
        <sv:value>mix:versionable</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:uuid" sv:type="String">
        <sv:value>5b73583f-1318-4d5b-93f1-1db64f5f02aa</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:isCheckedOut" sv:type="Boolean">
        <sv:value>true</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:versionHistory" sv:type="Reference">
        <sv:value>4bcc2957-9b44-4a29-a04d-11e894943cb9</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:baseVersion" sv:type="Reference">
        <sv:value>f52cd767-811c-4839-8026-3f9feffc41cf</sv:value>
    </sv:property>
    <sv:property sv:name="jcr:predecessors" sv:type="Reference">
        <sv:value>f52cd767-811c-4839-8026-3f9feffc41cf</sv:value>
    </sv:property>

    <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>


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to