Embedding waves in MediaWiki from different wave servers

0 views
Skip to first unread message

Micke Nordin

unread,
Oct 5, 2009, 5:21:41 AM10/5/09
to Google Wave API
I have written an extension for MediaWiki that makes it possible to
embed waves to a wiki page:

http://www.mediawiki.org/wiki/Extension:GoogleWave

Using the Google wave sandbox server, a wave is displayed properly
inline on a wiki page. I have not been able to reproduce this behavior
with other wave servers I have now been able to try.

If someone could shed a light on this it would be more than welcome.

These are the wave servers I have tried:
*http://wave.google.com/a/wavesandbox.com/ - The sandbox wave server,
a trailing slash in the URL works, no trailing slash doesn't.
*https://wave.google.com/wave - The Google wave server, no trailing
slash produces the inbox of my wave account, where as a trailing slash
produces a grey background only, no content.
*http://pygowave.net/waves/ - PyGoWave server, no trailing slahs
produces an error, a trailing slash shows inbox.

My extension is written in PHP and produce xhtml output similar to the
Hello World example from the tutorial.

/Micke Nordin

Micke Nordin

unread,
Oct 5, 2009, 3:04:10 PM10/5/09
to Google Wave API
I managed to fix this, all I had to do was switch places for these
lines in my js from;
wave.loadWave(...);
wave.setUIConfig(...);
to:
wave.setUIConfig(...);
wave.loadWave(...);
Oddly enough the former works with the sandbox server, but not with
the live server.

Also, we need a good way of getting the wave id, which was present in
the sandbox via the debug option, but that is missing from the live
server.

/MIcke

On 5 Okt, 11:21, Micke Nordin <mickew...@gmail.com> wrote:
> I have written an extension for MediaWiki that makes it possible to
> embed waves to a wiki page:
>
> http://www.mediawiki.org/wiki/Extension:GoogleWave
>
> Using the Google wave sandbox server, a wave is displayed properly
> inline on a wiki page. I have not been able to reproduce this behavior
> with other wave servers I have now been able to try.
>
> If someone could shed a light on this it would be more than welcome.
>
> These are the wave servers I have tried:
> *http://wave.google.com/a/wavesandbox.com/- The sandbox wave server,
> a trailing slash in the URL works, no trailing slash doesn't.
> *https://wave.google.com/wave- The Google wave server, no trailing
> slash produces the inbox of my wave account, where as a trailing slash
> produces a grey background only, no content.
> *http://pygowave.net/waves/- PyGoWave server, no trailing slahs

rick eisenmenger

unread,
Oct 6, 2009, 9:55:56 AM10/6/09
to Google Wave API
Hello Micke,

for now I am dragging a wave into another one to examine the link that
contains the wave id; I hope there are other ways..

How did you manage the authentication against the appserver? (I am
trying to embed a wave on an application web page on a remote
server..)

Regards
Rick

On Oct 5, 9:04 pm, Micke Nordin <mickew...@gmail.com> wrote:
> I managed to fix this, all I had to do was switch places for these
> lines in my js from;
>   wave.loadWave(...);
>   wave.setUIConfig(...);
> to:
>   wave.setUIConfig(...);
>   wave.loadWave(...);
> Oddly enough the former works with the sandbox server, but not with
> the live server.
>
> Also, we need a good way of getting the wave id, which was present in
> the sandbox via the debug option, but that is missing from the live
> server.
>
> /MIcke
>
> On 5 Okt, 11:21, Micke Nordin <mickew...@gmail.com> wrote:
>
> > I have written an extension for MediaWiki that makes it possible to
> > embed waves to a wiki page:
>
> >http://www.mediawiki.org/wiki/Extension:GoogleWave
>
> > Using the Google wave sandbox server, a wave is displayed properly
> > inline on a wiki page. I have not been able to reproduce this behavior
> > with other wave servers I have now been able to try.
>
> > If someone could shed a light on this it would be more than welcome.
>
> > These are the wave servers I have tried:
> > *http://wave.google.com/a/wavesandbox.com/-The sandbox wave server,
> > a trailing slash in the URL works, no trailing slash doesn't.
> > *https://wave.google.com/wave-The Google wave server, no trailing
> > slash produces the inbox of my wave account, where as a trailing slash
> > produces a grey background only, no content.
> > *http://pygowave.net/waves/-PyGoWave server, no trailing slahs

Micke Nordin

