How to create a folder inside CompanyHome (JAVA) ?
Solved! Go to Solution.
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
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
Hi,
Thanks.
And how can I check a folder existence ?
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);
Thanks.
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.