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

Load a repository workspace using Plain API

Hi,
how can I load a repository workspace into a local directory using Plain API? I could use scm CLI but I'd like to perform more action and so I don't like too much to launch external command from java.

What is the Class/Methods I can use?

Thanks,
Michele

0 votes



5 answers

Permanent link
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.

2 votes


Permanent link
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:

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.

1 vote


Permanent link
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.

0 votes


Permanent link
It was my fault. I did not understand that I must provide a list of element to load and not only if I want a subset.

Thanks,
Michele.

0 votes


Permanent link
Thanks,
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.

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,938

Question asked: Nov 25 '11, 4:21 a.m.

Question was seen: 7,945 times

Last updated: Nov 25 '11, 4:21 a.m.

Confirmation Cancel Confirm