Property samples
Basics
On almost methods you'll see parameter named "nodeId". The value of this parameter can be a valid document, folder, mail or record UUID or path.
Example of nodeId:
- Using UUID -> "f123a950-0329-4d62-8328-0ff500fd42db";
- Using path -> "/okm:root/logo.png"
Methods
addCategory
Description:
| Method | Return values | Description | 
|---|---|---|
| addCategory(String nodeId, String catId) | void | Sets a relation between a category and a node. | 
| The value of the catId parameter should be a category folder 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
            {
                ws.addCategory("/okm:root/logo.png", "/okm:categories/test");
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            } 
        }
    }
}
removeCategory
Description:
| Method | Return values | Description | 
|---|---|---|
| removeCategory(String nodeId, String catId) | void | Removes a relation between a category and a node. | 
| The value of the catId parameter should be a category folder 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
            {
                ws.removeCategory("/okm:root/logo.png", "/okm:categories/test");
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            } 
        }
    }
}
addKeyword
Description:
| Method | Return values | Description | 
|---|---|---|
| addKeyword(String nodeId, String keyword) | void | Adds a keyword and a node. | 
| The keyword should be a single word without spaces, formats allowed: 
 Also we suggest you to add keyword in lower case format, because OpenKM is case sensitive. | ||
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.addKeyword("/okm:root/logo.png", "test");
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            } 
        }
    }
}
removeKeyword
Description:
| Method | Return values | Description | 
|---|---|---|
| removeKeyword(String nodeId, String keyword) | void | Removes a keyword from a node. | 
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.removeKeyword("/okm:root/logo.png", "test");
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            } 
        }
    }
}
setEncryption
Description:
| Method | Return values | Description | 
|---|---|---|
| setEncryption(String nodeId, String cipherName) | void | Marks a document as an encrypted binary data into the repository | 
| The parameter nodeId should be a document node. The parameter cipherName saves information about the encryption mechanism. This method does not perform any kind of encryption, simply mark into the database that a document is encrypted. | ||
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.setEncryption("/okm:root/logo.png", "phrase");
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            } 
        }
    }
}
unsetEncryption
Description:
| Method | Return values | Description | 
|---|---|---|
| unsetEncryption(String nodeId) | void | Marks a document as a normal binary data into repository. | 
| The parameter nodeId should be a document node. This method does not perform any kind of uncryption, simply mark into the database that a document has been uncrypted. | ||
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.unsetEncryption("/okm:root/logo.png");
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            } 
        }
    }
}
setSigned
Description:
| Method | Return values | Description | 
|---|---|---|
| setSigned(String nodeId, boolean signed) | void | Marks a document as signed or unsigned binary data into the repository | 
| The parameter nodeId should be a document node. This method does not perform any kind of digital signature process, simply mark into the database that a document is signed. | ||
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.setSigned("/okm:root/logo.pdf", true);
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            } 
        }
    }
}
 
                   
                  