[jboss-user] [JBoss Portal] - How to set the theme programatically
m.paranjape
do-not-reply at jboss.com
Wed Sep 24 02:44:15 EDT 2008
Hi All,
I need to display a user defined portlet on my portal page which will let the user select a theme from the dropdown and then the selected theme will be applied to the whole portal. Actually I am trying to set the default theme for portal. I am using the following code in my process action.
//Get the Theme Service from the portlet context. Theme service is injected and saved in the context at start up.
| ThemeService themeService = (ThemeService) context.getAttribute("ThemeService");
|
| //themeName is a string which is the actual name of the theme. Will be the one that the user selects from the dropdown.
| PortalTheme themeToSet = themeService.getTheme(themeName, false);
| themeService.setDefault(themeToSet.getThemeInfo().getRegistrationId());
The above code does not work and it does not set the default theme to the one I select from the dropdown. It does not throw any exception on the consone either. If I put a S.O.P after setting the default theme it still shows the earlier default name i.e anonymous wrote : renaissance .
I am missing something somewhere. Could anyone help as I need to get this done as soon as possible.
Any help is highly appreciated.
Thanks and Regards,
Milind Paranjape.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4178465#4178465
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4178465
More information about the jboss-user
mailing list