How to check components in a stream with Server side code
Hello,
I'm writing an operations advisor that validates an entered Component name on a work item save operation and checks it is associated with a given stream, but have come a bit unstuck with the validation part. Is there a way using server side code to extract components associated with a specific stream. The code so far looks like this: // Check if POM location corresponds to a component name under the named stream IComponentSearchCriteria compSearchCriteria = IComponentSearchCriteria.FACTORY.newInstance(); compSearchCriteria.setExactName(POMLocation); ItemQueryResult result = query.findComponents(compSearchCriteria, 10, repomonitor); List results = result.getItemHandles(); // If list is empty component name doesn't exist so fail if (results.isEmpty()) { System.out.println("No items pulled from POM Location check. Check POM location corresponds to a component in this project"); IAdvisorInfo problem5 = collector .createProblemInfo("Component name/Build POM location entered not found, check it is valid and associated with project area "+ projectAreaName,"Item Number "+itemNumber,PROBLEM_TYPE); collector.addInfo(problem5); } IWorkspaceHandle wshandle = (IWorkspaceHandle) handles.get(0); ComponentEntry[] centries = service.getComponentEntries(wshandle, repomonitor); .... I have a workspace handle and can get component entries from it, but how would I tie this in. I can already check that the component name entered is an actual component on RTC successfully, but need to check that the component is also found in the workspace referenced by my handle. Is there anything I could add to ComponentSearchCriteria to do this. Thanks for your help, Kelly |
2 answers
Is there a way using server side code to extract components associated with a specific stream./quote] |
Is there a way using server side code to extract components associated with a specific stream./quote] |
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.