The last time I checked, there are two locations you need to change to
indication that the rpc_relay has changed from it's default location.
javascript/container/gadgets.js:486 reads
gadgets.IfrGadget.prototype.rpcRelay = 'files/container/rpc_relay.html';
and
config/container.js:79 reads
"parentRelayUrl" : "/gadgets/files/container/rpc_relay.html",
Both need to be pointed at the new location of the file - I believe that the
first is used by the container to reference the relay, and the second is
used by the gadgets themselves. I found that simply editing both settings
was enough for my purposes, but it might make sense to consolidate the
location of a key like this, even though the gadgets.js file is just an
example of how a container might be implemented.
Hope this helps,
Colin
On Mon, Jun 9, 2008 at 1:20 PM, Tim Thelin <[EMAIL PROTECTED]> wrote:
> I've never seen that error before, and I'm not that familiar with what it
> means. I'd check to make sure
> 1) your iframe.src is picking up the right rpc_relay.html file
> 2) All of your shindig javascript files are comming from the same gadget
> server so there isn't an issue where your container is using one version
> but
> your gadget server is expecting a different version.
>
> -Tim
>
> On Sat, Jun 7, 2008 at 12:42 AM, Neo Anderson <
> [EMAIL PROTECTED]>
> wrote:
>
> > Thank you very much Tim,
> >
> > Where do I need to modify my code to locate rpc_relay.html in a different
> > location?
> >
> > After doing what you said, I am not getting 404 error in the iframes
> which
> > are present inside the gadgets iframe, But I am getting a different
> > error, "Invalid
> > auth token.".
> >
> > Please solve this.
> >
> >
> > On Fri, Jun 6, 2008 at 10:31 PM, Tim Thelin <[EMAIL PROTECTED]> wrote:
> >
> > > So your setup involves two servers using two different ports?
> > >
> > > If that's the case, it means your container is not the same origin as
> > your
> > > gadget server, which will break gadget RPC unless you take some steps
> to
> > > repair it (below). Dynamic height is implemented using gadget RPC,
> which
> > > is
> > > why dynamic height would break.
> > >
> > > Steps to repair gadget RPC if you container is not the "same origin" as
> > the
> > > gadget server:
> > > 1) Within the container, make sure to set each gadget's server base
> > > (setServerBase) to the right gadget server url in each gadget's
> > constructor
> > > 2) copy javascript/container/rpc_relay.html to a path on your container
> > web
> > > server such that the url to access that file is
> > > "/gadgets/files/container/rpc_relay.html". This url path can be tweaked
> > to
> > > be something different by configuring the gadget server.
> > >
> > > The above is from memory so it might need a slight tweak. But the
> > general
> > > idea is that rpc works by bouncing responses between origins by using
> > > iframes. Each origin needs it's own copy of rpc_relay.html in a
> > > predictable
> > > location, so the other origin knows where it is. If the contianer and
> > > gadget server are on the same origin, then the existing location works
> > out
> > > just fine for both. If the container is on a separate origin, the
> > > container
> > > needs a copy of rpc_relay.html, and then it needs to be put in a place
> > > where
> > > the gadget server knows where it is. By default the gadget server
> tries
> > > to
> > > use a file on the container's origin of:
> > > "http://<container-host>/gadgets/files/container/rpc_relay.html".
> > > The ending can be changed by configuring the shindig gadget server.
> > >
> > >
> > > The way to check if RPC can find that rpc_relay.html file or is to use
> > > Firefox + Firebug (or any other DOM inspection debugger). Every time
> you
> > > try to use dynamic height, the gadget will generate a new internal
> iframe
> > > to
> > > try to transmit the call to the container. So if you find your
> gadget's
> > > iframe in the DOM, there will be new iframe's inside of it with a src
> > > attribute pointing to the container's rpc_relay.html. If the contents
> of
> > > this iframe is a http 404, then you know it's not configured correctly
> > (and
> > > this is most likely what's going on right now). When RPC is working,
> the
> > > contents of this iframe should match the contents of rpc_relay.html
> > >
> > > I hope this helps
> > > -Tim
> > >
> > >
> > >
> > > On Fri, Jun 6, 2008 at 4:18 AM, Neo Anderson <
> > > [EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > I have my gadgets container(Shindig code/javascript/container) files
> in
> > > > Apache server and my gadgets server is running at 8080 port. I am
> > > including
> > > > the following scripts in my HTML page on Apache server.
> > > >
> > > > 1. gadgets.js
> > > > 2. cookies.js
> > > > 3. cookiebaseduserprefstore.js
> > > >
> > > > Then I got some errors, and then I included rpc.js file using below
> > > script
> > > > tag..
> > > > <script type="text/javascript" src="
> > > > http://localhost:8080/gadgets/js/rpc.js?c=1&debug=1"></script>
> > > >
> > > > And list of scripts that are included are:
> > > > <script type="text/javascript" src="
> > > > http://localhost:8080/gadgets/js/rpc.js?c=1&debug=1"></script>
> > > > <script type="text/javascript" src="cookies.js"></script>
> > > > <script type="text/javascript" src="util.js"></script>
> > > > <script type="text/javascript" src="gadgets.js"></script>
> > > > <script type="text/javascript"
> > > src="cookiebaseduserprefstore.js"></script>
> > > >
> > > > All the script files are included correctly.
> > > >
> > > > And when I am running sample6.html, dynamic height is not working.
> > > >
> > > > Screenshot: http://tech-test.tutorialsforu.com/DynamicHeight.png
> > > >
> > >
> >
>
--
Colin Alworth
Software Engineer, SSS Research, Inc.
218.348.4347
[EMAIL PROTECTED]