As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
How to create subfolder in alfresco ?
in which context? In share just go to a folder and create a now folder in it....
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.
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
Thanks!
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