Commit d71619f9bad7b8937ebaec51d4d87a1f76d10c52
1 parent
be240047
Fix CMIS Spaces access and some of the folder listing problems
Story ID:2295472. Update KT CMIS implementation to 1.0 compliance Committed by: Paul Barrett Reviewed: Charl Mert
Showing
23 changed files
with
353 additions
and
247 deletions
lib/api/ktcmis/classes/AbstractEnum.inc.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Base class for enumerators | |
| 5 | + */ | |
| 6 | + | |
| 7 | +// TODO enable creation of enum instances on the fly - this will most likely be done in an extending class | |
| 8 | + | |
| 9 | +abstract class AbstractEnum { | |
| 10 | + | |
| 11 | + static private $values; | |
| 12 | + static private $value; | |
| 13 | + static private $name; | |
| 14 | + | |
| 15 | + /** | |
| 16 | + * Sets the value of the enumerator | |
| 17 | + * | |
| 18 | + * @param unknown_type $value | |
| 19 | + * @throws invalidArgumentException if the given value does not match one of the allowed values | |
| 20 | + */ | |
| 21 | + static protected function set($value) | |
| 22 | + { | |
| 23 | + if (!in_array($value, self::$values)) { | |
| 24 | + throw new InvalidArgumentException("Unable to set value for $name: Illegal input ($value)"); | |
| 25 | + } | |
| 26 | + | |
| 27 | + self::$value = $value; | |
| 28 | + } | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * Returns the currently set value, or null if unset | |
| 32 | + * | |
| 33 | + */ | |
| 34 | + static protected function get() | |
| 35 | + { | |
| 36 | + return self::$value; | |
| 37 | + } | |
| 38 | + | |
| 39 | +} | |
| 40 | + | |
| 41 | +?> | |
| 0 | 42 | \ No newline at end of file | ... | ... |
lib/api/ktcmis/classes/CMISDocumentPropertyCollection.inc.php
| ... | ... | @@ -51,35 +51,35 @@ require_once(CMIS_DIR . '/classes/CMISPropertyCollection.inc.php'); |
| 51 | 51 | */ |
| 52 | 52 | class CMISDocumentPropertyCollection extends CMISPropertyCollection { |
| 53 | 53 | |
| 54 | - static $Name; | |
| 55 | - static $IsImmutable; | |
| 56 | - static $IsLatestVersion; | |
| 57 | - static $IsMajorVersion; | |
| 58 | - static $IsLatestMajorVersion; | |
| 59 | - static $VersionLabel; | |
| 60 | - static $VersionSeriesId; | |
| 61 | - static $IsVersionSeriesCheckedOut; | |
| 62 | - static $VersionSeriesCheckedOutBy; | |
| 63 | - static $VersionSeriesCheckedOutId; | |
| 64 | - static $CheckinComment; | |
| 65 | - static $ContentStreamLength; | |
| 66 | - static $ContentStreamMimeType; | |
| 67 | - static $ContentStreamFilename; | |
| 68 | - static $ContentStreamUri; | |
| 54 | + static $name; | |
| 55 | + static $isImmutable; | |
| 56 | + static $isLatestVersion; | |
| 57 | + static $isMajorVersion; | |
| 58 | + static $isLatestMajorVersion; | |
| 59 | + static $versionLabel; | |
| 60 | + static $versionSeriesId; | |
| 61 | + static $isVersionSeriesCheckedOut; | |
| 62 | + static $versionSeriesCheckedOutBy; | |
| 63 | + static $versionSeriesCheckedOutId; | |
| 64 | + static $checkinComment; | |
| 65 | + static $contentStreamLength; | |
| 66 | + static $contentStreamMimeType; | |
| 67 | + static $contentStreamFilename; | |
| 68 | + static $contentStreamUri; | |
| 69 | 69 | |
| 70 | 70 | function __construct() |
| 71 | 71 | { |
| 72 | 72 | parent::__construct(); |
| 73 | - self::$propertyTypes = array_merge(self::$propertyTypes, array('ContentStreamAllowed' => 'propertyString', | |
| 74 | - 'ContentStreamLength' => 'propertyInteger', | |
| 75 | - 'ContentStreamMimeType' => 'propertyString', | |
| 76 | - 'ContentStreamFilename' => 'propertyString', | |
| 77 | - 'ContentStreamUri' => 'propertyUri', | |
| 78 | - 'IsLatestVersion' => 'propertyBoolean', | |
| 79 | - 'IsVersionSeriesCheckedOut' => 'propertyBoolean', | |
| 80 | - 'VersionSeriesCheckedOutBy' => 'propertyString', | |
| 81 | - 'VersionSeriesCheckedOutId' => 'propertyId', | |
| 82 | - 'VersionLabel' => 'propertyString')); | |
| 73 | + self::$propertyTypes = array_merge(self::$propertyTypes, array('contentStreamAllowed' => 'propertyString', | |
| 74 | + 'contentStreamLength' => 'propertyInteger', | |
| 75 | + 'contentStreamMimeType' => 'propertyString', | |
| 76 | + 'contentStreamFilename' => 'propertyString', | |
| 77 | + 'contentStreamUri' => 'propertyUri', | |
| 78 | + 'isLatestVersion' => 'propertyBoolean', | |
| 79 | + 'isVersionSeriesCheckedOut' => 'propertyBoolean', | |
| 80 | + 'versionSeriesCheckedOutBy' => 'propertyString', | |
| 81 | + 'versionSeriesCheckedOutId' => 'propertyId', | |
| 82 | + 'versionLabel' => 'propertyString')); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | } | ... | ... |
lib/api/ktcmis/classes/CMISFolderPropertyCollection.inc.php
| ... | ... | @@ -51,9 +51,9 @@ require_once(CMIS_DIR . '/classes/CMISPropertyCollection.inc.php'); |
| 51 | 51 | */ |
| 52 | 52 | class CMISFolderPropertyCollection extends CMISPropertyCollection { |
| 53 | 53 | |
| 54 | - static $Name; | |
| 55 | - static $ParentId; | |
| 56 | - static $AllowedChildObjectTypeIds; | |
| 54 | + static $name; | |
| 55 | + static $parentId; | |
| 56 | + static $allowedChildObjectTypeIds; | |
| 57 | 57 | |
| 58 | 58 | function __construct() |
| 59 | 59 | { | ... | ... |
lib/api/ktcmis/classes/CMISPropertyCollection.inc.php
| ... | ... | @@ -49,35 +49,35 @@ |
| 49 | 49 | */ |
| 50 | 50 | abstract class CMISPropertyCollection { |
| 51 | 51 | |
| 52 | - static $ObjectId; | |
| 53 | - static $BaseType; | |
| 54 | - static $Uri; | |
| 55 | - static $ObjectTypeId; | |
| 56 | - static $CreatedBy; | |
| 57 | - static $CreationDate; | |
| 58 | - static $LastModifiedBy; | |
| 59 | - static $LastModificationDate; | |
| 60 | - static $ChangeToken; | |
| 52 | + static $objectId; | |
| 53 | + static $baseTypeId; | |
| 54 | + static $uri; | |
| 55 | + static $objectTypeId; | |
| 56 | + static $createdBy; | |
| 57 | + static $creationDate; | |
| 58 | + static $lastModifiedBy; | |
| 59 | + static $lastModificationDate; | |
| 60 | + static $changeToken; | |
| 61 | 61 | // TODO these definitions belong in their own classe definition (see property type definions,) but here will do for now |
| 62 | 62 | static public $propertyTypes; |
| 63 | 63 | |
| 64 | 64 | function __construct() |
| 65 | 65 | { |
| 66 | - self::$propertyTypes = array('ObjectId' => 'propertyId', | |
| 67 | - 'Author' => 'propertyString', | |
| 68 | - 'BaseType' => 'propertyString', | |
| 69 | - 'ObjectTypeId' => 'propertyId', | |
| 70 | - 'CreatedBy' => 'propertyString', | |
| 71 | - 'CreationDate' => 'propertyDateTime', | |
| 72 | - 'LastModifiedBy' => 'propertyString', | |
| 73 | - 'LastModificationDate' => 'propertyDateTime', | |
| 74 | - 'Name' => 'propertyString', | |
| 75 | - 'Uri' => 'propertyUri', | |
| 76 | - 'AllowedChildObjectTypeIds' => 'propertyId', | |
| 77 | - 'CreatedBy' => 'propertyString', | |
| 78 | - 'CreationDate' => 'propertyDateTime', | |
| 79 | - 'ChangeToken' => 'propertyString', | |
| 80 | - 'ParentId' => 'propertyId'); | |
| 66 | + self::$propertyTypes = array('objectId' => 'propertyId', | |
| 67 | + 'author' => 'propertyString', | |
| 68 | + 'baseTypeId' => 'propertyId', | |
| 69 | + 'objectTypeId' => 'propertyId', | |
| 70 | + 'createdBy' => 'propertyString', | |
| 71 | + 'creationDate' => 'propertyDateTime', | |
| 72 | + 'lastModifiedBy' => 'propertyString', | |
| 73 | + 'lastModificationDate' => 'propertyDateTime', | |
| 74 | + 'name' => 'propertyString', | |
| 75 | + 'uri' => 'propertyUri', | |
| 76 | + 'allowedChildObjectTypeIds' => 'propertyId', | |
| 77 | + 'createdBy' => 'propertyString', | |
| 78 | + 'creationDate' => 'propertyDateTime', | |
| 79 | + 'changeToken' => 'propertyString', | |
| 80 | + 'parentId' => 'propertyId'); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** | ... | ... |
lib/api/ktcmis/classes/CMISRepository.inc.php
| ... | ... | @@ -84,6 +84,7 @@ class CMISRepository { |
| 84 | 84 | foreach($xml->repository as $repository) |
| 85 | 85 | { |
| 86 | 86 | $currentRepo = $repository->repositoryInfo[0]->repositoryId; |
| 87 | + // TODO this is no longer correct - is an object of SimpleXMLElement and not a string or int | |
| 87 | 88 | if ((int)$currentRepo == $this->repositoryId) |
| 88 | 89 | { |
| 89 | 90 | $config = $repository; | ... | ... |
lib/api/ktcmis/enums/EnumCapabilityACL.inc.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Enumaerator class for capabilityACL | |
| 5 | + */ | |
| 6 | + | |
| 7 | +require_once(realpath(dirname(__FILE__) . '/../../../../config/dmsDefaults.php')); | |
| 8 | + | |
| 9 | +define ('CMIS_DIR', KT_LIB_DIR . '/api/ktcmis'); | |
| 10 | +require_once(CMIS_DIR . '/classes/AbstractEnum.inc.php'); | |
| 11 | + | |
| 12 | +class EnumCapabilityACL extends AbstractEnum { | |
| 13 | + | |
| 14 | + static private $values = array('none', 'discover', 'manage'); | |
| 15 | + static private $name = 'capabilityACL'; | |
| 16 | +} | |
| 17 | + | |
| 18 | +?> | |
| 0 | 19 | \ No newline at end of file | ... | ... |
lib/api/ktcmis/enums/EnumCapabilityChanges.inc.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Enumaerator class for capabilityChanges | |
| 5 | + */ | |
| 6 | + | |
| 7 | +require_once(realpath(dirname(__FILE__) . '/../../../../config/dmsDefaults.php')); | |
| 8 | + | |
| 9 | +define ('CMIS_DIR', KT_LIB_DIR . '/api/ktcmis'); | |
| 10 | +require_once(CMIS_DIR . '/classes/AbstractEnum.inc.php'); | |
| 11 | + | |
| 12 | +class EnumCapabilityChanges extends AbstractEnum { | |
| 13 | + | |
| 14 | + static private $values = array('none', 'objectidsonly', 'properties', 'all'); | |
| 15 | + static private $name = 'capabilityChanges'; | |
| 16 | +} | |
| 17 | + | |
| 18 | +?> | |
| 0 | 19 | \ No newline at end of file | ... | ... |
lib/api/ktcmis/enums/EnumCapabilityContentStreamUpdatability.inc.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Enumaerator class for capabilityContentStreamUpdatability | |
| 5 | + */ | |
| 6 | + | |
| 7 | +require_once(realpath(dirname(__FILE__) . '/../../../../config/dmsDefaults.php')); | |
| 8 | + | |
| 9 | +define ('CMIS_DIR', KT_LIB_DIR . '/api/ktcmis'); | |
| 10 | +require_once(CMIS_DIR . '/classes/AbstractEnum.inc.php'); | |
| 11 | + | |
| 12 | +class EnumCapabilityContentStreamUpdatability extends AbstractEnum { | |
| 13 | + | |
| 14 | + static private $values = array('none', 'anytime', 'pwconly'); | |
| 15 | + static private $name = 'capabilityContentStreamUpdatability'; | |
| 16 | +} | |
| 17 | + | |
| 18 | +?> | |
| 0 | 19 | \ No newline at end of file | ... | ... |
lib/api/ktcmis/enums/EnumCapabilityJoin.inc.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Enumaerator class for capabilityJoin | |
| 5 | + */ | |
| 6 | + | |
| 7 | +require_once(realpath(dirname(__FILE__) . '/../../../../config/dmsDefaults.php')); | |
| 8 | + | |
| 9 | +define ('CMIS_DIR', KT_LIB_DIR . '/api/ktcmis'); | |
| 10 | +require_once(CMIS_DIR . '/classes/AbstractEnum.inc.php'); | |
| 11 | + | |
| 12 | +class EnumCapabilityJoin extends AbstractEnum { | |
| 13 | + | |
| 14 | + static private $values = array('none', 'inneronly', 'innerandouter'); | |
| 15 | + static private $name = 'capabilityJoin'; | |
| 16 | +} | |
| 17 | + | |
| 18 | +?> | |
| 0 | 19 | \ No newline at end of file | ... | ... |
lib/api/ktcmis/enums/EnumCapabilityQuery.inc.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Enumaerator class for capabilityQuery | |
| 5 | + */ | |
| 6 | + | |
| 7 | +require_once(realpath(dirname(__FILE__) . '/../../../../config/dmsDefaults.php')); | |
| 8 | + | |
| 9 | +define ('CMIS_DIR', KT_LIB_DIR . '/api/ktcmis'); | |
| 10 | +require_once(CMIS_DIR . '/classes/AbstractEnum.inc.php'); | |
| 11 | + | |
| 12 | +class EnumCapabilityQuery extends AbstractEnum { | |
| 13 | + | |
| 14 | + static private $values = array('none', 'metadataonly', 'fulltextonly', 'bothseparate', 'bothcombined'); | |
| 15 | + static private $name = 'capabilityQuery'; | |
| 16 | +} | |
| 17 | + | |
| 18 | +?> | |
| 0 | 19 | \ No newline at end of file | ... | ... |
lib/api/ktcmis/enums/EnumCapabilityRenditions.inc.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Enumaerator class for capabilityRenditions | |
| 5 | + */ | |
| 6 | + | |
| 7 | +require_once(realpath(dirname(__FILE__) . '/../../../../config/dmsDefaults.php')); | |
| 8 | + | |
| 9 | +define ('CMIS_DIR', KT_LIB_DIR . '/api/ktcmis'); | |
| 10 | +require_once(CMIS_DIR . '/classes/AbstractEnum.inc.php'); | |
| 11 | + | |
| 12 | +class EnumCapabilityRenditions extends AbstractEnum { | |
| 13 | + | |
| 14 | + static private $values = array('none', 'objectidsonly', 'properties', 'all'); | |
| 15 | + static private $name = 'capabilityRenditions'; | |
| 16 | +} | |
| 17 | + | |
| 18 | +?> | |
| 0 | 19 | \ No newline at end of file | ... | ... |
lib/api/ktcmis/objecttypes/CMISDocumentObject.inc.php
| ... | ... | @@ -74,9 +74,9 @@ class CMISDocumentObject extends CMISObject { |
| 74 | 74 | $this->creatable = ''; // <repository-specific> |
| 75 | 75 | /* |
| 76 | 76 | * fileable SHOULD be set as follows: |
| 77 | - * If the repository does NOT support the “un-filing†capability: | |
| 77 | + * If the repository does NOT support the “un-filing� capability: | |
| 78 | 78 | * TRUE |
| 79 | - * If the repository does support the “un-filing†capability: | |
| 79 | + * If the repository does support the “un-filing� capability: | |
| 80 | 80 | * <repository-specific>, but SHOULD be TRUE |
| 81 | 81 | */ |
| 82 | 82 | $this->fileable = true; // TODO implement check for whether un-filing is supported |
| ... | ... | @@ -119,7 +119,7 @@ class CMISDocumentObject extends CMISObject { |
| 119 | 119 | |
| 120 | 120 | $objectProperties = $object->get_detail(); |
| 121 | 121 | |
| 122 | - $this->_setPropertyInternal('ObjectId', CMISUtil::encodeObjectId($this->typeId, $objectProperties['document_id'])); | |
| 122 | + $this->_setPropertyInternal('objectId', CMISUtil::encodeObjectId($this->typeId, $objectProperties['document_id'])); | |
| 123 | 123 | // prevent doubled '/' chars |
| 124 | 124 | $uri = preg_replace_callback('/([^:]\/)\//', |
| 125 | 125 | create_function('$matches', 'return $matches[1];'), |
| ... | ... | @@ -128,33 +128,33 @@ class CMISDocumentObject extends CMISObject { |
| 128 | 128 | . $objectProperties['document_id']); |
| 129 | 129 | // NOTE what about instead creating a downloadable version with appropriate link? see ktapi::download_document |
| 130 | 130 | // also ktapidocument::get_download_url |
| 131 | -// $this->_setPropertyInternal('Uri', $uri); | |
| 132 | - $this->_setPropertyInternal('Uri', ''); | |
| 131 | +// $this->_setPropertyInternal('uri', $uri); | |
| 132 | + $this->_setPropertyInternal('uri', ''); | |
| 133 | 133 | // TODO what is this? Assuming it is the object type id, and not OUR document type? |
| 134 | - $this->_setPropertyInternal('ObjectTypeId', $this->getAttribute('typeId')); | |
| 134 | + $this->_setPropertyInternal('objectTypeId', 'cmis:' . strtolower($this->getAttribute('typeId'))); | |
| 135 | 135 | // Needed to distinguish type |
| 136 | - $this->_setPropertyInternal('BaseType', strtolower($this->getAttribute('typeId'))); | |
| 137 | - $this->_setPropertyInternal('CreatedBy', $objectProperties['created_by']); | |
| 138 | - $this->_setPropertyInternal('CreationDate', $objectProperties['created_date']); | |
| 139 | - $this->_setPropertyInternal('LastModifiedBy', $objectProperties['modified_by']); | |
| 140 | - $this->_setPropertyInternal('LastModificationDate', $objectProperties['modified_date']); | |
| 141 | - $this->_setPropertyInternal('ChangeToken', null); | |
| 142 | - $this->_setPropertyInternal('Name', $objectProperties['title']); | |
| 143 | - $this->_setPropertyInternal('ParentId', $objectProperties['folder_id']); | |
| 144 | - $this->_setPropertyInternal('IsImmutable', $objectProperties['is_immutable']); | |
| 136 | + $this->_setPropertyInternal('baseTypeId', 'cmis:' . strtolower($this->getAttribute('typeId'))); | |
| 137 | + $this->_setPropertyInternal('createdBy', $objectProperties['created_by']); | |
| 138 | + $this->_setPropertyInternal('creationDate', $objectProperties['created_date']); | |
| 139 | + $this->_setPropertyInternal('lastModifiedBy', $objectProperties['modified_by']); | |
| 140 | + $this->_setPropertyInternal('lastModificationDate', $objectProperties['modified_date']); | |
| 141 | + $this->_setPropertyInternal('changeToken', null); | |
| 142 | + $this->_setPropertyInternal('name', $objectProperties['title']); | |
| 143 | + $this->_setPropertyInternal('parentId', CMISUtil::encodeObjectId(FOLDER, $objectProperties['folder_id'])); | |
| 144 | + $this->_setPropertyInternal('isImmutable', $objectProperties['is_immutable']); | |
| 145 | 145 | // NOTE if access to older versions is allowed, this will need to be checked, else just set to yes |
| 146 | 146 | // see ktapi::get_document_version_history |
| 147 | 147 | // NOTE see ktapi::is_latest_version |
| 148 | - $this->_setPropertyInternal('IsLatestVersion', true); | |
| 149 | - $this->_setPropertyInternal('IsMajorVersion', (strstr($objectProperties['version'], '.') ? false : true)); | |
| 148 | + $this->_setPropertyInternal('isLatestVersion', true); | |
| 149 | + $this->_setPropertyInternal('isMajorVersion', (strstr($objectProperties['version'], '.') ? false : true)); | |
| 150 | 150 | // NOTE if access to older versions is allowed, this will need to be checked, else just set to yes |
| 151 | 151 | // see ktapi::get_document_version_history |
| 152 | 152 | // NOTE see ktapi::is_latest_version |
| 153 | - $this->_setPropertyInternal('IsLatestMajorVersion', true); | |
| 154 | - $this->_setPropertyInternal('VersionLabel', $objectProperties['version']); | |
| 153 | + $this->_setPropertyInternal('isLatestMajorVersion', true); | |
| 154 | + $this->_setPropertyInternal('versionLabel', $objectProperties['version']); | |
| 155 | 155 | // VersionSeriesId should be the id of the latest version |
| 156 | 156 | // NOTE this may change in the future but is easiest for the current implementation |
| 157 | - $this->_setPropertyInternal('VersionSeriesId', $objectProperties['version']); | |
| 157 | + $this->_setPropertyInternal('versionSeriesId', $objectProperties['version']); | |
| 158 | 158 | if ($objectProperties['checked_out_by'] != 'n/a') |
| 159 | 159 | { |
| 160 | 160 | $checkedOut = true; |
| ... | ... | @@ -168,18 +168,18 @@ class CMISDocumentObject extends CMISObject { |
| 168 | 168 | $checkedOutBy = null; |
| 169 | 169 | $checkedOutId = null; |
| 170 | 170 | } |
| 171 | - $this->_setPropertyInternal('IsVersionSeriesCheckedOut', $checkedOut); | |
| 172 | - $this->_setPropertyInternal('VersionSeriesCheckedOutBy', $checkedOutBy); | |
| 171 | + $this->_setPropertyInternal('isVersionSeriesCheckedOut', $checkedOut); | |
| 172 | + $this->_setPropertyInternal('versionSeriesCheckedOutBy', $checkedOutBy); | |
| 173 | 173 | // TODO presumably this is the ID of the Private Working Copy created on checkout? |
| 174 | 174 | // will find out more when we do checkout/checkin |
| 175 | - $this->_setPropertyInternal('VersionSeriesCheckedOutId', $checkedOutId); | |
| 175 | + $this->_setPropertyInternal('versionSeriesCheckedOutId', $checkedOutId); | |
| 176 | 176 | // TODO currently not returned by KnowledgeTree? |
| 177 | - $this->_setPropertyInternal('CheckinComment', null); | |
| 178 | - $this->_setPropertyInternal('ContentStreamLength', $objectProperties['filesize']); | |
| 179 | - $this->_setPropertyInternal('ContentStreamMimeType', $objectProperties['mime_type']); | |
| 180 | - $this->_setPropertyInternal('ContentStreamFilename', $objectProperties['filename']); | |
| 181 | - $this->_setPropertyInternal('ContentStreamUri', $this->getProperty('ObjectId') . '/' . $objectProperties['filename']); | |
| 182 | - $this->_setPropertyInternal('Author', $objectProperties['created_by']); | |
| 177 | + $this->_setPropertyInternal('checkinComment', null); | |
| 178 | + $this->_setPropertyInternal('contentStreamLength', $objectProperties['filesize']); | |
| 179 | + $this->_setPropertyInternal('contentStreamMimeType', $objectProperties['mime_type']); | |
| 180 | + $this->_setPropertyInternal('contentStreamFilename', $objectProperties['filename']); | |
| 181 | + $this->_setPropertyInternal('contentStreamUri', $this->getProperty('objectId') . '/' . $objectProperties['filename']); | |
| 182 | + $this->_setPropertyInternal('author', $objectProperties['created_by']); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | } | ... | ... |
lib/api/ktcmis/objecttypes/CMISFolderObject.inc.php
| ... | ... | @@ -98,7 +98,7 @@ class CMISFolderObject extends CMISObject { |
| 98 | 98 | |
| 99 | 99 | $objectProperties = $object->get_detail(); |
| 100 | 100 | |
| 101 | - $this->_setPropertyInternal('ObjectId', CMISUtil::encodeObjectId($this->typeId, $objectProperties['id'])); | |
| 101 | + $this->_setPropertyInternal('objectId', CMISUtil::encodeObjectId($this->typeId, $objectProperties['id'])); | |
| 102 | 102 | // prevent doubled '/' chars |
| 103 | 103 | $uri = preg_replace_callback('/([^:]\/)\//', |
| 104 | 104 | create_function('$matches', 'return $matches[1];'), |
| ... | ... | @@ -106,24 +106,24 @@ class CMISFolderObject extends CMISObject { |
| 106 | 106 | . '/browse.php?fFolderId=' |
| 107 | 107 | . $objectProperties['id']); |
| 108 | 108 | // TODO this url is probably incorrect...needs to be checked |
| 109 | -// $this->_setPropertyInternal('Uri', $uri); | |
| 110 | - $this->_setPropertyInternal('Uri', ''); | |
| 109 | +// $this->_setPropertyInternal('uri', $uri); | |
| 110 | + $this->_setPropertyInternal('uri', ''); | |
| 111 | 111 | // TODO what is this? Assuming it is the object type id, and not OUR document type? |
| 112 | - $this->_setPropertyInternal('ObjectTypeId', $this->getAttribute('typeId')); | |
| 112 | + $this->_setPropertyInternal('objectTypeId', 'cmis:' . strtolower($this->getAttribute('typeId'))); | |
| 113 | 113 | // Needed to distinguish type |
| 114 | - $this->_setPropertyInternal('BaseType', strtolower($this->getAttribute('typeId'))); | |
| 115 | - $this->_setPropertyInternal('CreatedBy', $objectProperties['created_by']); | |
| 114 | + $this->_setPropertyInternal('baseTypeId', 'cmis:' . strtolower($this->getAttribute('typeId'))); | |
| 115 | + $this->_setPropertyInternal('createdBy', $objectProperties['created_by']); | |
| 116 | 116 | // TODO cannot currently retrieve via ktapi or regular folder code - add as with created by |
| 117 | - $this->_setPropertyInternal('CreationDate', $objectProperties['created_date']); | |
| 117 | + $this->_setPropertyInternal('creationDate', $objectProperties['created_date']); | |
| 118 | 118 | // TODO cannot currently retrieve via ktapi or regular folder code - add as with created by |
| 119 | - $this->_setPropertyInternal('LastModifiedBy', $objectProperties['modified_by']); | |
| 119 | + $this->_setPropertyInternal('lastModifiedBy', $objectProperties['modified_by']); | |
| 120 | 120 | // TODO cannot currently retrieve via ktapi or regular folder code - add as with created by |
| 121 | - $this->_setPropertyInternal('LastModificationDate', $objectProperties['modified_date']); | |
| 122 | - $this->_setPropertyInternal('ChangeToken', null); | |
| 123 | - $this->_setPropertyInternal('Name', $objectProperties['folder_name']); | |
| 124 | - $this->_setPropertyInternal('ParentId', $objectProperties['parent_id']); | |
| 125 | - $this->_setPropertyInternal('AllowedChildObjectTypeIds', array('Document', 'Folder')); | |
| 126 | - $this->_setPropertyInternal('Author', $objectProperties['created_by']); | |
| 121 | + $this->_setPropertyInternal('lastModificationDate', $objectProperties['modified_date']); | |
| 122 | + $this->_setPropertyInternal('changeToken', null); | |
| 123 | + $this->_setPropertyInternal('name', $objectProperties['folder_name']); | |
| 124 | + $this->_setPropertyInternal('parentId', CMISUtil::encodeObjectId(FOLDER, $objectProperties['parent_id'])); | |
| 125 | + $this->_setPropertyInternal('allowedChildObjectTypeIds', array('Document', 'Folder')); | |
| 126 | + $this->_setPropertyInternal('author', $objectProperties['created_by']); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | } | ... | ... |
lib/api/ktcmis/services/CMISNavigationService.inc.php
| ... | ... | @@ -276,7 +276,7 @@ class CMISNavigationService { |
| 276 | 276 | { |
| 277 | 277 | $CMISDocument = new CMISDocumentObject($document->getId(), $this->ktapi); |
| 278 | 278 | // set version label property - possibly belongs in document class |
| 279 | - $CMISDocument->setProperty('VersionLabel', $CMISDocument->getProperty('VersionSeriesCheckedOutId')); | |
| 279 | + $CMISDocument->setProperty('versionLabel', $CMISDocument->getProperty('versionSeriesCheckedOutId')); | |
| 280 | 280 | $checkedout[] = $CMISDocument->getProperties(); |
| 281 | 281 | } |
| 282 | 282 | ... | ... |
lib/api/ktcmis/services/CMISObjectService.inc.php
| ... | ... | @@ -88,7 +88,7 @@ class CMISObjectService { |
| 88 | 88 | |
| 89 | 89 | // if parent folder is not allowed to hold this type, throw exception |
| 90 | 90 | $CMISFolder = new CMISFolderObject($folderId, $this->ktapi); |
| 91 | - $allowed = $CMISFolder->getProperty('AllowedChildObjectTypeIds'); | |
| 91 | + $allowed = $CMISFolder->getProperty('allowedChildObjectTypeIds'); | |
| 92 | 92 | $typeAllowed = false; |
| 93 | 93 | |
| 94 | 94 | if (is_array($allowed)) |
| ... | ... | @@ -306,7 +306,7 @@ class CMISObjectService { |
| 306 | 306 | |
| 307 | 307 | // if parent folder is not allowed to hold this type, throw exception |
| 308 | 308 | $CMISFolder = new CMISFolderObject($folderId, $this->ktapi); |
| 309 | - $allowed = $CMISFolder->getProperty('AllowedChildObjectTypeIds'); | |
| 309 | + $allowed = $CMISFolder->getProperty('allowedChildObjectTypeIds'); | |
| 310 | 310 | if (!is_array($allowed) || !in_array($typeId, $allowed)) { |
| 311 | 311 | throw new ConstraintViolationException('Parent folder may not hold objects of this type (' . $typeId . ')'); |
| 312 | 312 | } |
| ... | ... | @@ -366,7 +366,7 @@ class CMISObjectService { |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | // check that we were actually able to retrieve a real object |
| 369 | - $objectId = $CMISObject->getProperty('ObjectId'); | |
| 369 | + $objectId = $CMISObject->getProperty('objectId'); | |
| 370 | 370 | if (empty($objectId)) { |
| 371 | 371 | throw new ObjectNotFoundException('The requested object could not be found'); |
| 372 | 372 | } |
| ... | ... | @@ -384,7 +384,7 @@ class CMISObjectService { |
| 384 | 384 | * @return string $contentStream (binary or text data) |
| 385 | 385 | */ |
| 386 | 386 | // NOTE streamNotSupportedException: The Repository SHALL throw this exception if the Object-Type definition |
| 387 | - // specified by the objectId parameter’s “contentStreamAllowed†attribute is set to “not allowedâ€. | |
| 387 | + // specified by the objectId parameter’s “contentStreamAllowed� attribute is set to “not allowed�. | |
| 388 | 388 | // |
| 389 | 389 | function getContentStream($repositoryId, $objectId) |
| 390 | 390 | { |
| ... | ... | @@ -461,7 +461,7 @@ class CMISObjectService { |
| 461 | 461 | |
| 462 | 462 | // check type id of object against allowed child types for destination folder |
| 463 | 463 | $CMISFolder = new CMISFolderObject($targetFolderId, $this->ktapi); |
| 464 | - $allowed = $CMISFolder->getProperty('AllowedChildObjectTypeIds'); | |
| 464 | + $allowed = $CMISFolder->getProperty('allowedChildObjectTypeIds'); | |
| 465 | 465 | if (!is_array($allowed) || !in_array($typeId, $allowed)) { |
| 466 | 466 | throw new ConstraintViolationException('Parent folder may not hold objects of this type (' . $typeId . ')'); |
| 467 | 467 | } |
| ... | ... | @@ -707,7 +707,7 @@ class CMISObjectService { |
| 707 | 707 | throw new StreamNotSupportedException('Content Streams are not allowed for this object type'); |
| 708 | 708 | } |
| 709 | 709 | |
| 710 | - $csFileName = $CMISDocument->getProperty('ContentStreamFilename'); | |
| 710 | + $csFileName = $CMISDocument->getProperty('contentStreamFilename'); | |
| 711 | 711 | if (!empty($csFileName) && (!$overwriteFlag)) |
| 712 | 712 | { |
| 713 | 713 | throw new ContentAlreadyExistsException('Unable to overwrite existing content stream'); |
| ... | ... | @@ -730,7 +730,7 @@ class CMISObjectService { |
| 730 | 730 | // update the CMIS document object with the content stream information |
| 731 | 731 | // $CMISDocument->reload($document['result']['document_id']); |
| 732 | 732 | |
| 733 | - return $CMISDocument->getProperty('ObjectId'); | |
| 733 | + return $CMISDocument->getProperty('objectId'); | |
| 734 | 734 | } |
| 735 | 735 | |
| 736 | 736 | } | ... | ... |
lib/api/ktcmis/services/CMISRepositoryService.inc.php
| ... | ... | @@ -104,7 +104,7 @@ class CMISRepositoryService { |
| 104 | 104 | // NOTE this code may fit better within the Repository Class |
| 105 | 105 | // TODO return for specific type when $typeId is specified |
| 106 | 106 | // TODO other optional parameters |
| 107 | - private function getTypes($repositoryId, $typeId = '', $returnPropertyDefinitions = false, | |
| 107 | + public function getTypes($repositoryId, $typeId = '', $returnPropertyDefinitions = false, | |
| 108 | 108 | $maxItems = 0, $skipCount = 0, &$hasMoreItems = false) |
| 109 | 109 | { |
| 110 | 110 | /* | ... | ... |
lib/api/ktcmis/services/CMISVersioningService.inc.php
| ... | ... | @@ -116,18 +116,18 @@ class CMISVersioningService { |
| 116 | 116 | }; |
| 117 | 117 | |
| 118 | 118 | // if successful, set $contentCopied = true; unless contentStream is not set |
| 119 | - if ($pwc->getProperty('ContentStreamFilename') != '') $contentCopied = true; | |
| 119 | + if ($pwc->getProperty('contentStreamFilename') != '') $contentCopied = true; | |
| 120 | 120 | $documentId = CMISUtil::encodeObjectId('Document', $documentId); |
| 121 | 121 | |
| 122 | 122 | // mark document object as checked out |
| 123 | - $pwc->setProperty('IsVersionSeriesCheckedOut', true); | |
| 123 | + $pwc->setProperty('isVersionSeriesCheckedOut', true); | |
| 124 | 124 | $userName = ''; |
| 125 | 125 | $user = $this->ktapi->get_user(); |
| 126 | 126 | if (!PEAR::isError($user)) { |
| 127 | 127 | $userName = $user->getName(); |
| 128 | 128 | } |
| 129 | - $pwc->setProperty('VersionSeriesCheckedOutBy', $userName); | |
| 130 | - $pwc->setProperty('VersionSeriesCheckedOutId', $documentId); | |
| 129 | + $pwc->setProperty('versionSeriesCheckedOutBy', $userName); | |
| 130 | + $pwc->setProperty('versionSeriesCheckedOutId', $documentId); | |
| 131 | 131 | |
| 132 | 132 | return $contentCopied; |
| 133 | 133 | } |
| ... | ... | @@ -215,13 +215,13 @@ class CMISVersioningService { |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | // check that this is the latest version |
| 218 | - if ($pwc->getProperty('IsLatestVersion') != true) { | |
| 218 | + if ($pwc->getProperty('isLatestVersion') != true) { | |
| 219 | 219 | throw new VersioningException('The document is not the latest version and cannot be checked in'); |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | // now do the checkin |
| 223 | 223 | $tempfilename = CMISUtil::createTemporaryFile($contentStream); |
| 224 | - $response = $this->ktapi->checkin_document($documentId, $pwc->getProperty('ContentStreamFilename'), $reason, $tempfilename, $major, | |
| 224 | + $response = $this->ktapi->checkin_document($documentId, $pwc->getProperty('contentStreamFilename'), $reason, $tempfilename, $major, | |
| 225 | 225 | $sig_username, $sig_password); |
| 226 | 226 | |
| 227 | 227 | // if there was any error in cancelling the checkout | ... | ... |
lib/api/ktcmis/util/CMISUtil.inc.php
| ... | ... | @@ -278,7 +278,7 @@ class CMISUtil { |
| 278 | 278 | foreach(CMISPropertyCollection::$propertyTypes as $property => $type) |
| 279 | 279 | { |
| 280 | 280 | // hack for Author property |
| 281 | - if ($property == 'Author') { | |
| 281 | + if ($property == 'author') { | |
| 282 | 282 | $object[$property] = array('value' => $properties->getValue($property)); |
| 283 | 283 | } |
| 284 | 284 | else { |
| ... | ... | @@ -286,71 +286,7 @@ class CMISUtil { |
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | - /* old static method */ | |
| 290 | - /* | |
| 291 | - $object['Author'] = array('value' => $properties->getValue('Author')); | |
| 292 | - | |
| 293 | - $object['properties']['BaseType'] = array('type' => $properties->getFieldType('BaseType'), | |
| 294 | - 'value' => $properties->getValue('BaseType')); | |
| 295 | - | |
| 296 | - $object['properties']['Name'] = array('type' => $properties->getFieldType('Name'), | |
| 297 | - 'value' => $properties->getValue('Name')); | |
| 298 | - | |
| 299 | - $object['properties']['ParentId'] = array('type' => $properties->getFieldType('ParentId'), | |
| 300 | - 'value' => self::encodeObjectId('Folder', | |
| 301 | - $properties->getValue('ParentId'))); | |
| 302 | - | |
| 303 | - $object['properties']['Uri'] = array('type' => $properties->getFieldType('Uri'), | |
| 304 | - 'value' => $properties->getValue('Uri')); | |
| 305 | - | |
| 306 | - // TODO ensure format of date is always correct | |
| 307 | - $object['properties']['LastModificationDate'] = array('type' => $properties->getFieldType('LastModificationDate'), | |
| 308 | - 'value' => $properties->getValue('LastModificationDate')); | |
| 309 | - | |
| 310 | - $object['properties']['CreatedBy'] = array('type' => $properties->getFieldType('CreatedBy'), | |
| 311 | - 'value' => $properties->getValue('CreatedBy')); | |
| 312 | - | |
| 313 | - $object['properties']['AllowedChildObjectTypeIds'] = array('type' => $properties->getFieldType('AllowedChildObjectTypeIds'), | |
| 314 | - 'value' => $properties->getValue('AllowedChildObjectTypeIds')); | |
| 315 | - | |
| 316 | - $object['properties']['CreationDate'] = array('type' => $properties->getFieldType('CreationDate'), | |
| 317 | - 'value' => $properties->getValue('CreationDate')); | |
| 318 | - | |
| 319 | - $object['properties']['LastModifiedBy'] = array('type' => $properties->getFieldType('LastModifiedBy'), | |
| 320 | - 'value' => $properties->getValue('LastModifiedBy')); | |
| 321 | - | |
| 322 | - $object['properties']['ChangeToken'] = array('type' => $properties->getFieldType('ChangeToken'), | |
| 323 | - 'value' => $properties->getValue('ChangeToken')); | |
| 324 | - | |
| 325 | - $object['properties']['ObjectTypeId'] = array('type' => $properties->getFieldType('ObjectTypeId'), | |
| 326 | - 'value' => $properties->getValue('ObjectTypeId')); | |
| 327 | - | |
| 328 | - $object['properties']['ObjectId'] = array('type' => $properties->getFieldType('ObjectId'), | |
| 329 | - 'value' => $properties->getValue('ObjectId')); | |
| 330 | - | |
| 331 | - if (strtolower($properties->getValue('ObjectTypeId')) == 'document') | |
| 332 | - { | |
| 333 | - $object['properties']['ChangeToken'] = array('type' => $properties->getFieldType('ChangeToken'), | |
| 334 | - 'value' => $properties->getValue('ChangeToken')); | |
| 335 | - $contentStreamLength = $properties->getValue('ContentStreamLength'); | |
| 336 | - if (!empty($contentStreamLength)) | |
| 337 | - { | |
| 338 | - $contentStreamLength = $properties->getValue('ContentStreamLength'); | |
| 339 | - $object['properties']['ContentStreamAllowed'] = array('type' => $properties->getFieldType('ContentStreamAllowed'), | |
| 340 | - 'value' => $properties->getValue('ContentStreamAllowed')); | |
| 341 | - $object['properties']['ContentStreamLength'] = array('type' => $properties->getFieldType('ContentStreamLength'), | |
| 342 | - 'value' => $properties->getValue('ContentStreamLength')); | |
| 343 | - $object['properties']['ContentStreamMimeType'] = array('type' => $properties->getFieldType('ContentStreamMimeType'), | |
| 344 | - 'value' => $properties->getValue('ContentStreamMimeType')); | |
| 345 | - $object['properties']['ContentStreamFilename'] = array('type' => $properties->getFieldType('ContentStreamFilename'), | |
| 346 | - 'value' => $properties->getValue('ContentStreamFilename')); | |
| 347 | - $object['properties']['ContentStreamUri'] = array('type' => $properties->getFieldType('ContentStreamUri'), | |
| 348 | - 'value' => $properties->getValue('ContentStreamUri')); | |
| 349 | - } | |
| 350 | - } | |
| 351 | - */ | |
| 352 | - | |
| 353 | - /* what on earth was this for? */ | |
| 289 | + /* what was this for and is it still needed? */ | |
| 354 | 290 | /* |
| 355 | 291 | // if we have found a child/parent with one or more children/parents, recurse into the child/parent object |
| 356 | 292 | if (count($entry['items']) > 0) { | ... | ... |
tests/ktcmis/testCmisApi.php
| ... | ... | @@ -531,7 +531,7 @@ class CMISTestCase extends KTUnitTestCase { |
| 531 | 531 | $response = $NavigationService->getCheckedOutDocs($repositoryId, false, false); |
| 532 | 532 | $this->assertEqual($response['status_code'], 0); |
| 533 | 533 | $this->assertNotNull($response['results']); |
| 534 | - $this->assertTrue($this->findInPropertiesArray('ObjectId', $documentId, $response['results'])); | |
| 534 | + $this->assertTrue($this->findInPropertiesArray('objectId', $documentId, $response['results'])); | |
| 535 | 535 | // now let's cancel the checkout so that we can delete later during cleanup :) |
| 536 | 536 | $response = $VersioningService->cancelCheckOut($repositoryId, $pwcId); |
| 537 | 537 | ... | ... |
webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php
| ... | ... | @@ -104,8 +104,8 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | // we know that a folder will only have one parent, so we can assume element 0 |
| 107 | - $folderId = $response[0]['properties']['ObjectId']['value']; | |
| 108 | - $folderName = $response[0]['properties']['Name']['value']; | |
| 107 | + $folderId = $response[0]['properties']['objectId']['value']; | |
| 108 | + $folderName = $response[0]['properties']['name']['value']; | |
| 109 | 109 | } |
| 110 | 110 | else { |
| 111 | 111 | $folderId = $this->params[0]; |
| ... | ... | @@ -162,10 +162,10 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { |
| 162 | 162 | $cmisObjectProperties = KT_cmis_atom_service_helper::getCmisProperties($this->parsedXMLContent['@children']); |
| 163 | 163 | |
| 164 | 164 | // check for existing object id as property of submitted object data |
| 165 | - if (!empty($cmisObjectProperties['ObjectId'])) | |
| 165 | + if (!empty($cmisObjectProperties['objectId'])) | |
| 166 | 166 | { |
| 167 | 167 | $action = 'move'; |
| 168 | - $objectId = $cmisObjectProperties['ObjectId']; | |
| 168 | + $objectId = $cmisObjectProperties['objectId']; | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | // TODO there may be more to do for the checking of an existing object. |
| ... | ... | @@ -196,9 +196,9 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { |
| 196 | 196 | if ($action == 'create') |
| 197 | 197 | { |
| 198 | 198 | if ($type == 'folder') |
| 199 | - $newObjectId = $ObjectService->createFolder($repositoryId, ucwords($cmisObjectProperties['ObjectTypeId']), $properties, $folderId); | |
| 199 | + $newObjectId = $ObjectService->createFolder($repositoryId, ucwords($cmisObjectProperties['objectTypeId']), $properties, $folderId); | |
| 200 | 200 | else |
| 201 | - $newObjectId = $ObjectService->createDocument($repositoryId, ucwords($cmisObjectProperties['ObjectTypeId']), $properties, $folderId, $content); | |
| 201 | + $newObjectId = $ObjectService->createDocument($repositoryId, ucwords($cmisObjectProperties['objectTypeId']), $properties, $folderId, $content); | |
| 202 | 202 | |
| 203 | 203 | // check if returned Object Id is a valid CMIS Object Id |
| 204 | 204 | CMISUtil::decodeObjectId($newObjectId, $typeId); |
| ... | ... | @@ -272,12 +272,12 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { |
| 272 | 272 | $objectElement = $feed->newElement('cmisra:object'); |
| 273 | 273 | $propertiesElement = $feed->newElement('cmis:properties'); |
| 274 | 274 | $propElement = $feed->newElement('cmis:propertyId'); |
| 275 | - $propElement->appendChild($feed->newAttr('cmis:name', 'ObjectId')); | |
| 275 | + $propElement->appendChild($feed->newAttr('cmis:name', 'objectId')); | |
| 276 | 276 | $feed->newField('cmis:value', $failed, $propElement); |
| 277 | 277 | $propertiesElement->appendChild($propElement); |
| 278 | 278 | $objectElement->appendChild($propertiesElement); |
| 279 | 279 | $entry->appendChild($objectElement); |
| 280 | - $entry->appendChild($feed->newElement('cmis:terminator')); | |
| 280 | +// $entry->appendChild($feed->newElement('cmis:terminator')); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | $this->responseFeed = $feed; |
| ... | ... | @@ -386,7 +386,7 @@ class KT_cmis_atom_service_document extends KT_cmis_atom_service { |
| 386 | 386 | |
| 387 | 387 | // for now a document will only have one parent as KnowledgeTree does not support multi-filing |
| 388 | 388 | // TODO update this code if/when multi-filing support is added |
| 389 | - $objectId = $response[0]['properties']['ObjectId']['value']; | |
| 389 | + $objectId = $response[0]['properties']['objectId']['value']; | |
| 390 | 390 | } |
| 391 | 391 | // determine whether we want the document entry feed or the actual physical document content. |
| 392 | 392 | // this depends on $this->params[1] |
| ... | ... | @@ -622,7 +622,7 @@ class KT_cmis_atom_service_checkedout extends KT_cmis_atom_service { |
| 622 | 622 | $cmisObjectProperties = KT_cmis_atom_service_helper::getCmisProperties($this->parsedXMLContent['@children']); |
| 623 | 623 | |
| 624 | 624 | // check for existing object id as property of submitted object data |
| 625 | - if (empty($cmisObjectProperties['ObjectId'])) | |
| 625 | + if (empty($cmisObjectProperties['objectId'])) | |
| 626 | 626 | { |
| 627 | 627 | $feed = KT_cmis_atom_service_helper::getErrorFeed($this, self::STATUS_SERVER_ERROR, 'No object was specified for checkout'); |
| 628 | 628 | // Expose the responseFeed |
| ... | ... | @@ -630,7 +630,7 @@ class KT_cmis_atom_service_checkedout extends KT_cmis_atom_service { |
| 630 | 630 | return null; |
| 631 | 631 | } |
| 632 | 632 | |
| 633 | - $response = $VersioningService->checkOut($repositoryId, $cmisObjectProperties['ObjectId']); | |
| 633 | + $response = $VersioningService->checkOut($repositoryId, $cmisObjectProperties['objectId']); | |
| 634 | 634 | |
| 635 | 635 | if (PEAR::isError($response)) |
| 636 | 636 | { |
| ... | ... | @@ -641,7 +641,7 @@ class KT_cmis_atom_service_checkedout extends KT_cmis_atom_service { |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | $this->setStatus(self::STATUS_CREATED); |
| 644 | - $feed = KT_cmis_atom_service_helper::getObjectFeed($this, $ObjectService, $repositoryId, $cmisObjectProperties['ObjectId'], 'POST'); | |
| 644 | + $feed = KT_cmis_atom_service_helper::getObjectFeed($this, $ObjectService, $repositoryId, $cmisObjectProperties['objectId'], 'POST'); | |
| 645 | 645 | |
| 646 | 646 | // Expose the responseFeed |
| 647 | 647 | $this->responseFeed = $feed; | ... | ... |
webservice/atompub/cmis/KT_cmis_atom_service_helper.inc.php
| ... | ... | @@ -78,12 +78,12 @@ class KT_cmis_atom_service_helper { |
| 78 | 78 | } |
| 79 | 79 | else if ($method == 'GET') { |
| 80 | 80 | $response = new KT_cmis_atom_responseFeed_GET(CMIS_APP_BASE_URI); |
| 81 | - $response->newField('title', $cmisEntry['properties']['ObjectTypeId']['value'], $response); | |
| 82 | - $response->newField('id', 'urn:uuid:' . $cmisEntry['properties']['ObjectId']['value'], $response); | |
| 81 | + $response->newField('title', $cmisEntry['properties']['objectTypeId']['value'], $response); | |
| 82 | + $response->newField('id', 'urn:uuid:' . $cmisEntry['properties']['objectId']['value'], $response); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | if ($serviceType == 'PWC') $pwc = true; else $pwc = false; |
| 86 | - KT_cmis_atom_service_helper::createObjectEntry($response, $cmisEntry, $cmisEntry['properties']['ParentId']['value'], $pwc, $method); | |
| 86 | + KT_cmis_atom_service_helper::createObjectEntry($response, $cmisEntry, $cmisEntry['properties']['parentId']['value'], $pwc, $method); | |
| 87 | 87 | |
| 88 | 88 | // Don't think this should be here...only one item so why would we need to say there are no more? |
| 89 | 89 | /*if ($method == 'GET') { |
| ... | ... | @@ -103,7 +103,7 @@ class KT_cmis_atom_service_helper { |
| 103 | 103 | static public function createObjectEntry(&$response, $cmisEntry, $parent, $pwc = false, $method = 'GET') |
| 104 | 104 | { |
| 105 | 105 | $workspace = $response->getWorkspace(); |
| 106 | - $type = strtolower($cmisEntry['properties']['ObjectTypeId']['value']); | |
| 106 | + $type = strtolower($cmisEntry['properties']['objectTypeId']['value']); | |
| 107 | 107 | |
| 108 | 108 | // create entry |
| 109 | 109 | $entry = $response->newEntry(); |
| ... | ... | @@ -114,7 +114,8 @@ class KT_cmis_atom_service_helper { |
| 114 | 114 | // append attributes |
| 115 | 115 | $entry->appendChild($response->newAttr('xmlns', 'http://www.w3.org/2005/Atom')); |
| 116 | 116 | $entry->appendChild($response->newAttr('xmlns:app', 'http://www.w3.org/2007/app')); |
| 117 | - $entry->appendChild($response->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200901')); | |
| 117 | + $entry->appendChild($response->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200908/')); | |
| 118 | + $entry->appendChild($response->newAttr('xmlns:cmisra', 'http://docs.oasis-open.org/ns/cmis/restatom/200908/')); | |
| 118 | 119 | } |
| 119 | 120 | |
| 120 | 121 | // TODO dynamic actual creator name |
| ... | ... | @@ -122,18 +123,18 @@ class KT_cmis_atom_service_helper { |
| 122 | 123 | $element = $response->newField('name', 'admin', $responseElement); |
| 123 | 124 | $entry->appendChild($responseElement); |
| 124 | 125 | |
| 125 | - if (!empty($cmisEntry['properties']['ContentStreamLength']['value'])) | |
| 126 | + if (!empty($cmisEntry['properties']['contentStreamLength']['value'])) | |
| 126 | 127 | { |
| 127 | 128 | $field = $response->newElement('content'); |
| 128 | - $field->appendChild($response->newAttr('type', $cmisEntry['properties']['ContentStreamMimeType']['value'])); | |
| 129 | + $field->appendChild($response->newAttr('type', $cmisEntry['properties']['contentStreamMimeType']['value'])); | |
| 129 | 130 | $field->appendChild($response->newAttr('src', CMIS_APP_BASE_URI . $workspace . '/' . $type |
| 130 | - . '/' . $cmisEntry['properties']['ObjectId']['value'] | |
| 131 | - . '/' . $cmisEntry['properties']['ContentStreamFilename']['value'])); | |
| 131 | + . '/' . $cmisEntry['properties']['objectId']['value'] | |
| 132 | + . '/' . $cmisEntry['properties']['contentStreamFilename']['value'])); | |
| 132 | 133 | $entry->appendChild($field); |
| 133 | 134 | } |
| 134 | 135 | |
| 135 | 136 | // content & id tags |
| 136 | - $id = $cmisEntry['properties']['ObjectId']['value']; | |
| 137 | + $id = $cmisEntry['properties']['objectId']['value']; | |
| 137 | 138 | |
| 138 | 139 | $response->newField('id', 'urn:uuid:' . $id, $entry); |
| 139 | 140 | |
| ... | ... | @@ -141,32 +142,32 @@ class KT_cmis_atom_service_helper { |
| 141 | 142 | $link = $response->newElement('link'); |
| 142 | 143 | $link->appendChild($response->newAttr('rel', 'self')); |
| 143 | 144 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . (!$pwc ? $type : 'pwc') . '/' |
| 144 | - . $cmisEntry['properties']['ObjectId']['value'])); | |
| 145 | + . $cmisEntry['properties']['objectId']['value'])); | |
| 145 | 146 | $entry->appendChild($link); |
| 146 | 147 | |
| 147 | 148 | $link = $response->newElement('link'); |
| 148 | 149 | $link->appendChild($response->newAttr('rel', 'edit')); |
| 149 | 150 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type |
| 150 | - . '/' . $cmisEntry['properties']['ObjectId']['value'])); | |
| 151 | + . '/' . $cmisEntry['properties']['objectId']['value'])); | |
| 151 | 152 | $entry->appendChild($link); |
| 152 | 153 | |
| 153 | - if ((strtolower($cmisEntry['properties']['ObjectTypeId']['value']) == 'document') | |
| 154 | - && (!empty($cmisEntry['properties']['ContentStreamLength']['value']))) | |
| 154 | + if ((strtolower($cmisEntry['properties']['objectTypeId']['value']) == 'document') | |
| 155 | + && (!empty($cmisEntry['properties']['contentStreamLength']['value']))) | |
| 155 | 156 | { |
| 156 | 157 | $link = $response->newElement('link'); |
| 157 | 158 | $link->appendChild($response->newAttr('rel', 'edit-media')); |
| 158 | - $link->appendChild($response->newAttr('type', $cmisEntry['properties']['ContentStreamMimeType']['value'])); | |
| 159 | + $link->appendChild($response->newAttr('type', $cmisEntry['properties']['contentStreamMimeType']['value'])); | |
| 159 | 160 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type |
| 160 | - . '/' . $cmisEntry['properties']['ObjectId']['value'] | |
| 161 | - . '/' . $cmisEntry['properties']['ContentStreamFilename']['value'])); | |
| 161 | + . '/' . $cmisEntry['properties']['objectId']['value'] | |
| 162 | + . '/' . $cmisEntry['properties']['contentStreamFilename']['value'])); | |
| 162 | 163 | $entry->appendChild($link); |
| 163 | 164 | |
| 164 | 165 | $link = $response->newElement('link'); |
| 165 | 166 | $link->appendChild($response->newAttr('rel', 'enclosure')); |
| 166 | - $link->appendChild($response->newAttr('type', $cmisEntry['properties']['ContentStreamMimeType']['value'])); | |
| 167 | + $link->appendChild($response->newAttr('type', $cmisEntry['properties']['contentStreamMimeType']['value'])); | |
| 167 | 168 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type |
| 168 | - . '/' . $cmisEntry['properties']['ObjectId']['value'] | |
| 169 | - . '/' . $cmisEntry['properties']['ContentStreamFilename']['value'])); | |
| 169 | + . '/' . $cmisEntry['properties']['objectId']['value'] | |
| 170 | + . '/' . $cmisEntry['properties']['contentStreamFilename']['value'])); | |
| 170 | 171 | $entry->appendChild($link); |
| 171 | 172 | } |
| 172 | 173 | |
| ... | ... | @@ -175,7 +176,7 @@ class KT_cmis_atom_service_helper { |
| 175 | 176 | $link = $response->newElement('link'); |
| 176 | 177 | $link->appendChild($response->newAttr('rel', 'allowableactions')); |
| 177 | 178 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type . '/' |
| 178 | - . $cmisEntry['properties']['ObjectId']['value'] . '/permissions')); | |
| 179 | + . $cmisEntry['properties']['objectId']['value'] . '/permissions')); | |
| 179 | 180 | $entry->appendChild($link); |
| 180 | 181 | |
| 181 | 182 | // according to spec this MUST be present, but spec says that links for function which are not supported |
| ... | ... | @@ -183,67 +184,67 @@ class KT_cmis_atom_service_helper { |
| 183 | 184 | $link = $response->newElement('link'); |
| 184 | 185 | $link->appendChild($response->newAttr('rel', 'relationships')); |
| 185 | 186 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type . '/' |
| 186 | - . $cmisEntry['properties']['ObjectId']['value'] . '/rels')); | |
| 187 | + . $cmisEntry['properties']['objectId']['value'] . '/rels')); | |
| 187 | 188 | $entry->appendChild($link); |
| 188 | 189 | |
| 189 | 190 | // if there is no parent or parent is 0, do not add the parent link |
| 190 | 191 | // also if this is specifically the root folder, do not add the parent link |
| 191 | -// if (!empty($cmisEntry['properties']['ParentId']['value']) && !CMISUtil::isRootFolder(self::$repositoryId, $cmisEntry['properties']['ObjectId']['value'])) | |
| 192 | +// if (!empty($cmisEntry['properties']['parentId']['value']) && !CMISUtil::isRootFolder(self::$repositoryId, $cmisEntry['properties']['objectId']['value'])) | |
| 192 | 193 | |
| 193 | - if (!CMISUtil::isRootFolder(self::$repositoryId, $cmisEntry['properties']['ObjectId']['value'], self::$ktapi)) | |
| 194 | + if (!CMISUtil::isRootFolder(self::$repositoryId, $cmisEntry['properties']['objectId']['value'], self::$ktapi)) | |
| 194 | 195 | { |
| 195 | 196 | // TODO check parent link is correct, fix if needed |
| 196 | 197 | $link = $response->newElement('link'); |
| 197 | 198 | $link->appendChild($response->newAttr('rel', 'parents')); |
| 198 | 199 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/folder/' |
| 199 | - . $cmisEntry['properties']['ObjectId']['value'] . '/parent')); | |
| 200 | + . $cmisEntry['properties']['objectId']['value'] . '/parent')); | |
| 200 | 201 | $entry->appendChild($link); |
| 201 | 202 | } |
| 202 | 203 | |
| 203 | 204 | // Folder/Document specific links |
| 204 | - if (strtolower($cmisEntry['properties']['ObjectTypeId']['value']) == 'folder') | |
| 205 | + if (strtolower($cmisEntry['properties']['objectTypeId']['value']) == 'folder') | |
| 205 | 206 | { |
| 206 | 207 | $link = $response->newElement('link'); |
| 207 | 208 | $link->appendChild($response->newAttr('rel', 'children')); |
| 208 | 209 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' |
| 209 | 210 | . $type |
| 210 | - . '/' . $cmisEntry['properties']['ObjectId']['value'] | |
| 211 | + . '/' . $cmisEntry['properties']['objectId']['value'] | |
| 211 | 212 | . '/children')); |
| 212 | 213 | $entry->appendChild($link); |
| 213 | 214 | $link = $response->newElement('link'); |
| 214 | 215 | $link->appendChild($response->newAttr('rel', 'descendants')); |
| 215 | 216 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' |
| 216 | 217 | . $type |
| 217 | - . '/' . $cmisEntry['properties']['ObjectId']['value'] | |
| 218 | + . '/' . $cmisEntry['properties']['objectId']['value'] | |
| 218 | 219 | . '/descendants')); |
| 219 | 220 | $entry->appendChild($link); |
| 220 | 221 | } |
| 221 | - else if (strtolower($cmisEntry['properties']['ObjectTypeId']['value']) == 'document') | |
| 222 | + else if (strtolower($cmisEntry['properties']['objectTypeId']['value']) == 'document') | |
| 222 | 223 | { |
| 223 | 224 | // according to spec this MUST be present, but spec says that links for function which are not supported |
| 224 | 225 | // do not need to be present, so unsure for the moment |
| 225 | 226 | // $link = $response->newElement('link'); |
| 226 | 227 | // $link->appendChild($response->newAttr('rel', 'allversions')); |
| 227 | -// $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type . '/' . $cmisEntry['properties']['ParentId']['value'])); | |
| 228 | +// $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type . '/' . $cmisEntry['properties']['parentId']['value'])); | |
| 228 | 229 | // $entry->appendChild($link); |
| 229 | 230 | |
| 230 | 231 | // according to spec this MUST be present, but spec says that links for function which are not supported |
| 231 | 232 | // do not need to be present, so unsure for the moment |
| 232 | 233 | // $link = $response->newElement('link'); |
| 233 | 234 | // $link->appendChild($response->newAttr('rel', 'latestversion')); |
| 234 | -// $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type . '/' . $cmisEntry['properties']['ParentId']['value'])); | |
| 235 | +// $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type . '/' . $cmisEntry['properties']['parentId']['value'])); | |
| 235 | 236 | // $entry->appendChild($link); |
| 236 | 237 | |
| 237 | 238 | // if there is a content stream, this link MUST be present |
| 238 | 239 | // not sure yet where it must point... |
| 239 | - if (!empty($cmisEntry['properties']['ContentStreamLength']['value'])) | |
| 240 | + if (!empty($cmisEntry['properties']['contentStreamLength']['value'])) | |
| 240 | 241 | { |
| 241 | 242 | $link = $response->newElement('link'); |
| 242 | 243 | $link->appendChild($response->newAttr('rel', 'stream')); |
| 243 | - $link->appendChild($response->newAttr('type', $cmisEntry['properties']['ContentStreamMimeType']['value'])); | |
| 244 | + $link->appendChild($response->newAttr('type', $cmisEntry['properties']['contentStreamMimeType']['value'])); | |
| 244 | 245 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type |
| 245 | - . '/' . $cmisEntry['properties']['ObjectId']['value'] | |
| 246 | - . '/' . $cmisEntry['properties']['ContentStreamFilename']['value'])); | |
| 246 | + . '/' . $cmisEntry['properties']['objectId']['value'] | |
| 247 | + . '/' . $cmisEntry['properties']['contentStreamFilename']['value'])); | |
| 247 | 248 | $entry->appendChild($link); |
| 248 | 249 | } |
| 249 | 250 | |
| ... | ... | @@ -255,22 +256,22 @@ class KT_cmis_atom_service_helper { |
| 255 | 256 | $link = $response->newElement('link'); |
| 256 | 257 | $link->appendChild($response->newAttr('rel', 'pwc')); |
| 257 | 258 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type |
| 258 | - . '/' . $cmisEntry['properties']['ObjectId']['value'] | |
| 259 | - . '/' . $cmisEntry['properties']['ContentStreamFilename']['value'])); | |
| 259 | + . '/' . $cmisEntry['properties']['objectId']['value'] | |
| 260 | + . '/' . $cmisEntry['properties']['contentStreamFilename']['value'])); | |
| 260 | 261 | $entry->appendChild($link); |
| 261 | 262 | $link = $response->newElement('link'); |
| 262 | 263 | $link->appendChild($response->newAttr('rel', 'source')); |
| 263 | 264 | $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type |
| 264 | - . '/' . $cmisEntry['properties']['ObjectId']['value'] | |
| 265 | - . '/' . $cmisEntry['properties']['ContentStreamFilename']['value'])); | |
| 265 | + . '/' . $cmisEntry['properties']['objectId']['value'] | |
| 266 | + . '/' . $cmisEntry['properties']['contentStreamFilename']['value'])); | |
| 266 | 267 | $entry->appendChild($link); |
| 267 | 268 | } |
| 268 | 269 | |
| 269 | 270 | // $link = $response->newElement('link'); |
| 270 | 271 | // $link->appendChild($response->newAttr('rel', 'stream')); |
| 271 | 272 | // $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type |
| 272 | -// . '/' . $cmisEntry['properties']['ObjectId']['value'] | |
| 273 | -// . '/' . $cmisEntry['properties']['ContentStreamFilename']['value'])); | |
| 273 | +// . '/' . $cmisEntry['properties']['objectId']['value'] | |
| 274 | +// . '/' . $cmisEntry['properties']['contentStreamFilename']['value'])); | |
| 274 | 275 | } |
| 275 | 276 | |
| 276 | 277 | $link = $response->newElement('link'); |
| ... | ... | @@ -287,14 +288,14 @@ class KT_cmis_atom_service_helper { |
| 287 | 288 | // do not need to be present, so unsure for the moment - policies are being abandoned, or so I thought... |
| 288 | 289 | // $link = $response->newElement('link'); |
| 289 | 290 | // $link->appendChild($response->newAttr('rel', 'policies')); |
| 290 | -// $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type . '/' . $cmisEntry['properties']['ParentId']['value'])); | |
| 291 | +// $link->appendChild($response->newAttr('href', CMIS_APP_BASE_URI . $workspace . '/' . $type . '/' . $cmisEntry['properties']['parentId']['value'])); | |
| 291 | 292 | // $entry->appendChild($link); |
| 292 | 293 | // end links |
| 293 | 294 | |
| 294 | 295 | // TODO proper date |
| 295 | 296 | $entry->appendChild($response->newField('published', self::formatDatestamp())); |
| 296 | - $entry->appendChild($response->newElement('summary', $cmisEntry['properties']['Name']['value'])); | |
| 297 | - $entry->appendChild($response->newElement('title', $cmisEntry['properties']['Name']['value'])); | |
| 297 | + $entry->appendChild($response->newElement('summary', $cmisEntry['properties']['name']['value'])); | |
| 298 | + $entry->appendChild($response->newElement('title', $cmisEntry['properties']['name']['value'])); | |
| 298 | 299 | $entry->appendChild($response->newField('updated', self::formatDatestamp())); |
| 299 | 300 | |
| 300 | 301 | // main CMIS entry |
| ... | ... | @@ -304,11 +305,11 @@ class KT_cmis_atom_service_helper { |
| 304 | 305 | foreach($cmisEntry['properties'] as $propertyName => $property) |
| 305 | 306 | { |
| 306 | 307 | $propElement = $response->newElement('cmis:' . $property['type']); |
| 307 | - $propElement->appendChild($response->newAttr('localName', 'rep-cmis:' . $propertyName)); | |
| 308 | +// $propElement->appendChild($response->newAttr('localName', 'rep-cmis:' . $propertyName)); | |
| 308 | 309 | $propElement->appendChild($response->newAttr('propertyDefinitionId', 'cmis:' . $propertyName)); |
| 309 | 310 | if (!empty($property['value'])) |
| 310 | 311 | { |
| 311 | - if ($propertyName == 'ContentStreamUri') { | |
| 312 | + if ($propertyName == 'contentStreamUri') { | |
| 312 | 313 | $property['value'] = CMIS_APP_BASE_URI . $workspace . '/' . $type . '/' .$property['value']; |
| 313 | 314 | } |
| 314 | 315 | $response->newField('cmis:value', CMISUtil::boolToString($property['value']), $propElement); |
| ... | ... | @@ -320,7 +321,7 @@ class KT_cmis_atom_service_helper { |
| 320 | 321 | $entry->appendChild($objectElement); |
| 321 | 322 | |
| 322 | 323 | // after every entry, append a cmis:terminator tag |
| 323 | - $entry->appendChild($response->newElement('cmis:terminator')); | |
| 324 | +// $entry->appendChild($response->newElement('cmis:terminator')); | |
| 324 | 325 | |
| 325 | 326 | // TODO check determination of when to add app:edited tag |
| 326 | 327 | // if ($method == 'POST') { |
| ... | ... | @@ -431,7 +432,7 @@ class KT_cmis_atom_service_helper { |
| 431 | 432 | $entry->appendChild($feedElement); |
| 432 | 433 | |
| 433 | 434 | // after every entry, append a cmis:terminator tag |
| 434 | - $entry->appendChild($feed->newElement('cmis:terminator')); | |
| 435 | +// $entry->appendChild($feed->newElement('cmis:terminator')); | |
| 435 | 436 | } |
| 436 | 437 | |
| 437 | 438 | return $feed; |
| ... | ... | @@ -478,7 +479,7 @@ class KT_cmis_atom_service_helper { |
| 478 | 479 | ++$start; |
| 479 | 480 | } |
| 480 | 481 | |
| 481 | - return CMISUtil::encodeObjectId('Folder', $folderId); | |
| 482 | + return CMISUtil::encodeObjectId(FOLDER, $folderId); | |
| 482 | 483 | } |
| 483 | 484 | |
| 484 | 485 | static public function getCmisProperties($xmlArray) |
| ... | ... | @@ -591,7 +592,7 @@ class KT_cmis_atom_service_helper { |
| 591 | 592 | // $service->headers['If-Modified-Since'] => 2009-07-24 17:16:54 |
| 592 | 593 | |
| 593 | 594 | $service->setContentDownload(true); |
| 594 | - $eTag = md5($response['properties']['LastModificationDate']['value'] . $response['properties']['ContentStreamLength']['value']); | |
| 595 | + $eTag = md5($response['properties']['lastModificationDate']['value'] . $response['properties']['contentStreamLength']['value']); | |
| 595 | 596 | |
| 596 | 597 | if ($service->headers['If-None-Match'] == $eTag) |
| 597 | 598 | { |
| ... | ... | @@ -604,17 +605,17 @@ class KT_cmis_atom_service_helper { |
| 604 | 605 | |
| 605 | 606 | // headers specific to output |
| 606 | 607 | $service->setEtag($eTag); |
| 607 | - $service->setHeader('Last-Modified', $response['properties']['LastModificationDate']['value']); | |
| 608 | + $service->setHeader('Last-Modified', $response['properties']['lastModificationDate']['value']); | |
| 608 | 609 | |
| 609 | - if (!empty($response['properties']['ContentStreamMimeType']['value'])) { | |
| 610 | - $service->setHeader('Content-type', $response['properties']['ContentStreamMimeType']['value'] . ';charset=utf-8'); | |
| 610 | + if (!empty($response['properties']['contentStreamMimeType']['value'])) { | |
| 611 | + $service->setHeader('Content-type', $response['properties']['contentStreamMimeType']['value'] . ';charset=utf-8'); | |
| 611 | 612 | } |
| 612 | 613 | else { |
| 613 | 614 | $service->setHeader('Content-type', 'text/plain;charset=utf-8'); |
| 614 | 615 | } |
| 615 | 616 | |
| 616 | - $service->setHeader('Content-Disposition', 'attachment;filename="' . $response['properties']['ContentStreamFilename']['value'] . '"'); | |
| 617 | - $service->setHeader('Content-Length', $response['properties']['ContentStreamLength']['value']); | |
| 617 | + $service->setHeader('Content-Disposition', 'attachment;filename="' . $response['properties']['contentStreamFilename']['value'] . '"'); | |
| 618 | + $service->setHeader('Content-Length', $response['properties']['contentStreamLength']['value']); | |
| 618 | 619 | $service->setOutput($contentStream); |
| 619 | 620 | } |
| 620 | 621 | ... | ... |
webservice/classes/atompub/cmis/KT_cmis_atom_responseFeed.inc.php
| ... | ... | @@ -19,7 +19,7 @@ class KT_cmis_atom_responseFeed extends KT_atom_responseFeed { |
| 19 | 19 | |
| 20 | 20 | // append additional tags |
| 21 | 21 | $this->feed->appendChild($this->newAttr('xmlns:app', 'http://www.w3.org/2007/app')); |
| 22 | - $this->feed->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200908')); | |
| 22 | + $this->feed->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200908/')); | |
| 23 | 23 | $this->feed->appendChild($this->newAttr('xmlns:cmisra', 'http://docs.oasis-open.org/ns/cmis/restatom/200908/')); |
| 24 | 24 | |
| 25 | 25 | // require the workspace for creating links within responses | ... | ... |
webservice/classes/atompub/cmis/KT_cmis_atom_server.inc.php
| ... | ... | @@ -115,8 +115,13 @@ class KT_cmis_atom_server extends KT_atom_server { |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | + | |
| 119 | + ob_start(); | |
| 120 | + readfile('C:\Users\Paul\Documents\Downloads\cmis_mod_kt.xml'); | |
| 121 | + $this->output = ob_get_contents(); | |
| 122 | + ob_end_clean(); | |
| 118 | 123 | |
| 119 | - $this->output = $service->getAPPdoc(); | |
| 124 | +// $this->output = $service->getAPPdoc(); | |
| 120 | 125 | } |
| 121 | 126 | |
| 122 | 127 | public function registerService($workspace = NULL, $serviceName = NULL, $serviceClass = NULL, $title = NULL, |
| ... | ... | @@ -154,7 +159,21 @@ class KT_cmis_atom_server extends KT_atom_server { |
| 154 | 159 | |
| 155 | 160 | //include('/var/www/atompub_response.xml'); |
| 156 | 161 | |
| 157 | - if ($this->renderBody) echo $this->output; | |
| 162 | + if (false && preg_match('/F1\-children/', $this->output)) { | |
| 163 | + readfile('C:\Users\Paul\Documents\Downloads\alfresco folder tree atompub response.xml'); | |
| 164 | + } | |
| 165 | + else if (false && preg_match('/urn:uuid:checkedout/', $this->output)) { | |
| 166 | + readfile('C:\Users\Paul\Documents\Downloads\alfresco checkedout atompub response.xml'); | |
| 167 | + } | |
| 168 | + else if (false && preg_match('/urn:uuid:types\-all/', $this->output)) { | |
| 169 | + readfile('C:\Users\Paul\Documents\Downloads\alfresco types atompub response.xml'); | |
| 170 | + } | |
| 171 | + else if (false && preg_match('/\<service\>/', $this->output)) { | |
| 172 | + readfile('C:\Users\Paul\Documents\Downloads\cmis_mod_kt.xml'); | |
| 173 | + } | |
| 174 | + else { | |
| 175 | + if ($this->renderBody) echo $this->output; | |
| 176 | + } | |
| 158 | 177 | } |
| 159 | 178 | |
| 160 | 179 | } | ... | ... |