Commit 5f1bd74f87d84ae9d507edaa0c1df7e58f02a221
Merge branch 'edge' of github.com:ktgit/knowledgetree into edge
Showing
6 changed files
with
92 additions
and
112 deletions
lib/api/ktcmis/classes/CMISRepositoryCapabilities.inc.php
| @@ -46,20 +46,34 @@ | @@ -46,20 +46,34 @@ | ||
| 46 | */ | 46 | */ |
| 47 | 47 | ||
| 48 | class CMISRepositoryCapabilities { | 48 | class CMISRepositoryCapabilities { |
| 49 | - | ||
| 50 | - // boolean values | ||
| 51 | - protected $capabilityMultifiling; | ||
| 52 | - protected $capabilityUnfiling; | ||
| 53 | - protected $capabilityVersionSpecificFiling; | ||
| 54 | - protected $capabilityPWCUpdateable; | ||
| 55 | - protected $capabilityPWCSearchable; | ||
| 56 | - protected $capabilityAllVersionsSearchable; | ||
| 57 | - | ||
| 58 | - // non-boolean values | ||
| 59 | - // TODO these should be defined as classes/enums which will only accept the defined values when set | ||
| 60 | - protected $capabilityQuery; | ||
| 61 | - protected $capabilityFullText; | ||
| 62 | - protected $capabilityJoin; | 49 | + |
| 50 | + // TODO we need an enum equivalent class which can be used to define acceptable values for all which are not boolean | ||
| 51 | + | ||
| 52 | + // navigation capabilities | ||
| 53 | + protected $capabilityGetDescendants; // true/false | ||
| 54 | + protected $capabilityGetFolderTree; // true/false | ||
| 55 | + | ||
| 56 | + // object capabilities | ||
| 57 | + protected $capabilityContentStreamUpdatability; // none/anytime/pwconly | ||
| 58 | + protected $capabilityChanges; // none/objectidsonly/properties/all | ||
| 59 | + protected $capabilityRenditions; // none/read | ||
| 60 | + | ||
| 61 | + // filing capabilities | ||
| 62 | + protected $capabilityMultifiling; // true/false | ||
| 63 | + protected $capabilityUnfiling; // true/false | ||
| 64 | + protected $capabilityVersionSpecificFiling; // true/false | ||
| 65 | + | ||
| 66 | + // versioning capabilities | ||
| 67 | + protected $capabilityPWCUpdateable; // true/false | ||
| 68 | + protected $capabilityPWCSearchable; // true/false | ||
| 69 | + protected $capabilityAllVersionsSearchable; // true/false | ||
| 70 | + | ||
| 71 | + // query capabilities | ||
| 72 | + protected $capabilityQuery; // none/metadataonly/fulltextonly/bothseparate/bothcombined | ||
| 73 | + protected $capabilityJoin; // none/inneronly/innerandouter | ||
| 74 | + | ||
| 75 | + // acl capabilities | ||
| 76 | + protected $capabilityACL; // none/discover/manage | ||
| 63 | 77 | ||
| 64 | /** | 78 | /** |
| 65 | * Set a single field value | 79 | * Set a single field value |
| @@ -67,90 +81,105 @@ class CMISRepositoryCapabilities { | @@ -67,90 +81,105 @@ class CMISRepositoryCapabilities { | ||
| 67 | * @param string $field | 81 | * @param string $field |
| 68 | * @param string/int $value | 82 | * @param string/int $value |
| 69 | * @return a collection of repository entries | 83 | * @return a collection of repository entries |
| 84 | + * | ||
| 85 | + * TODO when we have the enum class in place we will need to check whether the value is of type enum and call its set function | ||
| 86 | + * to ensure that the rules are followed | ||
| 70 | */ | 87 | */ |
| 71 | function setFieldValue($field, $value) | 88 | function setFieldValue($field, $value) |
| 72 | { | 89 | { |
| 73 | $this->{$field} = ($value == 'true' ? true : ($value == 'false' ? false : $value)); | 90 | $this->{$field} = ($value == 'true' ? true : ($value == 'false' ? false : $value)); |
| 74 | } | 91 | } |
| 75 | - | 92 | + |
| 76 | /** | 93 | /** |
| 77 | * Gets the value of the capabilityMultifiling property. | 94 | * Gets the value of the capabilityMultifiling property. |
| 78 | * | 95 | * |
| 79 | */ | 96 | */ |
| 80 | - public function hasCapabilityMultifiling() { | ||
| 81 | - return $this->capabilityMultifiling; | 97 | + public function hasCapabilityGetDescendants() { |
| 98 | + return $this->capabilityGetDescendants; | ||
| 82 | } | 99 | } |
| 83 | - | 100 | + |
| 84 | /** | 101 | /** |
| 85 | - * Sets the value of the capabilityMultifiling property. | 102 | + * Gets the value of the capabilityMultifiling property. |
| 86 | * | 103 | * |
| 87 | */ | 104 | */ |
| 88 | - public function setCapabilityMultifiling($value) { | ||
| 89 | - $this->capabilityMultifiling = $value; | 105 | + public function hasCapabilityGetFolderTree() { |
| 106 | + return $this->capabilityGetFolderTree; | ||
| 90 | } | 107 | } |
| 91 | - | 108 | + |
| 92 | /** | 109 | /** |
| 93 | - * Gets the value of the capabilityUnfiling property. | 110 | + * Gets the value of the capabilityContentStreamUpdatability property. |
| 111 | + * | ||
| 112 | + * @return | ||
| 113 | + * possible object is | ||
| 114 | + * {@link EnumCapabilityContentStreamUpdatability } | ||
| 94 | * | 115 | * |
| 95 | */ | 116 | */ |
| 96 | - public function hasCapabilityUnfiling() { | ||
| 97 | - return $this->capabilityUnfiling; | 117 | + public function getCapabilityContentStreamUpdatability() { |
| 118 | + return $this->capabilityContentStreamUpdatability; | ||
| 98 | } | 119 | } |
| 99 | - | 120 | + |
| 100 | /** | 121 | /** |
| 101 | - * Sets the value of the capabilityUnfiling property. | 122 | + * Gets the value of the capabilityChanges property. |
| 123 | + * | ||
| 124 | + * @return | ||
| 125 | + * possible object is | ||
| 126 | + * {@link EnumCapabilityChanges } | ||
| 102 | * | 127 | * |
| 103 | */ | 128 | */ |
| 104 | - public function setCapabilityUnfiling($value) { | ||
| 105 | - $this->capabilityUnfiling = $value; | 129 | + public function getCapabilityChanges() { |
| 130 | + return $this->capabilityChanges; | ||
| 106 | } | 131 | } |
| 107 | - | 132 | + |
| 108 | /** | 133 | /** |
| 109 | - * Gets the value of the capabilityVersionSpecificFiling property. | 134 | + * Gets the value of the capabilityRenditions property. |
| 135 | + * | ||
| 136 | + * @return | ||
| 137 | + * possible object is | ||
| 138 | + * {@link EnumCapabilityRenditions } | ||
| 110 | * | 139 | * |
| 111 | */ | 140 | */ |
| 112 | - public function hasCapabilityVersionSpecificFiling() { | ||
| 113 | - return $this->capabilityVersionSpecificFiling; | 141 | + public function getCapabilityRenditions() { |
| 142 | + return $this->capabilityRenditions; | ||
| 114 | } | 143 | } |
| 115 | - | 144 | + |
| 116 | /** | 145 | /** |
| 117 | - * Sets the value of the capabilityVersionSpecificFiling property. | 146 | + * Gets the value of the capabilityMultifiling property. |
| 118 | * | 147 | * |
| 119 | */ | 148 | */ |
| 120 | - public function setCapabilityVersionSpecificFiling($value) { | ||
| 121 | - $this->capabilityVersionSpecificFiling = $value; | 149 | + public function hasCapabilityMultifiling() { |
| 150 | + return $this->capabilityMultifiling; | ||
| 122 | } | 151 | } |
| 123 | 152 | ||
| 124 | /** | 153 | /** |
| 125 | - * Gets the value of the capabilityPWCUpdateable property. | 154 | + * Gets the value of the capabilityUnfiling property. |
| 126 | * | 155 | * |
| 127 | */ | 156 | */ |
| 128 | - public function hasCapabilityPWCUpdateable() { | ||
| 129 | - return $this->capabilityPWCUpdateable; | 157 | + public function hasCapabilityUnfiling() { |
| 158 | + return $this->capabilityUnfiling; | ||
| 130 | } | 159 | } |
| 131 | - | 160 | + |
| 132 | /** | 161 | /** |
| 133 | - * Sets the value of the capabilityPWCUpdateable property. | 162 | + * Gets the value of the capabilityVersionSpecificFiling property. |
| 134 | * | 163 | * |
| 135 | */ | 164 | */ |
| 136 | - public function setCapabilityPWCUpdateable($value) { | ||
| 137 | - $this->capabilityPWCUpdateable = $value; | 165 | + public function hasCapabilityVersionSpecificFiling() { |
| 166 | + return $this->capabilityVersionSpecificFiling; | ||
| 138 | } | 167 | } |
| 139 | 168 | ||
| 140 | /** | 169 | /** |
| 141 | - * Gets the value of the capabilityPWCSearchable property. | 170 | + * Gets the value of the capabilityPWCUpdateable property. |
| 142 | * | 171 | * |
| 143 | */ | 172 | */ |
| 144 | - public function hasCapabilityPWCSearchable() { | ||
| 145 | - return $this->capabilityPWCSearchable; | 173 | + public function hasCapabilityPWCUpdateable() { |
| 174 | + return $this->capabilityPWCUpdateable; | ||
| 146 | } | 175 | } |
| 147 | 176 | ||
| 148 | /** | 177 | /** |
| 149 | - * Sets the value of the capabilityPWCSearchable property. | 178 | + * Gets the value of the capabilityPWCSearchable property. |
| 150 | * | 179 | * |
| 151 | */ | 180 | */ |
| 152 | - public function setCapabilityPWCSearchable($value) { | ||
| 153 | - $this->capabilityPWCSearchable = $value; | 181 | + public function hasCapabilityPWCSearchable() { |
| 182 | + return $this->capabilityPWCSearchable; | ||
| 154 | } | 183 | } |
| 155 | 184 | ||
| 156 | /** | 185 | /** |
| @@ -160,15 +189,7 @@ class CMISRepositoryCapabilities { | @@ -160,15 +189,7 @@ class CMISRepositoryCapabilities { | ||
| 160 | public function hasCapabilityAllVersionsSearchable() { | 189 | public function hasCapabilityAllVersionsSearchable() { |
| 161 | return $this->capabilityAllVersionsSearchable; | 190 | return $this->capabilityAllVersionsSearchable; |
| 162 | } | 191 | } |
| 163 | - | ||
| 164 | - /** | ||
| 165 | - * Sets the value of the capabilityAllVersionsSearchable property. | ||
| 166 | - * | ||
| 167 | - */ | ||
| 168 | - public function setCapabilityAllVersionsSearchable($value) { | ||
| 169 | - $this->capabilityAllVersionsSearchable = $value; | ||
| 170 | - } | ||
| 171 | - | 192 | + |
| 172 | /** | 193 | /** |
| 173 | * Gets the value of the capabilityQuery property. | 194 | * Gets the value of the capabilityQuery property. |
| 174 | * | 195 | * |
| @@ -182,18 +203,6 @@ class CMISRepositoryCapabilities { | @@ -182,18 +203,6 @@ class CMISRepositoryCapabilities { | ||
| 182 | } | 203 | } |
| 183 | 204 | ||
| 184 | /** | 205 | /** |
| 185 | - * Sets the value of the capabilityQuery property. | ||
| 186 | - * | ||
| 187 | - * @param value | ||
| 188 | - * allowed object is | ||
| 189 | - * {@link EnumCapabilityQuery } | ||
| 190 | - * | ||
| 191 | - */ | ||
| 192 | - public function setCapabilityQuery($value) { | ||
| 193 | - $this->capabilityQuery = $value; | ||
| 194 | - } | ||
| 195 | - | ||
| 196 | - /** | ||
| 197 | * Gets the value of the capabilityJoin property. | 206 | * Gets the value of the capabilityJoin property. |
| 198 | * | 207 | * |
| 199 | * @return | 208 | * @return |
| @@ -206,39 +215,15 @@ class CMISRepositoryCapabilities { | @@ -206,39 +215,15 @@ class CMISRepositoryCapabilities { | ||
| 206 | } | 215 | } |
| 207 | 216 | ||
| 208 | /** | 217 | /** |
| 209 | - * Sets the value of the capabilityJoin property. | ||
| 210 | - * | ||
| 211 | - * @param value | ||
| 212 | - * allowed object is | ||
| 213 | - * {@link EnumCapabilityJoin } | ||
| 214 | - * | ||
| 215 | - */ | ||
| 216 | - public function setCapabilityJoin($value) { | ||
| 217 | - $this->capabilityJoin = $value; | ||
| 218 | - } | ||
| 219 | - | ||
| 220 | - /** | ||
| 221 | - * Gets the value of the capabilityFullText property. | 218 | + * Gets the value of the capabilityACL property. |
| 222 | * | 219 | * |
| 223 | * @return | 220 | * @return |
| 224 | * possible object is | 221 | * possible object is |
| 225 | - * {@link EnumCapabilityFullText } | ||
| 226 | - * | ||
| 227 | - */ | ||
| 228 | - public function getCapabilityFullText() { | ||
| 229 | - return $this->capabilityFullText; | ||
| 230 | - } | ||
| 231 | - | ||
| 232 | - /** | ||
| 233 | - * Sets the value of the capabilityFullText property. | ||
| 234 | - * | ||
| 235 | - * @param value | ||
| 236 | - * allowed object is | ||
| 237 | - * {@link EnumCapabilityFullText } | 222 | + * {@link EnumCapabilityACL } |
| 238 | * | 223 | * |
| 239 | */ | 224 | */ |
| 240 | - public function setCapabilityFullText($value) { | ||
| 241 | - $this->capabilityFullText = $value; | 225 | + public function getCapabilityACL() { |
| 226 | + return $this->capabilityACL; | ||
| 242 | } | 227 | } |
| 243 | 228 | ||
| 244 | // /** | 229 | // /** |
lib/api/ktcmis/config/repositories.xml
| @@ -40,9 +40,9 @@ | @@ -40,9 +40,9 @@ | ||
| 40 | <capabilityPWCUpdateable>false</capabilityPWCUpdateable> | 40 | <capabilityPWCUpdateable>false</capabilityPWCUpdateable> |
| 41 | <capabilityPWCSearchable>false</capabilityPWCSearchable> | 41 | <capabilityPWCSearchable>false</capabilityPWCSearchable> |
| 42 | <capabilityAllVersionsSearchable>false</capabilityAllVersionsSearchable> | 42 | <capabilityAllVersionsSearchable>false</capabilityAllVersionsSearchable> |
| 43 | - <capabilityQuery>None</capabilityQuery> | ||
| 44 | - <capabilityJoin>NoJoin</capabilityJoin> | ||
| 45 | - <capabilityACL>none</capabilityACL> | 43 | + <capabilityQuery>none</capabilityQuery> |
| 44 | + <capabilityJoin>none</capabilityJoin> | ||
| 45 | + <capabilityACL>none</capabilityACL> | ||
| 46 | </repositoryCapabilities> | 46 | </repositoryCapabilities> |
| 47 | <supportedTypes> | 47 | <supportedTypes> |
| 48 | <objectType>Document</objectType> | 48 | <objectType>Document</objectType> |
webservice/classes/atompub/cmis/KT_cmis_atom_response.inc.php
webservice/classes/atompub/cmis/KT_cmis_atom_responseFeed.inc.php
webservice/classes/atompub/cmis/KT_cmis_atom_server.inc.php
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | include_once(KT_ATOM_LIB_FOLDER . 'KT_atom_server.inc.php'); | 3 | include_once(KT_ATOM_LIB_FOLDER . 'KT_atom_server.inc.php'); |
| 4 | -include_once('RepositoryService.inc.php'); | 4 | +require_once('RepositoryService.inc.php'); |
| 5 | 5 | ||
| 6 | class KT_cmis_atom_server extends KT_atom_server { | 6 | class KT_cmis_atom_server extends KT_atom_server { |
| 7 | 7 | ||
| @@ -45,7 +45,6 @@ class KT_cmis_atom_server extends KT_atom_server { | @@ -45,7 +45,6 @@ class KT_cmis_atom_server extends KT_atom_server { | ||
| 45 | $workspace = strtolower(trim($queryArray[0])); | 45 | $workspace = strtolower(trim($queryArray[0])); |
| 46 | if ($workspace == 'servicedocument') | 46 | if ($workspace == 'servicedocument') |
| 47 | { | 47 | { |
| 48 | - include 'services/cmis/RepositoryService.inc.php'; | ||
| 49 | $RepositoryService = new RepositoryService(); | 48 | $RepositoryService = new RepositoryService(); |
| 50 | 49 | ||
| 51 | // fetch data for response | 50 | // fetch data for response |
webservice/classes/atompub/cmis/KT_cmis_atom_serviceDoc.inc.php
| @@ -43,11 +43,11 @@ | @@ -43,11 +43,11 @@ | ||
| 43 | * Includes | 43 | * Includes |
| 44 | */ | 44 | */ |
| 45 | include_once(KT_ATOM_LIB_FOLDER.'KT_atom_serviceDoc.inc.php'); | 45 | include_once(KT_ATOM_LIB_FOLDER.'KT_atom_serviceDoc.inc.php'); |
| 46 | -//include_once('KT_atom_baseDoc.inc.php'); | 46 | +require_once('RepositoryService.inc.php'); |
| 47 | 47 | ||
| 48 | class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { | 48 | class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { |
| 49 | 49 | ||
| 50 | -// override and extend as needed | 50 | + // override and extend as needed |
| 51 | 51 | ||
| 52 | public $repositoryInfo = array(); | 52 | public $repositoryInfo = array(); |
| 53 | 53 | ||
| @@ -58,11 +58,7 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { | @@ -58,11 +58,7 @@ class KT_cmis_atom_serviceDoc extends KT_atom_serviceDoc { | ||
| 58 | // get repositoryInfo | 58 | // get repositoryInfo |
| 59 | // NOTE currently we only support one repository, which will be the first one found in the repositories.xml config | 59 | // NOTE currently we only support one repository, which will be the first one found in the repositories.xml config |
| 60 | // TODO multiple repositories as individual workspaces | 60 | // TODO multiple repositories as individual workspaces |
| 61 | - | ||
| 62 | - include 'services/cmis/RepositoryService.inc.php'; | ||
| 63 | $RepositoryService = new RepositoryService(); | 61 | $RepositoryService = new RepositoryService(); |
| 64 | - // TODO add auth requirement here, don't want to even supply service doc without auth | ||
| 65 | -// $RepositoryService->startSession(); | ||
| 66 | 62 | ||
| 67 | // fetch data for response | 63 | // fetch data for response |
| 68 | $repositories = $RepositoryService->getRepositories(); | 64 | $repositories = $RepositoryService->getRepositories(); |