Its possible add new fields when create a new document?


I'm Java Developer, but I have a question, It's possible add new field when a user create a new document,? without nuxeo studio?

Thanks a lot

0 votes

2 answers



Thanks a lot for your response. I'd like to add a new field (list type) with database information, for example, a contract type…

Thank u for your help

0 votes

Hi Zetta,

Please be mindful of the separation between comments and answers. It's helpful to keep things organized. You can edit your answer, moving it to comments, effectively.




Hi Yousuf

Thank you



Many configurations and customizations are possible without Nuxeo Studio. However, as it may be more enjoyable for the overzealous developer, it's definitely the more difficult route and requires a good understanding of the many extension points Nuxeo provides exactly for this purpose. Does that make sense?

There are a lot of steps necessary to do this. In general, you will need to:

  1. create a new schema with your field definition,
  2. override the default document type schema by simply adding your new schema to the list,
  3. add your new schema to your nuxeo project,
  4. create a new widget to hold the new field,
  5. add you new widget to your document's content view,
  6. package it all up in a Nuxeo compliant marketplace package, and
  7. deploy to your Nuxeo Platform instance.

For example, in order to add a new field to an existing Document Type's schema, you will need to:

1) Create your new schema (my-new-doc-schema.xsd) with the desired field, for example:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="" xmlns:nxs="" xmlns:nxsv="" xmlns:ref="" targetNamespace="">  
  <!-- helper XSD definitions for list types -->  
  <xs:complexType name="content"> 
      <xs:element name="encoding" type="xs:string"/>  
      <xs:element name="mime-type" type="xs:string"/>  
      <xs:element name="data" type="xs:base64Binary"/>  
      <xs:element name="name" type="xs:string"/>  
      <xs:element name="length" type="xs:long"/>  
      <xs:element name="digest" type="xs:string"/> 
  <xs:simpleType name="stringList"> 
    <xs:list itemType="xs:string"/> 
  <xs:simpleType name="doubleList"> 
    <xs:list itemType="xs:double"/> 
  <xs:simpleType name="dateList"> 
    <xs:list itemType="xs:date"/> 
  <xs:simpleType name="integerList"> 
    <xs:list itemType="xs:integer"/> 
  <xs:simpleType name="booleanList"> 
    <xs:list itemType="xs:boolean"/> 
  <xs:complexType name="blobList"> 
      <xs:element name="item" type="nxs:content" minOccurs="0" maxOccurs="unbounded"/> 

  <!--References my custom companies vocabulary that was created, again, through extensions-->  
  <xs:element name="company">
      <xs:restriction base="xs:string" ref:resolver="directoryResolver" ref:directory="companies"/>


2) Override the default schema of that document type (in this case Picture) through extension points, by adding for example:

<extension point="doctype" target="org.nuxeo.ecm.core.schema.TypeService">

    <facet name="Picture">
      <schema name="file"/>
      <schema name="picture"/>
      <schema name="image_metadata"/>

    <!-- deprecated since 7.1, here for compat -->
    <facet name="MultiviewPicture"/>

    <doctype extends="Document" name="Picture">
      <schema name="common"/>
      <schema name="uid"/>
      <schema name="dublincore"/>
      <!--Put your new schema here. Obviously you'd name it something better than this...-->
      <schema name="my-new-doc-schema"/>
      <facet name="Picture"/>
      <facet name="Versionable"/>
      <facet name="Publishable"/>
      <facet name="Commentable"/>
      <facet name="HasRelatedText"/>


Make sure, when packaging your project, to declare 'override' in your extension point contribution header. You can learn more about building a Nuxeo compliant marketplace package here:

You can view the available extension points for your Nuxeo Platform release, here:

Also, the Nuxeo Yeoman bootstrap generator may be of interest to you, found here:

Hopefully this is enough to get you started. If I were to provide you examples for each step, it would become more of a tutorial, and less of an answer. Am I right?

Of course, you can avoid all of this by registering your Nuxeo Platform with Nuxeo. Nuxeo Studio makes all of this 'easy-peezy-lemon-squeezy'.


0 votes