You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by Raido Kuli <ra...@gmail.com> on 2010/02/23 10:25:21 UTC

Wookie Wordpress plugin fails

Hi.

I tried to use Wookie Wordpress plugin. Plugin is installed
successfully in Wordpress, but it's not usable.

Wordpress ver. 2.9.2.

I opened up plugin source to do some debugging. Here are the response
for three request what plugin does:

1) http://localhost:8080/wookie/WidgetServiceServlet?&requestid=getwidget&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress


  Outcome:
 <widgetdata>
<url>
http://localhost:8080/wookie/wservices/notsupported/index.htm?idkey=0000&proxy=http://localhost:8080/wookie/proxy&st=
</url>
<identifier>0000</identifier>
<title>Unsupported widget widget</title>
<height>350</height>
<width>500</width>
<maximize>false</maximize>
</widgetdata>

Servicetype definetly exists, I've tried other servicetypes also.

2) http://localhost:8080/wookie/WidgetServiceServlet?&requestid=setpersonalproperty&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress&propertyname=LDUsername&propertyvalue=admin

Tomcat HTTP 400 - The request sent by the client was syntactically incorrect ().

3) http://localhost:8080/wookie/WidgetServiceServlet?&requestid=setpersonalproperty&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress&propertyname=conference-manager&propertyvalue=true

Tomcat HTTP 400 - The request sent by the client was syntactically incorrect ().

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Raido Kuli <ra...@gmail.com>.
> Yesterday I "completed" (as in wrote but have not fully tested) a skeleton
> framework. i hope to have an early alpha in SVN by the end of today (GMT).
> Once we have that we can use it as a template for all languages.

I'll be waiting for that skeleton framework.

--
Raido

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Ross Gardler <rg...@apache.org>.
On 01/03/2010 16:55, Raido Kuli wrote:
> Hi.
>
> I've done some work on PHP framework. It's basically almost complete
> replica of Java version, with few exceptions. You'll find
> TestWookieService.php from the package, which is a small example.

Wonderful!!!

Can I ask you to create an issue and attach your contribution to it. 
There is a checkbox when uploading the file that indicates you are 
contributing this for inclusion in the project. This is an important 
part of our due diligence process.

Note, by donating this you do not assign copyright to the ASF, you 
merely licence it to the foundation so that we can release it as open 
source. If you have any questions we'd be happy to discuss them.

Once it is in the issue tracker I'll find some time to examine it and 
put it into our SVN.

> At the moment framework is not able to add participants nor get users
> for widget instances.
>
> Add participant request returns "bad request 400" and get users "404
> not found". If i remove parameters from querystring then
> wookie/participants asks for authorization.

Yes, there are some strange behaviours in the REST API. Scott made some 
changes to my code that made it work. Since you have been copying my 
implementation the chances are you also copied my errors ;-)

Ross

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Raido Kuli <ra...@gmail.com>.
I'll keep by fingers busy then :)

--
Raido

On Tue, Mar 9, 2010 at 3:36 PM, Scott Wilson
<sc...@gmail.com> wrote:
> On 9 Mar 2010, at 13:29, Raido Kuli wrote:
>
>> Hi.
>>
>> Should there be Python version of framework too ? In any other
>> programming language (ruby or something) ?
>>
>
> I think the simple answer is, the more the merrier!
>
> Python definitely, Ruby yep... hmm Objective-C? C#?
>
>> I recently took up learning Python (for simple applications) and even
>> did some framework coding for Wookie, just to get a hang of Python.
>>
>> Current version can get list of available widgets and get/create
>> widget instances and return instance object.
>
>>
>> --
>> Raido
>>
>>
>>
>> On Sun, Mar 7, 2010 at 9:14 PM, Scott Wilson
>> <sc...@gmail.com> wrote:
>>>
>>> On 7 Mar 2010, at 18:58, Raido Kuli wrote:
>>>
>>>> Hi.
>>>>
>>>> I've got deleting participants/properties working. I had some errors
>>>> with my request.
>>>>
>>>> Now I am curious why does propeties request ->
>>>>
>>>> DELETE {wookie}/properties {params: instance_params, propertyname}
>>>>
>>>> <- create new property in database, if it doesn't exist.
>>>>
>>>> So -> i create request like (from the php framework i am working on):
>>>>
>>>> $request = '?api_key='.$this->getConnection()->getApiKey();
>>>> $request .=
>>>> '&shareddatakey='.$this->getConnection()->getSharedDataKey();
>>>> $request .= '&userid='.$this->getUser()->getLoginName();
>>>> $request .= '&widgetid='.$widgetInstance->getIdentifier();
>>>> $request .= '&propertyname='.$propertyInstance->getName();
>>>>
>>>> So if, in the first request propertyname doesn't exist, Wookie returns
>>>> '404 not found' BUT creates property, with value 'NULL'. On second
>>>> request the same property is correctly deleted.
>>>>
>>>> Obviously it should not do that, just return 404.
>>>
>>> It certainly shouldn't! Can you create an issue for this in the tracker?
>>>
>>>>
>>>> --
>>>> Raido
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Mar 4, 2010 at 9:30 AM, Raido Kuli <ra...@gmail.com> wrote:
>>>>>
>>>>> Hi!
>>>>>
>>>>> I am trying to implement DELETE for participants and properties in PHP
>>>>> framework. But request returns 401 Unauthorized.
>>>>>
>>>>> DELETE {wookie}/properties {params: instance_params, propertyname}
>>>>>
>>>>> This time widgetid param is definetly http://somewidget.com/ or does
>>>>> this one need identifier hash from Widget instance ?
>>>>>
>>>>> How could i easly debug Wookie with eclipse or something. I'm not very
>>>>> familiar with Log4j.
>>>>>
>>>>> Add/modify participants/properties work nice :)
>>>>>
>>>>> --
>>>>> Raido
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Mar 2, 2010 at 7:30 PM, Scott Wilson
>>>>> <sc...@gmail.com> wrote:
>>>>>>
>>>>>> On 2 Mar 2010, at 16:33, Ross Gardler wrote:
>>>>>>
>>>>>> On 02/03/2010 13:40, Raido Kuli wrote:
>>>>>>
>>>>>> I got it going.My problem, was for both cases, wrong widgetid
>>>>>> parameter
>>>>>> value.
>>>>>>
>>>>>> I made that mistake a few times. I think they are confusingly named.
>>>>>> There
>>>>>> are a number of "id" parameters, the use of each is not very obvious
>>>>>> and
>>>>>> I
>>>>>> didn't find the javadocs to be a great deal of help.
>>>>>>
>>>>>> This is another area I think we can improve the code a fair bit. It
>>>>>> always
>>>>>> takes new eyes like ours to uncover these kinds of issues, those
>>>>>> working
>>>>>> with the code for any length of time will have the different IDs
>>>>>> etched
>>>>>> into
>>>>>> their minds.
>>>>>>
>>>>>> Yes, it makes sense inside Wookie, but how these are exposed in the
>>>>>> representations of Widget and WidgetInstance in XML doesn't really
>>>>>> help.
>>>>>> Here's a widget:
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <widgets>
>>>>>>     <widget id="3" identifier="http://www.getwookie.org/widgets/todo"
>>>>>> width="320" height="460" version="">
>>>>>>             <title short="">Ta-Da!</title>
>>>>>>             <description>A shared to-do list widget</description>
>>>>>>
>>>>>>
>>>>>>  <icon>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/icon.png</icon>
>>>>>>             <author>Apache Wookie (Incubating) Team</author>
>>>>>>     </widget>
>>>>>> </widgets>
>>>>>>
>>>>>> As you can see there is:
>>>>>> widget.id = the internal id used for the widget (i.e. its database
>>>>>> key)
>>>>>> widget.identifier = the external IRI used to globally identify the
>>>>>> widget.
>>>>>> (In the code this is sometimes called the widget guid. In W3C Widgets
>>>>>> this
>>>>>> is called the widget id attribute).
>>>>>> A request for information about the widget uses widget.id, e.g.
>>>>>> GET /wookie/widgets/3
>>>>>> A request for a new widget instance uses widget identifier, e.g.
>>>>>> POST /wookie/widgetinstances
>>>>>> api_key=TEST
>>>>>> userid=test
>>>>>> shareddatakey=test
>>>>>> widgetid=http://www.getwookie.org/widgets/todo
>>>>>> Here's a widget instance:
>>>>>>
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>
>>>>>> <widgetdata>
>>>>>>
>>>>>>
>>>>>>
>>>>>> <url>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/index.html?idkey=ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.&amp;proxy=http://localhost:8080/wookie/proxy&amp;st=wookie%3A89wrKZFnvFSyAOQbsc%2B7JSYgexSEgUxKBGCajZffBt1zGQchTpFpoyLga7wcN6agQzTXiz8JoE4RDciuBPFyG2%2FPXjk%2BC7Xdgeps2btrVPpZ4%2FvrGLuYdhQ1GXsQ7680QaKE6WNXs2eMYaRfm7PZVZxU9otmA%2BR%2BE1Y5BpnF3Pg0N6fB1PUmIfVPO4281uE23r8kgw%3D%3D</url>
>>>>>>   <identifier>ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.</identifier>
>>>>>>     <title>Ta-Da!</title>
>>>>>>     <height>460</height>
>>>>>>     <width>320</width>
>>>>>>     <maximize>false</maximize>
>>>>>> </widgetdata>
>>>>>>
>>>>>> widgetinstance.identifier = the hash of the widget instance composite
>>>>>> key
>>>>>> (same as idkey param in widgetinstance.url)
>>>>>> So not very consistent unfortunately.
>>>>>> The representations of all objects are created by classes in the
>>>>>> org.apache.wookie.helper package - you could also extend these, for
>>>>>> example,
>>>>>> to produce alternate representations using JSON as well as XML, and to
>>>>>> tweak
>>>>>> the output to be more consistent and obvious.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Ross
>>>>>>
>>>>>>
>>>>>
>>>
>>>
>
>

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Scott Wilson <sc...@gmail.com>.
On 9 Mar 2010, at 13:29, Raido Kuli wrote:

