In my application, each business view is associated to one Nxtheme page. I have a generic fragment (used in different business view) that need to know the business view...

Thanks for the answer...

Benjamin JALON

Jean-Marc Orliaguet a écrit :
Benjamin JALON wrote:
Hi all,

Is there a way to get from the context (or else) in a backing bean the name of the theme applied to the current web page (default/default, default/dashboard, ...) ?


Benjamin JALON...


you should use the negotiator:


import org.nuxeo.theme.jsf.negotiation.JSFNegotiator
import org.nuxeo.theme.Manager;

....
String strategy = "default";
// the 'default' strategy is defined in org.nuxeo.theme.jsf/OSGI-INF/nxthemes-jsf-contrib.xml // the nuxeo5 app uses a 'nuxeo5' negotiation strategy, it tells the order in which to look for a theme name (cookie, param, session,..)

String spec = new JSFNegotiator(strategy, facesContext).getSpec();
URL url = new URL(spec);

ThemeManager themeManager = Manager.getThemeManager();
Element theme = themeManager.getThemeByUrl(url);
....

the theme name is then:

theme.getName()


there is no backing bean currently, it is easy to add one to org.nuxeo.theme.jsf however, but the question is why do you need that info?

/JM

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to