Powered By Blogger

Tuesday, November 3, 2015

Getting NodeRef of CompanyHome

 NodeRef getCompanyHomeNodeRef(){
        NodeRef companyNoderef = null ;
        NodeRef parentRef =    nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
        //NodeRef companyNodeRef  = nodeService.getChildByName(parentRef, ContentModel.ASSOC_CONTAINS, "Company Home");
        QName qname = QName.createQName(NamespaceService.APP_MODEL_1_0_URI, "company_home");
        List assocRefs = nodeService.getChildAssocs(parentRef, ContentModel.ASSOC_CHILDREN, qname);
        if(assocRefs != null){
            companyNoderef =  assocRefs.get(0).getChildRef();
        }else{
            LOGGER.error("Not able to find the Company Home nodeReference");
        }      
        return companyNoderef;
    }
    

1 comment:

  1. Hi,

    We are conducting Free Webinar on ALFRESCO in coming 20th July.For more details Kindly contact
    Saurabh +918553576305
    Email-saurabh@maxmunus.com
    Skype-saurabhmaxmunus
    Website- www.maxmunus.com

    ReplyDelete