CMIS with multi tenancy
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2012 04:21 PM
We're using CMIS (via OpenCMIS) to access an Alfresco Community 4.0b repository with multi-tenancy enabled. When we were using the "old" 3.x CMIS AtomPub endpoint, users in different tenants got the tenant-specific folders and documents in object fetches. When using the new 4.x endpoint, all tenants get objects back from the "non-tenant" spaces.
For example, getObjectByPath("/Foo/Bar") using "someone@tenant" would return the ID of the tenant-specific folder.
When switching to the new binding, "/Foo/Bar" returns the ID of the folder in the "non-tenant" area of the repository (not sure what to call that).
I searched through JIRA but didn't see any bugs related to CMIS and multi-tenancy. Has anyone else seen this behavior?
For example, getObjectByPath("/Foo/Bar") using "someone@tenant" would return the ID of the tenant-specific folder.
When switching to the new binding, "/Foo/Bar" returns the ID of the folder in the "non-tenant" area of the repository (not sure what to call that).
I searched through JIRA but didn't see any bugs related to CMIS and multi-tenancy. Has anyone else seen this behavior?
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2012 02:00 AM
Yes, I've seen this behaviour! We will try with the 4.0 Enterprise version and 4.0d :cry:
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2012 04:20 AM
Just tested with the enterprise release: the repository ids are identical in all tenants, the id's of the folders and documents inside differ!
So I'll give the 4.0d community edition a try (was released the same day).
So I'll give the 4.0d community edition a try (was released the same day).
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2012 09:01 AM
Thanks, I'll also upgrade to 4.0d as well and see if that has a fix.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2012 06:30 PM
I have an update to this. We continued issues with Alfresco 4.0.d Community and the 4.x Atom endpoint. I debugged the problem and it turned out to be an issue with how the CMISConnector manages its map of CMISRenditionMapping objects. In a multi-tenancy environment, the map does not seem to get pre-populated consistently. So the following code can cause a NullPointerException:
My fix was to test for "null" and add a map entry if needed:
Hope this helps anyone who's using Alfresco 4.0 Community with CMIS and multi-tenancy enabled.
public List<RenditionData> getRenditions(NodeRef nodeRef, String renditionFilter, BigInteger maxItems, BigInteger skipCount) { String tenantDomain = tenantAdminService.getCurrentUserDomain(); CMISRenditionMapping mapping = renditionMapping.get(tenantDomain); //BUG: "mapping" might be null return mapping.getRenditions(nodeRef, renditionFilter, maxItems, skipCount); }
My fix was to test for "null" and add a map entry if needed:
public List<RenditionData> getRenditions(NodeRef nodeRef, String renditionFilter, BigInteger maxItems, BigInteger skipCount) { String tenantDomain = tenantAdminService.getCurrentUserDomain(); CMISRenditionMapping mapping = getRenditionMapping(tenantDomain); return mapping.getRenditions(nodeRef, renditionFilter, maxItems, skipCount); } private CMISRenditionMapping getRenditionMapping(String tenantDomain) { CMISRenditionMapping mapping = renditionMapping.get(tenantDomain); if (mapping == null) { mapping = new CMISRenditionMapping(nodeService, contentService, renditionService, transactionService, kindToRenditionNames); } return mapping; }
Hope this helps anyone who's using Alfresco 4.0 Community with CMIS and multi-tenancy enabled.