Tuesday, January 15, 2013

Sharepoint 2013 w/ Apache Chemistry CMIS

Sharing my experience in trying to use the CMIS library to work with Sharepoint 2013.  As a prefix, I have existing code integrated into a CEVA (content-enabled vertical application, that seems to be the buzzword) using Alfresco 4.2 CE as a backend, and evaluating compatibility of the system with a Sharepoint 2013 backend (I'm not swapping to sharepoint, just cross-checking).

I use 'sp2013' for the server name, replace as appropriate.

  1. Work with CMIS-Workbench as your go-to tool for confirmation before working with your code.  This is like your SoapUI when working with Webservices, or your Database Editor tool when trying to write queries for your application.  Work through everything you want to do with CMIS Workbench *first* before you write code.
  2.  Sharepoint 2013 setup notes:
    1. Sharepoint Central Admin (http://sp2013:90/): 
      1. Security, under 'General Security' section, 'Specify Authentication Providers'. 
      2. Pick the default zone, or if you know Sharepoint the appropriate zone. 
      3. Under Windows Auth, I had to enable 'basic auth'...I also disabled integrated as my intent was to use Sharepoint soley as a repository, so no need to get the system confused between integrated or basic auth (obviously, if using this route in production, need to setup SSL).
    2. Site Settings (http://sp2013): 
      1. Pick the site you want to access through CMIS (for example, 'Documents').
      2. In the upper right, beside the login name, is a 'gear' icon for settings - click that, go to 'Site Settings'.
      3. Under 'Site Action' header is a 'Manage Site Features' link, click that.
      4. Activate 'Content Management Interoperability Services (CMIS) Producer'
      5. Repeat for each site you want to access. Each site will appear as a unique Repository from the CMIS point of view.
  3. Again, use CMIS Workbench for all your confirmation/testing.  Add some files/folders to the above Site(s)/Repo(s) you shared for CMIS.
    1. Connect to the URL http://sp2013/cmis/rest/?getRepositories through CMIS Workbench. You will likely use this one for your apache chemistry code as well.
    2. For Apache Chemistry, Lesson learned --
      1. DO NOT try to create a session by re-using your Map param and add in the repo ID...instead, get the Repository object directly, and use the Repository.createSession().
      2. For example of best-approach/usage of the Apache Chemistry CMIS library, look at the CMIS Workbench source code (that is how I learned the above error/correction).
  4. There are some CMIS functions that DO NOT work with Sharepoint 2013.  I ran into only one and have not done a thorough review, but this already delayed me significantly:
    1. SCORE() does not work in Sharepoint 2013
A HUGE kudos goes to  http://gauravmahajan.net/2013/01/06/sharepoint-2013-rtm-on-win-server-2012-virtual-machine-download/, I already spent enough time just dealing with Sharepoint and CMIS, much less getting all the infrastructure up and running - big thank you!

-Darren

7 comments:

Nicolas said...

Hi, thanks for this article. I followed your instructions to setup sp2013. From the CMIS Workbench, I can load the repositories. However, when I select one of the repositories such as "Documents" and click login, I get an error: "Invalid Argument: One or more of the input parameters to the service method is missing or invalid." I noticed that the urls in the service document don't even work when I try to use them in a browser. Any ideas about what's wrong?

dhartford said...

Hi Nicolas,
I ran into this problem as well. If it is what I think it is, you may have accessed the website through an IP address versus a domain name (or a domain name fragment), and the redirect done when selecting a repository was a different server name.

The 'quick' workaround is to modify your windows or linux 'hosts' file where you are running CMIS Workbench to add that as a domain name to the appropriate IP address.

This isn't CMIS specific, but is how Sharepoint shares its information through CMIS and has assumptions that the server and associated infrastructure is setup 'appropriately'. HTH! -Darren

Nicolas said...

Hi Darren. Thanks for the response. I tried the hosts workaround but that didn't work as well. I will try to find an answer from stackoverflow.

Nicolas Raoul said...

I just installed SharePoint 2013 Standard on Windows Server 2012, and http://server/cmis/rest/?getRepositories return error 404.
A step further, http://server/_vti_bin/cmissoapwsdl.aspx returns an XML CMIS endpoint definition, but CMIS Workbench chokes on it.
It amazes me how poorly documented SharePoint is in comparizon with Alfresco/Nuxeo.

Nicolas said...

@Nicolas Raoul.

Try
http://yourserver/yoursite/cmis/_vti_bin/cmis/rest?getRepositories

That gives me the list of repositories but I cannot logon

dhartford said...

Thanks Raoul on the stackoverflow link, I didn't realize this issue: https://issues.apache.org/jira/browse/CMIS-294

(affects Sharepoint and Filenet)

I did not run into this issue which surprises me, since I do have username/passwords setup (but no SSL in local test environment).

Anonymous said...

Hi,
I know this is old post,but I am also facing problem same like Nicolas Raoul said

http://server/cmis/rest/?getRepositories return error 404.
A step further, http://server/_vti_bin/cmissoapwsdl.aspx returns an XML CMIS endpoint definition, but CMIS Workbench chokes on it.