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

Fetching Stream List from source control rtc java API

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!!!
                                 

0 votes



One answer

Permanent link
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.

0 votes

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

Question asked: Oct 29 '15, 11:58 p.m.

Question was seen: 3,981 times

Last updated: Oct 30 '15, 4:59 p.m.

Confirmation Cancel Confirm