05-20-2020 01:26 PM
Has anyone be successfull at implementing the NodesApi ? https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodesApi.md#u...
Have tried NodesApiService (createNode doesn't work). https://www.alfresco.com/abn/adf/docs/core/services/nodes-api.service/
Have tried AlfrescoApiService (nodesApi.updateNode works). https://www.alfresco.com/abn/adf/docs/core/services/alfresco-api.service/
How can I implement NodesApi javascript/typescipt so all available methods work?
05-28-2020 05:22 AM
Hi @robertwoodhead have you tried to follow the example?
import NodesApi from 'NodesApi'; import { AlfrescoApi } from '@alfresco/js-api'; this.alfrescoApi = new AlfrescoApi(); this.alfrescoApi.setConfig({ hostEcm: 'http://127.0.0.1:8080' }); let nodesApi = new NodesApi(this.alfrescoApi); nodesApi.createNode('-root-', { { "name": "My new subfolder" }, nodeType: 'cm:folder' }).then((data) => { console.log('API called successfully. Returned data: ' + data); }, function(error) { console.error(error); });
08-05-2020 01:31 AM
Hii,
Please check once version of '@alfresco/js-api' in package.json file, it should be latest version like 3.9.0. to use all updated services and its methods. Then run npm i command and you will get all avilable methods using NodesApi Service.
Explore our Alfresco products with the links below. Use labels to filter content by product module.