Skip to main content

Fields

Schema fields

FieldTypeRequired?Description
triggersObjectYesThe source groups you want this schema to trigger on. A source group should contain one or more source entity types (array).

You can add as many source groups and source entity types as you wish.
propertiesObjectYesThe properties you want your schema to consist of. See properties types for supported types.
routeObjectNoDefines if you want this schema to be retrievable by a route. A route is not specifically an URL, but it can be.

The route property contains 2 different properties: url or handles.
actionsArrayNoActions is used when a new view has been generated from a schema. It defines which specific actions to take following the newly generated view. Currently, Enterspeed supports triggering the process of another schema.

The Array takes an object with the properties:
type (e.g. process)
alias (Alias of the schema to process)
originId (Optional. id of source to trigger)
source (Optional. Alias of destination source group)
sourceEntityTypesArray-DEPRECATED

The types of source entities you want this schema to trigger on.

Examples

Route

Routing by URL

If you want your schema to be routable by an URL, you can specify the url as an expression. Like the example below:

{
"triggers": {
"umbraco": ["frontPage"]
},
"route": {
"url": "{url}"
},
"properties": {}
}

You are not limited to using the built-in url property, you can also use properties defined by your source entity:

{
"triggers": {
"umbraco": ["frontPage"]
},
"route": {
"url": "{p.customFrontPageUrl}"
},
"properties": {}
}

The URL must be a valid URL: either relative /about-us or absolute https://enterspeed.com/about-us.

info

If you use relative URL's you must add a wildcard hostname, see more in Setting up domains

Routing by handles

If you don't want your schema to be routable by an URL but rather something more static, you can use a handle.

The handles is an array, so you can specify multiple handles per schema.

{
"triggers": {
"umbraco": ["frontPage"]
},
"route": {
"handles": ["front-page"]
},
"properties": {}
}

The handle supports expressions as described for url:

{
"triggers": {
"umbraco": ["frontPage"]
},
"route": {
"handles": ["front-page-{p.culture}"]
},
"properties": {}
}

Actions

To give an example, you can use actions when you want to update a list in a new view that you have generated from other schemas.

For example, having a product and category source entity type. When you ingest a product, the list of products should be updated in the generated category view and include the changes. Consider the following examples where the ingest of product will both generate a new view for the product and trigger the process of the category schema to generate a new category view including the updated product:

tip

If you want to trigger actions across schemas, you must specify the source. The value of source is the alias of the destination source group.

Schema with origin id
{
// This example will process a category schema where the category
// id == category id of the data source. Schema is
// processed in the source group "umbraco".

"triggers": {
"umbraco": ["product"]
},
"actions": [
{
"type": "process",
"alias": "category",
"originId": "{p.categoryId}"
}
],
"properties": {
"name": "{p.name}"
}
}
Schema with source and without originId.
{
// This example will process the category schema in the "myCustomSourceGroup" source group.
// This is due to the source property.

"triggers": {
"umbraco": ["product"]
},
"actions": [
{
"type": "process",
"source": "myCustomSourceGroup",
"alias": "category"
}
],
"properties": {
"name": "{p.name}"
}
}
Schema without source and originId
{
// This example will process the category schema in the source group "umbraco".
"triggers": {
"umbraco": ["product"]
},
"actions": [
{
"type": "process",
"alias": "category"
}
],
"properties": {
"name": "{p.name}"
}
}

The schema that we are processing in the above examples.

Schema alias category -
{
"triggers": {
"umbraco": ["category"]
},
"route": {
"url": "/categories/{p.slug}"
},
"properties": {
"title": "{p.name}",
"description": "{p.description}",
"products": {
"type": "array",
"input": {
"$lookup": {
"filter": "type eq 'product' and properties.categoryId eq '{originId}'"
}
},
"var": "product",
"items": {
"type": "object",
"properties": {
"headline": "{product.p.name}"
}
}
}
}
}