Property samples

Basics

On most methods you'll see 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 uuid, String catId)

void

Set a relation between a category and a node.

The value of the catId parameter should be a category folder UUID. 

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservices;
import com.openkm.sdk4j.OKMWebservicesFactory;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.addCategory("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "58c9b25f-d83e-4006-bd78-e26d7c6fb648");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

removeCategory 

Description:

MethodReturn valuesDescription

removeCategory(String uuid, String catId)

void

Removes a relation between a category and a node.

The value of the catId parameter should be a category folder UUID. 

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservices;
import com.openkm.sdk4j.OKMWebservicesFactory;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.removeCategory("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "58c9b25f-d83e-4006-bd78-e26d7c6fb648");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

addKeyword 

Description:

MethodReturn valuesDescription

addKeyword(String uuid, String keyword)

void

Add a keyword in a node.

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

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

We also we suggest you to add keyword in lowercase format, because OpenKM is case sensitive.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservices;
import com.openkm.sdk4j.OKMWebservicesFactory;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.addKeyword("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "test");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

removeKeyword 

Description:

MethodReturn valuesDescription

removeKeyword(String uuid, String keyword)

void

Removes a keyword from a node.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservices;
import com.openkm.sdk4j.OKMWebservicesFactory;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.removeKeyword("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "test");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

setEncryption 

Description:

MethodReturn valuesDescription

setEncryption(String uuid, String cipherName)

void

Marks a document as an en cripted binary data in the repository.

The parameter nodeId should be a document node. 

The parameter cipherName saves information about the encription mechanism.

This method does not perform any kind of encryption, simply mark in the database that a document is encrypted.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservices;
import com.openkm.sdk4j.OKMWebservicesFactory;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.setEncryption("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "phrase");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

unsetEncryption 

Description:

MethodReturn valuesDescription

unsetEncryption(String uuid)

void

Marks a document is a normal binary data into repository.

The parameter uuid should be a document node. 

This method does not perform any kind of encryption, simply mark into the database that a document has been uncrypted.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservices;
import com.openkm.sdk4j.OKMWebservicesFactory;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.unsetEncryption("eee9d70f-6af9-4783-82a7-b8ac94c234b6");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

setSigned 

Description:

MethodReturn valuesDescription

setSigned(String uuid, boolean signed)

void

Marks a document as signed or unsigned binary data into the repository.

The parameter uuid 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:

package com.openkm;

import com.openkm.sdk4j.OKMWebservices;
import com.openkm.sdk4j.OKMWebservicesFactory;

public class Test {

    public static void main(String[] args) {
        String host = "http://localhost:8080/openkm";
        String user = "okmAdmin";
        String password = "admin";
        OKMWebservices ws = OKMWebservicesFactory.getInstance(host);

        try {
            ws.login(user, password);
            ws.setSigned("eee9d70f-6af9-4783-82a7-b8ac94c234b6", true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}