Reputation: 175593
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?
Upvotes: 3
Views: 795
Reputation: 3809
You don't have to use COM to access the StarTeam API. There's a .NET version of the StarTeam SDK available.
Upvotes: 1
Reputation: 18815
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();
}
Upvotes: 4
Reputation: 18815
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.
Upvotes: 2