Skip to main content
Skip table of contents

1 - Entities and schemas

What are entities

HCMS consumes and modifies data stored in the censhare system and can perform read and write operations on censhare assets, e.g., search assets or create new ones.

However, there is no way to directly access assets as they are in censhare. This is solved through the basic concepts of HCMS: entities and schemas.

Entities are views to censhare assets. Entities have properties. Properties can represent:

  • Censhare asset feature

  • entire Censhare assets

  • storage files of Censhare assets

Therefore, one entity may represent only one asset, or, by including all or selected relationships of the asset, it may even represent the whole structures of assets. Each feature, relationship, and asset type can be represented in a different way. This allows to re-use the same content for various purposes.

Any modifications done on entities update censhare assets.

What are schemas

Each entity is represented as a JSON document called schema.

A schema describes what this entity actually is. It is sometimes called "entity type". Such JSON schemas define which properties and their types (string, number, object, array, etc.) are allowed in a given entity. You can say that schemas define how a censhare asset is translated into a JSON document, but this is not one-to-one translation. It is not necessary to include all properties and relationships from the corresponding censhare asset. On the other side, it is possible to represent the whole structures of assets in one entity by including also asset relationships in the entity that views to it.

Building custom data models

Therefore, Headless CMS allows you to define your own content API. The uniqueness of the HCMS design is that there is no standard API available, meaning, that there is no static data model either.

Where schemas are stored

Schemas are stored in the Censhare system.

All schemas are stored on one asset of the object type. It is created upon registering an HCMS instance automatically. If you want, you can also use an existing asset for this purpose by supplying it as an option to the CLI command for creating new HCMS configuration as explained here.

In either case, all output channels are added to this asset to make sure it is visible by the satellite. This ensures that the same asset can be shared between different configurations with different channels.

How to work with entities and schemas

You do not need to use a Censhare UI to acces or modify schemas. Schemas and their changes are deployed - i.e., synched to the Censhare system - through one of the HCMS REST endpoints

In the same way - through REST endpoints - you can manage entities with the difference that they won‘t be synched to the Censhare system. Instead, they are saved in the internal HCMS database.

Technical articles on schema basics

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.