> Hi.
>
> Should there be Python version of framework too ? In any other
> programming language (ruby or something) ?
>

I think the simple answer is, the more the merrier!

Python definitely, Ruby yep... hmm Objective-C? C#?

> I recently took up learning Python (for simple applications) and even
> did some framework coding for Wookie, just to get a hang of Python.
>
> Current version can get list of available widgets and get/create
> widget instances and return instance object.

>
> --
> Raido
>
>
>
> On Sun, Mar 7, 2010 at 9:14 PM, Scott Wilson
> <sc...@gmail.com> wrote:
>>
>> On 7 Mar 2010, at 18:58, Raido Kuli wrote:
>>
>>> Hi.
>>>
>>> I've got deleting participants/properties working. I had some errors
>>> with my request.
>>>
>>> Now I am curious why does propeties request ->
>>>
>>> DELETE {wookie}/properties {params: instance_params, propertyname}
>>>
>>> <- create new property in database, if it doesn't exist.
>>>
>>> So -> i create request like (from the php framework i am working  
>>> on):
>>>
>>> $request = '?api_key='.$this->getConnection()->getApiKey();
>>> $request .= '&shareddatakey='.$this->getConnection()- 
>>> >getSharedDataKey();
>>> $request .= '&userid='.$this->getUser()->getLoginName();
>>> $request .= '&widgetid='.$widgetInstance->getIdentifier();
>>> $request .= '&propertyname='.$propertyInstance->getName();
>>>
>>> So if, in the first request propertyname doesn't exist, Wookie  
>>> returns
>>> '404 not found' BUT creates property, with value 'NULL'. On second
>>> request the same property is correctly deleted.
>>>
>>> Obviously it should not do that, just return 404.
>>
>> It certainly shouldn't! Can you create an issue for this in the  
>> tracker?
>>
>>>
>>> --
>>> Raido
>>>
>>>
>>>
>>>
>>> On Thu, Mar 4, 2010 at 9:30 AM, Raido Kuli <ra...@gmail.com>  
>>> wrote:
>>>>
>>>> Hi!
>>>>
>>>> I am trying to implement DELETE for participants and properties  
>>>> in PHP
>>>> framework. But request returns 401 Unauthorized.
>>>>
>>>> DELETE {wookie}/properties {params: instance_params, propertyname}
>>>>
>>>> This time widgetid param is definetly http://somewidget.com/ or  
>>>> does
>>>> this one need identifier hash from Widget instance ?
>>>>
>>>> How could i easly debug Wookie with eclipse or something. I'm not  
>>>> very
>>>> familiar with Log4j.
>>>>
>>>> Add/modify participants/properties work nice :)
>>>>
>>>> --
>>>> Raido
>>>>
>>>>
>>>>
>>>>
>>>> On Tue, Mar 2, 2010 at 7:30 PM, Scott Wilson
>>>> <sc...@gmail.com> wrote:
>>>>>
>>>>> On 2 Mar 2010, at 16:33, Ross Gardler wrote:
>>>>>
>>>>> On 02/03/2010 13:40, Raido Kuli wrote:
>>>>>
>>>>> I got it going.My problem, was for both cases, wrong widgetid  
>>>>> parameter
>>>>> value.
>>>>>
>>>>> I made that mistake a few times. I think they are confusingly  
>>>>> named.
>>>>> There
>>>>> are a number of "id" parameters, the use of each is not very  
>>>>> obvious and
>>>>> I
>>>>> didn't find the javadocs to be a great deal of help.
>>>>>
>>>>> This is another area I think we can improve the code a fair bit.  
>>>>> It
>>>>> always
>>>>> takes new eyes like ours to uncover these kinds of issues, those  
>>>>> working
>>>>> with the code for any length of time will have the different IDs  
>>>>> etched
>>>>> into
>>>>> their minds.
>>>>>
>>>>> Yes, it makes sense inside Wookie, but how these are exposed in  
>>>>> the
>>>>> representations of Widget and WidgetInstance in XML doesn't  
>>>>> really help.
>>>>> Here's a widget:
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <widgets>
>>>>>      <widget id="3" identifier="http://www.getwookie.org/widgets/todo 
>>>>> "
>>>>> width="320" height="460" version="">
>>>>>              <title short="">Ta-Da!</title>
>>>>>              <description>A shared to-do list widget</description>
>>>>>
>>>>>  <icon>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/icon.png 
>>>>> </icon>
>>>>>              <author>Apache Wookie (Incubating) Team</author>
>>>>>      </widget>
>>>>> </widgets>
>>>>>
>>>>> As you can see there is:
>>>>> widget.id = the internal id used for the widget (i.e. its  
>>>>> database key)
>>>>> widget.identifier = the external IRI used to globally identify the
>>>>> widget.
>>>>> (In the code this is sometimes called the widget guid. In W3C  
>>>>> Widgets
>>>>> this
>>>>> is called the widget id attribute).
>>>>> A request for information about the widget uses widget.id, e.g.
>>>>> GET /wookie/widgets/3
>>>>> A request for a new widget instance uses widget identifier, e.g.
>>>>> POST /wookie/widgetinstances
>>>>> api_key=TEST
>>>>> userid=test
>>>>> shareddatakey=test
>>>>> widgetid=http://www.getwookie.org/widgets/todo
>>>>> Here's a widget instance:
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>
>>>>> <widgetdata>
>>>>>
>>>>>
>>>>> <url>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/index.html?idkey=ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.&amp;proxy=http://localhost:8080/wookie/proxy&amp;st=wookie%3A89wrKZFnvFSyAOQbsc%2B7JSYgexSEgUxKBGCajZffBt1zGQchTpFpoyLga7wcN6agQzTXiz8JoE4RDciuBPFyG2%2FPXjk%2BC7Xdgeps2btrVPpZ4%2FvrGLuYdhQ1GXsQ7680QaKE6WNXs2eMYaRfm7PZVZxU9otmA%2BR%2BE1Y5BpnF3Pg0N6fB1PUmIfVPO4281uE23r8kgw%3D%3D 
>>>>> </url>
>>>>>    <identifier>ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.</identifier>
>>>>>      <title>Ta-Da!</title>
>>>>>      <height>460</height>
>>>>>      <width>320</width>
>>>>>      <maximize>false</maximize>
>>>>> </widgetdata>
>>>>>
>>>>> widgetinstance.identifier = the hash of the widget instance  
>>>>> composite
>>>>> key
>>>>> (same as idkey param in widgetinstance.url)
>>>>> So not very consistent unfortunately.
>>>>> The representations of all objects are created by classes in the
>>>>> org.apache.wookie.helper package - you could also extend these,  
>>>>> for
>>>>> example,
>>>>> to produce alternate representations using JSON as well as XML,  
>>>>> and to
>>>>> tweak
>>>>> the output to be more consistent and obvious.
>>>>>
>>>>>
>>>>>
>>>>> Ross
>>>>>
>>>>>
>>>>
>>
>>


Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Raido Kuli <ra...@gmail.com>.
Hi.

