Page 1 of 1

Posted: Mon Jul 21, 2008 5:53 pm
by HakanL
I need to get the full tree (under a specified path) for a particular version in the history. For example let's say that folder $/A latest version is 200. $/A has files and subfolders. I'd like to view the complete file structure for what it looked like at version 100. I've found the ProcessCommandGetVersion which gets the files to the local disk, but I just want to view it, I don't want to actually get the files. What I'm looking for is what's in the Vault Client under Version History, View Tree. How can I do that in the API?

Thanks,
/Hakan

Posted: Tue Jul 22, 2008 7:47 am
by shannon
There's no way to easily bring up any of our GUI components, because we haven't released an API for doing graphical operations in Vault.

You want to run your version history command on the folder, then run this command:

ClientInstance.Connection.GetBranchStructure(ClientInstance.ActiveRepositoryID, strObjName, vtxhi.ID, vtxhi.Version, ref vfd, true);

where vtxhi is the VaultTxHistoryItem from your ProcessCommandVersionHistory and vfd is going to be a VaultFolderDelta for the version you wanted.

Construct a VaultClientFolder like this:
VaultClientFolder vcfolder = new VaultClientFolder(vfd, null);

Then you just construct your tree from vcfolder (loop over it's child files and folders recursively).

Posted: Fri Jul 25, 2008 2:07 pm
by HakanL
Excellent, just what I needed. I'm not interested in bringing up the GUI, I want to do it in code, so this is perfect. I haven't had a chance to test it yet, but if I have any further problems I'll let you know.

Thanks!
/Hakan