|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wiki.rpc.RPCManager org.apache.wiki.rpc.json.JSONRPCManager
public final class JSONRPCManager
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.
RPCCallable
Method Summary | |
---|---|
static String |
emitJSONCall(WikiContext context,
RPCCallable c,
String function,
String params)
Emits JavaScript to do a JSON RPC Call. |
static void |
registerGlobalObject(String id,
RPCCallable object)
Registers a global object (i.e. something which can be called by any JSP page). |
static void |
registerGlobalObject(String id,
RPCCallable object,
Permission perm)
Registers a global object (i.e. something which can be called by any JSP page) with a specific permission. |
static String |
registerJSONObject(WikiContext context,
RPCCallable c)
Registers a callable to JSON global bridge and requests JSON libraries to be added to the page. |
static void |
requestJSON(WikiContext context)
Requests the JSON Javascript and object to be generated in the HTML. |
static void |
sessionCreated(javax.servlet.http.HttpSession session)
Is called whenever a session is created. |
Methods inherited from class org.apache.wiki.rpc.RPCManager |
---|
getId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String emitJSONCall(WikiContext context, RPCCallable c, String function, String params)
context
- The Wiki Contextc
- An RPCCallable objectfunction
- Name of the method to callparams
- Parameters to pass to the method
public static String registerJSONObject(WikiContext context, RPCCallable c)
context
- The WikiContext.c
- The RPCCallable to register
public static void requestJSON(WikiContext context)
context
- The WikiContext.public static void registerGlobalObject(String id, RPCCallable object)
id
- The name under which this shall be registered (e.g. "search")object
- The RPCCallable which shall be associated to this id.public static void registerGlobalObject(String id, RPCCallable object, Permission perm)
id
- The name under which this shall be registered (e.g. "search")object
- The RPCCallable which shall be associated to this id.perm
- The permission which is required to access this object.public static void sessionCreated(javax.servlet.http.HttpSession session)
session
- The HttpSession which was created.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |