AquaLogic User Interaction Development Guide

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Creating Collaboration Tasks and Task Lists Using IDK Remote APIs

To create new Collaboration task lists, tasks and subtasks from a remote application, use the ITask* interfaces in the IDK.

The ITaskListManager.createTaskList method takes in a project ID, name and description, and returns an ITaskList object with a corresponding object ID and associated properties. In some cases, an existing task list can be used as a template. The ITaskListManager.copyTaskLists method allows you to copy existing task lists from one project to another.

Once a task list is created, you can create tasks and subtasks. The ITaskList.createTask method takes in a name, description, start date and end date, and returns an ITask object with a corresponding object ID and associated properties. The ITask.createSubTask method allows you to create subtasks using the same parameters. Subtasks are represented by an instance of ITask. For more information on subtasks, see Managing Collaboration Task Workflow Using IDK Remote APIs.

To create a new task list, follow the steps below.
  1. Create a session. For details, see Initiating a PRC Session to Use IDK Remote APIs.
  2. Retrieve the project ID (a source project must exist before you can create any Collaboration component objects). For details, see Querying Existing Collaboration Projects Using IDK Remote APIs.
  3. Create a new task list as shown in the code samples below.
  4. Use the new task list to add tasks and subtasks as shown in the code samples below.

Java

...

ICollaborationFactory collabFactory = portalSession.getCollaborationFactory();
ITaskListManager tasklistManager = collabFactory.getTaskListManager();

//create the task list
ITaskList tasklist = tasklistManager.createTaskList(project, name, description);

//call store() to persist the task list
tasklist.store();

//get the details URL and ID for the new task list
string url = tasklist.getDetailsURL();
int id = tasklist.getID();

//create the task
ITask task = tasklist.createTask(taskname, taskdescription, startTime, endTime);

//call store to persist the task
task.store();

......

.NET (C#)

...

//get the project ID out of session- this should never be null as it is added in the page load event
Plumtree.Remote.PRC.Collaboration.Project.IProject project = (Plumtree.Remote.PRC.Collaboration.Project.IProject)
Session[SESSION_PROJECT_KEY];

//create the task list
ITaskList tasklist = tasklistManager.CreateTaskList(project, name, description);

//call Store() to persist the task list
tasklist.Store();

//create the task
ITask task = tasklist.CreateTask(taskname, taskdescription, startTime, endTime);

//call Store() to persist the task
task.Store();
...

.NET (VB)

...

name = "ExampleTaskList"
description = "ExampleTaskListDescription"

'get the project ID out of session- this should never be Nothing as it is added in the page load event
dim project as Plumtree.Remote.PRC.Collaboration.Project.IProject = CType(Session.Item(SESSION_PROJECT_KEY),Plumtree.Remote.PRC.Collaboration.Project.IProject)

'create the task list
Dim tasklist As ITaskList = tasklistManager.CreateTaskList(project, name, description)

'call Store() to persist the task list
tasklist.Store()

'create the task
Dim tasklist As ITaskList = tasklistManager.CreateTaskList(project, name, description)

'call Store() to persist the task
task.Store()

...

  Back to Top      Previous Next