Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [mylyn-integrators] Startup help for writing new connector

Thank you very much, that was a very good hint again.

Still, I have several problems, but I think I'm near my destination of
fetching the task list.

One thing is that I'm developing my connector with Mylyn 3.0 and in this
version your suggested performFinish() method in my wizard doesn't work
because of restriction to TasksUiPlugin, deprecation of getTaskList()
and non-exist methods like addQuery() and getSynchronizationManager(). I
have temporarily solved this problem by using a RepositoryQueryWizard
instead of my own implementation, but with this workaround the created
queries aren't shown in the task list.
Does anybody know what to do in this case?

The other thing is that I get an exception when calling
resultCollector.accept(myTaskData) (also a modification of Mylyn 3.0:
instead of Task the parameter is TaskData now):

java.lang.IllegalArgumentException: Element handle-4 does not exist in
the task list.
	at
org.eclipse.mylyn.internal.tasks.core.TaskList.getValidElement(TaskList.
java:464)
	at
org.eclipse.mylyn.internal.tasks.core.TaskList.addTask(TaskList.java:149
)
	at
org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob$TaskCol
lector.accept(SynchronizeQueriesJob.java:112)
	at
org.eclipse.mylyn.consol.core.ConsolRepositoryConnector.performQuery(Con
solRepositoryConnector.java:235)
	at
org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.synchro
nizeQuery(SynchronizeQueriesJob.java:333)
	at
org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.synchro
nizeQueries(SynchronizeQueriesJob.java:286)
	at
org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.run(Syn
chronizeQueriesJob.java:228)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

I have no idea where he gets this strange "handle-4". Before I set the
summary in MyTrackerQueryPage "handle-3" was shown in my search field
when creating a query, but I just don't know what this has got to do
with myTaskData.


Kind regards,
Robert

-----Original Message-----
From: mylyn-integrators-bounces@xxxxxxxxxxx
[mailto:mylyn-integrators-bounces@xxxxxxxxxxx] On Behalf Of Tom Bryan
(tombry)
Sent: Freitag, 11. Juli 2008 16:58
To: Mylyn Integrators list
Subject: RE: [mylyn-integrators] Startup help for writing new connector

Schenkenfelder Robert wrote on Friday, July 11, 2008 8:33 AM:

> Thank you for publishing your notes. However, it is hard to follow 
> them due to very rough explanations.

Understood.  This second half is definitely not complete.

The explanation also wasn't intended to replace what is already in the
integrator reference at
http://wiki.eclipse.org/index.php/Mylyn_Integrator_Reference.  That
material may provide some more details.  

> Until today I wasn't able to retrieve a task list from the server, 
> even with using code out of the Trac connector.

I also read through a lot of code from the Trac connector, but for
figuring out what needed to be done, Dennis Rietmann's Origo connector
was definitely much easier to follow.
 
> For example, following problem crosses my way to a successful 
> implementation of my connector:
> 
> I can create a new query with my connector, but after the creation 
> there is no action at all. Where can I see my created query and how do

> I manage to retrieve the task list?

If you create a query correctly, it should show up in Mylyn's Task List
view as a folder or container for tasks.  Basically, if you're providing
a wizard for your users to create a query, you need to do something like
this to add it to the Task List and synchronize the query results:

@Override
public boolean performFinish () {
	AbstractRepositoryQuery query = myQueryPage.getQuery();
	if (query != null) {
	
TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query);
		AbstractRepositoryConnector connector = 
	
TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
				myRepository.getConnectorKind());
		if (connector != null) {
	
TasksUiPlugin.getSynchronizationManager().synchronize(
				connector, query, null, true);
		}
	}
	return true;
}


For the synchronization to work, your
MytrackerRepositoryConnector.performQuery should do whatever it needs to
do to call the task repository, get results, transform them into
MytrackerTasks (where MytrackerTask extends AbstractTask), and adds them
to the collector.  That is, you should be calling
resultCollector.accept(currentTask) in your performQuery somewhere.
Usually, performQuery hands most of the work off to some sort of
MytrackerClient class that you've written.  

Hope that helps!

--
Tom Bryan <tombry@xxxxxxxxx>
Software Engineering Solutions (SES)
Cisco Systems
RTP, NC, USA
_______________________________________________
mylyn-integrators mailing list
mylyn-integrators@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mylyn-integrators


Back to the top