Commit 3eb55c2b592a0bf92792ab44433df774f4d0e725
1 parent
bcc3eb6e
Partial fix for CMISSpaces browsing - now getting right hand side content includ…
…ing display of documents but tree is broken on left hand side. Committing to allow me to go back to code which worked for the lest hand side and see what is different Committed by: Paul Barrett
Showing
11 changed files
with
475 additions
and
669 deletions
lib/api/ktcmis/classes/CMISPropertyCollection.inc.php
| @@ -47,14 +47,14 @@ abstract class CMISPropertyCollection { | @@ -47,14 +47,14 @@ abstract class CMISPropertyCollection { | ||
| 47 | 47 | ||
| 48 | static $ObjectId; | 48 | static $ObjectId; |
| 49 | static $BaseType; | 49 | static $BaseType; |
| 50 | - static $URI; | 50 | + static $Uri; |
| 51 | static $ObjectTypeId; | 51 | static $ObjectTypeId; |
| 52 | static $CreatedBy; | 52 | static $CreatedBy; |
| 53 | static $CreationDate; | 53 | static $CreationDate; |
| 54 | static $LastModifiedBy; | 54 | static $LastModifiedBy; |
| 55 | static $LastModificationDate; | 55 | static $LastModificationDate; |
| 56 | static $ChangeToken; | 56 | static $ChangeToken; |
| 57 | - // TODO these definitions probably belong elsewhere, but here will do for now | 57 | + // TODO these definitions belong in their own classe definition (see property type definions,) but here will do for now |
| 58 | static $propertyTypes; | 58 | static $propertyTypes; |
| 59 | 59 | ||
| 60 | function __construct() | 60 | function __construct() |
| @@ -69,6 +69,11 @@ abstract class CMISPropertyCollection { | @@ -69,6 +69,11 @@ abstract class CMISPropertyCollection { | ||
| 69 | 'Name' => 'propertyString', | 69 | 'Name' => 'propertyString', |
| 70 | 'ContentStreamLength' => 'propertyInteger', | 70 | 'ContentStreamLength' => 'propertyInteger', |
| 71 | 'ContentStreamMimeType' => 'propertyString', | 71 | 'ContentStreamMimeType' => 'propertyString', |
| 72 | + 'Uri' => 'propertyUri', | ||
| 73 | + 'AllowedChildObjectTypeIds' => 'propertyId', | ||
| 74 | + 'CreatedBy' => 'propertyString', | ||
| 75 | + 'CreationDate' => 'propertyDateTime', | ||
| 76 | + 'ChangeToken' => 'propertyString', | ||
| 72 | 'ParentId' => 'propertyId'); | 77 | 'ParentId' => 'propertyId'); |
| 73 | } | 78 | } |
| 74 | 79 |
lib/api/ktcmis/objecttypes/CMISDocumentObject.inc.php
| @@ -121,7 +121,7 @@ class CMISDocumentObject extends CMISBaseObject { | @@ -121,7 +121,7 @@ class CMISDocumentObject extends CMISBaseObject { | ||
| 121 | . $objectProperties['document_id']); | 121 | . $objectProperties['document_id']); |
| 122 | // NOTE what about instead creating a downloadable version with appropriate link? see ktapi::download_document | 122 | // NOTE what about instead creating a downloadable version with appropriate link? see ktapi::download_document |
| 123 | // also ktapidocument::get_download_url | 123 | // also ktapidocument::get_download_url |
| 124 | - $this->_setPropertyInternal('URI', $uri); | 124 | + $this->_setPropertyInternal('Uri', $uri); |
| 125 | // TODO what is this? Assuming it is the object type id, and not OUR document type? | 125 | // TODO what is this? Assuming it is the object type id, and not OUR document type? |
| 126 | $this->_setPropertyInternal('ObjectTypeId', $this->getAttribute('typeId')); | 126 | $this->_setPropertyInternal('ObjectTypeId', $this->getAttribute('typeId')); |
| 127 | // Needed to distinguish type | 127 | // Needed to distinguish type |
lib/api/ktcmis/objecttypes/CMISFolderObject.inc.php
| @@ -99,7 +99,7 @@ class CMISFolderObject extends CMISBaseObject { | @@ -99,7 +99,7 @@ class CMISFolderObject extends CMISBaseObject { | ||
| 99 | . '/browse.php?fFolderId=' | 99 | . '/browse.php?fFolderId=' |
| 100 | . $objectProperties['id']); | 100 | . $objectProperties['id']); |
| 101 | // TODO this url is probably incorrect...needs to be checked | 101 | // TODO this url is probably incorrect...needs to be checked |
| 102 | - $this->_setPropertyInternal('URI', $uri); | 102 | + $this->_setPropertyInternal('Uri', $uri); |
| 103 | // TODO what is this? Assuming it is the object type id, and not OUR document type? | 103 | // TODO what is this? Assuming it is the object type id, and not OUR document type? |
| 104 | $this->_setPropertyInternal('ObjectTypeId', $this->getAttribute('typeId')); | 104 | $this->_setPropertyInternal('ObjectTypeId', $this->getAttribute('typeId')); |
| 105 | // Needed to distinguish type | 105 | // Needed to distinguish type |
lib/api/ktcmis/util/CMISUtil.inc.php
| @@ -82,7 +82,8 @@ class CMISUtil { | @@ -82,7 +82,8 @@ class CMISUtil { | ||
| 82 | * The decoded object ID is returned by reference via the argument list | 82 | * The decoded object ID is returned by reference via the argument list |
| 83 | * | 83 | * |
| 84 | * @param string $objectId | 84 | * @param string $objectId |
| 85 | - * @return string $typeId | 85 | + * @param string &$typeId |
| 86 | + * @return string $objectId | ||
| 86 | */ | 87 | */ |
| 87 | static public function decodeObjectId($objectId, &$typeId = null) | 88 | static public function decodeObjectId($objectId, &$typeId = null) |
| 88 | { | 89 | { |
| @@ -94,6 +95,25 @@ class CMISUtil { | @@ -94,6 +95,25 @@ class CMISUtil { | ||
| 94 | 95 | ||
| 95 | $typeId = null; | 96 | $typeId = null; |
| 96 | 97 | ||
| 98 | + // NOTE Not sure whether this really belongs here, but probably this is the safest and most reliable place | ||
| 99 | + // If we find that the folderId is in fact the name of the repository root folder, we will not be able to | ||
| 100 | + // decode it, but we still need to return a valid id :). This is because the root folder name is returned | ||
| 101 | + // by the repository configuration rather than the actual CMIS folder id. | ||
| 102 | + // TODO consider just setting F1 as the root in the config? Originally didn't based on Alfresco, but... | ||
| 103 | + $RepositoryService = new CMISRepositoryService(); | ||
| 104 | + $repositories = $RepositoryService->getRepositories(); | ||
| 105 | + $repositoryInfo = $repositories[0]->getRepositoryInfo(); | ||
| 106 | + // the string replace is a hack for the drupal module, yay... | ||
| 107 | + if ($repositoryInfo->getRootFolderId() == urldecode(str_replace('%2520', '%20', $objectId))) { | ||
| 108 | + // NOTE that we may want to check the KnowledgeTree (not CMIS) repository for the root folder id. | ||
| 109 | + // This will be vital if we ever implement a way for people to have multiple roots depending | ||
| 110 | + // on who is logged in or what they select. Obviously the CMIS API in general will need a | ||
| 111 | + // method of doing this. | ||
| 112 | + // meantime this minor hack will get things working for the existing system structure, as the root | ||
| 113 | + // folder should always be id 1. | ||
| 114 | + return '1'; | ||
| 115 | + } | ||
| 116 | + | ||
| 97 | preg_match('/(\D)(\d*)/', $objectId, $matches); | 117 | preg_match('/(\D)(\d*)/', $objectId, $matches); |
| 98 | $type = $matches[1]; | 118 | $type = $matches[1]; |
| 99 | $objectId = $matches[2]; | 119 | $objectId = $matches[2]; |
| @@ -233,29 +253,59 @@ class CMISUtil { | @@ -233,29 +253,59 @@ class CMISUtil { | ||
| 233 | 253 | ||
| 234 | static public function createObjectPropertiesEntry($properties) | 254 | static public function createObjectPropertiesEntry($properties) |
| 235 | { | 255 | { |
| 256 | + // TODO better dynamic style fetching of object properties into array for output | ||
| 236 | $object = array(); | 257 | $object = array(); |
| 237 | 258 | ||
| 259 | + $object['Author'] = array('value' => $properties->getValue('Author')); | ||
| 260 | + | ||
| 238 | // TODO additional properties to be returned | 261 | // TODO additional properties to be returned |
| 239 | - $object['properties']['ObjectId'] = array('type' => $properties->getFieldType('ObjectId'), | ||
| 240 | - 'value' => $properties->getValue('ObjectId')); | ||
| 241 | $object['properties']['BaseType'] = array('type' => $properties->getFieldType('BaseType'), | 262 | $object['properties']['BaseType'] = array('type' => $properties->getFieldType('BaseType'), |
| 242 | 'value' => $properties->getValue('BaseType')); | 263 | 'value' => $properties->getValue('BaseType')); |
| 264 | + $object['properties']['ObjectId'] = array('type' => $properties->getFieldType('ObjectId'), | ||
| 265 | + 'value' => $properties->getValue('ObjectId')); | ||
| 243 | $object['properties']['ObjectTypeId'] = array('type' => $properties->getFieldType('ObjectTypeId'), | 266 | $object['properties']['ObjectTypeId'] = array('type' => $properties->getFieldType('ObjectTypeId'), |
| 244 | 'value' => $properties->getValue('ObjectTypeId')); | 267 | 'value' => $properties->getValue('ObjectTypeId')); |
| 245 | $object['properties']['Name'] = array('type' => $properties->getFieldType('Name'), | 268 | $object['properties']['Name'] = array('type' => $properties->getFieldType('Name'), |
| 246 | 'value' => $properties->getValue('Name')); | 269 | 'value' => $properties->getValue('Name')); |
| 247 | - $object['Author'] = array('value' => $properties->getValue('Author')); | 270 | + // TODO ensure format of date is always correct |
| 271 | + $object['properties']['LastModificationDate'] = array('type' => $properties->getFieldType('LastModificationDate'), | ||
| 272 | + 'value' => $properties->getValue('LastModificationDate')); | ||
| 273 | + $object['properties']['Uri'] = array('type' => $properties->getFieldType('Uri'), | ||
| 274 | + 'value' => $properties->getValue('Uri')); | ||
| 248 | 275 | ||
| 249 | $object['properties']['ParentId'] = array('type' => $properties->getFieldType('ParentId'), | 276 | $object['properties']['ParentId'] = array('type' => $properties->getFieldType('ParentId'), |
| 250 | 'value' => CMISUtil::encodeObjectId('Folder', | 277 | 'value' => CMISUtil::encodeObjectId('Folder', |
| 251 | $properties->getValue('ParentId'))); | 278 | $properties->getValue('ParentId'))); |
| 252 | - // TODO should check for content stream data before filling these in | 279 | + |
| 280 | + $object['properties']['AllowedChildObjectTypeIds'] = array('type' => $properties->getFieldType('AllowedChildObjectTypeIds'), | ||
| 281 | + 'value' => $properties->getValue('AllowedChildObjectTypeIds')); | ||
| 282 | + | ||
| 283 | +// $object['properties']['AllowedChildObjectTypeIds'] = array('type' => $properties->getFieldType('AllowedChildObjectTypeIds'), | ||
| 284 | +// 'value' => $properties->getValue('AllowedChildObjectTypeIds')); | ||
| 285 | + | ||
| 286 | + $object['properties']['CreatedBy'] = array('type' => $properties->getFieldType('CreatedBy'), | ||
| 287 | + 'value' => $properties->getValue('CreatedBy')); | ||
| 288 | + | ||
| 289 | + $object['properties']['CreationDate'] = array('type' => $properties->getFieldType('CreationDate'), | ||
| 290 | + 'value' => $properties->getValue('CreationDate')); | ||
| 291 | + | ||
| 292 | + $object['properties']['ChangeToken'] = array('type' => $properties->getFieldType('ChangeToken'), | ||
| 293 | + 'value' => $properties->getValue('ChangeToken')); | ||
| 294 | + | ||
| 253 | if (strtolower($properties->getValue('ObjectTypeId')) == 'document') | 295 | if (strtolower($properties->getValue('ObjectTypeId')) == 'document') |
| 254 | { | 296 | { |
| 255 | - $object['properties']['ContentStreamLength'] = array('type' => $properties->getFieldType('ContentStreamLength'), | ||
| 256 | - 'value' => $properties->getValue('ContentStreamLength')); | ||
| 257 | - $object['properties']['ContentStreamMimeType'] = array('type' => $properties->getFieldType('ContentStreamMimeType'), | ||
| 258 | - 'value' => $properties->getValue('ContentStreamMimeType')); | 297 | + |
| 298 | + $object['properties']['ChangeToken'] = array('type' => $properties->getFieldType('ChangeToken'), | ||
| 299 | + 'value' => $properties->getValue('ChangeToken')); | ||
| 300 | + $contentStreamLength = $properties->getValue('ContentStreamLength'); | ||
| 301 | + if (!empty($contentStreamLength)) | ||
| 302 | + { | ||
| 303 | + $contentStreamLength = $properties->getValue('ContentStreamLength'); | ||
| 304 | + $object['properties']['ContentStreamLength'] = array('type' => $properties->getFieldType('ContentStreamLength'), | ||
| 305 | + 'value' => $properties->getValue('ContentStreamLength')); | ||
| 306 | + $object['properties']['ContentStreamMimeType'] = array('type' => $properties->getFieldType('ContentStreamMimeType'), | ||
| 307 | + 'value' => $properties->getValue('ContentStreamMimeType')); | ||
| 308 | + } | ||
| 259 | } | 309 | } |
| 260 | 310 | ||
| 261 | // if we have found a child/parent with one or more children/parents, recurse into the child/parent object | 311 | // if we have found a child/parent with one or more children/parents, recurse into the child/parent object |
webservice/atompub/cmis/KT_cmis_atom_server.services.inc.php
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | +/** | ||
| 4 | + * Any feed must be a valid atom Feed document and conform to the guidelines below: | ||
| 5 | +1. Updated will be the latest time the folder or its contents was updated. If unknown by the underlying repository, it should be the current time. | ||
| 6 | +2. Author/name will be the CMIS property createdBy | ||
| 7 | +3. Title will be the CMIS property name | ||
| 8 | +4. App:edited will be the CMIS property lastModifiedDate | ||
| 9 | +5. Link with relation self will be generated to return the uri of the feed | ||
| 10 | + */ | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * At any point where an Atom document of type Entry is sent or returned, it must be a valid Atom Entry document and conform to the guidelines below: | ||
| 14 | +1. Atom:Title will be best efforts by the repository. The repository should chose a property closest to Title. | ||
| 15 | +2. App:edited will be CMIS:lastModifiedDate | ||
| 16 | +3. Link with relation self will be the URI that returns the Atom Entry document | ||
| 17 | +4. Published will be CMIS:createdDate | ||
| 18 | +5. Atom:author will be CMIS:creator | ||
| 19 | +6. For content tags | ||
| 20 | +7. Documents with content | ||
| 21 | +a. Leverage the src attribute to point to the same link as stream | ||
| 22 | +b. The repository SHOULD populate the summary tag with text that at best efforts represents the documents. For example, an HTML table containing the properties and their values for simple feed readers | ||
| 23 | +i. Other (Content-less document, Folder, Relationship, Type, etc) – best efforts at generating HTML text that represents the object. That text would normally go into the summary tag, but since there is no content, goes in the content tag. | ||
| 24 | +8. If content src is specified, the summary SHOULD contain a text or html representation of the object. | ||
| 25 | +9. Links will be used to provide URIs to CMIS functionality | ||
| 26 | +10. Link relations may be omitted if the function is not allowed and that function would not show up on getAllowableActions. | ||
| 27 | +11. Links may be omitted if the repository does not support that capability | ||
| 28 | +12. All CMIS properties will be exposed in CMIS properties tag even if they are duplicated in an atom element | ||
| 29 | + | ||
| 30 | +When POSTing an Atom Document, the atom fields take precedence over the CMIS property field for writeable properties. For example, atom:title will overwrite cmis:name | ||
| 31 | + */ | ||
| 32 | + | ||
| 3 | include_once CMIS_ATOM_LIB_FOLDER . 'RepositoryService.inc.php'; | 33 | include_once CMIS_ATOM_LIB_FOLDER . 'RepositoryService.inc.php'; |
| 4 | include_once CMIS_ATOM_LIB_FOLDER . 'NavigationService.inc.php'; | 34 | include_once CMIS_ATOM_LIB_FOLDER . 'NavigationService.inc.php'; |
| 5 | include_once CMIS_ATOM_LIB_FOLDER . 'ObjectService.inc.php'; | 35 | include_once CMIS_ATOM_LIB_FOLDER . 'ObjectService.inc.php'; |
| @@ -142,7 +172,7 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | @@ -142,7 +172,7 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | ||
| 142 | // perhaps because the content is text/plain once base64 encoded? | 172 | // perhaps because the content is text/plain once base64 encoded? |
| 143 | // How to determine the actual content type? | 173 | // How to determine the actual content type? |
| 144 | /* | 174 | /* |
| 145 | - * <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/2008/05"> | 175 | + * <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200901"> |
| 146 | * <atom:title>setup.txt</atom:title> | 176 | * <atom:title>setup.txt</atom:title> |
| 147 | * <atom:summary>setup.txt</atom:summary> | 177 | * <atom:summary>setup.txt</atom:summary> |
| 148 | * <atom:content type="text/plain">dGhpcyBiZSBzb21lIHRlc3QgY29udGVudCBmb3IgYSBkb2N1bWVudCwgeWVzPw==</atom:content> | 178 | * <atom:content type="text/plain">dGhpcyBiZSBzb21lIHRlc3QgY29udGVudCBmb3IgYSBkb2N1bWVudCwgeWVzPw==</atom:content> |
| @@ -239,7 +269,20 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | @@ -239,7 +269,20 @@ class KT_cmis_atom_service_folder extends KT_cmis_atom_service { | ||
| 239 | 269 | ||
| 240 | // $baseURI=NULL,$title=NULL,$link=NULL,$updated=NULL,$author=NULL,$id=NULL | 270 | // $baseURI=NULL,$title=NULL,$link=NULL,$updated=NULL,$author=NULL,$id=NULL |
| 241 | $feed = new KT_cmis_atom_responseFeed(CMIS_APP_BASE_URI, $folderName . ' ' . ucwords($feedType), null, null, null, | 271 | $feed = new KT_cmis_atom_responseFeed(CMIS_APP_BASE_URI, $folderName . ' ' . ucwords($feedType), null, null, null, |
| 242 | - 'urn:uuid:' . $folderName . '-' . $feedType); | 272 | + 'urn:uuid:' . $folderId . '-' . $feedType); |
| 273 | + | ||
| 274 | + // TODO dynamic? | ||
| 275 | + $feedElement = $feed->newField('author'); | ||
| 276 | + $element = $feed->newField('name', 'System', $feedElement); | ||
| 277 | + $feed->appendChild($feedElement); | ||
| 278 | + | ||
| 279 | + // TODO get actual most recent update time, only use current if no other available | ||
| 280 | + $feed->appendChild($feed->newElement('updated', KT_cmis_atom_service_helper::formatDatestamp())); | ||
| 281 | + | ||
| 282 | + $link = $feed->newElement('link'); | ||
| 283 | + $link->appendChild($feed->newAttr('rel','source')); | ||
| 284 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/folder/' . $folderId)); | ||
| 285 | + $feed->appendChild($link); | ||
| 243 | 286 | ||
| 244 | foreach($entries as $cmisEntry) | 287 | foreach($entries as $cmisEntry) |
| 245 | { | 288 | { |
| @@ -405,7 +448,7 @@ class KT_cmis_atom_service_type extends KT_cmis_atom_service { | @@ -405,7 +448,7 @@ class KT_cmis_atom_service_type extends KT_cmis_atom_service { | ||
| 405 | /* | 448 | /* |
| 406 | // TODO need to create this dynamically now, will no longer work with static output | 449 | // TODO need to create this dynamically now, will no longer work with static output |
| 407 | $output = '<?xml version="1.0" encoding="UTF-8"?> | 450 | $output = '<?xml version="1.0" encoding="UTF-8"?> |
| 408 | - <feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmis="http://www.cmis.org/2008/05"> | 451 | + <feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200901"> |
| 409 | <id>urn:uuid:type-' . $type . '-children</id> | 452 | <id>urn:uuid:type-' . $type . '-children</id> |
| 410 | <link rel="self" href="' . CMIS_APP_BASE_URI . 'type/document/children"/> | 453 | <link rel="self" href="' . CMIS_APP_BASE_URI . 'type/document/children"/> |
| 411 | <link rel="first" href="' . CMIS_APP_BASE_URI . 'type/document/children?pageNo=1&pageSize=0&guest=" type="application/atom+xml;type=feed"/> | 454 | <link rel="first" href="' . CMIS_APP_BASE_URI . 'type/document/children?pageNo=1&pageSize=0&guest=" type="application/atom+xml;type=feed"/> |
| @@ -526,462 +569,4 @@ class KT_cmis_atom_service_document extends KT_cmis_atom_service { | @@ -526,462 +569,4 @@ class KT_cmis_atom_service_document extends KT_cmis_atom_service { | ||
| 526 | 569 | ||
| 527 | } | 570 | } |
| 528 | 571 | ||
| 529 | -$childrenFeed[] = '<?xml version="1.0" encoding="utf-8"?> | ||
| 530 | - <feed xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/2008/05"> | ||
| 531 | - <id>urn:uuid:28537649-8af2-4c74-aa92-5d8bbecac9ce-children</id> | ||
| 532 | - <link rel="self" href="http://10.33.4.34/ktatompub/?/cmis/folder/F1/children"/> | ||
| 533 | - <title>Root Folder Children</title> | ||
| 534 | - <entry> | ||
| 535 | - <id>urn:uuid:86224486-b7ae-4074-a793-82cd259b0026-folder</id> | ||
| 536 | - <link rel="cmis-children" href="http://10.33.4.34/ktatompub/?cmis/folder/F2/children"/> | ||
| 537 | - | ||
| 538 | - <link rel="cmis-descendants" href="http://10.33.4.34/ktatompub/?cmis/folder/F2/descendants"/> | ||
| 539 | - <link rel="cmis-type" href="http://10.33.4.34:8080/alfresco/service/api/type/folder"/> | ||
| 540 | - <link rel="cmis-repository" href="http://10.33.4.34:8080/alfresco/service/api/repository"/> | ||
| 541 | - <summary>DroppedDocuments</summary> | ||
| 542 | - <title>DroppedDocuments</title> | ||
| 543 | - <cmis:object> | ||
| 544 | - <cmis:properties> | ||
| 545 | - <cmis:propertyId cmis:name="ObjectId"> | ||
| 546 | - | ||
| 547 | - <cmis:value>F2</cmis:value> | ||
| 548 | - </cmis:propertyId> | ||
| 549 | - <cmis:propertyString cmis:name="ObjectTypeId"> | ||
| 550 | - <cmis:value>Folder</cmis:value> | ||
| 551 | - </cmis:propertyString> | ||
| 552 | - <cmis:propertyString cmis:name="Name"> | ||
| 553 | - <cmis:value>DroppedDocuments</cmis:value> | ||
| 554 | - | ||
| 555 | - </cmis:propertyString> | ||
| 556 | - </cmis:properties> | ||
| 557 | - </cmis:object> | ||
| 558 | - </entry> | ||
| 559 | - <entry> | ||
| 560 | - <id>urn:uuid:86224486-b7ae-4074-a793-82cd259b0026-folder</id> | ||
| 561 | - <link rel="cmis-children" href="http://10.33.4.34/ktatompub/?cmis/folder/F4/children"/> | ||
| 562 | - <link rel="cmis-descendants" href="http://10.33.4.34/ktatompub/?cmis/folder/F4/descendants"/> | ||
| 563 | - | ||
| 564 | - <link rel="cmis-type" href="http://10.33.4.34:8080/alfresco/service/api/type/folder"/> | ||
| 565 | - <link rel="cmis-repository" href="http://10.33.4.34:8080/alfresco/service/api/repository"/> | ||
| 566 | - <summary>Test KT Folder</summary> | ||
| 567 | - <title>Test KT Folder</title> | ||
| 568 | - <cmis:object> | ||
| 569 | - <cmis:properties> | ||
| 570 | - <cmis:propertyId cmis:name="ObjectId"> | ||
| 571 | - <cmis:value>F4</cmis:value> | ||
| 572 | - | ||
| 573 | - </cmis:propertyId> | ||
| 574 | - <cmis:propertyString cmis:name="ObjectTypeId"> | ||
| 575 | - <cmis:value>Folder</cmis:value> | ||
| 576 | - </cmis:propertyString> | ||
| 577 | - <cmis:propertyString cmis:name="Name"> | ||
| 578 | - <cmis:value>Test KT Folder</cmis:value> | ||
| 579 | - </cmis:propertyString> | ||
| 580 | - </cmis:properties> | ||
| 581 | - | ||
| 582 | - </cmis:object> | ||
| 583 | - </entry> | ||
| 584 | - <entry> | ||
| 585 | - <author><name>admin</name></author> | ||
| 586 | - <content type="application/pdf" src="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><id>urn:uuid:2df9d676-f173-47bb-8ec1-41fa1186b66d</id> | ||
| 587 | - <link rel="self" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d"/> | ||
| 588 | - | ||
| 589 | - <link rel="enclosure" type="application/pdf" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><link rel="edit" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d"/> | ||
| 590 | - <link rel="edit-media" type="application/pdf" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><link rel="cmis-allowableactions" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/permissions"/> | ||
| 591 | - <link rel="cmis-relationships" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/associations"/> | ||
| 592 | - <link rel="cmis-parents" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/parents"/> | ||
| 593 | - <link rel="cmis-allversions" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/versions"/> | ||
| 594 | - <link rel="cmis-stream" type="application/pdf" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><link rel="cmis-type" href="http://10.33.4.34:8080/alfresco/service/api/type/document"/> | ||
| 595 | - <link rel="cmis-repository" href="http://10.33.4.34:8080/alfresco/service/api/repository"/> | ||
| 596 | - <published>2009-06-23T09:40:47.889+02:00</published> | ||
| 597 | - <summary></summary> | ||
| 598 | - <title>h4555-cmis-so.pdf</title> | ||
| 599 | - <updated>2009-06-23T09:40:58.524+02:00</updated> | ||
| 600 | - | ||
| 601 | - <cmis:object> | ||
| 602 | - <cmis:properties> | ||
| 603 | - <cmis:propertyId cmis:name="ObjectId"><cmis:value>workspace://SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d</cmis:value></cmis:propertyId> | ||
| 604 | - <cmis:propertyString cmis:name="BaseType"><cmis:value>document</cmis:value></cmis:propertyString> | ||
| 605 | - <cmis:propertyString cmis:name="ObjectTypeId"><cmis:value>document</cmis:value></cmis:propertyString> | ||
| 606 | - <cmis:propertyString cmis:name="CreatedBy"><cmis:value>admin</cmis:value></cmis:propertyString> | ||
| 607 | - | ||
| 608 | - <cmis:propertyDateTime cmis:name="CreationDate"><cmis:value>2009-06-23T09:40:47.889+02:00</cmis:value></cmis:propertyDateTime> | ||
| 609 | - <cmis:propertyString cmis:name="LastModifiedBy"><cmis:value>admin</cmis:value></cmis:propertyString> | ||
| 610 | - <cmis:propertyDateTime cmis:name="LastModificationDate"><cmis:value>2009-06-23T09:40:58.524+02:00</cmis:value></cmis:propertyDateTime> | ||
| 611 | - <cmis:propertyString cmis:name="Name"><cmis:value>h4555-cmis-so.pdf</cmis:value></cmis:propertyString> | ||
| 612 | - <cmis:propertyBoolean cmis:name="IsImmutable"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 613 | - | ||
| 614 | - <cmis:propertyBoolean cmis:name="IsLatestVersion"><cmis:value>true</cmis:value></cmis:propertyBoolean> | ||
| 615 | - <cmis:propertyBoolean cmis:name="IsMajorVersion"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 616 | - <cmis:propertyBoolean cmis:name="IsLatestMajorVersion"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 617 | - <cmis:propertyString cmis:name="VersionLabel"/> | ||
| 618 | - <cmis:propertyId cmis:name="VersionSeriesId"><cmis:value>workspace://SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d</cmis:value></cmis:propertyId> | ||
| 619 | - | ||
| 620 | - <cmis:propertyBoolean cmis:name="IsVersionSeriesCheckedOut"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 621 | - <cmis:propertyString cmis:name="VersionSeriesCheckedOutBy"/> | ||
| 622 | - <cmis:propertyId cmis:name="VersionSeriesCheckedOutId"/> | ||
| 623 | - <cmis:propertyString cmis:name="CheckinComment"/> | ||
| 624 | - <cmis:propertyInteger cmis:name="ContentStreamLength"><cmis:value>343084</cmis:value></cmis:propertyInteger> | ||
| 625 | - <cmis:propertyString cmis:name="ContentStreamMimeType"><cmis:value>application/pdf</cmis:value></cmis:propertyString> | ||
| 626 | - <cmis:propertyString cmis:name="ContentStreamFilename"><cmis:value>h4555-cmis-so.pdf</cmis:value></cmis:propertyString> | ||
| 627 | - | ||
| 628 | - <cmis:propertyString cmis:name="ContentStreamURI"><cmis:value>http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf</cmis:value></cmis:propertyString> | ||
| 629 | - </cmis:properties> | ||
| 630 | - </cmis:object> | ||
| 631 | - | ||
| 632 | - | ||
| 633 | - </entry> | ||
| 634 | - </feed>'; | ||
| 635 | - | ||
| 636 | -$childrenFeed[] = '<?xml version="1.0" encoding="UTF-8"?> | ||
| 637 | -<feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmis="http://www.cmis.org/2008/05" xmlns:alf="http://www.alfresco.org" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"> | ||
| 638 | -<author><name>System</name></author> | ||
| 639 | -<generator version="3.0.0 (Stable 1526)">Alfresco (Labs)</generator> | ||
| 640 | -<icon>http://10.33.4.34:8080/alfresco/images/logo/AlfrescoLogo16.ico</icon> | ||
| 641 | -<id>urn:uuid:28537649-8af2-4c74-aa92-5d8bbecac9ce-children</id> | ||
| 642 | -<link rel="self" href="http://10.33.4.34:8080/alfresco/service/api/path/workspace/SpacesStore/Company%20Home/children"/> | ||
| 643 | -<link rel="cmis-source" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce"/> | ||
| 644 | -<link rel="first" href="http://10.33.4.34:8080/alfresco/service/api/path/workspace/SpacesStore/Company%20Home/children?pageNo=1&pageSize=0&guest=&format=atomfeed" type="application/atom+xml;type=feed"/> | ||
| 645 | - | ||
| 646 | -<link rel="last" href="http://10.33.4.34:8080/alfresco/service/api/path/workspace/SpacesStore/Company%20Home/children?pageNo=1&pageSize=0&guest=&format=atomfeed" type="application/atom+xml;type=feed"/> | ||
| 647 | -<title>Company Home Children</title> | ||
| 648 | -<updated>2009-06-18T10:20:29.937+02:00</updated> | ||
| 649 | -<entry> | ||
| 650 | -<author><name>System</name></author> | ||
| 651 | -<content>e98319fa-76e4-478f-8ce8-a3a0fd683e2c</content> | ||
| 652 | -<id>urn:uuid:e98319fa-76e4-478f-8ce8-a3a0fd683e2c</id> | ||
| 653 | - | ||
| 654 | -<link rel="self" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c"/> | ||
| 655 | -<link rel="edit" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c"/> | ||
| 656 | -<link rel="cmis-allowableactions" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c/permissions"/> | ||
| 657 | -<link rel="cmis-relationships" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c/associations"/> | ||
| 658 | -<link rel="cmis-parent" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce"/> | ||
| 659 | -<link rel="cmis-folderparent" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c/parent"/> | ||
| 660 | -<link rel="cmis-children" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c/children"/> | ||
| 661 | -<link rel="cmis-descendants" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c/descendants"/> | ||
| 662 | -<link rel="cmis-type" href="http://10.33.4.34:8080/alfresco/service/api/type/F/st_sites"/> | ||
| 663 | -<link rel="cmis-repository" href="http://10.33.4.34:8080/alfresco/service/api/repository"/> | ||
| 664 | -<published>2009-06-18T10:20:37.788+02:00</published> | ||
| 665 | -<summary>Site Collaboration Spaces</summary> | ||
| 666 | -<title>Sites</title> | ||
| 667 | -<updated>2009-06-18T10:20:37.874+02:00</updated> | ||
| 668 | - | ||
| 669 | -<cmis:object> | ||
| 670 | -<cmis:properties> | ||
| 671 | -<cmis:propertyId cmis:name="ObjectId"><cmis:value>workspace://SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c</cmis:value></cmis:propertyId> | ||
| 672 | -<cmis:propertyString cmis:name="BaseType"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 673 | -<cmis:propertyString cmis:name="ObjectTypeId"><cmis:value>F/st_sites</cmis:value></cmis:propertyString> | ||
| 674 | -<cmis:propertyString cmis:name="CreatedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 675 | - | ||
| 676 | -<cmis:propertyDateTime cmis:name="CreationDate"><cmis:value>2009-06-18T10:20:37.788+02:00</cmis:value></cmis:propertyDateTime> | ||
| 677 | -<cmis:propertyString cmis:name="LastModifiedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 678 | -<cmis:propertyDateTime cmis:name="LastModificationDate"><cmis:value>2009-06-18T10:20:37.874+02:00</cmis:value></cmis:propertyDateTime> | ||
| 679 | -<cmis:propertyString cmis:name="Name"><cmis:value>Sites</cmis:value></cmis:propertyString> | ||
| 680 | -<cmis:propertyId cmis:name="ParentId"><cmis:value>workspace://SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce</cmis:value></cmis:propertyId> | ||
| 681 | - | ||
| 682 | -</cmis:properties> | ||
| 683 | -</cmis:object> | ||
| 684 | -<cmis:terminator/> | ||
| 685 | -<app:edited>2009-06-18T10:20:37.874+02:00</app:edited> | ||
| 686 | -<alf:icon>http://10.33.4.34:8080/alfresco/images/icons/space-icon-default-16.gif</alf:icon> | ||
| 687 | -</entry> | ||
| 688 | -<entry> | ||
| 689 | -<author><name>System</name></author> | ||
| 690 | -<content>8c80a0f7-74b4-4bd8-bb76-a2464e4b2d10</content> | ||
| 691 | -<id>urn:uuid:8c80a0f7-74b4-4bd8-bb76-a2464e4b2d10</id> | ||
| 692 | - | ||
| 693 | -<link rel="self" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/8c80a0f7-74b4-4bd8-bb76-a2464e4b2d10"/> | ||
| 694 | -<link rel="edit" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/8c80a0f7-74b4-4bd8-bb76-a2464e4b2d10"/> | ||
| 695 | -<link rel="cmis-allowableactions" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/8c80a0f7-74b4-4bd8-bb76-a2464e4b2d10/permissions"/> | ||
| 696 | -<link rel="cmis-relationships" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/8c80a0f7-74b4-4bd8-bb76-a2464e4b2d10/associations"/> | ||
| 697 | -<link rel="cmis-parent" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce"/> | ||
| 698 | -<link rel="cmis-folderparent" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/8c80a0f7-74b4-4bd8-bb76-a2464e4b2d10/parent"/> | ||
| 699 | -<link rel="cmis-children" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/8c80a0f7-74b4-4bd8-bb76-a2464e4b2d10/children"/> | ||
| 700 | -<link rel="cmis-descendants" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/8c80a0f7-74b4-4bd8-bb76-a2464e4b2d10/descendants"/> | ||
| 701 | -<link rel="cmis-type" href="http://10.33.4.34:8080/alfresco/service/api/type/folder"/> | ||
| 702 | -<link rel="cmis-repository" href="http://10.33.4.34:8080/alfresco/service/api/repository"/> | ||
| 703 | -<published>2009-06-18T10:20:29.939+02:00</published> | ||
| 704 | -<summary>User managed definitions</summary> | ||
| 705 | -<title>Data Dictionary</title> | ||
| 706 | -<updated>2009-06-18T10:20:30.004+02:00</updated> | ||
| 707 | - | ||
| 708 | -<cmis:object> | ||
| 709 | -<cmis:properties> | ||
| 710 | -<cmis:propertyId cmis:name="ObjectId"><cmis:value>workspace://SpacesStore/8c80a0f7-74b4-4bd8-bb76-a2464e4b2d10</cmis:value></cmis:propertyId> | ||
| 711 | -<cmis:propertyString cmis:name="BaseType"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 712 | -<cmis:propertyString cmis:name="ObjectTypeId"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 713 | -<cmis:propertyString cmis:name="CreatedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 714 | - | ||
| 715 | -<cmis:propertyDateTime cmis:name="CreationDate"><cmis:value>2009-06-18T10:20:29.939+02:00</cmis:value></cmis:propertyDateTime> | ||
| 716 | -<cmis:propertyString cmis:name="LastModifiedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 717 | -<cmis:propertyDateTime cmis:name="LastModificationDate"><cmis:value>2009-06-18T10:20:30.004+02:00</cmis:value></cmis:propertyDateTime> | ||
| 718 | -<cmis:propertyString cmis:name="Name"><cmis:value>Data Dictionary</cmis:value></cmis:propertyString> | ||
| 719 | -<cmis:propertyId cmis:name="ParentId"><cmis:value>workspace://SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce</cmis:value></cmis:propertyId> | ||
| 720 | - | ||
| 721 | -</cmis:properties> | ||
| 722 | -</cmis:object> | ||
| 723 | -<cmis:terminator/> | ||
| 724 | -<app:edited>2009-06-18T10:20:30.004+02:00</app:edited> | ||
| 725 | -<alf:icon>http://10.33.4.34:8080/alfresco/images/icons/space-icon-default-16.gif</alf:icon> | ||
| 726 | -</entry> | ||
| 727 | -<entry> | ||
| 728 | -<author><name>System</name></author> | ||
| 729 | -<content>ba2524ef-7f3d-4ed4-84a0-8d99b6524737</content> | ||
| 730 | -<id>urn:uuid:ba2524ef-7f3d-4ed4-84a0-8d99b6524737</id> | ||
| 731 | - | ||
| 732 | -<link rel="self" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/ba2524ef-7f3d-4ed4-84a0-8d99b6524737"/> | ||
| 733 | -<link rel="edit" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/ba2524ef-7f3d-4ed4-84a0-8d99b6524737"/> | ||
| 734 | -<link rel="cmis-allowableactions" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/ba2524ef-7f3d-4ed4-84a0-8d99b6524737/permissions"/> | ||
| 735 | -<link rel="cmis-relationships" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/ba2524ef-7f3d-4ed4-84a0-8d99b6524737/associations"/> | ||
| 736 | -<link rel="cmis-parent" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce"/> | ||
| 737 | -<link rel="cmis-folderparent" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/ba2524ef-7f3d-4ed4-84a0-8d99b6524737/parent"/> | ||
| 738 | -<link rel="cmis-children" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/ba2524ef-7f3d-4ed4-84a0-8d99b6524737/children"/> | ||
| 739 | -<link rel="cmis-descendants" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/ba2524ef-7f3d-4ed4-84a0-8d99b6524737/descendants"/> | ||
| 740 | -<link rel="cmis-type" href="http://10.33.4.34:8080/alfresco/service/api/type/folder"/> | ||
| 741 | -<link rel="cmis-repository" href="http://10.33.4.34:8080/alfresco/service/api/repository"/> | ||
| 742 | -<published>2009-06-18T10:20:30.312+02:00</published> | ||
| 743 | -<summary>The guest root space</summary> | ||
| 744 | -<title>Guest Home</title> | ||
| 745 | - | ||
| 746 | -<updated>2009-06-18T10:20:30.400+02:00</updated> | ||
| 747 | -<cmis:object> | ||
| 748 | -<cmis:properties> | ||
| 749 | -<cmis:propertyId cmis:name="ObjectId"><cmis:value>workspace://SpacesStore/ba2524ef-7f3d-4ed4-84a0-8d99b6524737</cmis:value></cmis:propertyId> | ||
| 750 | -<cmis:propertyString cmis:name="BaseType"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 751 | -<cmis:propertyString cmis:name="ObjectTypeId"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 752 | -<cmis:propertyString cmis:name="CreatedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 753 | - | ||
| 754 | -<cmis:propertyDateTime cmis:name="CreationDate"><cmis:value>2009-06-18T10:20:30.312+02:00</cmis:value></cmis:propertyDateTime> | ||
| 755 | -<cmis:propertyString cmis:name="LastModifiedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 756 | -<cmis:propertyDateTime cmis:name="LastModificationDate"><cmis:value>2009-06-18T10:20:30.400+02:00</cmis:value></cmis:propertyDateTime> | ||
| 757 | -<cmis:propertyString cmis:name="Name"><cmis:value>Guest Home</cmis:value></cmis:propertyString> | ||
| 758 | -<cmis:propertyId cmis:name="ParentId"><cmis:value>workspace://SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce</cmis:value></cmis:propertyId> | ||
| 759 | - | ||
| 760 | -</cmis:properties> | ||
| 761 | -</cmis:object> | ||
| 762 | -<cmis:terminator/> | ||
| 763 | -<app:edited>2009-06-18T10:20:30.400+02:00</app:edited> | ||
| 764 | -<alf:icon>http://10.33.4.34:8080/alfresco/images/icons/space-icon-default-16.gif</alf:icon> | ||
| 765 | -</entry> | ||
| 766 | -<entry> | ||
| 767 | -<author><name>System</name></author> | ||
| 768 | -<content>86224486-b7ae-4074-a793-82cd259b0026</content> | ||
| 769 | -<id>urn:uuid:86224486-b7ae-4074-a793-82cd259b0026</id> | ||
| 770 | - | ||
| 771 | -<link rel="self" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/86224486-b7ae-4074-a793-82cd259b0026"/> | ||
| 772 | -<link rel="edit" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/86224486-b7ae-4074-a793-82cd259b0026"/> | ||
| 773 | -<link rel="cmis-allowableactions" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/86224486-b7ae-4074-a793-82cd259b0026/permissions"/> | ||
| 774 | -<link rel="cmis-relationships" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/86224486-b7ae-4074-a793-82cd259b0026/associations"/> | ||
| 775 | -<link rel="cmis-parent" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce"/> | ||
| 776 | -<link rel="cmis-folderparent" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/86224486-b7ae-4074-a793-82cd259b0026/parent"/> | ||
| 777 | -<link rel="cmis-children" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/86224486-b7ae-4074-a793-82cd259b0026/children"/> | ||
| 778 | -<link rel="cmis-descendants" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/86224486-b7ae-4074-a793-82cd259b0026/descendants"/> | ||
| 779 | -<link rel="cmis-type" href="http://10.33.4.34:8080/alfresco/service/api/type/folder"/> | ||
| 780 | -<link rel="cmis-repository" href="http://10.33.4.34:8080/alfresco/service/api/repository"/> | ||
| 781 | -<published>2009-06-18T10:20:30.402+02:00</published> | ||
| 782 | -<summary>User Homes</summary> | ||
| 783 | -<title>User Homes</title> | ||
| 784 | -<updated>2009-06-18T10:20:30.428+02:00</updated> | ||
| 785 | - | ||
| 786 | -<cmis:object> | ||
| 787 | -<cmis:properties> | ||
| 788 | -<cmis:propertyId cmis:name="ObjectId"><cmis:value>workspace://SpacesStore/86224486-b7ae-4074-a793-82cd259b0026</cmis:value></cmis:propertyId> | ||
| 789 | -<cmis:propertyString cmis:name="BaseType"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 790 | -<cmis:propertyString cmis:name="ObjectTypeId"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 791 | -<cmis:propertyString cmis:name="CreatedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 792 | - | ||
| 793 | -<cmis:propertyDateTime cmis:name="CreationDate"><cmis:value>2009-06-18T10:20:30.402+02:00</cmis:value></cmis:propertyDateTime> | ||
| 794 | -<cmis:propertyString cmis:name="LastModifiedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 795 | -<cmis:propertyDateTime cmis:name="LastModificationDate"><cmis:value>2009-06-18T10:20:30.428+02:00</cmis:value></cmis:propertyDateTime> | ||
| 796 | -<cmis:propertyString cmis:name="Name"><cmis:value>User Homes</cmis:value></cmis:propertyString> | ||
| 797 | -<cmis:propertyId cmis:name="ParentId"><cmis:value>workspace://SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce</cmis:value></cmis:propertyId> | ||
| 798 | - | ||
| 799 | -</cmis:properties> | ||
| 800 | -</cmis:object> | ||
| 801 | -<cmis:terminator/> | ||
| 802 | -<app:edited>2009-06-18T10:20:30.428+02:00</app:edited> | ||
| 803 | -<alf:icon>http://10.33.4.34:8080/alfresco/images/icons/space-icon-default-16.gif</alf:icon> | ||
| 804 | -</entry> | ||
| 805 | -<entry> | ||
| 806 | -<author><name>System</name></author> | ||
| 807 | -<content>0df9087f-e334-4890-a467-b60e3d6be92c</content> | ||
| 808 | -<id>urn:uuid:0df9087f-e334-4890-a467-b60e3d6be92c</id> | ||
| 809 | - | ||
| 810 | -<link rel="self" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/0df9087f-e334-4890-a467-b60e3d6be92c"/> | ||
| 811 | -<link rel="edit" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/0df9087f-e334-4890-a467-b60e3d6be92c"/> | ||
| 812 | -<link rel="cmis-allowableactions" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/0df9087f-e334-4890-a467-b60e3d6be92c/permissions"/> | ||
| 813 | -<link rel="cmis-relationships" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/0df9087f-e334-4890-a467-b60e3d6be92c/associations"/> | ||
| 814 | -<link rel="cmis-parent" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce"/> | ||
| 815 | -<link rel="cmis-folderparent" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/0df9087f-e334-4890-a467-b60e3d6be92c/parent"/> | ||
| 816 | -<link rel="cmis-children" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/0df9087f-e334-4890-a467-b60e3d6be92c/children"/> | ||
| 817 | -<link rel="cmis-descendants" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/0df9087f-e334-4890-a467-b60e3d6be92c/descendants"/> | ||
| 818 | -<link rel="cmis-type" href="http://10.33.4.34:8080/alfresco/service/api/type/folder"/> | ||
| 819 | -<link rel="cmis-repository" href="http://10.33.4.34:8080/alfresco/service/api/repository"/> | ||
| 820 | -<published>2009-06-18T10:20:45.115+02:00</published> | ||
| 821 | -<summary>Web Content Management Spaces</summary> | ||
| 822 | -<title>Web Projects</title> | ||
| 823 | -<updated>2009-06-18T10:20:45.137+02:00</updated> | ||
| 824 | - | ||
| 825 | -<cmis:object> | ||
| 826 | -<cmis:properties> | ||
| 827 | -<cmis:propertyId cmis:name="ObjectId"><cmis:value>workspace://SpacesStore/0df9087f-e334-4890-a467-b60e3d6be92c</cmis:value></cmis:propertyId> | ||
| 828 | -<cmis:propertyString cmis:name="BaseType"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 829 | -<cmis:propertyString cmis:name="ObjectTypeId"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 830 | -<cmis:propertyString cmis:name="CreatedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 831 | - | ||
| 832 | -<cmis:propertyDateTime cmis:name="CreationDate"><cmis:value>2009-06-18T10:20:45.115+02:00</cmis:value></cmis:propertyDateTime> | ||
| 833 | -<cmis:propertyString cmis:name="LastModifiedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 834 | -<cmis:propertyDateTime cmis:name="LastModificationDate"><cmis:value>2009-06-18T10:20:45.137+02:00</cmis:value></cmis:propertyDateTime> | ||
| 835 | -<cmis:propertyString cmis:name="Name"><cmis:value>Web Projects</cmis:value></cmis:propertyString> | ||
| 836 | -<cmis:propertyId cmis:name="ParentId"><cmis:value>workspace://SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce</cmis:value></cmis:propertyId> | ||
| 837 | - | ||
| 838 | -</cmis:properties> | ||
| 839 | -</cmis:object> | ||
| 840 | -<cmis:terminator/> | ||
| 841 | -<app:edited>2009-06-18T10:20:45.137+02:00</app:edited> | ||
| 842 | -<alf:icon>http://10.33.4.34:8080/alfresco/images/icons/space-icon-default-16.gif</alf:icon> | ||
| 843 | -</entry> | ||
| 844 | -<entry> | ||
| 845 | -<author><name>admin</name></author> | ||
| 846 | -<content type="application/pdf" src="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><id>urn:uuid:2df9d676-f173-47bb-8ec1-41fa1186b66d</id> | ||
| 847 | -<link rel="self" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d"/> | ||
| 848 | - | ||
| 849 | -<link rel="enclosure" type="application/pdf" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><link rel="edit" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d"/> | ||
| 850 | -<link rel="edit-media" type="application/pdf" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><link rel="cmis-allowableactions" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/permissions"/> | ||
| 851 | -<link rel="cmis-relationships" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/associations"/> | ||
| 852 | -<link rel="cmis-parents" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/parents"/> | ||
| 853 | -<link rel="cmis-allversions" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/versions"/> | ||
| 854 | -<link rel="cmis-stream" type="application/pdf" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><link rel="cmis-type" href="http://10.33.4.34:8080/alfresco/service/api/type/document"/> | ||
| 855 | -<link rel="cmis-repository" href="http://10.33.4.34:8080/alfresco/service/api/repository"/> | ||
| 856 | -<published>2009-06-23T09:40:47.889+02:00</published> | ||
| 857 | -<summary></summary> | ||
| 858 | -<title>h4555-cmis-so.pdf</title> | ||
| 859 | -<updated>2009-06-23T09:40:58.524+02:00</updated> | ||
| 860 | - | ||
| 861 | -<cmis:object> | ||
| 862 | -<cmis:properties> | ||
| 863 | -<cmis:propertyId cmis:name="ObjectId"><cmis:value>workspace://SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d</cmis:value></cmis:propertyId> | ||
| 864 | -<cmis:propertyString cmis:name="BaseType"><cmis:value>document</cmis:value></cmis:propertyString> | ||
| 865 | -<cmis:propertyString cmis:name="ObjectTypeId"><cmis:value>document</cmis:value></cmis:propertyString> | ||
| 866 | -<cmis:propertyString cmis:name="CreatedBy"><cmis:value>admin</cmis:value></cmis:propertyString> | ||
| 867 | - | ||
| 868 | -<cmis:propertyDateTime cmis:name="CreationDate"><cmis:value>2009-06-23T09:40:47.889+02:00</cmis:value></cmis:propertyDateTime> | ||
| 869 | -<cmis:propertyString cmis:name="LastModifiedBy"><cmis:value>admin</cmis:value></cmis:propertyString> | ||
| 870 | -<cmis:propertyDateTime cmis:name="LastModificationDate"><cmis:value>2009-06-23T09:40:58.524+02:00</cmis:value></cmis:propertyDateTime> | ||
| 871 | -<cmis:propertyString cmis:name="Name"><cmis:value>h4555-cmis-so.pdf</cmis:value></cmis:propertyString> | ||
| 872 | -<cmis:propertyBoolean cmis:name="IsImmutable"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 873 | - | ||
| 874 | -<cmis:propertyBoolean cmis:name="IsLatestVersion"><cmis:value>true</cmis:value></cmis:propertyBoolean> | ||
| 875 | -<cmis:propertyBoolean cmis:name="IsMajorVersion"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 876 | -<cmis:propertyBoolean cmis:name="IsLatestMajorVersion"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 877 | -<cmis:propertyString cmis:name="VersionLabel"/> | ||
| 878 | -<cmis:propertyId cmis:name="VersionSeriesId"><cmis:value>workspace://SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d</cmis:value></cmis:propertyId> | ||
| 879 | - | ||
| 880 | -<cmis:propertyBoolean cmis:name="IsVersionSeriesCheckedOut"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 881 | -<cmis:propertyString cmis:name="VersionSeriesCheckedOutBy"/> | ||
| 882 | -<cmis:propertyId cmis:name="VersionSeriesCheckedOutId"/> | ||
| 883 | -<cmis:propertyString cmis:name="CheckinComment"/> | ||
| 884 | -<cmis:propertyInteger cmis:name="ContentStreamLength"><cmis:value>343084</cmis:value></cmis:propertyInteger> | ||
| 885 | -<cmis:propertyString cmis:name="ContentStreamMimeType"><cmis:value>application/pdf</cmis:value></cmis:propertyString> | ||
| 886 | -<cmis:propertyString cmis:name="ContentStreamFilename"><cmis:value>h4555-cmis-so.pdf</cmis:value></cmis:propertyString> | ||
| 887 | - | ||
| 888 | -<cmis:propertyString cmis:name="ContentStreamURI"><cmis:value>http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf</cmis:value></cmis:propertyString> | ||
| 889 | -</cmis:properties> | ||
| 890 | -</cmis:object> | ||
| 891 | -<cmis:terminator/> | ||
| 892 | -<app:edited>2009-06-23T09:40:58.524+02:00</app:edited> | ||
| 893 | -<alf:icon>http://10.33.4.34:8080/alfresco/images/filetypes/pdf.gif</alf:icon> | ||
| 894 | -</entry> | ||
| 895 | -<cmis:hasMoreItems>false</cmis:hasMoreItems> | ||
| 896 | -<opensearch:totalResults>6</opensearch:totalResults> | ||
| 897 | -<opensearch:startIndex>0</opensearch:startIndex> | ||
| 898 | - | ||
| 899 | -<opensearch:itemsPerPage>0</opensearch:itemsPerPage> | ||
| 900 | -</feed>'; | ||
| 901 | - | ||
| 902 | -$folderFeed = '<?xml version="1.0" encoding="UTF-8"?> | ||
| 903 | -<feed xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/2008/05"> | ||
| 904 | -<entry> | ||
| 905 | -<author><name>System</name></author> | ||
| 906 | -<content>28537649-8af2-4c74-aa92-5d8bbecac9ce</content> | ||
| 907 | -<id>urn:uuid:28537649-8af2-4c74-aa92-5d8bbecac9ce</id> | ||
| 908 | -<link rel="self" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce"/> | ||
| 909 | -<link rel="edit" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce"/> | ||
| 910 | -<link rel="cmis-allowableactions" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce/permissions"/> | ||
| 911 | -<link rel="cmis-relationships" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce/associations"/> | ||
| 912 | -<link rel="cmis-children" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce/children"/> | ||
| 913 | -<link rel="cmis-descendants" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce/descendants"/> | ||
| 914 | -<link rel="cmis-type" href="http://127.0.0.1:8080/alfresco/service/api/type/folder"/> | ||
| 915 | -<link rel="cmis-repository" href="http://127.0.0.1:8080/alfresco/service/api/repository"/> | ||
| 916 | -<published>2009-06-18T10:20:29.871+02:00</published> | ||
| 917 | -<summary>The company root space</summary> | ||
| 918 | -<title>Company Home</title> | ||
| 919 | -<updated>2009-06-18T10:20:29.937+02:00</updated> | ||
| 920 | -<cmis:object> | ||
| 921 | -<cmis:properties> | ||
| 922 | -<cmis:propertyId cmis:name="ObjectId"><cmis:value>workspace://SpacesStore/28537649-8af2-4c74-aa92-5d8bbecac9ce</cmis:value></cmis:propertyId> | ||
| 923 | -<cmis:propertyString cmis:name="BaseType"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 924 | -<cmis:propertyString cmis:name="ObjectTypeId"><cmis:value>folder</cmis:value></cmis:propertyString> | ||
| 925 | -<cmis:propertyString cmis:name="CreatedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 926 | -<cmis:propertyDateTime cmis:name="CreationDate"><cmis:value>2009-06-18T10:20:29.871+02:00</cmis:value></cmis:propertyDateTime> | ||
| 927 | -<cmis:propertyString cmis:name="LastModifiedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 928 | -<cmis:propertyDateTime cmis:name="LastModificationDate"><cmis:value>2009-06-18T10:20:29.937+02:00</cmis:value></cmis:propertyDateTime> | ||
| 929 | -<cmis:propertyString cmis:name="Name"><cmis:value>Company Home</cmis:value></cmis:propertyString> | ||
| 930 | -<cmis:propertyId cmis:name="ParentId"/> | ||
| 931 | -</cmis:properties> | ||
| 932 | -</cmis:object> | ||
| 933 | -<cmis:terminator/> | ||
| 934 | -<app:edited>2009-06-18T10:20:29.937+02:00</app:edited> | ||
| 935 | -<alf:icon>http://127.0.0.1:8080/alfresco/images/icons/space-icon-default-16.gif</alf:icon> | ||
| 936 | -</entry> | ||
| 937 | -</feed>'; | ||
| 938 | - | ||
| 939 | -$docFeed = '<?xml version="1.0" encoding="UTF-8"?> | ||
| 940 | -<feed xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/2008/05"> | ||
| 941 | -<entry> | ||
| 942 | -<author><name>admin</name></author> | ||
| 943 | -<content type="application/pdf" src="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><id>urn:uuid:2df9d676-f173-47bb-8ec1-41fa1186b66d</id> | ||
| 944 | -<link rel="self" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d"/> | ||
| 945 | -<link rel="enclosure" type="application/pdf" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><link rel="edit" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d"/> | ||
| 946 | -<link rel="edit-media" type="application/pdf" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><link rel="cmis-allowableactions" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/permissions"/> | ||
| 947 | -<link rel="cmis-relationships" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/associations"/> | ||
| 948 | -<link rel="cmis-parents" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/parents"/> | ||
| 949 | -<link rel="cmis-allversions" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/versions"/> | ||
| 950 | -<link rel="cmis-stream" type="application/pdf" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf"/><link rel="cmis-type" href="http://127.0.0.1:8080/alfresco/service/api/type/document"/> | ||
| 951 | -<link rel="cmis-repository" href="http://127.0.0.1:8080/alfresco/service/api/repository"/> | ||
| 952 | -<published>2009-06-23T09:40:47.889+02:00</published> | ||
| 953 | -<summary></summary> | ||
| 954 | -<title>h4555-cmis-so.pdf</title> | ||
| 955 | -<updated>2009-06-23T09:40:58.524+02:00</updated> | ||
| 956 | -<cmis:object> | ||
| 957 | -<cmis:properties> | ||
| 958 | -<cmis:propertyId cmis:name="ObjectId"><cmis:value>workspace://SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d</cmis:value></cmis:propertyId> | ||
| 959 | -<cmis:propertyString cmis:name="BaseType"><cmis:value>document</cmis:value></cmis:propertyString> | ||
| 960 | -<cmis:propertyString cmis:name="ObjectTypeId"><cmis:value>document</cmis:value></cmis:propertyString> | ||
| 961 | -<cmis:propertyString cmis:name="CreatedBy"><cmis:value>admin</cmis:value></cmis:propertyString> | ||
| 962 | -<cmis:propertyDateTime cmis:name="CreationDate"><cmis:value>2009-06-23T09:40:47.889+02:00</cmis:value></cmis:propertyDateTime> | ||
| 963 | -<cmis:propertyString cmis:name="LastModifiedBy"><cmis:value>admin</cmis:value></cmis:propertyString> | ||
| 964 | -<cmis:propertyDateTime cmis:name="LastModificationDate"><cmis:value>2009-06-23T09:40:58.524+02:00</cmis:value></cmis:propertyDateTime> | ||
| 965 | -<cmis:propertyString cmis:name="Name"><cmis:value>h4555-cmis-so.pdf</cmis:value></cmis:propertyString> | ||
| 966 | -<cmis:propertyBoolean cmis:name="IsImmutable"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 967 | -<cmis:propertyBoolean cmis:name="IsLatestVersion"><cmis:value>true</cmis:value></cmis:propertyBoolean> | ||
| 968 | -<cmis:propertyBoolean cmis:name="IsMajorVersion"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 969 | -<cmis:propertyBoolean cmis:name="IsLatestMajorVersion"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 970 | -<cmis:propertyString cmis:name="VersionLabel"/> | ||
| 971 | -<cmis:propertyId cmis:name="VersionSeriesId"><cmis:value>workspace://SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d</cmis:value></cmis:propertyId> | ||
| 972 | -<cmis:propertyBoolean cmis:name="IsVersionSeriesCheckedOut"><cmis:value>false</cmis:value></cmis:propertyBoolean> | ||
| 973 | -<cmis:propertyString cmis:name="VersionSeriesCheckedOutBy"/> | ||
| 974 | -<cmis:propertyId cmis:name="VersionSeriesCheckedOutId"/> | ||
| 975 | -<cmis:propertyString cmis:name="CheckinComment"/> | ||
| 976 | -<cmis:propertyInteger cmis:name="ContentStreamLength"><cmis:value>343084</cmis:value></cmis:propertyInteger> | ||
| 977 | -<cmis:propertyString cmis:name="ContentStreamMimeType"><cmis:value>application/pdf</cmis:value></cmis:propertyString> | ||
| 978 | -<cmis:propertyString cmis:name="ContentStreamFilename"><cmis:value>h4555-cmis-so.pdf</cmis:value></cmis:propertyString> | ||
| 979 | -<cmis:propertyString cmis:name="ContentStreamURI"><cmis:value>http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/2df9d676-f173-47bb-8ec1-41fa1186b66d/content.h4555-cmis-so.pdf</cmis:value></cmis:propertyString> | ||
| 980 | -</cmis:properties> | ||
| 981 | -</cmis:object> | ||
| 982 | -<cmis:terminator/> | ||
| 983 | -<app:edited>2009-06-23T09:40:58.524+02:00</app:edited> | ||
| 984 | -<alf:icon>http://127.0.0.1:8080/alfresco/images/filetypes/pdf.gif</alf:icon> | ||
| 985 | -</entry> | ||
| 986 | -</feed>'; | ||
| 987 | ?> | 572 | ?> |
| 988 | \ No newline at end of file | 573 | \ No newline at end of file |
webservice/atompub/cmis/KT_cmis_atom_service_helper.inc.php
| @@ -28,45 +28,156 @@ class KT_cmis_atom_service_helper { | @@ -28,45 +28,156 @@ class KT_cmis_atom_service_helper { | ||
| 28 | $id = $cmisEntry['properties']['ObjectId']['value']; | 28 | $id = $cmisEntry['properties']['ObjectId']['value']; |
| 29 | $entry = $feed->newEntry(); | 29 | $entry = $feed->newEntry(); |
| 30 | $feed->newField('id', 'urn:uuid:' . $id, $entry); | 30 | $feed->newField('id', 'urn:uuid:' . $id, $entry); |
| 31 | -// print_r($cmisEntry); | 31 | + |
| 32 | + // TODO dynamic actual creator name | ||
| 33 | + $feedElement = $feed->newField('author'); | ||
| 34 | + $element = $feed->newField('name', 'admin', $feedElement); | ||
| 35 | + $entry->appendChild($feedElement); | ||
| 36 | + | ||
| 37 | + $entry->appendChild($feed->newField('content', $id)); | ||
| 38 | + // TODO proper date | ||
| 39 | + $entry->appendChild($feed->newField('published', self::formatDatestamp())); | ||
| 40 | + $entry->appendChild($feed->newField('updated', self::formatDatestamp())); | ||
| 41 | + | ||
| 42 | +// $entry->appendChild($feed->newField('summary', $cmisEntry['properties']['Name']['value'])); | ||
| 43 | + | ||
| 32 | // links | 44 | // links |
| 45 | + /* | ||
| 46 | +<link rel="allowableactions" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/66f02c27-379e-4782-a0c4-b12f2d5bc543/permissions"/> | ||
| 47 | +<link rel="relationships" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/66f02c27-379e-4782-a0c4-b12f2d5bc543/rels"/> | ||
| 48 | +<link rel="parents" href="http://127.0.0.1:8080/alfresco/service/api/node/workspace/SpacesStore/66f02c27-379e-4782-a0c4-b12f2d5bc543/parent"/> | ||
| 49 | + | ||
| 50 | + */ | ||
| 51 | + // | ||
| 52 | + | ||
| 53 | + /* | ||
| 54 | +<cmis:propertyUri cmis:name="Uri"/> | ||
| 55 | +<cmis:propertyId cmis:name="AllowedChildObjectTypeIds"/> | ||
| 56 | +<cmis:propertyString cmis:name="CreatedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 57 | +<cmis:propertyDateTime cmis:name="CreationDate"><cmis:value>2009-07-13T13:59:20.724+02:00</cmis:value></cmis:propertyDateTime> | ||
| 58 | +<cmis:propertyString cmis:name="ChangeToken"/> | ||
| 59 | +<cmis:propertyString cmis:name="LastModifiedBy"><cmis:value>System</cmis:value></cmis:propertyString> | ||
| 60 | +<cmis:propertyId cmis:name="ObjectTypeId"><cmis:value>folder</cmis:value></cmis:propertyId> | ||
| 61 | + | ||
| 62 | +<cmis:propertyId cmis:name="ObjectId"><cmis:value>workspace://SpacesStore/b30ea6e5-1e3f-4133-82f4-172bc240a9a2</cmis:value></cmis:propertyId> | ||
| 63 | + */ | ||
| 64 | + | ||
| 65 | + $type = strtolower($cmisEntry['properties']['ObjectTypeId']['value']); | ||
| 66 | + | ||
| 67 | + $link = $feed->newElement('link'); | ||
| 68 | + $link->appendChild($feed->newAttr('rel','self')); | ||
| 69 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' . $type . '/' . $cmisEntry['properties']['ObjectId']['value'])); | ||
| 70 | + $entry->appendChild($link); | ||
| 71 | + | ||
| 72 | + $link = $feed->newElement('link'); | ||
| 73 | + $link->appendChild($feed->newAttr('rel','edit')); | ||
| 74 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' . $type . '/' . $cmisEntry['properties']['ObjectId']['value'])); | ||
| 75 | + $entry->appendChild($link); | ||
| 76 | + | ||
| 33 | // TODO check parent link is correct, fix if needed | 77 | // TODO check parent link is correct, fix if needed |
| 78 | + // TODO leave out if at root folder | ||
| 79 | + $link = $feed->newElement('link'); | ||
| 80 | + $link->appendChild($feed->newAttr('rel', 'parents')); | ||
| 81 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/folder/' | ||
| 82 | + . $cmisEntry['properties']['ObjectId']['value'] . '/parent')); | ||
| 83 | + $entry->appendChild($link); | ||
| 84 | + | ||
| 85 | + // according to spec this MUST be present, but spec says that links for function which are not supported | ||
| 86 | + // do not need to be present, so unsure for the moment | ||
| 34 | $link = $feed->newElement('link'); | 87 | $link = $feed->newElement('link'); |
| 35 | - $link->appendChild($feed->newAttr('rel','cmis-parent')); | ||
| 36 | - $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/folder/' . $cmisEntry['properties']['ParentId']['value'])); | 88 | + $link->appendChild($feed->newAttr('rel', 'allowableactions')); |
| 89 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' . $type . '/' | ||
| 90 | + . $cmisEntry['properties']['ObjectId']['value'] . '/permissions')); | ||
| 37 | $entry->appendChild($link); | 91 | $entry->appendChild($link); |
| 38 | 92 | ||
| 93 | + // Folder/Document specific links | ||
| 39 | if (strtolower($cmisEntry['properties']['ObjectTypeId']['value']) == 'folder') | 94 | if (strtolower($cmisEntry['properties']['ObjectTypeId']['value']) == 'folder') |
| 40 | { | 95 | { |
| 41 | - // TODO check parent link is correct, fix if needed | ||
| 42 | - $link = $feed->newElement('link'); | ||
| 43 | - $link->appendChild($feed->newAttr('rel','cmis-folderparent')); | ||
| 44 | - $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/folder/' . $cmisEntry['properties']['ParentId']['value'])); | ||
| 45 | - $entry->appendChild($link); | 96 | + // no longer valid, remove... |
| 97 | +// // TODO check parent link is correct, fix if needed | ||
| 98 | +// $link = $feed->newElement('link'); | ||
| 99 | +// $link->appendChild($feed->newAttr('rel','folderparent')); | ||
| 100 | +// $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/folder/' . $cmisEntry['properties']['ParentId']['value'])); | ||
| 101 | +// $entry->appendChild($link); | ||
| 102 | + | ||
| 46 | $link = $feed->newElement('link'); | 103 | $link = $feed->newElement('link'); |
| 47 | - $link->appendChild($feed->newAttr('rel','cmis-children')); | 104 | + $link->appendChild($feed->newAttr('rel','children')); |
| 48 | $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' | 105 | $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' |
| 49 | - . strtolower($cmisEntry['properties']['ObjectTypeId']['value']) | 106 | + . $type |
| 50 | . '/' . $cmisEntry['properties']['ObjectId']['value'] | 107 | . '/' . $cmisEntry['properties']['ObjectId']['value'] |
| 51 | . '/children')); | 108 | . '/children')); |
| 52 | $entry->appendChild($link); | 109 | $entry->appendChild($link); |
| 53 | $link = $feed->newElement('link'); | 110 | $link = $feed->newElement('link'); |
| 54 | - $link->appendChild($feed->newAttr('rel','cmis-descendants')); | 111 | + $link->appendChild($feed->newAttr('rel','descendants')); |
| 55 | $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' | 112 | $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' |
| 56 | - . strtolower($cmisEntry['properties']['ObjectTypeId']['value']) | 113 | + . $type |
| 57 | . '/' . $cmisEntry['properties']['ObjectId']['value'] | 114 | . '/' . $cmisEntry['properties']['ObjectId']['value'] |
| 58 | . '/descendants')); | 115 | . '/descendants')); |
| 59 | $entry->appendChild($link); | 116 | $entry->appendChild($link); |
| 60 | } | 117 | } |
| 118 | + else if (strtolower($cmisEntry['properties']['ObjectTypeId']['value']) == 'document') | ||
| 119 | + { | ||
| 120 | + // according to spec this MUST be present, but spec says that links for function which are not supported | ||
| 121 | + // do not need to be present, so unsure for the moment | ||
| 122 | +// $link = $feed->newElement('link'); | ||
| 123 | +// $link->appendChild($feed->newAttr('rel', 'allversions')); | ||
| 124 | +// $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' . $type . '/' . $cmisEntry['properties']['ParentId']['value'])); | ||
| 125 | +// $entry->appendChild($link); | ||
| 126 | + | ||
| 127 | + // according to spec this MUST be present, but spec says that links for function which are not supported | ||
| 128 | + // do not need to be present, so unsure for the moment | ||
| 129 | +// $link = $feed->newElement('link'); | ||
| 130 | +// $link->appendChild($feed->newAttr('rel', 'latestversion')); | ||
| 131 | +// $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' . $type . '/' . $cmisEntry['properties']['ParentId']['value'])); | ||
| 132 | +// $entry->appendChild($link); | ||
| 133 | + | ||
| 134 | + // if there is a content stream, this link MUST be present | ||
| 135 | + // not sure yet where it must point... | ||
| 136 | + if (!empty($cmisEntry['properties']['ContentStreamLength']['value'])) | ||
| 137 | + { | ||
| 138 | + $link = $feed->newElement('link'); | ||
| 139 | + $link->appendChild($feed->newAttr('rel', 'stream')); | ||
| 140 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' . $type . '/' | ||
| 141 | + . $cmisEntry['properties']['ObjectId']['value'])); | ||
| 142 | + $entry->appendChild($link); | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + // if the document is checked out and this is NOT the PWC, this link MUST be present | ||
| 146 | +// if (!empty($cmisEntry['properties']['ContentStreamLength']['value'])) | ||
| 147 | +// { | ||
| 148 | +// $link = $feed->newElement('link'); | ||
| 149 | +// $link->appendChild($feed->newAttr('rel', 'stream')); | ||
| 150 | +// $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' . $type . '/' . $cmisEntry['properties']['ParentId']['value'])); | ||
| 151 | +// $entry->appendChild($link); | ||
| 152 | +// } | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + | ||
| 156 | + // according to spec this MUST be present, but spec says that links for function which are not supported | ||
| 157 | + // do not need to be present, so unsure for the moment | ||
| 158 | + $link = $feed->newElement('link'); | ||
| 159 | + $link->appendChild($feed->newAttr('rel', 'relationships')); | ||
| 160 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' . $type . '/' | ||
| 161 | + . $cmisEntry['properties']['ObjectId']['value'] . '/rels')); | ||
| 162 | + $entry->appendChild($link); | ||
| 163 | + | ||
| 61 | 164 | ||
| 62 | $link = $feed->newElement('link'); | 165 | $link = $feed->newElement('link'); |
| 63 | - $link->appendChild($feed->newAttr('rel','cmis-type')); | ||
| 64 | - $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/type/' . strtolower($cmisEntry['properties']['ObjectTypeId']['value']))); | 166 | + $link->appendChild($feed->newAttr('rel','type')); |
| 167 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/type/' . $type)); | ||
| 65 | $entry->appendChild($link); | 168 | $entry->appendChild($link); |
| 169 | + | ||
| 66 | $link = $feed->newElement('link'); | 170 | $link = $feed->newElement('link'); |
| 67 | - $link->appendChild($feed->newAttr('rel','cmis-repository')); | ||
| 68 | - $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/servicedocument')); | 171 | + $link->appendChild($feed->newAttr('rel','repository')); |
| 172 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . '/servicedocument')); | ||
| 69 | $entry->appendChild($link); | 173 | $entry->appendChild($link); |
| 174 | + | ||
| 175 | + // according to spec this MUST be present, but spec says that links for function which are not supported | ||
| 176 | + // do not need to be present, so unsure for the moment - policies are being abandoned, or so I thought... | ||
| 177 | +// $link = $feed->newElement('link'); | ||
| 178 | +// $link->appendChild($feed->newAttr('rel', 'policies')); | ||
| 179 | +// $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/' . $type . '/' . $cmisEntry['properties']['ParentId']['value'])); | ||
| 180 | +// $entry->appendChild($link); | ||
| 70 | // end links | 181 | // end links |
| 71 | 182 | ||
| 72 | $entry->appendChild($feed->newElement('summary', $cmisEntry['properties']['Name']['value'])); | 183 | $entry->appendChild($feed->newElement('summary', $cmisEntry['properties']['Name']['value'])); |
| @@ -86,6 +197,9 @@ class KT_cmis_atom_service_helper { | @@ -86,6 +197,9 @@ class KT_cmis_atom_service_helper { | ||
| 86 | 197 | ||
| 87 | $objectElement->appendChild($propertiesElement); | 198 | $objectElement->appendChild($propertiesElement); |
| 88 | $entry->appendChild($objectElement); | 199 | $entry->appendChild($objectElement); |
| 200 | + | ||
| 201 | + // after every entry, append a cmis:terminator tag | ||
| 202 | + $entry->appendChild($feed->newElement('cmis:terminator')); | ||
| 89 | } | 203 | } |
| 90 | 204 | ||
| 91 | /** | 205 | /** |
| @@ -116,35 +230,67 @@ class KT_cmis_atom_service_helper { | @@ -116,35 +230,67 @@ class KT_cmis_atom_service_helper { | ||
| 116 | //Create a new response feed | 230 | //Create a new response feed |
| 117 | $feed = new KT_cmis_atom_responseFeed(CMIS_APP_BASE_URI, $typesHeading, null, null, null, 'urn:uuid:' . $typesString); | 231 | $feed = new KT_cmis_atom_responseFeed(CMIS_APP_BASE_URI, $typesHeading, null, null, null, 'urn:uuid:' . $typesString); |
| 118 | 232 | ||
| 233 | + // TODO set page number correctly - to be done when we support paging the the API | ||
| 234 | + | ||
| 235 | + // author | ||
| 236 | + // TODO generate this dynamically (based on???)\ | ||
| 237 | + $feedElement = $feed->newField('author'); | ||
| 238 | + $element = $feed->newField('name', 'admin', $feedElement); | ||
| 239 | + $feed->appendChild($feedElement); | ||
| 240 | + | ||
| 241 | + // NOTE spec says this link MUST be present but is vague on where it points | ||
| 242 | + // as of 0.61c: | ||
| 243 | + // "The source link relation points to the underlying CMIS Type Definition as Atom Entry" | ||
| 244 | + // so what is the underlying CMIS Type Definition for a collection of base types? | ||
| 245 | + // suspect that it only applies when not listing all types, i.e. a base type is asked for | ||
| 246 | + /* | ||
| 247 | + $link = $feed->newElement('link'); | ||
| 248 | + $link->appendChild($feed->newAttr('rel','source')); | ||
| 249 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/type/' . strtolower($type['typeId']))); | ||
| 250 | + $feed->appendChild($link); | ||
| 251 | + */ | ||
| 252 | + | ||
| 253 | + // current time: format = 2009-07-13T14:49:27.659+02:00 | ||
| 254 | + $feed->appendChild($feed->newElement('updated', self::formatDatestamp())); | ||
| 255 | + | ||
| 119 | foreach($types as $type) | 256 | foreach($types as $type) |
| 120 | { | 257 | { |
| 121 | $entry = $feed->newEntry(); | 258 | $entry = $feed->newEntry(); |
| 259 | + | ||
| 260 | + $feedElement = $feed->newField('author'); | ||
| 261 | + $element = $feed->newField('name', 'admin', $feedElement); | ||
| 262 | + $entry->appendChild($feedElement); | ||
| 263 | + $feedElement = $feed->newField('content', $type['typeId']); | ||
| 264 | + $entry->appendChild($feedElement); | ||
| 265 | + | ||
| 266 | + // NOTE should this be strtolower? thought so but maybe not always, Alfresco is not consistent... | ||
| 122 | $feed->newId('urn:uuid:type-' . strtolower($type['typeId']), $entry); | 267 | $feed->newId('urn:uuid:type-' . strtolower($type['typeId']), $entry); |
| 123 | 268 | ||
| 269 | + // TODO add parents link when not selecting a base type. | ||
| 270 | + // TODO add children link when type has children | ||
| 271 | + // TODO add descendants link when type has children | ||
| 272 | + // NOTE KnowledgeTree currently only supports base types so these are not important at the present time. | ||
| 273 | + | ||
| 124 | // links | 274 | // links |
| 275 | +// $link = $feed->newElement('link'); | ||
| 276 | +// $link->appendChild($feed->newAttr('rel','self')); | ||
| 277 | +// $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/type/' . strtolower($type['typeId']))); | ||
| 278 | +// $entry->appendChild($link); | ||
| 279 | + // TODO type link MUST point to base type | ||
| 280 | + // KnowledgeTree currently only supports base types so this is not important | ||
| 281 | + // at the present time as it will always point at the base type. | ||
| 125 | $link = $feed->newElement('link'); | 282 | $link = $feed->newElement('link'); |
| 126 | - $link->appendChild($feed->newAttr('rel','self')); | ||
| 127 | - $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/type/' . strtolower($type['typeId']))); | ||
| 128 | - $entry->appendChild($link); | ||
| 129 | - $link = $feed->newElement('link'); | ||
| 130 | - $link->appendChild($feed->newAttr('rel','cmis-type')); | 283 | + $link->appendChild($feed->newAttr('rel','type')); |
| 131 | $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/type/' . strtolower($type['typeId']))); | 284 | $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/type/' . strtolower($type['typeId']))); |
| 132 | $entry->appendChild($link); | 285 | $entry->appendChild($link); |
| 133 | $link = $feed->newElement('link'); | 286 | $link = $feed->newElement('link'); |
| 134 | - $link->appendChild($feed->newAttr('rel','cmis-children')); | ||
| 135 | - $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/type/' . strtolower($type['typeId']) . '/children')); | ||
| 136 | - $entry->appendChild($link); | ||
| 137 | - $link = $feed->newElement('link'); | ||
| 138 | - $link->appendChild($feed->newAttr('rel','cmis-descendants')); | ||
| 139 | - $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/type/' . strtolower($type['typeId']) . '/descendants')); | ||
| 140 | - $entry->appendChild($link); | ||
| 141 | - $link = $feed->newElement('link'); | ||
| 142 | - $link->appendChild($feed->newAttr('rel','cmis-repository')); | ||
| 143 | - $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . $feed->workspace . '/servicedocument')); | 287 | + $link->appendChild($feed->newAttr('rel','repository')); |
| 288 | + $link->appendChild($feed->newAttr('href', CMIS_APP_BASE_URI . '/servicedocument')); | ||
| 144 | $entry->appendChild($link); | 289 | $entry->appendChild($link); |
| 145 | 290 | ||
| 146 | $entry->appendChild($feed->newElement('summary', $type['typeId'] . ' Type')); | 291 | $entry->appendChild($feed->newElement('summary', $type['typeId'] . ' Type')); |
| 147 | $entry->appendChild($feed->newElement('title', $type['typeId'])); | 292 | $entry->appendChild($feed->newElement('title', $type['typeId'])); |
| 293 | + $entry->appendChild($feed->newElement('updated', self::formatDatestamp())); | ||
| 148 | 294 | ||
| 149 | // main CMIS entry | 295 | // main CMIS entry |
| 150 | $feedElement = $feed->newElement('cmis:' . strtolower($type['typeId']) . 'Type'); | 296 | $feedElement = $feed->newElement('cmis:' . strtolower($type['typeId']) . 'Type'); |
| @@ -154,6 +300,9 @@ class KT_cmis_atom_service_helper { | @@ -154,6 +300,9 @@ class KT_cmis_atom_service_helper { | ||
| 154 | } | 300 | } |
| 155 | 301 | ||
| 156 | $entry->appendChild($feedElement); | 302 | $entry->appendChild($feedElement); |
| 303 | + | ||
| 304 | + // after every entry, append a cmis:terminator tag | ||
| 305 | + $entry->appendChild($feed->newElement('cmis:terminator')); | ||
| 157 | } | 306 | } |
| 158 | 307 | ||
| 159 | return $feed; | 308 | return $feed; |
| @@ -234,7 +383,7 @@ class KT_cmis_atom_service_helper { | @@ -234,7 +383,7 @@ class KT_cmis_atom_service_helper { | ||
| 234 | * @param string $ip | 383 | * @param string $ip |
| 235 | * @return object Containing the status_code of the login and session id | 384 | * @return object Containing the status_code of the login and session id |
| 236 | */ | 385 | */ |
| 237 | - function login($username, $password, $ip=null){ | 386 | + static public function login($username, $password, $ip=null){ |
| 238 | $kt = self::getKt(); | 387 | $kt = self::getKt(); |
| 239 | 388 | ||
| 240 | $session = $kt->start_session($username,$password, $ip); | 389 | $session = $kt->start_session($username,$password, $ip); |
| @@ -256,7 +405,7 @@ class KT_cmis_atom_service_helper { | @@ -256,7 +405,7 @@ class KT_cmis_atom_service_helper { | ||
| 256 | * @param string $session_id | 405 | * @param string $session_id |
| 257 | * @return object Containing the status_code of the logout attempt | 406 | * @return object Containing the status_code of the logout attempt |
| 258 | */ | 407 | */ |
| 259 | - function logout($session_id){ | 408 | + static public function logout($session_id){ |
| 260 | $kt = self::getKt(); | 409 | $kt = self::getKt(); |
| 261 | $session = $kt->get_active_session($session_id, null); | 410 | $session = $kt->get_active_session($session_id, null); |
| 262 | 411 | ||
| @@ -284,6 +433,13 @@ class KT_cmis_atom_service_helper { | @@ -284,6 +433,13 @@ class KT_cmis_atom_service_helper { | ||
| 284 | return self::$kt; | 433 | return self::$kt; |
| 285 | } | 434 | } |
| 286 | 435 | ||
| 436 | + // TODO adjust for time zones? | ||
| 437 | + static public function formatDatestamp($time = null) | ||
| 438 | + { | ||
| 439 | + if (is_null($time)) $time = time(); | ||
| 440 | + return date('Y-m-d H:i:s', $time); | ||
| 441 | + } | ||
| 442 | + | ||
| 287 | } | 443 | } |
| 288 | 444 | ||
| 289 | ?> | 445 | ?> |
webservice/atompub/cmis/index.php
| @@ -93,22 +93,21 @@ if ($workspace == 'servicedocument') | @@ -93,22 +93,21 @@ if ($workspace == 'servicedocument') | ||
| 93 | */ | 93 | */ |
| 94 | // TODO consider a registerServices function which will, dependant on what is requested, register the appropriate services, keep the logic out of the index file | 94 | // TODO consider a registerServices function which will, dependant on what is requested, register the appropriate services, keep the logic out of the index file |
| 95 | $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection', | 95 | $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection', |
| 96 | - array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'children'), 'root-children'); | 96 | + array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'children'), 'rootchildren'); |
| 97 | $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection', | 97 | $APP->registerService('dms', 'folder', 'KT_cmis_atom_service_folder', 'Root Folder Children Collection', |
| 98 | - array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'descendants'), 'root-descendants'); | ||
| 99 | -$APP->registerService('dms', 'checkedout', 'KT_cmis_atom_service_checkedout', 'Checked Out Document Collection', null, 'checkedout'); | ||
| 100 | -$APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'types-children'); | ||
| 101 | -$APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'types-descendants'); | 98 | + array(rawurlencode($APP->repositoryInfo['rootFolderId']), 'descendants'), 'rootdescendants'); |
| 99 | +$APP->registerService('dms', 'checkedout', 'KT_cmis_atom_service_checkedout', 'Checked Out Document Collection', null, | ||
| 100 | + 'checkedout', 'application/atom+xml;type=entry'); | ||
| 101 | +$APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'typeschildren'); | ||
| 102 | +$APP->registerService('dms', 'types', 'KT_cmis_atom_service_types', 'Object Type Collection', null, 'typesdescendants'); | ||
| 102 | 103 | ||
| 103 | -// FIXME HACK! this should not happen every time, ONLY on a specific request, should NOT appear in service document as this is not definable at that time; | ||
| 104 | -// SHOULD be appearing in types listing feed | ||
| 105 | // NOTE $requestParams is meaningless if not actually requesting this service, so not a good way to register the service really | 104 | // NOTE $requestParams is meaningless if not actually requesting this service, so not a good way to register the service really |
| 106 | if ($workspace != 'servicedocument') | 105 | if ($workspace != 'servicedocument') |
| 107 | { | 106 | { |
| 108 | // should check this per workspace??? | 107 | // should check this per workspace??? |
| 109 | - $APP->registerService('dms', 'type', 'KT_cmis_atom_service_type', 'Object Type Collection', explode('/', $requestParams), 'types-descendants'); | 108 | + $APP->registerService('dms', 'type', 'KT_cmis_atom_service_type', 'Object Type Collection', explode('/', $requestParams), 'typesdescendants'); |
| 110 | // FIXME HACK! see above, this one for documents | 109 | // FIXME HACK! see above, this one for documents |
| 111 | - $APP->registerService('dms', 'document', 'KT_cmis_atom_service_document', 'Object Type Collection', explode('/', $requestParams), 'types-descendants'); | 110 | + $APP->registerService('dms', 'document', 'KT_cmis_atom_service_document', 'Object Type Collection', explode('/', $requestParams), 'typesdescendants'); |
| 112 | } | 111 | } |
| 113 | 112 | ||
| 114 | //Execute the current url/header request | 113 | //Execute the current url/header request |
webservice/classes/atompub/cmis/KT_cmis_atom_responseFeed.inc.php
| @@ -24,7 +24,7 @@ class KT_cmis_atom_responseFeed extends KT_atom_responseFeed { | @@ -24,7 +24,7 @@ class KT_cmis_atom_responseFeed extends KT_atom_responseFeed { | ||
| 24 | // $feed->appendChild($this->newAttr('xmlns','http://www.w3.org/2007/app')); | 24 | // $feed->appendChild($this->newAttr('xmlns','http://www.w3.org/2007/app')); |
| 25 | // $feed->appendChild($this->newAttr('xmlns:atom','http://www.w3.org/2005/Atom')); | 25 | // $feed->appendChild($this->newAttr('xmlns:atom','http://www.w3.org/2005/Atom')); |
| 26 | $feed->appendChild($this->newAttr('xmlns','http://www.w3.org/2005/Atom')); | 26 | $feed->appendChild($this->newAttr('xmlns','http://www.w3.org/2005/Atom')); |
| 27 | - $feed->appendChild($this->newAttr('xmlns:cmis','http://www.cmis.org/2008/05')); | 27 | + $feed->appendChild($this->newAttr('xmlns:cmis','http://docs.oasis-open.org/ns/cmis/core/200901')); |
| 28 | $this->feed = &$feed; | 28 | $this->feed = &$feed; |
| 29 | 29 | ||
| 30 | if (!is_null($this->id)) | 30 | if (!is_null($this->id)) |
| @@ -52,22 +52,27 @@ class KT_cmis_atom_responseFeed extends KT_atom_responseFeed { | @@ -52,22 +52,27 @@ class KT_cmis_atom_responseFeed extends KT_atom_responseFeed { | ||
| 52 | return $id; | 52 | return $id; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | -// public function &newField($name = NULL, $value = NULL, &$entry = NULL) | ||
| 56 | -// { | ||
| 57 | -// $append = false; | ||
| 58 | -// | ||
| 59 | -// if(func_num_args() > 3) | ||
| 60 | -// { | ||
| 61 | -// $append = ((func_get_arg(3) === true) ? true : false); | ||
| 62 | -// } | ||
| 63 | -// | ||
| 64 | -// $field = $this->newElement('cmis:' . $name, $value); | ||
| 65 | -// | ||
| 66 | -// if (isset($entry)) $entry->appendChild($field); | ||
| 67 | -// else if ($append) $this->feed->appendChild($field); | ||
| 68 | -// | ||
| 69 | -// return $field; | ||
| 70 | -// } | 55 | + public function &newField($name = NULL, $value = NULL, &$entry = NULL) |
| 56 | + { | ||
| 57 | + $append = false; | ||
| 58 | + | ||
| 59 | + if(func_num_args() > 3) | ||
| 60 | + { | ||
| 61 | + $append = ((func_get_arg(3) === true) ? true : false); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + $field = $this->newElement($name, $value); | ||
| 65 | + | ||
| 66 | + if (isset($entry)) $entry->appendChild($field); | ||
| 67 | + else if ($append) $this->feed->appendChild($field); | ||
| 68 | + | ||
| 69 | + return $field; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + function appendChild($element) | ||
| 73 | + { | ||
| 74 | + $this->feed->appendChild($element); | ||
| 75 | + } | ||
| 71 | 76 | ||
| 72 | /* | 77 | /* |
| 73 | public function &newEntry() | 78 | public function &newEntry() |
webservice/classes/atompub/cmis/KT_cmis_atom_server.inc.php
| @@ -77,13 +77,13 @@ class KT_cmis_atom_server extends KT_atom_server { | @@ -77,13 +77,13 @@ class KT_cmis_atom_server extends KT_atom_server { | ||
| 77 | } | 77 | } |
| 78 | $ws->appendChild($element); | 78 | $ws->appendChild($element); |
| 79 | 79 | ||
| 80 | - foreach($collection as $serviceName => $serviceInstance) | 80 | + foreach($collection as $serviceName => $serviceInstance) |
| 81 | { | 81 | { |
| 82 | foreach($serviceInstance as $instance) | 82 | foreach($serviceInstance as $instance) |
| 83 | { | 83 | { |
| 84 | $collectionStr = CMIS_APP_BASE_URI . $workspace . '/' . $serviceName . '/' | 84 | $collectionStr = CMIS_APP_BASE_URI . $workspace . '/' . $serviceName . '/' |
| 85 | . (is_array($instance['parameters']) ? implode('/', $instance['parameters']).'/' : ''); | 85 | . (is_array($instance['parameters']) ? implode('/', $instance['parameters']).'/' : ''); |
| 86 | - $col = $service->newCollection($collectionStr, $instance['title'], $instance['collectionType'], $ws); | 86 | + $col = $service->newCollection($collectionStr, $instance['title'], $instance['collectionType'], $instance['accept'], $ws); |
| 87 | } | 87 | } |
| 88 | } | 88 | } |
| 89 | } | 89 | } |
| @@ -92,17 +92,18 @@ class KT_cmis_atom_server extends KT_atom_server { | @@ -92,17 +92,18 @@ class KT_cmis_atom_server extends KT_atom_server { | ||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | public function registerService($workspace = NULL, $serviceName = NULL, $serviceClass = NULL, $title = NULL, | 94 | public function registerService($workspace = NULL, $serviceName = NULL, $serviceClass = NULL, $title = NULL, |
| 95 | - $serviceParameters = NULL, $collectionType = NULL) | 95 | + $serviceParameters = NULL, $collectionType = NULL, $accept = null) |
| 96 | { | 96 | { |
| 97 | $workspace = strtolower(trim($workspace)); | 97 | $workspace = strtolower(trim($workspace)); |
| 98 | $serviceName = strtolower(trim($serviceName)); | 98 | $serviceName = strtolower(trim($serviceName)); |
| 99 | 99 | ||
| 100 | $serviceRecord = array( | 100 | $serviceRecord = array( |
| 101 | - 'fileName' => $fileName, | ||
| 102 | - 'serviceClass' => $serviceClass, | ||
| 103 | - 'title' => $title, | ||
| 104 | - 'parameters' => $serviceParameters, | ||
| 105 | - 'collectionType' => $collectionType | 101 | + 'fileName' => $fileName, |
| 102 | + 'serviceClass' => $serviceClass, | ||
| 103 | + 'title' => $title, | ||
| 104 | + 'parameters' => $serviceParameters, | ||
| 105 | + 'collectionType' => $collectionType, | ||
| 106 | + 'accept' => $accept | ||
| 106 | ); | 107 | ); |
| 107 | 108 | ||
| 108 | $this->services[$workspace][$serviceName][] = $serviceRecord; | 109 | $this->services[$workspace][$serviceName][] = $serviceRecord; |
| @@ -119,23 +120,25 @@ class KT_cmis_atom_server extends KT_atom_server { | @@ -119,23 +120,25 @@ class KT_cmis_atom_server extends KT_atom_server { | ||
| 119 | return false; | 120 | return false; |
| 120 | } | 121 | } |
| 121 | 122 | ||
| 122 | - // TODO we probably want this version in the base class for auth purposes | ||
| 123 | - public function render() | ||
| 124 | - { | ||
| 125 | - ob_end_clean(); | ||
| 126 | - // possible additional headers, e.g. basic auth request | ||
| 127 | - // FIXME this won't work with the service document as no service object exists | ||
| 128 | - if (!is_null($this->serviceObject)) | ||
| 129 | - { | ||
| 130 | - $headers = $this->serviceObject->getHeaders(); | ||
| 131 | - foreach ($headers as $header) | ||
| 132 | - { | ||
| 133 | - header($header); | ||
| 134 | - } | ||
| 135 | - } | ||
| 136 | - header('Content-type: text/xml'); | ||
| 137 | - echo $this->output; | ||
| 138 | - } | 123 | +// // TODO we probably want this version in the base class for auth purposes |
| 124 | +// public function render() | ||
| 125 | +// { | ||
| 126 | +// ob_end_clean(); | ||
| 127 | +//// // possible additional headers, e.g. basic auth request | ||
| 128 | +//// // FIXME this won't work with the service document as no service object exists | ||
| 129 | +//// if (!is_null($this->serviceObject)) | ||
| 130 | +//// { | ||
| 131 | +//// $headers = $this->serviceObject->getHeaders(); | ||
| 132 | +//// foreach ($headers as $header) | ||
| 133 | +//// { | ||
| 134 | +//// header($header); | ||
| 135 | +//// } | ||
| 136 | +//// } | ||
| 137 | +// | ||
| 138 | +// // TODO header: application/atom+xml for service doc? is how Alfresco does it but is it needed? | ||
| 139 | +// header('Content-type: text/xml'); | ||
| 140 | +// echo $this->output; | ||
| 141 | +// } | ||
| 139 | 142 | ||
| 140 | } | 143 | } |
| 141 | 144 |
webservice/classes/atompub/cmis/KT_cmis_atom_serviceDoc.inc.php
| @@ -75,17 +75,20 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { | @@ -75,17 +75,20 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { | ||
| 75 | $service = $this->newElement('service'); | 75 | $service = $this->newElement('service'); |
| 76 | $service->appendChild($this->newAttr('xmlns', 'http://www.w3.org/2007/app')); | 76 | $service->appendChild($this->newAttr('xmlns', 'http://www.w3.org/2007/app')); |
| 77 | $service->appendChild($this->newAttr('xmlns:atom', 'http://www.w3.org/2005/Atom')); | 77 | $service->appendChild($this->newAttr('xmlns:atom', 'http://www.w3.org/2005/Atom')); |
| 78 | - $service->appendChild($this->newAttr('xmlns:cmis', 'http://www.cmis.org/2008/05')); | 78 | + $service->appendChild($this->newAttr('xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200901')); |
| 79 | $this->service =& $service; | 79 | $this->service =& $service; |
| 80 | $this->DOM->appendChild($this->service); | 80 | $this->DOM->appendChild($this->service); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | - public function &newCollection($url = NULL, $title = NULL, $cmisCollectionType = NULL, &$ws = NULL) | 83 | + public function &newCollection($url = NULL, $title = NULL, $cmisCollectionType = NULL, $accept = null, &$ws = NULL) |
| 84 | { | 84 | { |
| 85 | $collection=$this->newElement('collection'); | 85 | $collection=$this->newElement('collection'); |
| 86 | $collection->appendChild($this->newAttr('href', $url)); | 86 | $collection->appendChild($this->newAttr('href', $url)); |
| 87 | $collection->appendChild($this->newAttr('cmis:collectionType', $cmisCollectionType)); | 87 | $collection->appendChild($this->newAttr('cmis:collectionType', $cmisCollectionType)); |
| 88 | $collection->appendChild($this->newElement('atom:title', $title)); | 88 | $collection->appendChild($this->newElement('atom:title', $title)); |
| 89 | + if (!is_null($accept)) { | ||
| 90 | + $collection->appendChild($this->newElement('accept', $accept)); | ||
| 91 | + } | ||
| 89 | if(isset($ws))$ws->appendChild($collection); | 92 | if(isset($ws))$ws->appendChild($collection); |
| 90 | return $collection; | 93 | return $collection; |
| 91 | } | 94 | } |
webservice/classes/soap/IPPhpDoc.class.php
| 1 | -<?PHP | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * The base phpdoc class searches for available classes | ||
| 5 | - * | ||
| 6 | - *@author KnowledgeTree Team | ||
| 7 | - *@package Webservice | ||
| 8 | - *@version Version 0.9 | ||
| 9 | - */ | ||
| 10 | -class IPPhpDoc{ | ||
| 11 | - /** @var IPReflectionClass[] Array with available classes */ | ||
| 12 | - public $classes = array(); | ||
| 13 | - | ||
| 14 | - /** @var IPReflectionClass The current class */ | ||
| 15 | - public $class = ""; | ||
| 16 | - | ||
| 17 | - /** | ||
| 18 | - * Constructor, initiates the getClasses() method | ||
| 19 | - * | ||
| 20 | - * @return void | ||
| 21 | - */ | ||
| 22 | - function __construct() { | ||
| 23 | - $this->getClasses(); | ||
| 24 | - } | ||
| 25 | - | ||
| 26 | - /** Sets the current class | ||
| 27 | - * @param string The class name | ||
| 28 | - * @return void | ||
| 29 | - */ | ||
| 30 | - public function setClass($class) { | ||
| 31 | - $this->class = new IPReflectionClass($class); | ||
| 32 | - } | ||
| 33 | - /** | ||
| 34 | - * Get all classes | ||
| 35 | - * | ||
| 36 | - * @return IPReflectionClass[] | ||
| 37 | - */ | ||
| 38 | - function getClasses() { | ||
| 39 | - $ar = get_declared_classes(); | ||
| 40 | - foreach($ar as $class){ | ||
| 41 | - $c = new reflectionClass($class); | ||
| 42 | - if($c->isUserDefined()){//add only when class is user-defined | ||
| 43 | - $this->classes[$class] = new IPReflectionClass($class); | ||
| 44 | - } | ||
| 45 | - } | ||
| 46 | - ksort($this->classes); | ||
| 47 | - return $this->classes; | ||
| 48 | - } | ||
| 49 | - /** | ||
| 50 | - * Generates the documentation page with all classes, methods etc. | ||
| 51 | - * @TODO FIXME: use the new template class | ||
| 52 | - * @param string Template file (optional) | ||
| 53 | - * @return string | ||
| 54 | - */ | ||
| 55 | - public function getDocumentation($template="classes/soap/templates/docclass.xsl") { | ||
| 56 | - if(!is_file($template)) | ||
| 57 | - throw new WSException("Could not find the template file: '$template'"); | ||
| 58 | - $xtpl = new IPXSLTemplate($template); | ||
| 59 | - $documentation = Array(); | ||
| 60 | - $documentation['menu'] = Array(); | ||
| 61 | - //loop menu items | ||
| 62 | - $documentation['menu'] = $this->getClasses(); | ||
| 63 | - | ||
| 64 | - if($this->class){ | ||
| 65 | - if($this->class->isUserDefined()) { | ||
| 66 | - $this->class->properties = $this->class->getProperties(false, false); | ||
| 67 | - $this->class->methods = $this->class->getMethods(false, false); | ||
| 68 | - foreach((array)$this->class->methods as $method) { | ||
| 69 | - $method->params = $method->getParameters(); | ||
| 70 | - } | ||
| 71 | - } else { | ||
| 72 | - $documentation['fault'] = "Native class"; | ||
| 73 | - } | ||
| 74 | - $documentation['class'] = $this->class; | ||
| 75 | - } | ||
| 76 | - echo $xtpl->execute($documentation); | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - | ||
| 80 | - /** | ||
| 81 | - * | ||
| 82 | - * @param $comment String The doccomment | ||
| 83 | - * @param $annotationName String the annotation name | ||
| 84 | - * @param $annotationClass String the annotation class | ||
| 85 | - * @return void | ||
| 86 | - */ | ||
| 87 | - public static function getAnnotation($comment, $annotationName, $annotationClass = null){ | ||
| 88 | - if(!$annotationClass){ | ||
| 89 | - $annotationClass = $annotationName; | ||
| 90 | - } | ||
| 91 | - $start = 0; | ||
| 92 | - if($start = stripos($comment, "@".$annotationName)){ | ||
| 93 | - $obi = new $annotationClass(); | ||
| 94 | - $start = strpos($comment, "(", $start); | ||
| 95 | - $end = strpos($comment, ")", $start); | ||
| 96 | - $propString = substr($comment, $start, ($end-$start) + 1); | ||
| 97 | - $eval = "return Array$propString;"; | ||
| 98 | - $arr = @eval($eval); | ||
| 99 | - if($arr === false) throw new Exception("Error parsing annotation: $propString"); | ||
| 100 | - | ||
| 101 | - foreach ((Array)$arr as $name => $value){ | ||
| 102 | - $obi->$name= $value; | ||
| 103 | - } | ||
| 104 | - return $obi; | ||
| 105 | - } | ||
| 106 | - throw new Exception("Cannot find annotation @$annotationName ($start, $end): {$this->comment} "); | ||
| 107 | - } | ||
| 108 | - | ||
| 109 | -} | 1 | +<?PHP |
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * The base phpdoc class searches for available classes | ||
| 5 | + * | ||
| 6 | + *@author KnowledgeTree Team | ||
| 7 | + *@package Webservice | ||
| 8 | + *@version Version 0.9 | ||
| 9 | + */ | ||
| 10 | +class IPPhpDoc{ | ||
| 11 | + /** @var IPReflectionClass[] Array with available classes */ | ||
| 12 | + public $classes = array(); | ||
| 13 | + | ||
| 14 | + /** @var IPReflectionClass The current class */ | ||
| 15 | + public $class = ""; | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * Constructor, initiates the getClasses() method | ||
| 19 | + * | ||
| 20 | + * @return void | ||
| 21 | + */ | ||
| 22 | + function __construct() { | ||
| 23 | + $this->getClasses(); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + /** Sets the current class | ||
| 27 | + * @param string The class name | ||
| 28 | + * @return void | ||
| 29 | + */ | ||
| 30 | + public function setClass($class) { | ||
| 31 | + $this->class = new IPReflectionClass($class); | ||
| 32 | + } | ||
| 33 | + /** | ||
| 34 | + * Get all classes | ||
| 35 | + * | ||
| 36 | + * @return IPReflectionClass[] | ||
| 37 | + */ | ||
| 38 | + function getClasses() { | ||
| 39 | + $ar = get_declared_classes(); | ||
| 40 | + foreach($ar as $class){ | ||
| 41 | + $c = new reflectionClass($class); | ||
| 42 | + if($c->isUserDefined()){//add only when class is user-defined | ||
| 43 | + $this->classes[$class] = new IPReflectionClass($class); | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + ksort($this->classes); | ||
| 47 | + return $this->classes; | ||
| 48 | + } | ||
| 49 | + /** | ||
| 50 | + * Generates the documentation page with all classes, methods etc. | ||
| 51 | + * @TODO FIXME: use the new template class | ||
| 52 | + * @param string Template file (optional) | ||
| 53 | + * @return string | ||
| 54 | + */ | ||
| 55 | + public function getDocumentation($template="classes/soap/templates/docclass.xsl") { | ||
| 56 | + if(!is_file($template)) | ||
| 57 | + throw new WSException("Could not find the template file: '$template'"); | ||
| 58 | + $xtpl = new IPXSLTemplate($template); | ||
| 59 | + $documentation = Array(); | ||
| 60 | + $documentation['menu'] = Array(); | ||
| 61 | + //loop menu items | ||
| 62 | + $documentation['menu'] = $this->getClasses(); | ||
| 63 | + | ||
| 64 | + if($this->class){ | ||
| 65 | + if($this->class->isUserDefined()) { | ||
| 66 | + $this->class->properties = $this->class->getProperties(false, false); | ||
| 67 | + $this->class->methods = $this->class->getMethods(false, false); | ||
| 68 | + foreach((array)$this->class->methods as $method) { | ||
| 69 | + $method->params = $method->getParameters(); | ||
| 70 | + } | ||
| 71 | + } else { | ||
| 72 | + $documentation['fault'] = "Native class"; | ||
| 73 | + } | ||
| 74 | + $documentation['class'] = $this->class; | ||
| 75 | + } | ||
| 76 | + echo $xtpl->execute($documentation); | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * | ||
| 82 | + * @param $comment String The doccomment | ||
| 83 | + * @param $annotationName String the annotation name | ||
| 84 | + * @param $annotationClass String the annotation class | ||
| 85 | + * @return void | ||
| 86 | + */ | ||
| 87 | + public static function getAnnotation($comment, $annotationName, $annotationClass = null){ | ||
| 88 | + if(!$annotationClass){ | ||
| 89 | + $annotationClass = $annotationName; | ||
| 90 | + } | ||
| 91 | + $start = 0; | ||
| 92 | + if($start = stripos($comment, "@".$annotationName)){ | ||
| 93 | + $obi = new $annotationClass(); | ||
| 94 | + $start = strpos($comment, "(", $start); | ||
| 95 | + $end = strpos($comment, ")", $start); | ||
| 96 | + $propString = substr($comment, $start, ($end-$start) + 1); | ||
| 97 | + $eval = "return Array$propString;"; | ||
| 98 | + $arr = @eval($eval); | ||
| 99 | + if($arr === false) throw new Exception("Error parsing annotation: $propString"); | ||
| 100 | + | ||
| 101 | + foreach ((Array)$arr as $name => $value){ | ||
| 102 | + $obi->$name= $value; | ||
| 103 | + } | ||
| 104 | + return $obi; | ||
| 105 | + } | ||
| 106 | + throw new Exception("Cannot find annotation @$annotationName ($start, $end): {$this->comment} "); | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | +} | ||
| 110 | ?> | 110 | ?> |
| 111 | \ No newline at end of file | 111 | \ No newline at end of file |