tags:

views:

302

answers:

3

Has anyone worked with the StarTeam COM API (Specifically, intergrating with C#).

I need to write a helper function that returns a directory structure out of Starteam, but all I've been able to retrieve using this API has been a list of views.

Has anyone else tried this?

+2  A: 

the Starteam object model is heirachical, projects contain views, views contain folders, folders contain items (child folders, files, cr's etc)

So once you have your view list you can get the folders that belong to the view, then you have a few properties that determine how they map to the local file system, both the view object and the folder objects have a readonly path property. There are 4 other properties of interest though, on the view object read up on the DefaultPath and AlternatePath properties and on the folder object the DefaultPathFragment and AlternatePathFragment.

Tim Jarvis
+3  A: 

Oh, in the interests of completeness, if you don't want to write the recursive code to navigate the heirachy of folders yourself, there is a helper class you can use to do the hard work for you called FolderListManager

void BtnFindClick(object sender, EventArgs e)
{
 Borland.StarTeam.View v = StarTeamFinder.OpenView("username:pwd@server:49201/Project");
 FolderListManager lm = new FolderListManager(v);
 lm.IncludeFolders(v.RootFolder,-1); // -1 means recursively add child folders
 StringBuilder sb = new StringBuilder();
 foreach(Folder f in lm.Folders)
 {
  sb.AppendLine(f.Path);
 }
 txtResults.Text = sb.ToString();
}
Tim Jarvis
+1  A: 

You don't have to use COM to access the StarTeam API. There's a .NET version of the StarTeam SDK available.

Slapout
The .NET version is simply a wrapper around the COM version.
FlySwat
Actually thats not true. The .NET version is a wrapper around the Java SDK. The COM SDK is depreciated.
Tim Jarvis