RTC v4.0.1+ Java API: how to load a workspace using Java API
![]()
Hi
I find my self struggling with a simple task: given an RTC repository and a ready made workspace I want to download its content. getting the repository instance was easy (there are online samples to do login): ITeamRepository repository = TeamPlatform.getTeamRepositoryService().getTeamRepository(rtcServerURL); ... then code here perform a login... then get an IWorkspaceConnection using IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(repository) IWorkspaceSearchCriteria criteria = IWorkspaceSearchCriteria.FACTORY.newInstance(); criteria.setExactName(rtcWorkspace); criteria.setKind(IWorkspaceSearchCriteria.WORKSPACES); ... and then run a findWorkspace... or maybe simply run : ISharingManager sharingManager = FileSystemCore.getSharingManager(); File workspaceRoot = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile(); PathLocation pathlocation = new PathLocation(workspaceRoot.getAbsolutePath()); ILocation sandBoxLocation = pathlocation.getCanonicalForm(); ISandbox sandbox = sharingManager.getSandbox(sandBoxLocation, false); IRelativeLocation relativeLocation = new RelativeLocation(new String[0]); Collection<ILoadRule> paramCollection = null; ILoadOperation loadOp = IOperationFactory.instance.getLoadOperation(p); loadOp.requestLoad(ISandbox paramISandbox, IRelativeLocation paramIRelativeLocation, Collection<ILoadRule> paramCollection, IProgressMonitor paramIProgressMonitor) however, I'm not sure what to put in the params for the simplest load command. can anyone help here ? |
4 answers
![]()
actually my post is duplicate of https://jazz.net/forum/questions/114708/load-workspace-using-api
|
![]()
here is what I did to load an existing workspace (need to attach the XML load rule file too)
Comments and the loadrule XML file content is:
As an IBMer i find it sad there are not enough samples available online.
|
![]()
Here you may find a trace:
|
Comments
The filesystem operations aren't supported API yet. We are formalizing them, but we don't have an expected date for their release. In the meantime you are encouraged to use the commandline client.