To create your first extension, create a descriptor file, and provide the configuration file to the module.
-
Create a descriptor folder with an extension descriptor
file inside, i.e. myorg.my-extension.json.
- The file name must be unique inside the application.
- Choose a name that does not conflict with other extensions.
- The descriptor file follows the schema in alfresco-content-app/extension.schema.json of the https://github.com/Alfresco/alfresco-content-app/ GitHub repository.
The minimal content of the descriptor file (shown below) should include the fields used for the About box only:
{ "$version": "0.1.0", "$id": "my-extension-id", "$name": "your plugin name", "$vendor": "Your amazing company", "$license": "LGPL-3.0", "$description": "Just a hello world" }This is an example of the About box:
-
Provide the configuration file to the module.
Inform the application to load the extension descriptor, using the provideExtensionConfig function from @alfresco/adfextensions.
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { provideExtensionConfig } from '@alfresco/adf-extensions'; @NgModule({ imports: [CommonModule], providers: [provideExtensionConfig(['myorg.my-extension.json'])], }) export class MyAdwExtensionModule {} -
Test the configuration by running:
npm run start content-ee
The application should run without issues or visible changes. If you inspect the network you should be able to find your JSON file loaded together with the other plugins.
Your extension is displayed in the plugin list in the About box: