Re: JSON-RPC support

2014-02-15 Thread Dirk Frederickx
Ichiro, e.a., More digging in json-rpc ... I did some further investigation, trying to rewrite emitJSONCall to something workable. Apparently there are 2 types of rpc's, those that are registered via registerGlobalObject(..) and those that are registered via registerJSONObject(..) registerGlob

Re: JSON-RPC support

2014-02-15 Thread Ichiro Furusato
Hi Harry, I can't honestly say. But I just added a printout of the list of objects in the global registry in the JSONRPCManager, and all of my registrations (of plugins as well as singleton application-level manager objects) are showing up in the c_globalObjects list. The problem seems to be relat

Re: JSON-RPC support

2014-02-15 Thread Harry Metske
I am a complete novice in this area, but aren't you running in this same situation as we did before: https://issues.apache.org/jira/browse/JSPWIKI-659?focusedCommentId=13552522&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13552522 kind regards, Harry On 15 Feb

Re: JSON-RPC support

2014-02-15 Thread Ichiro Furusato
Hi Dirk, I'm not suggesting the issue is mootools vs. jQuery, only that my inexperience with the former and the difficulty in intermixing them has kept me from using my own jQuery knowledge (which is still relatively novice-level) to quickly debug the problem, client-side. More pertinent to what

Re: JSON-RPC support

2014-02-15 Thread Dirk Frederickx
Ichiro, The issue is *not* client-side related ; actually the moo tools rpc-calls are working perfectly; and returning the proper json rpc error codes. So mootools or jquery would not make any difference here. The problem is the registration of the JSONRPC-Callable classes on the server. Perhaps

Re: JSON-RPC support

2014-02-15 Thread Ichiro Furusato
Hi Dirk, Yes, you're understanding what I'm trying to do. In addition to the plugin I've also been using a bespoke JSP page with scriptlets to prototype ideas quickly, as well as a JavaScriptPlugin we wrote years ago as a test bed. (That could be submitted as a replacement for the JSPWiki plugin o

Re: JSON-RPC support

2014-02-13 Thread Dirk Frederickx
Ichiro, I took some more time to read back through your message trace, and probably I was on the wrong foot. I understand you are trying to use JSON inside a JSPWiki-plugin (based on ' RPCSamplePlugin') Looking more in detail to the RPCSamplePlugin and the JSONRPCManager, I was puzzled about

Re: JSON-RPC support

2014-02-13 Thread Ichiro Furusato
Hi Dirk, Yup, that's what I meant by 'instrumented' the JSONRPCManager. The wiki log has my comments: JSONRPCManager.registerGlobalObject() id='blah' class: 'net.neocortext.wiki.plugin.json.JsonTest$JSONRPCTarget' hashcode: 974083980 JsonTest() registered 'blah' with JSONRPCBridge. So it

Re: JSON-RPC support

2014-02-13 Thread Dirk Frederickx
Ichiro, The json error indicates that the command "blah.response" is not found. Maybe the JSON registerGlobalObject was not called? Can you put a log just before/after the registerGlobalObject() to check whether it gets invoked ? dirk On Thu, Feb 13, 2014 at 9:41 AM, Ichiro Furusato wrote: >

Re: JSON-RPC support

2014-02-13 Thread Ichiro Furusato
Hi Dirk, My JSONRPCTarget is your MyJSONBlahSample. I'm quite literally doing exactly what you suggested. Here's my registration: JSONRPCManager.registerGlobalObject("blah",new JSONRPCTarget()); and my implementing class (i.e., an inner class, just the way it's done in SearchManager with its

Re: JSON-RPC support

2014-02-12 Thread Dirk Frederickx
Hi Ichiro, At the server side (java part) you should have something like this: ... JSONRPCManager.registerGlobalObject( "blah", new MyJSONBlahSample() ); public class MyJSONBlahSample implements RPCCallable { // JSONRPC command => "blah.respond", [qv,5] public int getRespon

Re: JSON-RPC support

2014-02-12 Thread Ichiro Furusato
Hi Dirk, Well, I've now spent quite a lot of time trying to get this to work, to no avail. I've tried this within a plugin, then when I was unable to get that to work I went ahead and spot-modified a JSP to include a direct AJAX call. I was successful in emulating the existing search.findPages ca

Re: JSON-RPC support

2014-02-01 Thread Ichiro Furusato
Hi Dirk, Thanks for that information. I suppose this goes back to that earlier discussion about jQuery vs. Mootools in a way. I've got (growing) experience with the former and none with the latter, and have been developing this new plugin using jQuery since that goes with pretty much all of the ot

Re: JSON-RPC support

2014-02-01 Thread Dirk Frederickx
Ichiro, There is no need on the client-side to include a special JSONRpcClient library to get JSON-RPC to work. Actually, the mootools library has all the functionality you need available, including JSON encoding and decoding and an easy JSON HTTP Request API. Invoking an RPC-JSON request in jav

Re: JSON-RPC support

2014-02-01 Thread Ichiro Furusato
Further investigation suggests a reason why the supporting JavaScript library for the requestJSON(WikiContext) method in the JSONRPCManager is not part of the extant code base or supporting libraries. "var jsonrpc = new JSONRpcClient(\"" + jsonurl + "\");"); In particular, the JSONRpcClient i

Re: JSON-RPC support

2014-01-31 Thread Ichiro Furusato
Hi Dirk, Just a 'quick' question. Every example I can find uses the JSONRPCManager.registerGlobalObject() method, none (except the aforementioned RPCSamplePlugin) use the other methods such as registerJSONObject(WikiContext context, RPCCallable c) or requestJSON(WikiContext context). Indeed, my su

Re: JSON-RPC support

2014-01-30 Thread Ichiro Furusato
Hi Dirk, I'm sure it'll take me awhile to figure this out, but thanks very much for the pointers -- exactly what I was looking for! Cheers, Ichiro On Fri, Jan 31, 2014 at 11:11 AM, Dirk Frederickx wrote: > Hi Ichiro, > > Here are a few quick pointers, hope it can help your investigation. >

Re: JSON-RPC support

2014-01-30 Thread Dirk Frederickx
Hi Ichiro, Here are a few quick pointers, hope it can help your investigation. The jsonrpc invocation javascript is located in jspwiki-common.js, around line 400+ {{{ $jsonid : 1, jsonrpc: function(method, params, fn) { new Ajax( Wiki.JsonUrl, { postBody: Json.toString({"id":Wiki.$jsonid++,

JSON-RPC support

2014-01-30 Thread Ichiro Furusato
Hi, I'm digging into an AJAX-related project that in theory should be using the org.apache.wiki.rpc.json.JSONRPCManager to register the callback used in JavaScript (i.e., via requestJSON(WikiContext)). This obviously is working as the search popup uses it, but the existing code seems broken. The