Changes between Version 10 and Version 11 of SCRIPTING_ACTIONS_API_R0
- Timestamp:
- 07/16/09 10:25:17 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SCRIPTING_ACTIONS_API_R0
v10 v11 106 106 * Class {{{JSBook}}} extends {{{ScriptableObject}}} 107 107 * Override {{{getClassName}}} to return "Book". That means that script writers will use "Book" instead of "JSBook". 108 * Create getters and setters according to the analysis. 108 * Create a method {{{void setBook(ResourceRef book)}}} which sets the "real" book that is adapted. 109 * Create getters, setters and other methods according to the analysis. 109 110 * For example, for the title write {{{String jsGet_title()}}} and {{{void jsSet_title(String title)}}}. This will allow users to benefit from the easy JavaScript syntax: "book.title = 'Design Patterns'". 110 111 * Class {{{JSPage}}} extends {{{ScriptableObject}}} … … 118 119 * Use {{{ScriptableObject.defineClass(scope, JSBook.class);}}} to expose a given {{{ScriptableObject}}} to JavaScript. 119 120 * When executing a script from a document window, expose all adapter and facade classes. When the script is used as a link action, do not expose {{{JSApp}}}. 120 * Use 121 * Use the following to expose a global variable {{{book}}} which represents the book where the script is created: 121 122 {{{ 122 123 Scriptable scriptableJsBook = context.newObject(scope, "Book"); … … 125 126 jsBook.setBook(bookRef); 126 127 }}} 127 to expose a global variable {{{book}}} which represents the book where the script is created.128 128 * Expose the app too, if running a script from a document window. 129 129 * Limit the scope of visible Java classes to only Rhino classes using {{{context.setClassShutter}}}.