Hi Sir,
Need some help on PHP SDK. My company have been using both OpenKM Pro(V6.4.49) and OpenKM Community(V6.3.2) for several years.
Now I would like to develop a more simple PHP web application to access to OpenKM Community to retrieve the folder list & PDF file inside those folders.
I tried to go through and study SDK PHP 1.1.2 from here (https://docs.openkm.com/kcenter/view/sd ... mples.html). However I see most of the sample/guides here will only use PHP function var_dump() to show the result.
In this case, I just need the specific "path" data, how can I get it to return only this "path" data? I tried to search in this forum as well as google search, but look like no one have a simple guide on this.
Can I ask if you could please help to guild me or show some simple code to achieve above information? Is that the SDK provided is just sample, which I need to modify it before use?
Example Script:
Need some help on PHP SDK. My company have been using both OpenKM Pro(V6.4.49) and OpenKM Community(V6.3.2) for several years.
Now I would like to develop a more simple PHP web application to access to OpenKM Community to retrieve the folder list & PDF file inside those folders.
I tried to go through and study SDK PHP 1.1.2 from here (https://docs.openkm.com/kcenter/view/sd ... mples.html). However I see most of the sample/guides here will only use PHP function var_dump() to show the result.
In this case, I just need the specific "path" data, how can I get it to return only this "path" data? I tried to search in this forum as well as google search, but look like no one have a simple guide on this.
Can I ask if you could please help to guild me or show some simple code to achieve above information? Is that the SDK provided is just sample, which I need to modify it before use?
Example Script:
Code: Select all
and the results showing<?php
include '../src/openkm/OpenKM.php';
use openkm\OKMWebservices;
use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\Folder;
class ExampleFolder {
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 testGetFolderChildren(){
try {
$folders = $this->ws->getFolderChildren("/okm:root/TLMS/CDR/COMDWG");
foreach ($folders as $folder) {
var_dump($folder);
}
} catch (Exception $e) {
var_dump($e);
}
}
}
$openkm = new OpenKM(); //autoload
$exampleFolder = new ExampleFolder();
$exampleFolder->testGetFolderChildren();
?>
D:\wamp\www\sdk4php-1.1.2\test\TestOKM.php:46:
object(openkm\bean\Folder)[24]
private 'hasChildren' => string 'false' (length=5)
protected 'created' => string '2021-04-19T11:42:13+08:00' (length=25)
protected 'path' => string '/okm:root/TLMS/CDR/COMDWG/[027]PRE-FORMING' (length=42)
protected 'author' => string 'okmAdmin' (length=8)
protected 'permissions' => int 15
protected 'uuid' => string '39e2a2f7-909f-4937-89e9-9afb5ad5c97d' (length=36)
protected 'subscribed' => string 'false' (length=5)
protected 'subscriptors' =>
array (size=0)
empty
protected 'keywords' =>
array (size=0)
empty
protected 'categories' =>
array (size=0)
empty
protected 'notes' =>
array (size=0)
empty