diff --git a/lib/api/ktcmis/classes/CMISPropertyCollection.inc.php b/lib/api/ktcmis/classes/CMISPropertyCollection.inc.php index 210d691..22dbd63 100644 --- a/lib/api/ktcmis/classes/CMISPropertyCollection.inc.php +++ b/lib/api/ktcmis/classes/CMISPropertyCollection.inc.php @@ -46,6 +46,7 @@ abstract class CMISPropertyCollection { static $ObjectId; + static $BaseType; static $URI; static $ObjectTypeId; static $CreatedBy; @@ -59,11 +60,15 @@ abstract class CMISPropertyCollection { function __construct() { - $this->propertyTypes = array('ObjectId' => 'propertyId', 'BaseType' => 'propertyString', - 'ObjectTypeId' => 'propertyString', 'CreatedBy' => 'propertyString', - 'CreationDate' => 'propertyDateTime', 'LastModifiedBy' => 'propertyString', - 'LastModificationDate' => 'propertyDateTime', 'Name' => 'propertyString', - 'ParentId' => 'propertyId'); + $this->propertyTypes = array('ObjectId' => 'propertyId', + 'BaseType' => 'propertyString', + 'ObjectTypeId' => 'propertyString', + 'CreatedBy' => 'propertyString', + 'CreationDate' => 'propertyDateTime', + 'LastModifiedBy' => 'propertyString', + 'LastModificationDate' => 'propertyDateTime', + 'Name' => 'propertyString', + 'ParentId' => 'propertyId'); } /** diff --git a/lib/api/ktcmis/objecttypes/CMISDocumentObject.inc.php b/lib/api/ktcmis/objecttypes/CMISDocumentObject.inc.php index 8b5b8f2..99ef152 100644 --- a/lib/api/ktcmis/objecttypes/CMISDocumentObject.inc.php +++ b/lib/api/ktcmis/objecttypes/CMISDocumentObject.inc.php @@ -119,6 +119,8 @@ class CMISDocumentObject extends CMISBaseObject { $this->_setPropertyInternal('URI', $uri); // TODO what is this? Assuming it is the object type id, and not OUR document type? $this->_setPropertyInternal('ObjectTypeId', $this->getAttribute('typeId')); + // Needed to distinguish type + $this->_setPropertyInternal('BaseType', strtolower($this->getAttribute('typeId'))); $this->_setPropertyInternal('CreatedBy', $objectProperties['created_by']); $this->_setPropertyInternal('CreationDate', $objectProperties['created_date']); $this->_setPropertyInternal('LastModifiedBy', $objectProperties['modified_by']); diff --git a/lib/api/ktcmis/objecttypes/CMISFolderObject.inc.php b/lib/api/ktcmis/objecttypes/CMISFolderObject.inc.php index 93e542c..a2e6408 100644 --- a/lib/api/ktcmis/objecttypes/CMISFolderObject.inc.php +++ b/lib/api/ktcmis/objecttypes/CMISFolderObject.inc.php @@ -97,6 +97,8 @@ class CMISFolderObject extends CMISBaseObject { $this->_setPropertyInternal('URI', $uri); // TODO what is this? Assuming it is the object type id, and not OUR document type? $this->_setPropertyInternal('ObjectTypeId', $this->getAttribute('typeId')); + // Needed to distinguish type + $this->_setPropertyInternal('BaseType', strtolower($this->getAttribute('typeId'))); $this->_setPropertyInternal('CreatedBy', $objectProperties['created_by']); // TODO cannot currently retrieve via ktapi or regular folder code - add as with created by $this->_setPropertyInternal('CreationDate', $objectProperties['created_date']); diff --git a/lib/api/ktcmis/util/CMISUtil.inc.php b/lib/api/ktcmis/util/CMISUtil.inc.php index 49342f3..af79356 100644 --- a/lib/api/ktcmis/util/CMISUtil.inc.php +++ b/lib/api/ktcmis/util/CMISUtil.inc.php @@ -224,6 +224,8 @@ class CMISUtil { // TODO additional properties to be returned $hierarchy[$key]['properties']['ObjectId'] = array('type' => $properties->getFieldType('ObjectId'), 'value' => $properties->getValue('ObjectId')); + $hierarchy[$key]['properties']['BaseType'] = array('type' => $properties->getFieldType('BaseType'), + 'value' => $properties->getValue('BaseType')); $hierarchy[$key]['properties']['ObjectTypeId'] = array('type' => $properties->getFieldType('ObjectTypeId'), 'value' => $properties->getValue('ObjectTypeId')); $hierarchy[$key]['properties']['Name'] = array('type' => $properties->getFieldType('Name'),