04-10-2017 12:04 PM
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?
04-12-2017 09:45 AM
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?
Explore our Alfresco products with the links below. Use labels to filter content by product module.