Page 1 of 1
How to retrieve Folder History
Posted: Tue Mar 23, 2010 2:04 pm
by buckey
I'm trying to figure out how to retrieve the history comments (using the API) for a specific folder. I can't seem to figure it out. I've searched a lot of the online forums, but the following is the only thing that I could really find that specifies any example code on how to retrieve a folder object (which i'm having trouble obtaining as well):
http://support.sourcegear.com/viewtopic ... ory#p39358
I tried testing the example code reference in the topic above, but the "ServerOperations" object does not resolve. I'm not sure that this object still exists though (I'm using version 5.0.2 of Vault).
Can anyone provide any assistance regarding how to retrieve a specific folder and the comments associated with that specific folder?
Thanks in advance.
Re: How to retrieve Folder History
Posted: Wed Mar 24, 2010 8:58 am
by jeremy_sg
It seems like you don't have the reference to VaultClientIntegrationLib right in your project (or your using statement is missing). Does that seem possible?
Another option is to use the Vault Command Line Client to generate an XML file with the history, and then load and parse the XML file.
Re: How to retrieve Folder History
Posted: Thu Mar 25, 2010 6:34 am
by buckey
Thank you for your reply. You were right. I only had VaultClientOperationsLib referenced, but not VaultClientIntegrationLib. So I am able to retrieve a folder now, but when I try to view the comments that have been applied to the folder by getting the Folder Properties and then by getting the comments doing the following, the comments are always an empty string:
folderProperties = folder.GetFolderProperties()
folderProperties.Comment //this always returns an empty string
I think this would only provide the comments for the most recent version of the folder anyways. I'm actually trying to get the comments for all of the existing versions of the folder. Is there any existing method or property that will let me plug into the history for this folder so that I can view all of the comments that have been applied to it?
Thanks.
Re: How to retrieve Folder History
Posted: Thu Mar 25, 2010 8:10 am
by jeremy_sg
You need to query the history using the ProcessCommandHistory() method in ServerOperations. Set the recursive parameter to false to specify that you only want changes to that folder, and not items below it. If you read the command line client source, which is included in the VaultClientAPI zip file, you will see how the method is used and what its returned values have.