incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi goel <Ruchi.G...@Sun.COM>
Subject Folder-File relationship in versioning
Date Fri, 09 Mar 2007 12:30:19 GMT
Hi,
     My Folder is  non-versionable but Files under the folder are 
versionable. The test which is in PersistenceManagerJcrNodeTypeTest.java 
adds file as child of folder .So, you do
persistenceManager.insert(folder);    *
*persistenceManager.save();

How will I do the checkout and checkin separately for file ? I believe 
,  I need to do  save and checkin  the file independently from folder.

 *//---------------------------------------------------------------------------------------------------------
            // Insert a  folder (class mapped to jcr:folder) with one 
file (class mapped to jcr:file)
           
 //---------------------------------------------------------------------------------------------------------
  
         
            Resource resource = new Resource();
            resource.setData(new ByteArrayInputStream("this is the 
content".getBytes()));            
            resource.setLastModified(Calendar.getInstance());
            resource.setMimeType("plain/text");
            File file = new File();    
            file.setResource(resource);
            
            
            Folder folder = new Folder();
            folder.setPath("/folder1");
            folder.addChild(file);
            
            persistenceManager.insert(folder);            
            persistenceManager.save();

*
Thanks,
Ruchi*
*

Mime
View raw message