Integrate adf in existing project

cancel
Showing results for 
Search instead for 
Did you mean: 
anakin98000
Active Member

Integrate adf in existing project

Hello,

 

this is what i try to add alfresco ecm only in existing angular 15 :

thank you,


package.json:
"dependencies": {
"@alfresco/adf-content-services": "^7.0.0-alpha.2",    // works with angular 15
"@alfresco/adf-core": "^7.0.0-alpha.2",
"@alfresco/adf-extensions": "^7.0.0-alpha.2",
"@alfresco/js-api": "^8.0.0-alpha.2",
...
app.config.json:
"{
"ecmHost": "https://localhost:8443",
"providers": "ECM"
},
"application": {
"name": "MyApp"
},
"languages": [
{
"key": "en",
"label": "English"
},
{
"key": "fr",
"label": "French"
}
],"

proxy.conf :
"module.exports = {
"/alfresco": {
target: "https://localhost:8443",
secure: false,
changeOrigin: true,
// workaround for REPO-2260
onProxyRes: function(proxyRes, req, res) {
const header = proxyRes.headers['www-authenticate'];
if (header && header.startsWith('Basic')) {
proxyRes.headers['www-authenticate'] = 'x' + header;
}
}
},
logLevel: 'debug'
};"
I have added a AdfModule file that I have imported in my app.module file :

"import { NgModule } from '@angular/core';
import {CoreModule, TRANSLATION_PROVIDER, TranslateLoaderService, AppConfigService} from '@alfresco/adf-core';
import { ContentModule } from '@alfresco/adf-content-services';
import {TranslateLoader, TranslateModule} from "@ngx-translate/core";

@NgModule({
imports: [
// ADF modules
CoreModule.forRoot(),
ContentModule.forRoot(),
TranslateModule.forRoot({
loader: { provide: TranslateLoader, useClass: TranslateLoaderService }
})
],
providers: [
AppConfigService,
{
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: 'app',
source: 'assets/i18n'
}
}
]
})
export class AdfModule {}
"
And in angular.json:

""assets": [
"src/favicon.ico",
"src/assets",
"src/app.config.json",
{
"glob": "/*",
"input": "resources",
"output": "/resources"
},
{
"glob": "
/",
"input": "node_modules/@alfresco/adf-core/prebuilt-themes",
"output": "/assets/prebuilt-themes"
},
{
"glob": "**/
",
"input": "node_modules/@alfresco/adf-core/bundles/assets",
"output": "/assets"
},
{
"glob": "**/*",
"input": "node_modules/@alfresco/adf-content-services/bundles/assets",
"output": "/assets"
},
{
"glob": "pdf.worker.js",
"input": "node_modules/pdfjs-dist/build",
"output": "/"
},
{
"glob": "pdf.worker.min.js",
"input": "node_modules/pdfjs-dist/build",
"output": "/"
}
],"

But I have an injection issue : "NullInjectorError: No provider for r!"
I think by checking code that it comes from AuthenticationService in adf-core.mjs

What is missing ?

Thank you in advance