Problem reading VersionTree of a component
Hi,
I've some problem retrieving information from IConfiguration object. This is my code:
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.
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.
2 answers
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?