cancel
Showing results for 
Search instead for 
Did you mean: 

Reverting AVM nodes

jameskinley
Champ in-the-making
Champ in-the-making
Hi,

I am trying to use the avm service to revert to a previous version of a node.

e.g.

1. Get the path to the file in the avm : "kb–admin:/www/avm_webapps/ROOT/test/.xml/test.xml"
2. Get the AVMNodeDescriptor for the specific version of the file : "avmService.lookup([version], [avmPath]);"
3. Revert the page : "avmService.revert([avmPath], [AVMNodeDescriptor]);"

But the lookup in step 2 always returns a null no matter what version I try and lookup.

I have looked at this file in my sandbox and it is there with all the relevant version histories so I am confused as to why the lookup cannot find the old versions.

Does anyone have any ideas?

Thanks, James.
2 REPLIES 2

jameskinley
Champ in-the-making
Champ in-the-making
I have also tried just retrieving the NodeRef for the older version…

AVMNodeConverter.ToNodeRef([version], [path]);

This also fails to return a valid NodeRef.

jameskinley
Champ in-the-making
Champ in-the-making
Update…

Instead of reverting the file I have tried just retrieving an older version of it using…

AVMNodeConverter.ToNodeRef([version], [path]);

I use this code to retrieve the latest version by passing "-1" as the version number and this has been working ok for some time. When I need to revert to an older version of the page I simply call the same code but pass through a version number.

This returns a correct NodeRef but when I get the content of the file at this NodeRef its the same as the latest version!

Has anyone come accross this before?