Repository samples

Methods

getRootFolder

Description:

MethodReturn valuesDescription

getRootFolder()

Folder

Returns 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;

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, username, password);
             try { System.Console.WriteLine(ws.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 trash folder.

For example if the method is executed by "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;

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, username, password);
             try { System.Console.WriteLine(ws.getTrashFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getTemplatesFolder

Description:

MethodReturn valuesDescription

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, username, password);
             try { System.Console.WriteLine(ws.getTemplatesFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getPersonalFolder

Description:

MethodReturn valuesDescription

getPersonalFolder()

Folder

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

The returned folder will be the user personal folder.

For example if the method is executed by "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, username, password);
             try { System.Console.WriteLine(ws.getPersonalFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getMailFolder

Description:

MethodReturn valuesDescription

getMailFolder()

Folder

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

The returned folder will be the user mail folder.

For example if the method is executed by "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, username, password);
             try { System.Console.WriteLine(ws.getMailFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getThesaurusFolder

Description:

MethodReturn valuesDescription

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, username, password);
             try { System.Console.WriteLine(ws.getThesaurusFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getCategoriesFolder

Description:

MethodReturn valuesDescription

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, username, password);
             try { System.Console.WriteLine(ws.getCategoriesFolder()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

purgeTrash

Description:

MethodReturn valuesDescription

purgeTrash()

void

Definitively removes from the repository all nodes into "/okm:trash/{userId}"

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

When a node is purged it will only be able to be restored from a previously repository backup. The purge action remove the node definitely 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, username, password);
             try { ws.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's 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, username, password);
             try { System.Console.WriteLine(ws.getUpdateMessage()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getRepositoryUuid

Description:

MethodReturn valuesDescription

getRepositoryUuid()

String

Retrieves a 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, username, password);
             try { System.Console.WriteLine(ws.getRepositoryUuid()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

hasNode

Description:

MethodReturn valuesDescription

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, username, password);
             try { System.Console.WriteLine("Exists node:" + ws.hasNode("064ff51a-b815-4f48-a096-b4946876784f")); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getNodePath

Description:

MethodReturn valuesDescription

getNodePath(String uuid)

String

Converts node UUID to 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, username, password);
             try { System.Console.WriteLine(ws.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 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, username, password);
             try { System.Console.WriteLine(ws.getNodeUuid("/okm:root/tmp")); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getAppVersion

Description:

MethodReturn valuesDescription

getAppVersion()

AppVersion

Returns 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, username, password);
             try { System.Console.WriteLine(ws.getAppVersion()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }