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 | 168 | "message" => "Failed getting folder parent: " . $e->getMessage() |
| 169 | 169 | ); |
| 170 | 170 | } |
| 171 | - | |
| 171 | + | |
| 172 | 172 | if (PEAR::isError($parent)) |
| 173 | 173 | { |
| 174 | 174 | return array( |
| ... | ... | @@ -176,7 +176,7 @@ class KTNavigationService extends KTCMISBase { |
| 176 | 176 | "message" => "Failed getting folder parent" |
| 177 | 177 | ); |
| 178 | 178 | } |
| 179 | - | |
| 179 | + | |
| 180 | 180 | return array( |
| 181 | 181 | "status_code" => 0, |
| 182 | 182 | "results" => CMISUtil::createObjectPropertiesEntry($parent->getProperties()) | ... | ... |
lib/api/ktcmis/services/CMISNavigationService.inc.php
| ... | ... | @@ -197,7 +197,7 @@ class CMISNavigationService { |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 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 | 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 | 52 | */ |
| 53 | 53 | public function GET_action() |
| 54 | 54 | { |
| 55 | -// global $default; | |
| 56 | -// $default->log->info($this->rawContent); | |
| 57 | 55 | $repositoryId = KT_cmis_atom_service_helper::getRepositoryId($RepositoryService); |
| 58 | 56 | |
| 59 | 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 | 105 | } |
| 108 | 106 | |
| 109 | 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 | 111 | else { |
| 114 | 112 | $folderId = $this->params[0]; |
| ... | ... | @@ -134,10 +132,7 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { |
| 134 | 132 | * This includes creation/moving of both folders and documents. |
| 135 | 133 | */ |
| 136 | 134 | public function POST_action() |
| 137 | - { | |
| 138 | - global $default; | |
| 139 | - $default->log->info($this->rawContent); | |
| 140 | - | |
| 135 | + { | |
| 141 | 136 | $repositoryId = KT_cmis_atom_service_helper::getRepositoryId($RepositoryService); |
| 142 | 137 | |
| 143 | 138 | // set default action, objectId and typeId |
| ... | ... | @@ -194,15 +189,12 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { |
| 194 | 189 | |
| 195 | 190 | $ObjectService = new KTObjectService(KT_cmis_atom_service_helper::getKt()); |
| 196 | 191 | |
| 197 | - $default->log->info('here: '.$action); | |
| 198 | - | |
| 199 | 192 | $success = false; |
| 200 | 193 | $error = null; |
| 201 | 194 | if ($action == 'create') |
| 202 | 195 | { |
| 203 | 196 | // TODO detection and passing of optional parameters (policies, ACEs, etc...) as well as support for other object-types |
| 204 | 197 | if ($cmisObjectProperties['cmis:objectTypeId'] == 'cmis:folder') { |
| 205 | - $default->log->info($cmisObjectProperties['cmis:objectTypeId']); | |
| 206 | 198 | $newObjectId = $ObjectService->createFolder($repositoryId, $properties, $folderId); |
| 207 | 199 | } |
| 208 | 200 | else { | ... | ... |
webservice/atompub/cmis/KT_cmis_atom_service_helper.inc.php
| ... | ... | @@ -56,6 +56,7 @@ class KT_cmis_atom_service_helper { |
| 56 | 56 | * @param string $folderId |
| 57 | 57 | * @return string CMIS AtomPub feed |
| 58 | 58 | */ |
| 59 | + // TODO enable this to work on an existing set of object properties if submitted | |
| 59 | 60 | static public function getObjectFeed(&$service, $ObjectService, $repositoryId, $objectId, $method = 'GET') |
| 60 | 61 | { |
| 61 | 62 | self::$repositoryId = $repositoryId; |
| ... | ... | @@ -399,10 +400,6 @@ class KT_cmis_atom_service_helper { |
| 399 | 400 | */ |
| 400 | 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 | 403 | $typesString = ''; |
| 407 | 404 | $typesHeading = ''; |
| 408 | 405 | switch($typeDef) | ... | ... |