Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mylyn-integrators] AbstractTask vs. RepositoryTaskData in a connector

Does the class in MyTracker's connector plug-in that extends
AbstractTask need to carry all of the data that is present in a class
like TracTicket?

Some background for this question:  I'm reading a thread on
eclipse.tools.mylyn from October 2007 between Dennis Rietmann and Stefen
Pingel about the different representations of a task in Trac.  

Summarizing something Stefen Pingel said:
- TracTask: represents the task information in the task list. This is
kept in memory at all times and contains information needed by Mylyn to
represent the task in the UI
- TracTicket: part of a generic API for accessing Trac repositories that
does not depend on Mylyn.
- RepositoryTaskData: used for offline editing and offline storage.

Now, for example, say that I have a repository with 50 fields.  Clearly,
many of those fields will be specific to that repository (for example,
documenting hardware platform and firmware versions for embedded
software defects).  I cannot imagine that the Task List UI needs to know
about those fields.

More specifically, MyTracker has a service for returning a bug.  

I use JAXB to generate classes to represent the data returned by the
service.  That tree of objects roughly corresponds to the TracTicket
representation.  It's independent from Mylyn, and it contains all of the
data sent to me by the repository.

Now, I know that I need to put *all* of that data in a
RepositoryTaskData instance for each task using setAttributeValue and my
AttributeFactory.  That will permit me to create an editor that shows
all of these fields.

But I also need a MyTrackerTask class that extends AbstractTask so that
the Task List UI has a representation of the objects, right?  Are those
instances supposed to carry all of these fields, too?  Or are they
supposed to carry only enough information for the UI?  

It looks like TracRepositoryConnector.updateTaskFromTicket and
updateTaskFromTaskData, for example, do not preserve the entire
valueByKey map of fields from TracTicket or the entire list of
attributes from RepositoryTaskData.getAttributes (via
AttributeContainer).  I just want to make sure that I don't lose data or
hit some horrible Exception because Mylyn didn't have what it needed
during some user interaction with the Task List UI.

Thanks.

--
Tom Bryan <tombry@xxxxxxxxx>
Cisco Systems


Back to the top