It's all about the answers!

Ask a question

Problem reading VersionTree of a component

Michele Pegoraro (1.8k14117103) | asked Apr 12 '11, 4:04 a.m.
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();
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?


2 answers

permanent link
Michele Pegoraro (1.8k14117103) | answered Apr 13 '11, 10:43 a.m.
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.

permanent link
SEC Servizi (97123257) | answered Feb 15 '13, 5:40 a.m.
edited Feb 15 '13, 6:30 a.m.
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?

SEC Servizi commented Feb 15 '13, 6:29 a.m. | edited Feb 15 '13, 6:31 a.m.
Ok, we have to call ISandbox#allShares() to get the a proper IVersionableHandle collection.

Your answer

Register or to post your answer.