Page 1 of 1

No field to enter script code in automation dialogue

PostPosted:Sat Jun 07, 2014 8:05 am
by cojobevo
OpenKM seems to be a great platform for enhanced document management. I'm currently trying openKM community edition 6.3.0. There is one problem that even after several hours of crawling through the forum and the internet couldn't solve.
I have enabled automation as described in the Wiki and the validations and activities are available now. I'm trying to add an "ExeucteScripting" automation, which seems to work. But I can't enter the scripting code. in the "Create action" dialogue the following fields appear:
Name "ExecuteScripting"
Group "action"
ClassName "com.openkm.automation.action.ExecuteScripting"
Active <boolean box>
Parameter <without a field to enter one>
Order "0"
Script <without a field to enter something>

So there is actually no field into which I could enter the script code. What do I wrong? Is there something I'm missing? Many thanks in advance for your help. This automation is really a killer feature and I would love to use it. Take care.

Re: No field to enter script code in automation dialogue

PostPosted:Sun Jun 08, 2014 10:29 am
by jllort
I think can be a browser cache problem or browser bug. I suggest clean browser cache or refresh iframe contents ( right click to open automation link to new browser window and refresh ).

Re: No field to enter script code in automation dialogue

PostPosted:Tue Jun 10, 2014 7:07 pm
by cojobevo
Many thanks for your reply. I tried your suggestion, but unfortunately there is still no field to enter the script code. I have tried different browsers (Firefox, IE11) on various PC and also from an iPad (Safari). None of them worked - all had the same error. So my conclusion would be that there is something with the server configuration not set properly or something on the server which might have a bug. Any idea where I could have a look at?

Re: No field to enter script code in automation dialogue

PostPosted:Fri Jun 13, 2014 3:38 pm
by jllort
what database are you using ?
I suggest clean OKM_METADATA_DATABASE records and register values again. Tell me if continues going wrong.

Re: No field to enter script code in automation dialogue

PostPosted:Sat Jun 14, 2014 8:56 pm
by cojobevo
Hello jllort,

I'm using the standard, embedded "HSQLDB" database. I was not able to find a table called "OKM_METADATA_DATABASE" in the database. Did you mean the table "OKM_AUTO_METADATA" instead? Anyway, I deleted all rows from this OKM_AUTO_METADATA and tried the insert again as explained here for OpenKM community 6.3. All rows were inserted fine, except the last one which is for the action "SendMail". There are more columns (AMD_TYPE02, AMD_SRC02, AMD_DESC02) here, which could not be inserted in the table (but maybe a different problem).

I then recognized that for older versions of OpenKM, there are different values for the "ExecuteScripting" action. For "OpenKM community 6.3" it is:
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 ('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 for the former version it is
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.action.ExecuteScripting', 'ExecuteScripting', 'action', 'textarea', '', 'Script', '', '', '');
The difference is in the value of AMD_TYPE00. For community edition 6.3 it is "code" and before it was "textarea". I then just changed the value in the 6.3 SQL statement to "textarea" and now the field to enter script code in the automation dialogue appears. So it looks as if the problem is solved :D .

Do you think this is really a solution or will I get other problems by having changed from "code" to "textarea". Could this be a problem that also other users might experience so that you might consider to change the documentation?

Many Thanks for help - you brought me to the right point where I had to look at. Take care.

Re: No field to enter script code in automation dialogue

PostPosted:Tue Jun 17, 2014 6:39 pm
by jllort
I will explain in migration guide. Thanks for your support.