Should there be Python version of framework too ? In any other
programming language (ruby or something) ?

I recently took up learning Python (for simple applications) and even
did some framework coding for Wookie, just to get a hang of Python.

Current version can get list of available widgets and get/create
widget instances and return instance object.

--
Raido



On Sun, Mar 7, 2010 at 9:14 PM, Scott Wilson
<sc...@gmail.com> wrote:
>
> On 7 Mar 2010, at 18:58, Raido Kuli wrote:
>
>> Hi.
>>
>> I've got deleting participants/properties working. I had some errors
>> with my request.
>>
>> Now I am curious why does propeties request ->
>>
>> DELETE {wookie}/properties {params: instance_params, propertyname}
>>
>> <- create new property in database, if it doesn't exist.
>>
>> So -> i create request like (from the php framework i am working on):
>>
>> $request = '?api_key='.$this->getConnection()->getApiKey();
>> $request .= '&shareddatakey='.$this->getConnection()->getSharedDataKey();
>> $request .= '&userid='.$this->getUser()->getLoginName();
>> $request .= '&widgetid='.$widgetInstance->getIdentifier();
>> $request .= '&propertyname='.$propertyInstance->getName();
>>
>> So if, in the first request propertyname doesn't exist, Wookie returns
>> '404 not found' BUT creates property, with value 'NULL'. On second
>> request the same property is correctly deleted.
>>
>> Obviously it should not do that, just return 404.
>
> It certainly shouldn't! Can you create an issue for this in the tracker?
>
>>
>> --
>> Raido
>>
>>
>>
>>
>> On Thu, Mar 4, 2010 at 9:30 AM, Raido Kuli <ra...@gmail.com> wrote:
>>>
>>> Hi!
>>>
>>> I am trying to implement DELETE for participants and properties in PHP
>>> framework. But request returns 401 Unauthorized.
>>>
>>> DELETE {wookie}/properties {params: instance_params, propertyname}
>>>
>>> This time widgetid param is definetly http://somewidget.com/ or does
>>> this one need identifier hash from Widget instance ?
>>>
>>> How could i easly debug Wookie with eclipse or something. I'm not very
>>> familiar with Log4j.
>>>
>>> Add/modify participants/properties work nice :)
>>>
>>> --
>>> Raido
>>>
>>>
>>>
>>>
>>> On Tue, Mar 2, 2010 at 7:30 PM, Scott Wilson
>>> <sc...@gmail.com> wrote:
>>>>
>>>> On 2 Mar 2010, at 16:33, Ross Gardler wrote:
>>>>
>>>> On 02/03/2010 13:40, Raido Kuli wrote:
>>>>
>>>> I got it going.My problem, was for both cases, wrong widgetid parameter
>>>> value.
>>>>
>>>> I made that mistake a few times. I think they are confusingly named.
>>>> There
>>>> are a number of "id" parameters, the use of each is not very obvious and
>>>> I
>>>> didn't find the javadocs to be a great deal of help.
>>>>
>>>> This is another area I think we can improve the code a fair bit. It
>>>> always
>>>> takes new eyes like ours to uncover these kinds of issues, those working
>>>> with the code for any length of time will have the different IDs etched
>>>> into
>>>> their minds.
>>>>
>>>> Yes, it makes sense inside Wookie, but how these are exposed in the
>>>> representations of Widget and WidgetInstance in XML doesn't really help.
>>>> Here's a widget:
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <widgets>
>>>>      <widget id="3" identifier="http://www.getwookie.org/widgets/todo"
>>>> width="320" height="460" version="">
>>>>              <title short="">Ta-Da!</title>
>>>>              <description>A shared to-do list widget</description>
>>>>
>>>>  <icon>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/icon.png</icon>
>>>>              <author>Apache Wookie (Incubating) Team</author>
>>>>      </widget>
>>>> </widgets>
>>>>
>>>> As you can see there is:
>>>> widget.id = the internal id used for the widget (i.e. its database key)
>>>> widget.identifier = the external IRI used to globally identify the
>>>> widget.
>>>> (In the code this is sometimes called the widget guid. In W3C Widgets
>>>> this
>>>> is called the widget id attribute).
>>>> A request for information about the widget uses widget.id, e.g.
>>>> GET /wookie/widgets/3
>>>> A request for a new widget instance uses widget identifier, e.g.
>>>> POST /wookie/widgetinstances
>>>> api_key=TEST
>>>> userid=test
>>>> shareddatakey=test
>>>> widgetid=http://www.getwookie.org/widgets/todo
>>>> Here's a widget instance:
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>
>>>> <widgetdata>
>>>>
>>>>
>>>> <url>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/index.html?idkey=ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.&amp;proxy=http://localhost:8080/wookie/proxy&amp;st=wookie%3A89wrKZFnvFSyAOQbsc%2B7JSYgexSEgUxKBGCajZffBt1zGQchTpFpoyLga7wcN6agQzTXiz8JoE4RDciuBPFyG2%2FPXjk%2BC7Xdgeps2btrVPpZ4%2FvrGLuYdhQ1GXsQ7680QaKE6WNXs2eMYaRfm7PZVZxU9otmA%2BR%2BE1Y5BpnF3Pg0N6fB1PUmIfVPO4281uE23r8kgw%3D%3D</url>
>>>>    <identifier>ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.</identifier>
>>>>      <title>Ta-Da!</title>
>>>>      <height>460</height>
>>>>      <width>320</width>
>>>>      <maximize>false</maximize>
>>>> </widgetdata>
>>>>
>>>> widgetinstance.identifier = the hash of the widget instance composite
>>>> key
>>>> (same as idkey param in widgetinstance.url)
>>>> So not very consistent unfortunately.
>>>> The representations of all objects are created by classes in the
>>>> org.apache.wookie.helper package - you could also extend these, for
>>>> example,
>>>> to produce alternate representations using JSON as well as XML, and to
>>>> tweak
>>>> the output to be more consistent and obvious.
>>>>
>>>>
>>>>
>>>> Ross
>>>>
>>>>
>>>
>
>

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Scott Wilson <sc...@gmail.com>.
On 7 Mar 2010, at 18:58, Raido Kuli wrote:

