Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 124321

Summary: [api] merge local tasks with repository tasks
Product: z_Archived Reporter: Mik Kersten <mik.kersten>
Component: MylynAssignee: Robert Elves <robert.elves>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P1 CC: brockj, mik.kersten, robert.elves, steffen.pingel, wes.coelho, wmitsuda
Version: unspecified   
Target Milestone: 2.0   
Hardware: PC   
OS: Windows All   
Whiteboard:

Description Mik Kersten CLA 2006-01-18 11:32:24 EST
Brock Janiczak suggested this might be a nice parallelism.  We evolved from local tasks, but if this doesn't overcomplicate the architecture it could be worth doing.  And it would also provide a nicer example for how to extend than the Bugzilla Client.
Comment 1 Mik Kersten CLA 2006-01-26 15:54:34 EST
Putting off until next week, too many other changes in the tasklist for 0.4.8.
Comment 2 Mik Kersten CLA 2006-02-27 20:32:57 EST
Currently there is no state held for a task that's purely local.  The only state held is planning/reminder/note information, which applies to any repository task as well.  So while we may still want to consider improving support for local tasks by adding a local repository, that issue is seperate.  Marking for later since this may need to be reconsidered.
Comment 3 Mik Kersten CLA 2006-10-24 17:18:14 EDT
Reopening based on recent discussion on mylar-dev.
Comment 4 Mik Kersten CLA 2007-06-06 17:51:44 EDT
We have just updated the Task/AbstractRepositoryTask hierarchy in a way that facilitates this.  This is the one remaining thorn in our architecture and we need to explore the changes needed to support this for 2.0.  

Rob: please investigate and let's figure out how necessary and how much of an improvement this would be.
Comment 5 Eugene Kuleshov CLA 2007-06-06 18:46:22 EDT
Mik, are you planning to remove ITask interface and pull up AbstractRepositoryTask class into Task? The latter is a good opportunity to try pull up refactoring.
Comment 6 Mik Kersten CLA 2007-06-06 22:36:28 EDT
Yup, we are working that out right now!  We would end up with a nice and simple AbstractTask.  Any objections??  

There are two separate architectural issues:

1) Merge AbstractRepositoryTask with Task, will be enable by changes to this bug report and the split has always meant more complicated client code.  Might result in something like a LocalPlanningData object and an AbstractTask.getPlanningData() method.  Or we will keep the common planning data as fields on AbstractTask since there aren't that many.

2) Get rid of ITask and rely on a clean interface of public/protected methods on AbstractTask.  The main benefit of this is that we can add methods to AbstracTask without breaking clients, which has been a big benefit with AbstractRepositoryTask already.  The cost is that many developers find plain interfaces easier to read/implement.
Comment 7 Eugene Kuleshov CLA 2007-06-06 23:06:26 EDT
(In reply to comment #6)
> Yup, we are working that out right now!  We would end up with a nice and simple
> AbstractTask.

Nice. I hope you'll make sure getTaskKey() is there.

> Any objections??

There is one you wouldn't agree with. Make that AbstractTask final. :-)

> 1) Merge AbstractRepositoryTask with Task, will be enable by changes to this bug
> report and the split has always meant more complicated client code.  Might
> result in something like a LocalPlanningData object and an
> AbstractTask.getPlanningData() method.  Or we will keep the common planning data
> as fields on AbstractTask since there aren't that many.

It would have been easier if AbstractTask had support for arbitrary properties. Though it is my legacy rdbms background speaking...

> 2) Get rid of ITask and rely on a clean interface of public/protected methods on
> AbstractTask.  The main benefit of this is that we can add methods to
> AbstracTask without breaking clients, which has been a big benefit with
> AbstractRepositoryTask already.  The cost is that many developers find plain
> interfaces easier to read/implement.

You already know my answer to that. Make something that don't need to be extended. :-)
Comment 8 Steffen Pingel CLA 2007-06-07 00:04:24 EDT
(In reply to comment #6)
> 2) Get rid of ITask and rely on a clean interface of public/protected methods
> on AbstractTask.  The main benefit of this is that we can add methods to
> AbstracTask without breaking clients, which has been a big benefit with
> AbstractRepositoryTask already.  The cost is that many developers find plain
> interfaces easier to read/implement.

I agree with that but since ITask is such a huge interface it is unlikely for anyone to implement it without subclassing the abstract class anyways. It does not have any documentation so the only way to figure out what it is supposed to do is to read existing implementations. Therefore I am in favor of using an abstract class only unless we are positive that the ITask API is rock stable and it doesn't hurt to keep it around.

Comment 9 Mik Kersten CLA 2007-06-12 22:15:35 EDT
Committer partial progress...

