xaop / activecmis Goto Github PK
View Code? Open in Web Editor NEWActive CMIS
Home Page: http://www.xaop.com
License: MIT License
Active CMIS
Home Page: http://www.xaop.com
License: MIT License
The following code:
wanted_type = repository.type_by_id("cmis:folder")
new_folder = wanted_type.new("cmis:name" => "New Folder")
new_folder.file(repository.root_folder)
new_folder.save
results in this error:
/usr/lib/ruby/gems/1.8/gems/active_cmis-0.1.12/lib/active_cmis/object.rb:357:in id': wrong number of arguments (1 for 0) (ArgumentError) from /usr/lib/ruby/gems/1.8/gems/active_cmis-0.1.12/lib/active_cmis/object.rb:357:in
render_atom_entry'
from /usr/lib/ruby/gems/1.8/gems/nokogiri-1.4.4/lib/nokogiri/xml/builder.rb:366:in call' from /usr/lib/ruby/gems/1.8/gems/nokogiri-1.4.4/lib/nokogiri/xml/builder.rb:366:in
insert'
from /usr/lib/ruby/gems/1.8/gems/nokogiri-1.4.4/lib/nokogiri/xml/builder.rb:350:in method_missing' from /usr/lib/ruby/gems/1.8/gems/active_cmis-0.1.12/lib/active_cmis/object.rb:348:in
render_atom_entry'
from /usr/lib/ruby/gems/1.8/gems/nokogiri-1.4.4/lib/nokogiri/xml/builder.rb:293:in initialize' from /usr/lib/ruby/gems/1.8/gems/active_cmis-0.1.12/lib/active_cmis/object.rb:347:in
new'
from /usr/lib/ruby/gems/1.8/gems/active_cmis-0.1.12/lib/active_cmis/object.rb:347:in render_atom_entry' from /usr/lib/ruby/gems/1.8/gems/active_cmis-0.1.12/lib/active_cmis/object.rb:416:in
save_new_object'
from /usr/lib/ruby/gems/1.8/gems/active_cmis-0.1.12/lib/active_cmis/object.rb:159:in send' from /usr/lib/ruby/gems/1.8/gems/active_cmis-0.1.12/lib/active_cmis/object.rb:159:in
save'
from /usr/lib/ruby/gems/1.8/gems/active_cmis-0.1.12/lib/active_cmis/object.rb:158:in each' from /usr/lib/ruby/gems/1.8/gems/active_cmis-0.1.12/lib/active_cmis/object.rb:158:in
save'
from test_case.rb:13
Thanks and regards,
Brent
I'd like to use this gem in a thread-safe context (using config.threadsafe! rails option).
Do you think I'll face any issue with activecmis?
Thanks,
Antonio.
Hi,
CMIS specification version 1.1 has now been approved by OASIS.
http://docs.oasis-open.org/cmis/CMIS/v1.1/CMIS-v1.1.html
Does ActiveCMIS have a plan to correspond CMIS 1.1?
In fact, I'm developing a new light-weight CMIS server "NemakiWare", whose backend is NoSQL CouchDB.
I'm also going to develop its new client with Ruby on Rails and ActiveCMIS!
But as the same time, I want to enhance NemakiWare to be more CMIS compliant, I mean, I want to use CMIS1.1 new feature insrtead of CMIS Extension data. The new ActiveCMIS client has to deal with CMIS1.1 feature.
For example:
NemakiWare needs some user-customizable property, they can be implemented as cmis:secondary object type which is a new feature of CMIS1.1. In addiotion, the concept of user/group could be expressed by "Item" object type which also comes into CMIS1.1.
To version up ActiveCMIS for 1.1, some core scripts(type.rb, object.rb...) seem to have to be changed. It could not be impossible by us (as ActiveCMIS is OpenSource :-)), though, it would be good by the knowledgeable developer like you, I think. I'd like to adopt a workaround that changes the atom parser of object.rb to extract cmis:secondary properties.
Anyway, could you please tell me if you have a plan for version up to 1.1? I decided to my development plan depending on it.
Thanks you in advance.
If the URL passed from the configuration is not a valid URL, URI raise an exception not managed by activecmis where it should.
cmis.yml
development:
server_url: "test"
initializers/active_cmis.rb
require "active_cmis"
begin
Fundlook::Repositories::Alfresco.repository = ActiveCMIS.load_config(Rails.env, File.join(Rails.root, "config", "cmis.yml"))
rescue Timeout::Error, SocketError => error
Rails.logger.warn "Error while connecting with CMIS: #{error.message}"
end
thin start
>> Using rails adapter
/Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/bundler/gems/activecmis-7f99b627339b/lib/active_cmis/internal/connection.rb:45:in `get': undefined method `request_uri' for #<URI::Generic:0x10a2a30e0 URL:test> (NoMethodError)
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/bundler/gems/activecmis-7f99b627339b/lib/active_cmis/internal/connection.rb:70:in `get_xml'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/bundler/gems/activecmis-7f99b627339b/lib/active_cmis/server.rb:107:in `repository_info__uncached'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/bundler/gems/activecmis-7f99b627339b/lib/active_cmis/internal/caching.rb:28:in `repository_info'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/bundler/gems/activecmis-7f99b627339b/lib/active_cmis/server.rb:79:in `uncached_repository'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/bundler/gems/activecmis-7f99b627339b/lib/active_cmis/server.rb:74:in `repository'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/bundler/gems/activecmis-7f99b627339b/lib/active_cmis/active_cmis.rb:49:in `connect'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/bundler/gems/activecmis-7f99b627339b/lib/active_cmis/active_cmis.rb:79:in `load_config'
from /Users/guillaumeh/Developments/fundlook/config/initializers/active_cmis.rb:4
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load_without_new_constant_marking'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/gems/rails-2.3.18/lib/initializer.rb:622:in `load_application_initializers'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/gems/rails-2.3.18/lib/initializer.rb:621:in `each'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/gems/rails-2.3.18/lib/initializer.rb:621:in `load_application_initializers'
from /Users/guillaumeh/.rvm/gems/ree-1.8.7-2012.02@fundlook/gems/rails-2.3.18/lib/initializer.rb:176:in `process'
A "Boolean" class name is used in https://github.com/xaop/activecmis/blob/master/lib/active_cmis/document.rb#L232
The Boolean class does not exists in Ruby core, so it ends with:
NameError (uninitialized constant ActiveCMIS::Document::Boolean):
active_cmis (0.3.4) lib/active_cmis/document.rb:232:in `checkin'
Platform : http://cmis.demo.nuxeo.org
I wish to update a document, in order to do this, I have to create a pwc :
pwc = doc.checkout
But by doing this, I have this error :
RuntimeError (
<title>Apache Chemistry OpenCMIS - invalidArgument error</title>Object Id must be set!
org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Object Id must be set! [...]
it seems there is not type definition for some changelog entries. Some have the type ACL, some others dont have a type set
the alfresco web server exception says:
org.springframework.extensions.webscripts.WebScriptException - 02300206 Invalid typeId
ruby stack trace:
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/internal/connection.rb:46:in `get'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/internal/connection.rb:70:in `get_xml'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/internal/connection.rb:77:in `get_atom_entry'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/repository.rb:133:in `type_by_id'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/object.rb:528:in `from_atom_entry'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/collection.rb:24:in `block in initialize'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:239:in `block in each'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:238:in `upto'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:238:in `each'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/collection.rb:191:in `map'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/collection.rb:191:in `receive_page'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/collection.rb:35:in `length'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/internal/caching.rb:28:in `length'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/collection.rb:67:in `at'
from /home/olli/.rvm/gems/ruby-1.9.3-p374/gems/active_cmis-0.3.2/lib/active_cmis/collection.rb:90:in `first'
from bin/alfy_cli.rb:33:in `<main>'
corresponding atom feed:
http://10.96.10.101:8080/alfresco/s/cmis/changes?maxItems=3
I have the following error when using cmis_4_redmine_2 with Alfresco 4.2 :
Error 500 Duplicate declaration for namespace prefix 'c'.
Following is the xml sent to the server :
<at:entry xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/"
xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
xmlns:cm="http://docs.oasis-open.org/ns/cmis/messaging/200908/"
xmlns:app="http://www.w3.org/2007/app"
xmlns:at="http://www.w3.org/2005/Atom"
xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/"
xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
xmlns:cm="http://docs.oasis-open.org/ns/cmis/messaging/200908/"
xmlns:app="http://www.w3.org/2007/app"
xmlns:at="http://www.w3.org/2005/Atom">
at:author
at:nameadmin/at:name
/at:author
at:titlemanuels/at:title
at:idrandom-garbage/at:id
cmisra:object
cmis:properties
<cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
cmis:valuecmis:folder/cmis:value
/cmis:propertyId
<cmis:propertyString propertyDefinitionId="cmis:name">
cmis:valuemanuels/cmis:value
/cmis:propertyString
/cmis:properties
/cmisra:object
/at:entry
Following my attempts to update a document (which doesn't work with Nuxeo, so I tried with Alfresco).
Here's my code :
pwc = doc.checkout
pwc.set_content_stream(:data=>contentStream, :overwrite => true)
pwc.checkin(false, "new version from redmine")
Unfortunately, this time I've a bug with the checkin function :
TypeError (can't convert String into Integer):
active_cmis (0.3.2) lib/active_cmis/object.rb:353:in []' active_cmis (0.3.2) lib/active_cmis/object.rb:353:in
block (2 levels) in render_atom_entry'
nokogiri-1.5.9-x86 (mingw32) lib/nokogiri/xml/builder.rb:391:in call' nokogiri-1.5.9-x86 (mingw32) lib/nokogiri/xml/builder.rb:391:in
insert'
nokogiri-1.5.9-x86 (mingw32) lib/nokogiri/xml/builder.rb:375:in method_missing' active_cmis (0.3.2) lib/active_cmis/object.rb:348:in
block in render_atom_entry'
nokogiri-1.5.9-x86 (mingw32) lib/nokogiri/xml/builder.rb:293:in initialize' active_cmis (0.3.2) lib/active_cmis/object.rb:347:in
new'
active_cmis (0.3.2) lib/active_cmis/object.rb:347:in render_atom_entry' active_cmis (0.3.2) lib/active_cmis/document.rb:211:in
render_atom_entry'
active_cmis (0.3.2) lib/active_cmis/object.rb:437:in save_attributes' active_cmis (0.3.2) lib/active_cmis/document.rb:193:in
block in checkin'
active_cmis (0.3.2) lib/active_cmis/document.rb:192:in each' active_cmis (0.3.2) lib/active_cmis/document.rb:192:in
checkin'
plugins/redmine_cmis/lib/cmis_module.rb:76:in `update_document_relative'
You can find cmis_module.rb there : https://github.com/BrunoSpy/cmis_4_redmine_2/blob/master/lib/cmis_module.rb
Update method failed with any attributes and values.
Debugging into the server which is implemented on OpenCMIS, I found AtomEntryParser recognize the atompub request body has only one line and failed to parse it.
We are implementing document replacement in our application and wanted to use versioning and no matter the value we pass to the set_versioning_state
method, always a minor version is created.
When I'm checking the Alfresco log file, I see that the PUT call is missing the versioningState
argument.
I will fix it soon and send a PR.
I am using the HTTParty gem and as soon as I add require 'active_cmis'
the HTTParty get
method fails with ``handle_deflation': undefined method[]' for nil:NilClass
. This is in a Rails project but I have confirmed it also occurs in a one file Ruby project.
require 'rubygems'
require 'httparty'
require 'active_cmis'
class Ting
include HTTParty
end
Ting.get('http://teamcoding.com')
Both ActiveCMIS and HTTParty use the Net::HTTP, but I couldn't find anywhere where it is monkey patched in either.
Disclaimer: I may be doing this wrong.
load_config
works fine but I don't wish to use a yaml file.
server = ActiveCMIS::Server.new('http://localhost:8082/alfresco/service/cmis')
server = server.authenticate(:basic, 'admin', 'admin)
repo = server.repository('SOME NODE ID')
# => undefined method `authentcation_info' for Server http://localhost:8082/alfresco/service/cmis:ActiveCMIS::Server
The work around is to pass nil
as a second parameter to server.repository
.
I can see there is a mispelling of authentication here but correcting it did not help.
Hey :-)
thanks for gem! i start using it and found it very helpful.
I have an error by using ruby-1.9.3. The error do not occur if i switch to ruby-1.8.7
require 'pp'
require 'rubygems'
require 'active_cmis'
alfresco = ActiveCMIS.load_config('alfresco_public')
store = alfresco.object_by_id('workspace://SpacesStore/aab0c41f-e021-4427-842d-7ae010662a53')
puts "store found"
store.items.each do |item|
if item.cmis.objectTypeId == "cmis:document"
puts "is doc #{item.name}"
item.content_stream.get_file('test_file') # content_stream is nil.....
else
puts "is directory #{item.name}"
end
end
ruby-1.9.3 error, 1.8.7 no problems, occur on
store found
is doc testdoc.txt
/Users/cbaus/.rvm/gems/ruby-1.9.3-p194/gems/active_cmis-0.3.1/lib/active_cmis/internal/connection.rb:58:in `get_response': undefined method `code' for nil:NilClass (NoMethodError)
from /Users/cbaus/.rvm/gems/ruby-1.9.3-p194/gems/active_cmis-0.3.1/lib/active_cmis/rendition.rb:62:in `get_data'
from /Users/cbaus/.rvm/gems/ruby-1.9.3-p194/gems/active_cmis-0.3.1/lib/active_cmis/rendition.rb:48:in `get_file'
from cmis_test_cli.rb:15:in `block in <main>'
from /Users/cbaus/.rvm/gems/ruby-1.9.3-p194/gems/active_cmis-0.3.1/lib/active_cmis/collection.rb:100:in `block in each'
from /Users/cbaus/.rvm/gems/ruby-1.9.3-p194/gems/active_cmis-0.3.1/lib/active_cmis/collection.rb:100:in `times'
from /Users/cbaus/.rvm/gems/ruby-1.9.3-p194/gems/active_cmis-0.3.1/lib/active_cmis/collection.rb:100:in `each'
from cmis_test_cli.rb:12:in `<main>'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.