0
votes

I'm working on a Liferay portlet, that connects to an Alfresco Repository through Cmis and wsdl binding, (BINDING_TYPE = BindingType.WEBSERVICES)

So far I've implemented most of the required functionality (Browsing, Folder/Doc management, doc versions, permissions etc). Now it's time to implement some aspect-related functionality, so it was time to use the alfresco open-cmis-extensions, which seems to be a straightforward process.

One of the things I had to do, was changing the Session Factory to 'AlfrescoObjectFactoryImpl'

parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");

After that, Ι still have success getting the Session, but as soon as I try to fetch any repository Folder I get an InvalidArgumentException while the Folder properties are being converted


my debug log:

! 12:51:11,542 DEBUG CmisWebServicesSpi:58 - Initializing Web Services SPI... 12:51:11,692 DEBUG AbstractPortProvider:244 - Initializing Web Service org.apache.chemistry.opencmis.binding.webservices.ObjectService... 12:51:16,426 DEBUG PortProvider:65 - Creating Web Service port object of {http://docs.oasis-open.org/ns/cmis/ws/200908/}ObjectService... 12:51:36,103 ERROR [render_portlet_jsp:154] java.lang.IllegalArgumentException: Unknown aspect property: http://docs.oasis-open.org/ns/cmis/core/200908/ at org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl.convertProperties(AlfrescoObjectFactoryImpl.java:265) at org.apache.chemistry.opencmis.client.runtime.AbstractCmisObject.initialize(AbstractCmisObject.java:108) at org.alfresco.cmis.client.impl.AlfrescoFolderImpl.initialize(AlfrescoFolderImpl.java:46) at org.apache.chemistry.opencmis.client.runtime.FolderImpl.(FolderImpl.java:69) at org.alfresco.cmis.client.impl.AlfrescoFolderImpl.(AlfrescoFolderImpl.java:39) .........................


I'm using: Liferay 6.1 and alfresco-opencmis-extension-0.3.jar

and the repository is alfresco Community - v4.0.0 (4003)


My best guess so far is that some property Definition is not properly set, as a namespace is passed as an aspect property

Any thoughts on what I'm doing wrong ?

Note that I haven't try to do anything aspect-related yet. By commenting out the 'OBJECT_FACTORY_CLASS' parameter, everything works fine!

1
Would be helpful if you would add the code that fetches the AlfrescoFolderImpl object. - Jeff Potts
Did you try with the AtomPub binding instead, just to check it's not a ws problem? (Also, the AtomPub binding is normally a little faster!) - Gagravarr
@jeff Potts: Ι didn't override anything concerning the Alfresco Impl. I just added the OBJECT_FACTORY_CLASS to the session parameters, following the open-cmis-extension tutorials. - yannicuLar
@Gagravarr I have to use the WSDL binding anyway (it's a requirement), but the same binding worked just fine so far. Do you believe it might not work with the Alfresco extensions? - yannicuLar

1 Answers

1
votes

After following Gagravarr 's idea, I tried an ATOMPUB binding instead of Web Services, and I finally connected successfully.

Turns out, the alfrescoExtensions fetched by AlfrescoAspectsUtils.findAlfrescoExtensions, contained properties with incorrect propertyDefinitionId, which lead to a crash in AlfrescoAspectsUtils.findAspect.

Maybe the Webservice binding for that repository might have not been set correctly

After some debugging, the same property values were

WSDL: -propertyDefinitionId = (http)://docs.oasis-open.org/ns/cmis/core/200908/

ATOM: propertyDefinitionId = app:icon

Thank you Gagravarr !