03-16-2019 06:52 AM
03-16-2019 12:03 PM
Hi,
You can create folder inside Company Home using repository service.
Ex.
String folderName = String.valueOf(new Date().getTime());
HashMap<QName, Serializable> props = new HashMap<QName, Serializable>();
props.put(ContentModel.PROP_NAME, folderName);nodeService.createNode(repository.getCompanyHome(), ContentModel.ASSOC_CONTAINS, QName.createQName(folderName),
ContentModel.TYPE_FOLDER, props);
Thanks,
Sanjay
03-16-2019 12:03 PM
Hi,
You can create folder inside Company Home using repository service.
Ex.
String folderName = String.valueOf(new Date().getTime());
HashMap<QName, Serializable> props = new HashMap<QName, Serializable>();
props.put(ContentModel.PROP_NAME, folderName);nodeService.createNode(repository.getCompanyHome(), ContentModel.ASSOC_CONTAINS, QName.createQName(folderName),
ContentModel.TYPE_FOLDER, props);
Thanks,
Sanjay
03-18-2019 05:23 AM
Hi,
Thanks.
And how can I check a folder existence ?
03-18-2019 09:22 AM
Hi,
You can use getChildByName() method of NodeService to check that given name folder is exist or not.
Ex.
nodeService.getChildByName(folderNode, ContentModel.ASSOC_CONTAINS,Constants.HELP_DOCUMENTS);
03-18-2019 09:31 AM
Thanks.
Explore our Alfresco products with the links below. Use labels to filter content by product module.