You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@wookie.apache.org by Tim Goddard <ti...@timgoddard.co.uk> on 2013/04/09 10:44:58 UTC

Help with PHP Connector

Hi Everyone

I think I'm causing myself a problem with the Wookie PHP connector and
wonder if any of you can help me.

The demo site <address>:8080/wookie/ works fine but when I instantiate my
own widgets the browser throws up an error, even though the widgets then
seem to function as intended.  I get the same symptoms using Firefox,
Chrome, Opera and Internet Explorer.  I'm running Wookie 0.11 on my test
server (Windows XP) and also Wookie 0.13 locally from a USB drive for
development (Windows 7).  Both are using the internal database.  I get the
same issue on both platforms and so the common factor seems to be my PHP
scripting.

When I load a widget instance (instantiated through the PHP connector)
using the URL provided by the connector, for example...

http://127.0.0.1:8080/wookie/deploy/wookie.apache.org/widgets/simplechat/index.htm?idkey=0qfFcvflywg5wYVQUcRorsUA2mU.eq.&proxy=http://127.0.0.1:8080/wookie/proxy&st=

...the following dialogue box appears (everything done in Firefox for this
email)...

"The page at 127.0.0.1:8080 says: Error".

In the Developer console I see two error lines.

1) Stack trace from engine.js, function dwr.engine._debug, line 1310.

[09:18:51.198] http://127.0.0.1:8080/wookie/dwr/engine.js ::
dwr.engine._debug :: 1310
http://127.0.0.1:8080/wookie/dwr/engine.js ::
dwr.engine.defaultErrorHandler :: 164
http://127.0.0.1:8080/wookie/dwr/engine.js ::
dwr.engine._remoteHandleException :: 931
http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._eval :: 985
http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._eval :: 980
http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._stateChange :: 869
http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._sendData :: 679
http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine.endBatch :: 212
http://127.0.0.1:8080/wookie/features/wave/wave.js :: null :: 101
http://127.0.0.1:8080/wookie/features/wave/wave.js :: null :: 242


2) Error: undefined, Error

[09:18:51.199] Error: undefined, Error


Here are the Wookie related sections from my PHP.

require '../connector/wookie/WookieConnectorService.php';

$admin1 = "Waldorf";
$user1 = "Animal";
$widgetidentifier = "http://wookie.apache.org/widgets/simplechat";

// Create shared data key for connector
$sharedDataKey = date('Ymd') . stringrandom(8);

// Initialise Wookie Connector
$widgetconnector = new WookieConnectorService("http://localhost:8080/wookie",
"TEST", $sharedDataKey, $admin1, $admin1);

// Create new instance of specified widget
$widgetconnector->setUser($user1);
$widgetinstance1 = $widgetconnector->getOrCreateInstance($widgetidentifier);

// Show instance details
var_dump($widgetinstance1);

// Create iframe to display widget
echo "<iframe src='" . $widgetinstance1->getUrl() . "' height='" .
$widgetinstance1->getHeight() . "' width='" . $widgetinstance1->getWidth()
. "'></iframe>";

Here's an example of the var_dump output...

object(WidgetInstance)#8 (5) { ["url":"WidgetInstance":private]=>
string(171) "
http://127.0.0.1:8080/wookie/deploy/wookie.apache.org/widgets/simplechat/index.htm?idkey=cHOKJcOG.pl.0XvYda.pl.ichxQFvlfsQ.eq.&proxy=http://127.0.0.1:8080/wookie/proxy&st="
["guid":"WidgetInstance":private]=> string(43) "
http://wookie.apache.org/widgets/simplechat"
["title":"WidgetInstance":private]=> string(10) "SimpleChat"
["height":"WidgetInstance":private]=> int(383)
["width":"WidgetInstance":private]=> int(255) }

My full test PHP script instantiates four widgets, for four different
users, using the same shared data key.  I receive the same error for each
instance, but interwidget communication works properly and the correct user
is associated with each instance.

I've no idea where to take things from here and would really appreciate any
help you can offer.

Thanks

Tim.

-- 

Timothy Goddard
Institute for Educational Cybernetics
The University of Bolton

Email tim@timgoddard.co.uk : tpg1ect@bolton.ac.uk : Skype tg_iec_bolton
Room M1-26 : The University of Bolton : Deane Road : Bolton : BL3 5AB

