Dynamic document types or live configuration of schemas and document types in Nuxeo
Every few years a client asks me about how to configure dynamic document types (or schemas) in Nuxeo. This is actually not a common requirement but it’s a fun little challenge to take and since we’ve implemented this before, I’m going to explain here a solution that could work for you as well.
Also, I want to explain to you why you might not need to have these dynamic document types even if you think you do 😀
I. The use case
The use case for this could be something like this:
As a business user I want to be able to go to the Admin center in Nuxeo and define new schemas and new document types. These should be immediately available to the rest of the users in Nuxeo and the users should be able to create documents using these user defined document types and schemas. Some clients refer to these as dynamic, or as flexible metadata but the end goal is the same: how can I define and make these available without restarting the server?
First of all, what are document types and schemas? (btw; everything here applies to facets as well, but for simplicity I’m going to just refer to the document types). And why are they not dynamic to begin with? As I’m writing this the most recent version of Nuxeo is LTS2021. So my blog post is referring to how the document types and schemas are currently defined and implemented up to the LTS2021 version. If you are reading this way past 2021, make sure to check Nuxeo as the feature might have been added into the platform.