Load a repository workspace using Plain API
5 answers
There's a fair bit of work involved in getting ILoadOperation configured properly to handle conflicts, load rules, etc.
I suggest browsing the code for
com.ibm.team.build.internal.scm.SourceControlUtility.updateFileCopyArea(IWorkspaceConnection, String, boolean, Collection<IComponentHandle>, boolean, Collection<ILoadRule2>, boolean, IProgressMonitor)
which is used by JBE and the teamFetch Ant task.
I suggest browsing the code for
com.ibm.team.build.internal.scm.SourceControlUtility.updateFileCopyArea(IWorkspaceConnection, String, boolean, Collection<IComponentHandle>, boolean, Collection<ILoadRule2>, boolean, IProgressMonitor)
which is used by JBE and the teamFetch Ant task.
Thank you for the anwser.
I was looking to something which performs like SCM so I think I'll going to use operations. I tryed with ILoadOperation but I still have a problem: it does not appear to run. This is my code:
When I run it nothing happends
Do you know if I'm using something wrong?
I was looking to something which performs like SCM so I think I'll going to use operations. I tryed with ILoadOperation but I still have a problem: it does not appear to run. This is my code:
ILoadOperation loadOperation = IOperationFactory.instance.getLoadOperation(LoadDilemmaHandler.getDefault());
loadOperation.requestLoad(sbox, null, wsManager.getWorkspaceConnection(wsc.getResolvedWorkspace(), null), component,(Collection)Collections.EMPTY_LIST);
loadOperation.run(null);
When I run it nothing happends
Do you know if I'm using something wrong?
You're looking at a bunch of classes and methods. The primary classes involved in manually downloading a repository workspace are IWorkspace, IComponent, IVersionable, IVersionableHandle (and its descendents IFolderHandle and IFileItemHandle), IFileSystemManager, FileSystemServiceProxy, LoadTree (which is internal, but required for any performance-sensitive loading), and possibly a few others.
The process description is relatively simple: for each component in a workspace, get the file tree for that component, then for each file in the tree get its stream and save the contents to the local disk. Implementing that will probably be more involved.
What that will not get you is the .jazz5 folder with all the metadata, and as far as I can tell it is not a standards-based file with a publicly supported format.
If you want instead to use an existing RTC operation class to run it you'll get the metadata but it'll operate pretty much like the SCM command. That is, unless there are hooks that I'm unaware of.
You're looking at a bunch of classes and methods. The primary classes involved in manually downloading a repository workspace are IWorkspace, IComponent, IVersionable, IVersionableHandle (and its descendents IFolderHandle and IFileItemHandle), IFileSystemManager, FileSystemServiceProxy, LoadTree (which is internal, but required for any performance-sensitive loading), and possibly a few others.
The process description is relatively simple: for each component in a workspace, get the file tree for that component, then for each file in the tree get its stream and save the contents to the local disk. Implementing that will probably be more involved.
What that will not get you is the .jazz5 folder with all the metadata, and as far as I can tell it is not a standards-based file with a publicly supported format.
If you want instead to use an existing RTC operation class to run it you'll get the metadata but it'll operate pretty much like the SCM command. That is, unless there are hooks that I'm unaware of.
The process description is relatively simple: for each component in a workspace, get the file tree for that component, then for each file in the tree get its stream and save the contents to the local disk. Implementing that will probably be more involved.
What that will not get you is the .jazz5 folder with all the metadata, and as far as I can tell it is not a standards-based file with a publicly supported format.
If you want instead to use an existing RTC operation class to run it you'll get the metadata but it'll operate pretty much like the SCM command. That is, unless there are hooks that I'm unaware of.
Thanks,
I'll take a look on it.
Best regards,
Michele.
I'll take a look on it.
Best regards,
Michele.
There's a fair bit of work involved in getting ILoadOperation configured properly to handle conflicts, load rules, etc.
I suggest browsing the code for
com.ibm.team.build.internal.scm.SourceControlUtility.updateFileCopyArea(IWorkspaceConnection, String, boolean, Collection<IComponentHandle>, boolean, Collection<ILoadRule2>, boolean, IProgressMonitor)
which is used by JBE and the teamFetch Ant task.