How to create subfolder in alfresco ?

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

How to create subfolder in alfresco ?

How to create subfolder in alfresco ?

6 Replies
Highlighted
Senior Member II

Re: How to create subfolder in alfresco ?

in which context? In share just go to a folder and create a now folder in it....

Highlighted
Member II

Re: How to create subfolder in alfresco ?

private static void createProjectToMasterSite(String masterSiteId, List<String> projectId,List<String> projectName) {
    String apiurl = api+"alfresco/service/api/site/folder/"+ masterSiteId +"/documentLibrary";
    for(int i =0 ;i<projectName.size();i++)
    {
        String pjId=projectId.get(i);
        String pjName=projectName.get(i);
            System.out.println(pjId + " " + pjName);
            JsonObject obj = new JsonObject();
            obj.addProperty("name", pjId);
            obj.addProperty("title",pjName);
            obj.addProperty("nodeType", "cm:folder");
            post(apiurl, obj, "createProjectToMasterSite()");
            getMembersToFolder(masterSiteId, pjId);
            inheritPermissionProject(projectId.get(i), masterSiteId);
          //  createProjectFolder(masterSiteId, pjId);
    }
}

private static void createProjectSubFoldertoFolder(String masterSiteId,String projeId,String folderName,String[] subFolderName) {
    for(int i = 0; i< subFolderName.length; i++) {
        String sub_folder_name = subFolderName[i];
        String apiurl = api + "alfresco/service/api/site/folder/" + masterSiteId + "/documentLibrary/" + projeId+"/"+folderName;
        JsonObject obj = new JsonObject();
        obj.addProperty("name", sub_folder_name);
        obj.addProperty("nodeType", "cm:folder");
        post(apiurl, obj, "createProjectSubFoldertoFolder");

    }
}

I hope helpful.

Highlighted
Senior Member II

Re: How to create subfolder in alfresco ?

ever looked into the examples on the github repo of Jeff Potts‌ ? jpotts (Jeff Potts) · GitHub 

Or use CMIS or the new Rest-API Alfresco Content Services REST API Explorer 

Highlighted
Member II

Re: How to create subfolder in alfresco ?

Thanks!

Highlighted
Senior Member II

Re: How to create subfolder in alfresco ?

in the new Rest API you can use "createNode" with the relativePath (JSON) property... it will create the whole tree for you if any folders are missing

Highlighted
Member II

Re: How to create subfolder in alfresco ?

I didn't know. Thanks! When did this feature come in ?