alfresco/js-api ContentApi problem

cancel
Showing results for 
Search instead for 
Did you mean: 
pedwards99
Partner

alfresco/js-api ContentApi problem

Hi there,

I am trying writing an Angular application that uses the Alfresco JS-API to retrieve content attached to an APS workflow.

My development environment is IntelliJ

There is a Activiti-REST ContentApi that provides the methods I need to call to retrieve the content (getRawContent)

The problem is there's another ContentApi under content-custom-api. 

In my typescript code, when I do import {ContentApi} from '@alfresco/js-api' it picks the wrong ContentApi

Any idea what the import should be to target the correct ContentApi? The suggestion in the docs import ContentApi from 'ContentApi' does not work. Intellij complains it can't find a module called ContentApi.

I'm actually not sure the second ContentApi should be there - possibly a bug? It appears in the code, but not the docs.

Thanks

Paul

 

3 Replies
pedwards99
Partner

Re: alfresco/js-api ContentApi problem

As ever, 2minutes after posting, I find a solution....just target the source directly.

import {ContentApi} from '@alfresco/js-api/src/api/activiti-rest-api/api/content.api';

 However, i'm still not sure that the other ContentApi should be there?

Paul

 

pedwards99
Partner

Re: alfresco/js-api ContentApi problem

Ah....spoke too soon.

Importing as above doesn't work - the source will not compile...

pedwards99
Partner

Re: alfresco/js-api ContentApi problem

So, I've managed to get it building by adding the following to tsconfig.app.json in the "includes" section

"node_modules/@alfresco/js-api/src/api/activiti-rest-api/api/*.ts",
"node_modules/@alfresco/js-api/src/api/activiti-rest-api/model/*.ts",
"node_modules/@alfresco/js-api/src/*.ts",
"node_modules/@alfresco/js-api/src/api/content-custom-api/model/dateAlfresco.ts"

This is obviously NOT how it's supposed to work, but at least my app is building now.