On Fri, Aug 20, 2010 at 11:41 AM, Thomas Lustig <[email protected]> wrote:
> Dear all
>
> I am using Jackrabbit 2.1 and I would like to add two custom String
> Properties to the Nodetypes
> nt:unstructured and nt:resource. This is for storing an ID and a classname
> representation of the Hibernate Objects
> I du this by adding a Mixin Type defined in the custom_nodetypes.xml file
you shouldn't mess around with jackrabbit internal files.
there's an api to register custom node types.
>
> In Java i used it this way:
> ..........
> filenode.addMixin("myns:javaobject");
> filenode.setProperty("myns:javaclass", myclass);
> filenode.setProperty("myns:hibernateid", myuuid);
> .........
>
> everthing works fine until i restart the jackrabbit server. Then the two
> properties added to the nodes is lost.
did you call session.save()?
cheers
stefan
> What is done wrong there?
> Do i have to do something extra to store my additional nodetypes permanently
> to get the data after the reboot of jackrabbit server?
> Could anyone tell me how i could solve my problem; this would be really
> great!
>
> ----------------- my custom_nodetypes.xml in folder \repository\nodetypes
> -------------
> <nodeTypes xmlns:myns="my-namespace"
> xmlns:nt="http://www.jcp.org/jcr/nt/1.0">
>
> <nodeType name="myns:javaobject"
> isMixin="true" hasOrderableChildNodes="false" primaryItemName=""
> isAbstract="false">
> <supertypes>
> <supertype>nt:base</supertype>
> </supertypes>
>
> <propertyDefinition name="myns:hibernateid"
> requiredType="String"
> autoCreated="false"
> mandatory="false"
> onParentVersion="COPY"
> protected="false"
> multiple="false"/>
>
> <propertyDefinition name="myns:javaclass"
> requiredType="String"
> autoCreated="false"
> mandatory="false"
> onParentVersion="COPY"
> protected="false"
> multiple="false"/>
>
> </nodeType>
> </nodeTypes>
> -------------------------------------------------------------------------------------
>
>
> Thanks again in advance for helping me
> best regards
> thomas
>