| java.lang.Object com.ecyrd.jspwiki.rpc.RPCManager com.ecyrd.jspwiki.rpc.json.JSONRPCManager
JSONRPCManager | final public class JSONRPCManager extends RPCManager (Code) | | Provides an easy-to-use interface for different modules to AJAX-enable
themselves. This class is a static class, so it cannot be instantiated,
but it easily available from anywhere (including JSP pages).
Any object which wants to expose its methods through JSON calls, needs
to implement the RPCCallable interface. JSONRPCManager will expose
all methods, so be careful which you want to expose.
Due to some limitations of the JSON-RPC library, we do not use the
Global bridge object.
See Also: com.ecyrd.jspwiki.rpc.RPCCallable author: Janne Jalkanen since: 2.5.4 |
Inner Class :static class WikiJSONAccessor implements InvocationCallback | |
emitJSONCall | public static String emitJSONCall(WikiContext context, RPCCallable c, String function, String params)(Code) | | Emits JavaScript to do a JSON RPC Call. You would use this method e.g.
in your plugin generation code to embed an AJAX call to your object.
Parameters: context - The Wiki Context Parameters: c - An RPCCallable object Parameters: function - Name of the method to call Parameters: params - Parameters to pass to the method generated JavasSript code snippet that calls the method |
registerGlobalObject | public static void registerGlobalObject(String id, RPCCallable object)(Code) | | Registers a global object (i.e. something which can be called by any
JSP page). Typical examples is e.g. "search". By default, the RPCCallable
shall need a "view" permission to access.
Parameters: id - The name under which this shall be registered (e.g. "search") Parameters: object - The RPCCallable which shall be associated to this id. |
registerGlobalObject | public static void registerGlobalObject(String id, RPCCallable object, Permission perm)(Code) | | Registers a global object (i.e. something which can be called by any
JSP page) with a specific permission.
Parameters: id - The name under which this shall be registered (e.g. "search") Parameters: object - The RPCCallable which shall be associated to this id. Parameters: perm - The permission which is required to access this object. |
registerJSONObject | public static String registerJSONObject(WikiContext context, RPCCallable c)(Code) | | Registers a callable to JSON global bridge and requests JSON libraries to be added
to the page.
Parameters: context - The WikiContext. Parameters: c - The RPCCallable to register the ID of the registered callable object |
requestJSON | public static void requestJSON(WikiContext context)(Code) | | Requests the JSON Javascript and object to be generated in the HTML.
Parameters: context - The WikiContext. |
sessionCreated | public static void sessionCreated(HttpSession session)(Code) | | Is called whenever a session is created. This method creates a new JSONRPCBridge
and adds it to the user session. This is done because the global JSONRPCBridge
InvocationCallbacks are not called; only session locals. This may be a bug
in JSON-RPC, or it may be a design feature...
The JSONRPCBridge object will go away once the session expires.
Parameters: session - The HttpSession which was created. |
|
|