Node samples
Basics
Section titled “Basics”Suggested code sample
Section titled “Suggested code sample”First, you must create the web service object:
OKMWebservices ws = OKMWebservicesFactory.getInstance(host);Then you should log in using the method “login”. You can access the “login” method from the web service object “ws” as shown below:
ws.login(user, password);At this point you can use all the Node methods from the “node” class as shown below:
ws.node.getNodeByUuid("29a22996-0e3b-421e-8759-c24ea41c1ebb")Methods
Section titled “Methods”getNodeByUuid
Section titled “getNodeByUuid”Description:
| Method | Return values | Description |
|---|---|---|
| getNodeByUuid(String uuid) | Node | Get a node by UUID. |
Example:
package com.openkm;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.Node;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); Node node = ws.node.getNodeByUuid("29a22996-0e3b-421e-8759-c24ea41c1ebb"); System.out.println(node); } catch (Exception e) { e.printStackTrace(); } }}getVersionHistory
Section titled “getVersionHistory”Description:
| Method | Return values | Description |
|---|---|---|
| getVersionHistory(String uuid) | List |
Returns a list of the version history for a document. |
Example:
package com.openkm;
import java.util.List;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.Version;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); List<Version> versions = ws.node.getVersionHistory("3767deb4-21e7-4272-82be-fece5384fbab"); for (Version version : versions) { System.out.println(version); } } catch (Exception e) { e.printStackTrace(); } }}restoreVersion
Section titled “restoreVersion”Description:
| Method | Return values | Description |
|---|---|---|
| restoreVersion(String uuid, String versionName) | void | Restore a document to a specific 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); ws.node.restoreVersion("3767deb4-21e7-4272-82be-fece5384fbab", "1.2"); } catch (Exception e) { e.printStackTrace(); } }}deleteVersion
Section titled “deleteVersion”Description:
| Method | Return values | Description |
|---|---|---|
| deleteVersion(String uuid, String versionName) | void | Delete a specific 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); ws.node.deleteVersion("5aab162d-df4f-4392-96c9-8fc1607e3903", "1.1"); } catch (Exception e) { e.printStackTrace(); } }}purgeVersionHistory
Section titled “purgeVersionHistory”Description:
| Method | Return values | Description |
|---|---|---|
| purgeVersionHistory(String uuid) | void | Purge the version history of a document. |
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.node.purgeVersionHistory("3767deb4-21e7-4272-82be-fece5384fbab"); } catch (Exception e) { e.printStackTrace(); } }}mayBePromotedAsRecord
Section titled “mayBePromotedAsRecord”Description:
| Method | Return values | Description |
|---|---|---|
| mayBePromotedAsRecord(String uuid, boolean fullEvaluation) | PromoteAsRecordEvaluation | Returns a PromoteAsRecordEvaluation object. |
Example:
package com.openkm;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.PromoteAsRecordEvaluation;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); PromoteAsRecordEvaluation pre = ws.node.mayBePromotedAsRecord("3767deb4-21e7-4272-82be-fece5384fbab", false); System.out.println(pre); } catch (Exception e) { e.printStackTrace(); } }}promoteAsRecord
Section titled “promoteAsRecord”Description:
| Method | Return values | Description |
|---|---|---|
| promoteAsRecord(String uuid) | void | Promote as a record. |
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.node.promoteAsRecord("3767deb4-21e7-4272-82be-fece5384fbab"); } catch (Exception e) { e.printStackTrace(); } }}degradeRecord
Section titled “degradeRecord”Description:
| Method | Return values | Description |
|---|---|---|
| degradeRecord(String uuid) | void | Degrade a record. |
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.node.degradeRecord("3767deb4-21e7-4272-82be-fece5384fbab"); } catch (Exception e) { e.printStackTrace(); } }}isElectronicRecordPath
Section titled “isElectronicRecordPath”Description:
| Method | Return values | Description |
|---|---|---|
| isElectronicRecordPath(String uuid) | boolean | Returns true when the node is in an electronic record. |
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.node.isElectronicRecordPath("3767deb4-21e7-4272-82be-fece5384fbab")); } catch (Exception e) { e.printStackTrace(); } }}getElectronicRecordInPath
Section titled “getElectronicRecordInPath”Description:
| Method | Return values | Description |
|---|---|---|
| getElectronicRecordInPath(String uuid) | Record | Get the electronic record in the path. |
Example:
package com.openkm;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.Record;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); Record record = ws.node.getElectronicRecordInPath("3767deb4-21e7-4272-82be-fece5384fbab"); System.out.println(record); } catch (Exception e) { e.printStackTrace(); } }}getChildrenNodesPaginated
Section titled “getChildrenNodesPaginated”Description:
| Method | Return values | Description |
|---|---|---|
| getChildrenNodesPaginated(String uuid, int offset, int limit, String filter, String orderByField, boolean orderAsc, List |
SimpleNodeBaseList | Get children nodes paginated. |
Example:
package com.openkm;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.NodesPaginationInfo;import com.openkm.sdk4j.bean.SimpleNodeBase;import com.openkm.sdk4j.bean.SimpleNodeBaseList;import com.openkm.sdk4j.impl.OKMWebservices;
import java.util.ArrayList;import java.util.List;
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); List<Integer> filteredTypes = new ArrayList<>(); filteredTypes.add(SimpleNodeBase.TYPE_FOLDER); filteredTypes.add(SimpleNodeBase.TYPE_DOCUMENT); // Folder UUID or Record UUID String uuid = "39479efe-de5e-468e-91a7-24d2aa3f8837"; SimpleNodeBaseList listNode = ws.node.getChildrenNodesPaginated(uuid, 0, 10, "", NodesPaginationInfo.ORDER_BY_NAME, true, filteredTypes); System.out.println("Filtered Elements: " + listNode.getFilteredElements()); System.out.println("Total Elements: " + listNode.getTotalElements()); for (SimpleNodeBase simpleNodeBase : listNode.getNodes()) { System.out.println(simpleNodeBase.getPath()); } } catch (Exception e) { e.printStackTrace(); } }}getChildrenNodesPaginated
Section titled “getChildrenNodesPaginated”Description:
| Method | Return values | Description |
|---|---|---|
| getChildrenNodesPaginated(String uuid, int offset, int limit, String filter, String orderByField, boolean orderAsc, List |
SimpleNodeBaseList | Get children nodes paginated. |
Example:
package com.openkm;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.NodesPaginationInfo;import com.openkm.sdk4j.bean.SimpleNodeBase;import com.openkm.sdk4j.bean.SimpleNodeBaseList;import com.openkm.sdk4j.impl.OKMWebservices;
import java.util.ArrayList;import java.util.List;
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); List<Integer> filteredTypes = new ArrayList<>(); filteredTypes.add(SimpleNodeBase.TYPE_FOLDER); filteredTypes.add(SimpleNodeBase.TYPE_DOCUMENT); // Folder UUID or Record UUID String uuid = "39479efe-de5e-468e-91a7-24d2aa3f8837"; SimpleNodeBaseList listNode = ws.node.getChildrenNodesPaginated(uuid, 0, 10, "", NodesPaginationInfo.ORDER_BY_NAME, true, filteredTypes, ""); System.out.println("Filtered Elements: " + listNode.getFilteredElements()); System.out.println("Total Elements: " + listNode.getTotalElements()); for (SimpleNodeBase simpleNodeBase : listNode.getNodes()) { System.out.println(simpleNodeBase.getPath()); } } catch (Exception e) { e.printStackTrace(); } }}getChildrenNodesByCategoryPaginated
Section titled “getChildrenNodesByCategoryPaginated”Description:
| Method | Return values | Description |
|---|---|---|
| getChildrenNodesByCategoryPaginated(String uuid, int offset, int limit, String filter, String orderByField, boolean orderAsc, List |
SimpleNodeBaseList | Get children nodes by category paginated. |
Example:
package com.openkm;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.NodesPaginationInfo;import com.openkm.sdk4j.bean.SimpleNodeBase;import com.openkm.sdk4j.bean.SimpleNodeBaseList;import com.openkm.sdk4j.impl.OKMWebservices;
import java.util.ArrayList;import java.util.List;
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); List<Integer> filteredTypes = new ArrayList<>(); filteredTypes.add(1); // Folder UUID or Record UUID String uuid = "39479efe-de5e-468e-91a7-24d2aa3f8837"; SimpleNodeBaseList listNode = ws.node.getChildrenNodesByCategoryPaginated(uuid, 0, 10, "", NodesPaginationInfo.ORDER_BY_NAME, true, filteredTypes); System.out.println("Filtered Elements: " + listNode.getFilteredElements()); System.out.println("Total Elements: " + listNode.getTotalElements()); for (SimpleNodeBase simpleNodeBase : listNode.getNodes()) { System.out.println(simpleNodeBase.getPath()); } } catch (Exception e) { e.printStackTrace(); } }}getChildrenNodesByCategoryPaginated
Section titled “getChildrenNodesByCategoryPaginated”Description:
| Method | Return values | Description |
|---|---|---|
| getChildrenNodesByCategoryPaginated(String uuid, int offset, int limit, String filter, String orderByField, boolean orderAsc, List |
SimpleNodeBaseList | Get children nodes by category paginated. |
Example:
package com.openkm;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.NodesPaginationInfo;import com.openkm.sdk4j.bean.SimpleNodeBase;import com.openkm.sdk4j.bean.SimpleNodeBaseList;import com.openkm.sdk4j.impl.OKMWebservices;
import java.util.ArrayList;import java.util.List;
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); List<Integer> filteredTypes = new ArrayList<>(); filteredTypes.add(1); // Folder UUID or Record UUID String uuid = "39479efe-de5e-468e-91a7-24d2aa3f8837"; SimpleNodeBaseList listNode = ws.node.getChildrenNodesByCategoryPaginated(uuid, 0, 10, "", NodesPaginationInfo.ORDER_BY_NAME, true, filteredTypes, ""); System.out.println("Filtered Elements: " + listNode.getFilteredElements()); System.out.println("Total Elements: " + listNode.getTotalElements()); for (SimpleNodeBase simpleNodeBase : listNode.getNodes()) { System.out.println(simpleNodeBase.getPath()); } } catch (Exception e) { e.printStackTrace(); } }}getBreadcrumb
Section titled “getBreadcrumb”Description:
| Method | Return values | Description |
|---|---|---|
| getBreadcrumb(String uuid) | List |
Get the breadcrumb. |
Example:
package com.openkm;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.BreadCrumbItem;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); List<BreadCrumbItem> list = ws.node.getBreadcrumb("39479efe-de5e-468e-91a7-24d2aa3f8837"); for (BreadCrumbItem item : list) { System.out.println(item.getPath()); } } catch (Exception e) { e.printStackTrace(); } }}subscribe
Section titled “subscribe”Description:
| Method | Return values | Description |
|---|---|---|
| subscribe(String uuid) | void | Adds a subscription to a node. |
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.node.subscribe("39479efe-de5e-468e-91a7-24d2aa3f8837"); } catch (Exception e) { e.printStackTrace(); } }}unsubscribe
Section titled “unsubscribe”Description:
| Method | Return values | Description |
|---|---|---|
| unsubscribe(String uuid) | void | Deletes a subscription to a node. |
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.node.unsubscribe("39479efe-de5e-468e-91a7-24d2aa3f8837"); } catch (Exception e) { e.printStackTrace(); } }}importZip
Section titled “importZip”Description:
| Method | Return values | Description |
|---|---|---|
| importZip(String uuid, InputStream is) | void | Import a ZIP file. |
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.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/import.zip"); ws.node.importZip("212e7c1f-443d-4aac-a12c-0b818ca03419", is); IOUtils.closeQuietly(is); } catch (Exception e) { e.printStackTrace(); } }}Description:
| Method | Return values | Description |
|---|---|---|
| unZip(String uuid, String dstId) | void | Unzip a file. |
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 uuid = "82555dd1-bcc2-4e64-81cb-5f7c2b0d7801"; // zip File String dstId = "70ec54af-76ad-4d02-b9c8-8c94c3b6ffc7"; // destination uuid ws.node.unZip(uuid, dstId); } catch (Exception e) { e.printStackTrace(); } }}exportZip
Section titled “exportZip”Description:
| Method | Return values | Description |
|---|---|---|
| exportZip(List |
InputStream | Export as a ZIP file. |
Example:
package com.openkm;
import java.io.FileOutputStream;import java.io.InputStream;import java.io.OutputStream;import java.util.ArrayList;import java.util.List;
import org.apache.commons.io.IOUtils;
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); List<String> uuids = new ArrayList<>(); uuids.add("0f6463f3-4d36-4091-b518-4fe7c353ee70"); uuids.add("d386cff8-1d4d-472f-9c6d-f21955ec499a");
OutputStream fos = new FileOutputStream("/home/openkm/export.zip");
InputStream is = ws.node.exportZip(uuids, true, true); IOUtils.copy(is, fos); IOUtils.closeQuietly(is); IOUtils.closeQuietly(fos); } catch (Exception e) { e.printStackTrace(); } }}getNodesFiltered
Section titled “getNodesFiltered”Description:
| Method | Return values | Description |
|---|---|---|
| getNodesFiltered(List |
List |
Returns a list of nodes. |
Example:
package com.openkm;
import java.util.ArrayList;import java.util.List;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.Node;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); List<String> uuids = new ArrayList<>(); uuids.add("0f6463f3-4d36-4091-b518-4fe7c353ee70"); uuids.add("d386cff8-1d4d-472f-9c6d-f21955ec499a");
List<Node> nodes = ws.node.getNodesFiltered(uuids); for (Node node : nodes) { System.out.println(node); } } catch (Exception e) { e.printStackTrace(); } }}evaluateDownloadZip
Section titled “evaluateDownloadZip”Description:
| Method | Return values | Description |
|---|---|---|
| evaluateDownloadZip(List |
ZipDownloadEvaluationResult | Returns a ZipDownloadEvaluationResult object. |
Example:
package com.openkm;
import java.util.ArrayList;import java.util.List;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.ZipDownloadEvaluationResult;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); List<String> uuids = new ArrayList<>(); uuids.add("0f6463f3-4d36-4091-b518-4fe7c353ee70"); uuids.add("d386cff8-1d4d-472f-9c6d-f21955ec499a");
ZipDownloadEvaluationResult result = ws.node.evaluateDownloadZip(uuids); System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }}generateDownloadToken
Section titled “generateDownloadToken”Description:
| Method | Return values | Description |
|---|---|---|
| generateDownloadToken(String uuid, boolean preview) | String | Generates a node download link. |
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.node.generateDownloadToken("b2f88679-e3fd-4f97-bf0e-abf76f9ec499", true)); } catch (Exception e) { e.printStackTrace(); } }}restore
Section titled “restore”Description:
| Method | Return values | Description |
|---|---|---|
| restore(String uuid) | Node | Restore a node. |
Example:
package com.openkm;
import com.openkm.sdk4j.OKMWebservicesFactory;import com.openkm.sdk4j.bean.Node;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); Node node = ws.node.restore("0f6463f3-4d36-4091-b518-4fe7c353ee70"); System.out.println(node); } catch (Exception e) { e.printStackTrace(); } }}hasNodesLockedByOtherUser
Section titled “hasNodesLockedByOtherUser”Description:
| Method | Return values | Description |
|---|---|---|
| hasNodesLockedByOtherUser(String uuid) | boolean | Returns whether the node is blocked by other users |
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); if(ws.node.hasNodesLockedByOtherUser("0f6463f3-4d36-4091-b518-4fe7c353ee70")) { System.out.println("Is blocked"); } } catch (Exception e) { e.printStackTrace(); } }}setComment
Section titled “setComment”Description:
| Method | Return values | Description |
|---|---|---|
| setComment(String uuid, String versionName, String comment) | void | Sets the comment for a specific node 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); ws.node.setComment("1ec49da9-1746-4875-ae32-9281d7303a62", "1.14", "Update comment"); } catch (Exception e) { e.printStackTrace(); } }}