Guides

ContentGrid has 2 main web interfaces. One of them for managing applications, is called the Console. The web UI for using ContentGrid applications is called Navigator.

Console

The Console enables you to create projects, model blueprints and deploy applications.

Navigator is the out-of-the-box end user interface for every ContentGrid applications and allows you to create, search, consult and delete entities.

Subsections of Guides

Subsections of Console

Getting Started

This guide will walk you through the initial steps of setting up your organization, creating a project, and starting with data modeling in ContentGrid.

1. Create an Organization

Before you can create a data model, you need to have an organization.

  1. On the main page, click the Create Organization button.
  2. Follow the prompts to set up your organization.

If you already have an organization, you can skip this step.

2. Create a Project

Once your organization is set up:

  1. Navigate to your organization page.
  2. Click the Create Project button.

Screenshot showing the Create Project button on the organization page Screenshot showing the Create Project button on the organization page

  1. In the dialog, enter a name for your project and confirm.

Screenshot of the Create Project dialog where you enter the project name Screenshot of the Create Project dialog where you enter the project name

3. Start Data Modeling

Now you can begin modeling your data:

  1. Click the Add Entity button to start creating your first entity.

Screenshot showing the Add Entity button in the Data Model menu Screenshot showing the Add Entity button in the Data Model menu

  1. In the Data model tool, you can model your business entities. Click Add Entity, provide a name, and optionally a description. Providing a useful description is a good practice and can help some of the AI features in ContentGrid work better.

Screenshot of the Add Entity dialog Screenshot of the Add Entity dialog

  1. After creating your first entity, you can edit its name or delete it if needed.

Entities, Attributes, and Relations

Entities can have attributes and relationships to other entities.

Add an Attribute

  1. Within an entity, click Add Attribute.
  2. A dialog will appear with the following options:

Screenshot of the Add Attribute dialog Screenshot of the Add Attribute dialog

  • Property Name: A unique name within the entity.
  • Type: The data type for this attribute. Options include:
    • Text
    • Integer
    • Decimal
    • Boolean
    • Date
    • Content (binary object or file)
    • Audit Metadata (automatically managed subfields: createdBy, createdAt, modifiedBy, modifiedAt)
  1. After creating the attribute, you can edit it further:

Screenshot of the Edit Attribute page Screenshot of the Edit Attribute page

  • Name: Rename the attribute.
  • Description: Add a description to help users and AI agents.
  • Search Options:
    • Search values exactly: Values must match exactly when searching (useful for status, category, etc.).
    • Search values starting with given prefix: Values can be searched by prefix (case- and accent-insensitive; useful for names, titles, etc.).
  • Constraints:
    • Value is required: Attribute must have a value for the item to be created.
    • Must be unique: Attribute value must be unique across all items.
    • Set allowed values: Provide a list of allowed values; only these can be used.

Add a Relation

You can model relationships to other entities (or to the same entity):

  1. Click Add Relation.
  2. In the pop-up dialog, configure the following:

Screenshot of the Add Relation dialog Screenshot of the Add Relation dialog

  • From: The current entity.
  • To: The target entity for the relationship.
  • Name: Name of the relationship.
  • Description: (Optional) Description for the relationship.
  • Cardinality: Cardinality of the relationship (e.g., one-to-one, one-to-many). Choose the checkboxes that apply.
  • Relationship is required: Check if this relationship must always exist.

Permission Policies

Permission Policies

ContentGrid takes a different approach to permissions than legacy content management systems. Instead of making a complex hierarchical tree structure of permissions with inheritance, a set of permission policies describes access for each entity. These policies are rules that contain logical expressions, making use of (a combination of) entity attributes and user attributes.

How to create a Policy

First, go to the Permissions modeler:

Permissions Permissions

To create our first policy, we first have to choose the entity for which we are going to create a policy:

Select Entity Select Entity

When clicking the “Create Policy” button you will see the configuration options for creating a new policy:

Create Policy Create Policy

First, you’ll have to choose for which operation this policy will be evaluated. The options are: Read, Create, Update, Delete. You can choose one or more operations.

By choosing the visibility setting, you can define if this policy is applicable for authenticated users only, or for all users.

The “Additional conditions” section is where you define the conditions for this policy, access to the entity is granted when the conditions are fulfilled.

Multiple conditions can be applied, and each rule has a left and a right side, that are compared to each other. Both left and right sides of can be a “user attribute”, “entity attribute” or constant. The possible comparisons between the left and the right side are:

  • equals
  • not equals
  • greater than
  • greater or equals
  • less than
  • less than or equals
  • contains
  • in