Rob: please get things compiling asap...
Comment 10 Robert Elves CLA 2007-06-12 23:26:06 EDT
Head now compiles. Work ongoing...
Comment 11 Robert Elves CLA 2007-06-13 00:09:59 EDT
Task is gone, ITask and ITaskListElement still standing. Those pertinent unit tests now passing.
Comment 12 Eugene Kuleshov CLA 2007-06-13 00:12:21 EDT
(In reply to comment #11)
> Task is gone, ITask and ITaskListElement still standing. 

Hmm. I thought the idea was to replace interface with the abstract class...
Comment 13 Robert Elves CLA 2007-06-13 00:40:44 EDT
Yup thats the plan. Once we're done here (tonight or morning) we'll be left with an AbstractTask.
Comment 14 Mik Kersten CLA 2007-06-13 01:19:17 EDT
Taking this over for the remaining changes...
Comment 15 Mik Kersten CLA 2007-06-13 03:57:44 EDT
Committed merge of ITask and ITaskListElement into hierarchy.  Still a bunch of API clean-up needed.
Comment 16 Eugene Kuleshov CLA 2007-06-13 11:52:46 EDT
Something wen't really funny - org.eclipse.mylyn.tasks.core.getAllCategories
Comment 17 Mik Kersten CLA 2007-06-13 13:15:27 EDT
Yes, thanks for pointing that out.  Fix coming shortly along with additional clean-up.
Comment 18 Mik Kersten CLA 2007-06-13 14:11:08 EDT
Committed next round of changes, still some consistency needed.  

Eugene: since we have a patch outstanding and awaiting review on bug 191575 I'm not sure if you want to synch or not.  We could try to merge it into an old workspace.
Comment 19 Eugene Kuleshov CLA 2007-06-13 14:24:04 EDT
Don't wait up on me. Besides, that patch is only needed for Steffen and Rob mostly as a hint. I might be able to merge it once more...
Comment 20 Steffen Pingel CLA 2007-06-13 14:34:29 EDT
Mik, I have Eugene's patch applied to my workspace and will take care of the merging.
Comment 21 Mik Kersten CLA 2007-06-13 14:48:49 EDT
Excellent!  Thanks Steffen.  Please go ahead and commit as soon as you can so that Rob and I can wrap up the refactoring.  We still need to clean up confusino between AbstractTaskListElement/AbstractTaskContainer/TaskCategory.
Comment 22 Steffen Pingel CLA 2007-06-13 15:10:44 EDT
Mik, not sure I understand your comment correctly. It will take at least until tomorrow until the patch will get to a level suited for review. There is no need to hold up any refactorings or commits.
Comment 23 Mik Kersten CLA 2007-06-13 15:32:04 EDT
Sorry, I misunderstood the timing.  We'll continue on and you can merge when ready.
Comment 24 Mik Kersten CLA 2007-06-14 01:42:00 EDT
Done.  Still UI stuff and test fixes to do on related bugs.
Comment 25 Steffen Pingel CLA 2007-06-14 11:46:44 EDT
Is it possible to hide the "Local Tasks" from the repositories view? All of its context menu items are disabled.
Comment 26 Robert Elves CLA 2007-06-14 12:55:21 EDT
We have the notion of user managed connectors, perhaps non-user managed TaskRepositories (i.e. Local Tasks) should be hidden.  This may be more detrimental than good due to lack of visibility and inconsistency with New Task dialog (where it needs to show up). Thoughts?
Comment 27 Steffen Pingel CLA 2007-06-14 13:15:50 EDT
I agree that the inconsistency with the New Task dialog might be confusing but I find it even more confusing to have a repository that can neither be deleted nor edited (renamed). I'd say it's less confusing to hide it from the view. If there is a good reason to keep we could also add a filter.
Comment 28 Mik Kersten CLA 2007-06-14 13:58:14 EDT
I agree that the current state is weird.  However, I think that it is very likely that we will want to provide some user-defined properties for the local repository (e.g., password-based encryption in case users are storing passwords in notes).  Also, the Task Repositories view is likely to be a place where users would go when wondering "where on earth does this thing store my (local) tasks?".  So for now I propose that we enable the Properties page on that repository, and on that page simply state that it is automatically created and point to the Task List preference page which points the user at the data directory.
Comment 29 Robert Elves CLA 2007-06-14 14:31:15 EDT
If there are no objections I'll add this to the ui nits.
Comment 30 Mik Kersten CLA 2007-06-14 14:38:46 EDT
If we keep the repository visible in the Task Repositories view for 2.0 I think that Properties has to be clickable for the reasons that Steffen outlines.
Comment 31 Mik Kersten CLA 2007-06-14 14:39:06 EDT
But it doesn't need to happen for RC1.