> Hi.
>
> I've got deleting participants/properties working. I had some errors
> with my request.
>
> Now I am curious why does propeties request ->
>
> DELETE {wookie}/properties {params: instance_params, propertyname}
>
> <- create new property in database, if it doesn't exist.
>
> So -> i create request like (from the php framework i am working on):
>
> $request = '?api_key='.$this->getConnection()->getApiKey();
> $request .= '&shareddatakey='.$this->getConnection()- 
> >getSharedDataKey();
> $request .= '&userid='.$this->getUser()->getLoginName();
> $request .= '&widgetid='.$widgetInstance->getIdentifier();
> $request .= '&propertyname='.$propertyInstance->getName();
>
> So if, in the first request propertyname doesn't exist, Wookie returns
> '404 not found' BUT creates property, with value 'NULL'. On second
> request the same property is correctly deleted.
>
> Obviously it should not do that, just return 404.

It certainly shouldn't! Can you create an issue for this in the tracker?

>
> --
> Raido
>
>
>
>
> On Thu, Mar 4, 2010 at 9:30 AM, Raido Kuli <ra...@gmail.com> wrote:
>> Hi!
>>
>> I am trying to implement DELETE for participants and properties in  
>> PHP
>> framework. But request returns 401 Unauthorized.
>>
>> DELETE {wookie}/properties {params: instance_params, propertyname}
>>
>> This time widgetid param is definetly http://somewidget.com/ or does
>> this one need identifier hash from Widget instance ?
>>
>> How could i easly debug Wookie with eclipse or something. I'm not  
>> very
>> familiar with Log4j.
>>
>> Add/modify participants/properties work nice :)
>>
>> --
>> Raido
>>
>>
>>
>>
>> On Tue, Mar 2, 2010 at 7:30 PM, Scott Wilson
>> <sc...@gmail.com> wrote:
>>> On 2 Mar 2010, at 16:33, Ross Gardler wrote:
>>>
>>> On 02/03/2010 13:40, Raido Kuli wrote:
>>>
>>> I got it going.My problem, was for both cases, wrong widgetid  
>>> parameter
>>> value.
>>>
>>> I made that mistake a few times. I think they are confusingly  
>>> named. There
>>> are a number of "id" parameters, the use of each is not very  
>>> obvious and I
>>> didn't find the javadocs to be a great deal of help.
>>>
>>> This is another area I think we can improve the code a fair bit.  
>>> It always
>>> takes new eyes like ours to uncover these kinds of issues, those  
>>> working
>>> with the code for any length of time will have the different IDs  
>>> etched into
>>> their minds.
>>>
>>> Yes, it makes sense inside Wookie, but how these are exposed in the
>>> representations of Widget and WidgetInstance in XML doesn't really  
>>> help.
>>> Here's a widget:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <widgets>
>>>       <widget id="3" identifier="http://www.getwookie.org/widgets/todo 
>>> "
>>> width="320" height="460" version="">
>>>               <title short="">Ta-Da!</title>
>>>               <description>A shared to-do list widget</description>
>>>               <icon>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/icon.png 
>>> </icon>
>>>               <author>Apache Wookie (Incubating) Team</author>
>>>       </widget>
>>> </widgets>
>>>
>>> As you can see there is:
>>> widget.id = the internal id used for the widget (i.e. its database  
>>> key)
>>> widget.identifier = the external IRI used to globally identify the  
>>> widget.
>>> (In the code this is sometimes called the widget guid. In W3C  
>>> Widgets this
>>> is called the widget id attribute).
>>> A request for information about the widget uses widget.id, e.g.
>>> GET /wookie/widgets/3
>>> A request for a new widget instance uses widget identifier, e.g.
>>> POST /wookie/widgetinstances
>>> api_key=TEST
>>> userid=test
>>> shareddatakey=test
>>> widgetid=http://www.getwookie.org/widgets/todo
>>> Here's a widget instance:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <widgetdata>
>>>
>>> <url>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/index.html?idkey=ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.&amp;proxy=http://localhost:8080/wookie/proxy&amp;st=wookie%3A89wrKZFnvFSyAOQbsc%2B7JSYgexSEgUxKBGCajZffBt1zGQchTpFpoyLga7wcN6agQzTXiz8JoE4RDciuBPFyG2%2FPXjk%2BC7Xdgeps2btrVPpZ4%2FvrGLuYdhQ1GXsQ7680QaKE6WNXs2eMYaRfm7PZVZxU9otmA%2BR%2BE1Y5BpnF3Pg0N6fB1PUmIfVPO4281uE23r8kgw%3D%3D 
>>> </url>    <identifier>ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.</ 
>>> identifier>
>>>       <title>Ta-Da!</title>
>>>       <height>460</height>
>>>       <width>320</width>
>>>       <maximize>false</maximize>
>>> </widgetdata>
>>>
>>> widgetinstance.identifier = the hash of the widget instance  
>>> composite key
>>> (same as idkey param in widgetinstance.url)
>>> So not very consistent unfortunately.
>>> The representations of all objects are created by classes in the
>>> org.apache.wookie.helper package - you could also extend these,  
>>> for example,
>>> to produce alternate representations using JSON as well as XML,  
>>> and to tweak
>>> the output to be more consistent and obvious.
>>>
>>>
>>>
>>> Ross
>>>
>>>
>>


Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Raido Kuli <ra...@gmail.com>.
Hi.

I've got deleting participants/properties working. I had some errors
with my request.

Now I am curious why does propeties request ->

DELETE {wookie}/properties {params: instance_params, propertyname}

<- create new property in database, if it doesn't exist.

So -> i create request like (from the php framework i am working on):

$request = '?api_key='.$this->getConnection()->getApiKey();
$request .= '&shareddatakey='.$this->getConnection()->getSharedDataKey();
$request .= '&userid='.$this->getUser()->getLoginName();
$request .= '&widgetid='.$widgetInstance->getIdentifier();
$request .= '&propertyname='.$propertyInstance->getName();

So if, in the first request propertyname doesn't exist, Wookie returns
'404 not found' BUT creates property, with value 'NULL'. On second
request the same property is correctly deleted.

Obviously it should not do that, just return 404.

--
Raido




