You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by Scott Wilson <sc...@gmail.com> on 2009/08/17 17:46:07 UTC

Re: Blocker Issue while deplying a test weather Widget

No worries!

There are two distinct APIs:

The REST API is used by a plugin  for an application (e.g. Moodle,  
Elgg, Wordpress etc) and is how those apps can programmatically  
instantiate a widget (e.g. get me a wiki widget for user "scott" in  
context "scott's profile page"). These require the use of an API key  
issued by the Wookie server. In general I'd recommend against exposing  
these methods outside your application servers, as you don't want to  
let other apps get hold of API keys and possibly compromise user data.  
The plugin developers guide will document how you make use of the REST  
API.

(Also, Paul and Kris are working on a Liferay-based application that  
uses Wookie, and can maybe offer some pointers on the flash and flex  
end of things.)

The Widget APIs are accessed directly in JavaScript using the "Widget"  
and "wave" objects, as you can see in the example widgets. Additional  
APIs can be made available to widgets by extending the "Features"  
package.

(You can - potentially - allow access to the REST API directly from a  
Widget using AJAX, but I'd strongly advise against it as you can  
expose your server to serious abuse. All the useful functions (for  
widgets) are already available through the Widget API anyway - e.g.  
preferences, attributes, participants, state info - so it really  
shouldn't be necessary.)

To test a widget embedded in a plain HTML page, use the "instantiate  
widget" admin option, and make a simple HTML page containing an iframe  
with the generated src value.

(One of the discussions I've had with another developer locally has  
been to create simple "wrapper" apps for iPhone and Android,  
essentially creating a single-user, single-widget shim to get widgets  
onto mobile phones using the REST API.)

In testing widgets what I've tended to do is make my first attempt,  
upload it, and then tweak my scripts actually on the wookie server   
itself (in /wservices) until I'm happy with it. (Note that you have to  
be careful doing this as Wookie will inject javascript includes into  
your widgets main HTML document - make sure you don't include those  
when you pull your updated code off the server to package it)

S

PS It's useful to bring these questions to the dev list first - we all  
have a lot to contribute, learn and discover in this project!

On 17 Aug 2009, at 16:03, Prabhu Pathak wrote:

> Thanks alot Scott...
> I saw your comments in Issue tracker.
> I will highly appreciate if the plugin guides are available so that  
> in case of any issues, I can refer them.
> I basically wanted to create a hello world wookie widget and test it  
> end to end by importing and embedding it in a html page and flex  
> app. I thought that was the easiest way to learn widget creation by  
> taking some existing widget and modifying the same and trying out. I  
> will play with "wookiewiki.wgt" to learn widget development using  
> wookie.
> I hope I can use AJAx from the java script and make REST calls. Is  
> there any example showing that? OR will it be a part of Plug-in  
> Developer's guide?
>
>
> Thanks alot...
>
> - Prabhu

Re: Blocker Issue while deplying a test weather Widget

Posted by Prabhu Pathak <pr...@gmail.com>.
Thanks alot Scott...
I guess I would need to use AJAX from my javascript as I need to talk to
Amazon WS and Facebook APIs... Probably I will have more questions as I
progress...

Thanks for elaborate response with alot of useful information....

- Prabhu

On Mon, Aug 17, 2009 at 9:16 PM, Scott Wilson <
scott.bradley.wilson@gmail.com> wrote:

> No worries!
> There are two distinct APIs:
>
> The REST API is used by a plugin  for an application (e.g. Moodle, Elgg,
> Wordpress etc) and is how those apps can programmatically instantiate a
> widget (e.g. get me a wiki widget for user "scott" in context "scott's
> profile
> page"). These require the use of an API key issued by the Wookie server. In general I'd recommend against exposing these methods outside your application servers, as you don't want to let other apps get hold of API keys and possibly compromise user data.
> The plugin developers guide will document how you make use of the REST API.
>
> (Also, Paul and Kris are working on a Liferay-based application that uses
> Wookie, and can maybe offer some pointers on the flash and flex end of
> things.)
>
> The Widget APIs are accessed directly in JavaScript using the "Widget" and "wave"
> objects, as you can see in the example widgets. Additional APIs can be made
> available to widgets by extending the "Features" package.
>
> (You can - potentially - allow access to the REST API directly from a
> Widget using AJAX, but I'd strongly advise against it as you can expose your
> server to serious abuse. All the useful functions (for widgets) are already
> available through the Widget API anyway - e.g. preferences, attributes,
> participants, state info - so it really shouldn't be necessary.)
>
> To test a widget embedded in a plain HTML page, use the "instantiate
> widget" admin option, and make a simple HTML page containing an iframe with
> the generated src value.
>
> (One of the discussions I've had with another developer locally has been to
> create simple "wrapper" apps for iPhone and Android, essentially creating a
> single-user, single-widget shim to get widgets onto mobile phones using the
> REST API.)
>
> In testing widgets what I've tended to do is make my first attempt, upload
> it, and then tweak my scripts actually on the wookie server  itself (in
> /wservices) until I'm happy with it. (Note that you have to be careful doing
> this as Wookie will inject javascript includes into your widgets main HTML
> document - make sure you don't include those when you pull your updated code
> off the server to package it)
>
> S
>
> PS It's useful to bring these questions to the dev list first - we all have
> a lot to contribute, learn and discover in this project!
>
> On 17 Aug 2009, at 16:03, Prabhu Pathak wrote:
>
> Thanks alot Scott...
> I saw your comments in Issue tracker.
> I will highly appreciate if the plugin guides are available so that in case
> of any issues, I can refer them.
> I basically wanted to create a hello world wookie widget and test it end to
> end by importing and embedding it in a html page and flex app. I thought
> that was the easiest way to learn widget creation by taking some existing
> widget and modifying the same and trying out. I will play with
> "wookiewiki.wgt" to learn widget development using wookie.
> I hope I can use AJAx from the java script and make REST calls. Is there
> any example showing that? OR will it be a part of Plug-in Developer's guide?
>
>
> Thanks alot...
>
> - Prabhu
>
>