cancel
Showing results for 
Search instead for 
Did you mean: 

retriving the version

mandalinaveen
Champ on-the-rise
Champ on-the-rise
Hi,

How to retrieve the content of a specific document version?

Thanks,
Naveen.
8 REPLIES 8

nazakatalfresco
Champ in-the-making
Champ in-the-making
You can use VersionService API to get version document's content. This Interface have many method like createVersion, deleteVersion, currentVersion.

nazakatalfresco
Champ in-the-making
Champ in-the-making
You can use VersionService API to get version document's content. This Interface have many method like createVersion, deleteVersion, currentVersion.

Hi,
I have a requirement where I have to retrieve a specific version which may not be the latest version. How do we retrieve the versions which are not the latest versions? The noderef is always point to the latest version. Do we have any node id available for each version?

Thanks,
Naveen.

kaynezhang
World-Class Innovator
World-Class Innovator
It depends on what api are you using. java foundation api? javascript api ? webscript api? cmis api ?

Hi Kaynezhang,

We are using web scripts.

Thanks,
Naveen.

kaynezhang
World-Class Innovator
World-Class Innovator
You can use folloing webscript api


GET /alfresco/service/api/node/content{property}/{store_type}/{store_id}/{id}?a={attach?}&streamId={streamId?}
GET /alfresco/service/api/path/content{property}/{store_type}/{store_id}/{nodepath}?a={attach?}&streamId={streamId?}
GET /alfresco/service/api/node/{store_type}/{store_id}/{id}/content{property}?a={attach?}&streamId={streamId?}
GET /alfresco/service/api/path/{store_type}/{store_id}/{nodepath}/content{property}?a={attach?}&streamId={streamId?}

rememeber you should use your store_id is version2Store
for example

      String uid = "fa6237f1-5925-4e69-98ad-9731492c2d3f";
      String apiurl = "http://localhost:8080/alfresco/service/api/node/workspace/version2Store/'+uid+'/content";

Hi Kaynezhang,

Thanks for your info. My last query is how do I capture the uid of the document? The UUID is same for all the versions but is there any property which can specify the version specific id.

Thanks,
Naveen.

kaynezhang
World-Class Innovator
World-Class Innovator


Use following webscript api to get all versions for a node, parse the returned xml you'll get a specified version uid.

GET /alfresco/service/api/node/{store_type}/{store_id}/{id}/versions?filter={filter?}&includeAllowableActions={includeAllowableActions?}
GET /alfresco/service/api/path/{store_type}/{store_id}/{nodepath}/versions?filter={filter?}&includeAllowableActions={includeAllowableActions?}

for example

      String uid = "1565a32e-7863-45af-a9fa-b68ad206b5e7";
      String apiurl = "http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/'+uid+'/versions";