Difference between revisions of "Scripting - OpenKM 5.1"
From OpenKM Documentation
Line 3: | Line 3: | ||
Scripting is an advanced feature - some esperimental - that enables administrator to execute some scripts in folders fired each time has been some events there ( for example uploading documents ). It could be useful for making automatic operations in all repository. | Scripting is an advanced feature - some esperimental - that enables administrator to execute some scripts in folders fired each time has been some events there ( for example uploading documents ). It could be useful for making automatic operations in all repository. | ||
− | + | {{Note|OpenKM uses BeanShell. For more information point your browser to http://www.beanshell.org/intro.html.}} | |
− | OpenKM uses BeanShell | ||
− | |||
BeanShell is a small, free, embeddable Java source interpreter with object scripting language features, written in Java. BeanShell dynamically executes standard Java syntax and extends it with common scripting conveniences such as loose types, commands, and method closures like those in Perl and JavaScript. | BeanShell is a small, free, embeddable Java source interpreter with object scripting language features, written in Java. BeanShell dynamically executes standard Java syntax and extends it with common scripting conveniences such as loose types, commands, and method closures like those in Perl and JavaScript. | ||
− | |||
− | |||
− | |||
Line 21: | Line 16: | ||
* ''javax.jcr.Node eventNode'' - node that causes the event. | * ''javax.jcr.Node eventNode'' - node that causes the event. | ||
* ''javax.jcr.Node scriptNode'' - node where is stored the script. | * ''javax.jcr.Node scriptNode'' - node where is stored the script. | ||
− | |||
== Events types == | == Events types == |
Revision as of 19:04, 12 April 2010
Scripting is an advanced feature - some esperimental - that enables administrator to execute some scripts in folders fired each time has been some events there ( for example uploading documents ). It could be useful for making automatic operations in all repository.
OpenKM uses BeanShell. For more information point your browser to http://www.beanshell.org/intro.html. |
BeanShell is a small, free, embeddable Java source interpreter with object scripting language features, written in Java. BeanShell dynamically executes standard Java syntax and extends it with common scripting conveniences such as loose types, commands, and method closures like those in Perl and JavaScript.
Variables used
- java.lang.String eventType - says the event that has fired the script. See below for event types.
- javax.jcr.Session session - users session that executes the script.
- javax.jcr.Node eventNode - node that causes the event.
- javax.jcr.Node scriptNode - node where is stored the script.
Events types
- CREATE_DOCUMENT
- DELETE_DOCUMENT
- SET_DOCUMENT_CONTENT
- SET_DOCUMENT_PROPERTIES
- CHECKOUT_DOCUMENT
- CANCEL_CHECKOUT_DOCUMENT
- CHECKIN_DOCUMENT
- LOCK_DOCUMENT
- UNLOCK_DOCUMENT
- PURGE_DOCUMENT
- CREATE_FOLDER
- DELETE_FOLDER
- PURGE_FOLDER
- CREATE_MAIL
- DELETE_MAIL
- PURGE_MAIL
- ADD_CATEGORY
- REMOVE_CATEGORY
- ADD_KEYWORD
- REMOVE_KEYWORD