You can add more conditions with the “Add Condition” button. All conditions have to be satisfied before a policy grants access. Save the policy with the “Add Policy” button.

Now, you should see your policy for this entity in the overview.

Policy Overview Policy Overview

Webhooks

Tutorial on webhooks

Webhooks are one way that ContentGrid applications can send automated messages or information to external systems. They are almost always faster than polling, and require less work on your end.

Each mutating operation on an resource is handled individually and is asynchronously, but almost immediately delivered to the configured webhook endpoint.

A ContentGrid Webhook

  • is always attached to a ContentGrid entity and selected change triggers
  • is delivered to a configured HTTP endpoint
  • is delivered as a HTTP POST message with a body payload and specific ContentGrid HTTP headers

Create New Webhook?

First, go to the Webhooks modeler:

Webhooks Webhooks

To create our first Webhook, we first have to click on Create Webhook:

Create Webhook Create Webhook

When clicking the “Create Webhook” button you will see the configuration options for creating a new Webhook:

Create Webhook Options Create Webhook Options

  • First, you will have to give a satisfying Webhook name (or description).
  • Then you have to choose for which entity this Webhook will be applied
  • After the entity selection, select the notifications triggers, where the options are
    • create (whenever the selected entity type is created)
    • update (when each existing entity is being updated)
    • content (when a document content has been changed)
    • delete (when the enetity selected has been deleted)
  • As a last step, you have to provide the Webhook URL to be invoked by your ContentGrid application

Webhooks sample Webhooks sample

After clicking save, the Webhook is saved and is listed in the overview but will only be available to your ContentGrid runtime application once you create a new release.

Webhooks listing Webhooks listing

You can add more Webhooks with the “Create Webhook” button.

Webhook endpoint

A Webhook endpoint has some specific constraints and must respect the following implementation details:

  • it has to support the HTTP POST method
  • should accept a JSON body and application/json Content-Type
  • can use our ContentGrid HTTP headers in order to validate that the delivered message is coming from our platform
    • User-Agent value is ContentGrid-Slingshot/APP_VERSION
    • ContentGrid-Application-Id contains the application id
    • ContentGrid-Deployment-Id contains the deployment id
    • ContentGrid-Signature provides a JWT signed by the our platform that should be used in order that the message is actually sent by the ContentGrid platform

Security and validation

ContentGrid signs JWTs using asymmetric encryption (RS256), and publishes the public signing keys in a JWKS (JSON Web Key Set).

The signing keys are rotated on a regular basis.

  • We discourage doing manual JWT validation since it might be easy to improperly implement and miss some important details that will lead to serious security vulnerabilities. Most JWT libraries take care of JWT validation for you.
  • We also highly recommend to use a JWK library for the programming language of your choice.

One of the benefits of JSON Web Token (JWT) is that you can validate a token using an easy cryptographic operation.

What are JWKs?

A JSON Web Key (JWK) is a JSON data structure that represents a cryptographic key. JWKs are a set of keys shared between different services and are used to verify the JWT token from the authorization server.

You should only be validating the received JWT against ContentGrid Json Web Key (JWK) URL which is ${CONTENTGRID_URL}/.well-known/jwks.json

We use JWKS to expose the public keys used by the ContentGrid platform to all the clients required to validate signatures.

For more information you can check the JWK RFC

The example of a JWKS is something that looks like this:

{
  "keys": [
    {
      "use": "sig",
      "kty": "RSA",
      "kid": "UVelusmvyM2xScEu0F_xSNlhelC5jZTD77R_3mmOZXs",
      "alg": "RS256",
      "n": "...yjXzcFpbMJB1fIFam9lQBeXWbTqzJwbuFbspHMsRowa8FaPw44l2C9Q42J3AdQD8CcN...",
      "e": "AQAB"
    },
    {
        ...
    }
  ]
}

In the above example some important fields are

  • e: is the exponent for a standard pem
  • n: is the moduluos for a standard pem
  • alg: the signing algorithm.
  • kid: a unique id for every key in the set.

ContentGrid’s JWT headers and claims:

{
  "kid": "UVelusmvyM2xScEu0F_xSNlhelC5jZTD77R_3mmOZXs",
  "alg": "RS256"
}.{
  "aud": "https://webhooks-demo.rtp-scw-sandbox.contentgrid.cloud/broker-process",
  "exp": 1679044765,
  "iat": 1679044465,
  "jti": "df475d5a-fc0e-4fca-a03a-c279e86fe9ed"
}.[Signature]
  • kid: is Identifier of the static key used to sign the JWT
  • alg: Algorithm used to sign the key
  • aud: Recipients that the JWT is intended for (the CG Application URL)
  • iat: The issuing time of the token in seconds
  • exp: The expiration time of the token in seconds
  • jti: Unique identifier of the token

Get the signing keys

Here is a Java exmaple of how to validate a JWT using JWKs with Nimbus JOSE + JWT

  • To validate the token, first, you need to get the JSON web key set from the JWKs endpoint. The token will be received as JSON in the validation endpoint in the body.
ResourceRetriever jwkSetRetriever = new DefaultResourceRetriever();
JWKSource<SecurityContext> jwkSource = new RemoteJWKSet<>(URI.create("${CONTENTGRID_URL}/.well-known/jwks.json").toURL(), jwkSetRetriever);
JWSKeySelector<SecurityContext> jwsKeySelector = JWSAlgorithmFamilyJWSKeySelector.fromJWKSource(jwkSource);
  • Additional validation for token claims
ConfigurableJWTProcessor<SecurityContext> jwtProcessor = new DefaultJWTProcessor<>();
jwtProcessor.setJWSKeySelector(jwsKeySelector);

jwtProcessor.setJWTClaimsSetVerifier((claims, context) -> {
	final Date now = new Date();			
	final Date exp = claims.getExpirationTime();
	if (exp != null) {
		if (now.after(exp)) {
			throw new BadJWTException("expired");
		}
	}
});	
  • and the JWT validation
SignedJWT signedJWT = SignedJWT.parse(THE_JWT);	
jwtProcessor.process(signedJWT, null);

This short guide provides the basic steps required to locally verify an access or ID token signed by ContentGrid. It uses packages from Nimbus JOSE + JWT for key parsing and token validation, but the general principles should apply to any JWT validation library.

Navigator

ContentGrid Navigator is the out-of-the box frontend for you ContentGrid application. The interface will adapt automatically to the entities and attributes you have configured.

Overview

An overview of the different UI elements of Navigator.

Create entity

Guide on how to create new entities with metadata and relations.

Subsections of Navigator

Navigator overview

Navigator overview Navigator overview

(1) Entity menu

The entity menu allows you to select an entity type for search and creation. The selected entity is highlighted.

(2) Search form

In the search form you can search on the searchable metadata of the entity and it’s related entities, as defined in the Console.

(3) Results table

The results table shows up after search and displays the search results as a table with metadata. Clicking one of the lines in the table will open the document preview.

(4) Create entity button

Clicking the create entity button will bring you to create form where you can fill in the metadata, files and link the relations for this entity.

(5) Document preview

The document preview will display a preview of the line selected in the results table. If there are multiple files attached to that entity, there will be a dropdown selector to choose what file you want to preview.

Info

The previewer can natively show PDF’s and images. For other documents, ContentGrid will attempt to transform the file to PDF. Currently, these formats are supported for previewing:

  • pdf
  • jpg, png
  • doc, docx, ppt, pptx, xls, xlsx
  • odt, ods, odp

Of course, other file formats can still be used in ContentGrid, but they don’t have out-of-the-box previews.

Creating entities

Create entity Create entity

(1) Create form

In the create form you can fill in the metadata fields of the entity you are creating. Mandatory fields are indicated with an asterisk. Datetime fields have a datetime picker. Content fields support drag and drop and opening a file picker.

(2) Relation field

If your entity has a relation to another relation, you will see that in the form. The link data button will bring you to the link relation popover where you can link the correct entities.

(3) Extract button

The extract button will open a pop-up to start an automated metadata extraction using AI based on the files you already uploaded in the form.

(4) Create/cancel buttons

These buttons allow you to submit or cancel the entity creation.

(5) Document preview

The document preview allows you to see the documents added next to the form. This can be practical when you need to read data from the document to fill in the form. The extract feature will also overlay information in the preview when used.

After clicking the link data button in the create form a popover will appear that will help you link related entities.

Add relation Add relation

(1) Search form

The search form in this popover functions similarly to the entity search form and searches on the linked entity.

(2) Result table

After pressing the “SEARCH” or “SHOW ALL” button, the results table shows the candidates for linking. Just click a line to link the entity. It is possible to link multiple entities if it is a “TO MANY” relationship.

(3) Create button

This button will open a new tab on the create form of the entity type you are trying to link. Use this when the entity you want to link does not yet exist.