Commit 315d6be74d45ae0b82c8938caacba0b6cc2f7f3e
1 parent
5c55eca3
removing unneeded files from git
Committed by: Paul Barrett
Showing
4 changed files
with
0 additions
and
338 deletions
webservice/atompub/cmis/NavigationService.inc.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -require_once KT_LIB_DIR . '/api/ktcmis/ktcmis.inc.php'; | |
| 4 | - | |
| 5 | -/** | |
| 6 | - * CMIS Service class which hooks into the KnowledgeTree interface | |
| 7 | - * for processing of CMIS queries and responses via atompub/webservices | |
| 8 | - */ | |
| 9 | - | |
| 10 | -class NavigationService extends KTNavigationService { | |
| 11 | - | |
| 12 | - /** | |
| 13 | - * Get descendents of the specified folder, up to the depth indicated | |
| 14 | - * | |
| 15 | - * @param string $repositoryId | |
| 16 | - * @param string $folderId | |
| 17 | - * @param boolean $includeAllowableActions | |
| 18 | - * @param boolean $includeRelationships | |
| 19 | - * @param string $typeID | |
| 20 | - * @param int $depth | |
| 21 | - * @param string $filter | |
| 22 | - * @return cmisObjectType[] | |
| 23 | - */ | |
| 24 | - public function getDescendants($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, | |
| 25 | - $depth = 1, $typeID = 'Any', $filter = '') | |
| 26 | - { | |
| 27 | - $result = parent::getDescendants($repositoryId, $folderId, $includeAllowableActions, | |
| 28 | - $includeRelationships, $depth, $typeID, $filter); | |
| 29 | - | |
| 30 | - if ($result['status_code'] == 0) | |
| 31 | - { | |
| 32 | - return $result['results']; | |
| 33 | - } | |
| 34 | - } | |
| 35 | - | |
| 36 | - /** | |
| 37 | - * Get direct children of the specified folder | |
| 38 | - * | |
| 39 | - * @param string $repositoryId | |
| 40 | - * @param string $folderId | |
| 41 | - * @param boolean $includeAllowableActions | |
| 42 | - * @param boolean $includeRelationships | |
| 43 | - * @param string $typeID | |
| 44 | - * @param string $filter | |
| 45 | - * @param int $maxItems | |
| 46 | - * @param int $skipCount | |
| 47 | - * @return cmisObjectType[] | |
| 48 | - */ | |
| 49 | - public function getChildren($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, | |
| 50 | - $typeID = 'Any', $filter = '', $maxItems = 0, $skipCount = 0) | |
| 51 | - { | |
| 52 | - $result = parent::getChildren($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, | |
| 53 | - $typeID, $filter, $maxItems, $skipCount); | |
| 54 | - | |
| 55 | - if ($result['status_code'] == 0) | |
| 56 | - { | |
| 57 | - return $result['results']; | |
| 58 | - } | |
| 59 | - } | |
| 60 | - | |
| 61 | - /** | |
| 62 | - * Gets the parent of the selected folder | |
| 63 | - * | |
| 64 | - * @param string $repositoryId | |
| 65 | - * @param string $folderId | |
| 66 | - * @param boolean $includeAllowableActions | |
| 67 | - * @param boolean $includeRelationships | |
| 68 | - * @param boolean $returnToRoot | |
| 69 | - * @param string $filter | |
| 70 | - * @return cmisObjectType[] | |
| 71 | - */ | |
| 72 | - public function getFolderParent($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, $returnToRoot, $filter = '') | |
| 73 | - { | |
| 74 | - $result = parent::getFolderParent($repositoryId, $folderId, $includeAllowableActions, $includeRelationships, $returnToRoot, $filter); | |
| 75 | - | |
| 76 | - if ($result['status_code'] == 0) | |
| 77 | - { | |
| 78 | - return $result['results']; | |
| 79 | - } | |
| 80 | - } | |
| 81 | - | |
| 82 | - /** | |
| 83 | - * Gets the parents for the selected object | |
| 84 | - * | |
| 85 | - * @param string $repositoryId | |
| 86 | - * @param string $folderId | |
| 87 | - * @param boolean $includeAllowableActions | |
| 88 | - * @param boolean $includeRelationships | |
| 89 | - * @param string $filter | |
| 90 | - * @return cmisObjectType[] | |
| 91 | - */ | |
| 92 | - public function getObjectParents($repositoryId, $objectId, $includeAllowableActions, $includeRelationships, $filter = '') | |
| 93 | - { | |
| 94 | - $result = parent::getObjectParents($repositoryId, $objectId, $includeAllowableActions, $includeRelationships, $filter); | |
| 95 | - | |
| 96 | - if ($result['status_code'] == 0) | |
| 97 | - { | |
| 98 | - return $result['results']; | |
| 99 | - } | |
| 100 | - } | |
| 101 | - | |
| 102 | - /** | |
| 103 | - * Returns a list of checked out documents from the selected repository | |
| 104 | - * | |
| 105 | - * @param string $repositoryId | |
| 106 | - * @param string $folderId The folder for which checked out docs are requested | |
| 107 | - * @param string $filter | |
| 108 | - * @param int $maxItems | |
| 109 | - * @param int $skipCount | |
| 110 | - * @return array $checkedout The collection of checked out documents | |
| 111 | - */ | |
| 112 | - function getCheckedoutDocs($repositoryId, $folderId = null, $filter = '', $maxItems = 0, $skipCount = 0) | |
| 113 | - { | |
| 114 | - $checkedout = parent::getObjectParents($repositoryId, $folderId, $filter, $maxItems, $skipCount); | |
| 115 | - | |
| 116 | - if ($result['status_code'] == 0) | |
| 117 | - { | |
| 118 | - return $result['results']; | |
| 119 | - } | |
| 120 | - } | |
| 121 | - | |
| 122 | -} | |
| 123 | - | |
| 124 | -?> |
webservice/atompub/cmis/ObjectFeed.inc.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -class CMISObjectFeed { | |
| 4 | - | |
| 5 | - /** | |
| 6 | - * Creates an AtomPub entry for a CMIS entry and adds it to the supplied feed | |
| 7 | - * | |
| 8 | - * @param object $feed The feed to which we add the entry | |
| 9 | - * @param array $cmisEntry The entry data | |
| 10 | - * @param string $parent The parent folder | |
| 11 | - */ | |
| 12 | - static public function createEntry(&$feed, $cmisEntry, $parent, $path) | |
| 13 | - { | |
| 14 | - preg_match('/^\/?cmis\/folder\/(.*)\/[^\/]*\/?$/', trim($_SERVER['QUERY_STRING'], '/'), $matches); | |
| 15 | - $path = $matches[1]; | |
| 16 | - $parent = preg_replace('/\/[^\/]*$/', '', $path); | |
| 17 | - | |
| 18 | - $entry = $feed->newEntry(); | |
| 19 | - $feed->newId('urn:uuid:' . $cmisEntry['properties']['Name']['value'] . '-' | |
| 20 | - . strtolower($cmisEntry['properties']['ObjectTypeId']['value']), $entry); | |
| 21 | - | |
| 22 | - /* | |
| 23 | -<link rel="edit" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c"/> | |
| 24 | -<link rel="cmis-allowableactions" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c/permissions"/> | |
| 25 | -<link rel="cmis-relationships" href="http://10.33.4.34:8080/alfresco/service/api/node/workspace/SpacesStore/e98319fa-76e4-478f-8ce8-a3a0fd683e2c/associations"/> | |
| 26 | - */ | |
| 27 | - | |
| 28 | - // links | |
| 29 | -// $link = $feed->newElement('link'); | |
| 30 | -// $link->appendChild($feed->newAttr('rel','self')); | |
| 31 | -// $link->appendChild($feed->newAttr('href', CMIS_BASE_URI . strtolower($cmisEntry['properties']['ObjectTypeId']['value']) | |
| 32 | -// . '/' . $cmisEntry['properties']['ObjectId']['value'])); | |
| 33 | -// $entry->appendChild($link); | |
| 34 | - $link = $feed->newElement('link'); | |
| 35 | - $link->appendChild($feed->newAttr('rel','cmis-parent')); | |
| 36 | - $link->appendChild($feed->newAttr('href', CMIS_BASE_URI . 'folder/' . $path)); | |
| 37 | - $entry->appendChild($link); | |
| 38 | - | |
| 39 | - if (strtolower($cmisEntry['properties']['ObjectTypeId']['value']) == 'folder') | |
| 40 | - { | |
| 41 | - $link = $feed->newElement('link'); | |
| 42 | - $link->appendChild($feed->newAttr('rel','cmis-folderparent')); | |
| 43 | - $link->appendChild($feed->newAttr('href', CMIS_BASE_URI . 'folder/' . $path)); | |
| 44 | - $entry->appendChild($link); | |
| 45 | - $link = $feed->newElement('link'); | |
| 46 | - $link->appendChild($feed->newAttr('rel','cmis-children')); | |
| 47 | - $link->appendChild($feed->newAttr('href', CMIS_BASE_URI | |
| 48 | - . strtolower($cmisEntry['properties']['ObjectTypeId']['value']) | |
| 49 | - . '/' . $path . '/' . urlencode($cmisEntry['properties']['Name']['value']) | |
| 50 | - . '/children')); | |
| 51 | - $entry->appendChild($link); | |
| 52 | - $link = $feed->newElement('link'); | |
| 53 | - $link->appendChild($feed->newAttr('rel','cmis-descendants')); | |
| 54 | - $link->appendChild($feed->newAttr('href', CMIS_BASE_URI | |
| 55 | - . strtolower($cmisEntry['properties']['ObjectTypeId']['value']) | |
| 56 | - . '/' . $path . '/' . urlencode($cmisEntry['properties']['Name']['value']) | |
| 57 | - . '/descendants')); | |
| 58 | - $entry->appendChild($link); | |
| 59 | - } | |
| 60 | - | |
| 61 | - $link = $feed->newElement('link'); | |
| 62 | - $link->appendChild($feed->newAttr('rel','cmis-type')); | |
| 63 | - $link->appendChild($feed->newAttr('href', CMIS_BASE_URI . 'type/' . strtolower($cmisEntry['properties']['ObjectTypeId']['value']))); | |
| 64 | - $entry->appendChild($link); | |
| 65 | - $link = $feed->newElement('link'); | |
| 66 | - $link->appendChild($feed->newAttr('rel','cmis-repository')); | |
| 67 | - $link->appendChild($feed->newAttr('href', CMIS_BASE_URI . 'repository')); | |
| 68 | - $entry->appendChild($link); | |
| 69 | - // end links | |
| 70 | - | |
| 71 | - $entry->appendChild($feed->newElement('summary', $cmisEntry['properties']['Name']['value'])); | |
| 72 | - $entry->appendChild($feed->newElement('title', $cmisEntry['properties']['Name']['value'])); | |
| 73 | - | |
| 74 | - // main CMIS entry | |
| 75 | - $objectElement = $feed->newElement('cmis:object'); | |
| 76 | - $propertiesElement = $feed->newElement('cmis:properties'); | |
| 77 | - | |
| 78 | - foreach($cmisEntry['properties'] as $propertyName => $property) | |
| 79 | - { | |
| 80 | - $propElement = $feed->newElement('cmis:' . $property['type']); | |
| 81 | - $propElement->appendChild($feed->newAttr('cmis:name', $propertyName)); | |
| 82 | - $feed->newField('value', CMISUtil::boolToString($property['value']), $propElement); | |
| 83 | - $propertiesElement->appendChild($propElement); | |
| 84 | - } | |
| 85 | - | |
| 86 | - $objectElement->appendChild($propertiesElement); | |
| 87 | - $entry->appendChild($objectElement); | |
| 88 | - } | |
| 89 | - | |
| 90 | -} | |
| 91 | - | |
| 92 | -?> |
webservice/atompub/cmis/ObjectService.inc.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -require_once KT_LIB_DIR . '/api/ktcmis/ktcmis.inc.php'; | |
| 4 | - | |
| 5 | -/** | |
| 6 | - * CMIS Service class which hooks into the KnowledgeTree interface | |
| 7 | - * for processing of CMIS queries and responses via atompub/webservices | |
| 8 | - */ | |
| 9 | - | |
| 10 | -class ObjectService extends KTObjectService { | |
| 11 | - | |
| 12 | - /** | |
| 13 | - * Fetches the properties for the specified object | |
| 14 | - * | |
| 15 | - * @param string $repositoryId | |
| 16 | - * @param string $objectId | |
| 17 | - * @param boolean $includeAllowableActions | |
| 18 | - * @param boolean $includeRelationships | |
| 19 | - * @param boolean $returnVersion | |
| 20 | - * @param string $filter | |
| 21 | - * @return object CMIS object properties | |
| 22 | - */ | |
| 23 | - public function getProperties($repositoryId, $objectId, $includeAllowableActions, $includeRelationships, | |
| 24 | - $returnVersion = false, $filter = '') | |
| 25 | - { | |
| 26 | - $result = parent::getProperties($repositoryId, $objectId, $includeAllowableActions, | |
| 27 | - $returnVersion, $filter); | |
| 28 | - | |
| 29 | - if ($result['status_code'] == 0) | |
| 30 | - { | |
| 31 | - return $result['results']; | |
| 32 | - } | |
| 33 | - } | |
| 34 | - | |
| 35 | -} | |
| 36 | - | |
| 37 | -?> |
webservice/atompub/cmis/RepositoryService.inc.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * CMIS Service class which hooks into the KnowledgeTree interface | |
| 5 | - * for processing of CMIS queries and responses via atompub/webservices | |
| 6 | - */ | |
| 7 | - | |
| 8 | -require_once KT_LIB_DIR . '/api/ktcmis/ktcmis.inc.php'; | |
| 9 | - | |
| 10 | -class RepositoryService extends KTRepositoryService { | |
| 11 | - | |
| 12 | - /** | |
| 13 | - * Fetches a list of available repositories | |
| 14 | - * | |
| 15 | - * @return cmisRepositoryEntryType[] | |
| 16 | - */ | |
| 17 | - public function getRepositories() | |
| 18 | - { | |
| 19 | - $result = parent::getRepositories(); | |
| 20 | - | |
| 21 | - if ($result['status_code'] == 0) | |
| 22 | - { | |
| 23 | - return $result['results']; | |
| 24 | - } | |
| 25 | - } | |
| 26 | - | |
| 27 | - /** | |
| 28 | - * Fetches information about the selected repository | |
| 29 | - * | |
| 30 | - * @param string $repositoryId | |
| 31 | - * @return cmisRepositoryInfoType | |
| 32 | - */ | |
| 33 | - public function getRepositoryInfo($repositoryId) | |
| 34 | - { | |
| 35 | - $result = parent::getRepositoryInfo($repositoryId); | |
| 36 | - | |
| 37 | - if ($result['status_code'] == 0) | |
| 38 | - { | |
| 39 | - return $result['results']; | |
| 40 | - } | |
| 41 | - } | |
| 42 | - | |
| 43 | - /** | |
| 44 | - * Fetch the list of supported object types for the selected repository | |
| 45 | - * | |
| 46 | - * @param string $repositoryId The ID of the repository for which object types must be returned | |
| 47 | - * @param string $typeId The type to return, ALL if not set | |
| 48 | - * @param boolean $returnPropertyDefinitions Return property definitions as well if TRUE | |
| 49 | - * @param int $maxItems The maximum number of items to return | |
| 50 | - * @param int $skipCount The number of items to skip before starting to return results | |
| 51 | - * @param boolean $hasMoreItems TRUE if there are more items to return than were requested | |
| 52 | - * @return cmisTypeDefinitionType[] | |
| 53 | - */ | |
| 54 | - public function getTypes($repositoryId, $typeId = '', $returnPropertyDefinitions = false, | |
| 55 | - $maxItems = 0, $skipCount = 0, &$hasMoreItems = false) | |
| 56 | - { | |
| 57 | - $result = parent::getTypes($repositoryId, $typeId, $returnPropertyDefinitions, | |
| 58 | - $maxItems, $skipCount, $hasMoreItems); | |
| 59 | - | |
| 60 | - if ($result['status_code'] == 0) | |
| 61 | - { | |
| 62 | - return $result['results']; | |
| 63 | - } | |
| 64 | - } | |
| 65 | - | |
| 66 | - /** | |
| 67 | - * Fetch the object type definition for the requested type | |
| 68 | - * | |
| 69 | - * @param string $repositoryId | |
| 70 | - * @param string $typeId | |
| 71 | - * @return cmisTypeDefinitionType | |
| 72 | - */ | |
| 73 | - public function getTypeDefinition($repositoryId, $typeId) | |
| 74 | - { | |
| 75 | - $result = parent::getTypeDefinition($repositoryId, $typeId); | |
| 76 | - | |
| 77 | - if ($result['status_code'] == 0) | |
| 78 | - { | |
| 79 | - return $result['results']; | |
| 80 | - } | |
| 81 | - } | |
| 82 | - | |
| 83 | -} | |
| 84 | - | |
| 85 | -?> |