Home

retriving the version

You are here

9 posts / 0 new
Last post
retriving the version

Hi,

How to retrieve the content of a specific document version?

Thanks,
Naveen.

retriving the version

You can use VersionService API to get version document's content. This Interface have many method like createVersion, deleteVersion, currentVersion.

You can use VersionService

You can use VersionService API to get version document's content. This Interface have many method like createVersion, deleteVersion, currentVersion.

retrieving the specific version

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.

api

It depends on what api are you using. java foundation api? javascript api ? webscript api? cmis api ?

If this post was helpful, please click Yes on the Post Rating

Hi Kaynezhang,

Hi Kaynezhang,

We are using web scripts.

Thanks,
Naveen.

webscript api

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";

If this post was helpful, please click Yes on the Post Rating

Hi Kaynezhang,

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.

get all versions

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";

If this post was helpful, please click Yes on the Post Rating

forums index