what is companyHome in alfresco NodeRef example

613 views Asked by At

Here it is told how to get a list of children of a NodeRef. Here is the code:

 List<ChildAssociationRef> children = nodeService.getChildAssocs(c);
       for (ChildAssociationRef childAssoc : children) {
           NodeRef childNodeRef = childAssoc.getChildRef();
           // Use childNodeRef here.
       }

What is the parameter companyHome, what type is it and the most important is how to get it from the process?

1

There are 1 answers

0
Krutik Jayswal On

companyHome is a root node in alfresco of files which we are creating or uploading.

Below code sample which you have given is for iterating childrens of node c, where c can be folder(space) or file in alfresco file system.In alfresco files are called content and folders are called space.

 List<ChildAssociationRef> children = nodeService.getChildAssocs(c);
       for (ChildAssociationRef childAssoc : children) {
           NodeRef childNodeRef = childAssoc.getChildRef();
           // Use childNodeRef here.
       }

For retrieving company home node you can use search service and use lucene search for that. Below is link for lucene search.

https://wiki.alfresco.com/wiki/Search

For understanding search service you can use any of below link.

https://wiki.alfresco.com/wiki/Search

https://wiki.alfresco.com/wiki/Search