On Wed, Feb 25, 2009 at 7:53 PM, Korbinian Bachl - privat <[email protected]> wrote: > -> Why do I have to do soo much work for just saving a file? Did I miss > an easier approach?
Why do you think this is "soo much work"? Your code does the following: - save any file - automatic versioning - store metadata along the file - uses standard structure to be compatible with eg. Jackrabbits simple webdav server That's a nice bunch of feature to me ;-) And regarding the somewhat nasty PathNotFoundException: you could use Node.hasNode() instead and simply ignore those PathNotFoundExceptions, that should no longer occur if you do the hasNode() check - all JCR exceptions inherit RepositoryEx, which you already throw in your method. > -> In the Jackrabbit-Doc i haven't found a word about versioning and its > behaviours of childs (neither in the JCR spec) - so how will a > parent-Node that is versioned react when > a, a versioned child changes? > b, a non-versioned child changes? It's covered in the JCR 1.0 spec in section 8.2.11 ff [1]. There is also a nice JCR tutorial that describes those OnParentVersion variants quite nicely [2]. > -> I saw that there is also an OCM; When should one use it and when not? > Would my file-scenario make sense to take usage of the OCM? That depends. My personal opinion is that you don't really need OCM with JCR [3]. Especially for handling binary files as in your case, it does not really help much. [1] http://www.day.com/specs/jcr/1.0/8.2.11_OnParentVersion_Attribute.html [2] http://jtoee.com/jsr-170/the_jcr_primer/5/ [3] http://markmail.org/message/rbq6by26th7kbqeh Regards, Alex -- Alexander Klimetschek [email protected]
