Commit be2400471b629ddda6b7b0066d60bf0439c0589f
Merge branch 'edge' of github.com:ktgit/knowledgetree into edge
Showing
10 changed files
with
38 additions
and
31 deletions
lib/api/ktcmis/ktRepositoryService.inc.php
| ... | ... | @@ -86,7 +86,7 @@ class KTRepositoryService extends KTCMISBase { |
| 86 | 86 | { |
| 87 | 87 | $repositoryList[$count]['repositoryId'] = $repository->getRepositoryId(); |
| 88 | 88 | $repositoryList[$count]['repositoryName'] = $repository->getRepositoryName(); |
| 89 | - $repositoryList[$count]['repositoryURI'] = $repository->getRepositoryURI(); | |
| 89 | + //$repositoryList[$count]['repositoryURI'] = $repository->getRepositoryURI(); | |
| 90 | 90 | ++$count; |
| 91 | 91 | } |
| 92 | 92 | ... | ... |
lib/api/ktcmis/services/CMISNavigationService.inc.php
| ... | ... | @@ -75,7 +75,7 @@ class CMISNavigationService { |
| 75 | 75 | */ |
| 76 | 76 | |
| 77 | 77 | // NOTE This method does NOT support paging as defined in the paging section |
| 78 | - // NOTE If the Repository supports the optional “VersionSpecificFiling� capability, | |
| 78 | + // NOTE If the Repository supports the optional “VersionSpecificFiling��? capability, | |
| 79 | 79 | // then the repository SHALL return the document versions filed in the specified folder or its descendant folders. |
| 80 | 80 | // Otherwise, the latest version of the documents SHALL be returned. |
| 81 | 81 | // TODO FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid |
| ... | ... | @@ -116,12 +116,12 @@ class CMISNavigationService { |
| 116 | 116 | * @param int $skipCount |
| 117 | 117 | * @return array $descendants |
| 118 | 118 | */ |
| 119 | - // NOTE If the Repository supports the optional “VersionSpecificFiling� capability, | |
| 119 | + // NOTE If the Repository supports the optional “VersionSpecificFiling��? capability, | |
| 120 | 120 | // then the repository SHALL return the document versions filed in the specified folder or its descendant folders. |
| 121 | 121 | // Otherwise, the latest version of the documents SHALL be returned. |
| 122 | 122 | // TODO FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid |
| 123 | - function getChildren($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, | |
| 124 | - $typeId = 'Any', $filter = '', $maxItems = 0, $skipCount = 0) | |
| 123 | + function getChildren($repositoryId, $folderId, $includeAllowableActions = null, $includeRelationships = null, | |
| 124 | + $typeId = 'Any', $filter = '', $maxItems = 0, $skipCount = 0, $orderBy = '', $renditionFilter = null, $includePathSegment = false) | |
| 125 | 125 | { |
| 126 | 126 | // TODO paging |
| 127 | 127 | // TODO optional parameters |
| ... | ... | @@ -130,9 +130,9 @@ class CMISNavigationService { |
| 130 | 130 | |
| 131 | 131 | // if this is not a folder, cannot get children |
| 132 | 132 | $folderId = CMISUtil::decodeObjectId($folderId, $type); |
| 133 | - // NOTE this will quite possibly break the webservices | |
| 133 | + | |
| 134 | 134 | if ($type != 'Folder') { |
| 135 | - return $children; | |
| 135 | + throw new invalidArgumentException('The specified object is not a folder'); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | $folder = $this->ktapi->get_folder_by_id($folderId); |
| ... | ... | @@ -158,7 +158,7 @@ class CMISNavigationService { |
| 158 | 158 | */ |
| 159 | 159 | // TODO FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid |
| 160 | 160 | // TODO If this service method is invoked on the root folder of the Repository, then the Repository SHALL return an empty result set. |
| 161 | - // NOTE SHOULD always include the “ObjectId� and “ParentId� properties for all objects returned | |
| 161 | + // NOTE SHOULD always include the “ObjectId��? and “ParentId��? properties for all objects returned | |
| 162 | 162 | function getFolderParent($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, $returnToRoot, $filter = '') |
| 163 | 163 | { |
| 164 | 164 | // NOTE the root folder obviously has no parent, throw an ObjectNotFoundException here if this is the root folder |
| ... | ... | @@ -263,12 +263,11 @@ class CMISNavigationService { |
| 263 | 263 | * @param int $skipCount |
| 264 | 264 | * @return array $checkedout The collection of checked out document objects |
| 265 | 265 | */ |
| 266 | - // NOTE NOT YET IMPLEMENTED (this function is just a place holder at the moment :)) | |
| 267 | 266 | // TODO exceptions: • FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid. |
| 268 | 267 | // TODO filter by folder id |
| 269 | 268 | // TODO $filter and paging |
| 270 | - function getCheckedOutDocs($repositoryId, $folderId = null, $filter = '', $includeAllowableActions, $includeRelationships, | |
| 271 | - $maxItems = 0, $skipCount = 0) | |
| 269 | + function getCheckedOutDocs($repositoryId, $folderId = null, $filter = '', $includeAllowableActions = false, $includeRelationships = null, | |
| 270 | + $maxItems = 0, $skipCount = 0, $orderBy = '') | |
| 272 | 271 | { |
| 273 | 272 | $checkedout = array(); |
| 274 | 273 | ... | ... |
lib/api/ktcmis/services/CMISRepositoryService.inc.php
| ... | ... | @@ -104,9 +104,10 @@ 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 | - function getTypes($repositoryId, $typeId = '', $returnPropertyDefinitions = false, | |
| 107 | + private function getTypes($repositoryId, $typeId = '', $returnPropertyDefinitions = false, | |
| 108 | 108 | $maxItems = 0, $skipCount = 0, &$hasMoreItems = false) |
| 109 | - { | |
| 109 | + { | |
| 110 | + /* | |
| 110 | 111 | if ($typeId != '') |
| 111 | 112 | { |
| 112 | 113 | try { |
| ... | ... | @@ -117,6 +118,7 @@ class CMISRepositoryService { |
| 117 | 118 | throw new InvalidArgumentException('Type ' . $typeId . ' is not supported'); |
| 118 | 119 | } |
| 119 | 120 | } |
| 121 | + */ | |
| 120 | 122 | |
| 121 | 123 | $repository = new CMISRepository($repositoryId); |
| 122 | 124 | $supportedTypes = $repository->getTypes(); |
| ... | ... | @@ -171,7 +173,7 @@ class CMISRepositoryService { |
| 171 | 173 | |
| 172 | 174 | require_once(CMIS_DIR . '/objecttypes/' . $object . '.inc.php'); |
| 173 | 175 | $cmisObject = new $object; |
| 174 | - $typeDefinition['attributes'] = $cmisObject->getAttributes(); | |
| 176 | + //$typeDefinition['attributes'] = $cmisObject->getAttributes(); | |
| 175 | 177 | $typeDefinition['properties'] = $cmisObject->getProperties(); |
| 176 | 178 | |
| 177 | 179 | return $typeDefinition; | ... | ... |
sql/mysql/install/rebuild.sh
webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php
| ... | ... | @@ -269,7 +269,7 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { |
| 269 | 269 | foreach($response as $failed) |
| 270 | 270 | { |
| 271 | 271 | $entry = $feed->newEntry(); |
| 272 | - $objectElement = $feed->newElement('cmis:object'); | |
| 272 | + $objectElement = $feed->newElement('cmisra:object'); | |
| 273 | 273 | $propertiesElement = $feed->newElement('cmis:properties'); |
| 274 | 274 | $propElement = $feed->newElement('cmis:propertyId'); |
| 275 | 275 | $propElement->appendChild($feed->newAttr('cmis:name', 'ObjectId')); |
| ... | ... | @@ -740,4 +740,4 @@ class KT_cmis_atom_service_type extends KT_cmis_atom_service { |
| 740 | 740 | |
| 741 | 741 | } |
| 742 | 742 | |
| 743 | -?> | |
| 744 | 743 | \ No newline at end of file |
| 744 | +?> | ... | ... |
webservice/atompub/cmis/KT_cmis_atom_service_helper.inc.php
| ... | ... | @@ -298,13 +298,14 @@ class KT_cmis_atom_service_helper { |
| 298 | 298 | $entry->appendChild($response->newField('updated', self::formatDatestamp())); |
| 299 | 299 | |
| 300 | 300 | // main CMIS entry |
| 301 | - $objectElement = $response->newElement('cmis:object'); | |
| 301 | + $objectElement = $response->newElement('cmisra:object'); | |
| 302 | 302 | $propertiesElement = $response->newElement('cmis:properties'); |
| 303 | 303 | |
| 304 | 304 | foreach($cmisEntry['properties'] as $propertyName => $property) |
| 305 | 305 | { |
| 306 | 306 | $propElement = $response->newElement('cmis:' . $property['type']); |
| 307 | - $propElement->appendChild($response->newAttr('cmis:name', $propertyName)); | |
| 307 | + $propElement->appendChild($response->newAttr('localName', 'rep-cmis:' . $propertyName)); | |
| 308 | + $propElement->appendChild($response->newAttr('propertyDefinitionId', 'cmis:' . $propertyName)); | |
| 308 | 309 | if (!empty($property['value'])) |
| 309 | 310 | { |
| 310 | 311 | if ($propertyName == 'ContentStreamUri') { |
| ... | ... | @@ -484,12 +485,12 @@ class KT_cmis_atom_service_helper { |
| 484 | 485 | { |
| 485 | 486 | $properties = array(); |
| 486 | 487 | |
| 487 | - // find cmis:object tag | |
| 488 | - $baseCmisObject = KT_cmis_atom_service_helper::findTag('cmis:object', $xmlArray, null, false); | |
| 488 | + // find cmisra:object tag | |
| 489 | + $baseCmisObject = KT_cmis_atom_service_helper::findTag('cmisra:object', $xmlArray, null, false); | |
| 489 | 490 | if(count($baseCmisObject) <= 0) |
| 490 | 491 | { |
| 491 | 492 | $entryObject = KT_cmis_atom_service_helper::findTag('entry', $xmlArray, null, false); |
| 492 | - $baseCmisObject = KT_cmis_atom_service_helper::findTag('cmis:object', $entryObject['@children'], null, true); | |
| 493 | + $baseCmisObject = KT_cmis_atom_service_helper::findTag('cmisra:object', $entryObject['@children'], null, true); | |
| 493 | 494 | } |
| 494 | 495 | |
| 495 | 496 | if(count($baseCmisObject)>0) | ... | ... |
webservice/atompub/cmis/index.php
| ... | ... | @@ -101,12 +101,12 @@ if ($workspace == 'servicedocument') |
| 101 | 101 | */ |
| 102 | 102 | // TODO consider a registerServices function which will, dependant on what is requested, register the appropriate services, keep the logic out of the index file |
| 103 | 103 | $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection', |
| 104 | - array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'children'), 'rootchildren'); | |
| 104 | + array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'children'), 'root'); | |
| 105 | 105 | $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection', |
| 106 | 106 | array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'descendants'), 'rootdescendants'); |
| 107 | 107 | $APP->registerService('dms', 'checkedout', 'KT_cmis_atom_service_checkedout', 'Checked Out Document Collection', null, |
| 108 | 108 | 'checkedout', 'application/atom+xml;type=entry'); |
| 109 | -$APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'typeschildren'); | |
| 109 | +$APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'types'); | |
| 110 | 110 | $APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'typesdescendants'); |
| 111 | 111 | |
| 112 | 112 | if ($workspace != 'servicedocument') | ... | ... |
webservice/classes/atompub/cmis/KT_cmis_atom_responseFeed.inc.php
| ... | ... | @@ -19,7 +19,8 @@ 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/200901')); | |
| 22 | + $this->feed->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200908')); | |
| 23 | + $this->feed->appendChild($this->newAttr('xmlns:cmisra', 'http://docs.oasis-open.org/ns/cmis/restatom/200908/')); | |
| 23 | 24 | |
| 24 | 25 | // require the workspace for creating links within responses |
| 25 | 26 | $queryArray = split('/', trim($_SERVER['QUERY_STRING'], '/')); |
| ... | ... | @@ -93,4 +94,4 @@ class KT_cmis_atom_ResponseFeed_PUT extends KT_cmis_atom_responseFeed{} |
| 93 | 94 | class KT_cmis_atom_ResponseFeed_POST extends KT_cmis_atom_responseFeed{} |
| 94 | 95 | class KT_cmis_atom_ResponseFeed_DELETE extends KT_cmis_atom_responseFeed{} |
| 95 | 96 | |
| 96 | -?> | |
| 97 | 97 | \ No newline at end of file |
| 98 | +?> | ... | ... |
webservice/classes/atompub/cmis/KT_cmis_atom_server.inc.php
| ... | ... | @@ -83,7 +83,7 @@ class KT_cmis_atom_server extends KT_atom_server { |
| 83 | 83 | $ws->appendChild($service->newAttr('cmis:repositoryRelationship', $this->repositoryInfo['repositoryRelationship'])); |
| 84 | 84 | |
| 85 | 85 | // repository information |
| 86 | - $element = $service->newElement('cmis:repositoryInfo'); | |
| 86 | + $element = $service->newElement('cmisra:repositoryInfo'); | |
| 87 | 87 | foreach($this->repositoryInfo as $key => $repoData) |
| 88 | 88 | { |
| 89 | 89 | if ($key == 'rootFolderId') { |
| ... | ... | @@ -151,9 +151,12 @@ class KT_cmis_atom_server extends KT_atom_server { |
| 151 | 151 | { |
| 152 | 152 | ob_end_clean(); |
| 153 | 153 | if (!$this->headersSet) header('Content-type: text/xml'); |
| 154 | + | |
| 155 | + //include('/var/www/atompub_response.xml'); | |
| 156 | + | |
| 154 | 157 | if ($this->renderBody) echo $this->output; |
| 155 | 158 | } |
| 156 | 159 | |
| 157 | 160 | } |
| 158 | 161 | |
| 159 | -?> | |
| 160 | 162 | \ No newline at end of file |
| 163 | +?> | ... | ... |
webservice/classes/atompub/cmis/KT_cmis_atom_serviceDoc.inc.php
| ... | ... | @@ -71,7 +71,8 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { |
| 71 | 71 | $service = $this->newElement('service'); |
| 72 | 72 | $service->appendChild($this->newAttr('xmlns', 'http://www.w3.org/2007/app')); |
| 73 | 73 | $service->appendChild($this->newAttr('xmlns:atom', 'http://www.w3.org/2005/Atom')); |
| 74 | - $service->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200901')); | |
| 74 | + $service->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200908')); | |
| 75 | + $service->appendChild($this->newAttr('xmlns:cmisra', 'http://docs.oasis-open.org/ns/cmis/restatom/200908/')); | |
| 75 | 76 | $this->service =& $service; |
| 76 | 77 | $this->DOM->appendChild($this->service); |
| 77 | 78 | } |
| ... | ... | @@ -80,7 +81,7 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { |
| 80 | 81 | { |
| 81 | 82 | $collection=$this->newElement('collection'); |
| 82 | 83 | $collection->appendChild($this->newAttr('href', $url)); |
| 83 | - $collection->appendChild($this->newAttr('cmis:collectionType', $cmisCollectionType)); | |
| 84 | + $collection->appendChild($this->newAttr('cmisra:collectionType', $cmisCollectionType)); | |
| 84 | 85 | $collection->appendChild($this->newElement('atom:title', $title)); |
| 85 | 86 | if (!is_null($accept)) { |
| 86 | 87 | $collection->appendChild($this->newElement('accept', $accept)); |
| ... | ... | @@ -123,4 +124,4 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { |
| 123 | 124 | */ |
| 124 | 125 | |
| 125 | 126 | |
| 126 | -?> | |
| 127 | 127 | \ No newline at end of file |
| 128 | +?> | ... | ... |