Skip to content
Other versions

Loading…

Activity samples

First, you must create the web service object:

OKMWebservices ws = OKMWebservicesFactory.newInstance(host);

Then you should log in using the “login” method. You can access the “login” method from the web service object “ws” as shown below:

ws.login(user, password);

At this point, you can use all the Activity methods from the “activity” class as shown below:

Terminal window
ActivityList results = ws.activity.findActivityLog(0, 20, beginDate, endDate, user, "", item);

Description:

Method Return values Description
findActivityLog(int page, int length, DateTime beginDate, DateTime endDate, String user, String action, String item) ActivityList Returns a list of all activity logs by date, user, action, and item.

The value of the item is the UUID of the node (document, folder, mail, or record).

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.impl;
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);
DateTime beginDate = new DateTime(2019, 7, 1);
DateTime endDate = new DateTime(2019, 8, 1);
ActivityList activityList = ws.activity.findActivityLog(0, 10, beginDate, endDate, "testUser", "LOGIN", null);
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}

Description:

Method Return values Description
getActivityActions() List Returns a list of all activity log actions.

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<string> actions = ws.activity.getActivityActions();
foreach(string action in actions)
{
System.Console.WriteLine(action);
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}