IWorkspaceHandle and IVersionableHandle?
I'm looking at the first code snippet on this page:
https://jazz.net/wiki/bin/view/Main/RTCSDK20_SourceControl
ITeamRepository repo = ...;
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!
3 answers
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
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.