Repository samples
Methods
getRootFolder
Description:
Method | Return values | Description |
---|---|---|
getRootFolder() |
Folder |
Returns the object Folder of node "/okm:root" |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetRoolFolder() {
try {
$folders = $this->ws->getRootFolder();
var_dump($folders);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetRoolFolder();
?>
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:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetTrashFolder(){
try {
$folders = $this->ws->getTrashFolder();
var_dump($folders);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetTrashFolder();
?>
getTrashFolderBase
Description:
Method | Return values | Description |
---|---|---|
getTrashFolderBase() |
Folder |
Returns the object Folder of node "/okm:trash" |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetTrashFolderBase(){
try {
$folders = $this->ws->getTrashFolderBase();
var_dump($folders);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetTrashFolderBase();
?>
getTemplatesFolder
Description:
Method | Return values | Description |
---|---|---|
getTemplatesFolder() |
Folder |
Returns the object Folder of node "/okm:templates" |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetTemplatesFolder() {
try {
$folders = $this->ws->getTemplatesFolder();
var_dump($folders);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetTemplatesFolder();
?>
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:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetPersonalFolder(){
try {
$folders = $this->ws->getPersonalFolder();
var_dump($folders);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetPersonalFolder();
?>
getPersonalFolderBase
Description:
Method | Return values | Description |
---|---|---|
getPersonalFolderBase() |
Folder |
Returns the object Folder of node "/okm:personal" |
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.getPersonalFolderBase());
} 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:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetMailFolder() {
try {
$folders = $this->ws->getMailFolder();
var_dump($folders);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetMailFolder();
?>
getMailFolderBase
Description:
Method | Return values | Description |
---|---|---|
getMailFolderBase() |
Folder |
Returns the object Folder of node "/okm:mail" |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetMailFolderBase(){
try {
$folders = $this->ws->getMailFolderBase();
var_dump($folders);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetMailFolderBase();
?>
getThesaurusFolder
Description:
Method | Return values | Description |
---|---|---|
getThesaurusFolder() |
Folder |
Returns the object Folder of node "/okm:thesaurus" |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetThesaurusFolder() {
try {
$folders = $this->ws->getThesaurusFolder();
var_dump($folders);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetThesaurusFolder();
?>
getCategoriesFolder
Description:
Method | Return values | Description |
---|---|---|
getCategoriesFolder() |
Folder |
Returns the object Folder of node "/okm:categories" |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetCategoriesFolder() {
try {
$folders = $this->ws->getCategoriesFolder();
var_dump($folders);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetCategoriesFolder();
?>
purgeTrash
Description:
Method | Return values | Description |
---|---|---|
purgeTrash() |
void |
Definitively remove 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 only will be able to be restored from a previously repository backup. The purge action remove the node definitely from the repository.
|
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testPurgeTrash() {
try {
$this->ws->purgeTrash();
echo 'correct';
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testPurgeTrash();
?>
getUpdateMessage
Description:
Method | Return values | Description |
---|---|---|
getUpdateMessage() |
string |
Retrieves a message when a new OpenKM release is available. |
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:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetUpdateMessage() {
try {
var_dump($this->ws->getUpdateMessage());
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetUpdateMessage();
?>
getRepositoryUuid
Description:
Method | Return values | Description |
---|---|---|
getRepositoryUuid() |
string |
Retrieves installation unique identifier. |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetRepositoryUuid() {
try {
var_dump($this->ws->getRepositoryUuid());
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetRepositoryUuid();
?>
hasNode
Description:
Method | Return values | Description |
---|---|---|
hasNode($nodeId) |
bool |
Returns a node that indicate if a node exists or not. |
Parameters: $nodeId string type is the value of the parameter nodeId can be a valid UUID or path. |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testHasNode() {
try {
echo 'Exists node: ' . $this->ws->hasNode('adabdb0f-7ff8-4832-9e43-8bc96fc1c9a5');
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testHasNode();
?>
getNodePath
Description:
Method | Return values | Description |
---|---|---|
getNodePath($uuid) |
string |
Converts node UUID to path. |
Parameters: $uuid string type is the uuid of the node |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetNodePath() {
try {
var_dump($this->ws->getNodePath('adabdb0f-7ff8-4832-9e43-8bc96fc1c9a5'));
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetNodePath();
?>
getNodeUuid
Description:
Method | Return values | Description |
---|---|---|
getNodeUuid($nodePath) |
string |
Converts node path to UUID. |
Parameters: $nodePath string type is the path of the node |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetNodeUuid() {
try {
var_dump($this->ws->getNodeUuid('/okm:root/SDK4PHP/logo.png'));
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetNodeUuid();
?>
getAppVersion
Description:
Method | Return values | Description |
---|---|---|
getAppVersion() |
AppVersion |
Returns information about OpenKM version. |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetAppVersion() {
try {
$appVersion = $this->ws->getAppVersion();
var_dump($appVersion);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetAppVersion();
?>
copyAttributes
Description:
Method | Return values | Description |
---|---|---|
copyAttributes($nodeId, $dstId, $categories, $keywords, $propertyGroups, $notes, |
void |
Copies attributes from a node to other. |
Parameters: $nodeId string type is the path of the node $dstId string type is the path of the node $categories bool type $keywords bool type $propertyGroups bool type $notes bool type $wiki bool type
|
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testCopyAttributes() {
try {
$this->ws->copyAttributes('/okm:root/SDK4PHP/invoice.pdf', '/okm:root/SDK4PHP/cloned_invoice.pdf', true, true, true, true, true);
echo 'Correct';
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testCopyAttributes();
?>
executeScript
Description:
Method | Return values | Description |
---|---|---|
executeScript($content) |
ScriptExecutionResult |
Executes an script. |
Parameters: $content string type Recommends using file_get_contents — Reads entire file into a string The local script - test.bsh - used in the sample below:
This action can only be done by a super user ( user with ROLE_ADMIN ). |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testExecuteScript() {
try {
$fileName = dirname(__FILE__) . '/files/test.bsh';
$scriptExecutionResult = new \openkm\bean\ScriptExecutionResult();
$scriptExecutionResult = $this->ws->executeScript(file_get_contents($fileName));
var_dump($scriptExecutionResult->getResult());
var_dump($scriptExecutionResult->getStdout());
if ($scriptExecutionResult->getStderr() != '') {
echo "Error happened";
var_dump($scriptExecutionResult->getStderr());
}
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testExecuteScript();
?>
executeSqlQuery
Description:
Method | Return values | Description |
---|---|---|
executeSqlQuery($content) |
SqlQueryResults |
Executes SQL sentences. |
Parameters: $content string type Recommend using file_get_contents — Reads entire file into a string The test.sql script used in the sample below:
The SQL script can only contains a single SQL sentence. This action can only be done by a super user ( user with ROLE_ADMIN ). |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
use openkm\bean\SqlQueryResults;
use openkm\bean\SqlQueryResultColumns;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testExecuteSqlQuery() {
try {
$fileName = dirname(__FILE__) . '/files/test.sql';
$sqlQueryResults = new SqlQueryResults();
$sqlQueryResults = $this->ws->executeSqlQuery(file_get_contents($fileName));
foreach ($sqlQueryResults->getResults() as $sqlQueryResultColumns ){
$columns = $sqlQueryResultColumns->getColumns();
var_dump('uuid: ' . $columns[0] . ' name: ' . $columns[1]);
}
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testExecuteSqlQuery();
?>
Also the InputStream can be set as:
$sql = "SELECT NBS_UUID, NBS_NAME FROM OKM_NODE_BASE LIMIT 10;";
$sqlQueryResults = $this->ws->executeSqlQuery($sql);
executeHqlQuery
Description:
Method | Return values | Description |
---|---|---|
executeHqlQuery($content) |
HqlQueryResults |
Executes HQL sentences. |
Parameters: $content string type Recommend using file_get_contents — Reads entire file into a string The testhql.sql script used in the sample below:
The HQL script can only contains a single HQL sentence. This action can only be done by a super user ( user with ROLE_ADMIN ). |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testExecuteHqlQuery() {
try {
$fileName = dirname(__FILE__) . '/files/testhql.sql';
$hqlQueryResults = new \openkm\bean\HqlQueryResults();
$hqlQueryResults = $this->ws->executeHqlQuery(file_get_contents($fileName));
foreach ($hqlQueryResults->getResults() as $hqlQueryResult ){
var_dump($hqlQueryResult);
}
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testExecuteHqlQuery();
?>
Also the InputStream can be set as:
$hql = "SELECT uuid, name from NodeBase where name = 'okm:root';";
$hqlQueryResults = $this->ws->executeHqlQuery($hql);
getTranslations
Description:
Method | Return values | Description |
---|---|---|
getTranslations($lang, $module) |
array |
Retrieves the translations of a module into an array |
Parameters: $lang string type $module string type The OpenKM translations tables can be used to retrieve actually OpenKM translations or create your own translations ( insert values into new module ). By default modules values are :
Example to add a new Translation module : SQL values to be executed from Database query view:
The code then should be:
|
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
use openkm\bean\SqlQueryResults;
use openkm\bean\SqlQueryResultColumns;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetTranslations() {
try {
$translations = $this->ws->getTranslations('en-GB','doc');
foreach ($translations as $translation ){
var_dump('key: ' . $translation->getKey() . ', with translation: ' . $translation->getValue());
}
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetTranslations();
?>
getConfiguration
Description:
Method | Return values | Description |
---|---|---|
getConfiguration($key) |
Configuration |
Retrieve the value of a configuration parameter. |
Parameters: $key string type is a configuration parameter If your OpenKM version have the configuration parameter named "webservices.visible.properties", will be restricted for non Administrator users what parameters are accessible. That means any non Administrator use who will try accessing across the webservices to configuration parameters not set into the list of values of "webservices.visible.properties" will get an access denied exception. |
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
use openkm\bean\SqlQueryResults;
use openkm\bean\SqlQueryResultColumns;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetConfiguration(){
try {
$configuration = $this->ws->getConfiguration('system.ocr');
var_dump($configuration);
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetConfiguration();
?>
getChangeLog
Description:
Method | Return values | Description |
---|---|---|
getChangeLog($nodePath, $modificationsFrom) |
array(ChangeLogged) |
Return the list of changes in some path and subfolders. |
Parameters: $nodePath string type is the path of the node(Folder,Document, Mail, Record) $modificationsFrom string type is the modificacions from date
|
Example:
<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\AppVersion;
use openkm\bean\SqlQueryResults;
use openkm\bean\SqlQueryResultColumns;
class ExampleRepository {
const HOST = "http://localhost:8080/OpenKM/";
const USER = "okmAdmin";
const PASSWORD = "admin";
private $ws;
public function __construct() {
$this->ws = OKMWebServicesFactory::build(self::HOST, self::USER, self::PASSWORD);
}
public function testGetChangeLog() {
try {
$changeLoggedes = $this->ws->getChangeLog("/okm:root/SDK4PHP", date('Y-m-d H:i:s'));
foreach ($changeLoggedes as $changeLogged) {
var_dump($changeLogged);
}
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleRepository = new ExampleRepository();
$exampleRepository->testGetChangeLog();
?>