Maker guide
Fields, perspectives and relationships
Define the schema on the maker site.
The schema is the fields, the perspectives that group them, and the relationships between perspectives. The maker site has a page for each. Read Entities and perspectives first if the model is new to you.
Fields
Fields lists the field catalogue: each field's system name, type, display name and the perspectives that use it. The search box filters the list.
To add one, press New field… and enter its system name (the JSON key, such as creditLimit). Then choose:
- the type: Text, Integer, Decimal, Boolean, DateTime, Reference or Json. It can't change once saved.
- the display name, which forms and views show;
- an optional description.
Then Save. Display names and descriptions can be changed later.
Perspectives
Perspectives shows each perspective's id, its relationships, its display name and description, and its fields.
- Add fields from the catalogue.
- Tick the fields the perspective requires. Requiredness belongs to the perspective, so the same field can be required in one and optional in another.
- Remove fields. A field that a relationship uses can't be removed while the relationship exists.
- Drag fields into order, or use Alt+↑ and Alt+↓. The order is the one forms use for All fields.
New perspective… asks for the name. Press Save to send your changes.
Making a field required doesn't re-check the entities already stored. They'll fail validation the next time they're saved without it.
Relationships
Relationships lists the relationships between perspectives, with their kind and ends. New relationship… asks for the name. Then, for each end, choose:
- the perspective;
- the multiplicity, One or Many;
- for a Many end, the reference field, from that perspective's Reference fields.
Save defines it. The database checks the data already stored, and refuses the relationship (listing the problems) if any entity breaks it. Delete asks first; the data and the field's index are kept.
| You want | From | To |
|---|---|---|
| A customer's orders | Customer, One | Order, Many, field customer |
| A staff member's manager | Staff, Many, field manager | Staff, One |
| A badge for one staff member | Badge, One, field holder | Staff, One |
See Relationships for what the database enforces.
Other ways to change the schema
- occtl:
occtl schema field set,occtl schema perspective set,occtl schema relationship set. - OmniCore Admin: the Fields, Perspectives and Relationships tabs.
- A plugin's manifest, applied when the plugin is installed.
- The REST API.