Thanks for the reply. As far as I can tell, there are no standard mixin node types that would fit the bill, so I will need to build one (creating a mixin node type seems like a good solution). (Or can I add in a primary type like nt:unstructured as a mixin type?)
Is there a link that has good step by step instructions as to how to do this? Can I make a new node type in the "mix" namespace (such as "mix:authored"), or do I also need to create a new namespace? Any suggestions as far as architecting this? Can this be done in a configuration file? I am still trying to find a page that shows an example cnd file. Thanks, ken Julian Reschke wrote: > > kenclark wrote: >> >> As you will see, I am very new to Jackrabbit and JCR in general. >> >> I am working on storing binary content using nt:file. I have this >> working. >> >> I would like to keep track of the user id of the user that saved the >> binary >> content. It is clear to me that I can't just add a property of whatever >> name I like -- I need to (apparently) configure a new node type which >> extends from "jcr:content" (or maybe "nt:resource", I can't be sure.) >> >> I have been googling my head off for about an hour, and am totally unable >> to >> figure out how to do this. >> >> So: >> >> 1) Is it correct that I need to make a new node type? > > Only if the node type you have doesn't allow residual properties (in > which case you can just go ahead and set new properties). This is > probably not the case here, otherwise you'd already be doing it. But it > could be the case on other JCR implementations. > > An alternative would be to go hunting for a existing *mixin* type that > does allow setting arbitrary properties, and try to add it to given node > instance. > >> 2) How do I define it and then register it? I would like this to be done >> in >> a portable way if possible so that I can hook up to different >> implementations of JCR without having to rewrite. > > Not possible with JCR 1.0, but part of the JCR 2.0 (potentially the most > important change!). > >> 3) I have a web app which will be using this. I assume the node type >> only >> needs to be registered once, but is that once per server startup or once >> ever or what? What is the best architecture for doing this setup? > > It would need to be done once. > >> 4) Why is it so complicated to add a new property -- or have I totally >> missed the easy way to do this? > > The JCR spec allows "strict" node types and "flexible" node types (which > is good). Jackrabbit implements "nt:file/nt:resource" exactly as > specified in the JCR spec, so doesn't make them less strict that they > need to be. Not sure why. > > > BR, Julian > > > -- View this message in context: http://www.nabble.com/Adding-a-new-property-tp19565880p19570513.html Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
