| Summary: | [api] improve API for non-local tasks with locally controlled attributes, e.g. completion, ownership | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Eugene Kuleshov <ekuleshov> | ||||||
| Component: | Mylyn | Assignee: | Steffen Pingel <steffen.pingel> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | enhancement | ||||||||
| Priority: | P3 | CC: | mik.kersten, shawn.minto, steffen.pingel | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 3.0 | ||||||||
| Hardware: | PC | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Eugene Kuleshov
What's the desired for what TaskRepositoryManager.isOwnedByUser() should return for web tasks? There is no way to know if they are owned by the user, so I assume that it should be false? (In reply to comment #1) > What's the desired for what TaskRepositoryManager.isOwnedByUser() should return > for web tasks? There is no way to know if they are owned by the user, so I > assume that it should be false? The web repository connector does map task owner if query configuration provide corresponding mapping. See connector user guide. Anyways, since there is a connector for local tasks it is rather strange to have task.isLocal() check in TaskRepositoryManager.isOwnedByUser(). From bug 222089: The AbstractTask.isLocal() is used to enable various actions for a task and change the behavor of action, e.g. it determines if a task can be completed in the task list or if it is moved to the Uncategorized folder when deleted from a category etc. There is an unclear overlap with checking if a task extends LocalTask. Also WebTask class currently returns true for isLocal(). Eugene points out: "If I remember correctly, isLocal() been set that way to allow to manually change task completion status and other properties not available from the server, as well as execute actions specific to local tasks (read/unread, etc)." While this makes sense this has undesired side effects in other places where WebTasks should be regarded as remote repository tasks. *** Bug 222089 has been marked as a duplicate of this bug. *** Steffen: Removing parent since this is now marked as a duplicate. I have removed the isLocal() method from ITask and changed TaskRepositoryManager.isOwnedByUser() to do an instanceof check for LocalTask. The synchronization state in the task list does not depend on getLastReadTimeStamp() anymore so there should not be a need for connectors to overwrite isLocal(). Connectors should use menu contributions to add complete/incomplete actions to the context menu. Sounds great. (In reply to comment #7) > Sounds great. What about separately controlling completion, ownership and other attributes for local tasks? Keeping separate local and repository state for certain attributes, e.g. due dates has been proposed on bug 229487 but I am not sure if that is still on the table for 3.0. I have opened bug 231704 for further discussion. I have moved the "Mark as" menu into a menu extension with the id "org.eclipse.mylyn.tasks.ui.menu.task.mark". An example how to contribute items to the menu can be found in the plugin.xml of tasks.ui. Created attachment 99862 [details]
mylyn/context/zip
The current solution for contributing common menu actions, e.g. for marking tasks complete seems slightly cumbersome and potentially duplicates a lot of the XML configuration. There is a risk of ending up with an inconsistent UI if connectors contribute commands in different ways, e.g. with different icons or in different menu locations. Added a method to AbstractRepositoryConnector:
public boolean hasCapability(Capability capability, TaskRepository taskRepository, ITask task,
ICapabilityContext context);
Supported capabilities:
public enum Capability { LOCAL_COMPLETION_STATE, REPOSITORY_DUE_DATE };
The ICapabilityContext parameter is similar to ISynchronizationContext and allows access to the task data manager in case connectors need to load task data to determine a capability.
Created attachment 102066 [details]
mylyn/context/zip
After further review and discussion the capability enum has been replaced by a new method:
AbstractRepositoryConnector{
public boolean hasLocalCompletionState(TaskRepository taskRepository, ITask task);
}
|