You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Laura Nathanson <la...@gmail.com> on 2009/08/04 16:43:19 UTC

setTitle

Hello there,

I'm trying to get setTitle working in my container, and having no
luck.

In container.js I've registered and defined the setTitle function to
just thow up an alert message. I'm including container.js and a
reference to my shindig's rpc.js file in the container's gadget
hosting page. But when my gadget calls gadgets.window.setTitle, no alert
pops up.

What else might I be missing? Are there some other files that my
container needs to have? Some setting in Shindig that I need to
change or some other functions I need to write?

My iframe urls do have a parent param set. I saw an old wiki article
that said: "You must make sure that gadgets.rpc.setRelayUrl is called
for every app". But, I couldn't find this method call anywhere in
Partuza, so is this still true?

(using PHP Shindig btw)

Laura

Re: setTitle

Posted by Laura Nathanson <la...@gmail.com>.
Thank you John and Chris both.
I (eventually) got setTitle working by adding references to Shindig's
util.js and gadgets.js to my containing page, and setting a "name" attribute
on the gadget iframe tag.

Calling setRelayUrl and setAuthToken seems to make no difference, nor does
changing the parentRelayUrl in container.js in Shindig. For now, I'm doing
neither. I do have the newer version of rpc.js with the crazy symbols in it,
and was using Firefox 3.5.2 and Chrome 2.0 to test in.

Re: setTitle

Posted by John Hjelmstad <fa...@google.com>.
Laura:
Turns out with recent changes to rpc.js (if yours has symbols in it named
gadgets.rpctx.*, you've got the new one), you won't need an "actual"
rpc_relay.html file any more. Which browser are you using?

For each gadget you render in your container with IFRAME ID "<gadget-id>"
with URL "<render-url>" you'll need to do:

gadgets.rpc.setRelayUrl("<gadget-id>", "<render-url>");
gadgets.rpc.setAuthToken("<gadget-id>", null);

If you choose to add an rpc token to the gadget (via
<render-url>#rpctoken=<random-number> - this prevents gadgets from spoofing
each other's messages to/from the container as a security measure), change
the last line to:
gadgets.rpc.setAuthToken("<gadget-id>", "<random-number>");

--John

On Tue, Aug 4, 2009 at 2:39 PM, Chris Chabot <ch...@google.com> wrote:

> Hey Laura,
>
> Chances are that it can't find the rpc_relay.html file, see this bit in
> shindig/config/container.js:
>
>  "rpc" : {
>    // Path to the relay file. Automatically appended to the parent
>    /// parameter if it passes input validation and is not null.
>    // This should never be on the same host in a production environment!
>    // Only use this for TESTING!
>    "parentRelayUrl" : "/gadgets/files/container/rpc_relay.html",
>
>   -- Chris
>
> On Tue, Aug 4, 2009 at 4:43 PM, Laura Nathanson
> <la...@gmail.com>wrote:
>
> > Hello there,
> >
> > I'm trying to get setTitle working in my container, and having no
> > luck.
> >
> > In container.js I've registered and defined the setTitle function to
> > just thow up an alert message. I'm including container.js and a
> > reference to my shindig's rpc.js file in the container's gadget
> > hosting page. But when my gadget calls gadgets.window.setTitle, no alert
> > pops up.
> >
> > What else might I be missing? Are there some other files that my
> > container needs to have? Some setting in Shindig that I need to
> > change or some other functions I need to write?
> >
> > My iframe urls do have a parent param set. I saw an old wiki article
> > that said: "You must make sure that gadgets.rpc.setRelayUrl is called
> > for every app". But, I couldn't find this method call anywhere in
> > Partuza, so is this still true?
> >
> > (using PHP Shindig btw)
> >
> > Laura
> >
>

Re: setTitle

Posted by Chris Chabot <ch...@google.com>.
Hey Laura,

Chances are that it can't find the rpc_relay.html file, see this bit in
shindig/config/container.js:

  "rpc" : {
    // Path to the relay file. Automatically appended to the parent
    /// parameter if it passes input validation and is not null.
    // This should never be on the same host in a production environment!
    // Only use this for TESTING!
    "parentRelayUrl" : "/gadgets/files/container/rpc_relay.html",

   -- Chris

On Tue, Aug 4, 2009 at 4:43 PM, Laura Nathanson
<la...@gmail.com>wrote:

> Hello there,
>
> I'm trying to get setTitle working in my container, and having no
> luck.
>
> In container.js I've registered and defined the setTitle function to
> just thow up an alert message. I'm including container.js and a
> reference to my shindig's rpc.js file in the container's gadget
> hosting page. But when my gadget calls gadgets.window.setTitle, no alert
> pops up.
>
> What else might I be missing? Are there some other files that my
> container needs to have? Some setting in Shindig that I need to
> change or some other functions I need to write?
>
> My iframe urls do have a parent param set. I saw an old wiki article
> that said: "You must make sure that gadgets.rpc.setRelayUrl is called
> for every app". But, I couldn't find this method call anywhere in
> Partuza, so is this still true?
>
> (using PHP Shindig btw)
>
> Laura
>