jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shanmugam Gopal" <haishanmu...@hotmail.com>
Subject File node - Version History
Date Mon, 21 Aug 2006 13:42:40 GMT
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" <shanmugamg@hexaware.com>
>To: <haishanmugam@hotmail.com>
>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


Mime
View raw message