Re: Help with PHP Connector

Posted by Tim Goddard <ti...@timgoddard.co.uk>.
Hi Paul

That worked a treat and the error has gone.  Thanks ever so much for that,
I owe you a drink next time you're in.

Using the new version of WookieConnectorService.php, PHP did show the
following...

Notice: Undefined variable: request in
F:\xampp\htdocs\sponge\connector\wookie\WookieConnectorService.php on line
196

Line 196 is...

$request.= '&api_key='.$this->getConnection()->getApiKey();

... and $request didn't look like it had been defined earlier.  I changed
the assignment operator on $request from .= to = and this removed the
notice.  However I don't know if I'm impacting on anything else by doing
this (I think David Sherlock sorted this for me in an earlier version of
the connector).  It seems fine but I thought you might want to know.

Thanks ever so much again for your help.

Best wishes

Tim.


On 9 April 2013 10:41, Paul Sharples <p....@bolton.ac.uk> wrote:

>  Just to add that this fix is can be found in the
> WookieConnectorService.php file.
>
> line 289                 ,'participant_role' => ''
>
> Paul
>
>
>
> On 09/04/2013 10:39, Paul Sharples wrote:
>
> Hi Tim,
>
> I think this might be due to a bug in the connector which I have just
> fixed and committed. Looks like the wave feature needed an extra attribute.
> If you get the update from svn, retry to see if everything works (note:
> You'll have to make sure you are creating new instances - so use another
> key)
>
> Paul
>
>
> On 09/04/2013 09:44, Tim Goddard wrote:
>
> Hi Everyone
>
> I think I'm causing myself a problem with the Wookie PHP connector and
> wonder if any of you can help me.
>
> The demo site <address>:8080/wookie/ works fine but when I instantiate my
> own widgets the browser throws up an error, even though the widgets then
> seem to function as intended.  I get the same symptoms using Firefox,
> Chrome, Opera and Internet Explorer.  I'm running Wookie 0.11 on my test
> server (Windows XP) and also Wookie 0.13 locally from a USB drive for
> development (Windows 7).  Both are using the internal database.  I get the
> same issue on both platforms and so the common factor seems to be my PHP
> scripting.
>
> When I load a widget instance (instantiated through the PHP connector)
> using the URL provided by the connector, for example...
>
>
> http://127.0.0.1:8080/wookie/deploy/wookie.apache.org/widgets/simplechat/index.htm?idkey=0qfFcvflywg5wYVQUcRorsUA2mU.eq.&proxy=http://127.0.0.1:8080/wookie/proxy&st=
>
> ...the following dialogue box appears (everything done in Firefox for this
> email)...
>
> "The page at 127.0.0.1:8080 says: Error".
>
> In the Developer console I see two error lines.
>
> 1) Stack trace from engine.js, function dwr.engine._debug, line 1310.
>
> [09:18:51.198] http://127.0.0.1:8080/wookie/dwr/engine.js ::
> dwr.engine._debug :: 1310
> http://127.0.0.1:8080/wookie/dwr/engine.js ::
> dwr.engine.defaultErrorHandler :: 164
> http://127.0.0.1:8080/wookie/dwr/engine.js ::
> dwr.engine._remoteHandleException :: 931
> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._eval :: 985
> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._eval :: 980
> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._stateChange ::
> 869
> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._sendData :: 679
> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine.endBatch :: 212
> http://127.0.0.1:8080/wookie/features/wave/wave.js :: null :: 101
> http://127.0.0.1:8080/wookie/features/wave/wave.js :: null :: 242
>
>
> 2) Error: undefined, Error
>
> [09:18:51.199] Error: undefined, Error
>
>
> Here are the Wookie related sections from my PHP.
>
> require '../connector/wookie/WookieConnectorService.php';
>
> $admin1 = "Waldorf";
> $user1 = "Animal";
> $widgetidentifier = "http://wookie.apache.org/widgets/simplechat";
>
> // Create shared data key for connector
> $sharedDataKey = date('Ymd') . stringrandom(8);
>
> // Initialise Wookie Connector
> $widgetconnector = new WookieConnectorService("
> http://localhost:8080/wookie", "TEST", $sharedDataKey, $admin1, $admin1);
>
> // Create new instance of specified widget
> $widgetconnector->setUser($user1);
> $widgetinstance1 =
> $widgetconnector->getOrCreateInstance($widgetidentifier);
>
> // Show instance details
> var_dump($widgetinstance1);
>
> // Create iframe to display widget
> echo "<iframe src='" . $widgetinstance1->getUrl() . "' height='" .
> $widgetinstance1->getHeight() . "' width='" . $widgetinstance1->getWidth()
> . "'></iframe>";
>
> Here's an example of the var_dump output...
>
> object(WidgetInstance)#8 (5) { ["url":"WidgetInstance":private]=>
> string(171) "
> http://127.0.0.1:8080/wookie/deploy/wookie.apache.org/widgets/simplechat/index.htm?idkey=cHOKJcOG.pl.0XvYda.pl.ichxQFvlfsQ.eq.&proxy=http://127.0.0.1:8080/wookie/proxy&st="
> ["guid":"WidgetInstance":private]=> string(43) "
> http://wookie.apache.org/widgets/simplechat"
> ["title":"WidgetInstance":private]=> string(10) "SimpleChat"
> ["height":"WidgetInstance":private]=> int(383)
> ["width":"WidgetInstance":private]=> int(255) }
>
> My full test PHP script instantiates four widgets, for four different
> users, using the same shared data key.  I receive the same error for each
> instance, but interwidget communication works properly and the correct user
> is associated with each instance.
>
> I've no idea where to take things from here and would really appreciate
> any help you can offer.
>
> Thanks
>
> Tim.
>
> --
>
> Timothy Goddard
> Institute for Educational Cybernetics
> The University of Bolton
>
> Email tim@timgoddard.co.uk : tpg1ect@bolton.ac.uk : Skype tg_iec_bolton
> Room M1-26 : The University of Bolton : Deane Road : Bolton : BL3 5AB
>
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2013.0.3267 / Virus Database: 3162/6221 - Release Date: 04/02/13
>
>
>
>

Re: Help with PHP Connector

Posted by Paul Sharples <p....@bolton.ac.uk>.
Just to add that this fix is can be found in the 
WookieConnectorService.php file.

line 289                 ,'participant_role' => ''

Paul


On 09/04/2013 10:39, Paul Sharples wrote:
> Hi Tim,
>
> I think this might be due to a bug in the connector which I have just 
> fixed and committed. Looks like the wave feature needed an extra 
> attribute.
> If you get the update from svn, retry to see if everything works 
> (note: You'll have to make sure you are creating new instances - so 
> use another key)
>
> Paul
>
>
> On 09/04/2013 09:44, Tim Goddard wrote:
>> Hi Everyone
>>
>> I think I'm causing myself a problem with the Wookie PHP connector 
>> and wonder if any of you can help me.
>>
>> The demo site <address>:8080/wookie/ works fine but when I 
>> instantiate my own widgets the browser throws up an error, even 
>> though the widgets then seem to function as intended.  I get the same 
>> symptoms using Firefox, Chrome, Opera and Internet Explorer.  I'm 
>> running Wookie 0.11 on my test server (Windows XP) and also Wookie 
>> 0.13 locally from a USB drive for development (Windows 7).  Both are 
>> using the internal database. I get the same issue on both platforms 
>> and so the common factor seems to be my PHP scripting.
>>
>> When I load a widget instance (instantiated through the PHP 
>> connector) using the URL provided by the connector, for example...
>>
>> http://127.0.0.1:8080/wookie/deploy/wookie.apache.org/widgets/simplechat/index.htm?idkey=0qfFcvflywg5wYVQUcRorsUA2mU.eq.&proxy=http://127.0.0.1:8080/wookie/proxy&st=
>>
>> ...the following dialogue box appears (everything done in Firefox for 
>> this email)...
>>
>> "The page at 127.0.0.1:8080 <http://127.0.0.1:8080> says: Error".
>>
>> In the Developer console I see two error lines.
>>
>> 1) Stack trace from engine.js, function dwr.engine._debug, line 1310.
>>
>> [09:18:51.198] http://127.0.0.1:8080/wookie/dwr/engine.js :: 
>> dwr.engine._debug :: 1310
>> http://127.0.0.1:8080/wookie/dwr/engine.js :: 
>> dwr.engine.defaultErrorHandler :: 164
>> http://127.0.0.1:8080/wookie/dwr/engine.js :: 
>> dwr.engine._remoteHandleException :: 931
>> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._eval :: 985
>> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._eval :: 980
>> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._stateChange 
>> :: 869
>> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._sendData :: 679
>> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine.endBatch :: 212
>> http://127.0.0.1:8080/wookie/features/wave/wave.js :: null :: 101
>> http://127.0.0.1:8080/wookie/features/wave/wave.js :: null :: 242
>>
>>
>> 2) Error: undefined, Error
>>
>> [09:18:51.199] Error: undefined, Error
>>
>>
>> Here are the Wookie related sections from my PHP.
>>
>> require '../connector/wookie/WookieConnectorService.php';
>>
>> $admin1 = "Waldorf";
>> $user1 = "Animal";
>> $widgetidentifier = "http://wookie.apache.org/widgets/simplechat";
>>
>> // Create shared data key for connector
>> $sharedDataKey = date('Ymd') . stringrandom(8);
>>
>> // Initialise Wookie Connector
>> $widgetconnector = new 
>> WookieConnectorService("http://localhost:8080/wookie", "TEST", 
>> $sharedDataKey, $admin1, $admin1);
>>
>> // Create new instance of specified widget
>> $widgetconnector->setUser($user1);
>> $widgetinstance1 = 
>> $widgetconnector->getOrCreateInstance($widgetidentifier);
>>
>> // Show instance details
>> var_dump($widgetinstance1);
>>
>> // Create iframe to display widget
>> echo "<iframe src='" . $widgetinstance1->getUrl() . "' height='" . 
>> $widgetinstance1->getHeight() . "' width='" . 
>> $widgetinstance1->getWidth() . "'></iframe>";
>>
>> Here's an example of the var_dump output...
>>
>> object(WidgetInstance)#8 (5) { ["url":"WidgetInstance":private]=> 
>> string(171) 
>> "http://127.0.0.1:8080/wookie/deploy/wookie.apache.org/widgets/simplechat/index.htm?idkey=cHOKJcOG.pl.0XvYda.pl.ichxQFvlfsQ.eq.&proxy=http://127.0.0.1:8080/wookie/proxy&st=" 
>> ["guid":"WidgetInstance":private]=> string(43) 
>> "http://wookie.apache.org/widgets/simplechat" 
>> ["title":"WidgetInstance":private]=> string(10) "SimpleChat" 
>> ["height":"WidgetInstance":private]=> int(383) 
>> ["width":"WidgetInstance":private]=> int(255) }
>>
>> My full test PHP script instantiates four widgets, for four different 
>> users, using the same shared data key.  I receive the same error for 
>> each instance, but interwidget communication works properly and the 
>> correct user is associated with each instance.
>>
>> I've no idea where to take things from here and would really 
>> appreciate any help you can offer.
>>
>> Thanks
>>
>> Tim.
>>
>> -- 
>>
>> Timothy Goddard
>> Institute for Educational Cybernetics
>> The University of Bolton
>> Email tim@timgoddard.co.uk <ma...@timgoddard.co.uk> : 
>> tpg1ect@bolton.ac.uk <ma...@bolton.ac.uk> : Skype tg_iec_bolton
>> Room M1-26 : The University of Bolton : Deane Road : Bolton : BL3 5AB
>>
>> No virus found in this message.
>> Checked by AVG - www.avg.com <http://www.avg.com>
>> Version: 2013.0.3267 / Virus Database: 3162/6221 - Release Date: 04/02/13
>>
>


Re: Help with PHP Connector

Posted by Paul Sharples <p....@bolton.ac.uk>.
Hi Tim,

I think this might be due to a bug in the connector which I have just 
fixed and committed. Looks like the wave feature needed an extra attribute.
If you get the update from svn, retry to see if everything works (note: 
You'll have to make sure you are creating new instances - so use another 
key)

Paul


On 09/04/2013 09:44, Tim Goddard wrote:
> Hi Everyone
>
> I think I'm causing myself a problem with the Wookie PHP connector and 
> wonder if any of you can help me.
>
> The demo site <address>:8080/wookie/ works fine but when I instantiate 
> my own widgets the browser throws up an error, even though the widgets 
> then seem to function as intended.  I get the same symptoms using 
> Firefox, Chrome, Opera and Internet Explorer. I'm running Wookie 0.11 
> on my test server (Windows XP) and also Wookie 0.13 locally from a USB 
> drive for development (Windows 7). Both are using the internal 
> database.  I get the same issue on both platforms and so the common 
> factor seems to be my PHP scripting.
>
> When I load a widget instance (instantiated through the PHP connector) 
> using the URL provided by the connector, for example...
>
> http://127.0.0.1:8080/wookie/deploy/wookie.apache.org/widgets/simplechat/index.htm?idkey=0qfFcvflywg5wYVQUcRorsUA2mU.eq.&proxy=http://127.0.0.1:8080/wookie/proxy&st=
>
> ...the following dialogue box appears (everything done in Firefox for 
> this email)...
>
> "The page at 127.0.0.1:8080 <http://127.0.0.1:8080> says: Error".
>
> In the Developer console I see two error lines.
>
> 1) Stack trace from engine.js, function dwr.engine._debug, line 1310.
>
> [09:18:51.198] http://127.0.0.1:8080/wookie/dwr/engine.js :: 
> dwr.engine._debug :: 1310
> http://127.0.0.1:8080/wookie/dwr/engine.js :: 
> dwr.engine.defaultErrorHandler :: 164
> http://127.0.0.1:8080/wookie/dwr/engine.js :: 
> dwr.engine._remoteHandleException :: 931
> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._eval :: 985
> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._eval :: 980
> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._stateChange 
> :: 869
> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine._sendData :: 679
> http://127.0.0.1:8080/wookie/dwr/engine.js :: dwr.engine.endBatch :: 212
> http://127.0.0.1:8080/wookie/features/wave/wave.js :: null :: 101
> http://127.0.0.1:8080/wookie/features/wave/wave.js :: null :: 242
>
>
> 2) Error: undefined, Error
>
> [09:18:51.199] Error: undefined, Error
>
>
> Here are the Wookie related sections from my PHP.
>
> require '../connector/wookie/WookieConnectorService.php';
>
> $admin1 = "Waldorf";
> $user1 = "Animal";
> $widgetidentifier = "http://wookie.apache.org/widgets/simplechat";
>
> // Create shared data key for connector
> $sharedDataKey = date('Ymd') . stringrandom(8);
>
> // Initialise Wookie Connector
> $widgetconnector = new 
> WookieConnectorService("http://localhost:8080/wookie", "TEST", 
> $sharedDataKey, $admin1, $admin1);
>
> // Create new instance of specified widget
> $widgetconnector->setUser($user1);
> $widgetinstance1 = 
> $widgetconnector->getOrCreateInstance($widgetidentifier);
>
> // Show instance details
> var_dump($widgetinstance1);
>
> // Create iframe to display widget
> echo "<iframe src='" . $widgetinstance1->getUrl() . "' height='" . 
> $widgetinstance1->getHeight() . "' width='" . 
> $widgetinstance1->getWidth() . "'></iframe>";
>
> Here's an example of the var_dump output...
>
> object(WidgetInstance)#8 (5) { ["url":"WidgetInstance":private]=> 
> string(171) 
> "http://127.0.0.1:8080/wookie/deploy/wookie.apache.org/widgets/simplechat/index.htm?idkey=cHOKJcOG.pl.0XvYda.pl.ichxQFvlfsQ.eq.&proxy=http://127.0.0.1:8080/wookie/proxy&st=" 
> ["guid":"WidgetInstance":private]=> string(43) 
> "http://wookie.apache.org/widgets/simplechat" 
> ["title":"WidgetInstance":private]=> string(10) "SimpleChat" 
> ["height":"WidgetInstance":private]=> int(383) 
> ["width":"WidgetInstance":private]=> int(255) }
>
> My full test PHP script instantiates four widgets, for four different 
> users, using the same shared data key.  I receive the same error for 
> each instance, but interwidget communication works properly and the 
> correct user is associated with each instance.
>
> I've no idea where to take things from here and would really 
> appreciate any help you can offer.
>
> Thanks
>
> Tim.
>
> -- 
>
> Timothy Goddard
> Institute for Educational Cybernetics
> The University of Bolton
> Email tim@timgoddard.co.uk <ma...@timgoddard.co.uk> : 
> tpg1ect@bolton.ac.uk <ma...@bolton.ac.uk> : Skype tg_iec_bolton
> Room M1-26 : The University of Bolton : Deane Road : Bolton : BL3 5AB
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 2013.0.3267 / Virus Database: 3162/6221 - Release Date: 04/02/13
>