Client API, labels, and "as of" fetching

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
djMax
Posts: 32
Joined: Wed Dec 01, 2004 1:05 pm
Location: Boston, MA

Client API, labels, and "as of" fetching

Post by djMax » Tue Jun 14, 2005 2:02 pm

I'm writing a tool to help prop web sites more simply. Basically it's an executable that "gets latest" via the API. I would like to be able to get historical versions either by label or by "version as of 1/1/05 12:30 EST" kind of thing. The second one is probably harder, but I can't even figure out the first. What I want is some sort of function like:

GetLabeledVersionToNonWorkingFolder(VaultClientFile f, string label, string localPath). But the nearest equivalent has all this junk about label path and stuff, which either I don't want to know about, or I want a way to automatically find out the path value. Thoughts?

Any approaches for the second problem are welcome as well.

Thanks!

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

Post by jeremy_sg » Tue Jun 14, 2005 2:29 pm

Check out the Vault command line client's code (installed with the VaultClientAPI installer) for a real-world example of how to download by label. Also, you should at least consider using the CLC instead of the API, if you only want to do get latest and get label operations.

djMax
Posts: 32
Joined: Wed Dec 01, 2004 1:05 pm
Location: Boston, MA

Post by djMax » Tue Jun 14, 2005 6:10 pm

my problem with the CLC is the horrid security... RememberLogin seemingly puts it in a text file in the clear on disk (right?) and/or put it on the command line, neither of which are great. (I guess the client API may be doing similar things, but with SSL I hoped not)

The CLC still seems to need this label path stuff to be passed in, am I reading that right? Or is it optional in most cases?

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

Post by jeremy_sg » Tue Jun 14, 2005 9:31 pm

In the API, you're going to have to pass the clear text password to the Login() function, so how and where you store the password are up to you.

The CLC just takes the path to the item in the tree that has been labeled, and the label to fetch.

Locked