cancel
Showing results for 
Search instead for 
Did you mean: 

Get 'Company Home' NodeRef [SOLVED]

eolith
Champ on-the-rise
Champ on-the-rise
Hello,

I'm writing and action with the Java Foundation API. My action moves a document to a folder path inside "Company Home".

How can I get the "Company Home" NodeRef in order to use it with the fileFolderService to create folders under it??

Thanks a lot.
6 REPLIES 6

janv
Employee
Employee
Example:


….
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
ResultSet rs = searchService.query(storeRef, SearchService.LANGUAGE_XPATH, "/app:company_home");
NodeRef companyHomeNodeRef = null;
try
{
    if (rs.length() == 0)
    {
        throw new AlfrescoRuntimeException("Didn't find Company Home");
    }
    companyHomeNodeRef = rs.getNodeRef(0);
}
finally
{
    rs.close();
}
….
Regards,
Jan

eolith
Champ on-the-rise
Champ on-the-rise
thanks!! It worked!! Smiley Happy

harishns
Champ in-the-making
Champ in-the-making
Hi,
I am trying to delete the existing node before creating it, is it possible to delete the existing node(file/folder) and create the new node(file/folder)?

Thanks in Advance
Harish

rudyanto
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to get Data Dictionary Content Items values in Company Home.

Any suggestion how to do it?

Best Regards,
rudyanto

sanketgosavi
Champ in-the-making
Champ in-the-making
How can i get noderef of company home by javascript api

kaynezhang
World-Class Innovator
World-Class Innovator
Use companyhome root object,about javascript api please refer to https://docs.alfresco.com/4.0/concepts/API-JS-intro.html