|
Re: How to change themes per-user? [message #1112149 is a reply to message #1111598] |
Thu, 19 September 2013 07:23 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
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 |
David Keegan 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 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
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/
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07480 seconds