How to retrieve Folder History

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
buckey
Posts: 22
Joined: Fri Feb 12, 2010 3:21 pm

How to retrieve Folder History

Post by buckey » Tue Mar 23, 2010 2:04 pm

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.
Connections Academy Software Development Team

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Re: How to retrieve Folder History

Post by jeremy_sg » Wed Mar 24, 2010 8:58 am

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.
Subscribe to the Fortress/Vault blog

buckey
Posts: 22
Joined: Fri Feb 12, 2010 3:21 pm

Re: How to retrieve Folder History

Post by buckey » Thu Mar 25, 2010 6:34 am

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.

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Re: How to retrieve Folder History

Post by jeremy_sg » Thu Mar 25, 2010 8:10 am

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.
Subscribe to the Fortress/Vault blog

Post Reply