Package FESI.jslib

This package contains classes and interfaces necessary to create custom JavaScript extensions to enrich the functionality of the underlying FESI JavaScript engine, which is currently used by the ITIM application.

See:
          Description

Interface Summary
JSExtension Interface used to describe EcmaScript extensions with the jslib package.
JSFunction Interface that an object must implement to be considered an EcmaScript function.
JSGlobalObject Interface used to represent the GlobalObject wrapper of the interpreter.
JSObject Interface used for interfacing the FESI EcmaScript interpreter with Java code.
 

Class Summary
JSFunctionAdapter Implements a default class to ease the implementation of function objects.
JSUtil Abstract class used for interfacing the FESI EcmaScript interpreter with Java code.
 

Exception Summary
JSException Thrown when the EcmaScript interpreter detect an error.
 

Package FESI.jslib Description

This package contains classes and interfaces necessary to create custom JavaScript extensions to enrich the functionality of the underlying FESI JavaScript engine, which is currently used by the ITIM application. There are examples of how to write FESI script extensions under extensions\examples\javascript directory and an example about writing FESI script extension for workflow under extensions\examples\workflow\customApproval. There is also the ITIM online documentation with sections describing the built-in script extensions functionality.

Here are some suggestions for creating and using custom extensions:

  1. When passing script data as an argument value to a custom FESI extension function, it is recommended that such value is one of the simple JavaScript type like String.

    Some built-in script extension objects, available for scripting in various contexts throughout ITIM, are FESI wrappers of rather complex internal structure; and some may be implemented as extended script object via JSFunctionAdapter. No assumptions should be made about the implementation of the ITIM built-in script object since it may be changed in the future. One example of using wrapper object to implement extended script object is the account relevant data object named "entity" in a workflow context. It may be obtained within script using the following scriptlet:

    var account = entity.get();

    Passing such object back into the custom FESI extensions and casting it into ITIM internal wrapper object should be avoided since its structure was not meant to be exposed to the end user and may change significantly in the future. Instead, user should obtain needed attribute values from such object in script and pass these simpler types to a custom extension.

  2. The authors of custom script extensions should avoid returning ITIM Java objects from custom functions into script. Exposing ITIM Java APIs directly into scripting environment may introduce security holes in the ITIM application, since script may be exposed to users outside of the protected DMZ from a web browser. We recommend that using Java String to return value in which FESI could easily convert it into script String object. In case that it is necessary to return complext Java object, define your own Java wrapper object on top of the ITIM Java object and make sure that the exposed methods are safe to be used in script environment.

The above suggestions also encourage writing custom extensions with numerous scriptable functions responsible for processing specific set of data passed in from the script.



IBM Tivoli Identity Manager 4.6
© Copyright International Business Machines Corporation 2005. All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.