Repository samples

Basics

Suggested code sample

First, you must create the webservice object:

OKMWebservices ws = OKMWebservicesFactory.getInstance(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);

Once you are logged with the webservices the session is keep in the webservice Object. Then you can use the other API method

At this point you can use all the Repository methods from "repository" class as is shown below:

ws.repository.getAppVersion();

Methods

getRootFolder

Description:

MethodReturn valuesDescription

getRootFolder()

Folder

Returns the object Folder of node "/okm:root"

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getRootFolder());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

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 the user "okmAdmin" then the folder returned will be "/okm:trash/okmAdmin".

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getTrashFolder());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getTrashFolderBase

Description:

MethodReturn valuesDescription

getTrashFolderBase()

Folder

Returns the object Folder of node "/okm:trash"

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getTrashFolderBase());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getTemplatesFolder

Description:

MethodReturn valuesDescription

getTemplatesFolder()

Folder

Returns the object Folder of node "/okm:templates"

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getTemplatesFolder());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

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 the user "okmAdmin" then the folder returned will be "/okm:personal/okmAdmin".

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getPersonalFolder());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getPersonalFolderBase

Description:

MethodReturn valuesDescription

getPersonalFolderBase()

Folder

Returns the object Folder of node "/okm:personal"

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getPersonalFolderBase());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

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 the user "okmAdmin" then the folder returned will be "/okm:mail/okmAdmin".

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getMailFolder());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getMailFolderBase

Description:

MethodReturn valuesDescription

getMailFolderBase()

Folder

Returns the object Folder of node "/okm:mail"

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getMailFolderBase());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getThesaurusFolder

Description:

MethodReturn valuesDescription

getThesaurusFolder()

Folder

Returns the object Folder of node "/okm:thesaurus"

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getThesaurusFolder());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getCategoriesFolder

Description:

MethodReturn valuesDescription

getCategoriesFolder()

Folder

Returns the object Folder of node "/okm:categories"

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getCategoriesFolder());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

purgeTrash

Description:

MethodReturn valuesDescription

purgeTrash()

void

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

For example if the method is executed by the user  "okmAdmin" 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 removes the node definitely from the repository.

 

Example:

package com.openkm;

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

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.repository.purgeTrash();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getUpdateMessage

Description:

MethodReturn valuesDescription

getUpdateMessage()

String

Retrieves a message when there is a new OpenKM release.

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:

package com.openkm;

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

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);
            System.out.println(ws.repository.getUpdateMessage());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getRepositoryUuid

Description:

MethodReturn valuesDescription

getRepositoryUuid()

String

Retrieves the installation unique identifier.

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getRepositoryUuid());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

hasNode

Description:

MethodReturn valuesDescription

hasNode(String nodeId)

Boolean

Returns a node that indicate if a node exists or not.
The value of the parameter nodeId can be a valid UUID or path.

Example:

