chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpo...@apache.org
Subject svn commit: r919625 - /incubator/chemistry/trunk/cmislib/src/cmislib/model.py
Date Fri, 05 Mar 2010 21:26:44 GMT
Author: jpotts
Date: Fri Mar  5 21:26:44 2010
New Revision: 919625

URL: http://svn.apache.org/viewvc?rev=919625&view=rev
Log:
Fixed a bug in _getXmlEntryDoc that was keeping CmisId properties from being translated into
cmis:propertyId elements. This was breaking object creation on Nuxeo.

Modified:
    incubator/chemistry/trunk/cmislib/src/cmislib/model.py

Modified: incubator/chemistry/trunk/cmislib/src/cmislib/model.py
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/cmislib/src/cmislib/model.py?rev=919625&r1=919624&r2=919625&view=diff
==============================================================================
--- incubator/chemistry/trunk/cmislib/src/cmislib/model.py (original)
+++ incubator/chemistry/trunk/cmislib/src/cmislib/model.py Fri Mar  5 21:26:44 2010
@@ -2167,12 +2167,12 @@
                 I could do a lookup to the type definition, but that doesn't
                 seem worth the performance hit
                 """
-                if isinstance(propValue, str):
-                    propElementName = 'cmis:propertyString'
-                    propValueStr = propValue
-                elif isinstance(propValue, CmisId):
+                if isinstance(propValue, CmisId):
                     propElementName = 'cmis:propertyId'
                     propValueStr = propValue
+                elif isinstance(propValue, str):
+                    propElementName = 'cmis:propertyString'
+                    propValueStr = propValue
                 elif isinstance(propValue, datetime.datetime):
                     propElementName = 'cmis:propertyDateTime'
                     propValueStr = propValue.isoformat()
@@ -2583,15 +2583,20 @@
         """
         Creates a new :class:`Folder` using the properties provided.
         Right now I expect a property called 'cmis:name' but I don't
-        complain if it isn't there (although the CMIS provider will)
-
-        See CMIS specification document 2.2.4.3 createFolder
+        complain if it isn't there (although the CMIS provider will). If a
+        cmis:name property isn't provided, the value passed in to the name
+        argument will be used.
+
+        To specify a custom folder type, pass in a property called
+        cmis:objectTypeId set to the :class:`CmisId` representing the type ID
+        of the instance you want to create. If you do not pass in an object
+        type ID, an instance of 'cmis:folder' will be created.
 
         >>> subFolder = folder.createFolder('someSubfolder')
         >>> subFolder.getName()
         u'someSubfolder'
 
-        The following optional arguments are not yet supported:
+        The following optional arguments are not supported:
          - policies
          - addACEs
          - removeACEs
@@ -2654,6 +2659,11 @@
         <cmislib.model.Document object at 0x10410fa10>
         >>> f.close()
 
+        To specify a custom object type, pass in a property called
+        cmis:objectTypeId set to the :class:`CmisId` representing the type ID
+        of the instance you want to create. If you do not pass in an object
+        type ID, an instance of 'cmis:document' will be created.
+
         The following optional arguments are not yet supported:
          - versioningState
          - policies



Mime
View raw message