Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-9965

CSS resources not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Not A Bug
    • Affects Version/s: 5.6
    • Fix Version/s: 5.7.2
    • Component/s: None
    • Environment:
      Windows XP, Eclipse Juno, Nuxeo nuxeo-cap-5.6-RC3-tomcat-sdk

      Description

      I have created an extension point in order to define new CSS and JS resources:

      lto-theme-contrib.xml:

      {norformat}
      <component name="org.lto.core.theme.contrib">

      <extension target="org.nuxeo.theme.services.ThemeService" point="resources">

      <resource name="diff.css">
      <path>css/diff.css</path>
      </resource>

      <resource name="wz_tooltip.js">
      <path>script/tooltip/wz_tooltip.js</path>
      </resource>

      <resource name="tip_balloon.js">
      <path>script/tooltip/tip_balloon.js</path>
      </resource>

      <resource name="dojo.js">
      <path>script/dojo/dojo.js</path>
      </resource>

      <resource name="diff.js">
      <path>script/diff.js</path>
      </resource>

      </extension>

      </component>{norformat}

      And I have added it to the Manifest:

      Manifest-Version: 1.0
      Bundle-Vendor: Nuxeo
      Bundle-ActivationPolicy: lazy
      Bundle-ClassPath: .
      Bundle-Version: 1.0.qualifier
      Bundle-Name: nuxeo-lto-core
      Bundle-ManifestVersion: 2
      Nuxeo-Component: OSGI-INF/lto-page-provider-contrib.xml,OSGI-INF/exten
       sions/org.nuxeo.lto.core.document.api.FrontEndService.xml,OSGI-INF/ex
       tensions/org.nuxeo.lto.core.document.Adapaters.xml,OSGI-INF/extension
       s/org.nuxeo.lto.core.document.api.BackEndService.xml,OSGI-INF/extensi
       ons/org.nuxeo.lto.core.document.operations.CreateNewProduction.xml,OS
       GI-INF/extensions/org.nuxeo.lto.core.document.operations.CreateNewPro
       ductionFromExistingByRef.xml,OSGI-INF/extensions/org.nuxeo.lto.core.d
       ocument.operations.CreateNewProductionFromExistingByValue.xml,OSGI-IN
       F/extensions/org.nuxeo.lto.core.document.operations.GetSourceProducti
       on.xml,OSGI-INF/extensions/org.nuxeo.lto.core.document.api.BackEndRel
       ationService.xml,OSGI-INF/lto-relation-doctype-contrib.xml,OSGI-INF/e
       xtensions/org.nuxeo.lto.core.document.operations.CreateMillesimeFromE
       xisting.xml,OSGI-INF/extensions/org.nuxeo.lto.core.document.operation
       s.PublishMillesime.xml,OSGI-INF/extensions/org.nuxeo.lto.core.documen
       t.backend.RelationManagerListener.xml,OSGI-INF/extensions/org.nuxeo.l
       to.core.document.controller.XxeJnlpBean.xml,OSGI-INF/extensions/org.n
       uxeo.lto.core.document.backend.listener.ProductionCreationModificatio
       nListener.xml,OSGI-INF/extensions/org.nuxeo.lto.core.document.diff.Pr
       oductionDiffAdapter.xml,OSGI-INF/lto-diff-display-contrib.xml,OSGI-IN
       F/extensions/org.nuxeo.lto.jsf.ProductionDiffBean.xml,OSGI-INF/lto-th
       eme-contrib.xml
      Bundle-SymbolicName: nuxeo-lto-core
      Bundle-RequiredExecutionEnvironment: JavaSE-1.6
      

      Then I have used the resource in my template:
      in comparison.xhtml:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <nxthemes:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:c="http://java.sun.com/jstl/core"
        xmlns:nxthemes="http://nuxeo.org/nxthemes"
        xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
        xmlns:nxd="http://nuxeo.org/nxweb/document"
        xmlns:nxl="http://nuxeo.org/nxforms/layout"
        xmlns:nxu="http://nuxeo.org/nxweb/util"
        xmlns:nxh="http://nuxeo.org/nxweb/html">
      
        <nxthemes:require resource="diff.css" />
      <!--   <nxthemes:require resource="wz_tooltip.js" /> -->
      <!--   <nxthemes:require resource="tip_balloon.js" /> -->
      <!--   <nxthemes:require resource="dojo.js" /> -->
      <!--   <nxthemes:require resource="diff.js" /> -->
        
        <ui:define name="page title">
          <h:outputText
            value="#{nuxeoApplicationName} - #{nxd:titleOrId(currentDocument)}" />
        </ui:define>
      
        <ui:define name="bookmark">
          <link rel="bookmark"
            href="#{navigationContext.currentDocumentFullUrl}" />
        </ui:define>
      
        <ui:define name="body">
          <div>
          <div class="globalActions">
         	  <ui:include src="/incl/document_actions_upperbuttons.xhtml"/>
         	</div>
          <ui:include src="/incl/document_action_tabs.xhtml"/>
      	
          Liste des différences
        
          <h:form>
            <nxh:commandButton value="Imprimer" action="#{productionDiff.doPrint()}" styleClass="button"/>
          </h:form>  
      	
          <h:outputText value="#{productionDiff.delta}" escape="false"/>
      	
            <div class="tabsContent">
              <ui:include src="/incl/tabs/org.nuxeo.lto.jsf.ProductionDiffBean-tab.xhtml" />
            </div>
      
          </div>
        </ui:define>
        </nxthemes:composition>
      

      But this is not working. There is no css associated with the page where as the file exists in src/main/resources/web/nuxeo.war/css/diff.css and if I include it in the XHTML file:

      <link href="css/diff.css" type="text/css" rel="stylesheet"></link>
      

      the style is found and applied to the correct tags.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.