When I originally dealt with this, I contributed an override to the
BaseURLSource.  That was the easy part.  It was the assets that threw
me.  With the private bits removed, here's what I did:

        public void contributeServiceOverride(@Symbol("XXXX.production-server")
final boolean productionServer, MappedConfiguration<Class,Object>
configuration, @Local AssetPathConstructor
assetPathContstructorOverride ) {
                BaseURLSource source = new BaseURLSource() {
                        public String getBaseURL(boolean secure) {
                                String server = null;
                                int securePort = 0;
                                int normalPort = 0;
                                if (productionServer){
                                        server = "server.somewhere.com";
                                        securePort = 443;
                                        normalPort = 80;
                                }
                                else{
                                        server = "test.server.com";
                                        securePort = 8443;
                                        normalPort = 8080;
                                }
                                String protocol = secure ? "https" : "http";
                                int port = secure ? securePort : normalPort;
                                
                                return String.format("%s://%s:%d", protocol, 
server, port);
                        }
                };

                configuration
                                .add( BaseURLSource.class, source);
                
        
        // no longer required: configuration.add(AssetPathConstructor.class,
assetPathContstructorOverride);
                
                

        }




On Tue, Oct 30, 2012 at 2:20 PM, jellevangompel
<jellevangom...@gmail.com> wrote:
> Hi Jonathan,
>
> This seems to work partially.
>
> - This only works for asset files, but not for links. Do you know if there's
> a similar constant for urls?
> - There is a problem with the context of the asset link generated: my T5 app
> is deployed as the the root context, however the facebook app has an
> additional path /myapp/.
>      => a solution could be to deploy my application not as the root
> context, but as the "myapp" context. However do you know if there's a way to
> add the additional path in the rendered url?
>
>
> Regards,
> Jelle
>
>
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Tapestry-URLs-inside-iFrame-Facebook-canvas-tp5717408p5717433.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>



-- 
Jonathan Barker
ITStrategic

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to