cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a document from a specific site

rodrigoa
Champ in-the-making
Champ in-the-making
Good Morning,

I am quite new using Alfresco, and I am having some problems to get a document from a specific site. In my code below I am creating the file, but what I really want is to get one document from the site "revision". How can I do this?

         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               var site = siteService.getSite("revision");
               var doc1 = userhome.createFile("transform_me1.doc");
            </script>
         </action>

Thanks in advance,

Rodrigo Araujo
1 REPLY 1

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Hi Rodrigo,

You started fine. It should be:


var revisionSite = siteService.getSite("revision");
var documentLibrary = revisionSite.getContainer("documentLibrary");
var myDocument = documentLibrary. childByNamePath("path/to/my/document.doc");

That should work for you.

Adei