Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 99631 invoked from network); 10 Jul 2007 11:38:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jul 2007 11:38:46 -0000 Received: (qmail 10064 invoked by uid 500); 10 Jul 2007 11:38:48 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 10048 invoked by uid 500); 10 Jul 2007 11:38:47 -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 10039 invoked by uid 99); 10 Jul 2007 11:38:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2007 04:38:47 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of quintesse@gmail.com designates 66.249.92.175 as permitted sender) Received: from [66.249.92.175] (HELO ug-out-1314.google.com) (66.249.92.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2007 04:38:44 -0700 Received: by ug-out-1314.google.com with SMTP id a2so1409568ugf for ; Tue, 10 Jul 2007 04:38:23 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=G6B7+z/0lNVfma9HJByGy2Tm/qc/A5G2VhJmQ110fl9Tqr7UAn+dU+V/3jrRQgB+lfDz2pl5qPNyAFe99H/FVh4qwWjtaOKCU8F5IAbhiFDGD2T7B9cbETDHghvHRwaas30uYK8EgWyOXzkvJ496zSHov6m1VqkgmJvrPMrgfOo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VE7EgqBDEmKS6jIkb3zTgC7dWM6wy5EjJbLrPFwiCYpiBD9KwF9TLALmpXcfAj3oz8tTv2T65whF6msPVb5lOM6gJEctGUkx6rwluygM6CKl15VoU42pmi4vGl6bONATm5DT4+uR8l2z3CgpjvGYEUev9qg5Zp+QF0pAPz+hG6c= Received: by 10.78.147.6 with SMTP id u6mr2008157hud.1184067502890; Tue, 10 Jul 2007 04:38:22 -0700 (PDT) Received: by 10.78.145.7 with HTTP; Tue, 10 Jul 2007 04:38:22 -0700 (PDT) Message-ID: <8641fd7c0707100438r180e070m2819019cc3de48a5@mail.gmail.com> Date: Tue, 10 Jul 2007 13:38:22 +0200 From: "Tako Schotanus" To: users@jackrabbit.apache.org Subject: Re: DM Rule #6: Files are Files are Files. In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org Agreed on the nt:file/nt:resource bit. I'm not sure what your reasons are to add extra properties to the resource instead of the file though. Care to elaborate a bit more? :-) On 7/7/07, David Nuescheler wrote: > Explanation: > --- > > If a content model exposes something that even remotely "smells" like > a file or a folder I try to use (or extend from) nt:file, nt:folder > and nt:resource. > > In my experience a lot of generic applications allow interaction with > nt:folder and nt:files implicitly and know how to handle and display > those event if they are enriched with additional meta-information. For > example a direct interaction with file server implementations like > CIFS or Webdav sitting on top of JCR become implicit. > > I think as good rule of thumb one could use the following: If you need > to store the filename and the mime-type then nt:file/nt:resource is a > very good match. If you could have multiple "files" an nt:folder is a > good place to store them. > > If you need to add meta information for your resource, let's say an > "author" or a "description" property, extend nt:resource not the > nt:file. I rarely extend nt:file and frequently extend nt:resource. > > Example > --- > Let's assume that someone would like to upload an image to a blog entry > > /content/myblog/posts/iphone_shipping > > maybe the initial gut reaction would be to add a binary property > containing the picture. > > While there certainly are good usecases to use just a binary property > (let's say the name is irrelevant and the mime-type is implicit) in > this case I would recommend the following structure for my blog > example. > > /content/myblog/posts/iphone_shipping/attachments [nt:folder] > /content/myblog/posts/iphone_shipping/attachments/front.jpg [nt:file] > /content/myblog/posts/iphone_shipping/attachments/front.jpg/jcr:content > [nt:resource] >