Repository samples

Basics

Suggested code sample

First, you must create the web service object:

OKMWebservices ws = OKMWebservicesFactory.newInstance(host);

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

ws.login(user, password);

Once you are logged in with the web services, the session is kept in the web service object. Then you can use the other API methods.

At this point, you can use all the Repository methods from "repository" class as shown below:

ws.repository.getAppVersion();

Methods

getRootFolder

Description:

MethodReturn valuesDescription

getRootFolder()

Folder

Returns the Folder object of node "/okm:root"

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:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getRootFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getTrashFolder

Description:

MethodReturn valuesDescription

getTrashFolder()

Folder

Returns the object Folder of node "/okm:trash/{userId}"

The returned folder will be the user's trash folder.

For example, if the method is executed by the "okmAdmin" user, then the folder returned will be "/okm:trash/okmAdmin".

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getTrashFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getTrashFolderBase

Description:

MethodReturn valuesDescription

getTrashFolderBase()

Folder

Returns the Folder object of node "/okm:trash"

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getTrashFolderBase()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getTemplatesFolder

Description:

MethodReturn valuesDescription

getTemplatesFolder()

Folder

Returns the Folder object of node "/okm:templates"

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getTemplatesFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getPersonalFolder

Description:

MethodReturn valuesDescription

getPersonalFolder()

Folder

Returns the Folder object of node "/okm:personal/{userId}"

The returned folder will be the user's personal folder.

For example, if the method is executed by the "okmAdmin" user, then the folder returned will be "/okm:personal/okmAdmin".

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);  
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getPersonalFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getPersonalFolderBase

Description:

MethodReturn valuesDescription

getPersonalFolderBase()

Folder

Returns the Folder object of node "/okm:personal"

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);  
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getPersonalFolderBase()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getMailFolder

Description:

MethodReturn valuesDescription

getMailFolder()

Folder

Returns the Folder object of node "/okm:mail/{userId}"

The returned folder will be the user's mail folder.

For example, if the method is executed by the "okmAdmin" user, then the folder returned will be "/okm:mail/okmAdmin".

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getMailFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getMailFolderBase

Description:

MethodReturn valuesDescription

getMailFolderBase()

Folder

Returns the Folder object of node "/okm:mail"

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getMailFolderBase()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getCategoriesFolder

Description:

MethodReturn valuesDescription

getCategoriesFolder()

Folder

Returns the Folder object of node "/okm:categories"

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);  
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getCategoriesFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

purgeTrash

Description:

MethodReturn valuesDescription

purgeTrash()

void

Permanently removes from the repository all nodes in "/okm:trash/{userId}"

For example, if the method is executed by the "okmAdmin" user, then the purged trash will be "/okm:trash/okmAdmin".

Once a node is purged, it can only be restored from a previous repository backup. The purge action permanently removes the node from the repository.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); ws.repository.purgeTrash(); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getUpdateMessage

Description:

MethodReturn valuesDescription

getUpdateMessage()

String

Retrieves a message when a new OpenKM release is available.

There is an official OpenKM update message service available which is based on your local OpenKM version. 

The most common message is that a new OpenKM version has been released.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

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); System.Console.WriteLine(ws.repository.getUpdateMessage()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getRepositoryUuid

Description:

MethodReturn valuesDescription

getRepositoryUuid()

String

Retrieves the installation's unique identifier.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getRepositoryUuid()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

hasNode

Description:

MethodReturn valuesDescription

hasNode(String nodeId)

Boolean

Returns a boolean that indicates whether a node exists.
The value of the parameter nodeId can be a valid UUID or path.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); System.Console.WriteLine("Exists node:" + ws.repository.hasNode("064ff51a-b815-4f48-a096-b4946876784f")); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getNodePath

Description:

MethodReturn valuesDescription

getNodePath(String uuid)

String

Converts a node UUID to its path.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getNodePath("e339f14b-4d3a-489c-91d3-05e4575709d2")); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getNodeUuid

Description:

MethodReturn valuesDescription

getNodeUuid(String path)

String

Converts a node path to a UUID.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getNodeUuid("/okm:root/tmp")); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getAppVersion

Description:

MethodReturn valuesDescription

getAppVersion()

AppVersion

Returns information about the OpenKM version.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8080/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host); 
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getAppVersion().toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

copyAttributes

Description:

MethodReturn valuesDescription

copyAttributes(String nodeId, String dstId, boolean categories, boolean keywords, boolean propertyGroups, boolean notes,
            boolean wiki)

void

