06-28-2012 09:17 PM
06-29-2012 12:05 AM
06-29-2012 08:37 AM
06-29-2012 10:42 AM
Curious, if "alfcmis:nodeRef" is an Alfresco-specific ID, why the alfcmis prefix? Is it specific to CMIS use only?That is correct, the alfcmis prefix is something you will only see when using CMIS against Alfresco. In plain old Alfresco, there is no "nodeRef" property in the model. When you ask for the nodeRef you can get it, obviously, but it isn't defined in the model. It is helpful to have the Alfresco nodeRef available when using CMIS, especially if you are making both CMIS and non-CMIS calls, so it made sense to add it to the CMIS model. The "alfcmis" prefix distinguishes it from the pure CMIS stuff.
Just to clarify a related item: for the session.getObject(ObjectId x) and getObject(String objID) methods, those expect the ID returned from something like Document.getId() right? NOT the alfcmis:nodeRef.Correct, you should always assume you are dealing with CMIS Object ID's when you are working with CMIS. Only use a node ref when you are doing something Alfresco specific.
07-08-2012 09:34 PM
07-09-2012 12:54 PM
>>> doc = folder.getChildren()[0]
>>> doc.name
u'test'
>>> doc2 = folder.createDocument('testrel')
>>> doc.addAspect('P:cm:referencesnode')
>>> props = {'cm:noderef': doc2.properties['alfcmis:nodeRef']}
>>> doc.updateProperties(props)
<cmislib.model.Document object at 0x10caeacd0>
>>> doc2.properties['cm:noderef']
'workspace://SpacesStore/0e9f1749-e311-4559-85e9-7be3104b7b02'
>>> reldoc = repo.getObject('workspace://SpacesStore/0e9f1749-e311-4559-85e9-7be3104b7b02')
>>> reldoc = reldoc.getLatestVersion()
>>> reldoc.name
u'testrel'
>>> reldoc.id
'workspace://SpacesStore/0e9f1749-e311-4559-85e9-7be3104b7b02;1.0'
07-09-2012 02:11 PM
Using associations is definitely preferred. Is that an option for you?Everything's on the table.
07-09-2012 02:21 PM
07-09-2012 06:59 PM
<associations>
<association name="sc:relatedDocuments">
<title>Related Documents</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>sc:doc</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
For example, I assume "source" refers to the type within which the Association is being defined, and "target" is the acceptable object-types that can be associated. Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.