Skip to content

Latest commit

 

History

History
112 lines (80 loc) · 2.9 KB

README.md

File metadata and controls

112 lines (80 loc) · 2.9 KB

CmisJS

A CMIS javascript library for node and browser

Build Status npm bower MIT License

API changes

Since version 0.3.0 The API for CmisSession.setContentStream() and CmisSession.appendContentStream() has changed. Please refer to the documentation for details.

Install

node.js

$ npm install cmis
$ node
> var cmis = require('cmis');

bower

$ bower install cmis

without bower

You can include directly minified version with dependencies:

<!-- do not use in production -->
<script src="https://rawgit.com/agea/CmisJS/master/min/cmis.min-all.js"></script>

Usage

The entry point for all CMIS operation is the CmisSession

var url = '/alfresco/cmisbrowser';

Note: you may specify an absolute url if running in node, or using CORS

var session = cmis.createSession(url);

You may specify your credentials

  session.setCredentials('admin','admin');

All session methods which connect to a repository are asynchronous, and return a CmisRequest object.

You may take a look at the tests to see some usage examples:

https://github.com/agea/CmisJS/blob/master/test/spec.js

Docs

API docs are available here: http://agea.github.io/CmisJS/docs/

Running tests

Install grunt:

$ npm install -g grunt-cli

Clone the repo:

$ git clone https://github.com/agea/CmisJS/

Install dependencies:

$ cd CmisJS
$ npm install

Running tests on node

(http://cmis.alfresco.com will be used as test repository)

$ grunt test

You can specify different url, username and password

$ grunt test --url http://localhost:8080/alfresco/cmisbrowser --username admin --password secret

Running browser tests

$ grunt server

Visit http://localhost:9000/test in the browser.

Grunt will act as a proxy for http://cmis.alfresco.com, you can specify a different server:

$ grunt server --host localhost --port 8080 --path /alfresco/cmisbrowser

To change username and password you can specify them in the url

http://localhost:9000/test?username=admin&password=secret

##License

MIT license - http://www.opensource.org/licenses/mit-license.php