unread,
Oct 6, 2009, 11:42:00 AM10/6/09
to Google Wave API


On Oct 6, 3:55 pm, rick eisenmenger <rick.eisenmen...@gmail.com>
wrote:
> for now I am dragging a wave into another one to examine the link that
> contains the wave id; I hope there are other ways..

I know two ways:
1. Use the URL
* Click on a wave in the Google Wave site, the resulting URL
might look something like this: https://wave.google.com/wave/#restored:wave:googlewave.com!w%252BP9PIf1t-A
* remove everything except googlewave.com!w%252BP9PIf1t-A
* change the part after the exclamation mark from w%252B to:
w+
* you are done and you wave id is googlewave.com!w+P9PIf1t-A
2. Use a bot
* add blog...@appspot.com to you wave, it will spit out the
wave id (among other things). Once you get the id you can delete the
bots messages

> How did you manage the authentication against the appserver? (I am
> trying to embed a wave on an application web page on a remote
> server..)
Basically my extension produces some of the html and all of the
javascript of the Hello World example here:
http://code.google.com/intl/sv/apis/wave/embed/guide.html#HelloWorld

All I do with the php code is add the wave id along with the
configuration options.So i did not need to worry about managing the
authentication against the appserver.

/Micke

Jack Park

unread,
Oct 6, 2009, 8:17:39 PM10/6/09
to google-...@googlegroups.com
I am getting an error trying it on FF 3.5.3 and the latest MediaWiki.

A slightly anonymized error message for when I save the edit is this:
[Tue Oct 06 16:57:53 2009] [error] [client x.x.x.x.] PHP Warning:
Parameter 3 to waveRender() expected to be a reference, value given in
C:\\Apache2.2\\htdocs\\mediawiki\\includes\\parser\\Parser.php on line
3243, referer: ...

When I ask the page to load with a refresh, nothing happens. No error
messages. I am using the simplest <wave tag with an id. I removed
id=... to see if I would get the error message. I see nothing.
waveRender is not even getting down to to the line of code where it
tests for id.

Thoughts?
Thanks
Jack

Micke Nordin

unread,
Oct 7, 2009, 4:24:14 AM10/7/09
to Google Wave API
I suspect there is something wrong with you MediaWiki installation and/
or your PHP installation as parameter 3 to waveRender is a reference
to the parser object, that should be sent by the parser hook (by
MediaWiki, that is). I have no idea as to why this doesn't work
though... It is not surprising that you get no error message, because
the problem is that the functions of the extension doesn't get called
by the parser properly. Does other extensions with parser hooks work
properly? Try to install any one of these extensions and see if you
get the same error:

http://www.mediawiki.org/wiki/Category:ParserFirstCallInit_extensions

/Micke

On 7 Okt, 02:17, Jack Park <jackp...@gmail.com> wrote:
> I am getting an error trying it on FF 3.5.3 and the latest MediaWiki.
>
> A slightly anonymized error message for when I save the edit is this:
> [Tue Oct 06 16:57:53 2009] [error] [client x.x.x.x.] PHP Warning:
> Parameter 3 to waveRender() expected to be a reference, value given in
> C:\\Apache2.2\\htdocs\\mediawiki\\includes\\parser\\Parser.php on line
> 3243, referer: ...
>
> When I ask the page to load with a refresh, nothing happens. No error
> messages. I am using the simplest <wave tag with an id.  I removed
> id=... to see if I would get the error message. I see nothing.
> waveRender is not even getting down to to the line of code where it
> tests for id.
>
> Thoughts?
> Thanks
> Jack
>
> On Tue, Oct 6, 2009 at 8:42 AM, Micke Nordin <mickew...@gmail.com> wrote:
>
> > On Oct 6, 3:55 pm, rick eisenmenger <rick.eisenmen...@gmail.com>
> > wrote:
> >> for now I am dragging a wave into another one to examine the link that
> >> contains the wave id; I hope there are other ways..
>
> > I know two ways:
> >   1. Use the URL
> >          * Click on a wave in the Google Wave site, the resulting URL
> > might look something like this:https://wave.google.com/wave/#restored:wave:googlewave.com!w%252BP9PI...
> >          * remove everything except googlewave.com!w%252BP9PIf1t-A
> >          * change the part after the exclamation mark from w%252B to:
> > w+
> >          * you are done and you wave id is googlewave.com!w+P9PIf1t-A
> >   2. Use a bot
> >          * add blog-...@appspot.com to you wave, it will spit out the

