Repository samples
Basics
Section titled “Basics”Suggested code sample
Section titled “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);At this point you can use all the Repository methods from “repository” class as is shown below:
ws.repository.getAppVersion();Methods
Section titled “Methods”getRootFolder
Section titled “getRootFolder”Description:
| Method | Return values | Description |
|---|---|---|
| getRootFolder() | Folder | Return the object Folder 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
Section titled “getTrashFolder”Description:
| Method | Return values | Description |
|---|---|---|
| getTrashFolder() | Folder | Returns the object Folder of node “/okm:trash/{userId}” |
The returned folder will be the user trash folder.
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
Section titled “getTrashFolderBase”Description:
| Method | Return values | Description |
|---|---|---|
| getTrashFolderBase() | Folder | Returns the object Folder 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
Section titled “getTemplatesFolder”Description:
| Method | Return values | Description |
|---|---|---|
| getTemplatesFolder() | Folder | Returns the object Folder 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
Section titled “getPersonalFolder”Description:
| Method | Return values | Description |
|---|---|---|
| getPersonalFolder() | Folder | Returns the object Folder of node “/okm:personal/{userId}” |
The returned folder will be the user personal folder.
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
Section titled “getPersonalFolderBase”Description:
| Method | Return values | Description |
|---|---|---|
| getPersonalFolderBase() | Folder | Return the object Folder 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
Section titled “getMailFolder”Description:
| Method | Return values | Description |
|---|---|---|
| getMailFolder() | Folder | Returns the object Folder of node “/okm:mail/{userId}” |
The returned folder will be the user mail folder.
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
Section titled “getMailFolderBase”Description:
| Method | Return values | Description |
|---|---|---|
| getMailFolderBase() | Folder | Returns the object Folder 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());}}}}getThesaurusFolder
Section titled “getThesaurusFolder”Description:
| Method | Return values | Description |
|---|---|---|
| getThesaurusFolder() | Folder | Returns the object Folder of node “/okm:thesaurus” |
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.getThesaurusFolder());}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getCategoriesFolder
Section titled “getCategoriesFolder”Description:
| Method | Return values | Description |
|---|---|---|
| getCategoriesFolder() | Folder | Returns the object Folder 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
Section titled “purgeTrash”Description:
| Method | Return values | Description |
|---|---|---|
| purgeTrash() | void | Definitively removes from repository all nodes into “/okm:trash/{userId}” |
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
Section titled “getUpdateMessage”Description:
| Method | Return values | Description |
|---|---|---|
| getUpdateMessage() | String | Retrieves a message when a new OpenKM release is available. |
There’s an official OpenKM update message service available which is based on your local 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: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
Section titled “getRepositoryUuid”Description:
| Method | Return values | Description |
|---|---|---|
| getRepositoryUuid() | String | Retrieves installation 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
Section titled “hasNode”Description:
| Method | Return values | Description |
|---|---|---|
| hasNode(String nodeId) | Boolean | Returns a node that indicates if a node exists or not. |
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
Section titled “getNodePath”Description:
| Method | Return values | Description |
|---|---|---|
| getNodePath(String uuid) | String | Converts a node UUID to the 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
Section titled “getNodeUuid”Description:
| Method | Return values | Description |
|---|---|---|
| getNodeUuid(String path) | String | Convert node path to 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
Section titled “getAppVersion”Description:
| Method | Return values | Description |
|---|---|---|
| getAppVersion() | AppVersion | Return information about 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
Section titled “copyAttributes”Description:
| Method | Return values | Description |
|---|---|---|
| copyAttributes(String nodeId, String dstId, boolean categories, boolean keywords, boolean propertyGroups, boolean notes, boolean wiki) |
void | Copy attributes from a node to other. |
The values of the dstId parameter should be a node UUID or 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);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
Section titled “executeScript”Description:
| Method | Return values | Description |
|---|---|---|
| executeScript(FileStream fs) | ScriptExecutionResult | Execute an 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 stringreturn "test result";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
Section titled “executeScript”Description:
| Method | Return values | Description |
|---|---|---|
| executeScript(String script) | ScriptExecutionResult | Executes an script. |
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
Section titled “executeSqlQuery”Description:
| Method | Return values | Description |
|---|---|---|
| executeSqlQuery(FileStream fs) | SqlQueryResults | Executes SQL sentences. |
The test.sql script used in the sample below:
SELECT NBS_UUID, NBS_NAME FROM OKM_NODE_BASE LIMIT 10;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
Section titled “executeSqlQuery”Description:
| Method | Return values | Description |
|---|---|---|
| executeSqlQuery(String sql) | SqlQueryResults | Executes SQL sentences. |
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
Section titled “executeHqlQuery”Description:
| Method | Return values | Description |
|---|---|---|
| executeHqlQuery(FileStream fs) | HqlQueryResults | Execute HQL sentences. |
The test.sql script used in the sample below:
SELECT uuid, name from NodeBase where name = 'okm:root';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
Section titled “executeHqlQuery”Description:
| Method | Return values | Description |
|---|---|---|
| executeHqlQuery(String hql) | HqlQueryResults | Executes HQL sentences. |
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
Section titled “getTranslations”Description:
| Method | Return values | Description |
|---|---|---|
| getTranslations(String lang, String module) | Dictionary<String, String> | Retrieves the translations of a module into a Map of values |
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
Section titled “getConfiguration”Description:
| Method | Return values | Description |
|---|---|---|
| getConfiguration(String key) | Configuration | Retrieve the value of a configuration parameter. |
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
Section titled “ getChangeLog”Description:
| Method | Return values | Description |
|---|---|---|
| getChangeLog(String nodePath, DateTime modificationsFrom) | List |
Return the list of changes in some path and subfolders. |
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()
Section titled “getServerTime()”Description:
| Method | Return values | Description |
|---|---|---|
| getServerTime() | String | Return the current server time. |
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
Section titled “getAvailableLocales”Description:
| Method | Return values | Description |
|---|---|---|
| getAvailableLocales(String locale) | Dictionary<String, String> | Return 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());}}}}getLicenseInfo
Section titled “getLicenseInfo”Description:
| Method | Return values | Description |
|---|---|---|
| getLicenseInfo() | LicenseInfo | Return license information. |
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);Console.WriteLine(ws.repository.getLicenseInfo().toString());}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getClusterUuid
Section titled “getClusterUuid”Description:
| Method | Return values | Description |
|---|---|---|
| getClusterUuid() | String | Return cluster UUID. |
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);Console.WriteLine("Cluster UUID =" + ws.repository.getClusterUuid());}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}getIsFilePlan
Section titled “getIsFilePlan”Description:
| Method | Return values | Description |
|---|---|---|
| getIsFilePlan() | bool | True when the filePlan mode is active |
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);Console.WriteLine("FilePlan= " + ws.repository.getIsFilePlan().ToString());}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}