Platform Explorer / Nuxeo Platform LTS 2015 7.10

Extension point negotiations

The negotations extension point allows to define a list of Java classes that will compute the current page or current flavor to use, depending on the context.

Example:

    <negotiation target="jsfFlavor">
        <negotiator
            class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestParameter" order="10">
            <property name="param">flavor</property>
        </negotiator>
        <negotiator
            class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestAttribute" order="20">
            <property name="param">flavor</property>
        </negotiator>
        <negotiator class="org.nuxeo.ecm.localconf.LocalThemeFlavor" order="30">
            <property name="negotiatedPageVariable">jsfPage</property>
        </negotiator>
        <negotiator
            class="org.nuxeo.ecm.web.resources.jsf.negotiators.DefaultPageFlavor" order="100">
            <property name="negotiatedPageVariable">jsfPage</property>
        </negotiator>
    </negotiation>

Negotiator classes must implement the org.nuxeo.theme.styling.negotiation.Negotiator interface. The abstract class org.nuxeo.theme.styling.negotiation.AbstractNegotiator can be extended to benefit from generic implementation.

The context used in negotiator API can depend on the caller. In JSF default pages, this context will be the current JSF FacesContext.

@since 7.4

Contribution Descriptor

Existing Contributions

  • nuxeo-platform-webapp-core-7.10-HF07.jar /OSGI-INF/theme-contrib.xml
    <extension point="negotiations" target="org.nuxeo.theme.styling.service">
    
        <negotiation target="jsfDefaultPage">
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.DefaultPage" order="100">
            <property name="jsfDefaultPage">galaxy/default</property>
          </negotiator>
        </negotiation>
    
        <negotiation target="jsfPage">
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestParameter" order="10">
            <property name="param">page</property>
          </negotiator>
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestAttribute" order="10">
            <property name="param">page</property>
          </negotiator>
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.DefaultPage" order="100">
            <property name="jsfPage">galaxy/default</property>
          </negotiator>
        </negotiation>
    
        <negotiation target="jsfFlavor">
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestParameter" order="10">
            <property name="param">flavor</property>
          </negotiator>
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestAttribute" order="20">
            <property name="param">flavor</property>
          </negotiator>
          <negotiator class="org.nuxeo.ecm.localconf.LocalThemeFlavor" order="30">
            <property name="negotiatedPageVariable">jsfPage</property>
          </negotiator>
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.DefaultPageFlavor" order="100">
            <property name="negotiatedPageVariable">jsfPage</property>
          </negotiator>
        </negotiation>
    
      </extension>
  • nuxeo-theme-migration-7.10.jar /OSGI-INF/theme-compat-framework.xml
    <extension point="negotiations" target="org.nuxeo.theme.styling.service">
        <negotiation target="jsfThemeCompatTemplate">
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.DefaultPage" order="100">
            <property name="jsfThemeCompatTemplate">/pages/workspace_page.xhtml</property>
          </negotiator>
        </negotiation>
      </extension>