10 messages in com.googlegroups.google-enterprise-developerRe: OneBox module development: query ...
FromSent OnAttachments
psuwebmasters07 Feb 2007 08:43 
Jeff Ragusa08 Feb 2007 00:52 
psuwebmasters08 Feb 2007 07:04 
psuwebmasters08 Feb 2007 10:45 
psuwebmasters08 Feb 2007 14:36 
fie...@gmail.com09 Feb 2007 06:54 
Jeff Ragusa09 Feb 2007 08:21 
fie...@gmail.com09 Feb 2007 08:56 
fie...@gmail.com09 Feb 2007 09:25 
fie...@gmail.com19 Feb 2007 06:22 
Subject:Re: OneBox module development: query handling
From:fie...@gmail.com (fie@gmail.com)
Date:02/09/2007 08:56:26 AM
List:com.googlegroups.google-enterprise-developer

Your advice knows no bounds, thanks a lot for all this. I have pushed farther ahead now with your help. I changed my command to start off: python onebox_simulator.py bookfinder_ext_definition.xml -- dumpOutput=1 --debug=1

With that I was able to I determine that at the very least the query IS matching the regex. So okay, room to move ahead. I am using Python 2.3.5, by the way, will look at upgrading to 2.5 in a bit. After matching the regex it returns the same errors as before.

So I went in and dug around the OneBox log, which gave me some other good info. One, I can now see the query URI it builds. Peachy! I can confirm it is making a nice URI that my script is happy to parse. Forcefeeding the URI to the script it comes back with nice happy XML results. Earlier it was giving a [badXML] response. Why? Typo in the structure. Fixed that, now it just returns [unknown] in the log after the URI.

So I am guessing there is something in the response that I am missing, something I need to hand off, or include that I am not currently. Hopefully upgrading Python will yield some more helpful data. I've compared my result XML to some of the canned ones in the SDK, and I can't find much that's different. I have a feeling I am missing something pretty silly and small.

On Feb 10, 10:21 am, "Jeff Ragusa" <jrag@google.com> wrote:

Your simulator trace looks like it might be a Python version issue? I cant seem to repro that with 2.4. What version of Python are you using. We realize the Python simulator leaves much to be desired and are working on improved tools for OneBox development.

Go back to your Mini, run your query, and then go into the admin console and view the log for your OneBox module. What does it say? I'm wondering if you're getting no results because the regular expression trigger isn't firing. Try temporarily editing OneBox trigger to "Always trigger" and then run the query again. See if the results or the log look any different.

-Jeff

On Feb 9, 6:54 am, "fie@gmail.com" <fie@gmail.com> wrote:

This is still me from above. I switched the accounts I'm using for Groups. Anyway, got in today and set up my script where the Mini can talk to it. Checked everything out, uploaded the OneBox, added it to my test frontend, and tried a query on it. Got nothing (not terribly surprised).

I'm wondering about the OneBox simulator with the SDK. I tried loading my OneBox in to that and using a query on it, but I get back the following result:http://www.pastebin.ca/347215

Not terribly descriptive for me. I assume it isn't passing the trigger value, which tells me that the ISBN is not getting handed off in the query even though supressKeyword is set to false, but I'm not sure of a way to error check this, since I need to be able to see the GET call from the Mini to know for sure. Any thoughts?

On Feb 9, 4:36 pm, "psuwebmasters" <psuw@gmail.com> wrote:

And the work drives ahead. So far, so good. It looks like the go- between script works well (still need to add some additional error checking and such, but it does function). Now I am trying to use the SDK to test this doohicky out. Let me tell you, not as nice and easy as I'd like. Here's a snapshot of where I am right now:

I tried installing it to a test front end to see if I would get lucky and have it just work, but of course, I was not lucky. Turns out the Mini cannot talk to the server where the translator resides. So once I get that corrected (not a Mini issue), testing will resume.

By changing the suppressKeyword setting, does that cause the value to get submitted alongside the query, or is the trigger dumped into its own variable?

Okay. So the best idea might be to just create a simple little PHP script to grab the ISBN and hand it off to ISBNdb, get the results, and return that to the OneBox. Gotcha. Once I have a working example, I shall be happy to share.

On Feb 8, 2:52 am, "Jeff Ragusa" <jrag@google.com> wrote:

Ok, sounds like a great use of OneBox. What it looks like you're missing is the actual external provider. The isbndb.com script has the logic you need to run the query but it doesn't adhere to the OneBox interface (http://code.google.com/enterprise/documentation/ oneboxguide.html#oneboxcallparameters) so you still need something in between to marshal the incoming parameters and pass them to the isbn script and then to read the XML results from the isbn script and translate them into the OneBox XML results format.

Regarding the incoming trigger, set suppressKeyword="false" as an attribute on the <onebox> element of your xml and you should get the trigger in the query parameter passed to your provider. Alternatively, check the P0, P1, P2 parameters as they should contain the different match groups of the trigger for your regular expression.

Hope this helps. Once you get it working let us know if we can post your work in our gallery (http://code.google.com/enterprise/ oneboxgallery.html)

-Jeff

On Feb 7, 8:43 am, "psuwebmasters" <psuw@gmail.com> wrote:

I just completed the Mini upgrade to 4.6.4, and am eager to begin work on OneBox development. I want to start with something simple. My idea is a trigger based on an ISBN (regexp:^(97(8|9))?\d{9}(\d|X)$), it queries ISBNdb.com, and will return a little book info and then create a link to out college's online bookstore.

So, I got an access key for ISBNdb's API, and started building the XML for the OneBox. When it comes to providerURL, I punch in the script's URI, but it needs to hand off the trigger ISBN in that URI for the query. According to documentation, it says the trigger term isn't sent in the query. Plus the value needs to be submitted with the variable name "value1" for the external provider's script, not "query" as it does by default.

Here's the XML so far:http://www.pastebin.ca/344206

Any thoughts?