nuxeo_client 0.3.2

  • README.md
  • Installing
  • Versions
  • 43

Nuxeo Dart

Dart Client Library for Nuxeo API

Build Status

Dart client library for the Nuxeo Automation and REST API.

The library can work in a browser, or in the console using the same API.

Getting started

Try It

  • Start the Dart Editor
  • Create a new Dart project
  • Add the nuxeo_client dependency to your pubspec.yaml file.
dependencies:
  nuxeo_client: any
  • Import the nuxeo_client library:
    • For browser applications use:
import 'package:nuxeo_client/browser_client.dart' as nuxeo;
- For standalone/console applications use:
import 'package:nuxeo_client/standalone_client.dart' as nuxeo;
  • Create your client:
var nx = new nuxeo.Client()
  • Call some operations, for instance:
nx.op("Document.GetChildren")(input:"doc:/")
  .then((docs) {
    ...
  });
  • Checkout the docs for more.

Documentation

API Reference

Running the TCK

Nuxeo provides a TCK (Test Compatibility Kit) that can be used to test the implementation of an automation client library.

You can run the Dart Automation Client TCK with your own Nuxeo server (version >= 5.8).

Prerequisites

nuxeoctl mp-install nuxeo-rest-api --accept true

Standalone Nuxeo Client

  • Start Nuxeo server
  • Run the console tests harness at test/console_test_harness.dart
  • Check the console output for the test results

Browser Nuxeo Client

Setup CORS

  • Add a CORS config contribution to allow Dartium to do cross-domain requests to your Nuxeo server:
<?xml version="1.0"?>
<component name="org.nuxeo.ecm.platform.web.dart.tck">
 <extension target="org.nuxeo.ecm.platform.web.common.requestcontroller.service.RequestControllerService" point="corsConfig">
    <corsConfig name="dartTCK" allowOrigin="http://127.0.0.1:3030" supportedMethods="GET,POST,HEAD,OPTIONS,PUT,DELETE">
      <pattern>/nuxeo/site/automation.*</pattern>
    </corsConfig>
    <corsConfig name="dartTCKApi" allowOrigin="http://127.0.0.1:3030" supportedMethods="GET,POST,HEAD,OPTIONS,PUT,DELETE">
      <pattern>/nuxeo/api.*</pattern>
    </corsConfig>
  </extension>
</component>

You can just put it in a *-config.xml file in nxserver/config or create a custom template (don't forget to update nuxeo.conf).

You can check if CORS is working properly with curl:

curl --verbose -u Administrator:Administrator -H "Origin: http://127.0.0.1:3030" -H "Access-Control-Request-Method: POST" -H "Access-Control-Request-Headers: X-Requested-With" -X OPTIONS http://localhost:8080/nuxeo/site/automation

Run the TCK

  • Start Nuxeo server

  • Run the console based tests

    dart test/console_test_harness.dart

  • Run the browser tests harness at test/browser_test_harness.dart

    use 'Run in Dartium' from Dart Editor

  • Check the browser for the test results

Authors

About Nuxeo

Nuxeo provides a modular, extensible Java-based [open source software platform for enterprise content management] 1 and packaged applications for [document management] 2, [digital asset management] 3 and [case management] 4. Designed by developers for developers, the Nuxeo platform offers a modern architecture, a powerful plug-in model and extensive packaging capabilities for building content applications.

More information on: http://www.nuxeo.com/

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  nuxeo_client: "^0.3.2"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:nuxeo_client/._automation.dart';

import 'package:nuxeo_client/automation.dart';

import 'package:nuxeo_client/browser_client.dart';

import 'package:nuxeo_client/client.dart';

import 'package:nuxeo_client/http.dart';

import 'package:nuxeo_client/._rest.dart';

import 'package:nuxeo_client/rest.dart';

import 'package:nuxeo_client/standalone_client.dart';
        
Version Uploaded Documentation Archive
0.3.2 May 4, 2017 Go to the documentation of nuxeo_client 0.3.2 Download nuxeo_client 0.3.2 archive
0.3.1 Jul 21, 2016 Go to the documentation of nuxeo_client 0.3.1 Download nuxeo_client 0.3.1 archive
0.3.0 May 18, 2016 Go to the documentation of nuxeo_client 0.3.0 Download nuxeo_client 0.3.0 archive
0.2.0 Nov 24, 2015 Go to the documentation of nuxeo_client 0.2.0 Download nuxeo_client 0.2.0 archive
0.1.0 Nov 12, 2015 Go to the documentation of nuxeo_client 0.1.0 Download nuxeo_client 0.1.0 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
93 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
77 / 100
Overall score:
Weighted score of the above. [more]
43
Learn more about scoring.

Platforms

Detected platforms: web

Platform components identified in package: html, io, mirrors.

Suggestions

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 4 errors 36 hints.

    Strong-mode analysis of lib/http/multipart.dart failed with the following error:

    line: 40 col: 10
    The argument type '(Iterable<Future<Blob>>, {eagerError: bool, cleanUp: (Blob) → void}) → Future<List<Blob>>' can't be assigned to the parameter type '(dynamic) → FutureOr<List<Blob>>'.

    Strong-mode analysis of lib/src/operation.dart failed with the following error:

    line: 28 col: 35
    The getter 'length' isn't defined for the class 'Object'.

    Similar analysis of the following files failed:

    • lib/automation.dart (hint)
    • lib/browser_client.dart (hint)
    • lib/client.dart (hint)
    • lib/http.dart (hint)
    • lib/http/client.dart (hint)
    • lib/http/standalone.dart (hint)
    • lib/rest.dart (hint)
    • lib/src/adapter.dart (hint)
    • lib/src/document.dart (hint)
    • lib/src/login.dart (hint)
    • lib/src/registry.dart (hint)
    • lib/src/request.dart (hint)
    • lib/src/rest/document.dart (hint)
    • lib/src/rest/request.dart (hint)
    • lib/src/rpc/request.dart (hint)
    • lib/src/uploader.dart (hint)
    • lib/standalone_client.dart (hint)
  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use nuxeo_client.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
browser >=0.10.0 <0.11.0 0.10.0+3
crypto >=0.9.0 <0.10.0 0.9.2+1 2.0.2+1
http >=0.10.0 <0.11.0 0.10.0 0.11.3+16
logging >=0.9.0 <0.10.0 0.9.3 0.11.3+1
logging_handlers >=0.8.0 <0.9.0 0.8.0
mime >=0.9.0+3 <0.10.0 0.9.6
Transitive dependencies
charcode 1.1.1
convert 1.1.1 2.0.1
intl 0.15.6
path 1.5.1
stack_trace 0.9.3+2 1.9.2
typed_data 1.1.5
Dev dependencies
unittest >=0.10.1+2 <0.11.0