OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | exoplatform List | July 2007 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [exoplatform] write files in JCR


jeremie garcia wrote:
> Hi
>
>> In my portlet, I tryed something like the following sample code in
>> order to create a new directory,
>> It seems to work but then this new directory doesn't appear in the
>> ECM file explorer unless I restart my tomcat.
>>
>>            PortalContainer container = PortalContainer.getInstance();
>>            RepositoryService repositoryService = (RepositoryService)
>> container.getComponentInstanceOfType(RepositoryService.class);
>>
>>            Session jcrSession = null;
>>            try {
>>                jcrSession =
>> repositoryService.getRepository().getSystemSession("production");
>>            } catch (RepositoryException e) {
>>                e.printStackTrace();
>>            } catch (RepositoryConfigurationException e) {
>>                e.printStackTrace();
>>            }
>>                                      Node root = null;
>>            try {
>>                root = jcrSession.getRootNode();
>>                NodeIterator lNodes = root.getNodes();
>>                   //test :
>>                    root.addNode("test",NT_UNSTRUCTURED);
>>                    jcrSession.save();
>>             }
>>             catch ......
>>
>> I think , something is missing like a broadcast event ..
>>
>> How can I manage this?
>>
>> thanks
>>
>>
>>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the exoplatform@xxxxxxxxxxxxx 
> mailing list.
> To unsubscribe: mailto:exoplatform-unsubscribe@xxxxxxxxxxxxx
> For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>   
Please try to call:
root = jcrSession.getRootNode();
               NodeIterator lNodes = root.getNodes();
                  //test :
                   root.addNode("test",NT_UNSTRUCTURED);
                   root.save()
                   jcrSession.save();
                   jcrSession.logout();

-- 
Best regard,
Hoa Pham - eXoplatform Viet Nam's team
Ha Noi - Viet Nam.

Email:hoa.pham@xxxxxxxxxxxxxxx
YM: phamvuxuanhoa
Skype:phamvuxuanhoa




<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.