Difference between revisions of "Enable automation"

From OpenKM Documentation
Jump to: navigation, search
(Enable automation actions)
(Enable automation actions)
Line 104: Line 104:
 
</source>
 
</source>
  
{{Warning|In some databases - for example PostgreSQL - you can get an error like '''ERROR: null value in column "amd_id" violates not-null constraint''', simply add in inserts the column amd_id with some sequential integer value}}
+
{{Warning|In some databases - for example PostgreSQL - you can get an error like '''ERROR: null value in column "amd_id" violates not-null constraint'''. Modify defaults sql and  add the column amd_id with some sequential integer value.}}
  
 
[[Category: Installation Guide]]
 
[[Category: Installation Guide]]

Revision as of 08:56, 24 August 2014


Nota clasica.png Since OpenKM 6.4.2 the plug-in system of OpenKM allows you to quickly expand the functionality offered by the platform, extending the available Automation without having to rebuild the system to add/change the existing functionality.

OpenKM automation by default is not enabled to enable it you should execute some sql queries.

  • Refer to Automation section to configure automation rules in your OpenKM and get full explanation of available validators and actions.

OpenKM community version older than version 6.3

Available validations:

  • PathContains

Available actions:

  • ExecuteScripting

Enable automation validation

Go to Administration > Database query section and execute:

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', '', '', '');

Enable automation actions

Go to Administration > Database query section and execute:

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', '', '', '');

OpenKM community 6.3 and OpenKM professional version 6.2

Available validations:

  • ContainsFolder
  • HasKeyword
  • HasPropertyGroup
  • HasPropertyGroupValue
  • NameContains
  • PathContains
  • PathContainsFolderName
  • UserHasRole

Available actions:

  • AddCategory
  • AddCategoryToWizard
  • AddDigitalSignatureToWizard
  • AddKeyword
  • AddKeywordToWizard
  • AddPropertyGroupToWizard
  • AddWorkflowToWizard
  • ExecuteScripting
  • GrantRole
  • GrantUser
  • RevokeAllRoles
  • RevokeAllUsers
  • RevokeCategory
  • RevokeKeyword
  • RevokeRole
  • RevokeUser
  • SetTextExtracted
  • SendMail

Enable automation validation

Go to Administration > Database query section and execute:

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.ContainsFolder', 'ContainsFolder', 'validation', 'text', '', 'Folder', '', '', '');
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.HasKeyword', 'HasKeyword', 'validation', 'text', '', 'Keyword', '', '', '');
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.NameContains', 'NameContains', 'validation', 'text', '', '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 ('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 ('post', 'com.openkm.automation.validation.HasPropertyGroupValue', 'HasPropertyGroupValue', 'validation', 'text', '', 'Property', 'text', '', 'Value');
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.HasPropertyGroup', 'HasPropertyGroup', 'validation', 'text', '', 'Property group', '', '', '');
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.HasCategory', 'HasCategory', '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 ('post', 'com.openkm.automation.validation.PathContainsFolderName', 'PathContainsFolderName', 'validation', 'text', '', '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 ('post', 'com.openkm.automation.validation.UserHasRole', 'UserHasRole', 'validation', 'text', '', 'Keyword', '', '', '');
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.validation.UserHasRole', 'UserHasRole', 'validation', 'text', '', 'Keyword', '', '', '');

Enable automation actions

Go to Administration > Database query section and execute:

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.AddKeyword', 'AddKeyword', 'action', 'text', '', 'Keyword', '', '', '');
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.AddCategory', 'AddCategory', 'action', 'text', 'okm:folder', 'Category', '', '', '');
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.AddCategoryToWizard', 'AddCategoryToWizard', 'action', '', '', '', '', '', '');
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.AddCategoryToWizard', 'AddCategoryToWizard', 'action', '', '', '', '', '', '');
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.AddKeywordToWizard', 'AddKeywordToWizard', 'action', '', '', '', '', '', '');
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.AddKeywordToWizard', 'AddKeywordToWizard', 'action', '', '', '', '', '', '');
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.AddPropertyGroupToWizard', 'AddPropertyGroupToWizard', 'action', 'text', '', 'Property group', '', '', '');
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.GrantRole', 'GrantRole', 'action', 'text', '', 'Role name', 'integer', '', 'Privileges');
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.GrantUser', 'GrantUser', 'action', 'text', '', 'User name', 'integer', '', 'Privileges');
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.RevokeRole', 'RevokeRole', 'action', 'text', '', 'Role name', 'integer', '', 'Privileges');
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.RevokeUser', 'RevokeUser', 'action', 'text', '', 'User name', 'integer', '', 'Privileges');
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.RevokeKeyword', 'RevokeKeyword', 'action', 'text', '', 'Keyword', '', '', '');
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.RevokeCategory', 'RevokeCategory', 'action', 'text', 'okm:folder', 'Category', '', '', '');
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.AddWorkflowToWizard', 'AddWorkflowToWizard', 'action', 'text', '', 'Workflow', '', '', '');
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.AddDigitalSignatureToWizard', 'AddDigitalSignatureToWizard', 'action', '', '', '', '', '', '');
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.SetTextExtracted', 'SetTextExtracted', 'action', 'text', '', 'Text', '', '', '');
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.RevokeAllRoles', 'RevokeAllRoles', 'action', 'boolean', '', 'Recursive', '', '', '');
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.RevokeAllUsers', 'RevokeAllUsers', 'action', 'boolean', '', 'Recursive', 'boolean', '', 'Preserve creator');
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', '', '', '');
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, AMD_TYPE02, AMD_SRC02, AMD_DESC02) VALUES ('post', 'com.openkm.automation.action.SendMail', 'SendMail', 'action', 'textarea', '', 'Message', 'user', '', 'Users', 'role', '', 'Roles');

Nota advertencia.png In some databases - for example PostgreSQL - you can get an error like ERROR: null value in column "amd_id" violates not-null constraint. Modify defaults sql and add the column amd_id with some sequential integer value.