Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 7203 invoked from network); 27 Mar 2007 06:22:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Mar 2007 06:22:44 -0000 Received: (qmail 73837 invoked by uid 500); 27 Mar 2007 06:22:50 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 73523 invoked by uid 500); 27 Mar 2007 06:22:49 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 73514 invoked by uid 99); 27 Mar 2007 06:22:49 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2007 23:22:49 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2007 23:22:39 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HW52s-0005Fj-If for users@jackrabbit.apache.org; Mon, 26 Mar 2007 23:20:38 -0700 Message-ID: <9687041.post@talk.nabble.com> Date: Mon, 26 Mar 2007 23:20:38 -0700 (PDT) From: alartin To: users@jackrabbit.apache.org Subject: Re: How to start thinking in JCR In-Reply-To: <9e2fff830703262023v7cff25e6q46ab2ae752fe1850@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: alartin@gmail.com References: <9e2fff830703230133s3545cad6pcba50a63b38ce40a@mail.gmail.com> <9631679.post@talk.nabble.com> <9e2fff830703231937p2366d40bwbf99a7173ada7807@mail.gmail.com> <46049C77.8060509@gmail.com> <9e2fff830703232331i68a133edy56afa624ee1bbc75@mail.gmail.com> <46054322.80104@gmail.com> <9e2fff830703262023v7cff25e6q46ab2ae752fe1850@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi Nunny, Nunny wrote: > > Hi, > > On 3/24/07, Brian Thompson wrote: >> >> Comments interleaved below: >> >> Oh, one other thing: In your model, do you ever expect the same image >> to be attached to multiple BlogEntries? > > > Nope, Same image will not be attached to multiple Blog Entires. But if it > is the case, as I understood I should use property of reference type in > the > blog entry which references to a image attachment. Is that the way to > handle > it ? > > >> I went through the Node Type sections of the Jackrabbit site and also >> 6.7Node Types of the JSR 170 specification. As I understood, > > A node type defines the Child nodes and properties it may ( or must ) > have. > > Primary node type must be subtype of either primary or a mixin type and > mixin type may have a super type and it is not a must. > > I have few questions and some of them may be obsolete. But I listed them > down as it is always better have a discussion and get things clarified. > > 1.) In naming node types and properties, do we follow the naming > conventions > used in Java ? > Eg. myFristType > > IMO, Yes. It's better to follow it. > > 2.) What is purpose mixin node type ? Purpose of primary node is to > define > the structure of the node as I understood. What is the advantage of adding > some properties or child nodes via mixin types to a node ? > > I think primary and mixin in JCR are much like class and interface in > Java. > Node must have ONE primary type: Class can only extend one class > Node can have many mixin types: Class can implements many interfaces > In one word, interface provides a function ability, same as mixin and > think > mixin as the interface. You should only define functional properties and > child nodes to mixin > ,for example: uuid to mix:referenceable. uuid is a must property to > achieve that reference ability/funciton > ,so define uuid in the mixin, while cotent (for example) property is > irrelated to that, keep it out of the mixin. > I think you should treat them as you treat class and interface in Java. > Think about when should extend a class > and when should implement an interface and when use interface instead of > extending a class. > > 3.) What is the purpose of primary item of a node type? > IMO, just for the convenient mehtod, it privodes a way to get the primary > item without knowing its name. > > 4.) In a property definition, in Required Type, what does NAME, PATH types > mean ? > > 5.) Is int supported as a property type ? It is not listed under the > property_type in the grammer. > Use long instead of int > > 6.) How to we constraint a property of a node to be unique ( like a > primary > key in RDBMS ) ? > No way. Make your unique entity as a referenceable node A, then make a > node B a property C with reference type, C stores the A's uuid. So you > can get it: Node B -- > > |__C -----> Node A > Thus node B only points to one unique Node A > > > > As you proposed, if we change the hierarchy like this, > > - Users > - Year > - Month > > - Date > > - Blog Entry > > - Comment > > - Rate > > - Image Attachment > > > > In CND notation, > > > > > > [blog:user] > mix:referenceable > > - blog:userID (long) mandatory > > - blog:nickName (string) mandatory > > - blog:email (string) mandatory > > - blog:password (string) mandatory > > + blog:year [blog:year] multiple > > > [blog:year] > > - blog:year (long) mandatory > > + blog:month [blog:month] multiple > > > [blog:date] > > - blog:date (date) > > + blog:blogEntry [blog:blogEntry] multiple > > > [blog:blogEntry] > > - blog:blogEntryID (long) mandatory > > - blog:content (string) mandatory > > - blog:image (binay) multiple > > - blog:rate (long) > > - blog:dateCreated (date) mandatory > > + blog:comment [blog:comment] multiple > > > > [blog:comment] > > - blog:commentID (long) mandatory > > - commenterID (reference) mandatory < blog:user > > - blog:content (string) mandatory > > - blog:dateCreated (date) mandatory > > -- View this message in context: http://www.nabble.com/How-to-start-thinking-in-JCR-tf3452522.html#a9687041 Sent from the Jackrabbit - Users mailing list archive at Nabble.com.