Jack Park

unread,
Oct 7, 2009, 1:29:57 PM10/7/09
to google-...@googlegroups.com
Good question.
I have two extensions that use the parser thus:

function getAppletOutput( $input, $args, $parser )

which contrasts with the wave function:
function waveRender($input, $argv, &$parser) as copied directly from the file.

I just removed the ampersand to
function waveRender($input, $argv, $parser)
and now it's "almost" working. Now I get a flood of errors such as:

Use of undefined constant id - assumed 'id' in
C:\\Apache2.2\\htdocs\\mediawiki\\extensions\\GoogleWave\\GoogleWave.php
on line 38,...

I then went in and found all the arg[] values and put ticks around them.
It's now working. Seems to take a long time to load my wave, and I now
need to play with width, height, etc, but it appears to have been a
few "typos" in GoogleWave.php that prevented it from working.

Thanks
Jack

On Wed, Oct 7, 2009 at 1:24 AM, Micke Nordin <mick...@gmail.com> wrote:
>
> I suspect there is something wrong with you MediaWiki installation and/
> or your PHP installation as parameter 3 to waveRender is a reference
> to the parser object, that should be sent by the parser hook (by
> MediaWiki, that is). I have no idea as to why this doesn't work
> though... It is not surprising that you get no error message, because
> the problem is that the functions of the extension doesn't get called
> by the parser properly. Does other extensions with parser hooks work
> properly? Try to install any one of these extensions and see if you
> get the same error:
>
> http://www.mediawiki.org/wiki/Category:ParserFirstCallInit_extensions
>
> /Micke

><snip>

Micke Nordin

unread,
Oct 7, 2009, 3:56:55 PM10/7/09
to Google Wave API
I don't know if there is a difference between behavior in apache/PHP
under Linux and Windows (I have never tried it in a Windows
environment) and it works properly for me on all the machines I have
tried on. I would be glad if you could attach a patch or just the file
with your changes so that I can take a look at them and see if I can
figure out what is going on (or e-mail me directly if you like).

/Micke

On 7 Okt, 19:29, Jack Park <jackp...@gmail.com> wrote:
> Good question.
> I have two extensions that use the parser thus:
>
> function getAppletOutput( $input, $args, $parser )
>
> which contrasts with the wave function:
> function waveRender($input, $argv, &$parser)  as copied directly from the file.
>
> I just removed the ampersand to
> function waveRender($input, $argv, $parser)
> and now it's "almost" working. Now I get a flood of errors such as:
>
> Use of undefined constant id - assumed 'id' in
> C:\\Apache2.2\\htdocs\\mediawiki\\extensions\\GoogleWave\\GoogleWave.php
> on line 38,...
>
> I then went in and found all the arg[] values and put ticks around them.
> It's now working. Seems to take a long time to load my wave, and I now
> need to play with width, height, etc, but it appears to have been a
> few "typos" in GoogleWave.php that prevented it from working.
>
> Thanks
> Jack
>

Jack Park

unread,
Oct 7, 2009, 4:04:02 PM10/7/09
to google-...@googlegroups.com
The only change made that actually made it work was to remove the
ampersand from &$parser since it's not like that in any other parser
extension I have access to. Then it started working. But, I got lots
of error messages due to things like $args[id] which php defaulted to
$args['id'] and ran with. By fixing all the args you call by putting
ticks around them as suggested with 'id', no more errors, and it still
runs.

Jack

Micke Nordin

unread,
Oct 7, 2009, 4:04:33 PM10/7/09
to Google Wave API
FYI the ampersand makes it so the parser object is passed by reference
instead of being copied, so that is a part of PHP and not a typo:
http://us3.php.net/references.pass

That should definitly work and it is what is specified in the
MediaWiki docs.

I don't now what difference putting tics around the arg values make
(what kind of tics?), but I'll look in to it.

/Micke

