I am trying to get the "Custom properties on nt:file and nt:folder nodes" (http://modeshape.wordpress.com/2010/09/01/custom-properties-on-ntfile-and-ntfolder-nodes/) running on a JBOSS AS 5.1 / Modeshape 2.3 software stack.
So I created a "acme.cnd" file and now need to tell Modeshape to find it and add this to the namespace.
My first idea was to put an additional line into the "<jcr:nodeTypes>" section in the "modeshape-services.jar/modeshape-config.xml" file.
But whatever I tried so far, Modeshape doesn't see the file or the contained infos.
Can someone please point out where to put the file or what I am doing wrong here?
You should be able to add this to your configuration file inside the mode:repository tag for your JCR repository, assuming that acme.cnd is located in some location where it is accessible with a resource path of "/acme.cnd". If this doesn't work for you, please post your config file so that we can try it out.
Import the custom node types defined in the named resource (a file at a classpath-relative
path). If there was more than one file with custom node types, we could either add successive
<jcr:nodeTypes ... /> elements or just add all of the files as a comma-delimited string in the
<jcr:nodeTypes mode:resource="/acme.cnd" />
OK - and what (file-)path would it look for?
Say my JBOSS-AS is located at "/servers/jbossas/server/default/" and Modeshape's "modeshape-config.xml" resists inside "/server/default/deploy/modeshape-services.jar/". If I now have the "<jcr:nodeTypes mode:resource="/acme.cnd" />" in this config file - in which directory should I place the "acme.cnd" file?
Since you're deploying ModeShape as a JAR, you have to either have acme.cnd in a directory that's on the classpath either implicitly (like /server/default/conf) or explicitly (like some directory you put into your JBOSS_CLASSPATH environment variable before starting up the server).
Alternatively, you could treat "/acme.cnd" as a file path and put it in the root directory of your filesystem, but there are some obvious flaws with that deployment mechanism.
If it were me and I wanted to externalize 'Shape from any particular webapp or service running on the app server, I would probably make a modeshape directory under /server/default/conf and stick my CND files in there. That way I could patch versions of modeshape-services.jar without overwriting my custom node types.
People who spend more time administering JBoss may be able to find flaws with that approach though.