Commit a98877b08e976ea13d904419cb85e38fe2e56781
1 parent
7a202292
Updates to move object functionality
Story ID:2713417. CMIS working with PHP client Committed by: Paul Barrett
Showing
2 changed files
with
8 additions
and
6 deletions
webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php
| ... | ... | @@ -190,12 +190,11 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { |
| 190 | 190 | // /folder/<folderId>/<sourceFolderId>/<objectId> |
| 191 | 191 | // also possible that there will be an existing ObjectId property, try to cater for both until we know how it really works |
| 192 | 192 | // NOTE this also applies to the source folder id, see above |
| 193 | - | |
| 194 | 193 | // check for existing object id as parameter in url |
| 195 | - // if sourceFolderId parameter is submitted (expected as parameter 3, or params[2]) then this is a move | |
| 196 | - if (isset($this->params[2])) { | |
| 194 | + // if sourceFolderId parameter is submitted (expected as $_GET['sourceFolderId']) then this is a move | |
| 195 | + if (isset($_GET['sourceFolderId'])) { | |
| 197 | 196 | $action = 'move'; |
| 198 | - $sourceFolderId = $this->params[2]; | |
| 197 | + $sourceFolderId = $_GET['sourceFolderId']; | |
| 199 | 198 | } |
| 200 | 199 | |
| 201 | 200 | // get object properties - todo send through original properties array and not modified version |
| ... | ... | @@ -364,7 +363,6 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { |
| 364 | 363 | // TODO how will client request depth? for now we assume as part of the url - will probably be covered by URI templates |
| 365 | 364 | if (isset($this->params[2])) { |
| 366 | 365 | $entries = $NavigationService->getDescendants($repositoryId, $folderId, $this->params[2]); |
| 367 | - | |
| 368 | 366 | } |
| 369 | 367 | else { |
| 370 | 368 | $entries = $NavigationService->getDescendants($repositoryId, $folderId); | ... | ... |
webservice/classes/atompub/KT_atom_server.inc.php
| ... | ... | @@ -25,7 +25,11 @@ class KT_atom_server { |
| 25 | 25 | */ |
| 26 | 26 | public function execute(){ |
| 27 | 27 | $reqMethod=trim(strtoupper($_SERVER['REQUEST_METHOD'])); |
| 28 | - $queryArray=split('/',trim($_SERVER['QUERY_STRING'],'/')); | |
| 28 | + // Use preg_split to split on both / and & characters, for hybrid uri format | |
| 29 | + // e.g. ?dms/servicename/id&arg=val will be extracted to [dms], [id], [arg=val] | |
| 30 | + // This is mainly so that we properly extract the initial parameters, the remainder | |
| 31 | + // could be extracted from the $_GET array anyway, this is just making things cleaner | |
| 32 | + $queryArray=preg_split('/\/|&/',trim($_SERVER['QUERY_STRING'],'/')); | |
| 29 | 33 | $rawRequest=@file_get_contents('php://input'); |
| 30 | 34 | |
| 31 | 35 | $workspace=strtolower(trim($queryArray[0])); | ... | ... |