Commit be2400471b629ddda6b7b0066d60bf0439c0589f

Authored by Paul Barrett
2 parents 6cbdfa02 c885e908

Merge branch 'edge' of github.com:ktgit/knowledgetree into edge

lib/api/ktcmis/ktRepositoryService.inc.php
@@ -86,7 +86,7 @@ class KTRepositoryService extends KTCMISBase { @@ -86,7 +86,7 @@ class KTRepositoryService extends KTCMISBase {
86 { 86 {
87 $repositoryList[$count]['repositoryId'] = $repository->getRepositoryId(); 87 $repositoryList[$count]['repositoryId'] = $repository->getRepositoryId();
88 $repositoryList[$count]['repositoryName'] = $repository->getRepositoryName(); 88 $repositoryList[$count]['repositoryName'] = $repository->getRepositoryName();
89 - $repositoryList[$count]['repositoryURI'] = $repository->getRepositoryURI(); 89 + //$repositoryList[$count]['repositoryURI'] = $repository->getRepositoryURI();
90 ++$count; 90 ++$count;
91 } 91 }
92 92
lib/api/ktcmis/services/CMISNavigationService.inc.php
@@ -75,7 +75,7 @@ class CMISNavigationService { @@ -75,7 +75,7 @@ class CMISNavigationService {
75 */ 75 */
76 76
77 // NOTE This method does NOT support paging as defined in the paging section 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 // then the repository SHALL return the document versions filed in the specified folder or its descendant folders. 79 // then the repository SHALL return the document versions filed in the specified folder or its descendant folders.
80 // Otherwise, the latest version of the documents SHALL be returned. 80 // Otherwise, the latest version of the documents SHALL be returned.
81 // TODO FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid 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,12 +116,12 @@ class CMISNavigationService {
116 * @param int $skipCount 116 * @param int $skipCount
117 * @return array $descendants 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 // then the repository SHALL return the document versions filed in the specified folder or its descendant folders. 120 // then the repository SHALL return the document versions filed in the specified folder or its descendant folders.
121 // Otherwise, the latest version of the documents SHALL be returned. 121 // Otherwise, the latest version of the documents SHALL be returned.
122 // TODO FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid 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 // TODO paging 126 // TODO paging
127 // TODO optional parameters 127 // TODO optional parameters
@@ -130,9 +130,9 @@ class CMISNavigationService { @@ -130,9 +130,9 @@ class CMISNavigationService {
130 130
131 // if this is not a folder, cannot get children 131 // if this is not a folder, cannot get children
132 $folderId = CMISUtil::decodeObjectId($folderId, $type); 132 $folderId = CMISUtil::decodeObjectId($folderId, $type);
133 - // NOTE this will quite possibly break the webservices 133 +
134 if ($type != 'Folder') { 134 if ($type != 'Folder') {
135 - return $children; 135 + throw new invalidArgumentException('The specified object is not a folder');
136 } 136 }
137 137
138 $folder = $this->ktapi->get_folder_by_id($folderId); 138 $folder = $this->ktapi->get_folder_by_id($folderId);
@@ -158,7 +158,7 @@ class CMISNavigationService { @@ -158,7 +158,7 @@ class CMISNavigationService {
158 */ 158 */
159 // TODO FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid 159 // TODO FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid
160 // TODO If this service method is invoked on the root folder of the Repository, then the Repository SHALL return an empty result set. 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 function getFolderParent($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, $returnToRoot, $filter = '') 162 function getFolderParent($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, $returnToRoot, $filter = '')
163 { 163 {
164 // NOTE the root folder obviously has no parent, throw an ObjectNotFoundException here if this is the root folder 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,12 +263,11 @@ class CMISNavigationService {
263 * @param int $skipCount 263 * @param int $skipCount
264 * @return array $checkedout The collection of checked out document objects 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 // TODO exceptions: • FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid. 266 // TODO exceptions: • FilterNotValidException: The Repository SHALL throw this exception if this property filter input parameter is not valid.
268 // TODO filter by folder id 267 // TODO filter by folder id
269 // TODO $filter and paging 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 $checkedout = array(); 272 $checkedout = array();
274 273
lib/api/ktcmis/services/CMISRepositoryService.inc.php
@@ -104,9 +104,10 @@ class CMISRepositoryService { @@ -104,9 +104,10 @@ class CMISRepositoryService {
104 // NOTE this code may fit better within the Repository Class 104 // NOTE this code may fit better within the Repository Class
105 // TODO return for specific type when $typeId is specified 105 // TODO return for specific type when $typeId is specified
106 // TODO other optional parameters 106 // TODO other optional parameters
107 - function getTypes($repositoryId, $typeId = '', $returnPropertyDefinitions = false, 107 + private function getTypes($repositoryId, $typeId = '', $returnPropertyDefinitions = false,
108 $maxItems = 0, $skipCount = 0, &$hasMoreItems = false) 108 $maxItems = 0, $skipCount = 0, &$hasMoreItems = false)
109 - { 109 + {
  110 + /*
110 if ($typeId != '') 111 if ($typeId != '')
111 { 112 {
112 try { 113 try {
@@ -117,6 +118,7 @@ class CMISRepositoryService { @@ -117,6 +118,7 @@ class CMISRepositoryService {
117 throw new InvalidArgumentException('Type ' . $typeId . ' is not supported'); 118 throw new InvalidArgumentException('Type ' . $typeId . ' is not supported');
118 } 119 }
119 } 120 }
  121 + */
120 122
121 $repository = new CMISRepository($repositoryId); 123 $repository = new CMISRepository($repositoryId);
122 $supportedTypes = $repository->getTypes(); 124 $supportedTypes = $repository->getTypes();
@@ -171,7 +173,7 @@ class CMISRepositoryService { @@ -171,7 +173,7 @@ class CMISRepositoryService {
171 173
172 require_once(CMIS_DIR . '/objecttypes/' . $object . '.inc.php'); 174 require_once(CMIS_DIR . '/objecttypes/' . $object . '.inc.php');
173 $cmisObject = new $object; 175 $cmisObject = new $object;
174 - $typeDefinition['attributes'] = $cmisObject->getAttributes(); 176 + //$typeDefinition['attributes'] = $cmisObject->getAttributes();
175 $typeDefinition['properties'] = $cmisObject->getProperties(); 177 $typeDefinition['properties'] = $cmisObject->getProperties();
176 178
177 return $typeDefinition; 179 return $typeDefinition;
sql/mysql/install/rebuild.sh
1 #!/bin/sh 1 #!/bin/sh
  2 +set -e
2 3
3 DIR=`dirname $0` 4 DIR=`dirname $0`
4 cd $DIR 5 cd $DIR
@@ -17,4 +18,3 @@ mysqladmin -u root -p$pass create $db @@ -17,4 +18,3 @@ mysqladmin -u root -p$pass create $db
17 mysql -u root -p$pass $db < structure.sql 18 mysql -u root -p$pass $db < structure.sql
18 mysql -u root -p$pass $db < data.sql 19 mysql -u root -p$pass $db < data.sql
19 mysql -u root -p$pass $db < user.sql 20 mysql -u root -p$pass $db < user.sql
20 -  
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,7 +269,7 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service {
269 foreach($response as $failed) 269 foreach($response as $failed)
270 { 270 {
271 $entry = $feed->newEntry(); 271 $entry = $feed->newEntry();
272 - $objectElement = $feed->newElement('cmis:object'); 272 + $objectElement = $feed->newElement('cmisra:object');
273 $propertiesElement = $feed->newElement('cmis:properties'); 273 $propertiesElement = $feed->newElement('cmis:properties');
274 $propElement = $feed->newElement('cmis:propertyId'); 274 $propElement = $feed->newElement('cmis:propertyId');
275 $propElement->appendChild($feed->newAttr('cmis:name', 'ObjectId')); 275 $propElement->appendChild($feed->newAttr('cmis:name', 'ObjectId'));
@@ -740,4 +740,4 @@ class KT_cmis_atom_service_type extends KT_cmis_atom_service { @@ -740,4 +740,4 @@ class KT_cmis_atom_service_type extends KT_cmis_atom_service {
740 740
741 } 741 }
742 742
743 -?>  
744 \ No newline at end of file 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,13 +298,14 @@ class KT_cmis_atom_service_helper {
298 $entry->appendChild($response->newField('updated', self::formatDatestamp())); 298 $entry->appendChild($response->newField('updated', self::formatDatestamp()));
299 299
300 // main CMIS entry 300 // main CMIS entry
301 - $objectElement = $response->newElement('cmis:object'); 301 + $objectElement = $response->newElement('cmisra:object');
302 $propertiesElement = $response->newElement('cmis:properties'); 302 $propertiesElement = $response->newElement('cmis:properties');
303 303
304 foreach($cmisEntry['properties'] as $propertyName => $property) 304 foreach($cmisEntry['properties'] as $propertyName => $property)
305 { 305 {
306 $propElement = $response->newElement('cmis:' . $property['type']); 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 if (!empty($property['value'])) 309 if (!empty($property['value']))
309 { 310 {
310 if ($propertyName == 'ContentStreamUri') { 311 if ($propertyName == 'ContentStreamUri') {
@@ -484,12 +485,12 @@ class KT_cmis_atom_service_helper { @@ -484,12 +485,12 @@ class KT_cmis_atom_service_helper {
484 { 485 {
485 $properties = array(); 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 if(count($baseCmisObject) <= 0) 490 if(count($baseCmisObject) <= 0)
490 { 491 {
491 $entryObject = KT_cmis_atom_service_helper::findTag('entry', $xmlArray, null, false); 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 if(count($baseCmisObject)>0) 496 if(count($baseCmisObject)>0)
webservice/atompub/cmis/index.php
@@ -101,12 +101,12 @@ if ($workspace == &#39;servicedocument&#39;) @@ -101,12 +101,12 @@ if ($workspace == &#39;servicedocument&#39;)
101 */ 101 */
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 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 $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection', 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 $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection', 105 $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection',
106 array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'descendants'), 'rootdescendants'); 106 array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'descendants'), 'rootdescendants');
107 $APP->registerService('dms', 'checkedout', 'KT_cmis_atom_service_checkedout', 'Checked Out Document Collection', null, 107 $APP->registerService('dms', 'checkedout', 'KT_cmis_atom_service_checkedout', 'Checked Out Document Collection', null,
108 'checkedout', 'application/atom+xml;type=entry'); 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 $APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'typesdescendants'); 110 $APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'typesdescendants');
111 111
112 if ($workspace != 'servicedocument') 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,7 +19,8 @@ class KT_cmis_atom_responseFeed extends KT_atom_responseFeed {
19 19
20 // append additional tags 20 // append additional tags
21 $this->feed->appendChild($this->newAttr('xmlns:app', 'http://www.w3.org/2007/app')); 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 // require the workspace for creating links within responses 25 // require the workspace for creating links within responses
25 $queryArray = split('/', trim($_SERVER['QUERY_STRING'], '/')); 26 $queryArray = split('/', trim($_SERVER['QUERY_STRING'], '/'));
@@ -93,4 +94,4 @@ class KT_cmis_atom_ResponseFeed_PUT extends KT_cmis_atom_responseFeed{} @@ -93,4 +94,4 @@ class KT_cmis_atom_ResponseFeed_PUT extends KT_cmis_atom_responseFeed{}
93 class KT_cmis_atom_ResponseFeed_POST extends KT_cmis_atom_responseFeed{} 94 class KT_cmis_atom_ResponseFeed_POST extends KT_cmis_atom_responseFeed{}
94 class KT_cmis_atom_ResponseFeed_DELETE extends KT_cmis_atom_responseFeed{} 95 class KT_cmis_atom_ResponseFeed_DELETE extends KT_cmis_atom_responseFeed{}
95 96
96 -?>  
97 \ No newline at end of file 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,7 +83,7 @@ class KT_cmis_atom_server extends KT_atom_server {
83 $ws->appendChild($service->newAttr('cmis:repositoryRelationship', $this->repositoryInfo['repositoryRelationship'])); 83 $ws->appendChild($service->newAttr('cmis:repositoryRelationship', $this->repositoryInfo['repositoryRelationship']));
84 84
85 // repository information 85 // repository information
86 - $element = $service->newElement('cmis:repositoryInfo'); 86 + $element = $service->newElement('cmisra:repositoryInfo');
87 foreach($this->repositoryInfo as $key => $repoData) 87 foreach($this->repositoryInfo as $key => $repoData)
88 { 88 {
89 if ($key == 'rootFolderId') { 89 if ($key == 'rootFolderId') {
@@ -151,9 +151,12 @@ class KT_cmis_atom_server extends KT_atom_server { @@ -151,9 +151,12 @@ class KT_cmis_atom_server extends KT_atom_server {
151 { 151 {
152 ob_end_clean(); 152 ob_end_clean();
153 if (!$this->headersSet) header('Content-type: text/xml'); 153 if (!$this->headersSet) header('Content-type: text/xml');
  154 +
  155 + //include('/var/www/atompub_response.xml');
  156 +
154 if ($this->renderBody) echo $this->output; 157 if ($this->renderBody) echo $this->output;
155 } 158 }
156 159
157 } 160 }
158 161
159 -?>  
160 \ No newline at end of file 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,7 +71,8 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc {
71 $service = $this->newElement('service'); 71 $service = $this->newElement('service');
72 $service->appendChild($this->newAttr('xmlns', 'http://www.w3.org/2007/app')); 72 $service->appendChild($this->newAttr('xmlns', 'http://www.w3.org/2007/app'));
73 $service->appendChild($this->newAttr('xmlns:atom', 'http://www.w3.org/2005/Atom')); 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 $this->service =& $service; 76 $this->service =& $service;
76 $this->DOM->appendChild($this->service); 77 $this->DOM->appendChild($this->service);
77 } 78 }
@@ -80,7 +81,7 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { @@ -80,7 +81,7 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc {
80 { 81 {
81 $collection=$this->newElement('collection'); 82 $collection=$this->newElement('collection');
82 $collection->appendChild($this->newAttr('href', $url)); 83 $collection->appendChild($this->newAttr('href', $url));
83 - $collection->appendChild($this->newAttr('cmis:collectionType', $cmisCollectionType)); 84 + $collection->appendChild($this->newAttr('cmisra:collectionType', $cmisCollectionType));
84 $collection->appendChild($this->newElement('atom:title', $title)); 85 $collection->appendChild($this->newElement('atom:title', $title));
85 if (!is_null($accept)) { 86 if (!is_null($accept)) {
86 $collection->appendChild($this->newElement('accept', $accept)); 87 $collection->appendChild($this->newElement('accept', $accept));
@@ -123,4 +124,4 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { @@ -123,4 +124,4 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc {
123 */ 124 */
124 125
125 126
126 -?>  
127 \ No newline at end of file 127 \ No newline at end of file
  128 +?>