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
I didn't know. Thanks! When did this feature come in ?
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.