Copies attributes from one node to another.

The values of the dstId parameter should be a node UUID or path.

  • When the categories parameter is true, the original values of the categories will be copied.
  • When the keywords parameter is true, the original values of the keywords will be copied.
  • When the property groups parameter is true, the original values of the metadata groups will be copied.
  • When the notes parameter is true, the original values of the notes will be copied.
  • When the wiki parameter is true, the original values of the wiki will be copied.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); ws.repository.copyAttributes("50b7a5b9-89d2-430e-bbc9-6a6e01662a71", "055e4384-7c70-4456-b32b-f5a55a79861f", true, true, true, true, true); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

executeScript

Description:

MethodReturn valuesDescription

executeScript(FileStream fs)

ScriptExecutionResult

Executes a script.

The local script - test.bsh - used in the sample below:

import com.openkm.api.OKMFolder;
import com.openkm.bean.Folder;
import com.openkm.util.ContextWrapper;

try {
OKMFolder okmFolder = ContextWrapper.getContext().getBean(OKMFolder.class);
for (Folder fld : okmFolder.getChildren(null, "/okm:root")) {
print(fld.getPath() + "\n");
}
} catch (Exception e) {
e.printStackTrace();
}

// Some value can also be returned as string
return "test result";

This action can only be performed by a superuser (a user with ROLE_ADMIN).

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using System.IO;
using com.openkm.sdk4csharp.bean;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); FileStream fs = new FileStream("E:\\test.bsh", FileMode.Open); ScriptExecutionResult result = ws.repository.executeScript(fs); System.Console.WriteLine(result.result); System.Console.WriteLine(result.stdout);
                 if (!result.stderr.Equals("")) { System.Console.WriteLine("Error happened"); System.Console.WriteLine(result.stderr); }
                 fs.Dispose(); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

executeScript

Description:

MethodReturn valuesDescription

executeScript(String script)

ScriptExecutionResult

Executes a script.

This action can only be performed by a superuser (user with ROLE_ADMIN).

 

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using System.IO;
using com.openkm.sdk4csharp.bean;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); String script = "import com.openkm.util.ContextWrapper;"
+ " import org.springframework.web.context.WebApplicationContext;"
+ " import com.openkm.api.OKMFolder;"
+ " import com.openkm.bean.Folder;"
+ " WebApplicationContext cc = (WebApplicationContext) ContextWrapper.getContext();"
+ " OKMFolder okmFolder = cc.getBean(OKMFolder.class);"
+ " for (Folder fld : okmFolder.getChildren(null,\"/okm:root\")) {"
+ " print(fld.getPath());"
+ "}";
ScriptExecutionResult result = ws.repository.executeScript(script);
Console.WriteLine(result.result);
Console.WriteLine(result.stdout); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

executeSqlQuery

Description:

MethodReturn valuesDescription

executeSqlQuery(FileStream fs)

SqlQueryResults

Executes SQL statements.

The test.sql script used in the sample below:

SELECT NBS_UUID, NBS_NAME FROM OKM_NODE_BASE LIMIT 10;

The SQL script can contain only a single SQL statement.

This action can only be performed by a superuser (a user with ROLE_ADMIN).

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using System.IO;
using com.openkm.sdk4csharp.bean;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); FileStream fs = new FileStream("E:\\test.sql", FileMode.Open); SqlQueryResults result = ws.repository.executeSqlQuery(fs);                 fs.Dispose(); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

executeSqlQuery

Description:

MethodReturn valuesDescription

executeSqlQuery(String sql)

SqlQueryResults

Executes SQL statements.

The SQL script can contain only a single SQL statement.

