Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mylyn-integrators] how to get ITask object from task ID?

Just out of curiosity, what kind of connector are you working on?
i'm working on a StarTeam connector, it provides SDK (Java APIs) to access the server...

actually, i problem is the getTaskData signature only pass a String of Task ID, and TaskRepository object.
as this method supposed, i need retrieve the full task details from server
for web/http access system like JIRA, bugzilla, Trac, etc. it won't be a pb
since they all have a uniform query interface by TaskID
e.g. JIRA: http://hostname:port/TASKID

but for StarTeam, tasks/CRs are stored under the folder, so the pseudo-url:
hostname:port/Project/View/FolderA/FoderB/TASKID

currently, i put the "/Project/View/FolderA/FoderB/" part in IRespositoryQuery

go back to the getTaskData() method, i cannot retrieve the full task details since incomplete context info (nowhere to get the path part)


The getTaskData() method is indeed expected to return the full details
of a task. I would recommend encoding all relevant information
required to retrieve the task  into the task id or store it on the
TaskRepository object if it's not specific to a task.

yep, i'm also considering put some context info (e.g. path) to the TaskRepository, which will be persisted into respository.xml.zip
and retrieve the context info via the TaskRespository attributes access methods...

but, you know, it's the last option

If that is not feasible you could consider overriding
AbstractRepositoryConnector.canSynchronizeTask() and return false. If
you ensure that performQuery() always returns non partial task data
you should still be able to leverage almost all functionality of the
framework. One limitation is that looking up repository tasks by id
will not work unless a task is already in the task list.

Oh? could it be a case that I handle a Task ID, which passed as a argument by mylyn framework, but the corresponding task not in the task list?

One more thing, i'm considering use TasksUiPlugin.getTaskList() to retrieve the task list, and query task by id/key with the methods provided by TaskList.
but one pb is TasksUiPlugin.getTaskList() depends on the Mylyn Task UI plugin, but my code (RespositoryConnector) actually lay in a Core plugin...

any suggestions?

  Thanks & Best Regards!

               ///
              (. .)
  --------ooO--(_)--Ooo--------
  |         Nick Tan          |
  -----------------------------



On Tue, Oct 19, 2010 at 11:25 AM, Steffen Pingel <steffen.pingel@xxxxxxxxxxx> wrote:
The getTaskData() method is indeed expected to return the full details
of a task. I would recommend encoding all relevant information
required to retrieve the task  into the task id or store it on the
TaskRepository object if it's not specific to a task.

If that is not feasible you could consider overriding
AbstractRepositoryConnector.canSynchronizeTask() and return false. If
you ensure that performQuery() always returns non partial task data
you should still be able to leverage almost all functionality of the
framework. One limitation is that looking up repository tasks by id
will not work unless a task is already in the task list.

Just out of curiosity, what kind of connector are you working on?

Steffen


On Mon, Oct 18, 2010 at 7:29 AM, XuQing Tan <missedone@xxxxxxxxx> wrote:
> hi, folks
>
> i'm recently developing a mylyn starteam connector to fetch tasks/CRs.
>
> i notice that in the AbstractRepositoryConnector, i need to implement the
> method:
>
> org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector.getTaskData(TaskRepository,
> String, IProgressMonitor)
>
> which means let me to update the TaskData from repository? generally, query
> latest details from server?
>
> here's a taskId as String as the argument, but from my side, i cannot get
> the task URl from single taskId, i need context info, like
> IRepositoryQuery...
>
> i found that this method signature is designed for http-like query, i mean
> both bugzilla, jira, trac all has a uniform url for querying task detail
> from task Id...
>
> i notice that, ITask object will be persisted into task.xml.zip, and its
> attributes as well
> so i'm thinking, is there any way to get the ITask object from taskId, and
> thus i can get some context info from the ITask object:
>
> org.eclipse.mylyn.tasks.core.IAttributeContainer.getAttribute(String)
>
> (ITask extends the IAttributeContainer interface)
>
> anyone can help?
>
> ---
>   Thanks & Best Regards!
>
>                ///
>               (. .)
>   --------ooO--(_)--Ooo--------
>   |         Nick Tan          |
>   -----------------------------
>
>
> _______________________________________________
> mylyn-integrators mailing list
> mylyn-integrators@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
>
>



--
Steffen Pingel
Committer, http://eclipse.org/mylyn
Senior Developer, http://tasktop.com
_______________________________________________
mylyn-integrators mailing list
mylyn-integrators@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mylyn-integrators


Back to the top