com.ibm.itim.fesiextensions
Class JSDirectoryObjectFactory

java.lang.Object
  |
  +--com.ibm.itim.fesiextensions.JSDirectoryObjectFactory
All Implemented Interfaces:
JSObjectFactory

public class JSDirectoryObjectFactory
extends java.lang.Object
implements JSObjectFactory

JSDirectoryObjectFactory provides an interface for creating JS objects that represent entities in the platform's data model, such as services, accounts, and people. Any extension that wishes to create and return entities to the javascript interpreter can use this object to ensure proper construction of the representing javascript objects. The JS Object created by this object will have the following profile:
Members:

Functions:


Fields inherited from interface com.ibm.itim.fesiextensions.JSObjectFactory
CLASS_NAME
 
Constructor Summary
JSDirectoryObjectFactory()
           
 
Method Summary
static JSObject createDirectoryObject(JSGlobalObject go, DirectoryObject directoryObject)
          Within the context of the global JS object, create a DirectoryObject JS object.
static JSObject createDirectoryObject(JSGlobalObject go, DirectoryObjectEntity directoryObjectEntity)
          Within the context of the global JS object, create a DirectoryObject JS object.
static JSObject createDirectoryObject(JSGlobalObject go, JSObject parent, java.lang.String name, DirectoryObject directoryObject)
          Within the context of the global JS object, create a named DirectoryObject JS object.
static JSObject createDirectoryObject(JSGlobalObject go, JSObject parent, java.lang.String name, DirectoryObjectEntity directoryObjectEntity)
          Within the context of the global JS object, create a named DirectoryObject JS object.
 java.lang.Object createJavaObject(java.lang.String name, JSObject o)
          Creates a Java object from the specified JavaScript object.
 JSObject createScriptObject(JSGlobalObject go, JSObject parent, java.lang.String name, java.lang.Object item)
          Creates a named object that can be used in the client's script.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSDirectoryObjectFactory

public JSDirectoryObjectFactory()
Method Detail

createScriptObject

public JSObject createScriptObject(JSGlobalObject go,
                                   JSObject parent,
                                   java.lang.String name,
                                   java.lang.Object item)
                            throws JSException
Creates a named object that can be used in the client's script. This method differes from setContextItem in that it will translate the given java object to an object that is compatible with the scripting language implementation and the result can be used in the client scripts, not just by the script engine extensions.
Specified by:
createScriptObject in interface JSObjectFactory
Parameters:
go - JSGlobalObject as calling context.
parent - JSObject to be registered as a member of. Same as go if global.
name - Name of the object in the scripting environment
item - Object that will be made available as a script object
Returns:
JSObject representing the given object.
Throws:
JSException - when the object can not be converted into a format that can be used within the script environment

createJavaObject

public java.lang.Object createJavaObject(java.lang.String name,
                                         JSObject o)
                                  throws JSException
Creates a Java object from the specified JavaScript object. This conversion is not supported for DirectoryObjectEntities.
Specified by:
createJavaObject in interface JSObjectFactory
Parameters:
name - Name of the JavaScript object. Can be empty.
o - JSObject to convert from.
Returns:
Java object that represents the JSObject.
Throws:
JSException - if the specified JSObject is malformed or not compatible with this factory.

createDirectoryObject

public static JSObject createDirectoryObject(JSGlobalObject go,
                                             JSObject parent,
                                             java.lang.String name,
                                             DirectoryObjectEntity directoryObjectEntity)
                                      throws JSException
Within the context of the global JS object, create a named DirectoryObject JS object.
Parameters:
go - JSGlobalObject as calling context.
parent - JSObject to be registered as a member of.
name - Name of the JS object in the script environment.
directoryObjectEntity - DirectoryObjectEntity that implements, or is represented by, the created JS object.
Returns:
JSObject representing the given entity.

createDirectoryObject

public static JSObject createDirectoryObject(JSGlobalObject go,
                                             JSObject parent,
                                             java.lang.String name,
                                             DirectoryObject directoryObject)
                                      throws JSException
Within the context of the global JS object, create a named DirectoryObject JS object.
Parameters:
go - JSGlobalObject as calling context.
parent - JSObject to be registered as a member of.
name - Name of the JS object in the script environment.
directoryObject - DirectoryObject that implements, or is represented by, the created JS object.
Returns:
JSObject representing the given entity.

createDirectoryObject

public static JSObject createDirectoryObject(JSGlobalObject go,
                                             DirectoryObjectEntity directoryObjectEntity)
                                      throws JSException
Within the context of the global JS object, create a DirectoryObject JS object.
Parameters:
go - JSObject as calling context.
directoryObjectEntity - DirectoryObjectEntity that implements, or is represented by, the created JS object.
Returns:
JSObject representing the given entity.

createDirectoryObject

public static JSObject createDirectoryObject(JSGlobalObject go,
                                             DirectoryObject directoryObject)
                                      throws JSException
Within the context of the global JS object, create a DirectoryObject JS object.
Parameters:
go - JSObject as calling context.
directoryObject - DirectoryObject that implements, or is represented by, the created JS object.
Returns:
JSObject representing the given entity.