cancel
Showing results for 
Search instead for 
Did you mean: 

Need Alfresco share webscript to get the list of all sites,folder, files and space occupied by them.

anujsharma
Confirmed Champ
Confirmed Champ

Can anyone please share webscript to get the list of all sites,folder, files and the space occupied by them.

1 ACCEPTED ANSWER

kaynezhang
World-Class Innovator
World-Class Innovator

folder path parameter should be cn:name property,for example in my environment

http://localhost:8080/alfresco/s/dir/公司主页?verbose=true  (of course chinese character need to be encoded)will work

View answer in original post

13 REPLIES 13

kaynezhang
World-Class Innovator
World-Class Innovator

Please visit http://serverSmiley Tongueort/alfresco/s/index/all  and login with admin account.

This page will list all webscripts installed .

I am following the tutorial Developing a Folder Listing web script | Alfresco Documentation 

But i am getting 404 folder not found error for Company Home as described here :

http status code 404 - Alfresco webscript can't find Company Home folder - Stack Overflow 

Stuck on this !!

kaynezhang
World-Class Innovator
World-Class Innovator

Could you please attach your customized webscript here?

dir.get.desc.xml
<webscript>
<shortname>Folder Listing Utility</shortname>
<description>
Sample demonstrating the listing of folder contents
</description>
<url>/dir/{folderpath}?verbose={verbose?}</url>
<format default="html">extension</format>
<authentication>guest</authentication>
</webscript>
dir.get.html.ftl

<html>   <head>     <title>Folder ${folder.displayPath}/${folder.name}</title>   </head>   <body>     <p>Alfresco ${server.edition} Edition v${server.version} : dir</p>     <p>Contents of folder ${folder.displayPath}/${folder.name}</p>     <table>     <#list folder.children as child>        <tr>            <td><#if child.isContainer>d</#if></td>            <#if verbose>               <td>${child.properties.modifier}</td>               <td><#if child.isDocument>                  ${child.properties.content.size}</#if></td>               <td>${child.properties.modified?date}</td>            </#if>            <td>${child.name}</td>        </tr>     </#list>     </table>   </body> </html>

dir.get.js
// extract folder listing arguments from URI var verbose = (args.verbose == "true" ? true : false); var folderpath = url.templateArgs.folderpath;  // search for folder within Alfresco content repository var folder = roothome.childByNamePath(folderpath);  // validate that folder has been found if (folder == undefined || !folder.isContainer) {    status.code = 404;    status.message = "Folder " + folderpath + " not found.";    status.redirect = true; }  // construct model for response template to render model.verbose = verbose; model.folder = folder;

and 

i am trying hitting the url : http://localhost:8080/alfresco/service/dir/{folderpath}?verbose={verbose?} 

but getting the error

i have also tried with the url :  http://localhost:8080/alfresco/service/dir/Company%20Home?verbose=true 

but getting the same error

ycoulon
Employee
Employee

Hi,

IMO the 404 tells us that your webscript is not correctly deployed on Alfresco.

Can you find your webscript using this URL : http://hostSmiley Tongueort/alfresco/service/index/uri/  ?

Yann


Webscript is correctly deployed

 i am able to see the webscript after hitting this url

Please see the below image :-

kaynezhang
World-Class Innovator
World-Class Innovator

folder path parameter should be cn:name property,for example in my environment

http://localhost:8080/alfresco/s/dir/公司主页?verbose=true  (of course chinese character need to be encoded)will work

Hi,

Please can you tell how to browse to this page (the screenshot which you have given).

kaynezhang
World-Class Innovator
World-Class Innovator

http://localhost:8080/alfresco/

click Alfresco Administration Console (admin only) and login with admin user.

in left tree click node browser.

Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.