Re: Localized mount points for BookmarkablePages?

2011-09-16 Thread Jorge Gallardo
Hi people,

What is the best way to achieve this with Wicket 1.5? Still using the same
approach?

Thanks!
JG

On Thu, Dec 23, 2010 at 7:50 AM, Bas Gooren b...@iswd.nl wrote:

 I think in wicket 1.4.x this is only possible with a custom mount point; In
 other words:

 Override/implement a version of bookmarkable page handling which takes into
 accoun the locale.
 Have a look at BookmarkablePageRequestTargetU**rlCodingStrategy. You could
 implement this class, overriding it's matches() method to match the mount
 path and the locale. For encoding and decoding you should be able to use the
 bookmarkable parts available in wicket.

 PageWithLocaleUrlCodingStrateg**y extends 
 BookmarkablePageRequestTargetU**rlCodingStrategy
 {
   Locale locale;

   // constructors of BPRTUCS with added Locale param

   matches( IRequestTarget target ) {
   return super.matches(target)  getSession().getLocale().**
 equals(this.locale);
   }
 }

 You can then mount like this (in application.init):
 mount( new PageWithLocaleUrlCodingStrateg**y( General, new
 Locale(en,US), MainPage.class ) );
 etc

 Hope this helps!

 Bas

 - Original Message - From: Thomas Götz t...@richmountain.de
 To: users@wicket.apache.org
 Sent: Thursday, December 23, 2010 2:36 PM
 Subject: Re: Localized mount points for BookmarkablePages?



  Ok, thanks for that hint. But: if I mount the page using the method you
 described, which mount name will be taken when referencing the page via a
 BookmarkablePageLink? What I want to achieve is that if the current
 user/session is set to locale GERMAN e.g., then all BookmarkablePageLinks
 should be rendered with the german mount name, got my point?

 Cheers,
  -Tom


  - Ursprüngliche Nachricht -
 Von: Hans Lesmeister
 Gesendet: 23.12.10 13:05 Uhr
 An: users@wicket.apache.org
 Betreff: Re: Localized mount points for BookmarkablePages?

 Hi, you van pass a list with alternates to the mount-annotation. Same
 can be done on mounting programmatically.

 Regards Hans



 Am 23.12.2010 um 12:29 schrieb Thomas Götz t...@richmountain.de:

  Hi,
 
  is it possible to have localized mount points for BookmarkablePages?
 
  Example:
  I have a BookmarkablePage GeneralPage.java which should be available
  under
  http://my.domain.com/General and
  http://my.domain.com/Allgemein (german)
 
  ... depending on the current locale. Is this possible? If yes, could
  someone
  point me into the right direction?
 
  Cheers,
  -Tom
 
 
 
  --**--**
 -
  To unsubscribe, e-mail: 
  users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 

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



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




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




-- 
Jorge Gallardo

jorgeagalla...@gmail.com


Re: Localized mount points for BookmarkablePages?

2011-09-16 Thread Igor Vaynberg
there is an example of this in the new wicket-examples under request
mapper examples.

-igor

On Fri, Sep 16, 2011 at 11:41 AM, Jorge Gallardo
jorgeagalla...@gmail.com wrote:
 Hi people,

 What is the best way to achieve this with Wicket 1.5? Still using the same
 approach?

 Thanks!
 JG

 On Thu, Dec 23, 2010 at 7:50 AM, Bas Gooren b...@iswd.nl wrote:

 I think in wicket 1.4.x this is only possible with a custom mount point; In
 other words:

 Override/implement a version of bookmarkable page handling which takes into
 accoun the locale.
 Have a look at BookmarkablePageRequestTargetU**rlCodingStrategy. You could
 implement this class, overriding it's matches() method to match the mount
 path and the locale. For encoding and decoding you should be able to use the
 bookmarkable parts available in wicket.

 PageWithLocaleUrlCodingStrateg**y extends 
 BookmarkablePageRequestTargetU**rlCodingStrategy
 {
   Locale locale;

   // constructors of BPRTUCS with added Locale param

   matches( IRequestTarget target ) {
       return super.matches(target)  getSession().getLocale().**
 equals(this.locale);
   }
 }

 You can then mount like this (in application.init):
 mount( new PageWithLocaleUrlCodingStrateg**y( General, new
 Locale(en,US), MainPage.class ) );
 etc

 Hope this helps!

 Bas

 - Original Message - From: Thomas Götz t...@richmountain.de
 To: users@wicket.apache.org
 Sent: Thursday, December 23, 2010 2:36 PM
 Subject: Re: Localized mount points for BookmarkablePages?



  Ok, thanks for that hint. But: if I mount the page using the method you
 described, which mount name will be taken when referencing the page via a
 BookmarkablePageLink? What I want to achieve is that if the current
 user/session is set to locale GERMAN e.g., then all BookmarkablePageLinks
 should be rendered with the german mount name, got my point?

 Cheers,
  -Tom


  - Ursprüngliche Nachricht -
 Von: Hans Lesmeister
 Gesendet: 23.12.10 13:05 Uhr
 An: users@wicket.apache.org
 Betreff: Re: Localized mount points for BookmarkablePages?

 Hi, you van pass a list with alternates to the mount-annotation. Same
 can be done on mounting programmatically.

 Regards Hans



 Am 23.12.2010 um 12:29 schrieb Thomas Götz t...@richmountain.de:

  Hi,
 
  is it possible to have localized mount points for BookmarkablePages?
 
  Example:
  I have a BookmarkablePage GeneralPage.java which should be available
  under
  http://my.domain.com/General and
  http://my.domain.com/Allgemein (german)
 
  ... depending on the current locale. Is this possible? If yes, could
  someone
  point me into the right direction?
 
  Cheers,
  -Tom
 
 
 
  --**--**
 -
  To unsubscribe, e-mail: 
  users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 

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



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




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




 --
 Jorge Gallardo
 
 jorgeagalla...@gmail.com


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



