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

Problem reading VersionTree of a component

Hi,
I've some problem retrieving information from IConfiguration object. This is my code:

IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(repo);
IWorkspaceConnection ws = wm.createWorkspace(repo.loggedInContributor(), "AUTO", "CREATO", null);
IItemManager items = repo.itemManager();

//getting the component
IComponentSearchCriteria cSC = IComponentSearchCriteria.FACTORY.newInstance();
cSC.setExactName("UCM");
List<IComponentHandle> compHandles = wm.findComponents(cSC, IWorkspaceManager.MAX_QUERY_SIZE, null);
IComponent component = (IComponent)items.fetchCompleteItem(compHandles.get(0), IItemManager.DEFAULT, null);

ws.addComponent(component, false, null);
IConfiguration conf = ws.configuration(component);
IFolder folder = (IFolder)conf.fetchCompleteItem(conf.rootFolderHandle(null),null);
Collection<IVersionableHandle> collection = ws.configuration(component).childEntriesForRoot(null).values();


Running this code I have a folder with "" as name and null as parent id. So when I search for childEntries I got an empty list.

Any idea of what is wrong?

Thanks,
Michele.

0 votes



2 answers

Permanent link
I've got some news on this point. It seems to work if the workspace has been already created, the error still remains if I create the workspace and then got IConfiguration object.

0 votes


Permanent link
We got a void collection even with an existing Repository Workspace:
ITeamRepository repo = ...
IWorkspaceHandle wksH = ...
IWorkspaceManager wksManager = SCMPlatform.getWorkspaceManager(repo);
IWorkspaceConnection wksConnection = wksManager.getWorkspaceConnection(wksH, null);
List<IComponentHandle> components = wksConnection.getComponents();
IConfiguration configuration = wksConnection.configuration(componentH);
Collection<? extends IVersionableHandle> childEntriesForRoot = configuration.childEntriesForRoot(null).values();
Here, the childEntriesForRoot collection is void.
Any advice?

0 votes

Comments
Ok, we have to call ISandbox#allShares() to get the a proper IVersionableHandle collection.

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

Question asked: Apr 12 '11, 4:04 a.m.

Question was seen: 5,086 times

Last updated: Feb 15 '13, 6:31 a.m.

Confirmation Cancel Confirm