Overview
Datalink JSON files define the connection between Alfresco content model aspects and external REST API data sources. Each JSON file represents a single datalink configuration.File Structure
Datalink JSON files must be valid JSON documents with the following top-level structure:Schema Reference
Root Properties
Unique identifier for the datalink. Used internally and must be unique across all datalink configurations.Example:
"employee", "departments"Human-readable display name shown in the Alfresco Share UI.Example:
"Company Employee", "Company Departments"Optional description of the datalink’s purpose and usage.Example:
"Example to datalink demo"Fully qualified name of the Alfresco content model aspect that this datalink binds to. Must match an aspect defined in your content model XML.Format:
prefix:localNameExample: "dlnk:employee", "dlnk:departm"The property within the aspect where the linked entity’s primary key value will be stored.Example:
"dlnk:employee", "dlnk:departm"Display order for multiple datalinks on the same document. Lower numbers appear first.Default:
0Example: 10, 20Configuration object for the REST API connector. See REST Connector Configuration below.
Array of column definitions that map REST API response fields to displayable columns. See Column Configuration below.
REST Connector Configuration
TheconnectorRest object defines how to connect to the external REST API:
Full URL of the REST API endpoint for searching entities. This endpoint should accept a search query parameter and return a JSON array of results.Example:
"http://localhost:3005/api/v1/public/employees/search"The URL query parameter name used to send the user’s search text.Default:
"query"Example: If searchParam is "query", searches become: ?query=JohnAuthentication configuration for the REST API. See REST Connectors for detailed authentication options.
Column Configuration
Thecolumns array defines which fields from the REST API response should be displayed and how:
The field name from the REST API JSON response. Must exactly match the property name in the API response.Example:
"emp_no", "first_name", "dept_no"Human-readable column header displayed in the Alfresco Share UI.Example:
"Id", "First Name", "Hire Date"Data type of the column. Affects formatting and display.Options:
"text"- Plain text (default)"date"- Date/time values (requiresformatproperty)"number"- Numeric values"boolean"- True/false values
"text", "date"Indicates whether this column contains the unique identifier for the entity. Exactly one column must have
primaryKey: true.Example: true for "emp_no", false for other columnsIf
true, the column value is stored but not displayed in the UI. Typically used for primary key fields.Example: true for ID columns, false for display columnsDate format pattern for
type: "date" columns. Uses Java SimpleDateFormat syntax.Example: "dd/MM/yyyy", "yyyy-MM-dd'T'HH:mm:ss"Common patterns:dd/MM/yyyy- 25/12/2023MM-dd-yyyy- 12-25-2023yyyy-MM-dd- 2023-12-25
Validation Rules
Required Fields
The following fields are mandatory:nametitleaspectNameaspectPropertyNameconnectorRest.urlcolumns(must contain at least one column)
Primary Key Requirements
Exactly one column must have
primaryKey: true. This column’s value is stored in the aspect property and used to maintain the link between the document and external entity.Aspect Name Validation
TheaspectName must:
- Match an aspect defined in a deployed Alfresco content model
- Follow the format
prefix:localName - Use a registered namespace prefix
Column Name Restrictions
Column names must:- Match exactly with REST API response field names (case-sensitive)
- Not contain spaces or special characters (except underscore)
- Be unique within the columns array
API Response Format
The REST API endpoint must return a JSON array of objects. Each object should contain properties matching the column names defined in your datalink configuration.Expected API Response Format
Expected API Response Format
Complete Configuration Example
Here’s a complete datalink configuration with all available options:Best Practices
Use Descriptive Names
Choose clear, meaningful names for datalinks that reflect the business entity type
Hide Primary Keys
Set
hidden: true for technical ID columns that users don’t need to seeSet Display Order
Use the
order property to control how multiple datalinks appear on documentsValidate JSON
Use a JSON validator before deployment to catch syntax errors early
Troubleshooting
Datalink not appearing in Share UI
Datalink not appearing in Share UI
Search returns no results
Search returns no results
Possible causes:
- REST API endpoint is unreachable
- Authentication credentials are incorrect
- Column names don’t match API response fields
- API returns data in unexpected format
Date columns display incorrectly
Date columns display incorrectly
Possible causes:
- Missing
formatproperty for date columns - Format pattern doesn’t match API date format
Next Steps
Content Models
Learn how to define Alfresco aspects for your datalinks
REST Connectors
Configure authentication and advanced REST API options