package com.openkm;

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

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);
            System.out.println("Exists node:" + ws.repository.hasNode("373bcdd0-c082-4e7b-addd-e10ef813946e"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getNodePath

Description:

MethodReturn valuesDescription

getNodePath(String uuid)

String Converts a node UUID to path.

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getNodePath("373bcdd0-c082-4e7b-addd-e10ef813946e"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getNodeUuid

Description:

MethodReturn valuesDescription

getNodeUuid(String nodePath)

String

Converts a node path to UUID.

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getNodeUuid("/okm:root/test"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getAppVersion

Description:

MethodReturn valuesDescription

getAppVersion()

AppVersion

Returns information about OpenKM version.

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getAppVersion());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

copyAttributes

Description:

MethodReturn valuesDescription

copyAttributes(String uuid, 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.

  • When the category parameter is true the original values of the categories will be copied.
  • When the keywords parameter is true the original values of the keywords will be copied.
  • When the property Groups parameter is true the original values of the metadata groups will be copied.
  • When the notes parameter is true the original values of the notes will be copied.
  • When the wiki parameter is true the original values of the wiki will be copied.

Example:

package com.openkm;

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

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.repository.copyAttributes("46762f90-82c6-4886-8d21-ad3017dd78a7", "ac9fe744-8e45-4bf4-a293-85dafe1bfbca", true, true, true, true, true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

executeScript

Description:

MethodReturn valuesDescription

executeScript(InputStream is)

ScriptExecutionResult

Executes 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 string
return "test result";

This action can only be done by a super user ( user with ROLE_ADMIN ).

Example:

package com.openkm;

import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.bean.ScriptExecutionResult;
import com.openkm.sdk4j.impl.OKMWebservices;

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);
            InputStream is = new FileInputStream("/home/openkm/test.bsh");
            ScriptExecutionResult result = ws.repository.executeScript(is);
            System.out.println(result.getResult());
            System.out.println(result.getStdout());

            if (!result.getStderr().isEmpty()) {
                System.out.println("Error happened");
                System.out.println(result.getStderr());
            }

            IOUtils.closeQuietly(is);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

executeSqlQuery

Description:

MethodReturn valuesDescription

executeSqlQuery(InputStream is)

SqlQueryResults

Executes SQL sentences.

The test.sql script used in the sample below:

SELECT NBS_UUID, NBS_NAME FROM OKM_NODE_BASE LIMIT 10;

The SQL script can only contains a single SQL sentence.

This action can only be done by a super user ( user with ROLE_ADMIN ).

Example:

package com.openkm;

import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.bean.SqlQueryResultColumns;
import com.openkm.sdk4j.bean.SqlQueryResults;
import com.openkm.sdk4j.impl.OKMWebservices;

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);
            InputStream is = new FileInputStream("/home/gnujavasergio/okm/test.sql");
            SqlQueryResults results = ws.repository.executeSqlQuery(is);

            for (SqlQueryResultColumns row : results.getResults()) {
                System.out.println("uuid" + row.getColumns().get(0) + ", name:" + row.getColumns().get(1));
            }

            IOUtils.closeQuietly(is);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Also the InputStream can be set as:

String sql = "SELECT NBS_UUID, NBS_NAME FROM OKM_NODE_BASE LIMIT 10;";
InputStream is = new ByteArrayInputStream(sql.getBytes("UTF-8"));

executeHqlQuery

Description:

MethodReturn valuesDescription

executeHqlQuery(InputStream is)

HqlQueryResults

Executes HQL sentences.

The test.sql script used in the sample below:

SELECT uuid, name from NodeBase where name = 'okm:root';

The HQL script can only contains a single HQL sentence.

This action can only be done by a super user ( user with ROLE_ADMIN ).

Example:

package com.openkm;

import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.bean.HqlQueryResultColumns;
import com.openkm.sdk4j.bean.HqlQueryResults;
import com.openkm.sdk4j.impl.OKMWebservices;

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);
            InputStream is = new FileInputStream("/home/gnujavasergio/okm/test.sql");
            HqlQueryResults result = ws.repository.executeHqlQuery(is);

            for (HqlQueryResultColumns row : result.getResults()) {
                System.out.println("uuid: " + row.getColumns().get(0) + ", name: " + row.getColumns().get(1));
            }

            IOUtils.closeQuietly(is);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Also the InputStream can be set as:

String sql = "SELECT uuid, name from NodeBase where name = 'okm:root';";
InputStream is = new ByteArrayInputStream(sql.getBytes("UTF-8"));

getTranslations

Description:

MethodReturn valuesDescription

getTranslations(String lang, String module)

Map<String, String>

Retrieve the translations of a module into a Map of values.

The OpenKM translations tables can be used to retrieve actually OpenKM translations or create your own translations ( insert values into new module ).

By default modules values are :

  • frontend ( used by default OpenKM UI ).
  • extension ( used by OpenKM extension UI ).
  • mobile ( used by OpenKM mobile UI ).

Example to add a new Translation module :

SQL values to be executed from Database query view:

DELETE FROM OKM_TRANSLATION WHERE TR_LANGUAGE='en-GB' and TR_MODULE='doc';
INSERT INTO OKM_TRANSLATION (TR_MODULE, TR_KEY, TR_TEXT, TR_LANGUAGE) VALUES ('doc', 'document.generator.title','Document generator', 'en-GB');
INSERT INTO OKM_TRANSLATION (TR_MODULE, TR_KEY, TR_TEXT, TR_LANGUAGE) VALUES ('doc', 'document.generator.logout','Logout', 'en-GB');

The code then should be:

Map<String, String> translations = ws.getTranslations("en-GB", "doc");

Example:

package com.openkm;

import java.util.Map;

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

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);
            Map<String, String> translations = ws.repository.getTranslations("en-GB", "frontend");
            for (String key : translations.keySet()) {
                System.out.println("key:'" + key + "', with translation:'" + translations.get(key) + "'");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getConfiguration

Description:

MethodReturn valuesDescription

getConfiguration(String key)

Configuration

Retrieve the value of a configuration parameter.

If your OpenKM version have the configuration parameter named "webservices.visible.properties", will be restricted for non Administrator users what parameters are accessible. That means any non Administrator use who will try accessing across the webservices to configuration parameters not set into the list of values of "webservices.visible.properties" will get an access denied exception.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.bean.Configuration;
import com.openkm.sdk4j.impl.OKMWebservices;

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);
            Configuration configuration = ws.repository.getConfiguration("system.ocr");
            System.out.println(configuration);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getChangeLog

Description:

MethodReturn valuesDescription

getChangeLog(String nodePath, Calendar modificationsFrom)

List<ChangeLogged>

Return the list of changes in some path and subfolders.

  • The method is used by desktop synchronization application for retrieving the changes.

Example:

package com.openkm;

import java.util.Calendar;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.bean.ChangeLogged;
import com.openkm.sdk4j.impl.OKMWebservices;

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);
            Calendar now = Calendar.getInstance();
            for (ChangeLogged cl : ws.repository.getChangeLog("/okm:root/synchronized", now)) {
                System.out.println(cl);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getServerTime()

Description:

MethodReturn valuesDescription

getServerTime()

String

Return the current server time.

The server time returned format is ISO8601

  • The method is used by desktop synchronization application for retrieving the changes

Example:

package com.openkm;

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

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);
            System.out.println(ws.repository.getServerTime());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getAvailableLocales

