Creating a Studio layout and calling it correctly in the IDE - adding a tab to the document


Thanks to the help provided at by @bjalon, I was able to move ahead and create a layout in Nuxeo Studio.

This layout is to display as an additional tab “Send to Client” when the document is in certain lifecycle state “approved”.

The layout is a form containing multiple choice questions with options and some text inputs.

From the “approved” state the document lifecycle has been modified so that it can either return back to “project” by additional editing OR move ahead to be submitted to client and attain the lifecycle state “client”.

To move from the “approved” to the “client” state, the only route is to navigate to the tab “Send to Client”, fill the form and submit. In case the form is submitted without errors, the document state becomes “Client” and the tab goes away. This change of state including the filling up of the form in the layout is captured in history AND the date entered in the form also needs to be stored.

I was able to create a sample layout form, identifier TAB_CLIENT, using Studio but faced these issues

  1. No option for Radio buttons in the widgets

  2. List item3.

  3. No option for submit button in the widgets

  4. Having to create Vocabularies for “selectOneDirectory” widget used since the radio buttons were not available.

I downloaded the files, included the files relevant to the newly created layout within an empty project in Nuxeo Eclipse IDE and defined the contributions in extensions.xml within “OSGI-INF”.

I created a new xhtml file called mytabs.xhtml as suggested by bjalon in the link above. Now I am faced with the dilemma of how to call my layout in this file?

Considering that these files were relevant to the layout that I created

  1. TAB_CLIENT.layout.xml in “.metadata” folder

  2. TSegment.voc.xml, Relevance.voc.xml, Comprehensiv.voc.xml -> in “.metadata” -> vocabulary files used

  3. TSegment.csv, Relevance.csv, Comprehensiv.csv in “\data\vocabularies”

  4. Multiple widget files in “\web\nuxeo.war\widgets” that were used in the layout

In the “\web\nuxeo.war\layouts” folder, there are 3 few layout files



xyz_layout_template.xhtml - a layout file with the name of my project in studio.

In addition there were other files and schema that are packaged by default when downloading from Studio but not relevant to this requirement.

The package download from studio, in its extension.xml has references to the TAB_CLIENT@create, TAB_CLIENT@edit and TAB_CLIENT@view layouts under

It also references as below within each layout

    <template mode="any">/layouts/xyz_layout_template.xhtml</template>

With the above I have been able to add the necessary tab to the document view. I have even been able to add a user action “Send to Client”, visible in “approved” state, as a shortcut to click and automatically switch to the tab.

However when I click the tab, it gives and UNEXPECTED ERROR “javax.servlet.ServletException” with NULL.

In this scenario, my questions are

  1. How to correctly call the layout to the mytabs.xhtml as suggested in the URL above? Or do I need to call it into mytabs.xhtml at all?
  2. How to create a better layout using Studio? My form requires multiple/ Single choice questions and also needs to be arranged with tables etc.
  3. Is this the correct way to store data of the completed form as well as the history?

Apologies for the long description to put the scenario in perspective. My need is quite urgent now so any immediate help will be very welcome and appreciated.

@bjalon, I have created a new question as suggested. Any help would be wonderful as always :-)

Many thanks

0 votes

1 answers



Update: I modified the content of my mytabs.xhtml file as such

<div xmlns="" xmlns:ui="" xmlns:h="" xmlns:f="" xmlns:c="" xmlns:nxh="" xmlns:nxu="" xmlns:nxl="">

<h:form enctype="multipart/form-data" id="document_edit"> <script>

jQuery(document).ready(function() {


<nxl:documentLayout mode="create" value="TAB_CLIENT" />

</h:form> </div>

basing in the document.edit.xhtml

I now get the error

Cannot convert TAB_CLIENT of type class java.lang.String to interface org.nuxeo.ecm.core.api.DocumentModel


Hi, The nxl:documentLayout waits for a document model as value, see documentation at

0 votes

Anahide Tchertchian, your comment did point me to the correct direction. I modified my code as below

<nxl:layout name="TAB_CLIENT@edit" mode="edit" value="#{TAB_CLIENT}" />

The tab now loads correctly and works almost exactly as I wanted.

thank you very much.