Accessing a version NodeRef via Alfresco REST Api

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
bigs4321
Member II

Accessing a version NodeRef via Alfresco REST Api

Hi All!

I am migrating Media Wiki from using Alfresco Web Services to use Alfresco REST so that ACS 5.2 (or higher) can be used.  The challenge I am facing is how the URLs where stored in Media Wiki for accessing versions within ACS.  When using Web Services the URLS are stored as

alfresco://workspace/SpacesStore/baf0392a-3cca-4840-bbe2-6c72d64fe70e/versionStore/version2Store/172fe7eb-f50f-47b2-b492-0f7e971ef44c

going forward (to simply changes) the url would be something like

alfresco://workspace/SpacesStore/3cc28c63-1988-4525-8eb4-e6c32298241f/versionStore/version2Store/0.3

In working through the REST services, there does not seem to be a way to pull back the NodeRef for a version.  Hopefully there might be a way of doing this, so I can dynamically map between the version noderef to the version label.  I am trying to avoid deploying any custom REST services to perform this action, if possible,

Thanks,

Colin.

2 Replies
Moderator
Moderator

Re: Accessing a version NodeRef via Alfresco REST Api

I don't know where you've looked but the ReST API sure has operations to deal with versions and separate version IDs. Check Alfresco Content Services REST API Explorer  for operations on the version history. One thing to note is that via the ReST API you typically no longer deal with full NodeRefs but only with contextual IDs (which are typically the uid part of the full NodeRef).

bigs4321
Member II

Re: Accessing a version NodeRef via Alfresco REST Api

I have been reviewing the ReST interface via api-explorer and also the blogs provided by Gavin.  There is a Version API which provides the ability to look up version nodes using the workspace node reference and the version id (ie. version label).  There does not appear to be a way to use the version contextual ID which is fair enough.  However there does not appear to be a way to retrieve the version nodeRef via the ReST Version API as a property.

As the volume of content is not that much, I can write a simple script to rewrite the old nodeRefs used by MediaWiki and Alfresco WebServices php client to use the version label instead.

Thanks.