It's all about the answers!

Ask a question

From project to Stream


Giacomo Ghezzi (161) | asked Aug 01 '08, 3:19 a.m.
Hi,
I've been messing around with the Jazz SCM for a while and I already know how to connect to a team repository, access different workspaces, baselines and fetch artifacts from there.
Know I would like, given a java project to get the Stream related to it. I read that it's the same as getting a Workspace, but I somehow got stuck.
I'm already able to get connect the SharingDescriptor from the project and from there I get the Component and the team repository associated to the project, but then I just can't find a way to get a connection to the stream. In fact if I use the following code:

IWorkspaceManager wsManager = SCMPlatform.getWorkspaceManager(repository);

IWorkspaceConnection conn = wsManager.getWorkspaceConnection((IWorkspaceHandle) sharingDescriptor.getConnectionHandle(), monitor);


I just get a connection to the user's workspace for that project, as the test conn.isStream() returns false, which is not what I need. Any suggestions?
Thanks
Giacomo

4 answers



permanent link
Dmitry Karasik (1.8k11) | answered Aug 01 '08, 8:16 a.m.
JAZZ DEVELOPER
On Fri, 01 Aug 2008 07:28:03 +0000, ghezzi wrote:

Know I would like, given a
java project to get the Stream related to it. I read that it's the same
as getting a Workspace, but I somehow got stuck.


There is no such notion as a stream related to a java project. The
content on disk corresponds to a user's workspace, which may collaborate
with 0 or more streams that also contain the project.

- Dmitry

permanent link
Giacomo Ghezzi (161) | answered Aug 11 '08, 6:00 p.m.
I realized now that my previous post was a little unclear and misleading. I was talking about java project as they are the things I'm interested in, but I know that jazz works on a more generic level.
As I said, I'm already able to connect to a TeamRepository, get the WorkspaceManager (with SCMPlatform.getWorkspaceManager), a WorkspaceConnection (with SCMPlatform.getWorkspaceManager), get the workspace components and fetch artifacts and so on.
I would then like to fetch all the streams the workspace is collaborating with. Which is were I got stuck. Is it possible to fetch that information?
cheers
Giacomo

permanent link
John Camelon (1.7k14) | answered Aug 12 '08, 8:36 a.m.
JAZZ DEVELOPER
You can get the flow table from a workspace connection via
getFlowTable(). Look at the deliver and accept targets (which are
of type IFlowEntry). IFlowEntry#getFlowNode() returns a workspace
handle : you can either fetch the workspace item through IItemManager or
get a workspace connection through IWorkspaceManager and call isStream()
on either object to determine if the collaboration is with a stream.

Alternatively, you can call
IWorkspaceManager#findWorkspaceAcceptRelationships and
IWorkspaceManager#findWorkspaceDeliverRelationships, but these APIs are
not paged and may cause you trouble if the # of collaborations is quite
large.

Hope that helps,
JohnC
SCM Server


ghezzi wrote:
I realized now that my previous post was a little unclear and
misleading. I was talking about java project as they are the things
I'm interested in, but I know that jazz works on a more generic
level.
As I said, I'm already able to connect to a TeamRepository, get the
WorkspaceManager (with SCMPlatform.getWorkspaceManager), a
WorkspaceConnection (with SCMPlatform.getWorkspaceManager), get the
workspace components and fetch artifacts and so on.
I would then like to fetch all the streams the workspace is
collaborating with. Which is were I got stuck. Is it possible to
fetch that information?
cheers
Giacomo

permanent link
Giacomo Ghezzi (161) | answered Aug 15 '08, 7:54 a.m.
Thanks John, that's exactly what I was looking for.
cheers
Giacomo

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.