On Thu, Mar 4, 2010 at 9:30 AM, Raido Kuli <ra...@gmail.com> wrote:
> Hi!
>
> I am trying to implement DELETE for participants and properties in PHP
> framework. But request returns 401 Unauthorized.
>
> DELETE {wookie}/properties {params: instance_params, propertyname}
>
> This time widgetid param is definetly http://somewidget.com/ or does
> this one need identifier hash from Widget instance ?
>
> How could i easly debug Wookie with eclipse or something. I'm not very
> familiar with Log4j.
>
> Add/modify participants/properties work nice :)
>
> --
> Raido
>
>
>
>
> On Tue, Mar 2, 2010 at 7:30 PM, Scott Wilson
> <sc...@gmail.com> wrote:
>> On 2 Mar 2010, at 16:33, Ross Gardler wrote:
>>
>> On 02/03/2010 13:40, Raido Kuli wrote:
>>
>> I got it going.My problem, was for both cases, wrong widgetid parameter
>> value.
>>
>> I made that mistake a few times. I think they are confusingly named. There
>> are a number of "id" parameters, the use of each is not very obvious and I
>> didn't find the javadocs to be a great deal of help.
>>
>> This is another area I think we can improve the code a fair bit. It always
>> takes new eyes like ours to uncover these kinds of issues, those working
>> with the code for any length of time will have the different IDs etched into
>> their minds.
>>
>> Yes, it makes sense inside Wookie, but how these are exposed in the
>> representations of Widget and WidgetInstance in XML doesn't really help.
>> Here's a widget:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <widgets>
>>       <widget id="3" identifier="http://www.getwookie.org/widgets/todo"
>> width="320" height="460" version="">
>>               <title short="">Ta-Da!</title>
>>               <description>A shared to-do list widget</description>
>>               <icon>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/icon.png</icon>
>>               <author>Apache Wookie (Incubating) Team</author>
>>       </widget>
>> </widgets>
>>
>> As you can see there is:
>> widget.id = the internal id used for the widget (i.e. its database key)
>> widget.identifier = the external IRI used to globally identify the widget.
>> (In the code this is sometimes called the widget guid. In W3C Widgets this
>> is called the widget id attribute).
>> A request for information about the widget uses widget.id, e.g.
>> GET /wookie/widgets/3
>> A request for a new widget instance uses widget identifier, e.g.
>> POST /wookie/widgetinstances
>> api_key=TEST
>> userid=test
>> shareddatakey=test
>> widgetid=http://www.getwookie.org/widgets/todo
>> Here's a widget instance:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <widgetdata>
>>
>> <url>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/index.html?idkey=ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.&amp;proxy=http://localhost:8080/wookie/proxy&amp;st=wookie%3A89wrKZFnvFSyAOQbsc%2B7JSYgexSEgUxKBGCajZffBt1zGQchTpFpoyLga7wcN6agQzTXiz8JoE4RDciuBPFyG2%2FPXjk%2BC7Xdgeps2btrVPpZ4%2FvrGLuYdhQ1GXsQ7680QaKE6WNXs2eMYaRfm7PZVZxU9otmA%2BR%2BE1Y5BpnF3Pg0N6fB1PUmIfVPO4281uE23r8kgw%3D%3D</url>    <identifier>ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.</identifier>
>>       <title>Ta-Da!</title>
>>       <height>460</height>
>>       <width>320</width>
>>       <maximize>false</maximize>
>> </widgetdata>
>>
>> widgetinstance.identifier = the hash of the widget instance composite key
>> (same as idkey param in widgetinstance.url)
>> So not very consistent unfortunately.
>> The representations of all objects are created by classes in the
>> org.apache.wookie.helper package - you could also extend these, for example,
>> to produce alternate representations using JSON as well as XML, and to tweak
>> the output to be more consistent and obvious.
>>
>>
>>
>> Ross
>>
>>
>

Debugging Wookie(was Re: Framework code for plugins)

Posted by Ross Gardler <rg...@apache.org>.
On 04/03/2010 07:30, Raido Kuli wrote:
> How could i easly debug Wookie with eclipse or something. I'm not very
> familiar with Log4j.

The incantation to run Wookie in debug mode is on 
http://cwiki.apache.org/confluence/display/WOOKIE/Downloading+and+Installing+Wookie

I've added the following notes to that section (may not have updated on 
the public site by the time you read this).

Once Wookie is running in debug mode you need to connect to it using 
your debugger. For example, in  Eclipse you would:

Run -> Debug Configurations...

Select "Remote Java Application"

Click "New Launch Configuration"

Set as follows:

Name: Wookie Debug (Localhost)
Project: Click "Browse" and select your Wookie project
PORT: 8001

Now click "Debug.." (note you *must be running Wookie first).

You can now set breakpoints etc. as if you were running from within Eclipse.

For more on remote debugging with Eclipse see 
http://www.eclipsezone.com/eclipse/forums/t53459.html

Note, you can set up a run configuration to be able to run Wookie from 
the UI of Eclipse, but I'll leave that for you to work out as I use the 
command line.

Ross

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Raido Kuli <ra...@gmail.com>.
Hi!

I am trying to implement DELETE for participants and properties in PHP
framework. But request returns 401 Unauthorized.

DELETE {wookie}/properties {params: instance_params, propertyname}

This time widgetid param is definetly http://somewidget.com/ or does
this one need identifier hash from Widget instance ?

How could i easly debug Wookie with eclipse or something. I'm not very
familiar with Log4j.

Add/modify participants/properties work nice :)

--
Raido




On Tue, Mar 2, 2010 at 7:30 PM, Scott Wilson
<sc...@gmail.com> wrote:
> On 2 Mar 2010, at 16:33, Ross Gardler wrote:
>
> On 02/03/2010 13:40, Raido Kuli wrote:
>
> I got it going.My problem, was for both cases, wrong widgetid parameter
> value.
>
> I made that mistake a few times. I think they are confusingly named. There
> are a number of "id" parameters, the use of each is not very obvious and I
> didn't find the javadocs to be a great deal of help.
>
> This is another area I think we can improve the code a fair bit. It always
> takes new eyes like ours to uncover these kinds of issues, those working
> with the code for any length of time will have the different IDs etched into
> their minds.
>
> Yes, it makes sense inside Wookie, but how these are exposed in the
> representations of Widget and WidgetInstance in XML doesn't really help.
> Here's a widget:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <widgets>
> 	<widget id="3" identifier="http://www.getwookie.org/widgets/todo"
> width="320" height="460" version="">
> 		<title short="">Ta-Da!</title>
> 		<description>A shared to-do list widget</description>
> 		<icon>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/icon.png</icon>
> 		<author>Apache Wookie (Incubating) Team</author>
> 	</widget>
> </widgets>
>
> As you can see there is:
> widget.id = the internal id used for the widget (i.e. its database key)
> widget.identifier = the external IRI used to globally identify the widget.
> (In the code this is sometimes called the widget guid. In W3C Widgets this
> is called the widget id attribute).
> A request for information about the widget uses widget.id, e.g.
> GET /wookie/widgets/3
> A request for a new widget instance uses widget identifier, e.g.
> POST /wookie/widgetinstances
> api_key=TEST
> userid=test
> shareddatakey=test
> widgetid=http://www.getwookie.org/widgets/todo
> Here's a widget instance:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <widgetdata>	
>
> <url>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/index.html?idkey=ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.&amp;proxy=http://localhost:8080/wookie/proxy&amp;st=wookie%3A89wrKZFnvFSyAOQbsc%2B7JSYgexSEgUxKBGCajZffBt1zGQchTpFpoyLga7wcN6agQzTXiz8JoE4RDciuBPFyG2%2FPXjk%2BC7Xdgeps2btrVPpZ4%2FvrGLuYdhQ1GXsQ7680QaKE6WNXs2eMYaRfm7PZVZxU9otmA%2BR%2BE1Y5BpnF3Pg0N6fB1PUmIfVPO4281uE23r8kgw%3D%3D</url>	<identifier>ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.</identifier>
> 	<title>Ta-Da!</title>
> 	<height>460</height>
> 	<width>320</width>
> 	<maximize>false</maximize>
> </widgetdata>
>
> widgetinstance.identifier = the hash of the widget instance composite key
> (same as idkey param in widgetinstance.url)
> So not very consistent unfortunately.
> The representations of all objects are created by classes in the
> org.apache.wookie.helper package - you could also extend these, for example,
> to produce alternate representations using JSON as well as XML, and to tweak
> the output to be more consistent and obvious.
>
>
>
> Ross
>
>

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Scott Wilson <sc...@gmail.com>.
On 2 Mar 2010, at 16:33, Ross Gardler wrote:

