How to get Project Area Name on Source Control?
Hi.
I want to know how to get Project Area Name on source control.
so, i searched repository workspace, stream, user, changeset for Project Area Name
but, i didn't find (repository workspace, stream, user, changeset).
"String projectName = operation.getProcessArea().getName();"
this code get stream's owner value.
but if stream's owner is team area, i can't get project area name.
How do you get Project Area Name on source control?
thanks.
I want to know how to get Project Area Name on source control.
so, i searched repository workspace, stream, user, changeset for Project Area Name
but, i didn't find (repository workspace, stream, user, changeset).
"String projectName = operation.getProcessArea().getName();"
this code get stream's owner value.
but if stream's owner is team area, i can't get project area name.
How do you get Project Area Name on source control?
thanks.
3 answers
If you have the stream, use:
On the client side, you'd use IItemManager to fetch the items, on the server side you'd use IRepositoryItemService.
IWorkspace stream = ...
IProcessAreaHandle processAreaHandle = stream.getOwner();
IProcessArea processArea = /* fetch processAreaHandle */
IProjectAreaHandle projectAreaHandle = processArea.getProjectArea();
IProjectArea projectArea = /* fetch projectAreaHandle */
String name = projectArea.getName();
On the client side, you'd use IItemManager to fetch the items, on the server side you'd use IRepositoryItemService.
The tree structure that Geoff mentions is maintained at project area level (not as parent/children links in each team area). You can get at the info using:
IProjectArea projectArea = /* see above */
ITeamAreaHierarchy hierarchy = projectArea.getTeamAreaHierarchy();
ITeamAreaHandle teamArea = /* handle for some team area */
ITeamAreaHandle parent = hiearchy.getParent(teamArea); // null means project is parent
Set children = hierarchy.getChildren(teamArea); // set of ITeamAreaHandle
I don't know the API details, but team areas are arranged in a tree, the
root of which is a project area. So you'll want to look for some kind
of a "parent" relation from a team area (and keep traversing it until
you reach the project area), or a team area might have a direct pointer
to the root of the hierarchy (i.e. the project area).
Cheers,
Geoff
On 6/15/2011 3:38 AM, jjangrang wrote:
root of which is a project area. So you'll want to look for some kind
of a "parent" relation from a team area (and keep traversing it until
you reach the project area), or a team area might have a direct pointer
to the root of the hierarchy (i.e. the project area).
Cheers,
Geoff
On 6/15/2011 3:38 AM, jjangrang wrote:
Hi.
I want to know how to get Project Area Name on source control.
so, i searched repository workspace, stream, user, changeset for
Project Area Name
but, i didn't find (repository workspace, stream, user, changeset).
"String projectName =
operation.getProcessArea().getName();"
this code get stream's owner value.
but if stream's owner is team area, i can't get project area name.
How do you get Project Area Name on source control?
thanks.