07-04-2018 07:38 AM
07-05-2018 05:02 AM
in which context? In share just go to a folder and create a now folder in it....
07-05-2018 07:14 AM
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.
07-05-2018 07:28 AM
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
07-05-2018 07:33 AM
Thanks!
07-05-2018 07:38 AM
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
07-05-2018 08:24 AM
I didn't know. Thanks! When did this feature come in ?
Explore our Alfresco products with the links below. Use labels to filter content by product module.