mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4125] simplify extension load in extension module (#4214)
* add extension load in extension module * add viewer extensions * fix license header * fix node passed in the viewer extension * fix node passed in the viewer extension * startup factory extension * startup factory extension * fix script * fix beta tag build * fix build * fix build * refactoring configuration files * extension using map * fix build * fix config * fix test * fix test
This commit is contained in:
27
demo-shell/src/app/app-extension.module.ts
Normal file
27
demo-shell/src/app/app-extension.module.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { AcaMonacoModule } from 'adf-monaco-extension';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
AcaMonacoModule
|
||||
]
|
||||
})
|
||||
export class AppExtensionsModule {
|
||||
}
|
@@ -24,6 +24,7 @@ import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
import { AppConfigService, TRANSLATION_PROVIDER, DebugAppConfigService, CoreModule } from '@alfresco/adf-core';
|
||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
import { AppComponent } from './app.component';
|
||||
import { MaterialModule } from './material.module';
|
||||
import { LoginComponent } from './components/login/login.component';
|
||||
@@ -65,7 +66,6 @@ import { ProcessModule } from '@alfresco/adf-process-services';
|
||||
import { AuthBearerInterceptor } from './services';
|
||||
import { ProcessServicesCloudModule, GroupCloudModule } from '@alfresco/adf-process-services-cloud';
|
||||
import { TreeViewSampleComponent } from './components/tree-view/tree-view-sample.component';
|
||||
import { AppExtensionsModule } from './extensions/extensions.module';
|
||||
import { CloudLayoutComponent } from './components/app-layout/cloud/cloud-layout.component';
|
||||
import { AppsCloudDemoComponent } from './components/app-layout/cloud/apps-cloud-demo.component';
|
||||
import { ProcessesCloudDemoComponent } from './components/app-layout/cloud/processes-cloud-demo.component';
|
||||
@@ -78,6 +78,7 @@ import { StartProcessCloudDemoComponent } from './components/app-layout/cloud/st
|
||||
import { TemplateDemoComponent } from './components/template-list/template-demo.component';
|
||||
import { PeopleGroupCloudDemoComponent } from './components/app-layout/cloud/people-groups-cloud-demo.component';
|
||||
import { CloudSettingsComponent } from './components/app-layout/cloud/cloud-settings.component';
|
||||
import { AppExtensionsModule } from './app-extension.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -88,16 +89,18 @@ import { CloudSettingsComponent } from './components/app-layout/cloud/cloud-sett
|
||||
FormsModule,
|
||||
HttpClientModule,
|
||||
MaterialModule,
|
||||
AppExtensionsModule,
|
||||
FlexLayoutModule,
|
||||
CoreModule.forRoot(),
|
||||
ContentModule.forRoot(),
|
||||
InsightsModule.forRoot(),
|
||||
ProcessModule.forRoot(),
|
||||
ProcessServicesCloudModule,
|
||||
ExtensionsModule.forRoot(),
|
||||
ThemePickerModule,
|
||||
ChartsModule,
|
||||
MonacoEditorModule.forRoot(),
|
||||
ProcessServicesCloudModule,
|
||||
AppExtensionsModule.forRoot(),
|
||||
GroupCloudModule
|
||||
],
|
||||
declarations: [
|
||||
|
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { ExtensionRef } from '@alfresco/adf-extensions';
|
||||
import { AppExtensionService } from '../../extensions/extension.service';
|
||||
import { AppExtensionService, ExtensionRef } from '@alfresco/adf-extensions';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
|
@@ -19,6 +19,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NotificationService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { CloudLayoutService } from './services/cloud-layout.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './start-process-cloud-demo.component.html',
|
||||
styleUrls: ['./start-process-cloud-demo.component.scss']
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<adf-info-drawer [title]="'APP.INFO_DRAWER.TITLE' | translate">
|
||||
|
||||
<adf-info-drawer-tab [label]="'APP.INFO_DRAWER.COMMENTS' | translate">
|
||||
<adf-comments [nodeId]="nodeId" [readOnly]="isCommentDisabled"></adf-comments>
|
||||
<adf-comments [nodeId]="nodeId" [readOnly]="!isCommentEnabled"></adf-comments>
|
||||
</adf-info-drawer-tab>
|
||||
|
||||
<adf-info-drawer-tab [label]="'APP.INFO_DRAWER.PROPERTIES' | translate">
|
||||
|
@@ -1,3 +1,12 @@
|
||||
.adf-viewer__sidebar {
|
||||
width: 380px !important;
|
||||
}
|
||||
|
||||
/* stylelint-disable */
|
||||
.monaco-scrollable-element {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
adf-preview-extension {
|
||||
width: 600px;
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ContentService, PermissionsEnum, NodesApiService } from '@alfresco/adf-core';
|
||||
import { ContentService, AllowableOperationsEnum, PermissionsEnum, NodesApiService } from '@alfresco/adf-core';
|
||||
import { MatSnackBar } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
@@ -52,7 +52,7 @@ export class FileViewComponent implements OnInit {
|
||||
showLeftSidebar = null;
|
||||
showRightSidebar = false;
|
||||
customToolbar = false;
|
||||
isCommentDisabled = false;
|
||||
isCommentEnabled = false;
|
||||
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
@@ -68,7 +68,8 @@ export class FileViewComponent implements OnInit {
|
||||
this.nodeApiService.getNode(id).subscribe(
|
||||
(node) => {
|
||||
if (node && node.isFile) {
|
||||
this.isCommentDisabled = this.contentServices.hasPermissions(node, PermissionsEnum.CONSUMER);
|
||||
this.isCommentEnabled = this.contentServices.hasPermissions(node, PermissionsEnum.NOT_CONSUMER) ||
|
||||
this.contentServices.hasAllowableOperations(node, AllowableOperationsEnum.UPDATE);
|
||||
this.nodeId = id;
|
||||
return;
|
||||
}
|
||||
|
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { FormComponent, FormModel, FormService, LogService } from '@alfresco/adf-core';
|
||||
import { FormOutcomeEvent } from '../../../../../lib/core/form/components/widgets/core';
|
||||
import { FormComponent, FormModel, FormService, LogService, FormOutcomeEvent } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-form-list',
|
||||
|
@@ -22,10 +22,9 @@ import {
|
||||
TaskDetailsModel,
|
||||
TaskUploadService
|
||||
} from '@alfresco/adf-process-services';
|
||||
import { UploadService, AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { UploadService, AlfrescoApiService, AppConfigService, FileUploadCompleteEvent } from '@alfresco/adf-core';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { FileUploadCompleteEvent } from '../../../../../lib/core/events/file.event';
|
||||
|
||||
export function taskUploadServiceFactory(api: AlfrescoApiService, config: AppConfigService) {
|
||||
return new TaskUploadService(api, config);
|
||||
|
@@ -1,56 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
ExtensionService,
|
||||
ExtensionConfig,
|
||||
ExtensionRef
|
||||
} from '@alfresco/adf-extensions';
|
||||
import { Observable, BehaviorSubject } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AppExtensionService {
|
||||
private _references = new BehaviorSubject<ExtensionRef[]>([]);
|
||||
|
||||
references$: Observable<ExtensionRef[]>;
|
||||
|
||||
constructor(private extensions: ExtensionService) {
|
||||
this.references$ = this._references.asObservable();
|
||||
}
|
||||
|
||||
async load() {
|
||||
const config = await this.extensions.load();
|
||||
this.setup(config);
|
||||
}
|
||||
|
||||
setup(config: ExtensionConfig) {
|
||||
if (!config) {
|
||||
console.error('Extension configuration not found');
|
||||
return;
|
||||
}
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('loaded extension config', config);
|
||||
|
||||
const references = (config.$references || [])
|
||||
.filter((entry) => typeof entry === 'object')
|
||||
.map((entry) => <ExtensionRef> entry);
|
||||
this._references.next(references);
|
||||
}
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NgModule, ModuleWithProviders, APP_INITIALIZER } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { AppExtensionService } from './extension.service';
|
||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
|
||||
export function setupExtensions(service: AppExtensionService): Function {
|
||||
return () => service.load();
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, CoreModule.forChild(), ExtensionsModule]
|
||||
})
|
||||
export class AppExtensionsModule {
|
||||
static forRoot(): ModuleWithProviders {
|
||||
return {
|
||||
ngModule: AppExtensionsModule,
|
||||
providers: [
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: setupExtensions,
|
||||
deps: [AppExtensionService],
|
||||
multi: true
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
static forChild(): ModuleWithProviders {
|
||||
return {
|
||||
ngModule: AppExtensionsModule
|
||||
};
|
||||
}
|
||||
}
|
@@ -1,15 +1,9 @@
|
||||
{
|
||||
"$schema": "./extension.schema.json",
|
||||
"$id": "app.1.0.0",
|
||||
"$name": "app",
|
||||
"$version": "1.0.0",
|
||||
"$vendor": "Alfresco",
|
||||
"$license": "Apache-2.0",
|
||||
"$runtime": "2.7.0",
|
||||
"$description": "base application extensions",
|
||||
"$schema": "../../lib/extensions/config/schema/app-extension.schema.json",
|
||||
"$references": [
|
||||
"plugin1.json",
|
||||
"plugin2.json"
|
||||
"plugin2.json",
|
||||
"monaco-extension.json"
|
||||
],
|
||||
"$dependencies": []
|
||||
}
|
||||
|
@@ -1,752 +0,0 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://github.com/Alfresco/alfresco-content-app/blob/development/extension.schema.json",
|
||||
"title": "ACA Extension Schema",
|
||||
"description": "Provides a validation schema for ACA extensions",
|
||||
|
||||
"definitions": {
|
||||
"ruleRef": {
|
||||
"type": "object",
|
||||
"required": ["id", "type"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique rule definition id",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "Rule evaluator type",
|
||||
"type": "string"
|
||||
},
|
||||
"parameters": {
|
||||
"description": "Rule evaluator parameters",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/ruleParameter" },
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"ruleParameter": {
|
||||
"type": "object",
|
||||
"required": ["type", "value"],
|
||||
"properties": {
|
||||
"type": {
|
||||
"description": "Rule parameter type",
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"description": "Rule parameter value",
|
||||
"type": "string"
|
||||
},
|
||||
"parameters": {
|
||||
"description": "Parameters",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/ruleParameter" },
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"routeRef": {
|
||||
"type": "object",
|
||||
"required": ["id", "path", "component"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique route reference identifier.",
|
||||
"type": "string"
|
||||
},
|
||||
"path": {
|
||||
"description": "Route path to register.",
|
||||
"type": "string"
|
||||
},
|
||||
"component": {
|
||||
"description": "Unique identifier for the Component to use with the route.",
|
||||
"type": "string"
|
||||
},
|
||||
"layout": {
|
||||
"description": "Unique identifier for the custom layout component to use.",
|
||||
"type": "string"
|
||||
},
|
||||
"auth": {
|
||||
"description": "List of the authentication guards to use with the route.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minLength": 1,
|
||||
"uniqueItems": true
|
||||
},
|
||||
"data": {
|
||||
"description": "Custom data to pass to the activated route so that your components can access it",
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
"actionRef": {
|
||||
"type": "object",
|
||||
"required": ["id", "type"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique action identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "Action type",
|
||||
"type": "string"
|
||||
},
|
||||
"payload": {
|
||||
"description": "Action payload value (string or expression)",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"contentActionRef": {
|
||||
"type": "object",
|
||||
"required": ["id"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique action identifier.",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "Element type",
|
||||
"type": "string",
|
||||
"enum": ["default", "button", "separator", "menu", "custom"]
|
||||
},
|
||||
"title": {
|
||||
"description": "Element title",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Element description, used for the tooltips.",
|
||||
"type": "string"
|
||||
},
|
||||
"description-disabled": {
|
||||
"description": "Description to use when element is in the disabled state.",
|
||||
"type": "string"
|
||||
},
|
||||
"order": {
|
||||
"description": "Element order",
|
||||
"type": "number"
|
||||
},
|
||||
"icon": {
|
||||
"description": "Element icon",
|
||||
"type": "string"
|
||||
},
|
||||
"disabled": {
|
||||
"description": "Toggles disabled state",
|
||||
"type": "boolean"
|
||||
},
|
||||
"component": {
|
||||
"description": "Custom component id (requires type to be 'custom')",
|
||||
"type": "string"
|
||||
},
|
||||
"children": {
|
||||
"description": "Child entries for the container types.",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"actions": {
|
||||
"description": "Element actions",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"click": {
|
||||
"description": "Action reference for the click handler",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"description": "Element rules",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Rule to evaluate the enabled state",
|
||||
"type": "string"
|
||||
},
|
||||
"visible": {
|
||||
"description": "Rule to evaluate the visibility state",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"navBarLinkRef": {
|
||||
"type": "object",
|
||||
"required": ["id", "icon", "title"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"description": "Element icon",
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Element title",
|
||||
"type": "string"
|
||||
},
|
||||
"route": {
|
||||
"description": "Route reference identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"description": "Element description or tooltip",
|
||||
"type": "string"
|
||||
},
|
||||
"order": {
|
||||
"description": "Element order",
|
||||
"type": "number"
|
||||
},
|
||||
"children": {
|
||||
"description": "Navigation children items",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"title",
|
||||
"route"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Element title",
|
||||
"type": "string"
|
||||
},
|
||||
"route": {
|
||||
"description": "Route reference identifier",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"not": {
|
||||
"required": ["children"]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"minItems": 1
|
||||
},
|
||||
"rules": {
|
||||
"description": "Element rules",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"visible": {
|
||||
"description": "Rule to evaluate the visibility state",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"oneOf": [
|
||||
{
|
||||
"required": ["route"],
|
||||
"not": {
|
||||
"required": ["children"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": ["children"],
|
||||
"not": {
|
||||
"required": ["route"]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"navBarGroupRef": {
|
||||
"type": "object",
|
||||
"required": ["id", "items"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier for the navigation group",
|
||||
"type": "string"
|
||||
},
|
||||
"items": {
|
||||
"description": "Navigation group items",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/navBarLinkRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"order": {
|
||||
"description": "Group order",
|
||||
"type": "number"
|
||||
},
|
||||
"rules": {
|
||||
"description": "Element rules",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"visible": {
|
||||
"description": "Rule to evaluate the visibility state",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sidebarTabRef": {
|
||||
"type": "object",
|
||||
"required": ["id", "component"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier for the navigation group",
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"description": "Element title",
|
||||
"type": "string"
|
||||
},
|
||||
"component": {
|
||||
"description": "Component id",
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"description": "Material icon name",
|
||||
"type": "string"
|
||||
},
|
||||
"disabled": {
|
||||
"description": "Toggles disabled state",
|
||||
"type": "boolean"
|
||||
},
|
||||
"order": {
|
||||
"description": "Element order",
|
||||
"type": "number"
|
||||
},
|
||||
"rules": {
|
||||
"description": "Element rules",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"visible": {
|
||||
"description": "Rule to evaluate the visibility state",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"viewerExtensionRef": {
|
||||
"type": "object",
|
||||
"required": ["id", "component", "fileExtension"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier for the navigation group",
|
||||
"type": "string"
|
||||
},
|
||||
"component": {
|
||||
"description": "Component id",
|
||||
"type": "string"
|
||||
},
|
||||
"fileExtension": {
|
||||
"description": "Target file extension",
|
||||
"type": "string"
|
||||
},
|
||||
"order": {
|
||||
"description": "Group order",
|
||||
"type": "number"
|
||||
},
|
||||
"disabled": {
|
||||
"description": "Toggles the disabled state",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"content-metadata-aspect": {
|
||||
"description": "Content metadata aspect definition",
|
||||
"type": "object",
|
||||
"required": ["id"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "Unique identifier"
|
||||
}
|
||||
},
|
||||
"patternProperties": {
|
||||
".*": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "Wildcard for every property",
|
||||
"type": "string",
|
||||
"pattern": "^\\*$"
|
||||
},
|
||||
{
|
||||
"description": "Properties array",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"description": "Property name",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"content-metadata-layout-group": {
|
||||
"description": "Content metadata's layout groups definition",
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"description": "Content metadata's one layout group definition",
|
||||
"type": "object",
|
||||
"required": ["id"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "Unique identifier"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"description": "Content metadata's one layout group definition's title"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"description": "Content metadata's one layout group definition's items",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"aspect",
|
||||
"properties"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"aspect": {
|
||||
"description": "Aspect group",
|
||||
"type": "string"
|
||||
},
|
||||
"properties": {
|
||||
"description": "Wildcard character",
|
||||
"type": "string",
|
||||
"pattern": "^\\*$"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"aspect",
|
||||
"properties"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"aspect": {
|
||||
"description": "Aspect group",
|
||||
"type": "string"
|
||||
},
|
||||
"properties": {
|
||||
"description": "list of aspect properties",
|
||||
"type": "array"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"type",
|
||||
"properties"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "Type group",
|
||||
"type": "string"
|
||||
},
|
||||
"properties": {
|
||||
"description": "Wildcard character",
|
||||
"type": "string",
|
||||
"pattern": "^\\*$"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"type",
|
||||
"properties"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "Type group",
|
||||
"type": "string"
|
||||
},
|
||||
"properties": {
|
||||
"description": "list of type properties",
|
||||
"type": "array"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"disabled"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"disabled": {
|
||||
"description": "Toggles disabled state",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentListPresetRef": {
|
||||
"type": "object",
|
||||
"required": ["id", "key", "type"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier.",
|
||||
"type": "string"
|
||||
},
|
||||
"key": {
|
||||
"description": "Property key",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "Column type",
|
||||
"type": "string",
|
||||
"enum": ["text", "image", "date", "fileSize"]
|
||||
},
|
||||
"title": {
|
||||
"description": "Column title",
|
||||
"type": "string"
|
||||
},
|
||||
"format": {
|
||||
"description": "Column format",
|
||||
"type": "string"
|
||||
},
|
||||
"class": {
|
||||
"description": "CSS class name",
|
||||
"type": "string"
|
||||
},
|
||||
"sortable": {
|
||||
"description": "Toggles sortable state of the column",
|
||||
"type": "boolean"
|
||||
},
|
||||
"template": {
|
||||
"description": "Column template id",
|
||||
"type": "string"
|
||||
},
|
||||
"desktopOnly": {
|
||||
"description": "Display column only for large screens",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"type": "object",
|
||||
"required": ["$name", "$version"],
|
||||
"properties": {
|
||||
"$name": {
|
||||
"description": "Extension name",
|
||||
"type": "string"
|
||||
},
|
||||
"$version": {
|
||||
"description": "Extension version",
|
||||
"type": "string"
|
||||
},
|
||||
"$description": {
|
||||
"description": "Brief description on what the extension does"
|
||||
},
|
||||
"$references": {
|
||||
"description": "References to external files",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 0,
|
||||
"uniqueItems": true
|
||||
},
|
||||
"rules": {
|
||||
"description": "List of rule definitions",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/ruleRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"routes": {
|
||||
"description": "List of custom application routes",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/routeRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"actions": {
|
||||
"description": "List of action definitions",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/actionRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"features": {
|
||||
"description": "Application-specific features and extensions",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"header": {
|
||||
"description": "Application header extensions",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"create": {
|
||||
"description": "The [New] menu component extensions",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"viewer": {
|
||||
"description": "Viewer component extensions",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"openWith": {
|
||||
"description": "The [Open With] menu extensions",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"toolbarMoreMenu": {
|
||||
"description": "Toolbar entries from the More actions menu",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"toolbarActions": {
|
||||
"description": "Toolbar entries from outside the More menu",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"content": {
|
||||
"description": "Viewer content extensions",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/viewerExtensionRef" },
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"navbar": {
|
||||
"description": "Navigation bar extensions",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/navBarGroupRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"sidebar": {
|
||||
"description": "Sidebar extensions",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/sidebarTabRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"toolbar": {
|
||||
"description": "Toolbar entries",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"contextMenu": {
|
||||
"description": "Context menu entries",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/contentActionRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"content-metadata-presets": {
|
||||
"description": "Configuration for the presets for content metadata component",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "Unique identifier"
|
||||
}
|
||||
},
|
||||
"patternProperties": {
|
||||
".*": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^\\*$",
|
||||
"description": "Wildcard for every aspect"
|
||||
},
|
||||
{ "$ref": "#/definitions/content-metadata-aspect" },
|
||||
{ "$ref": "#/definitions/content-metadata-layout-group" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"documentList": {
|
||||
"description": "Document list extensions",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"files": {
|
||||
"description": "Files document list preset",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/documentListPresetRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"libraries": {
|
||||
"description": "Libraries document list preset",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/documentListPresetRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"shared": {
|
||||
"description": "Shared Files document list preset",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/documentListPresetRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"recent": {
|
||||
"description": "Recent Files document list preset",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/documentListPresetRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"favorites": {
|
||||
"description": "Favorites document list preset",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/documentListPresetRef" },
|
||||
"minItems": 1
|
||||
},
|
||||
"trashcan": {
|
||||
"description": "Trashcan document list preset",
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/definitions/documentListPresetRef" },
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
17
demo-shell/src/assets/plugins/monaco-extension.json
Normal file
17
demo-shell/src/assets/plugins/monaco-extension.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "../../../lib/extensions/config/schema/plugin-extension.schema.json",
|
||||
"$version": "1.0.0",
|
||||
"$name": "monaco extension",
|
||||
"$description": "monaco plugin",
|
||||
"features": {
|
||||
"viewer": {
|
||||
"content": [
|
||||
{
|
||||
"id": "dev.tools.viewer",
|
||||
"fileExtension": "js",
|
||||
"component": "monaco-extension.main.component"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,16 +1,11 @@
|
||||
{
|
||||
"$schema": "../extension.schema.json",
|
||||
"$id": "plugin1.1.0.0",
|
||||
"$schema": "../../../lib/extensions/config/schema/plugin-extension.schema.json",
|
||||
"$name": "plugin1",
|
||||
"$version": "1.0.0",
|
||||
"$vendor": "Alfresco",
|
||||
"$license": "Apache-2.0",
|
||||
"$runtime": "2.7.0",
|
||||
"$description": "example plugin",
|
||||
"$dependencies": [
|
||||
"@some/library1"
|
||||
],
|
||||
|
||||
"features": {
|
||||
"custom": {
|
||||
"key": "value"
|
||||
|
@@ -1,16 +1,11 @@
|
||||
{
|
||||
"$schema": "../extension.schema.json",
|
||||
"$id": "plugin2.1.1.0",
|
||||
"$schema": "../../../lib/extensions/config/schema/plugin-extension.schema.json",
|
||||
"$name": "plugin2",
|
||||
"$version": "1.1.0",
|
||||
"$vendor": "Alfresco",
|
||||
"$license": "Apache-2.0",
|
||||
"$runtime": "2.7.0",
|
||||
"$description": "another example plugin",
|
||||
"$dependencies": [
|
||||
"@some/library2"
|
||||
],
|
||||
|
||||
"features": {
|
||||
"extra": {
|
||||
"key": "value"
|
||||
|
@@ -4,30 +4,7 @@
|
||||
"outDir": "../out-tsc/app",
|
||||
"module": "es2015",
|
||||
"baseUrl": ".",
|
||||
"types": [],
|
||||
"paths": {
|
||||
"@alfresco/adf-extensions": [
|
||||
"../../lib/extensions"
|
||||
],
|
||||
"@alfresco/adf-core": [
|
||||
"../../lib/core"
|
||||
],
|
||||
"@alfresco/adf-process-services-cloud": [
|
||||
"../../lib/process-services-cloud"
|
||||
],
|
||||
"@alfresco/adf-testing": [
|
||||
"../../lib/testing"
|
||||
],
|
||||
"@alfresco/adf-content-services": [
|
||||
"../../lib/content-services"
|
||||
],
|
||||
"@alfresco/adf-process-services": [
|
||||
"../../lib/process-services"
|
||||
],
|
||||
"@alfresco/adf-insights": [
|
||||
"../../lib/insights"
|
||||
]
|
||||
}
|
||||
"types": []
|
||||
},
|
||||
"exclude": [
|
||||
"test.ts",
|
||||
|
Reference in New Issue
Block a user