0

I am using DotCMIS with no problem to connect to Alfresco and FileNet.

I registered for an IBM Connections account, added a few files via the web interface, and tried to connect to its CMIS endpoint https://greenhouse.lotus.com/files/basic/cmis/my/servicedoc

GetRepositories on this URL gives one repository, which in turn contain the two folders below:

My Files
My Folders

But when I run GetObjectByPath("/My Files") in the same repository, I get:

DotCMIS.Exceptions.CmisObjectNotFoundException was unhandled
 Message=Not Found
 Source=DotCMIS
 ErrorContent=<?xml version="1.0" encoding="UTF-8"?><lcmis:error xmlns:lcmis="http://www.ibm.com/xmlns/prod/sn/cmis"><lcmis:code>objectNotFound</lcmis:code><lcmis:message>EJPVJ9023E: Unable to find object at path /My Files</lcmis:message><lcmis:userAction></lcmis:userAction></lcmis:error>

What does IBM Connections say Unable to find object at path /My Files despite My Files being a folder at the root of the repository?

Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373

1 Answers1

2

The cmis:name property ("My Files", "My Folers") is localized. A non-English user would get different cmis:name property values for these two objects.

To fetch children from these resources, you need to build the path using the cmis:path property returned on each object or construct the path relative to its parent using the cmisra:pathSegment.

For example, the cmis:object for the resource labeled "My Files" in your scenario has the following:

<cmis:propertyString propertyDefinitionId="cmis:path"
 localName="cmis_path" displayName="Path" queryName="cmis:path">
 <cmis:value>/files</cmis:value>
</cmis:propertyString>

So to actually fetch the user's files, the path to call is the following:

GetObjectByPath("/files")

And to fetch the user's folders, the path to call is the following:

GetObjectByPath("/collections")

The net is to ensure you build paths using the cmisra:pathSegment or the cmis:path property, and not the cmis:name as this may not be valid in all scenarios (i.e. if the repository has same name siblings, etc.).

Derek Carr
  • 36
  • 1
  • Thanks a lot for the tip! `GetObjectByPath("/files")` fails with `System.ArgumentException "Object type must have property defintions!" at DotCMIS.Client.Impl.AbstractCmisObject.Initialize` [*sic*]. I also tried `GetObjectByPath("/snx:files")` which fails with `CmisObjectNotFoundException "EJPVJ9023E: Unable to find object at path /snx:files" at DotCMIS.Binding.AtomPub.AbstractAtomPubService.Read`, I guess this one is normal behavior. I will try a few things with "/files" and come back to you later. – Nicolas Raoul Oct 11 '12 at 05:56
  • Your tip about localized names has helped me a lot, thanks! I still get an exception, but I guess it is a different problem, so I created a DotCMIS issue: https://issues.apache.org/jira/browse/CMIS-593 – Nicolas Raoul Oct 19 '12 at 06:51