OKMProperty
Basics
Section titled “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 or path.
About the parameter named “catId”, the value of this parameter can be a valid categories folder UUID or path node.
Also on all methods you’ll see parameter named “token”. When accessing application across SOAP the login process returns a token, what is used to identify the user on all the exposed methods. From default application execution context you must use “null” value what indicates to the application must use the “user session”.
Methods
Section titled “Methods”addCategory
Section titled “addCategory”Description:
| Method | Return values | Description |
|---|---|---|
| addCategory(String token, String nodeId, String catId) | void | Set a relation between a category and a node. |
Example:
package com.openkm;
import com.openkm.api.OKMProperty;
public class Test { public static void main(String[] args) { try { OKMProperty.getInstance().addCategory(null, "/okm:root/logo.png", "/okm:categories/test"); } catch (Exception e) { e.printStackTrace(); } }}removeCategory
Section titled “removeCategory”Description:
| Method | Return values | Description |
|---|---|---|
| removeCategory(String token, String nodeId, String catId) | void | Removes a relation between a category and a node. |
Example:
package com.openkm;
import com.openkm.api.OKMProperty;
public class Test { public static void main(String[] args) { try { OKMProperty.getInstance().addCategory(null, "/okm:root/logo.png", "/okm:categories/test"); } catch (Exception e) { e.printStackTrace(); } }}addKeyword
Section titled “addKeyword”Description:
| Method | Return values | Description |
|---|---|---|
| addKeyword(String token, String nodeId, String keyword) | String | Add a keyword in a node. |
- The keyword should be a single word without spaces, formats allowed:
Example:
package com.openkm;
import com.openkm.api.OKMProperty;
public class Test { public static void main(String[] args) { try { String keyword = OKMProperty.getInstance().addKeyword(null, "/okm:root/logo.png", "test"); System.out.println(keyword); } catch (Exception e) { e.printStackTrace(); } }}removeKeyword
Section titled “removeKeyword”Description:
| Method | Return values | Description |
|---|---|---|
| removeKeyword(String token, String nodeId, String keyword) | void | Removes a keyword from a node. |
Example:
package com.openkm;
import com.openkm.api.OKMProperty;
public class Test { public static void main(String[] args) { try { OKMProperty.getInstance().removeKeyword(null, "/okm:root/logo.png", "test"); } catch (Exception e) { e.printStackTrace(); } }}setEncryption
Section titled “setEncryption”Description:
| Method | Return values | Description |
|---|---|---|
| setEncryption(String token, String nodeId, 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.
Example:
package com.openkm;
import com.openkm.api.OKMProperty;
public class Test { public static void main(String[] args) { try { OKMProperty.getInstance().setEncryption(null, "/okm:root/logo.png", "phrase"); } catch (Exception e) { e.printStackTrace(); } }}unsetEncryption
Section titled “unsetEncryption”Description:
| Method | Return values | Description |
|---|---|---|
| unsetEncryption(String token, String nodeId) | void | Marks a document is a normal binary data into repository. |
- The parameter nodeId should be a document node.
Example:
package com.openkm;
import com.openkm.api.OKMProperty;
public class Test { public static void main(String[] args) { try { OKMProperty.getInstance().unsetEncryption(null, "/okm:root/logo.png"); } catch (Exception e) { e.printStackTrace(); } }}setSigned
Section titled “setSigned”Description:
| Method | Return values | Description |
|---|---|---|
| setSigned(String token, 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.
Example:
package com.openkm;
import com.openkm.api.OKMProperty;
public class Test { public static void main(String[] args) { try { OKMProperty.getInstance().setSigned(null, "/okm:root/logo.png", true); } catch (Exception e) { e.printStackTrace(); } }}