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

Schenkenfelder Robert wrote on Thursday, July 03, 2008 6:01 AM:

> I need some help in developing a new Eclipse Mylyn connector.
...
> Can anyone give me a detailed startup help for writing such a
> connector? 

I had orginally hoped that the Integrator Guide would be more of a
step-by-step guide than it is.  So, when I wrote my (read only)
connector, I tried to keep track of the steps I took.  I haven't put
this material up on the existing wiki page, yet.  It seems that it needs
a new sub-section for a step-by-step guide.  That is, most of the
existing material on the wiki is still useful and fills in the details,
but it would be great to start with a step-by-step description that
refers to sections later in the wiki page for more details.  

Here's the first half of what I've written so far.  It should get you
started and take you up to a "do nothing" connector that at least shows
up in the Mylyn Task Repositories view.  Note, also, that I'm talking
about Mylyn 2.3.  Since Mylyn 3.0 is now out, it probably makes more
sense to target your integration at Mylyn 3.0.  I have no idea whether
any of this has changed for Mylyn 3.0.



Creating Mylyn Connector for "Mytracker"
========================================

Some notes to simplify this process for others, based on my experience
of 
creating a Mylyn 2.3 connector for our internal tracker.  Note that I
was 
writing a read only connector.  Figuring out how to make a read-write 
connector is left as an exercise for the reader.  

Basic framework and add a new repository to view
------------------------------------------------

* Create com.cisco.mytracker.mylyn.core plug-in.
**	Dependency: org.eclipse.core.runtime
**	Dependency: org.eclipse.mylyn.tasks.core
**	Don't forget to export your packages in runtime tab (for tests
plug-in).

* Create com.cisco.mytracker.mylyn.ui plug-in.
**	Dependency: org.eclipse.ui
**	Dependency: org.eclipse.core.runtime
**	Dependency: org.eclipse.mylyn.tasks.core
**	Dependency: org.eclipse.mylyn.tasks.ui
**	Dependency: com.cisco.mytracker.mylyn.core

* Create com.cisco.mytracker.mylyn.tests plug-in.
**	Dependency: org.junit
**	Dependency: org.eclipse.core.runtime
**	Dependency: org.eclipse.mylyn.tasks.core
**	Dependency: com.cisco.mytracker.mylyn.core

* In com.cisco.mytracker.mylyn.core plug-in,
**	Create
com.cisco.mytracker.mylyn.core.internal.MytrackerCorePlugin (the
activator for this plug-in).
***		Define a constant string for the PLUGIN_ID.
***		Define a constant string for the REPOSITORY_KIND.
**	Create com.cisco.mytracker.mylyn.core.internal.MytrackerTask.
***		Implement a constructor.
***		Return MytrackerCorePlugin.REPOSITORY_KIND from
getConnectorKind().
***		Return false from isLocal().
**	Create
com.cisco.mytracker.mylyn.core.internal.MytrackerRepositoryConnector.
***		Return MytrackerCorePlugin.REPOSITORY_KIND from
getConnectorKind().
***		Return a summary description String for the connector
itself.
***		For a read only connector, canCreateNewTask() should
return false.
***		canCreateTaskFromKey() should return true (create a task
for an existing ID?), and implement createTaskFromExistingId (to just
return a Task instance, or fetch/populate it from repository?).
***		Implement createTask()?  Or is that just for read write
connectors?
***		You can implement getRepositoryUrlFromTaskUrl(String),
getTaskIdFromTaskUrl(String), and getTaskUrl(String,String) if you're
integrating to a bug system with a web-app as a primary front-end.
***		Do not implement getTaskDataHandler() or
updateTaskFromTaskData,  yet.
***		Do not implement performQuery, yet.
***		Do not implement updateTaskFromRepository or
markStaleTasks, yet.
***		Do not implement updateAttributes, yet.
		

* In com.cisco.mytracker.mylyn.ui plug-in,
**	Create com.cisco.mytracker.mylyn.ui.internal.MytrackerUiPlugin
(the activator for this plug-in).
***		Nothing to do here?
**	Create
com.cisco.mytracker.mylyn.ui.internal.MytrackerTaskListFactory.
***		Create constants for keys for the XML that will be
written.  
			For example, KEYS_MYTRACKER,
KEYS_MYTRACKER_TASK, and KEYS_MYTRACKER_QUERY.
***		Implement canCreate(AbstractTask).
***		Implement createTask.  Duplicate from
MytrackerRepositoryConnector?
***		Implement getTaskElementName() to return
KEY_MYTRACKER_TASK.
**	Create
com.cisco.mytracker.mylyn.ui.internal.MytrackerConnectorUi.
***		Return MytrackerCorePlugin.REPOSITORY_KIND from
getConnectorKind().
***		No need for getNewTaskWizard for a read only connector.
***		Do not implement getQueryWizard, yet.
***		Return false from hasSearchPage().
***		Implement getSettingsPage() to return a new
MytrackerRepositorySettingsPage.
**	Create
com.cisco.mytracker.mylyn.ui.internal.MytrackerRepositorySettingsPage.
***		Do nothing in createAdditionalControls.
***		Return null from getValidator.
***		Implement isValidUrl as desired.  It needs to return
true to be able to add a newrepository of this type.
***		Implement a constructorthat setsNeedsValidation(false).
**	Implement org.eclipse.mylyn.tasks.ui.repositories:
***		Point connectorCore to
com.cisco.mytracker.mylyn.core.internal.MytrackerRepositoryConnector.
***		Point taskListFactor to
com.cisco.mytracker.mylyn.ui.internal.MytrackerTaskListFactory.
***		Point connectorUi to
com.cisco.mytracker.mylyn.ui.internal.MytrackerConnectorUi.
**	Implement org.eclipse.mylyn.tasks.core.templates:
***		If you have a set or public URL for an instance of your
bug repository, you can make it 
			easier for users to add it to their Repositories
View in Mylyn.  You can even add 
			it automatically when they install your
connector (not generally recommended).
***		Add a sample repository template for Mytracker, if
desired.

You can now run a hosted Eclipse app with your plug-in and add a
Mytracker repository to your repository view.

-- 
Tom Bryan <tombry@xxxxxxxxx>
Cisco Systems


Back to the top