Getting site documents information

cancel
Showing results for 
Search instead for 
Did you mean: 
etm
Member II

Getting site documents information

Hello,

I want to retreive all of one site documents information, my site has 1300 documents so it would be a pain to do that manually

I want to get :

File name

File path

File version

Publication date

Publication status

Publisher

I searched online and found that webscripts can help me do that, but i do not know what i should write in my script in order to get these informations. Could someone help me write the script or send me one that is already ready for deployement?

1 Reply
etm
Member II

Re: Getting site documents information

I was able to get document list with informations i needed, i used this webscript

getChildren.get.desc.xml

<webscript>
<shortname>Get Documents</shortname>
<description>Display all Documents within Folder</description>
<url>/getChildren</url>
<format default="json">argument</format>
<authentication>user</authentication>
</webscript>

getChildren.get.js

function main()
{
var node = [];
node = search.luceneSearch("PATH:\"/app:company_home/st:sites/cm:yoursitename//*\"");
model.totalItems = node.length;
model.results = node;

} main();

getChildren.get.json.ftl

totalItems": "${totalItems}
Name;Type;Path;Creator;Created;Modifier;Modified
<#list results as node>
<#if node.isDocument>
${node.name};${node.mimetype};${node.displayPath};${node.properties.creator};${(node.properties.created)?date};${node.properties.modifier};${(node.properties.modified)?date}

</#if>
<#if (node_index + 1 < results?size)></#if>
</#list>

Access it via http://127.0.0.1/alfresco/s/getChildren 

As you can see i got the informations i needed. But i can see that there are still some properties left that i didn't know how to get them. I can't find the names on node explorator

These are custom properties, is there any way to retrieve them?