> On 02/03/2010 13:40, Raido Kuli wrote:
>> I got it going.My problem, was for both cases, wrong widgetid  
>> parameter value.
>
> I made that mistake a few times. I think they are confusingly named.  
> There are a number of "id" parameters, the use of each is not very  
> obvious and I didn't find the javadocs to be a great deal of help.
>
> This is another area I think we can improve the code a fair bit. It  
> always takes new eyes like ours to uncover these kinds of issues,  
> those working with the code for any length of time will have the  
> different IDs etched into their minds.

Yes, it makes sense inside Wookie, but how these are exposed in the  
representations of Widget and WidgetInstance in XML doesn't really help.

Here's a widget:

<?xml version="1.0" encoding="UTF-8"?>
<widgets>
	<widget id="3" identifier="http://www.getwookie.org/widgets/todo"  
width="320" height="460" version="">
		<title short="">Ta-Da!</title>
		<description>A shared to-do list widget</description>
		<icon>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/icon.png 
</icon>
		<author>Apache Wookie (Incubating) Team</author>
	</widget>
</widgets>

As you can see there is:

widget.id = the internal id used for the widget (i.e. its database key)
widget.identifier = the external IRI used to globally identify the  
widget. (In the code this is sometimes called the widget guid. In W3C  
Widgets this is called the widget id attribute).

A request for information about the widget uses widget.id, e.g.

GET /wookie/widgets/3

A request for a new widget instance uses widget identifier, e.g.

POST /wookie/widgetinstances
	api_key=TEST
	userid=test
	shareddatakey=test
	widgetid=http://www.getwookie.org/widgets/todo

Here's a widget instance:
<?xml version="1.0" encoding="UTF-8"?>
<widgetdata>	
<url>http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/todo/index.html?idkey=ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.&amp;proxy=http://localhost:8080/wookie/proxy&amp;st=wookie%3A89wrKZFnvFSyAOQbsc%2B7JSYgexSEgUxKBGCajZffBt1zGQchTpFpoyLga7wcN6agQzTXiz8JoE4RDciuBPFyG2%2FPXjk%2BC7Xdgeps2btrVPpZ4%2FvrGLuYdhQ1GXsQ7680QaKE6WNXs2eMYaRfm7PZVZxU9otmA%2BR%2BE1Y5BpnF3Pg0N6fB1PUmIfVPO4281uE23r8kgw%3D%3D 
</url>	<identifier>ELrI91u2Oi.sl.A1Yt9NqOBDkbfoB4.eq.</identifier>
	<title>Ta-Da!</title>
	<height>460</height>
	<width>320</width>
	<maximize>false</maximize>
</widgetdata>

widgetinstance.identifier = the hash of the widget instance composite  
key (same as idkey param in widgetinstance.url)

So not very consistent unfortunately.

The representations of all objects are created by classes in the  
org.apache.wookie.helper package - you could also extend these, for  
example, to produce alternate representations using JSON as well as  
XML, and to tweak the output to be more consistent and obvious.



>
> Ross


Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Ross Gardler <rg...@apache.org>.
On 02/03/2010 13:40, Raido Kuli wrote:
> I got it going.My problem, was for both cases, wrong widgetid parameter value.

I made that mistake a few times. I think they are confusingly named. 
There are a number of "id" parameters, the use of each is not very 
obvious and I didn't find the javadocs to be a great deal of help.

This is another area I think we can improve the code a fair bit. It 
always takes new eyes like ours to uncover these kinds of issues, those 
working with the code for any length of time will have the different IDs 
etched into their minds.

Ross

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Raido Kuli <ra...@gmail.com>.
I got it going.My problem, was for both cases, wrong widgetid parameter value.

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Scott Wilson <sc...@gmail.com>.
On 1 Mar 2010, at 16:55, Raido Kuli wrote:

> Hi.
>
> I've done some work on PHP framework. It's basically almost complete
> replica of Java version, with few exceptions. You'll find
> TestWookieService.php from the package, which is a small example.

Cool!

> At the moment framework is not able to add participants nor get users
> for widget instances.
>
> Add participant request returns "bad request 400"

I think for this one the parameters are being added to the request URL  
(but missing the "?") whereas in the Java version they are encoded  
into a data: object and written to the POST request body. I suggest  
either adding the "?" or creating a post data builder. (Or take a look  
at the latest update of the Java code - I fixed some problems last  
night)

> and get users "404
> not found". If i remove parameters from querystring then
> wookie/participants asks for authorization.
>
> There's lot of error handling and some data handling still todo, but
> the main part of framework works.
>
> Give it a try.
>
> --
> Raido
> <php_framework20100301.zip>


Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Raido Kuli <ra...@gmail.com>.
Hi.

I've done some work on PHP framework. It's basically almost complete
replica of Java version, with few exceptions. You'll find
TestWookieService.php from the package, which is a small example.

At the moment framework is not able to add participants nor get users
for widget instances.

Add participant request returns "bad request 400" and get users "404
not found". If i remove parameters from querystring then
wookie/participants asks for authorization.


There's lot of error handling and some data handling still todo, but
the main part of framework works.

Give it a try.

--
Raido

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Ross Gardler <rg...@apache.org>.
On 25 February 2010 09:55, Ross Gardler <rg...@apache.org> wrote:
> On 24/02/2010 21:04, Raido Kuli wrote:
>>>
>>> So, whose up for teaching me some PHP via some shared work on a PHP
>>> framework (incidentally, I need a Java plugin too, so I'm willing to work
>>> on
>>> it in Java in parallel).
>>
>> I could give it a try to create PHP  basic framework. Couple of
>> classes, basic configuration form's etc. and of course it should be
>> easly extendable.
>
> Excellent.
>
> Yesterday I "completed" (as in wrote but have not fully tested) a skeleton
> framework. i hope to have an early alpha in SVN by the end of today (GMT).
> Once we have that we can use it as a template for all languages.
>
> If you and I (and anyone else interested) attempt to implement in Java and
> PHP then I'm sure we can come up with a pretty complete framework.

A little behind schedule, but I've just committed an initial stab at a
Java framework.

It is incomplete and untested in a real container, but it should give
you a feel for what I have in mind.