This action can only be performed by a superuser (user with ROLE_ADMIN).

 

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using System.IO;
using com.openkm.sdk4csharp.bean;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); SqlQueryResults result = ws.repository.executeSqlQuery("SELECT NBS_UUID, NBS_CONTEXT, NBS_NAME FROM OKM_NODE_BASE;");
foreach (SqlQueryResultColumns columns in result.sqlQueryResults)
{
Console.WriteLine("UUID:" + columns.sqlQueryResultColumns[0]);
Console.WriteLine("Context:" + columns.sqlQueryResultColumns[1]);
Console.WriteLine("Name:" + columns.sqlQueryResultColumns[2]);
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

executeHqlQuery

Description:

MethodReturn valuesDescription

executeHqlQuery(FileStream fs)

 HqlQueryResults

Executes HQL statements.

The test.sql script used in the sample below:

SELECT uuid, name from NodeBase where name = 'okm:root';

The HQL script can contain only a single HQL statement.

This action can only be performed by a superuser (a user with ROLE_ADMIN).

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.impl; using System.IO; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
   try {
ws.login(user, password);                  FileStream fs = new FileStream(@"C:\Desktop\test.sql", FileMode.Open);  HqlQueryResults result = ws.repository.executeHqlQuery(fs); fs.Dispose(); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

executeHqlQuery

Description:

MethodReturn valuesDescription

executeHqlQuery(String hql)

HqlQueryResults

Executes HQL statements.

The HQL script can contain only a single HQL statement.

This action can only be performed by a superuser (user with ROLE_ADMIN).

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.impl; using System.IO; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
   try {
ws.login(user, password);                  HqlQueryResults result = ws.repository.executeHqlQuery("SELECT uuid, name from NodeBase where name = 'okm:root';");
foreach (HqlQueryResultColumns row in result.hqlQueryResults)
{
Console.WriteLine("uuid: " + row.hqlQueryResultColumns[0] + ", name: " + row.hqlQueryResultColumns[1]);
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

 

getTranslations

Description:

MethodReturn valuesDescription

getTranslations(String lang, String module)

Dictionary<String, String>

Retrieves the translations of a module into a map of values.

The OpenKM translations tables can be used to retrieve the current OpenKM translations or create your own translations (insert values into a new module).

By default, module values are:

  • frontend (used by the default OpenKM UI).
  • extension (used by the OpenKM extension UI).
  • mobile (used by the OpenKM mobile UI).

Example to add a new translation module:

SQL values to be executed from Database query view:

DELETE FROM OKM_TRANSLATION WHERE TR_LANGUAGE='en-GB' and TR_MODULE='doc';
INSERT INTO OKM_TRANSLATION (TR_MODULE, TR_KEY, TR_TEXT, TR_LANGUAGE) VALUES ('doc', 'document.generator.title','Document generator', 'en-GB');
INSERT INTO OKM_TRANSLATION (TR_MODULE, TR_KEY, TR_TEXT, TR_LANGUAGE) VALUES ('doc', 'document.generator.logout','Logout', 'en-GB');

The code should then be:

Dictionary<String, String> translations = ws.repository.getTranslations("en-GB", "doc");

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); Dictionary<string,string>translations = ws.repository.getTranslations("en-GB", "frontend"); foreach (KeyValuePair<string, string> kvp in translations) { Console.WriteLine("key:{0},with translation:{1}", kvp.Key, kvp.Value); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getConfiguration

Description:

MethodReturn valuesDescription

getConfiguration(String key)

Configuration

Retrieves the value of a configuration parameter.

If your OpenKM version has the configuration parameter named "webservices.visible.properties", access to configuration parameters will be restricted for non-administrator users. That means any non-administrator user who tries to access configuration parameters via the web services that are not listed in "webservices.visible.properties" will get an access denied exception.

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:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try {
ws.login(user, password); Configuration configuration = ws.repository.getConfiguration("system.ocr"); System.Console.WriteLine(configuration.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

 getChangeLog

Description:

MethodReturn valuesDescription

getChangeLog(String nodePath, DateTime modificationsFrom)

List<ChangeLogged>

Return the list of changes in some path and subfolders.

  • The method is used by the desktop synchronization application to retrieve the changes.

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:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try {
ws.login(user, password); List<ChangeLogged> changeLoggedList = ws.repository.getChangeLog("/okm:root/test", DateTime.Now); foreach (var cl in changeLoggedList) { System.Console.WriteLine(cl.toString()); } } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getServerTime()

Description:

MethodReturn valuesDescription

getServerTime()

String

Returns the current server time.

The server time returned is in ISO 8601 format.

The method is used by the desktop synchronization application to retrieve changes.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.impl; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8080/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
             try {
ws.login(user, password); System.Console.WriteLine(ws.repository.getServerTime()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getAvailableLocales

Description:

MethodReturn valuesDescription

getAvailableLocales(String locale)

Dictionary<String, String>

Returns the available languages.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.impl;

namespace OKMRest
{
public class Program
{
static void Main(string[] args)
{
String host = "http://localhost:8080/openkm";
String username = "okmAdmin";
String password = "admin";
OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

try
{
ws.login(user, password);
Dictionary<String, String> locales = ws.repository.getAvailableLocales("en-GB");
foreach(KeyValuePair<String, String> local in locales)
{
Console.WriteLine("Language:" + local.Key + "," + local.Value);
}
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}