Hello,
I think this should be a simple thing but I'm not finding any information to get a nodeRef from a nodeId.
Is there any way to do this through the Java api?
Best regards,
Francisco Duarte
Solved! Go to Solution.
The NodeRef includes information about the Store, that includes by default one protocol and one identifier.
Default stores are the Workspace(StoreRef STORE_REF_WORKSPACE_SPACESSTORE = new StoreRef(PROTOCOL_WORKSPACE, "SpacesStore")) and the Archive (StoreRef STORE_REF_ARCHIVE_SPACESSTORE = new StoreRef(PROTOCOL_ARCHIVE, "SpacesStore")).
The nodeId (by itself) doesn't include information about the Store, so you need to add this information to build a NodeRef.
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACES_STORE, nodeId);
The NodeRef includes information about the Store, that includes by default one protocol and one identifier.
Default stores are the Workspace(StoreRef STORE_REF_WORKSPACE_SPACESSTORE = new StoreRef(PROTOCOL_WORKSPACE, "SpacesStore")) and the Archive (StoreRef STORE_REF_ARCHIVE_SPACESSTORE = new StoreRef(PROTOCOL_ARCHIVE, "SpacesStore")).
The nodeId (by itself) doesn't include information about the Store, so you need to add this information to build a NodeRef.
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACES_STORE, nodeId);
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.