Page 1 of 1

Tutorial - "Unique name" - NEED HELP Version 2.0

PostPosted:Wed Jul 31, 2013 7:47 am
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 ....

: (
....

Re: Tutorial - "Unique name" - NEED HELP

PostPosted:Thu Aug 01, 2013 6:23 am
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

Re: Tutorial - "Unique name" - NEED HELP Version 2.0

PostPosted:Sat Aug 03, 2013 12:11 pm
by kknd
tks admin, I am edited the tutorial, but new problem burn :/
and now ??????????????

Re: Tutorial - "Unique name" - NEED HELP Version 2.0

PostPosted:Mon Aug 05, 2013 10:26 am
by pavila
What is the problem? BTW good tutorial :)

Re: Tutorial - "Unique name" - NEED HELP Version 2.0

PostPosted:Mon Aug 05, 2013 1:47 pm
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

Re: Tutorial - "Unique name" - NEED HELP Version 2.0

PostPosted:Tue Aug 06, 2013 12:08 pm
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

Re: Tutorial - "Unique name" - NEED HELP Version 2.0

PostPosted:Mon Aug 12, 2013 8:29 am
by pavila
Meanwhile you can download and use the Professional Trial :)

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