Creating tasks programmatically [message #55450] |
Thu, 07 August 2008 09:35 |
Eclipse User |
|
|
|
Originally posted by: matthias.scholz.interactive-objects.com
Hi,
I'm trying to create Mylyn tasks programmatrically, i.e., adding tasks to
a Trac repository via the Mylyn 3.0 Tasks API and a Trac connector.
However, I did not find any useful documentation how to do so and I am
presently out of my wits here.
Can some one provide help, please?
Maybe there is some example code somewhere?
Best and thanks,
MP
|
|
|
Re: Creating tasks programmatically - Unsupported Operation exception [message #55502 is a reply to message #55450] |
Thu, 07 August 2008 15:31 |
Eclipse User |
|
|
|
Originally posted by: matthias.scholz.interactive-objects.com
I've investigated the Trac connector tests from the cvs and came up with
the following code to create a completely new taskin my remote Trac
repository:
final TaskRepository taskRepository =
TasksUiPlugin.getRepositoryManager().getRepository(getReposi toryUrl());
final AbstractRepositoryConnector connector =
TasksUi.getRepositoryManager().getRepositoryConnector(taskRe pository.getConnectorKind());
AbstractTaskDataHandler taskDataHandler =
connector.getTaskDataHandler();
TaskAttributeMapper attributeMapper =
taskDataHandler.getAttributeMapper(taskRepository);
TaskData taskData = new TaskData(attributeMapper,
taskRepository.getConnectorKind(), taskRepository.getRepositoryUrl(), "");
ITaskMapping taskMapping = new DefaultTaskMapping();
taskDataHandler.initializeTaskData(taskRepository, taskData, taskMapping,
new NullProgressMonitor());
AbstractTaskDataHandler handler = connector.getTaskDataHandler();
RepositoryResponse returnValue = handler.postTaskData(taskRepository,
taskData, null, null);
However, the last call spawns an "Unsupported Operation" exception in the
TracTaskHandler.postTaskData() method.
Why?
|
|
|
|
Re: Creating tasks programmatically - Unsupported Operation exception [message #592273 is a reply to message #55450] |
Thu, 07 August 2008 15:31 |
Eclipse User |
|
|
|
Originally posted by: matthias.scholz.interactive-objects.com
I've investigated the Trac connector tests from the cvs and came up with
the following code to create a completely new taskin my remote Trac
repository:
final TaskRepository taskRepository =
TasksUiPlugin.getRepositoryManager().getRepository(getReposi toryUrl());
final AbstractRepositoryConnector connector =
TasksUi.getRepositoryManager().getRepositoryConnector(taskRe pository.getConnectorKind());
AbstractTaskDataHandler taskDataHandler =
connector.getTaskDataHandler();
TaskAttributeMapper attributeMapper =
taskDataHandler.getAttributeMapper(taskRepository);
TaskData taskData = new TaskData(attributeMapper,
taskRepository.getConnectorKind(), taskRepository.getRepositoryUrl(), "");
ITaskMapping taskMapping = new DefaultTaskMapping();
taskDataHandler.initializeTaskData(taskRepository, taskData, taskMapping,
new NullProgressMonitor());
AbstractTaskDataHandler handler = connector.getTaskDataHandler();
RepositoryResponse returnValue = handler.postTaskData(taskRepository,
taskData, null, null);
However, the last call spawns an "Unsupported Operation" exception in the
TracTaskHandler.postTaskData() method.
Why?
|
|
|
|
Powered by
FUDForum. Page generated in 0.02549 seconds