Community
Participate
Working Groups
I working on some issues raised by users beta version of Industrial SQL Connector. See bug 184532: [connector] Generic SQL connector The people fields in the task editor have content assist, but that is not prefilled. So my question was How and where can I populate the names of the people to which a bug may be assigned? Here is what I found after some searching: - the proposals are prepared in org.eclipse.mylyn.internal.tasks.ui.PersonProposalProvider - the mechanism is that it wil loop over all LOADED tasks that share the same repository URL and add the owner of that task - there is no code to add commenters or reporters, or to query the repository, or to intervene and advise in this process. The code is heavily commented with FIXME reimplement for 3.3 In my case I can just do an SQL query to the database to provide a list of people. Either a SELECT DISTINCT on the history or a SELECT on a special table containing current bug owners. Content assist may be different for Assigned To, CC, QA contact or other person fields. Content assist may also be different for based on specific Task properties, such as product,component, platform, or severity... So I propose a method to be added to the repository API called SortedSet<String> advisePersonProposals(TaskAttribute attribute, ITask task, TaskData data, SortedSet<String> proposal); that in turn will call a method in the connector SortedSet<String> advisePersonProposals(TaskRepository repository, TaskAttribute attribute, ITask task, TaskData data, SortedSet<String> proposal); The default list will contain the current task owner. The default will either return the unchanged list, or loop through loaded tasks and add the owners. A connector writer can then override and make it more specific to its repository kind. If this sounds like a good idea I would be willing to contribute such a patch for the tasks core.
That sounds like a good idea to me. We have discussed a cache for repository person objects that is populated by connectors for a while now but haven't come up with a good API, yet. Maarten, how do you imagine supporting asynchronous behavior in this API assuming that the call to the database could take a while?
*** Bug 334039 has been marked as a duplicate of this bug. ***
Created attachment 186583 [details] patch
Great patch! I have applied it to head. Connectors that wish to provide a list of proposals for the people content assist may either set options on the corresponding task attribute or override TaskAttributeMapper.getOptions() to return a dynamically generated list of proposals. The value of the returned map is used for the presentation in the content assist UI and the key is stored in the task attribute value.
Created attachment 186587 [details] mylyn/context/zip