Developer Jahia 8.2

In a definitions file, how to define a long property with a minimum value constraint

Question

In a definitions file (CND file), how do I define a long property with a minimum value constraint?

Can you give me also an example with a range constraint?

Answer

The information to create a new content type can be found in this documentation.

More detailed information about the Compact Namespace and Node Type Definition (CND) can be found in the Apache Jackrabbit documentation.

When modifying a definition, please also follow carefully the advice provided in this documentation: 

  1. Modifying existing content definitions
  2. Migrating and modifying nodetypes

If you want to set up a range or a minimum value constraint, you'll have to set up a custom validator. An example can be found there.