Hi,

Trying to use this API to integrate with SP 2010. Here's what I've done so far.

Configured CMIS in SP 2010. My SOAP URL for the CMIS endpoint looks something like this:

http://<SPURL>/_vti_bin/cmissoapwsdl.aspx?wsdl

It works when I check it from the browser.

I've added and enabled the CMIS module in my Drupal 7 site. Also made the following change in settings.php.

$conf['cmis_repositories'] = array(
  'default' => array(
    'user' => '<sp username>',
    'password' => '<sp password>',
    'url' => 'http://<SPURL>/_vti_bin/cmissoapwsdl.aspx?wsdl'
  )
);

However, I'm getting the following error every time I go to the sample links that are added for browsing and querying CMIS:

Notice: Undefined index: cmis:repositoryId in cmis_get_repository() (line 95 of C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mydrupal\sites\all\modules\cmis\cmis.module).

I've tried searching for a solution for this with no luck. Could someone please shed some light on this issue?

Thank you.

Comments

utkarsh_w’s picture

Hey!

Just wanted to post an update that we made a little progress on this issue. It seems that the response returned by the SP 2010 CMIS Producer is a little different from what the API expects. The "cmis:repositoryId" field is actually just "repositoryId" in the SP response. We were able to get the document library in Drupal after removing the "cmis:" part. However there are still errors...

Now we're getting this

Notice: Trying to get property of non-object in CMISRepositoryWrapper::getLinksArray() (line 195 of C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mydrupal\sites\all\modules\cmis\cmis_common\lib\cmis_repository_wrapper.php).
Notice: Trying to get property of non-object in CMISRepositoryWrapper::getLinksArray() (line 203 of C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mydrupal\sites\all\modules\cmis\cmis_common\lib\cmis_repository_wrapper.php).

on the following line in cmis_repository_wrapper.php file. The document listing however gets displayed on the test page, although the actions don't work. They error out with similar messages as above.

This leads me to believe that the CMIS response form SharePoint isn't exactly as per the standard. Can anyone confirm this?

Thanks.

utkarsh_w’s picture

Hi guys,

Finally got this working. However it did take a lot of debugging and digging through the API code. The major problem is that SharePoint's CMIS responses aren't exactly compatible with the API. Below is a brief description of the changes that we had to make in the API files...

- The API was not able to connect to the SharePoint REST service and kept giving us a 401 error. We eventually overcame this by adding the following line in cmis_common.module.

curl_setopt($session, CURLOPT_HTTPAUTH, CURLAUTH_ANY);

- The next set of errors which we ran into dealt with the cmis:repositoryId, cmis:rootFolderId and cmis:id fields being invalid. SharePoint simply returned them as repositoryId, rootFolderId and id respectively. Our solution was to hunt down these instances and add an isset() check before each use. This solved the errors and took us to the next step.

- At this point we were able to browse the document library from Drupal but weren’t able to add or delete files and folders from Drupal. The error mostly revolved around incorrect request format being passed to the SharePoint CMIS consumer.
This issue actually took a while to figure out. We eventually found that SharePoint needed the document name to be passed as a separate XML tag in the request. There were also certain instances where the name expected by SharePoint didn’t contain the “cmis:” prefix. So eventually the request had to look like this:

 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
- <atom:entry xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
  <atom:title>sp.txt</atom:title> 
  <atom:summary>sp.txt</atom:summary> 
- <cmisra:content>
  <cmisra:mediatype>text/plain</cmisra:mediatype> 
  <cmisra:base64>aHR0cDovL25pdC13a3MtMTU1OjY2NjYNCg0KbWVlbmFsbg0KbWVlbmFsMTIzDQoNCmh0dHA6Ly9uaXQtaHYzLW1vczo0</cmisra:base64> 
  </cmisra:content>
- <cmisra:object>
- <cmis:properties>
- <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
  <cmis:value>cmis:document</cmis:value> 
  </cmis:propertyId>
- <cmis:propertyString propertyDefinitionId="cmis:name">
  <cmis:value>sp.txt</cmis:value> 
  </cmis:propertyString>
  </cmis:properties>
  </cmisra:object>
  </atom:entry>

For this we had to make changes in the postObject() and extractTypeDefFromNode() methods in the cmis_repository_wrapper.php file.

After this we were able to get the add and delete functionality working.

- Lastly we ran into issues while downloading the shared documents from Drupal. Their contents were in a garbled state. For this we had to implement a base64 check in the cmis_browser.content_get.inc file. SharePoint returned the contents encoded as base64.

Hope that helps anyone else facing issues with getting this to work with SharePoint.

JeremyFrench’s picture

Status: Active » Closed (duplicate)

Thanks for posting your patch in #1307180: Sharepoint Support, closing this ticket as a duplicate so attention is focused on that ticket.

jaypark’s picture

Status: Closed (duplicate) » Needs work

how is this a dupe? applies to 2 different major versions...

JeremyFrench’s picture

The other issue was to get share point support working. Once that is done the issue can be changed to D7, rather than have two bugs which may have much parallel work.

Zimsil’s picture

The patch that is shown there isnt working.