How to list files metadata (Creation / Modification dates) for a given folder

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

How to list files metadata (Creation / Modification dates) for a given folder

Hi,

How to list files metadata (File name + Creation & Modification dates) for a given folder ?
Folder can also contain sub-folders.

JSON / CURL then CSV file

Thank you

4 Replies
abhinavmishra14
Advanced

Re: How to list files metadata (Creation / Modification dates) for a given folder

AFAIK, There is no api OOTB that can provide the info you are requesting. May be any V1 APIs may provide some details, search if you can find something. 

You can also write a java backed/js repository WebScript that will execute search against repository. The result set will have list of nodeRefs. Using the nodeRef you can extract all the required info and return json or write to excel/csv.

 

here is an example of js WebScript, you can take reference from here and create/update WebScript's search query accordingly and extract info.

List Folder Info 

you can update the AND query to return cm:content type instead of folder and extract any other additional info as needed

query = query + ' AND (TYPE:"cm:content")';

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
sanjaybandhniya
Intermediate

Re: How to list files metadata (Creation / Modification dates) for a given folder

You can try api-explorer api to get children of given folder.

https://api-explorer.alfresco.com/api-explorer/#!/nodes/listNodeChildren

Kiwi
Member II

Re: How to list files metadata (Creation / Modification dates) for a given folder

Thank you abhinav for your reply.

- I registered the 2 files  desc.xml and html.flt ( .js not yet involved)
- I refreshed the WebScript Extensions Ok

Now what is a site 'test" you referred in the URL
http://127.0.0.1:8080/alfresco/service/abhinav/getFolderInfo?siteShortName=test&skipCount=0&maxCount=100

Site in Alfresco terminology ?  if I want to test the scripts against one of my sites ? I am new to alfresco

Thank you

 

 

 

 

abhinavmishra14
Advanced

Re: How to list files metadata (Creation / Modification dates) for a given folder


Site in Alfresco terminology ?  if I want to test the scripts against one of my sites ? I am new to alfresco

 


Yes Site is a space which you can create via Share interface. To execute the script againt one of your sites, you need to provide the short name of the site. You must register the controller (.get.js) file in order to successfully execute the search query.

~Abhinav
(ACSCE, AWS SAA, Azure Admin)