Nuxeo IDE addon deployment

When trying to customize the Footer of Nuxeo by following the blogpost from Laurent Doguin everything works as expected, when starting Nuxeo directly out of Eclipse.

BUT: When exporting the addon to a jar, putting it in the plugins Folder and starting via commandline, my changes to the footer aren't deployed, while other customizations in the same addon (custom doctype) are getting deployed and are working ok.

What am i missing for the deployment of changes to xhtml fragments?

Max.

0 votes

1 answers

853 views

ANSWER

Max
I seem not to be able to override template fragments, when deploying via maven:

What i am trying is to use my own nuxeo-footer-template.xhtml. (Note: the "-" chars are "_" chars in the actual filename).

  • When deploying via IDE, i see my changes in /…./nuxeo-cap-5.6-tomcat/nxserver/nuxeo.war/incl/nuxeo-footer-template.xhtml: All well and ok and working.
  • When deploying via commandline (maven), i get two files with the same name (nuxeo-footer-template.xhtml) in the folder /…./nuxeo-cap-5.6-tomcat/nxserver/nuxeo.war/incl/
  • The first one is the original nuxeo one, the second one is my customized one. No luck in seeing my customizations in the Clientview.

I even tried a "require all" in my deployment-fragment.xml, to circumvent ordering problems but no luck:

<?xml version="1.0"?> <fragment version="1">

&lt;require&gt;all&lt;/require&gt;
&lt;install&gt;
    &lt;!-- unzip the war template --&gt;
    &lt;unzip from=&quot;${bundle.fileName}&quot; to=&quot;/&quot; prefix=&quot;web&quot;&gt;
        &lt;include&gt;web/nuxeo.war/**&lt;/include&gt;
    &lt;/unzip&gt;
&lt;/install&gt;

</fragment>

Is this a known BUG, or what's going on here? I am using the official Nuxeo 5.6 Mac/Tomcat Version.

11/27/2012



Hi,

That could be an ordering issue due to the plugins folder. Try to put your into the bundles folder.

Also, how did you export the addon to a JAR ? I guess there's an issue if using the Eclipse default export option instead of the Nuxeo IDE export.

0 votes



Max
The jar was exported from the IDE Project Explorer/Project: right mouse click -> Nuxeo -> export JAR.

it works now, when i use: <require>all</require> (works in bundles and plugins, i tried both).

when using <require>org.nuxeo.theme.nuxeo.default</require> it doesn't work (neither in bundles nor in plugins).

AND: when trying the same (working when exported from IDE) deployment-fragment with the commandline maven project (started from the empty bundle tutorial) it simply doesn't work.

I can live with that, although it's confusing….

Max

11/28/2012

The fragment preprocessing is done at bootstrap before the nuxeo runtime being started for building the WAR. As you're contributing WAR resources, you're setting the requirement at the right place.

Can you explain which use case is not working ? I didn't get it. Thanks.

11/29/2012

Max
Scenario:

1) generate empty project via maven, like shown here: http://doc.nuxeo.com/display/NXDOC56/How-to+create+an+empty+bundle

2) add deployment-fragment.xml:

<pre> <?xml version="1.0"?> <fragment version="1">

&lt;require&gt;all&lt;/require&gt;
&lt;install&gt;
    &lt;!-- unzip the war template --&gt;
    &lt;unzip from=&quot;${bundle.fileName}&quot; to=&quot;/&quot; prefix=&quot;web&quot;&gt;
        &lt;include&gt;web/nuxeo.war/**&lt;/include&gt;
    &lt;/unzip&gt;
&lt;/install&gt;

</fragment> </pre>

3) add customized nuxeo_footer_template.xhtml to resources/web/nuxeo.war/incl Folder

4) mvn clean install -> generate jar

5) copy jar to server plugins folder (or bundles) Folder

6) restart nuxeo

7) customized nuxeo_footer_template doesn't get deployed correctly, the changes aren't visible.

I thought, this should work, like it's working, when i do the same custmization out of Nuxeo IDE?

11/29/2012

Thanks for the well explained use case.
11/29/2012