Schema system


Define forms for management of structured content


To facilitate creation of structured content Content Studio, Enonic XP ships with a high-level schema concept that requires no coding.

Each schema will produce a deterministic set of properties with valid values and indexing rules. Content can be submitted through both via UI, and API.


First and foremost, schemas define forms that can be edited through an administrative interface, typically Content Studio.

In addition to the user interface, schemas also have a back-end equivalent that can be used programmatically, for instance through the content API.

All forms are essentially compositions of various Input types.

Once a form is populated and submitted, the end-result will be a property structure that matches 1-1 with the schema definition. The property structure can then be persisted directly into the XP repository.

Forms can be declared statically with XML, using a format that looks like this:

  <input name="firstname" type="TextLine">
    <label>First Name</label>
  <input name="lastname" type="TextLine">
    <label>Last Name</label>

There are many types of forms, each with their specific purpose and options. The form implementation will control where and how end result is actually persisted.

The persisted output form the above form might look something like this:

  firstname: "Tom",
  lastname: "Cat"

Form grouping

In addition to input types, one may use sets to group form items to construct more advanced forms, and hence richer data models.

Use form items like Field sets (decorative only), Item sets, and Option sets for this purpose.

XML Schema Definition (XSD)

To simplify editing, an XSD is available.

Addf the following attributes to the first element of your XML file in order to enjoy validation while typing:

Not all editors support XSD validation
XSD attributes



If added to a content type schema, it would look something like this:

Example when added to content type schema
<?xml version="1.0" encoding="utf-8"?>
  <display-name>Content type display name</display-name>