Code Monkey home page Code Monkey logo

cmis-ruby's Introduction

CMIS ruby

Gem Version Dependency Status Code Climate

CMIS ruby is a CMIS client library, using the the CMIS Browser Binding (CMIS 1.1).

Example usage

require 'cmis'

# get the repository object
server = CMIS::Server.new(service_url: 'http://33.33.33.100:8080/browser',
                          username: 'foo', password: 'bar')
repository = server.repository('my_repository')

# get object by object id
document = repository.object('f3y5wbb6slhkeq3ciu3uazbpxeu')

# or by unique property
document = repository.find_object('cmis:document',
                                  'cmis:name' => 'some_unique_name')

# set document content
document.content = { stream: 'Apple is a fruit',
                     mime_type: 'text/plain',
                     filename: 'apple.txt' }

# create a new document
document = repository.new_document
document.name = 'new_document'
document.object_type_id = 'cmis:document'
document = document.create_in_folder(repository.root)

# query for first 50 documents where the property 'cmis:name' is 'bar'
query = repository.query("select * from cmis:document where cmis:name='bar'")
query.each_result(limit: 50) { |document| puts document.cmis_object_id }

Running specs

The default rake task runs the specs. This requires a separate CMIS server. The environment variable TEST_ENV selects the test environment from spec/config.yml.

Contributing

Write some code. Run the specs. Open a pull request.

cmis-ruby's People

Contributors

brackxm avatar bertbruynooghe avatar

Watchers

psweatte avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.