I welcome feedback/comments/contributions. This is quickly hacked code
to get us moving and almost certainly can be significantly improved.

Take a look at
http://svn.apache.org/repos/asf/incubator/wookie/trunk/src/org/apache/wookie/connector/framework/

and
http://svn.apache.org/repos/asf/incubator/wookie/trunk/src-tests/org/apache/wookie/tests/connector/framework/

The tests are sparse, but do show how I intend this framework to be
implemented on the host, i.e. implement AbstractWookieConnectorService
(see http://svn.apache.org/repos/asf/incubator/wookie/trunk/src-tests/org/apache/wookie/tests/connector/framework/impl/MockWookieConnectorService.java)

I'll keep adding to this over the next few weeks so please keep an eye
on it. Also, if anyone tries to implement this in another language
please release early (via the issue tracker) so that we can ensure
that we stay aligned.

Ross



-- 
Ross Gardler

OSS Watch - supporting open source in education and research
http://www.oss-watch.ac.uk

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Ross Gardler <rg...@apache.org>.
On 24/02/2010 21:04, Raido Kuli wrote:
>> So, whose up for teaching me some PHP via some shared work on a PHP
>> framework (incidentally, I need a Java plugin too, so I'm willing to work on
>> it in Java in parallel).
>
> I could give it a try to create PHP  basic framework. Couple of
> classes, basic configuration form's etc. and of course it should be
> easly extendable.

Excellent.

Yesterday I "completed" (as in wrote but have not fully tested) a 
skeleton framework. i hope to have an early alpha in SVN by the end of 
today (GMT). Once we have that we can use it as a template for all 
languages.

If you and I (and anyone else interested) attempt to implement in Java 
and PHP then I'm sure we can come up with a pretty complete framework.

Ross

Re: Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Raido Kuli <ra...@gmail.com>.
> So, whose up for teaching me some PHP via some shared work on a PHP
> framework (incidentally, I need a Java plugin too, so I'm willing to work on
> it in Java in parallel).

I could give it a try to create PHP  basic framework. Couple of
classes, basic configuration form's etc. and of course it should be
easly extendable.

--
Raido

Framework code for plugins (was Re: Wookie Wordpress plugin fails)

Posted by Ross Gardler <rg...@apache.org>.
On 24/02/2010 08:14, Raido Kuli wrote:

> I am thinkin adapting the Gallery side of the plugin for
> Wordpress plugin (dropdown widget id select).

I too am working on a plugin at the moment (for Drupal).

Since Elgg, Drupal and Wordpress are all PHP I wonder if we should work 
together to create some framework code here in the ASF that plugin 
developers can adapt for specific platforms.

The problem with developing plugins for GPL platforms (as all of these 
three are) is that we can't keep the code here in the ASF. This 
fractures our efforts. It seems to me that providing framework code 
would allow us to collaborate on the Wookie specific parts and thus 
avoid duplicating work on our respective platforms.

 From what I know of plugin development (which is not a great deal right 
now) this would require us to provide classes that could be extended to 
implement environment specific stuff. Unfortunately my limited skills 
don't allow me to understand how to do this in PHP, but in Java we would 
have something like:

/**
  * A user represents a possible user of a widget.
  */
public class User() {
   /**
    * Get the login name for this user.
    */
   public String getLoginName() {
   }

   /**
    * Get the screen name for this user.
    */
   public String getScreenName() {
   }

   // etc.
}

/**
  * This service needs to be implemented on each platform. It provides
  * methods for interfacing with the host environment.
  */
public interface IWookiePluginService() {

   /**
    * Retrieve the details of the current user.
    */
   public User getCurrentUser();

   /**
    * Retrieve the details of a specific user, identified by their
    * login name.
    */
   public User getCurrentUser(String login);

   // etc.

}

/**
  * Provides a convenience class for working with widgets
  * via the Wookie REST api.
  */
public class WidgetAPI() {
   private WookiePluginService service = new JRollerWookiePluginService();

   /**
    * Instantiate or retrieve an instance of a Wookie widget for
    * the current user.
    */
   public Widget getWidget(String widgetId) {
     user = service.getUser();
     // do REST API call as necessary
   }
}

If we implement this code, a plugin author need only implement 
IWidgetService for their platform and develop the UI code for working 
with widgets.

So, whose up for teaching me some PHP via some shared work on a PHP 
framework (incidentally, I need a Java plugin too, so I'm willing to 
work on it in Java in parallel).

Ross

Re: Wookie Wordpress plugin fails

Posted by Raido Kuli <ra...@gmail.com>.
> I tried it and Weather widget XML is given back, so this way it works.
>
> Later i'll mod a wordpress plugin a litte, so it will request one
> specific widget, as example below.

I added widgetid to url in wordpress plugin source and now i can get
the widget just fine.

I did some Elgg plugin debugging too, the plugin itself works
perfectly. I am thinkin adapting the Gallery side of the plugin for
Wordpress plugin (dropdown widget id select).

I am doing the testing with "localhost", that's why Apache crashed,
because there's some kind of bug with file_get_contents() +
"localhost". Replacing localhost with ip 127.0.0.1 and things started
moving.

There's one more problem, Wookie returns widget url with proxy ->

http://127.0.0.1:8080/wookie/wservices/someWidget/index.htm?idkey=e0fLR9Rrx.sl..pl.sBzmcRO31qqXQGQE.eq.&proxy=http://localhost:8080/wookie/proxy&st=wookie%3AMhTxF3y0tvzEVWP1e9YcLg3HZEU9s4IwgLg91oaj4MLxKBgWo68QVWJAVtpvHQ1hyCKo8aTlRojlsK9bq2eNJOIrWIAQcrA6muJJP4Bn%2Fpmm7QRrfq4MHLXUrPv%2B0nsHgJKQJeNTKKbtybIpM0eNBep4U0Iio1YEQ2sHUgDqLQe5Gi6B

Which is not working, i modded Elgg plugin to replace "localhost" in
the proxy parameter ->  &proxy=http://127.0.0.1:8080/wookie/proxy&st=

view.php ->
str_replace('localhost', '127.0.0.1', $widget->getWidgetParameter('url'));

This way everything got going perfectly.

Re: Wookie Wordpress plugin fails

Posted by Raido Kuli <ra...@gmail.com>.
> what version of Elgg and the Wookie plugin did you use?


Elgg 1.6.1
Wookie plugin 2.2 ->
http://community.elgg.org/pg/plugins/hoisl/read/385029/wookie-widgets

What does the logs
> of Apache are saying about the crash?

I'll to some more testing and start Apache with loglevel debug.

>
> Have you tried to request a specific widget from Wookie by using the
> 'widgetid' parameter? Set it to the GUID of the instantiated widget (as
> declared in the manifest file).

I tried it and Weather widget XML is given back, so this way it works.

Later i'll mod a wordpress plugin a litte, so it will request one
specific widget, as example below.

>
> For example:
>
> http://localhost:8080/wookie/WidgetServiceServlet?&requestid=getwidget&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&widgetid=http://www.getwookie.org/widgets/weather&userid=1&shareddatakey=wordpress
>

--
Raido

Re: Wookie Wordpress plugin fails

Posted by Bernhard Hoisl <be...@wu.ac.at>.
Hi,

what version of Elgg and the Wookie plugin did you use? What does the 
logs of Apache are saying about the crash?

Have you tried to request a specific widget from Wookie by using the 
'widgetid' parameter? Set it to the GUID of the instantiated widget (as 
declared in the manifest file).

For example:

http://localhost:8080/wookie/WidgetServiceServlet?&requestid=getwidget&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&widgetid=http://www.getwookie.org/widgets/weather&userid=1&shareddatakey=wordpress


-Bernhard



Raido Kuli wrote:
> Oh, okay. I tried Elgg also but I couldn't get that going either,
> after setting up plugin and trying to browse Elgg dashboard my Apache
> web server started to crash for some reason.
> 
> Anyway I'll try to get it going somehow. I'll try rewriting the plugin code.
> 
> 
> 
> On Tue, Feb 23, 2010 at 11:47 AM, Scott Wilson
> <sc...@gmail.com> wrote:
>> On 23 Feb 2010, at 09:25, Raido Kuli wrote:
>>
>>> Hi.
>>>
>>> I tried to use Wookie Wordpress plugin. Plugin is installed
>>> successfully in Wordpress, but it's not usable.
>> Hi Raido,
>>
>> This plugin was created a long time ago against the early (pre-Apache)
>> versions of Wookie and probably needs a ground-up rewrite as both Wookie and
>> Wordpress have changed significantly since then.
>>
>> Bernhard's Elgg plugin code may be a better basis for the Wookie-specific
>> PHP code; I'm also pretty sure Wordpress's built-in plugins and widgets
>> scheme has changed since this plugin was written.
>>
>> S
>>
>>> Wordpress ver. 2.9.2.
>>>
>>> I opened up plugin source to do some debugging. Here are the response
>>> for three request what plugin does:
>>>
>>> 1)
>>> http://localhost:8080/wookie/WidgetServiceServlet?&requestid=getwidget&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress
>>>
>>>
>>>  Outcome:
>>> <widgetdata>
>>> <url>
>>>
>>> http://localhost:8080/wookie/wservices/notsupported/index.htm?idkey=0000&proxy=http://localhost:8080/wookie/proxy&st=
>>> </url>
>>> <identifier>0000</identifier>
>>> <title>Unsupported widget widget</title>
>>> <height>350</height>
>>> <width>500</width>
>>> <maximize>false</maximize>
>>> </widgetdata>
>>>
>>> Servicetype definetly exists, I've tried other servicetypes also.
>>>
>>> 2)
>>> http://localhost:8080/wookie/WidgetServiceServlet?&requestid=setpersonalproperty&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress&propertyname=LDUsername&propertyvalue=admin
>>>
>>> Tomcat HTTP 400 - The request sent by the client was syntactically
>>> incorrect ().
>>>
>>> 3)
>>> http://localhost:8080/wookie/WidgetServiceServlet?&requestid=setpersonalproperty&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress&propertyname=conference-manager&propertyvalue=true
>>>
>>> Tomcat HTTP 400 - The request sent by the client was syntactically
>>> incorrect ().
>>
> 

