Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 30417 invoked from network); 21 Aug 2006 13:43:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Aug 2006 13:43:11 -0000 Received: (qmail 38301 invoked by uid 500); 21 Aug 2006 13:43:08 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 38263 invoked by uid 500); 21 Aug 2006 13:43:08 -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 38240 invoked by uid 99); 21 Aug 2006 13:43:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Aug 2006 06:43:08 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of haishanmugam@hotmail.com designates 65.54.246.163 as permitted sender) Received: from [65.54.246.163] (HELO bay0-omc2-s27.bay0.hotmail.com) (65.54.246.163) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Aug 2006 06:43:06 -0700 Received: from hotmail.com ([65.54.250.44]) by bay0-omc2-s27.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 21 Aug 2006 06:42:46 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 21 Aug 2006 06:42:45 -0700 Message-ID: Received: from 65.54.250.200 by by115fd.bay115.hotmail.msn.com with HTTP; Mon, 21 Aug 2006 13:42:40 GMT X-Originating-IP: [202.54.128.16] X-Originating-Email: [haishanmugam@hotmail.com] X-Sender: haishanmugam@hotmail.com From: "Shanmugam Gopal" To: dev@jackrabbit.apache.org Cc: users@jackrabbit.apache.org Subject: File node - Version History Date: Mon, 21 Aug 2006 19:12:40 +0530 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 21 Aug 2006 13:42:45.0290 (UTC) FILETIME=[AEC0B8A0:01C6C527] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I have created a file node in repository. Different users can check out and check in this file. At any point of time, I should get the version history like version name, version created time and the user who has created that particular version. >From VersionHistory and Version interfaces, I am able to get the version name and created time for different versions. I am not sure how to maintain the username who has created the versions? Since the nt:file node doesn't accept any property, I couldn't attach the user name as a property to the file node ? Any work around for this ?? >From: "Shanmugam Gopal" >To: >Subject: file node >Date: Mon, 21 Aug 2006 18:59:20 +0530 > > File file = new File("C:\\gif\\bea.gif"); > > MimeTable mt = MimeTable.getDefaultTable(); > > String mimeType = mt.getContentTypeFor(file.getName()); > > if (mimeType == null) { > > mimeType = "application/octet-stream"; > > } > > > > //Adding Image 1 > > Node fileNode = images.addNode(file.getName(), "nt:file"); > > Node resourceNode = fileNode.addNode("jcr:content", >"nt:resource"); > > resourceNode.setProperty("jcr:mimeType", mimeType); > > resourceNode.setProperty("jcr:encoding", ""); > > resourceNode.setProperty("jcr:data", new FileInputStream(file)); > > Calendar lastModified = Calendar.getInstance(); > > lastModified.setTimeInMillis(file.lastModified()); > > resourceNode.setProperty("jcr:lastModified", lastModified); > > > > >*************************************************************************************************************************** >This e-mail communication and any attachments may be privileged and >confidential to Hexaware and are intended only for the >use of the recipients named above. If you are not the intended recipient, >please do not review, disclose, disseminate, >distribute or copy this e-mail and attachments. If you have received this >email in error, please delete the same alongwith >all attachments thereto and notify us immediately at mailadmin@hexaware.com >. >*************************************************************************************************************************** > > _________________________________________________________________ Tried the new MSN Messenger? It�s cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in