Using AngularJS module for Nuxeo platform

I've been working on developping an angular application following this tutorial : https://doc.nuxeo.com/display/NXDOC/Developing+with+AngularJS and using the samples from the following page : https://github.com/nuxeo-sandbox/angular-nuxeo

From that, I could :

  • List all document from a folder
  • Fetch a document from a folder

However, I couldn't find any example about CRUD methods on documents, or on users. These examples does not seem to work on Nuxeo 6 using the AngularJS module : https://github.com/dmetzler/nuxeo-book

Could I get any exemples on what's possible using the AngularJS module for the Nuxeo Automation and REST API. My id is to create a frontend portal of the Nuxeo platform for end users.

0 votes

1 answers

2230 views

ANSWER

I’ve tried to get the current user of the platform, using the /api/automation/User.Get from the Automation API, but I can’t get it to work properly. It works fine in the Nuxeo API playground.

I’m getting “ReferenceError: callback is not defined” in the Javascript console of the web browser.

08/05/2015



There was a typo in the angular-nuxeo client. It has been fixed. Just update the client in your project and it should work.

0 votes



Thanks for your answer. It resolved the callback error, but I'm still getting another error in the JS console when calling 'User.Get' method. "POST http://localhost:8080/nuxeo/site/api/v1/automation/User.Get 500 (Erreur Interne de Servlet)"

Here is the code included in my controller below :

 nuxeoClient.operation('User.Get').execute().then(function(user) {
    // OK, return specified user
        console.dir(user);

    }, function(err) {
    // NOK, return error
           console.log('Error: ' + err);

  });

Any idea ?

08/06/2015

Seems like operation User.Get does not exist on 6.0. Can you replace it by NuxeoPrincipal.Get and try again?
08/06/2015

Thanks, it works fine! :-) Is the API playground based on a anterior version of the platform? Because the operation is called User.Get : http://nuxeo.github.io/api-playground/#/commands/User.Get

However, it seems that the user properties are not included anymore in the return..

08/06/2015