Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mylyn » How to use Mylyn connectors the right way?
How to use Mylyn connectors the right way? [message #639689] Wed, 17 November 2010 13:40
Stephan Mann is currently offline Stephan MannFriend
Messages: 22
Registered: August 2010
Junior Member
Hi,

I want to access multiple bug trackers for a project of mine and so I'm
trying to use the Mylyn connectors. The goal is to use only the code
required for communication with the bug tracker but no part of Mylyn's
GUI. After much trial and error I got access to a Bugzilla repository [1].

Although this is working, I wonder if there is a better way to do this.
Most of the classes I used in this test are internal, so what is the
right way to use the Bugzilla connector? Since I need to access a Mantis
bug tracker as well, I also wonder whether there is some generic
approach that I've missed so far.

I also didn't yet get the concept of TaskData/TaskAttribute. Is there a
more convenient way to access the task properties?

thanks in advance,
stephan



[1]
public class MylynBugzillaTest extends TestCase {
public void testConnect() {

final BugzillaRepositoryConnector connector = new
BugzillaRepositoryConnector();
final TaskRepository repository = new TaskRepository(
BugzillaCorePlugin.CONNECTOR_KIND,
"https://bugs.eclipse.org/bugs");
repository.setAuthenticationCredentials(
"stephan.mann@compeople.de", "password");

final TaskRepositoryManager repositoryManager =
new TaskRepositoryManager();
final TaskList taskList = new TaskList();
final RepositoryModel repositoryModel =
new RepositoryModel(taskList, repositoryManager);

final IRepositoryQuery repositoryQuery =
repositoryModel.createRepositoryQuery(repository);
repositoryQuery.setUrl(repository.getUrl()
+ "/buglist.cgi?product=Riena&bug_status=NEW"
+ "&bug_status=ASSIGNED&bug_status=REOPENED");

final TaskDataCollector collector = new TaskDataCollector() {
@Override
public void accept(final TaskData taskData) {
final String title =
taskData.getRoot().
getAttribute("bug").getValue();
System.out.println(title.trim());
}
};

final IStatus status = connector.performQuery(
repository, repositoryQuery, collector, null,
new NullProgressMonitor());
assertEquals(IStatus.OK, status.getCode());
}
}
Previous Topic:is there TaskAttribute Reference list
Next Topic:Question on Mylyn usage
Goto Forum:
  


Current Time: Wed Apr 24 17:04:37 GMT 2024

Powered by FUDForum. Page generated in 0.02929 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top