• fill metadata fields with values automatically when you upload new documents

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #45833  by cherifmad
 
I would like to fill metadata some fields with values automatically when you upload new documents . I have view the process to add keywards wizards and groupe property wizards.
But ,when the groupe property is show, there way to have some way to get some fields filled yet .?

Thanks for your understanding
 #45858  by jllort
 
Try for example setting in the xml definition the value:
https://docs.openkm.com/kcenter/view/ok ... field.html
Code: Select all
<input label="Input label"  name="okp:consulting.input" value="defaultValue"/>
https://docs.openkm.com/kcenter/view/ok ... field.html
Code: Select all
<select label="select label" name="okp:consulting.select" type="simple">
      <option label="one" value="001" />
      <option label="two" value="002" />
      <option label="three" value="003" selected="true"/>
     </select>
That might initialize the form element with these values by default.
 #45869  by jllort
 
The wizard only works when you uploading a single file. A wizard-based on a queue for it should be implemented as an OpenKM external feature. We have something in customization in professional edition https://www.youtube.com/watch?v=do-uVuk816M what goes in that direction ( Basically it's a small UI created in the combination of SDK4J https://docs.openkm.com/kcenter/view/sdk4j-1.1/),
 #45870  by cherifmad
 
Thanks @Jlor, for this responses,
I am not a good java developper,
But I would,like to where and how I can use this SDK?
Is it in source code of openkm? Or This SDK is the web ( HTML page ?)
Please can you help to make the same application like the youtube example? "https://www.youtube.com/watch?v=do-uVuk816M"
 #45890  by jllort
 
This application is a bootstrap one what into it uses the SDK for JAVA for connecting to OpenKM. The idea is quite easy.
1- Documents are uploaded into /okm:root/import
Then external application
2- List files into ( using SDK )
3- Use preview feature ( from professional version is possible to use it, you should integrate some previewer or apply small changes into OpenKM community code to use it from outside, I should review actual code because I do not have in mind how is it ).
4- Get metadata definition ( SDK )
5- Draw metadata definition
6- Set metadata ( SDK again )

We do not have a sample as a web application with SDK working together. But is quite easy, when you authenticate to the application really you are authenticating to OpenKM across the SDK and you keep user and password for using the application when you are logged into.

The SDK is a library what can be used into your own projects ( https://docs.openkm.com/kcenter/view/sd ... lient.html for JAVA or https://docs.openkm.com/kcenter/view/sdk4net-1.1.2/ for .NET or https://docs.openkm.com/kcenter/view/sdk4php-1.1.2/ for PHP )
 #45922  by cherifmad
 
jllort wrote: Tue May 22, 2018 6:43 am This application is a bootstrap one what into it uses the SDK for JAVA for connecting to OpenKM. The idea is quite easy.
1- Documents are uploaded into /okm:root/import
Then external application
2- List files into ( using SDK )
3- Use preview feature ( from professional version is possible to use it, you should integrate some previewer or apply small changes into OpenKM community code to use it from outside, I should review actual code because I do not have in mind how is it ).
4- Get metadata definition ( SDK )
5- Draw metadata definition
6- Set metadata ( SDK again )

We do not have a sample as a web application with SDK working together. But is quite easy, when you authenticate to the application really you are authenticating to OpenKM across the SDK and you keep user and password for using the application when you are logged into.

The SDK is a library what can be used into your own projects ( https://docs.openkm.com/kcenter/view/sd ... lient.html for JAVA or https://docs.openkm.com/kcenter/view/sdk4net-1.1.2/ for .NET or https://docs.openkm.com/kcenter/view/sdk4php-1.1.2/ for PHP )
Thanks you a lot Jlort
I do it, this proccess, and I tell you my progression .
I have yet download the SDK for PHP, but, when I launch the php script in my broswer, it is the script, not the web application like youtube video( wizard catalog customization), ( see my screen shot)
thanks for your understanding
Attachments
test2.JPG
test2.JPG (89.84 KiB) Viewed 6143 times
 #46003  by cherifmad
 
jllort wrote: Thu May 24, 2018 8:13 am That is because you have not configured php support in your webserver and is not executed from server side. Google for "enable php" in your Operating system
Thanks dear Jllort, I have enable my PHP in windows,
I have maked some test like " addgroup" succesfully, but, If I would like to addgroup form or metadata for each document in one folder ( for exemple the SDK4PHP like the example of sdk4php), Can I make a loop or are you a best way to addgroup property at all documents in the same folder ?
 #46021  by cherifmad
 
jllort wrote: Fri Jun 01, 2018 6:35 pm You can iterate across al the documents into some folder with the method getDocumentChildren:
https://docs.openkm.com/kcenter/view/sd ... ntChildren
thanks Jllort, I have see it but I don't understand well the using of this method. per example, if I have this script, How can I use the getDocumentChildren ?
Code: Select all
<?php

include '../src/openkm/OpenKM.php';

use openkm\OKMWebServicesFactory;
use openkm\OpenKM;

class ExamplePropertyGroup {

    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 testAddGroup() {
        try {
            $this->ws->addGroup('/okm:root/SDK4PHP/logo.png', 'okg:consulting');
            echo 'addGroup';
        } catch (Exception $e) {
            var_dump($e);
        }
    }

}

$openkm = new OpenKM(); //autoload

 public function testGetDocumentChildren(){
        try {
            $documents = $this->ws->getDocumentChildren('/okm:root/SDK4PHP/');
            foreach ($documents as $document) {
                var_dump($document);
            }
        } catch (Exception $e) {
            var_dump($e);
        }
    }
$examplePropertyGroup = new ExamplePropertyGroup();
$exampleDocument->testGetDocumentChildren('365dc4a7-9bfb-489f-be19-659f5048dae3');
$examplePropertyGroup->testAddGroup();
?>
I have put the GetDocumentChildren, but an error appear.
can you help me to correct my script in order to apply the "addgroup" in all files of folder SDK4PHP like the one written in my script.
Thank you for your understanding
Will you help me please ? thanks for your understanding
 #46028  by jllort
 
In the code shown in our documentation it is looping across all the documents, try it: https://docs.openkm.com/kcenter/view/sd ... ntChildren , then for each document with the uuid variable of each document you can do something ( add group, se metadata etc... )
 #46036  by cherifmad
 
jllort wrote: Mon Jun 04, 2018 6:14 pm In the code shown in our documentation it is looping across all the documents, try it: https://docs.openkm.com/kcenter/view/sd ... ntChildren , then for each document with the uuid variable of each document you can do something ( add group, se metadata etc... )
Please can you make one example to show me the using of obtention of path's folders children( to get a path list) and create a list of addgroup ?
thanks for your understanding

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.