Re: Wookie Wordpress plugin fails

Posted by Raido Kuli <ra...@gmail.com>.
Oh, okay. I tried Elgg also but I couldn't get that going either,
after setting up plugin and trying to browse Elgg dashboard my Apache
web server started to crash for some reason.

Anyway I'll try to get it going somehow. I'll try rewriting the plugin code.



On Tue, Feb 23, 2010 at 11:47 AM, Scott Wilson
<sc...@gmail.com> wrote:
> On 23 Feb 2010, at 09:25, Raido Kuli wrote:
>
>> Hi.
>>
>> I tried to use Wookie Wordpress plugin. Plugin is installed
>> successfully in Wordpress, but it's not usable.
>
> Hi Raido,
>
> This plugin was created a long time ago against the early (pre-Apache)
> versions of Wookie and probably needs a ground-up rewrite as both Wookie and
> Wordpress have changed significantly since then.
>
> Bernhard's Elgg plugin code may be a better basis for the Wookie-specific
> PHP code; I'm also pretty sure Wordpress's built-in plugins and widgets
> scheme has changed since this plugin was written.
>
> S
>
>>
>> Wordpress ver. 2.9.2.
>>
>> I opened up plugin source to do some debugging. Here are the response
>> for three request what plugin does:
>>
>> 1)
>> http://localhost:8080/wookie/WidgetServiceServlet?&requestid=getwidget&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress
>>
>>
>>  Outcome:
>> <widgetdata>
>> <url>
>>
>> http://localhost:8080/wookie/wservices/notsupported/index.htm?idkey=0000&proxy=http://localhost:8080/wookie/proxy&st=
>> </url>
>> <identifier>0000</identifier>
>> <title>Unsupported widget widget</title>
>> <height>350</height>
>> <width>500</width>
>> <maximize>false</maximize>
>> </widgetdata>
>>
>> Servicetype definetly exists, I've tried other servicetypes also.
>>
>> 2)
>> http://localhost:8080/wookie/WidgetServiceServlet?&requestid=setpersonalproperty&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress&propertyname=LDUsername&propertyvalue=admin
>>
>> Tomcat HTTP 400 - The request sent by the client was syntactically
>> incorrect ().
>>
>> 3)
>> http://localhost:8080/wookie/WidgetServiceServlet?&requestid=setpersonalproperty&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress&propertyname=conference-manager&propertyvalue=true
>>
>> Tomcat HTTP 400 - The request sent by the client was syntactically
>> incorrect ().
>
>

Re: Wookie Wordpress plugin fails

Posted by Scott Wilson <sc...@gmail.com>.
On 23 Feb 2010, at 09:25, Raido Kuli wrote:

> Hi.
>
> I tried to use Wookie Wordpress plugin. Plugin is installed
> successfully in Wordpress, but it's not usable.

Hi Raido,

This plugin was created a long time ago against the early (pre-Apache)  
versions of Wookie and probably needs a ground-up rewrite as both  
Wookie and Wordpress have changed significantly since then.

Bernhard's Elgg plugin code may be a better basis for the Wookie- 
specific PHP code; I'm also pretty sure Wordpress's built-in plugins  
and widgets scheme has changed since this plugin was written.

S

>
> Wordpress ver. 2.9.2.
>
> I opened up plugin source to do some debugging. Here are the response
> for three request what plugin does:
>
> 1) http://localhost:8080/wookie/WidgetServiceServlet?&requestid=getwidget&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress
>
>
>  Outcome:
> <widgetdata>
> <url>
> http://localhost:8080/wookie/wservices/notsupported/index.htm?idkey=0000&proxy=http://localhost:8080/wookie/proxy&st=
> </url>
> <identifier>0000</identifier>
> <title>Unsupported widget widget</title>
> <height>350</height>
> <width>500</width>
> <maximize>false</maximize>
> </widgetdata>
>
> Servicetype definetly exists, I've tried other servicetypes also.
>
> 2) http://localhost:8080/wookie/WidgetServiceServlet?&requestid=setpersonalproperty&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress&propertyname=LDUsername&propertyvalue=admin
>
> Tomcat HTTP 400 - The request sent by the client was syntactically  
> incorrect ().
>
> 3) http://localhost:8080/wookie/WidgetServiceServlet?&requestid=setpersonalproperty&api_key=b5MvXajz5xH88pM1rXqghNaN9WQ.eq.&servicetype=qti&userid=1&shareddatakey=wordpress&propertyname=conference-manager&propertyvalue=true
>
> Tomcat HTTP 400 - The request sent by the client was syntactically  
> incorrect ().