diff --git a/lib/api/ktcmis/ktRepositoryService.inc.php b/lib/api/ktcmis/ktRepositoryService.inc.php index 667de21..cf08f74 100644 --- a/lib/api/ktcmis/ktRepositoryService.inc.php +++ b/lib/api/ktcmis/ktRepositoryService.inc.php @@ -86,7 +86,7 @@ class KTRepositoryService extends KTCMISBase { { $repositoryList[$count]['repositoryId'] = $repository->getRepositoryId(); $repositoryList[$count]['repositoryName'] = $repository->getRepositoryName(); - $repositoryList[$count]['repositoryURI'] = $repository->getRepositoryURI(); + //$repositoryList[$count]['repositoryURI'] = $repository->getRepositoryURI(); ++$count; } diff --git a/lib/api/ktcmis/services/CMISNavigationService.inc.php b/lib/api/ktcmis/services/CMISNavigationService.inc.php index 3c0a797..d3785b7 100644 --- a/lib/api/ktcmis/services/CMISNavigationService.inc.php +++ b/lib/api/ktcmis/services/CMISNavigationService.inc.php @@ -75,7 +75,7 @@ class CMISNavigationService { */ // NOTE This method does NOT support paging as defined in the paging section - // NOTE If the Repository supports the optional “VersionSpecificFiling� capability, + // NOTE If the Repository supports the optional “VersionSpecificFiling��? capability, // then the repository SHALL return the document versions filed in the specified folder or its descendant folders. // Otherwise, the latest version of the documents SHALL be returned. // TODO FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid @@ -116,12 +116,12 @@ class CMISNavigationService { * @param int $skipCount * @return array $descendants */ - // NOTE If the Repository supports the optional “VersionSpecificFiling� capability, + // NOTE If the Repository supports the optional “VersionSpecificFiling��? capability, // then the repository SHALL return the document versions filed in the specified folder or its descendant folders. // Otherwise, the latest version of the documents SHALL be returned. // TODO FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid - function getChildren($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, - $typeId = 'Any', $filter = '', $maxItems = 0, $skipCount = 0) + function getChildren($repositoryId, $folderId, $includeAllowableActions = null, $includeRelationships = null, + $typeId = 'Any', $filter = '', $maxItems = 0, $skipCount = 0, $orderBy = '', $renditionFilter = null, $includePathSegment = false) { // TODO paging // TODO optional parameters @@ -130,9 +130,9 @@ class CMISNavigationService { // if this is not a folder, cannot get children $folderId = CMISUtil::decodeObjectId($folderId, $type); - // NOTE this will quite possibly break the webservices + if ($type != 'Folder') { - return $children; + throw new invalidArgumentException('The specified object is not a folder'); } $folder = $this->ktapi->get_folder_by_id($folderId); @@ -158,7 +158,7 @@ class CMISNavigationService { */ // TODO FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid // TODO If this service method is invoked on the root folder of the Repository, then the Repository SHALL return an empty result set. - // NOTE SHOULD always include the “ObjectId� and “ParentId� properties for all objects returned + // NOTE SHOULD always include the “ObjectId��? and “ParentId��? properties for all objects returned function getFolderParent($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, $returnToRoot, $filter = '') { // NOTE the root folder obviously has no parent, throw an ObjectNotFoundException here if this is the root folder @@ -263,12 +263,11 @@ class CMISNavigationService { * @param int $skipCount * @return array $checkedout The collection of checked out document objects */ - // NOTE NOT YET IMPLEMENTED (this function is just a place holder at the moment :)) // TODO exceptions: • FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid. // TODO filter by folder id // TODO $filter and paging - function getCheckedOutDocs($repositoryId, $folderId = null, $filter = '', $includeAllowableActions, $includeRelationships, - $maxItems = 0, $skipCount = 0) + function getCheckedOutDocs($repositoryId, $folderId = null, $filter = '', $includeAllowableActions = false, $includeRelationships = null, + $maxItems = 0, $skipCount = 0, $orderBy = '') { $checkedout = array(); diff --git a/lib/api/ktcmis/services/CMISRepositoryService.inc.php b/lib/api/ktcmis/services/CMISRepositoryService.inc.php index 72ad89e..b701f00 100644 --- a/lib/api/ktcmis/services/CMISRepositoryService.inc.php +++ b/lib/api/ktcmis/services/CMISRepositoryService.inc.php @@ -104,9 +104,10 @@ class CMISRepositoryService { // NOTE this code may fit better within the Repository Class // TODO return for specific type when $typeId is specified // TODO other optional parameters - function getTypes($repositoryId, $typeId = '', $returnPropertyDefinitions = false, + private function getTypes($repositoryId, $typeId = '', $returnPropertyDefinitions = false, $maxItems = 0, $skipCount = 0, &$hasMoreItems = false) - { + { + /* if ($typeId != '') { try { @@ -117,6 +118,7 @@ class CMISRepositoryService { throw new InvalidArgumentException('Type ' . $typeId . ' is not supported'); } } + */ $repository = new CMISRepository($repositoryId); $supportedTypes = $repository->getTypes(); @@ -171,7 +173,7 @@ class CMISRepositoryService { require_once(CMIS_DIR . '/objecttypes/' . $object . '.inc.php'); $cmisObject = new $object; - $typeDefinition['attributes'] = $cmisObject->getAttributes(); + //$typeDefinition['attributes'] = $cmisObject->getAttributes(); $typeDefinition['properties'] = $cmisObject->getProperties(); return $typeDefinition; diff --git a/sql/mysql/install/rebuild.sh b/sql/mysql/install/rebuild.sh index b4e0d06..53c5c28 100755 --- a/sql/mysql/install/rebuild.sh +++ b/sql/mysql/install/rebuild.sh @@ -1,4 +1,5 @@ #!/bin/sh +set -e DIR=`dirname $0` cd $DIR @@ -17,4 +18,3 @@ mysqladmin -u root -p$pass create $db mysql -u root -p$pass $db < structure.sql mysql -u root -p$pass $db < data.sql mysql -u root -p$pass $db < user.sql - diff --git a/webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php b/webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php index 6f56e6c..150d193 100644 --- a/webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php +++ b/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 { foreach($response as $failed) { $entry = $feed->newEntry(); - $objectElement = $feed->newElement('cmis:object'); + $objectElement = $feed->newElement('cmisra:object'); $propertiesElement = $feed->newElement('cmis:properties'); $propElement = $feed->newElement('cmis:propertyId'); $propElement->appendChild($feed->newAttr('cmis:name', 'ObjectId')); @@ -740,4 +740,4 @@ class KT_cmis_atom_service_type extends KT_cmis_atom_service { } -?> \ No newline at end of file +?> diff --git a/webservice/atompub/cmis/KT_cmis_atom_service_helper.inc.php b/webservice/atompub/cmis/KT_cmis_atom_service_helper.inc.php index 3746bfd..20d3155 100644 --- a/webservice/atompub/cmis/KT_cmis_atom_service_helper.inc.php +++ b/webservice/atompub/cmis/KT_cmis_atom_service_helper.inc.php @@ -298,13 +298,14 @@ class KT_cmis_atom_service_helper { $entry->appendChild($response->newField('updated', self::formatDatestamp())); // main CMIS entry - $objectElement = $response->newElement('cmis:object'); + $objectElement = $response->newElement('cmisra:object'); $propertiesElement = $response->newElement('cmis:properties'); foreach($cmisEntry['properties'] as $propertyName => $property) { $propElement = $response->newElement('cmis:' . $property['type']); - $propElement->appendChild($response->newAttr('cmis:name', $propertyName)); + $propElement->appendChild($response->newAttr('localName', 'rep-cmis:' . $propertyName)); + $propElement->appendChild($response->newAttr('propertyDefinitionId', 'cmis:' . $propertyName)); if (!empty($property['value'])) { if ($propertyName == 'ContentStreamUri') { @@ -484,12 +485,12 @@ class KT_cmis_atom_service_helper { { $properties = array(); - // find cmis:object tag - $baseCmisObject = KT_cmis_atom_service_helper::findTag('cmis:object', $xmlArray, null, false); + // find cmisra:object tag + $baseCmisObject = KT_cmis_atom_service_helper::findTag('cmisra:object', $xmlArray, null, false); if(count($baseCmisObject) <= 0) { $entryObject = KT_cmis_atom_service_helper::findTag('entry', $xmlArray, null, false); - $baseCmisObject = KT_cmis_atom_service_helper::findTag('cmis:object', $entryObject['@children'], null, true); + $baseCmisObject = KT_cmis_atom_service_helper::findTag('cmisra:object', $entryObject['@children'], null, true); } if(count($baseCmisObject)>0) diff --git a/webservice/atompub/cmis/index.php b/webservice/atompub/cmis/index.php index 3e00656..983f2d4 100644 --- a/webservice/atompub/cmis/index.php +++ b/webservice/atompub/cmis/index.php @@ -101,12 +101,12 @@ if ($workspace == 'servicedocument') */ // TODO consider a registerServices function which will, dependant on what is requested, register the appropriate services, keep the logic out of the index file $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection', - array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'children'), 'rootchildren'); + array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'children'), 'root'); $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection', array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'descendants'), 'rootdescendants'); $APP->registerService('dms', 'checkedout', 'KT_cmis_atom_service_checkedout', 'Checked Out Document Collection', null, 'checkedout', 'application/atom+xml;type=entry'); -$APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'typeschildren'); +$APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'types'); $APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'typesdescendants'); if ($workspace != 'servicedocument') diff --git a/webservice/classes/atompub/cmis/KT_cmis_atom_responseFeed.inc.php b/webservice/classes/atompub/cmis/KT_cmis_atom_responseFeed.inc.php index 6bb0c29..9a01898 100644 --- a/webservice/classes/atompub/cmis/KT_cmis_atom_responseFeed.inc.php +++ b/webservice/classes/atompub/cmis/KT_cmis_atom_responseFeed.inc.php @@ -19,7 +19,8 @@ class KT_cmis_atom_responseFeed extends KT_atom_responseFeed { // append additional tags $this->feed->appendChild($this->newAttr('xmlns:app', 'http://www.w3.org/2007/app')); - $this->feed->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200901')); + $this->feed->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200908')); + $this->feed->appendChild($this->newAttr('xmlns:cmisra', 'http://docs.oasis-open.org/ns/cmis/restatom/200908/')); // require the workspace for creating links within responses $queryArray = split('/', trim($_SERVER['QUERY_STRING'], '/')); @@ -93,4 +94,4 @@ class KT_cmis_atom_ResponseFeed_PUT extends KT_cmis_atom_responseFeed{} class KT_cmis_atom_ResponseFeed_POST extends KT_cmis_atom_responseFeed{} class KT_cmis_atom_ResponseFeed_DELETE extends KT_cmis_atom_responseFeed{} -?> \ No newline at end of file +?> diff --git a/webservice/classes/atompub/cmis/KT_cmis_atom_server.inc.php b/webservice/classes/atompub/cmis/KT_cmis_atom_server.inc.php index 83dfec9..e2254e5 100644 --- a/webservice/classes/atompub/cmis/KT_cmis_atom_server.inc.php +++ b/webservice/classes/atompub/cmis/KT_cmis_atom_server.inc.php @@ -83,7 +83,7 @@ class KT_cmis_atom_server extends KT_atom_server { $ws->appendChild($service->newAttr('cmis:repositoryRelationship', $this->repositoryInfo['repositoryRelationship'])); // repository information - $element = $service->newElement('cmis:repositoryInfo'); + $element = $service->newElement('cmisra:repositoryInfo'); foreach($this->repositoryInfo as $key => $repoData) { if ($key == 'rootFolderId') { @@ -151,9 +151,12 @@ class KT_cmis_atom_server extends KT_atom_server { { ob_end_clean(); if (!$this->headersSet) header('Content-type: text/xml'); + + //include('/var/www/atompub_response.xml'); + if ($this->renderBody) echo $this->output; } } -?> \ No newline at end of file +?> diff --git a/webservice/classes/atompub/cmis/KT_cmis_atom_serviceDoc.inc.php b/webservice/classes/atompub/cmis/KT_cmis_atom_serviceDoc.inc.php index c61c94b..423e5d7 100644 --- a/webservice/classes/atompub/cmis/KT_cmis_atom_serviceDoc.inc.php +++ b/webservice/classes/atompub/cmis/KT_cmis_atom_serviceDoc.inc.php @@ -71,7 +71,8 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { $service = $this->newElement('service'); $service->appendChild($this->newAttr('xmlns', 'http://www.w3.org/2007/app')); $service->appendChild($this->newAttr('xmlns:atom', 'http://www.w3.org/2005/Atom')); - $service->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200901')); + $service->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200908')); + $service->appendChild($this->newAttr('xmlns:cmisra', 'http://docs.oasis-open.org/ns/cmis/restatom/200908/')); $this->service =& $service; $this->DOM->appendChild($this->service); } @@ -80,7 +81,7 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { { $collection=$this->newElement('collection'); $collection->appendChild($this->newAttr('href', $url)); - $collection->appendChild($this->newAttr('cmis:collectionType', $cmisCollectionType)); + $collection->appendChild($this->newAttr('cmisra:collectionType', $cmisCollectionType)); $collection->appendChild($this->newElement('atom:title', $title)); if (!is_null($accept)) { $collection->appendChild($this->newElement('accept', $accept)); @@ -123,4 +124,4 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { */ -?> \ No newline at end of file +?>