Localized mount points for BookmarkablePages?

2010-12-23 Thread Thomas Götz
Hi,

is it possible to have localized mount points for BookmarkablePages?

Example:
I have a BookmarkablePage GeneralPage.java which should be available under
http://my.domain.com/General  and
http://my.domain.com/Allgemein (german)

... depending on the current locale. Is this possible? If yes, could someone
point me into the right direction?

Cheers,
   -Tom



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



Re: Localized mount points for BookmarkablePages?

2010-12-23 Thread Hans Lesmeister
Hi, you van pass a list with alternates to the mount-annotation. Same  
can be done on mounting programmatically.


Regards Hans



Am 23.12.2010 um 12:29 schrieb Thomas Götz t...@richmountain.de:


Hi,

is it possible to have localized mount points for BookmarkablePages?

Example:
I have a BookmarkablePage GeneralPage.java which should be available  
under

http://my.domain.com/General  and
http://my.domain.com/Allgemein (german)

... depending on the current locale. Is this possible? If yes, could  
someone

point me into the right direction?

Cheers,
  -Tom



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



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



Re: Localized mount points for BookmarkablePages?

2010-12-23 Thread Thomas Götz
Ok, thanks for that hint. But: if I mount the page using the method you 
described, which mount name will be taken when referencing the page via a 
BookmarkablePageLink? What I want to achieve is that if the current 
user/session is set to locale GERMAN e.g., then all BookmarkablePageLinks 
should be rendered with the german mount name, got my point?

Cheers,
   -Tom


 - Ursprüngliche Nachricht -
 Von: Hans Lesmeister
 Gesendet: 23.12.10 13:05 Uhr
 An: users@wicket.apache.org
 Betreff: Re: Localized mount points for BookmarkablePages?
 
 Hi, you van pass a list with alternates to the mount-annotation. Same 
 can be done on mounting programmatically.
 
 Regards Hans
 
 
 
 Am 23.12.2010 um 12:29 schrieb Thomas Götz t...@richmountain.de:
 
  Hi,
 
  is it possible to have localized mount points for BookmarkablePages?
 
  Example:
  I have a BookmarkablePage GeneralPage.java which should be available 
  under
  http://my.domain.com/General and
  http://my.domain.com/Allgemein (german)
 
  ... depending on the current locale. Is this possible? If yes, could 
  someone
  point me into the right direction?
 
  Cheers,
  -Tom
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


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



Re: Localized mount points for BookmarkablePages?

2010-12-23 Thread Bas Gooren
I think in wicket 1.4.x this is only possible with a custom mount point; In 
other words:


Override/implement a version of bookmarkable page handling which takes into 
accoun the locale.
Have a look at BookmarkablePageRequestTargetUrlCodingStrategy. You could 
implement this class, overriding it's matches() method to match the mount 
path and the locale. For encoding and decoding you should be able to use the 
bookmarkable parts available in wicket.


PageWithLocaleUrlCodingStrategy extends 
BookmarkablePageRequestTargetUrlCodingStrategy {

   Locale locale;

   // constructors of BPRTUCS with added Locale param

   matches( IRequestTarget target ) {
   return super.matches(target)  
getSession().getLocale().equals(this.locale);

   }
}

You can then mount like this (in application.init):
mount( new PageWithLocaleUrlCodingStrategy( General, new 
Locale(en,US), MainPage.class ) );

etc

Hope this helps!

Bas

- Original Message - 
From: Thomas Götz t...@richmountain.de

To: users@wicket.apache.org
Sent: Thursday, December 23, 2010 2:36 PM
Subject: Re: Localized mount points for BookmarkablePages?


Ok, thanks for that hint. But: if I mount the page using the method you 
described, which mount name will be taken when referencing the page via a 
BookmarkablePageLink? What I want to achieve is that if the current 
user/session is set to locale GERMAN e.g., then all 
BookmarkablePageLinks should be rendered with the german mount name, got 
my point?


Cheers,
 -Tom



- Ursprüngliche Nachricht -
Von: Hans Lesmeister
Gesendet: 23.12.10 13:05 Uhr
An: users@wicket.apache.org
Betreff: Re: Localized mount points for BookmarkablePages?

Hi, you van pass a list with alternates to the mount-annotation. Same
can be done on mounting programmatically.

Regards Hans



Am 23.12.2010 um 12:29 schrieb Thomas Götz t...@richmountain.de:

 Hi,

 is it possible to have localized mount points for BookmarkablePages?

 Example:
 I have a BookmarkablePage GeneralPage.java which should be available
 under
 http://my.domain.com/General and
 http://my.domain.com/Allgemein (german)

 ... depending on the current locale. Is this possible? If yes, could
 someone
 point me into the right direction?

 Cheers,
 -Tom



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


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



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





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