Description:

MethodReturn valuesDescription

getAvailableLocales(String locale)

Map<String, String>

Return the available languages

Example:

package com.openkm;

import java.util.Map;

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

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);
            Map<String, String> locales = ws.repository.getAvailableLocales("en-GB");
            for (String key : locales.keySet()) {
                System.out.println("Language:" + key + "," + locales.get(key));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getLicenseInfo()

Description:

MethodReturn valuesDescription

getLicenseInfo()

LicenseInfo

Return license information.

Example:

package com.openkm;

import com.openkm.sdk4j.OKMWebservicesFactory;
import com.openkm.sdk4j.bean.LicenseInfo;
import com.openkm.sdk4j.impl.OKMWebservices;

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);
            LicenseInfo licenseInfo = ws.repository.getLicenseInfo();
            System.out.println(licenseInfo);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getClusterUuid()

Description:

MethodReturn valuesDescription

getClusterUuid()

String

Return cluster UUID.

Example:

package com.openkm;

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

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);
            String clusterUuid = ws.repository.getClusterUuid();
            System.out.println(clusterUuid);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

getIsFilePlan()

Description:

MethodReturn valuesDescription

getIsFilePlan()

boolean

True when the filePlan mode is active

Example:

package com.openkm;

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

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);
            System.out.println("FilePlan: " + ws.repository.getIsFilePlan());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}