Skip to main content

Overview

This guide will walk you through creating your first datalink and linking document properties to database values. We’ll use the included employee datalink example to demonstrate the workflow.
Before starting, ensure you have completed the installation steps and have all three components running.

Prerequisites Checklist

Verify all services are running:
1

Alfresco Repository

Check that Alfresco is accessible at http://localhost:8080/alfresco/Default credentials: admin / admin
2

Database Mock Server

Verify the mock database is running on port 3005:
curl http://localhost:3005
# Should return: Venzia employee db mockup
3

Alfresco Content App

Access ACA at http://localhost:4200 and log in with Alfresco credentials
The employee datalink is already configured in the system. Let’s verify it’s loaded:
curl http://localhost:8080/alfresco/s/venzia/datalink/v1/datalinks
You should see a JSON response with available datalinks:
[
  {
    "name": "employee",
    "title": "Company Employee",
    "aspectName": "dlnk:employee",
    "order": 10
  },
  {
    "name": "departments",
    "title": "Company Departments",
    "aspectName": "dlnk:departm",
    "order": 20
  }
]

Step 2: Upload a Test Document

In Alfresco Content App:
1

Navigate to a Folder

Go to Personal Files or any folder where you have write permissions
2

Upload a Document

Click the Upload button or drag and drop a fileAny file type works—try a PDF, Word document, or text file
3

Verify Upload

Confirm the document appears in the file list
Now let’s link the document to an employee record:
1

Open Datalink Editor

Right-click on the uploaded document and select Edit Datalink from the context menu
If you don’t see the “Edit Datalink” option, verify that the ACA extension is properly loaded and that you’re using the correct version of ACA.
2

Select Employee Datalink

In the datalink editor dialog:
  1. Choose Company Employee from the datalink type dropdown
  2. The form will load dynamically based on the datalink configuration
3

Search for an Employee

Start typing an employee name in the search field:
  • Try searching for “Adolfo”
  • The system queries the REST endpoint:
    http://localhost:3005/api/v1/public/employees/search?query=Adolfo
    
  • Results appear in a searchable list showing:
    • First Name
    • Last Name
    • Hire Date
4

Select and Save

  1. Click on an employee from the search results
  2. Review the selected employee information
  3. Click Save to apply the datalink to the document
The document now has the dlnk:employee aspect applied with the linked employee data

Step 4: Verify the Linked Data

Confirm that the datalink was applied successfully:
  1. Select the document in ACA
  2. Open the Info Drawer (click the info icon)
  3. Expand the Properties section
  4. Look for the Employee aspect properties
  5. You should see the linked employee ID stored in dlnk:employee
Now let’s try the department datalink, which uses basic authentication:
1

Right-Click the Same Document

Open the datalink editor again by right-clicking on your test document
2

Select Department Datalink

Choose Company Departments from the dropdown
3

Search Departments

Search for a department:
  • Try “Recursos” or “Marketing”
  • This endpoint uses basic authentication (configured in the datalink JSON)
  • Credentials: user2019 / g3n3r4l
4

Apply Department Link

Select a department and saveThe document now has both aspects:
  • dlnk:employee
  • dlnk:departm
A document can have multiple datalink aspects applied simultaneously, allowing you to link different types of data to the same document.

Test the Mock Database

Let’s understand what’s happening behind the scenes:

Employee Endpoint (Public)

# Get all employees
curl http://localhost:3005/api/v1/public/employees/search

# Search for specific employee
curl "http://localhost:3005/api/v1/public/employees/search?query=Ana"
[
  {
    "emp_no": 8,
    "first_name": "Ana",
    "last_name": "Cuesta",
    "hire_date": "2002-03-25T00:00:00.000Z"
  },
  {
    "emp_no": 3,
    "first_name": "Anastasia",
    "last_name": "Lopez",
    "hire_date": "1999-11-04T00:00:00.000Z"
  }
]

Department Endpoint (Authenticated)

# Get all departments (requires auth)
curl -u user2019:g3n3r4l \
  http://localhost:3005/api/v1/private/departments/search

# Search for specific department
curl -u user2019:g3n3r4l \
  "http://localhost:3005/api/v1/private/departments/search?query=Marketing"
[
  {
    "dept_no": 6,
    "dept_name": "Marketing"
  }
]
Now let’s create your own datalink configuration:
1

Create Configuration File

Create a new JSON file in the datalink configuration directory:
cd venzia-datalink/src/main/docker/datalink
Create datalink-project.json:
{
  "name": "project",
  "title": "Project Codes",
  "description": "Link documents to project codes",
  "aspectName": "dlnk:project",
  "aspectPropertyName": "dlnk:project",
  "order": 30,
  "connectorRest": {
    "url": "https://your-api.example.com/api/projects",
    "authentication": {
      "type": "basic",
      "username": "api_user",
      "password": "api_password"
    },
    "searchParam": "search"
  },
  "columns": [
    {
      "primaryKey": true,
      "name": "project_id",
      "label": "Project ID",
      "type": "text",
      "hidden": true
    },
    {
      "primaryKey": false,
      "name": "project_code",
      "label": "Code",
      "type": "text"
    },
    {
      "primaryKey": false,
      "name": "project_name",
      "label": "Project Name",
      "type": "text"
    },
    {
      "primaryKey": false,
      "name": "start_date",
      "label": "Start Date",
      "type": "date",
      "format": "dd/MM/yyyy"
    }
  ]
}
2

Add Content Model Aspect

Edit the content model to add the new aspect:Open venzia-datalink/src/main/resources/alfresco/module/aqua-datalink/model/datalink-model.xmlAdd the new aspect:
<aspect name="dlnk:project">
  <title>Project</title>
  <properties>
    <property name="dlnk:project">
      <type>d:text</type>
      <index enabled="true">
        <atomic>true</atomic>
        <stored>false</stored>
        <tokenised>false</tokenised>
      </index>
    </property>
  </properties>
</aspect>
3

Rebuild and Restart

Rebuild the backend module and restart Alfresco:
cd venzia-datalink
./run.sh reload_acs
This will:
  1. Rebuild the ACS module
  2. Recreate the ACS Docker image
  3. Restart the ACS container with the new configuration
4

Verify New Datalink

Check that the new datalink is available:
curl http://localhost:8080/alfresco/s/venzia/datalink/v1/datalinks
You should see your new “project” datalink in the list.

Configuration Options

Authentication Types

"authentication": {
  "type": "none"
}

Column Types

Text

{
  "name": "field_name",
  "label": "Display Label",
  "type": "text"
}

Date

{
  "name": "date_field",
  "label": "Date",
  "type": "date",
  "format": "dd/MM/yyyy"
}

Primary Key

{
  "primaryKey": true,
  "name": "id",
  "label": "ID",
  "type": "text",
  "hidden": true
}

Required Response Format

Your REST API endpoint must return an array of objects:
[
  {
    "field_name_1": "value1",
    "field_name_2": "value2",
    "date_field": "2024-01-15"
  },
  {
    "field_name_1": "value3",
    "field_name_2": "value4",
    "date_field": "2024-02-20"
  }
]
The field names in your API response must exactly match the name values in your datalink column definitions.

Common Use Cases

Scenario: Link employee documents (contracts, evaluations) to HR databaseConfiguration:
{
  "name": "employee",
  "aspectName": "dlnk:employee",
  "connectorRest": {
    "url": "https://hr-system.company.com/api/employees",
    "authentication": {"type": "basic", "username": "...", "password": "..."}
  },
  "columns": [
    {"name": "employee_id", "primaryKey": true, "hidden": true},
    {"name": "full_name", "label": "Employee Name"},
    {"name": "department", "label": "Department"},
    {"name": "position", "label": "Position"}
  ]
}
Scenario: Link customer documents to CRM systemConfiguration:
{
  "name": "customer",
  "aspectName": "dlnk:customer",
  "connectorRest": {
    "url": "https://crm.company.com/api/customers/search",
    "authentication": {"type": "basic", "username": "...", "password": "..."}
  },
  "columns": [
    {"name": "customer_id", "primaryKey": true, "hidden": true},
    {"name": "customer_name", "label": "Customer"},
    {"name": "account_number", "label": "Account #"},
    {"name": "contact_email", "label": "Email"}
  ]
}
Scenario: Link product specs and manuals to product databaseConfiguration:
{
  "name": "product",
  "aspectName": "dlnk:product",
  "connectorRest": {
    "url": "https://products.company.com/api/products",
    "authentication": {"type": "none"}
  },
  "columns": [
    {"name": "sku", "primaryKey": true, "label": "SKU"},
    {"name": "product_name", "label": "Product Name"},
    {"name": "category", "label": "Category"},
    {"name": "release_date", "type": "date", "label": "Release Date"}
  ]
}

Troubleshooting

Problem: Search returns no results or connection errorsSolutions:
  1. Test endpoint directly with curl:
    curl "http://your-api.com/endpoint?query=test"
    
  2. Check authentication credentials
  3. Verify URL is accessible from Docker container
  4. For localhost endpoints, use host networking or host.docker.internal
  5. Check for CORS issues
  6. Review ACS logs for connection errors
Problem: Datalink shows incorrect or missing informationSolutions:
  1. Verify API response format matches column definitions
  2. Check that field names are exactly the same
  3. Ensure primaryKey is set on one column
  4. Test API response:
    curl "http://localhost:3005/api/v1/public/employees/search" | jq
    
  5. Verify column types match data types (text, date, etc.)
Problem: 401 Unauthorized errorsSolutions:
  1. Verify credentials in datalink JSON
  2. Test authentication manually:
    curl -u username:password http://your-api.com/endpoint
    
  3. Check authentication type is correct (“basic”, “none”)
  4. For the mock database, use user2019 / g3n3r4l
  5. Review API server logs for auth errors

Next Steps

Configuration Reference

Detailed reference for all datalink configuration options

API Reference

Explore the Datalinks REST API and services

Content Models

Learn about custom aspects and content model design

Usage Guide

Learn how to use datalinks in Alfresco Content App

Get Help

If you need assistance:

Build docs developers (and LLMs) love