Task samples
Basics
Task fields description:
Field | Type | Description | Mandatory |
---|---|---|---|
Id |
long |
Internal task id.
It is automatically set by application.
|
Not applicable. |
Owner |
String |
It contains the OpenKM userId. It is automatically set by application. |
Not applicable. |
Subject |
String |
The topic of the task. |
Yes. |
Description |
String |
The description of the task. |
No. |
Start |
DateTime |
When the task might start. |
Yes. |
End |
DateTime |
When the task might endding. |
No. |
Status |
TaskStatus |
The task status. You administering the list of status values. |
Yes. |
Project |
TaskProject |
The project related to the task. You administering the list of project values. |
Yes. |
Type |
TaskType |
The task type. You administering the list of task type values. |
Yes. |
Progress |
int |
The numeric progress status. The range of allowed values is from 0 to 100. Where 100% indicates a completed task. |
Yes. |
RepeatGroup |
long |
When a task is repeated along time is a member of a group. The group is identified by an unique repeat group id. |
No. |
ReminderStartValue |
int |
How many days before the task starts, the system might send a mail notification to the user. |
No. |
ReminderEndValue |
int |
How many days before the task ending, the system might send a mail notification to the user. |
No. |
ReminderStartUnit |
String |
Reminder start units. Allowed values:
|
Mandatory when ReminderStartValue greater than 0. |
ReminderEndUnit |
String |
Reminder end units. Allowed values:
|
Mandatory when ReminderEndValue greater than 0. |
Users |
List<String> |
Collection of assigned users to the task. |
No. But At least should be a user or role assigned. |
Roles |
List<String> |
Collection of assigned roles to the task. |
No. But At least should be a user or role assigned. |
Documents |
List<String> |
List of UUID's of the related documents. |
No. |
Folders |
List<String> |
List of UUID's of the related folders. |
No. |
Mails |
List<String> |
List of UUID's of the related mails. |
No. |
Records |
List<String> |
List of UUID's of the related records. |
No. |
On all methods, you'll see parameter named "token". When accessing application across SOAP the login process returns a token, what is used to identify the user on all the exposed methods. From default application execution context you must use the "null" value what indicates the application must use the "user session".
In special cases, you might be "promoted as Administrator" using the "administrator token".
String systemToken = DbSessionManager.getInstance().getSystemToken();
Suggested code sample
First, you must create the webservice object:
OKMWebservices ws = OKMWebservicesFactory.newInstance(host);
Then should login using the method "login". You can access the "login" method from webservice object "ws" as is shown below:
ws.login(user, password);
Once you are logged with the webservices the session is keep in the webservice Object. Then you can use the other API method
At this point you can use all the Task methods from "task" class as is shown below:
ws.task.getAssignedTasks(projectId, typeId, statusId, orderColumn, true, 0, 10, subject);
Methods
getAssignedTasks
Description:
Method | Return values | Description |
---|---|---|
getAssignedTasks(long projectId, long typeId, long statusId, String orderColumn, bool orderAsc, int offset, int limit, String subject) |
TaskList |
Retrieve a list of tasks assigned to a user, filtered and paginated. |
Filter parameters description:
The parameter "limit" and "offset" allows you to retrieve just a portion of the results of a query.
For example, if your query has 1000 results, but you only want to return the first 10, you should use these values:
Now suppose you want to show the results from 11-20, you should use these values:
|
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long statusId = 1; // A valid status id
String orderColumn = "subject"; // A valid TaskManagerTask class parameter name used in HQL query
String subject = "test";
TaskList assignedTasks = ws.task.getAssignedTasks(projectId, typeId, statusId, orderColumn, true, 0, 10, subject);
foreach (Task task in assignedTasks.tasks)
{
System.Console.WriteLine(task.toString());
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getActiveTasks
Description:
Method | Return values | Description |
---|---|---|
getActiveTasks(long projectId, long typeId, long statusId, String orderColumn, bool orderAsc, int offset, int limit, String subject) |
TaskList |
Retrieve a list of active tasks assigned to a user, filtered and paginated. |
Filter parameters description:
The parameter "limit" and "offset" allows you to retrieve just a portion of the results of a query.
For example if your query has 1000 results, but you only want to return the first 10, you should use these values:
Now suppose you want to show the results from 11-20, you should use these values:
|
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long statusId = 1; // A valid status id
String orderColumn = "subject"; // A valid TaskManagerTask class parameter name used in HQL query
String subject = "test";
TaskList activeTasks = ws.task.getActiveTasks(projectId, typeId, statusId, "description", false, 0, 10, subject);
foreach (Task task in activeTasks.tasks)
{
System.Console.WriteLine(task.toString());
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getFinishedTasks
Description:
Method | Return values | Description |
---|---|---|
getFinishedTasks(long projectId, long typeId, long statusId, String orderColumn, bool orderAsc, int offset, int limit, String subject) |
TaskList |
Retrieve a list of finished tasks assigned to a user, filtered and paginated. |
Filter parameters description:
The parameter "limit" and "offset" allows you to retrieve just a portion of the results of a query.
For example, if your query has 1000 results, but you only want to return the first 10, you should use these values:
Now suppose you want to show the results from 11-20, you should use these values:
|
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long statusId = 1; // A valid status id
String orderColumn = "start"; // A valid TaskManagerTask class parameter name used in HQL query
String subject = "test";
TaskList finishedTasks = ws.task.getFinishedTasks(projectId, typeId, statusId, "description", false, 0, 10, subject);
foreach (Task task in finishedTasks.tasks)
{
System.Console.WriteLine(task.toString());
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getTaskStatus
Description:
Method | Return values | Description |
---|---|---|
getTaskStatus() |
List<TaskStatus> |
Retrieve a list of all the task status. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
List<TaskStatus> list = ws.task.getTaskStatus();
foreach (TaskStatus taskStatus in list)
{
System.Console.WriteLine(taskStatus.name);
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getTaskProjects
Description:
Method | Return values | Description |
---|---|---|
getTaskProjects(bool filterActive) |
List<TaskProject> |
Retrieve a list of all the task projects. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
List<TaskProject> taskProjects = ws.task.getTaskProjects(true);
foreach (TaskProject tpj in taskProjects)
{
System.Console.WriteLine(tpj.name);
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getTaskTypes
Description:
Method | Return values | Description |
---|---|---|
getTaskTypes(bool filterActive) |
List<TaskType> |
Retrieve a list of all the task types. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
List<TaskType> taskTypes = ws.task.getTaskTypes(false);
foreach (TaskType tp in taskTypes)
{
System.Console.WriteLine(tp.name);
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getAssignedTasksCount
Description:
Method | Return values | Description |
---|---|---|
getAssignedTasksCount(long statusId, long projectId, long typeId) |
long |
Return the number of tasks assigned to a user. |
Filter parameters description:
|
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long statusId = 1; // A valid status id
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long assigned = ws.task.getAssignedTasksCount(statusId, projectId, typeId);
System.Console.WriteLine("Assigned tasks count: "+ assigned.ToString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getActiveTasksCount
Description:
Method | Return values | Description |
---|---|---|
getActiveTasksCount(long statusId, long projectId, long typeId) |
long |
Return the number of active tasks to a user. |
Filter parameters description:
|
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long statusId = 1; // A valid status id
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long active = ws.task.getActiveTasksCount(statusId, projectId, typeId);
System.Console.WriteLine("Active tasks count: " + active.ToString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getFinishedTasksCount
Description:
Method | Return values | Description |
---|---|---|
getFinishedTasksCount(long statusId, long projectId, long typeId) |
long |
Return the number of finished tasks to a user. |
Filter parameters description:
|
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long statusId = 1; // A valid status id
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long finished = ws.task.getFinishedTasksCount(statusId, projectId, typeId);
System.Console.WriteLine("Finished tasks count: " + finished.ToString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
createTask
Description:
Method | Return values | Description |
---|---|---|
createTask(String subject, String start, String end, String description, String statusId, String projectId, |
Task |
Create a new task. |
The repeatExpression parameters description: The commands are executed by cron when the minute, hour, and month fields match the current time, and when at least one of the two day fields (day of month, or day of week) match the current time. The scheduler examines crontab entries once every minute. The time and date fields are: * * * * * command to execute
|
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
using com.openkm.sdk4csharp.util;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
String subject = "task subject";
DateTime date = DateTime.Now;
String start = ISO8601.formatBasic(date);
date = new DateTime(2019, 1, 1);
String end = ISO8601.formatBasic(date);
String description = "description test";
String statusId = "1"; // A valid task status id
String projectId = "1"; // A valid project id
String typeId = "1"; // A valid type id
List<String> users = new List<String>();
users.Add("okmAdmin");
users.Add("pherrera");
List<String> roles = new List<String>();
roles.Add("ROLE_ADMIN");
roles.Add("ROLE_USER");
List<String> externalUsers = new List<String>();
externalUsers.Add("test@openkm.com");
List<String> relatedDocuments = new List<String>();
relatedDocuments.Add("82555dd1-bcc2-4e64-81cb-5f7c2b0d7801");
List<String> relatedFolders = new List<String>();
relatedFolders.Add("70ec54af-76ad-4d02-b9c8-8c94c3b6ffc7");
List<String> relatedMails = new List<String>();
List<String> relatedRecords = new List<String>();
Task task = ws.task.createTask(subject, start, end, description, statusId, projectId, typeId, users, roles, externalUsers,
relatedDocuments, relatedFolders, relatedRecords, relatedMails, "0 0 1 * *", "", "", 0, "", 0, "", 0);
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
updateTask
Description:
Method | Return values | Description |
---|---|---|
updateTask(String taskId, String subject, String start, String end, String description, String statusId, |
Task |
Update a task. |
The repeatExpression parameters description: The commands are executed by cron when the minute, hour, and month fields match the current time, and when at least one of the two day fields (day of the month, or day of the week) match the current time. The scheduler examines crontab entries once every minute. The time and date fields are: * * * * * command to execute
|
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
using com.openkm.sdk4csharp.util;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
String taskId = "2";
String subject = "task update";
DateTime date = DateTime.Now;
String start = ISO8601.formatBasic(date);
date = new DateTime(2019, 12, 1);
String end = ISO8601.formatBasic(date);
String description = "test update";
String statusId = "1"; // A valid task status id
String projectId = "1"; // A valid project id
String typeId = "1"; // A valid type id
List<String> users = new List<String>();
users.Add("test");
List<String> roles = new List<String>();
roles.Add("ROLE_ADMIN");
roles.Add("ROLE_USER");
List<String> externalUsers = new List<String>();
externalUsers.Add("test@openkm.com");
List<String> relatedDocuments = new List<String>();
relatedDocuments.Add("82555dd1-bcc2-4e64-81cb-5f7c2b0d7801");
List<String> relatedFolders = new List<String>();
relatedFolders.Add("70ec54af-76ad-4d02-b9c8-8c94c3b6ffc7");
List<String> relatedMails = new List<String>();
List<String> relatedRecords = new List<String>();
String owner = "okmAdmin";
int progress = 20; // Progress task
Task task = ws.task.updateTask(taskId, subject, start, end, description, statusId, projectId, typeId, users, roles, externalUsers,
relatedDocuments, relatedFolders, relatedRecords, relatedMails, owner, "0 0 1 * *", "", "", progress, 0, "", 0, "", 0);
System.Console.WriteLine(task.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getTask
Description:
Method | Return values | Description |
---|---|---|
getTask(long taskId) |
Task |
Retrieve a task. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskId = "2";
Task task = ws.task.getTask(task.id);
System.Console.WriteLine(task.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
deleteTask
Description:
Method | Return values | Description |
---|---|---|
deleteTask(long taskId) |
void |
Delete a task. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskId = "2";
ws.task.deleteTask(task.id);
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
createTaskProject
Description:
Method | Return values | Description |
---|---|---|
createTaskProject(String name, bool active, String description) |
TaskProject |
Create a task project. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
TaskProject taskProject = ws.task.createTaskProject("Task project 001", true, "Any description");
System.Console.WriteLine(taskProject.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
updateTaskProject
Description:
Method | Return values | Description |
---|---|---|
updateTaskProject(long projectId, bool active, String name, String description) |
TaskProject |
Update a task project. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskProjectId = 1; // Valid task project id
TaskProject taskProject = ws.task.updateTaskProject(taskProjectId, true, "Task project 002", "Any description");
System.Console.WriteLine(taskProject1.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
deleteTaskProject
Description:
Method | Return values | Description |
---|---|---|
deleteTaskProject(long projectId) |
void |
Deletea task project. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskProjectId = 1; // Valid task project id
ws.task.deleteTaskProject(taskProjectId);
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getTaskProject
Description:
Method | Return values | Description |
---|---|---|
getTaskProject(long projectId) |
TaskProject |
Get a task project. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskProjectId = 1; // Valid task project id
TaskProject tp = ws.task.getTaskProject(taskProjectId);
System.Console.WriteLine(tp.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
createTaskType
Description:
Method | Return values | Description |
---|---|---|
createTaskType(String name, bool active, String description) |
TaskType |
Create a task type. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
TaskType taskType = ws.task.createTaskType("Test", false, "Any description");
System.Console.WriteLine(taskType.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
updateTaskType
Description:
Method | Return values | Description |
---|---|---|
updateTaskType(long typeId, bool active, String name, String description) |
TaskType |
Update a task type. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskTypeId = 1; // Valid task type id
TaskType taskType = ws.task.updateTaskType(taskTypeId, true, "New Test", "New description");
System.Console.WriteLine(taskType.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
deleteTaskType
Description:
Method | Return values | Description |
---|---|---|
deleteTaskType(long typeId) |
void |
Delete a task type. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskTypeId = 1; //Valid task type id
ws.task.deleteTaskType(taskTypeId);
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getTaskType
Description:
Method | Return values | Description |
---|---|---|
getTaskType(long typeId) |
TaskType |
Get a task type object by id. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskTypeId = 1; //Valid task type id
TaskType taskType = ws.task.getTaskType(taskTypeId);
System.Console.WriteLine(taskType.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
createTaskStatus
Description:
Method | Return values | Description |
---|---|---|
createTaskStatus(String name, bool finish) |
TaskStatus |
Create a task status. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
TaskStatus taskStatus = ws.task.createTaskStatus("Test", false);
System.Console.WriteLine(taskStatus.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
updateTaskStatus
Description:
Method | Return values | Description |
---|---|---|
updateTaskStatus(long statusId, String name, bool finish) |
TaskStatus |
Update a task status. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskStatusId = 1; // Valid task status id
TaskStatus taskStatus = ws.task.updateTaskStatus(taskStatusId , "Test", true);
System.Console.WriteLine(taskStatus.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
deleteTaskStatus
Description:
Method | Return values | Description |
---|---|---|
deleteTaskStatus(long statusId) |
void |
Delete a task status. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskStatusId = 1; // Valid task status id
ws.task.deleteTaskStatus(taskStatusId);
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getTaskStatus
Description:
Method | Return values | Description |
---|---|---|
getTaskStatus(long statusId) |
TaskStatus |
Get a task status by id. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskStatusId = 1; // Valid task status id
TaskStatus taskStatus= ws.task.getTaskStatus(taskStatusId);
System.Console.WriteLine(taskStatus.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
getTaskNotes
Description:
Method | Return values | Description |
---|---|---|
getTaskNotes(long taskId) |
List<TaskNote> |
Returns a list of notes of a task. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskId = 1; // Valid task id
foreach (TaskNote tn in ws.task.getTaskNotes(taskId))
{
System.Console.WriteLine(tn.toString());
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
createTaskNote
Description:
Method | Return values | Description |
---|---|---|
createTaskNote(long taskId, String text) |
TaskNote |
Create a note to a certain task. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskId = 1; // Valid task id
TaskNote taskNote = ws.task.createTaskNote(taskId, "Any note");
System.Console.WriteLine(taskNote.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
updateTaskNote
Description:
Method | Return values | Description |
---|---|---|
updateTaskNote(long noteId, String text) |
TaskNote |
Update a task note. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskNoteId = 1; // Valid task note id
TaskNote taskNote = ws.task.updateTaskNote(taskNoteId, "Any text");
System.Console.WriteLine(taskNote.toString());
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
deleteTaskNote
Description:
Method | Return values | Description |
---|---|---|
deleteTaskNote(long noteId) |
void |
Delete a task note. |
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8180/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try
{
ws.login(user, password);
long taskNoteId = 1; // Valid task note id
ws.task.deleteTaskNote(taskNoteId);
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}