Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to change themes per-user?
How to change themes per-user? [message #1111598] Wed, 18 September 2013 12:42 Go to next message
David Keegan is currently offline David KeeganFriend
Messages: 2
Registered: September 2013
Junior Member
Is it possible to serve two different themes to two users within one RAP/RWT application instance?

A use case would be to display different logo/title/colors to users based on their organization in a multi-branded cloud web app.
Re: How to change themes per-user? [message #1112149 is a reply to message #1111598] Thu, 19 September 2013 07:23 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1853
Registered: July 2009
Senior Member
Hi David,
branding (theming) is attached to the entrypoint (servlet path). You
could register two entry points (same class) with different themes:
.....
Map<String, String> properties = new HashMap<String, String>();
properties.put( WebClient.THEME_ID, "foo" );
application.addEntryPoint( "/foo", MyEntry.class, properties );
properties = new HashMap<String, String>();
properties.put( WebClient.THEME_ID, "bar" );
application.addEntryPoint( "/bar", MyEntry.class, properties );
application.addStyleSheet( "foo", "theme/foo.css" );
application.addStyleSheet( "bar", "theme/bar.css" );
......
HTH,
Ivan

On 9/18/2013 8:33 PM, David Keegan wrote:
> Is it possible to serve two different themes to two users within one
> RAP/RWT application instance?
>
> A use case would be to display different logo/title/colors to users
> based on their organization in a multi-branded cloud web app.

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to change themes per-user? [message #1112194 is a reply to message #1112149] Thu, 19 September 2013 08:32 Go to previous messageGo to next message
David Keegan is currently offline David KeeganFriend
Messages: 2
Registered: September 2013
Junior Member
Thanks, Ivan. This allows to reuse the same entry point class with different paths and themes. This will force me, however, to a) add extra path level to all URLs and b) create new path for every new group of users with custom theme.

Searching more forums, I've found class
org.eclipse.rap.rwt.internal.theme.ThemeUtil
with method
setCurrentThemeId(UISession uiSession, String themeId)
- a per-session theme setting! The signature is just what I need, but unfortunately it did not work (I was setting theme and called relayout of main shell in button selection handler). Ultimately, I'd like to set a theme for user after he logs in without adding extra paths, if possible.

I've also found some mentions that switching theme in runtime was not possible in 1.2 (2008-2009), could it possibly change?
Re: How to change themes per-user? [message #1112215 is a reply to message #1112194] Thu, 19 September 2013 09:01 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1853
Registered: July 2009
Senior Member
Hi David,
switching theme in runtime is still not possible and it's not in our
plan to impplement for RAP 2.2-2.3. Using different servlet paths is the
only way to go.
Best,
Ivan

On 9/19/2013 11:32 AM, David Keegan wrote:
> Thanks, Ivan. This allows to reuse the same entry point class with
> different paths and themes. This will force me, however, to a) add
> extra path level to all URLs and b) create new path for every new
> group of users with custom theme.
>
> Searching more forums, I've found class
> org.eclipse.rap.rwt.internal.theme.ThemeUtil with method
> setCurrentThemeId(UISession uiSession, String themeId) - a per-session
> theme setting! The signature is just what I need, but unfortunately it
> did not work (I was setting theme and called relayout of main shell in
> button selection handler). Ultimately, I'd like to set a theme for
> user after he logs in without adding extra paths, if possible.
>
> I've also found some mentions that switching theme in runtime was not
> possible in 1.2 (2008-2009), could it possibly change?

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to change themes per-user? [message #1129001 is a reply to message #1112215] Tue, 08 October 2013 07:40 Go to previous messageGo to next message
Sebastien Arod is currently offline Sebastien ArodFriend
Messages: 34
Registered: July 2009
Member
Hi,


We also have a similar need. In our case the application administrator is the one choosing the theme and the theme has to be applied to all users connecting to the platform.

In this case having an URL per theme is no really acceptable.

I wasn't able to find an enhancement request/bug talking about this should I create one?
Re: How to change themes per-user? [message #1129059 is a reply to message #1129001] Tue, 08 October 2013 08:43 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1853
Registered: July 2009
Senior Member
Hi Sebastien,
yes... Please open an enhancement request.
Thanks,
Ivan

On 10/8/2013 10:40 AM, Sebastien Arod wrote:
> Hi,
>
>
> We also have a similar need. In our case the application administrator
> is the one choosing the theme and the theme has to be applied to all
> users connecting to the platform.
> In this case having an URL per theme is no really acceptable.
> I wasn't able to find an enhancement request/bug talking about this
> should I create one?

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to change themes per-user? [message #1131140 is a reply to message #1129059] Thu, 10 October 2013 08:28 Go to previous message
Sebastien Arod is currently offline Sebastien ArodFriend
Messages: 34
Registered: July 2009
Member
Hi Ivan,

I created ER 419098 [Theming] Support changing theme without changing url

Regards,
-Seb

[Updated on: Thu, 10 October 2013 08:29]

Report message to a moderator

Previous Topic:RAP 2.1 War is not working
Next Topic:Tomcat + RAP
Goto Forum:
  


Current Time: Sun Nov 23 02:15:24 GMT 2014

Powered by FUDForum. Page generated in 0.01660 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software