incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart" <christophe.lomb...@gmail.com>
Subject Re: Folder-File relationship in versioning
Date Mon, 12 Mar 2007 15:49:58 GMT
On 3/9/07, ruchi goel <Ruchi.Goel@sun.com> wrote:
>
> 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.


yes. See the class PersistenceManagerBasicVersionning for more examples.


*//---------------------------------------------------------------------------------------------------------
>             // 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message