Adding colums to the default user schema

Hello community, I'm trying to add more fields to the user creation form. I've been following the tutorial at Where it shows how to override the default user schema. I followed suit and added my custom user schema as well as the references contribution as shown. I also modified the edit user layout to add my custom fields (they are simple nuxeo-inputs with the new user fields as values).

However whenever I create or edit an user, those fields are never persisted; looking at the database those fields/columns are also missing. I checked the server logs as well and found that the schema manager actually marks my custom schema as registered.

Is there another configuration that s missing? I'd appreciate any help

0 votes

1 answers




Here is what has to be done to update the user profile.

Studio side

  1. use the XSD file (for example my_custom_user.xsd) from the user schema (see documentation above) as a basis and keep the namespace, etc.

  2. add the fields you want

  3. head over to CONFIGURATION / Resources / Schemas

  4. import the XSD file

  5. go to CONFIGURATION / Advanced Settings / XML Extensions

  6. add the following configuration:

    <extension point="schema" target="org.nuxeo.ecm.core.schema.TypeService">
    <!-- override default user schema -->
    <schema name="user" override="true" src="data/schemas/my_custom_user.xsd"/>
  7. to double-check those steps were effective, you can go check into your database that the fields are indeed present in the users table after synching your project server-side and restarting Nuxeo.

Web UI side

After checking the code, you will need to:

  1. override the nuxeo-edit-user.html element by writing a custom element:
    adding the field(s) you just added to the schema
  2. override the nuxeo-create-user element
    so that it uses the custom element based on nuxeo-edit-user
  3. override the nuxeo-user-group-management element
    so that it uses the custom element based on nuxeo-create-user
  4. override the nuxeo-user-group-management-page
    so that it uses the custom element based on nuxeo-user-group-management
  5. then you will be able to override the ADMINISTRATION_PAGES slot in nuxeo–custom-bundle.html
    so that it uses your overriden version of the nuxeo-user-group-management-page element.
    (in Studio you can find it in Designer / RESOURCES / UI)
    For reference the original slot definition is defined here:
1 votes

a c
Thank you so much for your answer. I thought I could just override directories the same way schemas are overriden, with a override=&quot;true&quot; property in the directory definition but that wasn't the case. In the end I had everything as you described, but the error was in the directory references. The only way it worked was by defining a customUserDirectory and updating the references in the groupDirectory!