Skip to content
Other versions

Loading…

Property samples

The value of this parameter can be a valid document, folder, mail or record UUID.

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 repository methods from “repository” class as shown below:

ws.property.addCategory("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "58c9b25f-d83e-4006-bd78-e26d7c6fb648");

Description:

Method Return values Description
addCategory(String uuid, String catId) void Sets 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.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.property.addCategory("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "58c9b25f-d83e-4006-bd78-e26d7c6fb648");
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
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.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.property.removeCategory("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "58c9b25f-d83e-4006-bd78-e26d7c6fb648");
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
addKeyword(String uuid, String keyword) void Adds a keyword to a node.

The keyword should be a single word without spaces. Formats allowed:

  • “test”
  • “two_words” (the character “_” is used as a separator).

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.property.addKeyword("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "test");
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
removeKeyword(String uuid, String keyword) void Removes a keyword from 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.property.removeKeyword("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "test");
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
setEncryption(String uuid, String cipherName) void Marks a document as encrypted binary data in the repository.

The parameter nodeId should be a document node.

The parameter cipherName stores information about the encryption mechanism.

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.property.setEncryption("eee9d70f-6af9-4783-82a7-b8ac94c234b6", "phrase");
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
unsetEncryption(String uuid) void Marks a document as normal binary data in the repository.

The parameter uuid should be a document 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.property.unsetEncryption("eee9d70f-6af9-4783-82a7-b8ac94c234b6");
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
setSigned(String uuid, boolean signed) void Marks a document as signed or unsigned binary data in the repository.

The parameter uuid should be a document 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.property.setSigned("eee9d70f-6af9-4783-82a7-b8ac94c234b6", true);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Description:

Method Return values Description
isSigned(String uuid) boolean Returns a boolean that indicates whether the document is signed.

The parameter uuid should be a document 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);
System.out.println("Is the document signed: " + ws.property.isSigned("6330d2a0-529f-4c14-baa1-ce6a92004e01"));
} catch (Exception e) {
e.printStackTrace();
}
}
}