You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Scott Aikin <ad...@hawkee.com> on 2008/03/29 23:01:50 UTC

Trying to get Javascript sample container to work with PHP Gadget Server

I've been playing with the Shindig PHP code and did manage to get a
gadget server running with it, but I cannot get the javascript  
opensocial
sample containers to work with it.  I've got this directory layout:

/gadgets/src - PHP code
/gadgets/javascript
/gadgets/features
/gadgets/config

I've tried running the samples in the javascript directory, but the  
first
problem is that rpc.js is referenced in ../../js/ which does not exist
anywhere in the Shindig distribution.  So I tried including it from
/gadgets/features/rpc, but I'm still getting some errors when testing
the samples:

gadgets.util has no properties
[Break on this error] var params = gadgets.util.getUrlParameters();
rpc.js (line 40)

gadgets.rpc has no properties
[Break on this error] gadgets.rpc.register('resize_iframe',  
this.setHeight);
gadgets.js (line 182)

gadgets.container has no properties
[Break on this error] var gadget0 = gadgets.container.createGadget 
({specUrl: specUrl0});
sample1.html (line 19)

Now I could be going about this completely wrong, so any nudge
in the right direction would be greatly appreciated.

Thank you!
- Scott

Re: Trying to get Javascript sample container to work with PHP Gadget Server

Posted by Scott Aikin <ad...@hawkee.com>.
Thank you Chris,

I did manage to get this solved, but one thing that would have
helped would have been more granule mod_rewrite rules.  The
rule included basically eradicated all of my existing mod_rewrite
since it's a catch-all.  What I had to do was figure out each event
and create individual rules:

RewriteRule /gadgets/ifr /gadgets/index.php [L]
RewriteRule /gadgets/proxy /gadgets/index.php [L]
RewriteRule /gadgets/js /gadgets/index.php [L]
RewriteRule /gadgets/socialdata /gadgets/index.php [L]

It would be much nicer if the given .htaccess used this
format as well.

- Scott

On Mar 30, 2008, at 3:09 PM, Chris Chabot wrote:

> Hey Scott,
>
> The example's expect their hosted under /gadgets/files/container/ 
> *.html (in
> both java and php land), hence the ../../js is actually /gadgets/js  
> event,
> and not a folder.
>
> The /js event then looks for the feaure that is called (rpc in this  
> case)
> and assembles and outputs its (concatenated) javascript(s) for you.
>
> So if you changed the location of where the events are located,  
> just update
> the html to call the right <gadget server root>/js/rpc.js and  
> everything
> should be fine again.
>
> 	-- Chris
>
> -----Original Message-----
> From: Scott Aikin [mailto:admin@hawkee.com]
> Sent: Saturday, March 29, 2008 23:02
> To: shindig-dev@incubator.apache.org
> Subject: Trying to get Javascript sample container to work with PHP  
> Gadget
> Server
>
> I've been playing with the Shindig PHP code and did manage to get a
> gadget server running with it, but I cannot get the javascript
> opensocial
> sample containers to work with it.  I've got this directory layout:
>
> /gadgets/src - PHP code
> /gadgets/javascript
> /gadgets/features
> /gadgets/config
>
> I've tried running the samples in the javascript directory, but the
> first
> problem is that rpc.js is referenced in ../../js/ which does not exist
> anywhere in the Shindig distribution.  So I tried including it from
> /gadgets/features/rpc, but I'm still getting some errors when testing
> the samples:
>
> gadgets.util has no properties
> [Break on this error] var params = gadgets.util.getUrlParameters();
> rpc.js (line 40)
>
> gadgets.rpc has no properties
> [Break on this error] gadgets.rpc.register('resize_iframe',
> this.setHeight);
> gadgets.js (line 182)
>
> gadgets.container has no properties
> [Break on this error] var gadget0 = gadgets.container.createGadget
> ({specUrl: specUrl0});
> sample1.html (line 19)
>
> Now I could be going about this completely wrong, so any nudge
> in the right direction would be greatly appreciated.
>
> Thank you!
> - Scott
>


RE: Trying to get Javascript sample container to work with PHP Gadget Server

Posted by Chris Chabot <ch...@xs4all.nl>.
Hey Scott,

The example's expect their hosted under /gadgets/files/container/*.html (in
both java and php land), hence the ../../js is actually /gadgets/js event,
and not a folder.

The /js event then looks for the feaure that is called (rpc in this case)
and assembles and outputs its (concatenated) javascript(s) for you.

So if you changed the location of where the events are located, just update
the html to call the right <gadget server root>/js/rpc.js and everything
should be fine again.

	-- Chris

-----Original Message-----
From: Scott Aikin [mailto:admin@hawkee.com] 
Sent: Saturday, March 29, 2008 23:02
To: shindig-dev@incubator.apache.org
Subject: Trying to get Javascript sample container to work with PHP Gadget
Server

I've been playing with the Shindig PHP code and did manage to get a
gadget server running with it, but I cannot get the javascript  
opensocial
sample containers to work with it.  I've got this directory layout:

/gadgets/src - PHP code
/gadgets/javascript
/gadgets/features
/gadgets/config

I've tried running the samples in the javascript directory, but the  
first
problem is that rpc.js is referenced in ../../js/ which does not exist
anywhere in the Shindig distribution.  So I tried including it from
/gadgets/features/rpc, but I'm still getting some errors when testing
the samples:

gadgets.util has no properties
[Break on this error] var params = gadgets.util.getUrlParameters();
rpc.js (line 40)

gadgets.rpc has no properties
[Break on this error] gadgets.rpc.register('resize_iframe',  
this.setHeight);
gadgets.js (line 182)

gadgets.container has no properties
[Break on this error] var gadget0 = gadgets.container.createGadget 
({specUrl: specUrl0});
sample1.html (line 19)

Now I could be going about this completely wrong, so any nudge
in the right direction would be greatly appreciated.

Thank you!
- Scott


Re: Trying to get Javascript sample container to work with PHP Gadget Server

Posted by Scott Aikin <ad...@hawkee.com>.
Turns out I had the wrong rpc.js which is what I suspected all along.
What I ended up doing was running the sample through the Java
server (which works fine) and I copied the code from that rpc.js
and created /gadgets/js/rpc.js then pointed sample1.html back
to that file.  I'm not sure why there is a different rpc.js in /features
so maybe somebody can shed some light on that.

- Scott


On Mar 29, 2008, at 3:01 PM, Scott Aikin wrote:

> I've been playing with the Shindig PHP code and did manage to get a
> gadget server running with it, but I cannot get the javascript  
> opensocial
> sample containers to work with it.  I've got this directory layout:
>
> /gadgets/src - PHP code
> /gadgets/javascript
> /gadgets/features
> /gadgets/config
>
> I've tried running the samples in the javascript directory, but the  
> first
> problem is that rpc.js is referenced in ../../js/ which does not exist
> anywhere in the Shindig distribution.  So I tried including it from
> /gadgets/features/rpc, but I'm still getting some errors when testing
> the samples:
>
> gadgets.util has no properties
> [Break on this error] var params = gadgets.util.getUrlParameters();
> rpc.js (line 40)
>
> gadgets.rpc has no properties
> [Break on this error] gadgets.rpc.register('resize_iframe',  
> this.setHeight);
> gadgets.js (line 182)
>
> gadgets.container has no properties
> [Break on this error] var gadget0 = gadgets.container.createGadget 
> ({specUrl: specUrl0});
> sample1.html (line 19)
>
> Now I could be going about this completely wrong, so any nudge
> in the right direction would be greatly appreciated.
>
> Thank you!
> - Scott