• Tutorial - "Unique name" - NEED HELP Version 2.0

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #24450  by kknd
 
Hi All,

I'm doing a tutorial but I need help because given problem, hep-me please : )
Fonte: http://wiki.openkm.com/index.php/Unique_name
My version: OpenKM Community

See screens
0. Run OpenKM for the first time, close the server, start again, create a any FOLDER, and can proceed
1. Register Database metadata
Image
Code: Select all
-- metadata type
DELETE FROM OKM_DB_METADATA_TYPE WHERE DMT_TABLE='customer';
INSERT INTO OKM_DB_METADATA_TYPE (DMT_TABLE, DMT_REAL_COLUMN, DMT_TYPE, DMT_VIRTUAL_COLUMN) VALUES ('customer', 'col00', 'integer', 'cus_id');
INSERT INTO OKM_DB_METADATA_TYPE (DMT_TABLE, DMT_REAL_COLUMN, DMT_TYPE, DMT_VIRTUAL_COLUMN) VALUES ('customer', 'col01', 'text', 'cus_nombre');
 
-- values
DELETE FROM OKM_DB_METADATA_VALUE WHERE DMV_TABLE='customer';
INSERT INTO OKM_DB_METADATA_VALUE (DMV_TABLE, DMV_COL00, DMV_COL01) VALUES ('customer', '0001','Customer 1');
INSERT INTO OKM_DB_METADATA_VALUE (DMV_TABLE, DMV_COL00, DMV_COL01) VALUES ('customer', '0002','Customer 2');
Image

AND
Code: Select all
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.validation.PathContains', 'PathContains', 'validation', 'text', 'okm:folder', 'String', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('pre', 'com.openkm.automation.action.ExecuteScripting', 'ExecuteScripting', 'action', 'code', '', 'Script', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.ExecuteScripting', 'ExecuteScripting', 'action', 'code', '', 'Script', '', '', '');
Image
...
Image
2. Register the group
Image
....
Image
....
Image
Clear the text
Image
.....
Image
Put new code
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.1//EN" "http://www.openkm.com/dtd/property-groups-2.1.dtd">
<property-groups>
<property-group label="Datos" name="okg:data">
<input label="Id" type="text" name="okp:data.id" width="200px" readonly="true"/>
<input label="Project code" type="text" name="okp:data.project.code" width="200px">
<validator type="req"/>
<validator type="num"/>
<validator type="maxlen" parameter="6"/>
<validator type="minlen" parameter="6"/>
</input>
<select label="Customer" name="okp:data.customer" type="simple" table="customer" optionsQuery="select $cus_id, $cus_nombre from DatabaseMetadataValue dmv where dmv.table='customer'">
<validator type="req"/>
</select>
<input label="Description" type="text" name="okp:data.description" width="200px">
<validator type="req"/>
<validator type="maxlen" parameter="150"/>
</input>
</property-group>
</property-groups>
REMOVE ANY SPACE ! AND SEND
Image
Register
Image
Result
Image

Image
Image
Image
Image
Image
Image
Image
Image

and now admin ? : / dont have the "AddPropertyGoupToWizard" in ACTIONS ....

: (
....
Last edited by kknd on Sat Aug 03, 2013 12:10 pm, edited 26 times in total.
 #24459  by jllort
 
In http://wiki.openkm.com/index.php/Automation is explained how to enable automation http://wiki.openkm.com/index.php/Enable_automation

In community version you should execute from administration -> Database query:
Code: Select all
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.validation.PathContains', 'PathContains', 'validation', 'text', 'okm:folder', 'String', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('pre', 'com.openkm.automation.action.ExecuteScripting', 'ExecuteScripting', 'action', 'code', '', 'Script', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.ExecuteScripting', 'ExecuteScripting', 'action', 'code', '', 'Script', '', '', '');
and then you'll got it registered
 #24488  by jllort
 
Community version does not comes with all features presents in professional, for it I give you only few sql inserts. On latest professional openkm 6.4.x version is not necessary register on database, automatically loads its from deployed classes. Anyway you're able to extend classes as you wish, take a look here http://wiki.openkm.com/index.php/Extend_automation really is simply doing it.

Here can see implementations of :
http://doxygen.openkm.com/dd/d04/namesp ... ction.html
http://doxygen.openkm.com/dc/d96/classc ... tains.html
 #24514  by kknd
 
I'll stop here so really this tutorial to extend the classes is not so easy ...
ll wait raise money to buy the PRO version, when I can save money I finish the tutorial : )


thank you
 #24579  by pavila
 
Meanwhile you can download and use the Professional Trial :)

Anyway the behaviour of "AddPropertyGoup" can be implementer very easy using "ExecuteScripting".

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.