You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Jasha Joachimsthal <j....@onehippo.com> on 2011/06/29 13:33:28 UTC

Usage or example of preloadTokens

Hi,

if there anyone who has a (working) example of preloadTokens in
osapi.container.ContainerConfig (container/container.js)? I guess that's
what I need if I want to pass my own security tokens but without
documentation or a test case it's hard to find out how it is expected to
work.

Jasha Joachimsthal

Europe - Amsterdam - Oosteinde 11, 1017 WT Amsterdam - +31(0)20 522 4466
US - Boston - 1 Broadway, Cambridge, MA 02142 - +1 877 414 4776 (toll free)

www.onehippo.com

Re: Usage or example of preloadTokens

Posted by Michael Hermanto <mh...@gmail.com>.
On Wed, Jul 6, 2011 at 11:38 AM, Jasha Joachimsthal <
j.joachimsthal@onehippo.com> wrote:

> Hi Michael,
>
> On 6 July 2011 20:03, Michael Hermanto <mh...@google.com> wrote:
>
> > Sorry for the delay. Had a long 4-day weekend.
>
>
> ah yes, it was a long weekend in the US :)
>
>
> >
> > preloadTokens (and preloadMetadatas) work similarly. In basic, it
> provides
> > hooks when common container is instantiated to inline a map of gadget
> URLs
> > to tokens (and metadatas), to warm-up the internal cache, to avoid XHR
> > request when a gadget is navigated to. To use, as an example (roughly):
> >
> > var container = new osapi.container.Container({
> >    preloadMetadatas: { ... },
> >    preloadTokens: { ... },
> >    ...
> > });
> >
> > This is injected by the server-side, through templating engine of your
> > choice.
> > Look at preloadFromConfig_ impl to see how this is consumed.
> >
> >
> yes I figured out already when to call the preloadTokens or preloadMetadata
> but I'm looking for a (working) example of the {...} part. Do you happen to
> have samples of that?
>
> No, but you can obtain an example of this by break-pointing on gadget
navigation, and see the returned XHR response, for an example map.


>  Jasha
>
>
> >
> > On Mon, Jul 4, 2011 at 9:29 AM, Jasha Joachimsthal <
> > j.joachimsthal@onehippo.com> wrote:
> >
> >> Could you please give me more information, Mike?
> >>
> >> Jasha
> >>
> >>
> >> On 1 July 2011 03:07, Ryan J Baxter <rj...@us.ibm.com> wrote:
> >> > Mike should be able to give more information on this since he wrote
> the
> >> > common container.
> >> >
> >> > -Ryan
> >> >
> >> > Email: rjbaxter@us.ibm.com
> >> > Phone: 978-899-3041
> >> > developerWorks Profile
> >> >
> >> >
> >> >
> >> > From:   Jasha Joachimsthal <j....@onehippo.com>
> >> > To:     dev@shindig.apache.org,
> >> > Date:   06/29/2011 07:34 AM
> >> > Subject:        Usage or example of preloadTokens
> >> >
> >> >
> >> >
> >> > Hi,
> >> >
> >> > if there anyone who has a (working) example of preloadTokens in
> >> > osapi.container.ContainerConfig (container/container.js)? I guess
> that's
> >> > what I need if I want to pass my own security tokens but without
> >> > documentation or a test case it's hard to find out how it is expected
> to
> >> > work.
> >> >
> >> > Jasha Joachimsthal
> >> >
> >> > Europe - Amsterdam - Oosteinde 11, 1017 WT Amsterdam - +31(0)20 522
> >> 4466
> >> > US - Boston - 1 Broadway, Cambridge, MA 02142 - +1 877 414 4776 (toll
> >> > free)
> >> >
> >> > www.onehippo.com
> >> >
> >> >
> >> >
> >> >
> >>
> >
> >
>

Re: Usage or example of preloadTokens

Posted by Jasha Joachimsthal <j....@onehippo.com>.
Hi Michael,

On 6 July 2011 20:03, Michael Hermanto <mh...@google.com> wrote:

> Sorry for the delay. Had a long 4-day weekend.


ah yes, it was a long weekend in the US :)


>
> preloadTokens (and preloadMetadatas) work similarly. In basic, it provides
> hooks when common container is instantiated to inline a map of gadget URLs
> to tokens (and metadatas), to warm-up the internal cache, to avoid XHR
> request when a gadget is navigated to. To use, as an example (roughly):
>
> var container = new osapi.container.Container({
>    preloadMetadatas: { ... },
>    preloadTokens: { ... },
>    ...
> });
>
> This is injected by the server-side, through templating engine of your
> choice.
> Look at preloadFromConfig_ impl to see how this is consumed.
>
>
yes I figured out already when to call the preloadTokens or preloadMetadata
but I'm looking for a (working) example of the {...} part. Do you happen to
have samples of that?

Jasha


