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
The NodeRef includes information about the Store, that includes by default one protocol and one identifier.
https://github.com/Alfresco/alfresco-data-model/blob/master/src/main/java/org/alfresco/service/cmr/repository/StoreRef.java#L39
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);