Hi,
I have built a quite large white-label  web app using Tapestry 5, and I am
aware of other white-label Tapestry-based sites.

I recommend following approach:

   - Encode partner information in URL for (nearly) all your pages, not
   only 'gateway' ones. I use 'http://example.com/PARTNER/PAGE....'.

   - If necessary, put some pages that are not partner-dependent in a
   separate package.

   - Write code that performs URL rewriting for both incoming and outgoing
   links. In Tapestry 5.1 you need to contribute 'URLRewriteRule'-s to
   URLRewriter service. URLRewriter works in T5.2 too, but it is deprecated,
   so in Tapestry 5.2 and 5.3 you need to decorate ComponentEventLinkEncoder.
   Remember to not-rewrite requests to '/assets/' and your special package (or
   packages).

   - Your code after rewriting URL, should store information about partner
   as 'Request' attribute. It is important to NOT store that in the  session,
   otherwise you would invite problems like e.g. loosing partner branding when
   the session expires.

   - Write a service that provides a nice interface for getting information
   about the current partner from the request.

   - If you feel especially adventurous and not afraid of Tapestry
   internals, you can even write an InjectionProvider
   and/or ComponentClassTransformWorker to automagically inject necessary data
   about partner into your pages and class. However, it is not recommended for
   beginners, and please do not overuse such mechanism, as it could make your
   code hard to understand for less Tapestry-proficient developers.



Best regards,
Cezary



On Wed, Dec 21, 2011 at 1:08 PM, captain_rhino <
graeme.kitc...@axa-travel-insurance.com> wrote:

> A little xmas cheer to all!
>
> I'm in the process of creating a white label site to handle insurance
> claims
> for different partners.
>
> I'm looking for a general steer on how to handle the urls.
>
> The web page flow is generic for all the different white label partners.
>
> Currently external sites use the following links to access my site
> www.mydomain.com/makeaclaim/whitelabelpartner1
> www.mydomain.com/makeaclaim/whitelabelpartner2
>
> for a white label partner entering our site I use a
> PageRenderLinkTransformer to then look at the that url and move them onto
> to
> the start of the journey and store where they came from in the session.
> i.e. move them from
> www.mydomain.com/makeaclaim/whitelabelpartner1
> to
> www.mydomain.com/makeaclaim/claimdetails
>
>
> My problem is if they bookmark the claimsdetails or any future page links I
> have no idea where they came from.  I have thought of passing a request
> parameter through the entire journey but that seems a bit clunky.
> Ideally i'd like to be to do the following
>
> www.mydomain.com/makeaclaim/whitelabelpartner1/claimdetails
> www.mydomain.com/makeaclaim/whitelabelpartner1/personaldetails
>
> www.mydomain.com/makeaclaim/whitelabelpartner2/claimdetails
> www.mydomain.com/makeaclaim/whitelabelpartner2/personaldetails
>
> where claim details is one single tapestry page  not placed in two separate
> packages as this needs to be configurable as new partners can be added all
> the time.
>
> Is some kind of url masking to page actions available in tapestry?
> i.e.
> www.mydomain.com/makeaclaim/*/claimdetails
>
> Any ideas/Suggestions welcome.
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/How-to-handle-urls-for-a-White-Label-site-tp5091687p5091687.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
>
>

Reply via email to