i'm retriving my repository workspace programatically with this snippet:
IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(teamRepository);
IWorkspaceSearchCriteria wsSearchCriteria = WorkspaceSearchCriteria.FACTORY.newInstance();
wsSearchCriteria.setKind(IWorkspaceSearchCriteria.WORKSPACES);
wsSearchCriteria.setExactOwnerName("ownerName"); //replaced with real parameter
List<IWorkspaceHandle> workspaceHandles = workspaceManager.findWorkspaces(wsSearchCriteria,Integer.MAX_VALUE, monitor);
//so, here i got my repWorkSpace:
IRepositoryWorkspace myDesiredRepositoryWorkspace = workspaceHandles.get(0);
how can i programatically fetch/load components from the repository workspace into my eclipse workspace?
you can get your components by this snippet:
List<IComponent> componentList = new ArrayList<IComponent>();
for(Object componentHandle: myDesiredRepositoryWorkspace.getComponents() ){
IItemHandle handle = (IItemHandle) componentHandle;
IItemManager itemManager = teamRepository.itemManager();
IComponent component = (IComponent) itemManager.fetchCompleteItem(handle, IItemManager.DEFAULT, monitor );
componentList.add(component);
}
after that i have my repository workspace, i have all components from each workspace but i'm not able to load the repository workspace into a local workspace.
i'm developint a eclipse plugin, so you'll need the following plugins (or imports from the plain-java-api directly):
- com.ibm.team.rtc.common
- com.ibm.team.repository.client
- com.ibm.team.scm.client
- com.ibm.team.scm.common
- com.ibm.team.process.common