On Sat, Jul 10, 2010 at 7:23 PM, Michael Young <[email protected]>wrote:

> For some reason my first reply was rejected by the moderator at
> dev-ow...@shindig... Here it is again:
>
> Thanks for the reply, John. I will use the interim solution, for now.
>
> I noticed that SERVER_PORT is injected into the JsonContainerConfig and
> replaced via EL expression, is this what you're proposing for the host as
> well? I'm not sure if JsonContainerConfig has access to the gadget context,
> however. I would be happy to attempt to patch this if no one is working on
> this already.
>

That's what I was hoping to be possible, but you're right that
JsonContainerConfig lacks the proper context (unless it were turned into
some kind of global I suppose).

In several installations of Shindig of which I'm aware, including our own,
we have a separate @Inject'ed layer that maintains request state. I've
considered porting that in generic fashion to Shindig, but don't have the
bandwidth at the moment. It might also be overbuilt for this exact use case,
though is useful in other contexts.


>
> I also noticed that the older config values used by the former URLGenerator
> are still present in the default container.js. Are there plans to
> eventually
> remove those? I found it a bit confusing as we've been upgrading from 1.1
> BETA 5 as it's not clear which values are used and which are deprecated
>

Yes. They were kept in for backward compatibility reasons when the two
coexisted, but now that 2.0 has UriManager only, we'll get rid of the old
ones.

--j


>
> On Fri, Jul 9, 2010 at 5:17 PM, John Hjelmstad <[email protected]> wrote:
>
> > %host% is a regression to some degree... though is useful, and is in need
> > of
> > a replacement. Given 2.0 is a breaking API release, it was removed.
> > Rationale is that its logic was being sprinkled throughout the code, with
> > the substitution coming from gadget.getContext().getHost(). IMO better
> > would
> > be to have a more general injected context object that, for instance,
> > ContainerConfig would use.
> >
> > To support it in the interim, you can subclass DefaultJsUriManager and
> > perform the replacement:
> > Uri uri = super.makeExternJsUri();
> > if (uri.toString().contains("%host%")) {
> >  uri = new UriBuilder(uri.replaceAll("%host%",
> > gadget.getContext().getHost())).toUri();
> > }
> > return uri;
> >
> > %js% was replaced with a better-structured host/path based config
> > mechanism.
> > Let me know if there's a use case its removal breaks.
> >
> > --j
> >
> > On Fri, Jul 9, 2010 at 4:29 PM, Michael Young <[email protected]
> > >wrote:
> >
> > > DefaultURLGenerator used to substitute these tokens. Is this a
> > regresssion,
> > > or is there an alternative way to specify values for host and js at
> > runtime?
> > >
> > >
> > >
> > > - Mike
> > > --
> > > Liferay West Coast Symposium
> > > September 8-9, 2010
> > > Anaheim, CA
> > > www.liferay.com/wcs
> > > --
> > > Follow us on Twitter: liferay
> > >
> > >
> >
>
>
>
> --
> - Mike
>

Reply via email to