The task list is only accessible through internals at the moment. You can
add yourself to the CC of this bug to monitor progress for providing a task
list API:

 239994: [api] provide access to task list
 https://bugs.eclipse.org/bugs/show_bug.cgi?id=239994

It is possible to create tasks using the Mylyn tasks core API. I have
committed an example to the org.eclipse.mylyn.examples.jira project which
should work for Bugzilla with minor modifications. Here is the relevant part
of the source:

            TaskData taskData = new
TaskData(dataHandler.getAttributeMapper(repository),
repository.getConnectorKind(),
                    repository.getRepositoryUrl(), "");
            TaskMapping mapping = new TaskMapping() {
                @Override
                public String getProduct() {
                    return "SCRATCH";
                }

                @Override
                public String getSummary() {
                    return "Issue created by JiraCreateIssueExample";
                }
            };

            System.out.println("Initializing project...");
            dataHandler.initializeTaskData(repository, taskData, mapping,
null);
            System.out.println("Applying attributes...");
            connector.getTaskMapping(taskData).merge(mapping);

            System.out.println("Creating issue...");
            RepositoryResponse response =
dataHandler.postTaskData(repository, taskData, null, null);

Steffen


On Thu, Apr 9, 2009 at 6:50 AM, Vincent Vallarine <[email protected]>wrote:

> I'm trying to get away from using internals but I can't find the API
> equivalent for many things.
>
> I need to do a 2 main things programmatically:
> 1. Create a TaskList that shows up on the Mylyn TaskList UI
> 2. Create/Modify Tasks on a Bugzilla server.
>
> Any help on showing me the API equivalent of the below internals would
> be very helpful:
>
>
>
> //BugzillaRepositoryConnector is internal
> BugzillaRepositoryConnector connector;
>
> //TasksUiPlugin.getDefault() is internal
> TasksUiPlugin.getDefault().getPreferenceStore().setValue(
> ITasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED,
> false);
>
> //TasksUiPlugin.getRepositoryManager() is internal
> manager = TasksUiPlugin.getRepositoryManager();
>
> //internal
> manager.addRepository(repository);
> TaskList taskList = TasksUiPlugin.getTaskList();
>
> // manager.getRepositoryConnector is internal
> AbstractRepositoryConnector abstractRepositoryClient =
> manager.getRepositoryConnector(BugzillaCorePlugin.CONNECTOR_KIND);
>
> //BugzillaRepositoryConnector is internal
> connector = (BugzillaRepositoryConnector) abstractRepositoryClient;
>
>
> //connector.getTaskData() is internal
> connector.getTaskData(repository, existingTaskId,
> new NullProgressMonitor());
>
> //how to create a task w/o using internals?
> TasksUiInternal.createTaskData(repository,
>  taskMappingInit, taskMappingSelect, null);
>
> //TaskCategory is internal
> TaskCategory taskCategory = new TaskCategory(taskCategoryName);
>
> //all internal
> connector.getTaskDataHandler().initializeTaskData(repository,
> taskDataNew[0],                                                 new
> DefaultTaskMapping(), new
> NullProgressMonitor());
> _______________________________________________
> mylyn-integrators mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/mylyn-integrators
>



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

Reply via email to