chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <florian.muel...@alfresco.com>
Subject Re: OpenCMIS Client Questions
Date Wed, 15 Sep 2010 09:22:27 GMT
Hi Chris,

I hope I have some answers for you.

We still use the tools that were available when we started OpenCMIS 
(Maven 2 and jaxws-rt 2.1.7). Since we didn't run into any problem with 
that we had never changed it. Also Maven 3 doesn't seem to be widely 
used yet. We may should start a discussion moving to jaxws-rt 2.2 but I 
don't think will adopt Maven 3 anytime soon.

The CMIS specification has no notion of a default or primary repository. 
All repositories are equal. So OpenCMIS needs a hint which repository to 
contact to. If you don't know the repository id, the method 
SessionFactory.getRepositories() returns all available repositories. See 
[1] for a code snippet.

There are only a few exceptions that OpenCMIS actually raises by itself. 
In most cases OpenCMIS translates the error messages from the repository 
into Java exceptions. SessionFactory.createSession() connects to the 
repository to get the repository info. In theory, a repository could 
return any error mentioned in the CMIS specification - even if doesn't 
make sense. So OpenCMIS has to be prepared to forward these error 
messages to the client API. That's why a client has to handle all 
exceptions derived from CmisBaseException.

The current Session implementation is thread-safe. It's not prominently 
mentioned somewhere. We should add it to the documentation.

There is no (official) way to get a URL that returns the document 
content for a simple reason: It doesn't work with the Web Services 
binding. With the Web Services binding there is always a Web Services 
wrapper around the content. There is no plain content URL by definition 
and it might not even be transported via HTTP.

If you are only using the AtomPub binding there are two ways to achieve 
what you want.
1) You can get the content URL from OpenCMIS' internal binding cache. 
It's not supported, it's not a public API and it might change in the 
future. If you still want to do that, please contact me and I will send 
you a code snippet that gets you the URL.
2) If you just want to control the HTTP headers, you can extend the 
StandardAuthenticationProvider. It allows you set any HTTP header you 
want or need. See [2] and the JavaDoc for details.


Regards,

Florian




[1] 
http://incubator.apache.org/chemistry/opencmis-cookbook.html#OpenCMISCookbook-ConnectingtoaCMISrepositorybyAtomPub

[2] 
http://incubator.apache.org/chemistry/opencmis-client-bindings.html#OpenCMISClientBindings-CustomAuthenticationProvider



On 15/09/2010 06:42, Chris Hubick wrote:
> Hi,
>
> Having not updated my Chemistry client-using code from the custom
> patched version I had been using since before the OpenCMIS project
> merge, I decided it was time to give the chemistry-opencmis-client-impl
> 0.1.0-incubating-RC2 artifacts in the staging repository a try.
>
> My first problem was that chemistry-opencmis-commons-impl and
> chemistry-opencmis-client-bindings both require jaxws-rt 2.1.7, which is
> only available from http://download.java.net/maven/1/ and the Maven
> 3.0-beta-3 I am using no longer has support for legacy Maven 1
> repositories:
> https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-LegacystyleRepositories
> I was forced to manually locate, download, and install it into my local
> repo as a workaround.  The Maven 2 repo seems to have several versions
> of jaxws-rt 2.2 available, which could make things easier for users if
> it's not a huge upgrade.
>
> My next problem was PersistentSessionImpl.connect() throwing
> "IllegalStateException: Repository Id is not set!", and I am wondering
> if it's still possible to connect to a default repository without
> specifying an ID?  It doesn't appear like there would be API for the
> client to return a list of ID's before connecting a Session?
>
> The SessionFactory.createSession() method doesn't declare any
> exceptions, checked or otherwise.  The API of my software using this
> client declares different exceptions for problems with "configuration",
> "operational", "software", "content", etc, and so I'm left wondering
> what things to catch here so that I can properly wrap them.  Am I
> basically supposed to just look at _all_ CmisBaseException subclasses
> then, and pick the ones I might want to handle specially? (ie, a user
> can't know which method might throw which ones specifically)
>
> Neither the Javadoc for SessionFactory nor Session mention anything
> about the thread safety of Sessions?  I really hope they are safe - as
> if not, it looks like I'm in trouble as far as any shared cache reuse?
>
> My last, and I think biggest problem, is that I'm wondering if, given an
> arbitrary Document reference, if there is some way to access a URL
> through which one could retrieve that document directly from the
> repository via HTTP?  Once I have used CMIS to locate a Document needed
> by a client, I would rather not have to use the CMIS client library to
> proxy all further access to the repository, as this would almost
> certainly prevent a lot of potential HTTP features (proper
> Cache-Control, Accept-Ranges, etc) which might be utilized directly.
>
> Much Thanks for the library, and any direction you might provide! :)
>


Mime
View raw message