Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

IWorkspaceHandle and IVersionableHandle?

Hi,

I'm looking at the first code snippet on this page:
https://jazz.net/wiki/bin/view/Main/RTCSDK20_SourceControl

ITeamRepository repo = ...;
IWorkspaceHandle workspaceHandle = ...;
IVersionableHandle versionableHandle = ...;


//fetch workspace from IItemManager
IItemManager itemManager = repo.itemManager();
IWorkspace workspace = (IWorkspace) itemManager.fetchCompleteItem(workspaceHandle, monitor);

//fetch workspace connection from IWorkspaceManager
IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(repo);
IWorkspaceConnection workspaceConnection = workspaceManager.getWorkspaceConnection(workspaceHandle, monitor);

//fetch a list of components from IItemManager
List<IComponentHandle> componentHandles = workspace.getComponents();
List<IComponent> components = itemManager.fetchCompleteItems(components, componentHandles);

//fetch a versionable from IConfiguration
IComponentHandle componentHandle = components.get(0);
IConfiguration configuration = workspaceConnection.configuration(componentHandle);
IVersionable versionable = configuration.fetchCompleteItem(versionable);

//cast IVersionable to IFileItem
if (IFileItem.ITEM_TYPE.equals(versionable.getItemType())) {
IFileItem file = (IFileItem) versionable;
}

Can someone please clarify the purpose of IWorkspaceHandle and IVersionableHandle? How should I initialize workspaceHandle and versionbleHandle?

Thanks!

0 votes



3 answers

Permanent link

I suspect that the code snippet assumes that you already have a handle
to a repository, a workspace and a versionable (i.e.a file or folder).
Where you would get them from really depends on the operation you are
trying to write.

Michael

0 votes

Comments

I am trying to access the source files that are in the repositry.

Thanks for any help.

Hi there,

I am also looking for ways to access/extract the source files. Any help would be greatly appreciated


- Jacqui


Permanent link
The workspace is the place to check out and check in changes. You can also access the configuration from a workspace to get the versionables. There has to be some sort of context (stream/workspace/snapshot) to what you want to access. This is why you need the IWorkspaceHandle. It can get you the IWorkspaceConnection that can get to the versionables.

0 votes

Comments

No one asked that question Tim Moke!! dont post unless you know the answer to the question aksed

I answered the first question of what they were. I apologize if I misinterpreted the question but I have no clue since you didn't ask it and cannot clarify it. I felt that Michael tried to answer the part of how to initialize them, which he asked for more information and never received.

Please refrain from adding an answer to questions when you do not provide an answer. You can however add a comment to an answer if you want to continue a discussion. I have converted your answer to a comment to prevent confusion for other users.


Permanent link
I found that this helps too for accessing source files :)
http://jazz.net/forums/viewtopic.php?t=10310&highlight=ifileitem

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,933
× 1,202
× 169

Question asked: Oct 04 '10, 12:25 p.m.

Question was seen: 10,697 times

Last updated: May 24 '23, 2:08 a.m.

Confirmation Cancel Confirm