Property samples

Basics

On almost methods, you'll see the parameter named "nodeId". The value of this parameter can be a valid document, folder, mail or record UUID.

Example of nodeId:

  • Using UUID -> "f123a950-0329-4d62-8328-0ff500fd42db"

Methods

addCategory 

Description:

MethodReturn valuesDescription

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); 
             try {
ws.login(user, password); ws.addCategory("f123a950-0329-4d62-8328-0ff500fd42db", "055e4384-7c70-4456-b32b-f5a55a79861f"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

removeCategory 

Description:

MethodReturn valuesDescription

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); 
             try {
ws.login(user, password); ws.removeCategory("f123a950-0329-4d62-8328-0ff500fd42db", "ac165cab-a62a-4b17-89fc-2480a1d784db"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

addKeyword 

Description:

MethodReturn valuesDescription

addKeyword(String nodeId, String keyword)

void

Adds a keyword and a node.

The keyword should be a single word without spaces, formats allowed:

  • "test"
  • "two_words" ( the character "_" is used for the junction ).

Also, we suggest you add a 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); 
             try {
ws.login(user, password); ws.addKeyword("f123a950-0329-4d62-8328-0ff500fd42db", "test"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

removeKeyword 

Description:

MethodReturn valuesDescription

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); 
             try {
ws.login(user, password); ws.removeKeyword("f123a950-0329-4d62-8328-0ff500fd42db", "test"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

setEncryption 

Description:

MethodReturn valuesDescription

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); 
             try {
ws.login(user, password); ws.setEncryption("f123a950-0329-4d62-8328-0ff500fd42db", "phrase"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

unsetEncryption 

Description:

MethodReturn valuesDescription

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); 
             try {
ws.login(user, password); ws.unsetEncryption("f123a950-0329-4d62-8328-0ff500fd42db"); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

setSigned 

Description:

MethodReturn valuesDescription

setSigned(String nodeId, boolean signed)

void

Marks a document assigned 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);  
             try {
ws.login(user, password); ws.setSigned("f123a950-0329-4d62-8328-0ff500fd42db", true); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }