Overview
TheDatalinkListComponent is a standalone Angular component that displays all datalinks associated with an Alfresco node. It provides functionality for viewing, adding, and removing datalink entries through a tabbed interface.
Import
Selector
Standalone Component
Inputs
ID of the Alfresco node whose datalinks you want to display
Optional Node object (alternative to nodeId)
Outputs
Emitted when datalink rows are selected. Emits array of selected items.
Emitted when an error occurs during datalink operations.
Emitted when the parent dialog should reload.
Properties
Object containing datalink rows organized by aspect property name
Array of all available datalink configurations
Index of the currently active datalink tab
Loading state indicator
The current node being displayed
Currently selected datalink rows
Methods
ngOnChanges
Lifecycle hook that loads datalink configurations and node data.onChangeTabIndex
Handles tab change events and clears selection.Index of the newly selected tab
elementClicked / elementUnClicked
Handles row selection/deselection events.reload
Reloads the component data from the server.onRemoveRow
Removes a single row from the datalink.Row object containing the data to remove
Datalink configuration object
deleteSelectRows
Deletes all currently selected rows.openAddDatalinkDialog
Opens the dialog to add new datalink entries.onError
Handles and displays error messages.Example Usage
Features
Multi-Datalink Support
Displays multiple datalink types in separate tabs:- Each tab represents one datalink configuration
- Tab switching clears selection
- Active tab index is tracked
Data Table
Uses ADF DataTable component:- Configurable columns from datalink configuration
- Multi-select support
- Row click/unclick events
- Empty state handling
CRUD Operations
- Read: Loads datalinks from node properties
- Create: Opens dialog to add new entries
- Delete: Removes individual or multiple rows
- Update: Automatically updates node properties
Loading States
Provides loading indicators:- Progress bar during data fetch
- Loading flag for conditional rendering
- Automatic state management
Implementation Details
Data Storage
Datalink data is stored in Alfresco node properties:- Property name:
dataLink.aspectPropertyName - Format: JSON string containing array of row objects
- Example:
[{"id": "123", "name": "Customer A"}, ...]
Error Handling
Errors are handled through:- Event emission to parent components
- NgRx store actions for snackbar notifications
- Console logging for debugging
Styling
The component includes:- SCSS stylesheet for custom styling
- ViewEncapsulation.None for global styles
- Material Design integration
- Responsive layout support
Dependencies
@angular/core: Angular framework@angular/material: Material tabs and progress bar@alfresco/adf-core: ADF data table components@alfresco/adf-content-services: Alfresco API services@alfresco/aca-shared: Content App shared library@ngrx/store: State managementrxjs: Reactive programming
See Also
- VenziaDatalinkApiService - Service for loading datalinks
- VenziaDatalinkSearchDialogService - Service for dialog operations
- Datalink Dialog Component - Parent dialog component
- Datalink Add Panel Component - Component for adding datalinks