>
> On Mon, Jul 4, 2011 at 9:29 AM, Jasha Joachimsthal <
> j.joachimsthal@onehippo.com> wrote:
>
>> Could you please give me more information, Mike?
>>
>> Jasha
>>
>>
>> On 1 July 2011 03:07, Ryan J Baxter <rj...@us.ibm.com> wrote:
>> > Mike should be able to give more information on this since he wrote the
>> > common container.
>> >
>> > -Ryan
>> >
>> > Email: rjbaxter@us.ibm.com
>> > Phone: 978-899-3041
>> > developerWorks Profile
>> >
>> >
>> >
>> > From:   Jasha Joachimsthal <j....@onehippo.com>
>> > To:     dev@shindig.apache.org,
>> > Date:   06/29/2011 07:34 AM
>> > Subject:        Usage or example of preloadTokens
>> >
>> >
>> >
>> > Hi,
>> >
>> > if there anyone who has a (working) example of preloadTokens in
>> > osapi.container.ContainerConfig (container/container.js)? I guess that's
>> > what I need if I want to pass my own security tokens but without
>> > documentation or a test case it's hard to find out how it is expected to
>> > work.
>> >
>> > Jasha Joachimsthal
>> >
>> > Europe - Amsterdam - Oosteinde 11, 1017 WT Amsterdam - +31(0)20 522
>> 4466
>> > US - Boston - 1 Broadway, Cambridge, MA 02142 - +1 877 414 4776 (toll
>> > free)
>> >
>> > www.onehippo.com
>> >
>> >
>> >
>> >
>>
>
>

Re: Usage or example of preloadTokens

Posted by Michael Hermanto <mh...@google.com>.
Sorry for the delay. Had a long 4-day weekend.

preloadTokens (and preloadMetadatas) work similarly. In basic, it provides
hooks when common container is instantiated to inline a map of gadget URLs
to tokens (and metadatas), to warm-up the internal cache, to avoid XHR
request when a gadget is navigated to. To use, as an example (roughly):

var container = new osapi.container.Container({
   preloadMetadatas: { ... },
   preloadTokens: { ... },
   ...
});

This is injected by the server-side, through templating engine of your
choice.
Look at preloadFromConfig_ impl to see how this is consumed.

On Mon, Jul 4, 2011 at 9:29 AM, Jasha Joachimsthal <
j.joachimsthal@onehippo.com> wrote:

> Could you please give me more information, Mike?
>
> Jasha
>
>
> On 1 July 2011 03:07, Ryan J Baxter <rj...@us.ibm.com> wrote:
> > Mike should be able to give more information on this since he wrote the
> > common container.
> >
> > -Ryan
> >
> > Email: rjbaxter@us.ibm.com
> > Phone: 978-899-3041
> > developerWorks Profile
> >
> >
> >
> > From:   Jasha Joachimsthal <j....@onehippo.com>
> > To:     dev@shindig.apache.org,
> > Date:   06/29/2011 07:34 AM
> > Subject:        Usage or example of preloadTokens
> >
> >
> >
> > Hi,
> >
> > if there anyone who has a (working) example of preloadTokens in
> > osapi.container.ContainerConfig (container/container.js)? I guess that's
> > what I need if I want to pass my own security tokens but without
> > documentation or a test case it's hard to find out how it is expected to
> > work.
> >
> > Jasha Joachimsthal
> >
> > Europe - Amsterdam - Oosteinde 11, 1017 WT Amsterdam - +31(0)20 522 4466
> > US - Boston - 1 Broadway, Cambridge, MA 02142 - +1 877 414 4776 (toll
> > free)
> >
> > www.onehippo.com
> >
> >
> >
> >
>

Re: Usage or example of preloadTokens

Posted by Jasha Joachimsthal <j....@onehippo.com>.
Could you please give me more information, Mike?

Jasha


On 1 July 2011 03:07, Ryan J Baxter <rj...@us.ibm.com> wrote:
> Mike should be able to give more information on this since he wrote the
> common container.
>
> -Ryan
>
> Email: rjbaxter@us.ibm.com
> Phone: 978-899-3041
> developerWorks Profile
>
>
>
> From:   Jasha Joachimsthal <j....@onehippo.com>
> To:     dev@shindig.apache.org,
> Date:   06/29/2011 07:34 AM
> Subject:        Usage or example of preloadTokens
>
>
>
> Hi,
>
> if there anyone who has a (working) example of preloadTokens in
> osapi.container.ContainerConfig (container/container.js)? I guess that's
> what I need if I want to pass my own security tokens but without
> documentation or a test case it's hard to find out how it is expected to
> work.
>
> Jasha Joachimsthal
>
> Europe - Amsterdam - Oosteinde 11, 1017 WT Amsterdam - +31(0)20 522 4466
> US - Boston - 1 Broadway, Cambridge, MA 02142 - +1 877 414 4776 (toll
> free)
>
> www.onehippo.com
>
>
>
>

Re: Usage or example of preloadTokens

Posted by Ryan J Baxter <rj...@us.ibm.com>.
Mike should be able to give more information on this since he wrote the 
common container.

-Ryan

Email: rjbaxter@us.ibm.com
Phone: 978-899-3041
developerWorks Profile



From:   Jasha Joachimsthal <j....@onehippo.com>
To:     dev@shindig.apache.org, 
Date:   06/29/2011 07:34 AM
Subject:        Usage or example of preloadTokens



Hi,

if there anyone who has a (working) example of preloadTokens in
osapi.container.ContainerConfig (container/container.js)? I guess that's
what I need if I want to pass my own security tokens but without
documentation or a test case it's hard to find out how it is expected to
work.

Jasha Joachimsthal

Europe - Amsterdam - Oosteinde 11, 1017 WT Amsterdam - +31(0)20 522 4466
US - Boston - 1 Broadway, Cambridge, MA 02142 - +1 877 414 4776 (toll 
free)

www.onehippo.com