Notification samples
Basics
On most methods, you'll see a parameter named "nodeId". The value of this parameter can be a valid document, folder, mail, or record UUID or path.
Example of nodeId:
- Using UUID -> "f123a950-0329-4d62-8328-0ff500fd42db";
- Using path -> "/okm:root/logo.png"
Methods
notify
Description:
Method | Return values | Description |
---|---|---|
notify(String nodeId, List<String> users, List<String> mails, String message, boolean attachment) |
void |
Send a mail notification. |
The parameter nodeId is the UUID or PATH of the node ( document, folder, mail, or record ). The parameter users are a set of OpenKM users to be notified. The parameter mails are a set of email addresses - usually external mails - to be notified. The parameter message is the content body of the mail. When the attachment value is true the node is attached to the mail. |
Example:
package com.openkm;
import java.util.ArrayList;
import java.util.List;
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.newInstance(host, user, password);
try {
String nodeId = "b153c4b7-3d1c-4589-bd42-0ed0f34fd338";
List<String> users = new ArrayList<>();
users.add("test");
users.add("gnujavasergio");
List<String> mails = new ArrayList<>();
mails.add("test@openkm.com");
mails.add("test@gmail.com");
String message = "Body of the message";
ws.notify(nodeId, users, mails, message, false);
} catch (Exception e) {
e.printStackTrace();
}
}
}