It's all about the answers!

Ask a question

Fetching Stream List from source control rtc java API


Naveen Tyagi (19768152) | asked Oct 29 '15, 11:58 p.m.
edited Oct 30 '15, 4:59 p.m. by Geoffrey Clemm (30.1k33035)
I am new to rtc plain java API. I am trying to  start with with simple example code.

public static void main(String arr[])
    {
        TeamPlatform.startup();
        try{
            IProgressMonitor myProgressMonitor = null;
            String repoUri = "https://#####:9443/ccm";
            // Login to the repository using the provided credentials
            ITeamRepository repository = TeamPlatform.getTeamRepositoryService().getTeamRepository(repoUri);
            repository.registerLoginHandler(new ILoginHandler2() {
                public ILoginInfo2 challenge(ITeamRepository repo) {
                    return new UsernameAndPasswordLoginInfo("myadmin", "password");
                }
            });
            repository.login((org.eclipse.core.runtime.IProgressMonitor) myProgressMonitor);
            System.out.println("Longin to RTC server");
           
           
           
            IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(repository);

            IWorkspaceSearchCriteria wsSearchCriteria = WorkspaceSearchCriteria.FACTORY.newInstance();

            wsSearchCriteria.setKind(IWorkspaceSearchCriteria.STREAMS);

            wsSearchCriteria.setPartialOwnerNameIgnoreCase("CM_Evaluation");
            List <IWorkspaceHandle> workspaceHandles = workspaceManager.findWorkspaces(wsSearchCriteria, Integer.MAX_VALUE, monitor);
           
            IWorkspaceConnection workspaceConnection = workspaceManager.getWorkspaceConnection(workspaceHandles.get(0), monitor);

}


I don't know what is this monitor object. I have seen some people used Application.getMontor() but i am not able to find any Application class. Am i missing some jar file or some other issue ?


==> My requirement :
1) I have to give  list of all  the rtc project.
2) user will select one of these project and then i have to get the Streams list.
3) then user will select anyone of the stream and i have to give list of the components inside that stream.
4) After user select the components then i have to pulling out the folders inside the component.
5)folders inside folder till we get the last folder and then list of the files.

Thanks!!!
                                 

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Oct 30 '15, 3:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Oct 30 '15, 3:30 a.m.
The IProgressMonitor is an object that allows to show progress in the UI and also allows to cancel operations. You either get it when called or you create one yourself. The snippets shipped with the Plain Java Client Libraries show a custom one. You can use null or the NullProgressMonitor instead, if you don't want to use a custom implementation of the interface e.g. based on an existing implementation.

Some of your questions might be answered in https://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/ others might be in other posts there or on Stackoverflow or in this forum.

Good luck with your effort.

Your answer


Register or 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.