How DataLinks Store Information
When you link database records to a document, Venzia Datalinks stores the connection using Alfresco’s property system:Property-Based Storage
- Each datalink type is associated with a specific aspect property on the document
- Linked records are stored as JSON arrays within these properties
- Multiple records can be linked to a single document through one property
- Each property contains the complete record data returned from the database
Aspect properties are metadata fields added to documents through Alfresco’s content model. Your administrator configures which properties are used for each datalink type.
Understanding Aspect Properties
Aspect properties are the foundation of how Venzia Datalinks operates:What Are Aspect Properties?
In Alfresco Content Services:- Aspects are reusable sets of properties that can be applied to documents
- Properties are metadata fields that store information about documents
- Aspect properties combine these concepts to extend document metadata
DataLink Property Configuration
For each configured datalink type:- Aspect Property Name: A unique identifier for where linked data is stored (e.g.,
dl:customerRecords) - Property Type: Must be configured to store text/JSON data
- Multiple Records: The property stores an array of database records
- JSON Format: Data is serialized as JSON for structured storage
Property names and aspect configurations are set up by your administrator during the Venzia Datalinks installation and configuration process.
The Linking Process
When you add or remove database links, here’s what happens behind the scenes:Adding Records
Record Data Retrieved
The system retrieves the complete record data from the database via the configured REST API connector.
JSON Array Created
The selected records are combined with any existing linked records into a JSON array.
Property Updated
The JSON array is serialized and stored in the document’s aspect property using the Alfresco Nodes API.
Removing Records
User Selects Records to Remove
You select one or more linked records in the DataLink management dialog.
Property Updated
The filtered JSON array is serialized and saved back to the document’s aspect property.
Data Structure
JSON Storage Format
Linked records are stored as a JSON array in the document property:Field Mapping
The fields stored in each record object depend on:- Database schema: What fields exist in the source database table
- REST API response: What fields the connector returns
- Column configuration: Which fields are displayed in the UI tables
Property Management
Reading Properties
When you open the DataLink management dialog:- The system retrieves the document node information from Alfresco
- For each configured datalink type, it checks if the corresponding aspect property exists
- If the property exists and contains data, the JSON is parsed into record objects
- The records are displayed in the appropriate tab of the DataLink dialog
Writing Properties
When you add or remove records:- The updated record array is serialized to JSON format
- The Alfresco Nodes API
updateNodemethod is called - The aspect property value is set to the new JSON string
- Alfresco validates and persists the change
- If versioning is enabled, a new document version is created
Each property update creates a new version of the document (if versioning is enabled). This provides an audit trail of all datalink changes.
Multiple DataLink Types
Documents can have multiple types of datalinks simultaneously:Separate Properties
- Each datalink type uses a different aspect property
- Customer records might be stored in
dl:customers - Product records might be stored in
dl:products - Invoice records might be stored in
dl:invoices
Independent Management
- Changes to one datalink type don’t affect others
- You can add customer records without impacting product links
- Each property maintains its own JSON array of records
Tabbed Interface
The DataLink dialog displays tabs for each datalink type:- Each tab reads from its configured aspect property
- Switching tabs shows different sets of linked records
- The active tab determines which property is updated when you add/remove records
Property Compatibility
Content Model Requirements
For Venzia Datalinks to work with a document:- Aspect must be applied: The document must have the required aspect(s)
- Property must exist: The aspect must define the properties used for datalink storage
- Property type: Must support text/string data to store JSON
Administrator Configuration
Your administrator configures:- Aspect definitions: Which aspects contain datalink properties
- Property names: The identifiers used for each datalink type
- Content model: The Alfresco content model that defines these aspects and properties
- Auto-application: Whether aspects are automatically applied to documents
If you see the error “Not compatible content,” it means the document doesn’t have the required aspect properties. Contact your administrator to configure the content model for your document type.
Data Integrity
Validation
The system ensures data integrity through:- JSON validation: Data is validated before storage
- Array structure: Records are always stored as valid JSON arrays
- Error handling: Failed updates trigger error messages and don’t corrupt existing data
Versioning
When Alfresco versioning is enabled:- Version history: Each datalink change creates a new document version
- Audit trail: You can track when records were added or removed
- Rollback capability: Previous versions preserve old datalink states
Data Persistence
- Database storage: Properties are stored in Alfresco’s database
- Backup included: Datalinks are part of regular Alfresco backups
- Migration support: Properties move with documents during migrations
Working with Properties Programmatically
For developers and administrators:Accessing via API
Linked data can be accessed through:- Alfresco REST API: Read document properties using the Nodes API
- CMIS: Access properties via CMIS protocol
- JavaScript API: Read/write properties in repository-tier scripts
Example Property Access
Using the Alfresco REST API:Best Practices
For Users
- Verify before deleting: Check that you’re removing the correct records, as changes create new versions
- Link relevant records: Only link database records that are truly related to the document
- Use appropriate types: Select the correct datalink type tab for the kind of records you’re linking
For Administrators
- Plan property names: Use clear, descriptive names for aspect properties
- Configure content models: Ensure aspects are properly defined and applied
- Test compatibility: Verify that all document types support the required aspects
- Document configuration: Maintain documentation of which properties are used for which datalink types
Troubleshooting
Property Not Found
Symptom: “Not compatible content” error message Causes:- Document doesn’t have the required aspect applied
- Property doesn’t exist in the content model
- Configuration mismatch between plugin and content model
Invalid Data Format
Symptom: Linked records don’t display correctly Causes:- Property contains invalid JSON
- Data structure doesn’t match expected format
- Manual property modification outside of Venzia Datalinks
Version History Issues
Symptom: Can’t track datalink changes over time Causes:- Versioning not enabled for the document type
- Version history has been deleted
Next Steps
- Edit DataLink - Learn how to manage the DataLink dialog
- Search Records - Learn how to find and select database records
