Commit bb93527654dd187315cbc27a221c2dd441f1ad3d
1 parent
d30cd127
Fix issue with parent folder return caused by removal of redundant code layer
Story ID:2295472. Update KT CMIS implementation to 1.0 lib/api/compliance Committed by: Paul Barrett
Showing
4 changed files
with
7 additions
and
18 deletions
lib/api/ktcmis/ktNavigationService.inc.php
| @@ -168,7 +168,7 @@ class KTNavigationService extends KTCMISBase { | @@ -168,7 +168,7 @@ class KTNavigationService extends KTCMISBase { | ||
| 168 | "message" => "Failed getting folder parent: " . $e->getMessage() | 168 | "message" => "Failed getting folder parent: " . $e->getMessage() |
| 169 | ); | 169 | ); |
| 170 | } | 170 | } |
| 171 | - | 171 | + |
| 172 | if (PEAR::isError($parent)) | 172 | if (PEAR::isError($parent)) |
| 173 | { | 173 | { |
| 174 | return array( | 174 | return array( |
| @@ -176,7 +176,7 @@ class KTNavigationService extends KTCMISBase { | @@ -176,7 +176,7 @@ class KTNavigationService extends KTCMISBase { | ||
| 176 | "message" => "Failed getting folder parent" | 176 | "message" => "Failed getting folder parent" |
| 177 | ); | 177 | ); |
| 178 | } | 178 | } |
| 179 | - | 179 | + |
| 180 | return array( | 180 | return array( |
| 181 | "status_code" => 0, | 181 | "status_code" => 0, |
| 182 | "results" => CMISUtil::createObjectPropertiesEntry($parent->getProperties()) | 182 | "results" => CMISUtil::createObjectPropertiesEntry($parent->getProperties()) |
lib/api/ktcmis/services/CMISNavigationService.inc.php
| @@ -197,7 +197,7 @@ class CMISNavigationService { | @@ -197,7 +197,7 @@ class CMISNavigationService { | ||
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | $parentId = $ktapiFolder->get_parent_folder_id(); | 199 | $parentId = $ktapiFolder->get_parent_folder_id(); |
| 200 | - $parent = new CMISFolderObject(CMISUtil::encodeObjectId($parentId, FOLDER), $this->ktapi); | 200 | + $parent = new CMISFolderObject($parentId, $this->ktapi); |
| 201 | 201 | ||
| 202 | return $parent; | 202 | return $parent; |
| 203 | } | 203 | } |
webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php
| @@ -52,8 +52,6 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | @@ -52,8 +52,6 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | ||
| 52 | */ | 52 | */ |
| 53 | public function GET_action() | 53 | public function GET_action() |
| 54 | { | 54 | { |
| 55 | -// global $default; | ||
| 56 | -// $default->log->info($this->rawContent); | ||
| 57 | $repositoryId = KT_cmis_atom_service_helper::getRepositoryId($RepositoryService); | 55 | $repositoryId = KT_cmis_atom_service_helper::getRepositoryId($RepositoryService); |
| 58 | 56 | ||
| 59 | // TODO implement full path/node separation as with Alfresco - i.e. path requests come in on path/ and node requests come in on node/ | 57 | // TODO implement full path/node separation as with Alfresco - i.e. path requests come in on path/ and node requests come in on node/ |
| @@ -107,8 +105,8 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | @@ -107,8 +105,8 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | ||
| 107 | } | 105 | } |
| 108 | 106 | ||
| 109 | // we know that a folder will only have one parent, so we can assume element 0 | 107 | // we know that a folder will only have one parent, so we can assume element 0 |
| 110 | - $folderId = $response[0]['properties']['objectId']['value']; | ||
| 111 | - $folderName = $response[0]['properties']['name']['value']; | 108 | + $folderId = $response['properties']['objectId']['value']; |
| 109 | + $folderName = $response['properties']['name']['value']; | ||
| 112 | } | 110 | } |
| 113 | else { | 111 | else { |
| 114 | $folderId = $this->params[0]; | 112 | $folderId = $this->params[0]; |
| @@ -134,10 +132,7 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | @@ -134,10 +132,7 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | ||
| 134 | * This includes creation/moving of both folders and documents. | 132 | * This includes creation/moving of both folders and documents. |
| 135 | */ | 133 | */ |
| 136 | public function POST_action() | 134 | public function POST_action() |
| 137 | - { | ||
| 138 | - global $default; | ||
| 139 | - $default->log->info($this->rawContent); | ||
| 140 | - | 135 | + { |
| 141 | $repositoryId = KT_cmis_atom_service_helper::getRepositoryId($RepositoryService); | 136 | $repositoryId = KT_cmis_atom_service_helper::getRepositoryId($RepositoryService); |
| 142 | 137 | ||
| 143 | // set default action, objectId and typeId | 138 | // set default action, objectId and typeId |
| @@ -194,15 +189,12 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | @@ -194,15 +189,12 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | ||
| 194 | 189 | ||
| 195 | $ObjectService = new KTObjectService(KT_cmis_atom_service_helper::getKt()); | 190 | $ObjectService = new KTObjectService(KT_cmis_atom_service_helper::getKt()); |
| 196 | 191 | ||
| 197 | - $default->log->info('here: '.$action); | ||
| 198 | - | ||
| 199 | $success = false; | 192 | $success = false; |
| 200 | $error = null; | 193 | $error = null; |
| 201 | if ($action == 'create') | 194 | if ($action == 'create') |
| 202 | { | 195 | { |
| 203 | // TODO detection and passing of optional parameters (policies, ACEs, etc...) as well as support for other object-types | 196 | // TODO detection and passing of optional parameters (policies, ACEs, etc...) as well as support for other object-types |
| 204 | if ($cmisObjectProperties['cmis:objectTypeId'] == 'cmis:folder') { | 197 | if ($cmisObjectProperties['cmis:objectTypeId'] == 'cmis:folder') { |
| 205 | - $default->log->info($cmisObjectProperties['cmis:objectTypeId']); | ||
| 206 | $newObjectId = $ObjectService->createFolder($repositoryId, $properties, $folderId); | 198 | $newObjectId = $ObjectService->createFolder($repositoryId, $properties, $folderId); |
| 207 | } | 199 | } |
| 208 | else { | 200 | else { |
webservice/atompub/cmis/KT_cmis_atom_service_helper.inc.php
| @@ -56,6 +56,7 @@ class KT_cmis_atom_service_helper { | @@ -56,6 +56,7 @@ class KT_cmis_atom_service_helper { | ||
| 56 | * @param string $folderId | 56 | * @param string $folderId |
| 57 | * @return string CMIS AtomPub feed | 57 | * @return string CMIS AtomPub feed |
| 58 | */ | 58 | */ |
| 59 | + // TODO enable this to work on an existing set of object properties if submitted | ||
| 59 | static public function getObjectFeed(&$service, $ObjectService, $repositoryId, $objectId, $method = 'GET') | 60 | static public function getObjectFeed(&$service, $ObjectService, $repositoryId, $objectId, $method = 'GET') |
| 60 | { | 61 | { |
| 61 | self::$repositoryId = $repositoryId; | 62 | self::$repositoryId = $repositoryId; |
| @@ -399,10 +400,6 @@ class KT_cmis_atom_service_helper { | @@ -399,10 +400,6 @@ class KT_cmis_atom_service_helper { | ||
| 399 | */ | 400 | */ |
| 400 | static public function getTypeFeed($typeDef, $types) | 401 | static public function getTypeFeed($typeDef, $types) |
| 401 | { | 402 | { |
| 402 | - global $default; | ||
| 403 | -// $default->log->info(print_r($types)); | ||
| 404 | -// $default->log->info(print_r($types, true)); | ||
| 405 | - $default->log->info($typeDef); | ||
| 406 | $typesString = ''; | 403 | $typesString = ''; |
| 407 | $typesHeading = ''; | 404 | $typesHeading = ''; |
| 408 | switch($typeDef) | 405 | switch($typeDef) |