Repository samples
Methods
getRootFolder
Description:
Method | Return values | Description |
---|---|---|
getRootFolder() |
Folder |
Returns the object Folder of node "/okm:root" |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getRootFolder());
} catch (Exception e) {
e.printStackTrace();
}
}
}
getTrashFolder
Description:
Method | Return values | Description |
---|---|---|
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 "okmAdmin" user then the folder returned will be "/okm:trash/okmAdmin". |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getTrashFolder());
} catch (Exception e) {
e.printStackTrace();
}
}
}
getTemplatesFolder
Description:
Method | Return values | Description |
---|---|---|
getTemplatesFolder() |
Folder |
Returns the object Folder of node "/okm:templates" |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getTemplatesFolder());
} catch (Exception e) {
e.printStackTrace();
}
}
}
getPersonalFolder
Description:
Method | Return values | Description |
---|---|---|
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 "okmAdmin" user then the folder returned will be "/okm:personal/okmAdmin". |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getPersonalFolder());
} catch (Exception e) {
e.printStackTrace();
}
}
}
getMailFolder
Description:
Method | Return values | Description |
---|---|---|
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 "okmAdmin" user then the folder returned will be "/okm:mail/okmAdmin". |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getMailFolder());
} catch (Exception e) {
e.printStackTrace();
}
}
}
getThesaurusFolder
Description:
Method | Return values | Description |
---|---|---|
getThesaurusFolder() |
Folder |
Returns the object Folder of node "/okm:thesaurus" |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getThesaurusFolder());
} catch (Exception e) {
e.printStackTrace();
}
}
}
getCategoriesFolder
Description:
Method | Return values | Description |
---|---|---|
getCategoriesFolder() |
Folder |
Returns the object Folder of node "/okm:categories" |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getCategoriesFolder());
} catch (Exception e) {
e.printStackTrace();
}
}
}
purgeTrash
Description:
Method | Return values | Description |
---|---|---|
purgeTrash() |
void |
Definitively removes from repository all nodes into "/okm:trash/{userId}" |
For example if the method is executed by "okmAdmin" user then the purged trash will be "/okm:trash/okmAdmin". When a node is purged, it only will be able to be restored from a previously repository backup. The purge action remove the node definitely from the repository.
|
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
ws.purgeTrash();
} catch (Exception e) {
e.printStackTrace();
}
}
}
getUpdateMessage
Description:
Method | Return values | Description |
---|---|---|
getUpdateMessage() |
String |
Retrieves a message in case there is a newer 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.OKMWebservices;
import com.openkm.sdk4j.OKMWebservicesFactory;
public class Test {
public static void main(String[] args) {
String host = "http://localhost:8080/OpenKM";
String username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getUpdateMessage());
} catch (Exception e) {
e.printStackTrace();
}
}
}
getRepositoryUuid
Description:
Method | Return values | Description |
---|---|---|
getRepositoryUuid() |
String |
Retrieves installation unique identifier. |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getRepositoryUuid());
} catch (Exception e) {
e.printStackTrace();
}
}
}
hasNode
Description:
Method | Return values | Description |
---|---|---|
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.OKMWebservices;
import com.openkm.sdk4j.OKMWebservicesFactory;
public class Test {
public static void main(String[] args) {
String host = "http://localhost:8080/OpenKM";
String username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println("Exists node:"+ws.hasNode("064ff51a-b815-4f48-a096-b4946876784f"));
} catch (Exception e) {
e.printStackTrace();
}
}
}
getNodePath
Description:
Method | Return values | Description |
---|---|---|
getNodePath(String uuid) |
String | Converts node UUID to path. |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getNodePath("064ff51a-b815-4f48-a096-b4946876784f"));
} catch (Exception e) {
e.printStackTrace();
}
}
}
getNodeUuid
Description:
Method | Return values | Description |
---|---|---|
getNodeUuid(String path) |
String |
Converts node path to UUID. |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getNodeUuid("/okm:root/tmp"));
} catch (Exception e) {
e.printStackTrace();
}
}
}
getAppVersion
Description:
Method | Return values | Description |
---|---|---|
getAppVersion() |
AppVersion |
Returns information about OpenKM version. |
Example:
package com.openkm;
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 username = "okmAdmin";
String password = "admin";
OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);
try {
System.out.println(ws.getAppVersion());
} catch (Exception e) {
e.printStackTrace();
}
}
}