@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | use EWW\Dpf\Domain\Repository\ClientRepository; |
| 23 | 23 | use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; |
| 24 | 24 | |
| 25 | -class ClientConfigurationManager |
|
| 26 | -{ |
|
| 25 | +class ClientConfigurationManager { |
|
| 27 | 26 | /** |
| 28 | 27 | * settings |
| 29 | 28 | * |
@@ -46,8 +45,7 @@ discard block |
||
| 46 | 45 | */ |
| 47 | 46 | protected $extensionConfiguration = array(); |
| 48 | 47 | |
| 49 | - public function __construct() |
|
| 50 | - { |
|
| 48 | + public function __construct() { |
|
| 51 | 49 | $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 52 | 50 | $clientRepository = $objectManager->get(ClientRepository::class); |
| 53 | 51 | |
@@ -77,8 +75,7 @@ discard block |
||
| 77 | 75 | |
| 78 | 76 | } |
| 79 | 77 | |
| 80 | - public function setConfigurationPid($pid) |
|
| 81 | - { |
|
| 78 | + public function setConfigurationPid($pid) { |
|
| 82 | 79 | $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 83 | 80 | $clientRepository = $objectManager->get(ClientRepository::class); |
| 84 | 81 | |
@@ -88,8 +85,7 @@ discard block |
||
| 88 | 85 | /** |
| 89 | 86 | * @return int|null |
| 90 | 87 | */ |
| 91 | - public function getClientPid() |
|
| 92 | - { |
|
| 88 | + public function getClientPid() { |
|
| 93 | 89 | return $this->client->getPid(); |
| 94 | 90 | } |
| 95 | 91 | |
@@ -98,8 +94,7 @@ discard block |
||
| 98 | 94 | * |
| 99 | 95 | * @var array |
| 100 | 96 | */ |
| 101 | - public function getSetting($settingName, $extConfig = null) |
|
| 102 | - { |
|
| 97 | + public function getSetting($settingName, $extConfig = null) { |
|
| 103 | 98 | $setting = null; |
| 104 | 99 | if ($this->client) { |
| 105 | 100 | $setting = trim($this->client->{"get" . ucfirst($settingName)}()); |
@@ -114,270 +109,217 @@ discard block |
||
| 114 | 109 | } |
| 115 | 110 | |
| 116 | 111 | |
| 117 | - public function getOwnerId() |
|
| 118 | - { |
|
| 112 | + public function getOwnerId() { |
|
| 119 | 113 | return $this->getSetting("ownerId"); |
| 120 | 114 | } |
| 121 | 115 | |
| 122 | - public function getSwordHost() |
|
| 123 | - { |
|
| 116 | + public function getSwordHost() { |
|
| 124 | 117 | return $this->getSetting("swordHost", "swordHost"); |
| 125 | 118 | } |
| 126 | 119 | |
| 127 | - public function getSwordUser() |
|
| 128 | - { |
|
| 120 | + public function getSwordUser() { |
|
| 129 | 121 | return $this->getSetting("swordUser", "swordUser"); |
| 130 | 122 | } |
| 131 | 123 | |
| 132 | - public function getSwordPassword() |
|
| 133 | - { |
|
| 124 | + public function getSwordPassword() { |
|
| 134 | 125 | return $this->getSetting("swordPassword", "swordPassword"); |
| 135 | 126 | } |
| 136 | 127 | |
| 137 | - public function getSwordCollectionNamespace() |
|
| 138 | - { |
|
| 128 | + public function getSwordCollectionNamespace() { |
|
| 139 | 129 | return $this->getSetting("swordCollectionNamespace", "swordCollectionNamespace"); |
| 140 | 130 | } |
| 141 | 131 | |
| 142 | - public function getFedoraHost() |
|
| 143 | - { |
|
| 132 | + public function getFedoraHost() { |
|
| 144 | 133 | return $this->getSetting("fedoraHost", "fedoraHost"); |
| 145 | 134 | } |
| 146 | 135 | |
| 147 | - public function getFedoraUser() |
|
| 148 | - { |
|
| 136 | + public function getFedoraUser() { |
|
| 149 | 137 | return $this->getSetting("fedoraUser", "fedoraUser"); |
| 150 | 138 | } |
| 151 | 139 | |
| 152 | - public function getFedoraPassword() |
|
| 153 | - { |
|
| 140 | + public function getFedoraPassword() { |
|
| 154 | 141 | return $this->getSetting("fedoraPassword", "fedoraPassword"); |
| 155 | 142 | } |
| 156 | 143 | |
| 157 | - public function getElasticSearchHost() |
|
| 158 | - { |
|
| 144 | + public function getElasticSearchHost() { |
|
| 159 | 145 | return $this->getSetting("elasticSearchHost", "elasticSearchHost"); |
| 160 | 146 | } |
| 161 | 147 | |
| 162 | - public function getElasticSearchPort() |
|
| 163 | - { |
|
| 148 | + public function getElasticSearchPort() { |
|
| 164 | 149 | return $this->getSetting("elasticSearchPort", "elasticSearchPort"); |
| 165 | 150 | } |
| 166 | 151 | |
| 167 | - public function getElasticSearchIndexName() |
|
| 168 | - { |
|
| 152 | + public function getElasticSearchIndexName() { |
|
| 169 | 153 | return $this->getSetting("elasticSearchIndexName", "elasticSearchIndexName"); |
| 170 | 154 | } |
| 171 | 155 | |
| 172 | - public function getUploadDirectory() |
|
| 173 | - { |
|
| 156 | + public function getUploadDirectory() { |
|
| 174 | 157 | return $this->getSetting("uploadDirectory", "uploadDirectory"); |
| 175 | 158 | } |
| 176 | 159 | |
| 177 | - public function getUploadDomain() |
|
| 178 | - { |
|
| 160 | + public function getUploadDomain() { |
|
| 179 | 161 | return $this->getSetting("uploadDomain", "uploadDomain"); |
| 180 | 162 | } |
| 181 | 163 | |
| 182 | - public function getSuggestionFlashMessage() |
|
| 183 | - { |
|
| 164 | + public function getSuggestionFlashMessage() { |
|
| 184 | 165 | return $this->getSetting("suggestionFlashmessage", "suggestionFlashmessage"); |
| 185 | 166 | } |
| 186 | 167 | |
| 187 | - public function getFileXpath() |
|
| 188 | - { |
|
| 168 | + public function getFileXpath() { |
|
| 189 | 169 | return $this->getSetting("fileXpath", "fileXpath"); |
| 190 | 170 | } |
| 191 | 171 | |
| 192 | - public function getStateXpath() |
|
| 193 | - { |
|
| 172 | + public function getStateXpath() { |
|
| 194 | 173 | return $this->getSetting("stateXpath", "stateXpath"); |
| 195 | 174 | } |
| 196 | 175 | |
| 197 | - public function getTypeXpath() |
|
| 198 | - { |
|
| 176 | + public function getTypeXpath() { |
|
| 199 | 177 | return $this->getSetting("typeXpath", "typeXpath"); |
| 200 | 178 | } |
| 201 | 179 | |
| 202 | - public function getTypeXpathInput() |
|
| 203 | - { |
|
| 180 | + public function getTypeXpathInput() { |
|
| 204 | 181 | return $this->getSetting("typeXpathInput", "typeXpathInput"); |
| 205 | 182 | } |
| 206 | 183 | |
| 207 | - public function getUrnXpath() |
|
| 208 | - { |
|
| 184 | + public function getUrnXpath() { |
|
| 209 | 185 | return $this->getSetting("urnXpath", "urnXpath"); |
| 210 | 186 | } |
| 211 | 187 | |
| 212 | - public function getPrimaryUrnXpath() |
|
| 213 | - { |
|
| 188 | + public function getPrimaryUrnXpath() { |
|
| 214 | 189 | return $this->getSetting("primaryUrnXpath", "primaryUrnXpath"); |
| 215 | 190 | } |
| 216 | 191 | |
| 217 | - public function getDateXpath() |
|
| 218 | - { |
|
| 192 | + public function getDateXpath() { |
|
| 219 | 193 | return $this->getSetting("dateXpath", "dateXpath"); |
| 220 | 194 | } |
| 221 | 195 | |
| 222 | - public function getPublishingYearXpath() |
|
| 223 | - { |
|
| 196 | + public function getPublishingYearXpath() { |
|
| 224 | 197 | return $this->getSetting("publishingYearXpath", "publishingYearXpath"); |
| 225 | 198 | } |
| 226 | 199 | |
| 227 | - public function getNamespaces() |
|
| 228 | - { |
|
| 200 | + public function getNamespaces() { |
|
| 229 | 201 | return $this->getSetting("namespaces", "namespaces"); |
| 230 | 202 | } |
| 231 | 203 | |
| 232 | - public function getTitleXpath() |
|
| 233 | - { |
|
| 204 | + public function getTitleXpath() { |
|
| 234 | 205 | return $this->getSetting("titleXpath", "titleXpath"); |
| 235 | 206 | } |
| 236 | 207 | |
| 237 | - public function getOriginalSourceTitleXpath() |
|
| 238 | - { |
|
| 208 | + public function getOriginalSourceTitleXpath() { |
|
| 239 | 209 | return $this->getSetting("originalSourceTitleXpath", "originalSourceTitleXpath"); |
| 240 | 210 | } |
| 241 | 211 | |
| 242 | - public function getProcessNumberXpath() |
|
| 243 | - { |
|
| 212 | + public function getProcessNumberXpath() { |
|
| 244 | 213 | return $this->getSetting("processnumberXpath", "processnumberXpath"); |
| 245 | 214 | } |
| 246 | 215 | |
| 247 | - public function getSubmitterNameXpath() |
|
| 248 | - { |
|
| 216 | + public function getSubmitterNameXpath() { |
|
| 249 | 217 | return $this->getSetting("submitterNameXpath", "submitterNameXpath"); |
| 250 | 218 | } |
| 251 | 219 | |
| 252 | - public function getSubmitterEmailXpath() |
|
| 253 | - { |
|
| 220 | + public function getSubmitterEmailXpath() { |
|
| 254 | 221 | return $this->getSetting("submitterEmailXpath", "submitterEmailXpath"); |
| 255 | 222 | } |
| 256 | 223 | |
| 257 | - public function getSubmitterNoticeXpath() |
|
| 258 | - { |
|
| 224 | + public function getSubmitterNoticeXpath() { |
|
| 259 | 225 | return $this->getSetting("submitterNoticeXpath", "submitterNoticeXpath"); |
| 260 | 226 | } |
| 261 | 227 | |
| 262 | - public function getCreatorXpath() |
|
| 263 | - { |
|
| 228 | + public function getCreatorXpath() { |
|
| 264 | 229 | return $this->getSetting("creatorXpath", "creatorXpath"); |
| 265 | 230 | } |
| 266 | 231 | |
| 267 | - public function getCreationDateXpath() |
|
| 268 | - { |
|
| 232 | + public function getCreationDateXpath() { |
|
| 269 | 233 | return $this->getSetting("creationDateXpath", "creationDateXpath"); |
| 270 | 234 | } |
| 271 | 235 | |
| 272 | - public function getRepositoryCreationDateXpath() |
|
| 273 | - { |
|
| 236 | + public function getRepositoryCreationDateXpath() { |
|
| 274 | 237 | return $this->getSetting("repositoryCreationDateXpath", "repositoryCreationDateXpath"); |
| 275 | 238 | } |
| 276 | 239 | |
| 277 | - public function getRepositoryLastModDateXpath() |
|
| 278 | - { |
|
| 240 | + public function getRepositoryLastModDateXpath() { |
|
| 279 | 241 | return $this->getSetting("repositoryLastModDateXpath", "repositoryLastModDateXpath"); |
| 280 | 242 | } |
| 281 | 243 | |
| 282 | - public function getDepositLicenseXpath() |
|
| 283 | - { |
|
| 244 | + public function getDepositLicenseXpath() { |
|
| 284 | 245 | return $this->getSetting("depositLicenseXpath", "depositLicenseXpath"); |
| 285 | 246 | } |
| 286 | 247 | |
| 287 | - public function getAllNotesXpath() |
|
| 288 | - { |
|
| 248 | + public function getAllNotesXpath() { |
|
| 289 | 249 | return $this->getSetting("allNotesXpath", "allNotesXpath"); |
| 290 | 250 | } |
| 291 | 251 | |
| 292 | - public function getPrivateNotesXpath() |
|
| 293 | - { |
|
| 252 | + public function getPrivateNotesXpath() { |
|
| 294 | 253 | return $this->getSetting("privateNotesXpath", "privateNotesXpath"); |
| 295 | 254 | } |
| 296 | 255 | |
| 297 | - public function getInputTransformation() |
|
| 298 | - { |
|
| 256 | + public function getInputTransformation() { |
|
| 299 | 257 | return $this->client->getInputTransformation()->current(); |
| 300 | 258 | } |
| 301 | 259 | |
| 302 | - public function getOutputTransformation() |
|
| 303 | - { |
|
| 260 | + public function getOutputTransformation() { |
|
| 304 | 261 | return $this->client->getOutputTransformation()->current(); |
| 305 | 262 | } |
| 306 | 263 | |
| 307 | - public function getPersonXpath() |
|
| 308 | - { |
|
| 264 | + public function getPersonXpath() { |
|
| 309 | 265 | return $this->getSetting("personXpath", "personXpath"); |
| 310 | 266 | } |
| 311 | 267 | |
| 312 | - public function getPersonFamilyXpath() |
|
| 313 | - { |
|
| 268 | + public function getPersonFamilyXpath() { |
|
| 314 | 269 | return $this->getSetting("personFamilyXpath", "personFamilyXpath"); |
| 315 | 270 | } |
| 316 | 271 | |
| 317 | - public function getPersonGivenXpath() |
|
| 318 | - { |
|
| 272 | + public function getPersonGivenXpath() { |
|
| 319 | 273 | return $this->getSetting("personGivenXpath", "personGivenXpath"); |
| 320 | 274 | } |
| 321 | 275 | |
| 322 | - public function getPersonRoleXpath() |
|
| 323 | - { |
|
| 276 | + public function getPersonRoleXpath() { |
|
| 324 | 277 | return $this->getSetting("personRoleXpath", "personRoleXpath"); |
| 325 | 278 | } |
| 326 | 279 | |
| 327 | - public function getPersonFisIdentifierXpath() |
|
| 328 | - { |
|
| 280 | + public function getPersonFisIdentifierXpath() { |
|
| 329 | 281 | return $this->getSetting("personFisIdentifierXpath", "personFisIdentifierXpath"); |
| 330 | 282 | } |
| 331 | 283 | |
| 332 | - public function getPersonAffiliationXpath() |
|
| 333 | - { |
|
| 284 | + public function getPersonAffiliationXpath() { |
|
| 334 | 285 | return $this->getSetting("personAffiliationXpath", "personAffiliationXpath"); |
| 335 | 286 | } |
| 336 | 287 | |
| 337 | - public function getPersonAffiliationIdentifierXpath() |
|
| 338 | - { |
|
| 288 | + public function getPersonAffiliationIdentifierXpath() { |
|
| 339 | 289 | return $this->getSetting("personAffiliationIdentifierXpath", "personAffiliationIdentifierXpath"); |
| 340 | 290 | } |
| 341 | 291 | |
| 342 | - public function getPersonAuthorRole() |
|
| 343 | - { |
|
| 292 | + public function getPersonAuthorRole() { |
|
| 344 | 293 | return $this->getSetting("personAuthorRole", "personAuthorRole"); |
| 345 | 294 | } |
| 346 | 295 | |
| 347 | - public function getPersonPublisherRole() |
|
| 348 | - { |
|
| 296 | + public function getPersonPublisherRole() { |
|
| 349 | 297 | return $this->getSetting("personPublisherRole", "personPublisherRole"); |
| 350 | 298 | } |
| 351 | 299 | |
| 352 | - public function getValidationXpath() |
|
| 353 | - { |
|
| 300 | + public function getValidationXpath() { |
|
| 354 | 301 | return $this->getSetting("validationXpath", "validationXpath"); |
| 355 | 302 | } |
| 356 | 303 | |
| 357 | - public function fisIdXpath() |
|
| 358 | - { |
|
| 304 | + public function fisIdXpath() { |
|
| 359 | 305 | return $this->getSetting("fisIdXpath", "fisIdXpath"); |
| 360 | 306 | } |
| 361 | 307 | |
| 362 | - public function getSourceDetailsXpaths() |
|
| 363 | - { |
|
| 308 | + public function getSourceDetailsXpaths() { |
|
| 364 | 309 | return $this->getSetting("sourceDetailsXpaths", "sourceDetailsXpaths"); |
| 365 | 310 | } |
| 366 | 311 | |
| 367 | - public function getFedoraNamespace() |
|
| 368 | - { |
|
| 312 | + public function getFedoraNamespace() { |
|
| 369 | 313 | $settings = $this->getTypoScriptSettings(); |
| 370 | 314 | return $settings['fedoraNamespace']; |
| 371 | 315 | } |
| 372 | 316 | |
| 373 | - public function getUniversityCollection() |
|
| 374 | - { |
|
| 317 | + public function getUniversityCollection() { |
|
| 375 | 318 | $settings = $this->getTypoScriptSettings(); |
| 376 | 319 | return $settings['universityCollection']; |
| 377 | 320 | } |
| 378 | 321 | |
| 379 | - public function getTypoScriptSettings() |
|
| 380 | - { |
|
| 322 | + public function getTypoScriptSettings() { |
|
| 381 | 323 | $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 382 | 324 | $configurationManager = $objectManager->get(ConfigurationManager::class); |
| 383 | 325 | $settings = $configurationManager->getConfiguration( |
@@ -22,15 +22,13 @@ discard block |
||
| 22 | 22 | /** |
| 23 | 23 | * The repository for Bookmarks |
| 24 | 24 | */ |
| 25 | -class BookmarkRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository |
|
| 26 | -{ |
|
| 25 | +class BookmarkRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository { |
|
| 27 | 26 | /** |
| 28 | 27 | * @param int $feUserUid |
| 29 | 28 | * @param string $identifier |
| 30 | 29 | * @return object |
| 31 | 30 | */ |
| 32 | - public function findBookmark($feUserUid, $identifier) |
|
| 33 | - { |
|
| 31 | + public function findBookmark($feUserUid, $identifier) { |
|
| 34 | 32 | $query = $this->createQuery(); |
| 35 | 33 | |
| 36 | 34 | $query->matching( |
@@ -49,8 +47,7 @@ discard block |
||
| 49 | 47 | * @return bool |
| 50 | 48 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 51 | 49 | */ |
| 52 | - public function removeBookmark($document, $feUserUid) |
|
| 53 | - { |
|
| 50 | + public function removeBookmark($document, $feUserUid) { |
|
| 54 | 51 | $query = $this->createQuery(); |
| 55 | 52 | |
| 56 | 53 | if ($document instanceof Document) { |
@@ -88,8 +85,7 @@ discard block |
||
| 88 | 85 | * @return bool |
| 89 | 86 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 90 | 87 | */ |
| 91 | - public function addBookmark($document, $feUserUid) |
|
| 92 | - { |
|
| 88 | + public function addBookmark($document, $feUserUid) { |
|
| 93 | 89 | if ($document instanceof Document) { |
| 94 | 90 | // The returned documentIdentifier is either a PID or the document UID (TYPO3 db), see also |
| 95 | 91 | // the above method removeBookmark(). |
@@ -115,8 +111,7 @@ discard block |
||
| 115 | 111 | * @param Document $document |
| 116 | 112 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
| 117 | 113 | */ |
| 118 | - public function findDocumentBookmarks(Document $document) |
|
| 119 | - { |
|
| 114 | + public function findDocumentBookmarks(Document $document) { |
|
| 120 | 115 | $query = $this->createQuery(); |
| 121 | 116 | |
| 122 | 117 | $constraintsAnd[] = $query->logicalOr( |
@@ -17,8 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * The abstract repository |
| 19 | 19 | */ |
| 20 | -class AbstractRepository extends \TYPO3\CMS\Extbase\Persistence\Repository |
|
| 21 | -{ |
|
| 20 | +class AbstractRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { |
|
| 22 | 21 | /** |
| 23 | 22 | * Finds all records of all clients. |
| 24 | 23 | * |
@@ -34,8 +33,7 @@ discard block |
||
| 34 | 33 | return $query->execute($returnRawQueryResult); |
| 35 | 34 | } |
| 36 | 35 | |
| 37 | - public function crossClient($active = false) |
|
| 38 | - { |
|
| 36 | + public function crossClient($active = false) { |
|
| 39 | 37 | /** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */ |
| 40 | 38 | $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings'); |
| 41 | 39 | $querySettings->setRespectStoragePage(!$active); |
@@ -17,16 +17,14 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * The repository for Clients |
| 19 | 19 | */ |
| 20 | -class ClientRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository |
|
| 21 | -{ |
|
| 20 | +class ClientRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository { |
|
| 22 | 21 | |
| 23 | 22 | /** |
| 24 | 23 | * findAllByPid |
| 25 | 24 | * |
| 26 | 25 | * @return |
| 27 | 26 | */ |
| 28 | - public function findAllByPid($pid) |
|
| 29 | - { |
|
| 27 | + public function findAllByPid($pid) { |
|
| 30 | 28 | $query = $this->createQuery(); |
| 31 | 29 | $query->getQuerySettings()->setRespectStoragePage(false); |
| 32 | 30 | $query->matching($query->equals('pid', $pid)); |
@@ -4,15 +4,13 @@ |
||
| 4 | 4 | use EWW\Dpf\Domain\Model\Document; |
| 5 | 5 | use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; |
| 6 | 6 | |
| 7 | -class FrontendUserRepository extends \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository |
|
| 8 | -{ |
|
| 7 | +class FrontendUserRepository extends \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository { |
|
| 9 | 8 | /** |
| 10 | 9 | * @param $feUserUid |
| 11 | 10 | * @param $clientPid |
| 12 | 11 | * @return bool |
| 13 | 12 | */ |
| 14 | - public function isUserInClient($feUserUid, $clientPid) |
|
| 15 | - { |
|
| 13 | + public function isUserInClient($feUserUid, $clientPid) { |
|
| 16 | 14 | /** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */ |
| 17 | 15 | $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings'); |
| 18 | 16 | $querySettings->setRespectStoragePage(false); |
@@ -14,10 +14,8 @@ |
||
| 14 | 14 | * The TYPO3 project - inspiring people to share! |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -class ElasticSearchMissingIndexNameException extends \Exception implements DPFExceptionInterface |
|
| 18 | -{ |
|
| 19 | - public function messageLanguageKey() |
|
| 20 | - { |
|
| 17 | +class ElasticSearchMissingIndexNameException extends \Exception implements DPFExceptionInterface { |
|
| 18 | + public function messageLanguageKey() { |
|
| 21 | 19 | return 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_transfer.elasticsearch_indexname_error'; |
| 22 | 20 | } |
| 23 | 21 | } |
@@ -28,8 +28,7 @@ discard block |
||
| 28 | 28 | use TYPO3\CMS\Core\Log\LogManager; |
| 29 | 29 | use TYPO3\CMS\Extbase\Utility\LocalizationUtility; |
| 30 | 30 | |
| 31 | -class ElasticSearch |
|
| 32 | -{ |
|
| 31 | +class ElasticSearch { |
|
| 33 | 32 | /** |
| 34 | 33 | * @var \EWW\Dpf\Configuration\ClientConfigurationManager |
| 35 | 34 | */ |
@@ -61,8 +60,7 @@ discard block |
||
| 61 | 60 | * @param int|null $clientPid |
| 62 | 61 | * @throws ElasticSearchMissingIndexNameException |
| 63 | 62 | */ |
| 64 | - public function __construct($clientPid = null) |
|
| 65 | - { |
|
| 63 | + public function __construct($clientPid = null) { |
|
| 66 | 64 | $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 67 | 65 | |
| 68 | 66 | $this->elasticsearchMapper = $objectManager->get(ElasticsearchMapper::class); |
@@ -103,8 +101,7 @@ discard block |
||
| 103 | 101 | /** |
| 104 | 102 | * @return string|null |
| 105 | 103 | */ |
| 106 | - protected function getIndexName() |
|
| 107 | - { |
|
| 104 | + protected function getIndexName() { |
|
| 108 | 105 | return $this->indexName; |
| 109 | 106 | } |
| 110 | 107 | |
@@ -113,8 +110,7 @@ discard block |
||
| 113 | 110 | * |
| 114 | 111 | * @param $indexName |
| 115 | 112 | */ |
| 116 | - protected function initializeIndex($indexName) |
|
| 117 | - { |
|
| 113 | + protected function initializeIndex($indexName) { |
|
| 118 | 114 | $paramsIndex = [ |
| 119 | 115 | 'index' => $indexName, |
| 120 | 116 | 'body' => [ |
@@ -252,8 +248,7 @@ discard block |
||
| 252 | 248 | * |
| 253 | 249 | * @param Document $document |
| 254 | 250 | */ |
| 255 | - public function index($document) |
|
| 256 | - { |
|
| 251 | + public function index($document) { |
|
| 257 | 252 | try { |
| 258 | 253 | $data = json_decode($this->elasticsearchMapper->getElasticsearchJson($document)); |
| 259 | 254 | } catch (\Throwable $throwable) { |
@@ -391,8 +386,7 @@ discard block |
||
| 391 | 386 | * |
| 392 | 387 | * @param string $identifier |
| 393 | 388 | */ |
| 394 | - public function delete($identifier) |
|
| 395 | - { |
|
| 389 | + public function delete($identifier) { |
|
| 396 | 390 | try { |
| 397 | 391 | |
| 398 | 392 | $params = [ |
@@ -418,8 +412,7 @@ discard block |
||
| 418 | 412 | /** |
| 419 | 413 | * @param $identifier |
| 420 | 414 | */ |
| 421 | - public function getDocument($identifier) |
|
| 422 | - { |
|
| 415 | + public function getDocument($identifier) { |
|
| 423 | 416 | $params = [ |
| 424 | 417 | 'index' => $this->getIndexName(), |
| 425 | 418 | 'id' => $identifier |
@@ -434,8 +427,7 @@ discard block |
||
| 434 | 427 | * @param array $query search query |
| 435 | 428 | * @return array result list |
| 436 | 429 | */ |
| 437 | - public function search($query, $type = null) |
|
| 438 | - { |
|
| 430 | + public function search($query, $type = null) { |
|
| 439 | 431 | try { |
| 440 | 432 | // define type and index |
| 441 | 433 | if (empty($query['index'])) { |
@@ -467,8 +459,7 @@ discard block |
||
| 467 | 459 | * Get the results |
| 468 | 460 | * @return mixed |
| 469 | 461 | */ |
| 470 | - public function getResults() |
|
| 471 | - { |
|
| 462 | + public function getResults() { |
|
| 472 | 463 | // return results from the last search request |
| 473 | 464 | return $this->results; |
| 474 | 465 | } |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | use EWW\Dpf\Security\Security; |
| 20 | 20 | use TYPO3\CMS\Extbase\Utility\LocalizationUtility; |
| 21 | 21 | |
| 22 | -class QueryBuilder |
|
| 23 | -{ |
|
| 22 | +class QueryBuilder { |
|
| 24 | 23 | /** |
| 25 | 24 | * |
| 26 | 25 | * @var \EWW\Dpf\Configuration\ClientConfigurationManager |
@@ -62,8 +61,7 @@ discard block |
||
| 62 | 61 | public function buildQuery( |
| 63 | 62 | $itemsPerPage, $workspaceFilter, $from = 0, $bookmarkIdentifiers = [], $filters = [], |
| 64 | 63 | $excludeFilters = [], $sortField = null, $sortOrder = null, $queryString = null |
| 65 | - ) |
|
| 66 | - { |
|
| 64 | + ) { |
|
| 67 | 65 | |
| 68 | 66 | if ($workspaceFilter) { |
| 69 | 67 | $workspaceFilter = [0 => $workspaceFilter]; |
@@ -464,8 +462,7 @@ discard block |
||
| 464 | 462 | } |
| 465 | 463 | |
| 466 | 464 | |
| 467 | - protected function getSortScriptUniversityCollection($collection) |
|
| 468 | - { |
|
| 465 | + protected function getSortScriptUniversityCollection($collection) { |
|
| 469 | 466 | $script = "for (int i = 0; i < doc['collections'].length; ++i) {"; |
| 470 | 467 | $script .= " if (doc['collections'][i] == '".$collection."') {"; |
| 471 | 468 | $script .= " return '1';"; |
@@ -476,8 +473,7 @@ discard block |
||
| 476 | 473 | return $script; |
| 477 | 474 | } |
| 478 | 475 | |
| 479 | - protected function getSortScriptHasFiles() |
|
| 480 | - { |
|
| 476 | + protected function getSortScriptHasFiles() { |
|
| 481 | 477 | $script = "if (doc['hasFiles'].value == 'true') {"; |
| 482 | 478 | $script .= " return '1';"; |
| 483 | 479 | $script .= "}"; |
@@ -486,8 +482,7 @@ discard block |
||
| 486 | 482 | return $script; |
| 487 | 483 | } |
| 488 | 484 | |
| 489 | - protected function getSortScriptCreatorRole($feUserUid) |
|
| 490 | - { |
|
| 485 | + protected function getSortScriptCreatorRole($feUserUid) { |
|
| 491 | 486 | $script = "if (doc['creator'].value == '".$feUserUid."') {"; |
| 492 | 487 | $script .= " return '1';"; |
| 493 | 488 | $script .= "}"; |
@@ -503,8 +498,7 @@ discard block |
||
| 503 | 498 | } |
| 504 | 499 | |
| 505 | 500 | |
| 506 | - protected function getSortScriptState() |
|
| 507 | - { |
|
| 501 | + protected function getSortScriptState() { |
|
| 508 | 502 | $sortStates = []; |
| 509 | 503 | foreach (DocumentWorkflow::PLACES as $state) { |
| 510 | 504 | if (array_key_exists($state, DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING)) { |
@@ -521,8 +515,7 @@ discard block |
||
| 521 | 515 | } |
| 522 | 516 | |
| 523 | 517 | |
| 524 | - protected function getSortScriptDoctype() |
|
| 525 | - { |
|
| 518 | + protected function getSortScriptDoctype() { |
|
| 526 | 519 | $sortDoctypes = []; |
| 527 | 520 | foreach ($this->documentTypeRepository->findAll() as $documentType) { |
| 528 | 521 | if ($documentType->getName() && $documentType->getDisplayname()) { |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * ParserGenerator |
| 25 | 25 | */ |
| 26 | -class ParserGenerator |
|
| 27 | -{ |
|
| 26 | +class ParserGenerator { |
|
| 28 | 27 | /** |
| 29 | 28 | * clientConfigurationManager |
| 30 | 29 | * |
@@ -93,8 +92,7 @@ discard block |
||
| 93 | 92 | * ParserGenerator constructor. |
| 94 | 93 | * @param int $clientPid |
| 95 | 94 | */ |
| 96 | - public function __construct($clientPid = 0) |
|
| 97 | - { |
|
| 95 | + public function __construct($clientPid = 0) { |
|
| 98 | 96 | $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class); |
| 99 | 97 | $this->clientConfigurationManager = $objectManager->get(ClientConfigurationManager::class); |
| 100 | 98 | |
@@ -128,16 +126,14 @@ discard block |
||
| 128 | 126 | * returns the mods xml string |
| 129 | 127 | * @return string mods xml |
| 130 | 128 | */ |
| 131 | - public function getXMLData() |
|
| 132 | - { |
|
| 129 | + public function getXMLData() { |
|
| 133 | 130 | $xml = $this->xmlData->saveXML(); |
| 134 | 131 | $xml = preg_replace("/eww=\"\d-\d-\d\"/", '${1}${2}${3}', $xml); |
| 135 | 132 | |
| 136 | 133 | return $xml; |
| 137 | 134 | } |
| 138 | 135 | |
| 139 | - public function transformInputXML($xml) |
|
| 140 | - { |
|
| 136 | + public function transformInputXML($xml) { |
|
| 141 | 137 | $XSLTransformator = new XSLTransformator(); |
| 142 | 138 | return $XSLTransformator->transformInputXML($xml); |
| 143 | 139 | } |
@@ -146,8 +142,7 @@ discard block |
||
| 146 | 142 | * @param $document |
| 147 | 143 | * @return string The transformed xml |
| 148 | 144 | */ |
| 149 | - public function getTransformedOutputXML($document) |
|
| 150 | - { |
|
| 145 | + public function getTransformedOutputXML($document) { |
|
| 151 | 146 | $XSLTransformator = new XSLTransformator(); |
| 152 | 147 | return $XSLTransformator->getTransformedOutputXML($document); |
| 153 | 148 | } |
@@ -157,8 +152,7 @@ discard block |
||
| 157 | 152 | * build mods from form array |
| 158 | 153 | * @param array $array structured form data array |
| 159 | 154 | */ |
| 160 | - public function buildXmlFromForm($array) |
|
| 161 | - { |
|
| 155 | + public function buildXmlFromForm($array) { |
|
| 162 | 156 | $fedoraNamespace = $this->clientConfigurationManager->getFedoraNamespace(); |
| 163 | 157 | |
| 164 | 158 | $this->xmlData = $this->xmlData; |
@@ -241,8 +235,7 @@ discard block |
||
| 241 | 235 | * @param xpath $xPath xPath expression |
| 242 | 236 | * @return xml |
| 243 | 237 | */ |
| 244 | - public function parseXPath($xPath) |
|
| 245 | - { |
|
| 238 | + public function parseXPath($xPath) { |
|
| 246 | 239 | |
| 247 | 240 | $this->parser->generateXmlFromXPath($xPath); |
| 248 | 241 | $xml = $this->parser->getXML(); |
@@ -250,8 +243,7 @@ discard block |
||
| 250 | 243 | return $xml; |
| 251 | 244 | } |
| 252 | 245 | |
| 253 | - public function parseXPathWrapped($xPath) |
|
| 254 | - { |
|
| 246 | + public function parseXPathWrapped($xPath) { |
|
| 255 | 247 | $this->parser->generateXmlFromXPath($xPath); |
| 256 | 248 | $xml = $this->parser->getXML(); |
| 257 | 249 | |
@@ -266,8 +258,7 @@ discard block |
||
| 266 | 258 | * @param string $value form value |
| 267 | 259 | * @return xml created xml |
| 268 | 260 | */ |
| 269 | - public function customXPath($xPath, $newGroupFlag = false, $value = '', $attributeOnly = false) |
|
| 270 | - { |
|
| 261 | + public function customXPath($xPath, $newGroupFlag = false, $value = '', $attributeOnly = false) { |
|
| 271 | 262 | if (!$attributeOnly) { |
| 272 | 263 | // Explode xPath |
| 273 | 264 | $newPath = explode('%', $xPath); |
@@ -466,8 +457,7 @@ discard block |
||
| 466 | 457 | * sets the file data and generates file xml |
| 467 | 458 | * @param string $value |
| 468 | 459 | */ |
| 469 | - public function setFileData($value = '') |
|
| 470 | - { |
|
| 460 | + public function setFileData($value = '') { |
|
| 471 | 461 | $this->files = $value; |
| 472 | 462 | $this->generateFileXML(); |
| 473 | 463 | } |