On 7 Okt, 19:29, Jack Park <jackp...@gmail.com> wrote:
> Good question.
> I have two extensions that use the parser thus:
>
> function getAppletOutput( $input, $args, $parser )
>
> which contrasts with the wave function:
> function waveRender($input, $argv, &$parser)  as copied directly from the file.
>
> I just removed the ampersand to
> function waveRender($input, $argv, $parser)
> and now it's "almost" working. Now I get a flood of errors such as:
>
> Use of undefined constant id - assumed 'id' in
> C:\\Apache2.2\\htdocs\\mediawiki\\extensions\\GoogleWave\\GoogleWave.php
> on line 38,...
>
> I then went in and found all the arg[] values and put ticks around them.
> It's now working. Seems to take a long time to load my wave, and I now
> need to play with width, height, etc, but it appears to have been a
> few "typos" in GoogleWave.php that prevented it from working.
>
> Thanks
> Jack
>

Jack Park

unread,
Oct 7, 2009, 4:07:53 PM10/7/09
to google-...@googlegroups.com
That may be so. I'm not a php hacker by any means; I just copy what
seems to work. In two other parser extensions I have, there was no
'&'. Prior to removing it, I got the error suggested earlier in this
thread. After removing it, no further repeat of that error, plus
which, the darn thing started working. Sure, might be something to do
with windoz php. I dunno.

Jack

ndee

unread,
Oct 7, 2009, 4:12:08 PM10/7/09
to Google Wave API
hi,

3. add emb...@appspot.com to your wave.

See the issue here: http://code.google.com/p/google-wave-resources/issues/detail?id=246

greets

On Oct 6, 5:42 pm, Micke Nordin <mickew...@gmail.com> wrote:
> On Oct 6, 3:55 pm, rick eisenmenger <rick.eisenmen...@gmail.com>
> wrote:
>
> > for now I am dragging a wave into another one to examine the link that
> > contains the wave id; I hope there are other ways..
>
> I know two ways:
>    1. Use the URL
>           * Click on a wave in the Google Wave site, the resulting URL
> might look something like this:https://wave.google.com/wave/#restored:wave:googlewave.com!w%252BP9PI...
>           * remove everything except googlewave.com!w%252BP9PIf1t-A
>           * change the part after the exclamation mark from w%252B to:
> w+
>           * you are done and you wave id is googlewave.com!w+P9PIf1t-A
>    2. Use a bot
>           * add blog-...@appspot.com to you wave, it will spit out the

Micke Nordin

unread,
Oct 7, 2009, 5:06:48 PM10/7/09
to Google Wave API
The tic thing is definitely an error on my part though (check under
"Array do's and don'ts"):

http://se2.php.net/manual/en/language.types.array.php

You dont think that it is that alone which is causing the problem?

/Micke

On 7 Okt, 22:07, Jack Park <jackp...@gmail.com> wrote:
> That may be so. I'm not a php hacker by any means; I just copy what
> seems to work. In two other parser extensions I have, there was no
> '&'. Prior to removing it, I got the error suggested earlier in this
> thread. After removing it, no further repeat of that error, plus
> which, the darn thing started working. Sure, might be something to do
> with windoz php. I dunno.
>
> Jack
>

Jack Park

unread,
Oct 7, 2009, 5:40:44 PM10/7/09
to google-...@googlegroups.com
According to the original error message, it never got to that. I went
so far as to put up a <wave /> tag with no id, hoping to provoke that
error message. It never got there. Always failed on passing the wrong
thing to &$parser

Micke Nordin

unread,
Oct 10, 2009, 4:29:38 AM10/10/09
to Google Wave API
Which version of PHP are you using? I have been asking around, and one
possible answer I got from the MediaWiki mailing list was that you
were using PHP4, which is no longer supported by MediaWiki. Could that
be the case? You can check the installation requirements for MediaWiki
here:

http://www.mediawiki.org/wiki/Manual:Installation_requirements

/Micke

On 7 Okt, 23:40, Jack Park <jackp...@gmail.com> wrote:
> According to the original error message, it never got to that. I went
> so far as to put up a <wave /> tag with no id, hoping to provoke that
> error message. It never got there. Always failed on passing the wrong
> thing to &$parser
>
> >> >> > I suspect there is something wrong with youMediaWikiinstallation and/

Jack Park

unread,
Oct 10, 2009, 4:02:11 PM10/10/09
to google-...@googlegroups.com
PHP5: the apache dll is php5apache2_2.dll

Jack Park

unread,
Oct 13, 2009, 12:27:30 PM10/13/09
to google-...@googlegroups.com
I embedded the wave about waves in classrooms and learned this: an
embedded wave that contains links to other waves (which are not
embedded) causes problems--the evidence was that message waves give,
something about needing to restart the wave.

Jack
Reply all
Reply to author
Forward
0 new messages