1

I am programming an extension for analyzing files in an deliver changesets to a stream. It is an Advisor because if the analyze fails then you can't deliver anything.

In addition I have read the articles:

https://jazz.net/library/article/1000 https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/ https://jazz.net/wiki/bin/view/Main/CustomPreconditionsTable

But I have some doubts yet. I have created a plugin project with extension point ID: com.ibm.team.scm.server.deliver and a java class, but I don't know how to get the path of the files included in the deliver for analyzing them:

import org.eclipse.core.runtime.IProgressMonitor;
import com.ibm.team.process.common.IProcessConfigurationElement;
import com.ibm.team.process.common.advice.AdvisableOperation;
import com.ibm.team.process.common.advice.IAdvisorInfoCollector;
import com.ibm.team.process.common.advice.runtime.IOperationAdvisor;
import com.ibm.team.repository.common.TeamRepositoryException;
import com.ibm.team.repository.service.AbstractService;


public class CheckBadCharacterAdvisor extends AbstractService implements IOperationAdvisor{

    @Override
    public void run(AdvisableOperation operation,
            IProcessConfigurationElement advisorConfiguration,
            IAdvisorInfoCollector collector, IProgressMonitor monitor)
            throws TeamRepositoryException {      

        Object data = operation.getOperationData();

        // what else here?

   }
}

How could I get the change sets included in the delivery? or What javadoc or steps do you follow for getting this information?

Fran b
  • 3,016
  • 6
  • 38
  • 65

3 Answers3

1

I have only done a little bit with the SCM APIs. Here is an example for an Advisor. The most part is common the a follow up action/participant, so this could be a good starter. https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/

You want to use com.ibm.team.scm.service.internal.AbstractScmService instead of the AbstractService, because it is the entry-point into the SCM API.

RSJazz
  • 31
  • 5
1

I don't have the reputation for all the links yet....

These posts show some SCM API that you should look at, in order to approach your problem:

https://rsjazz.wordpress.com/2013/10/15/extracting-an-archive-into-jazz-scm-using-the-plain-java-client-libraries/ http://thescmlounge.blogspot.de/2013/08/getting-your-stuff-using-rtc-sdk-to-zip.html

RSJazz
  • 31
  • 5
1

Unfortunately the answers are in the wrong order...

And more posts I have found useful for RTC SCM API:

https://rsjazz.wordpress.com/2014/09/02/reading-and-writing-files-directly-from-and-to-an-rtc-scm-stream/

this page has pointer to more API examples that could come in handy as well: https://rsjazz.wordpress.com/interesting-links/

I have been relatively successful to find usage in the RTC SDK using PluginSpy, YARI as well as simply the Java Search e.g. for references of classes or methods I found. Sometimes just guessing a method name and search with asterisk helps a lot.

Good luck with your efforts.

RSJazz
  • 31
  • 5