@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | use EWW\Dpf\Helper\XSLTransformator; |
| 18 | 18 | |
| 19 | -class ElasticsearchMapper |
|
| 20 | -{ |
|
| 19 | +class ElasticsearchMapper { |
|
| 21 | 20 | |
| 22 | 21 | /** |
| 23 | 22 | * [$documentRepository description] |
@@ -40,8 +39,7 @@ discard block |
||
| 40 | 39 | * @param Document $document [description] |
| 41 | 40 | * @return json Elasticsearch json format |
| 42 | 41 | */ |
| 43 | - public function getElasticsearchJson($document) |
|
| 44 | - { |
|
| 42 | + public function getElasticsearchJson($document) { |
|
| 45 | 43 | $xsltDoc = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:dpf/Resources/Private/Xslt/mets-mods-xml2json.xsl'); |
| 46 | 44 | |
| 47 | 45 | // xslt |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $query = [ |
| 139 | 139 | 'bool' => [ |
| 140 | 140 | 'must' => [ |
| 141 | - 'match_all' => (object)[] |
|
| 141 | + 'match_all' => (object) [] |
|
| 142 | 142 | ], |
| 143 | 143 | 'filter' => $queryFilter |
| 144 | 144 | ] |
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | 'script' => [ |
| 181 | 181 | 'lang' => 'painless', |
| 182 | 182 | 'source' => |
| 183 | - "for (int i = 0; i < doc['collections'].length; ++i) {". |
|
| 184 | - " if(doc['collections'][i] =='".$this->getSettings()['universityCollection']."') {". |
|
| 185 | - " return 'true';". |
|
| 186 | - " }". |
|
| 187 | - "}". |
|
| 183 | + "for (int i = 0; i < doc['collections'].length; ++i) {" . |
|
| 184 | + " if(doc['collections'][i] =='" . $this->getSettings()['universityCollection'] . "') {" . |
|
| 185 | + " return 'true';" . |
|
| 186 | + " }" . |
|
| 187 | + "}" . |
|
| 188 | 188 | "return 'false';" |
| 189 | 189 | ] |
| 190 | 190 | ] |
@@ -200,23 +200,23 @@ discard block |
||
| 200 | 200 | 'script' => [ |
| 201 | 201 | 'lang' => 'painless', |
| 202 | 202 | 'source' => |
| 203 | - "if (". |
|
| 204 | - " doc['creator'].size() > 0 &&". |
|
| 205 | - " doc['creator'].value == '".$this->security->getUser()->getUid()."') {". |
|
| 206 | - " return 'self';". |
|
| 207 | - "}". |
|
| 208 | - "if (". |
|
| 209 | - " doc['creatorRole'].size() > 0 &&". |
|
| 210 | - " doc['creatorRole'].value == '".Security::ROLE_LIBRARIAN."'". |
|
| 211 | - ") {". |
|
| 212 | - " return 'librarian';". |
|
| 213 | - "}". |
|
| 214 | - "if (". |
|
| 215 | - " doc['creatorRole'].size() > 0 &&". |
|
| 216 | - " doc['creatorRole'].value == '".Security::ROLE_RESEARCHER."'". |
|
| 217 | - ") {". |
|
| 218 | - " return 'user';". |
|
| 219 | - "}". |
|
| 203 | + "if (" . |
|
| 204 | + " doc['creator'].size() > 0 &&" . |
|
| 205 | + " doc['creator'].value == '" . $this->security->getUser()->getUid() . "') {" . |
|
| 206 | + " return 'self';" . |
|
| 207 | + "}" . |
|
| 208 | + "if (" . |
|
| 209 | + " doc['creatorRole'].size() > 0 &&" . |
|
| 210 | + " doc['creatorRole'].value == '" . Security::ROLE_LIBRARIAN . "'" . |
|
| 211 | + ") {" . |
|
| 212 | + " return 'librarian';" . |
|
| 213 | + "}" . |
|
| 214 | + "if (" . |
|
| 215 | + " doc['creatorRole'].size() > 0 &&" . |
|
| 216 | + " doc['creatorRole'].value == '" . Security::ROLE_RESEARCHER . "'" . |
|
| 217 | + ") {" . |
|
| 218 | + " return 'user';" . |
|
| 219 | + "}" . |
|
| 220 | 220 | "return 'unknown';" |
| 221 | 221 | ] |
| 222 | 222 | ] |
@@ -429,8 +429,8 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | protected function buildSortQueryPart($sortField, $sortOrder) { |
| 431 | 431 | |
| 432 | - $sortField = ($sortField)? $sortField : 'title'; |
|
| 433 | - $sortOrder = ($sortOrder)? $sortOrder : 'asc'; |
|
| 432 | + $sortField = ($sortField) ? $sortField : 'title'; |
|
| 433 | + $sortOrder = ($sortOrder) ? $sortOrder : 'asc'; |
|
| 434 | 434 | |
| 435 | 435 | // Build the sorting part. |
| 436 | 436 | $script = ""; |
@@ -460,11 +460,11 @@ discard block |
||
| 460 | 460 | ]; |
| 461 | 461 | } else { |
| 462 | 462 | if ($sortField == 'title') { |
| 463 | - $sortField.= ".keyword"; |
|
| 463 | + $sortField .= ".keyword"; |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | if ($sortField == 'personsSort') { |
| 467 | - $sortField.= ".keyword"; |
|
| 467 | + $sortField .= ".keyword"; |
|
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | $sort = [ |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | protected function getSortScriptUniversityCollection($collection) |
| 482 | 482 | { |
| 483 | 483 | $script = "for (int i = 0; i < doc['collections'].length; ++i) {"; |
| 484 | - $script .= " if (doc['collections'][i] == '".$collection."') {"; |
|
| 484 | + $script .= " if (doc['collections'][i] == '" . $collection . "') {"; |
|
| 485 | 485 | $script .= " return '1';"; |
| 486 | 486 | $script .= " }"; |
| 487 | 487 | $script .= "}"; |
@@ -502,13 +502,13 @@ discard block |
||
| 502 | 502 | |
| 503 | 503 | protected function getSortScriptCreatorRole($feUserUid) |
| 504 | 504 | { |
| 505 | - $script = "if (doc['creator'].value == '".$feUserUid."') {"; |
|
| 505 | + $script = "if (doc['creator'].value == '" . $feUserUid . "') {"; |
|
| 506 | 506 | $script .= " return '1';"; |
| 507 | 507 | $script .= "}"; |
| 508 | - $script .= "if (doc['creatorRole'].value == '".Security::ROLE_LIBRARIAN."') {"; |
|
| 508 | + $script .= "if (doc['creatorRole'].value == '" . Security::ROLE_LIBRARIAN . "') {"; |
|
| 509 | 509 | $script .= "return '2';"; |
| 510 | 510 | $script .= "}"; |
| 511 | - $script .= "if (doc['creatorRole'].value == '".Security::ROLE_RESEARCHER."') {"; |
|
| 511 | + $script .= "if (doc['creatorRole'].value == '" . Security::ROLE_RESEARCHER . "') {"; |
|
| 512 | 512 | $script .= " return '3';"; |
| 513 | 513 | $script .= "}"; |
| 514 | 514 | $script .= "return '4';"; |
@@ -523,15 +523,15 @@ discard block |
||
| 523 | 523 | foreach (DocumentWorkflow::PLACES as $state) { |
| 524 | 524 | if (array_key_exists($state, DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING)) { |
| 525 | 525 | $aliasState = DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING[$state]; |
| 526 | - $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:manager.documentList.state.'.$aliasState; |
|
| 526 | + $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:manager.documentList.state.' . $aliasState; |
|
| 527 | 527 | $stateName = LocalizationUtility::translate($key, 'dpf'); |
| 528 | - $sortStates[] = "if (doc['state'].value == '".$state."') return '".$stateName."';"; |
|
| 528 | + $sortStates[] = "if (doc['state'].value == '" . $state . "') return '" . $stateName . "';"; |
|
| 529 | 529 | } |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | $sortStates = implode(" ", $sortStates); |
| 533 | 533 | |
| 534 | - return $sortStates." return '';"; |
|
| 534 | + return $sortStates . " return '';"; |
|
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | |
@@ -540,14 +540,14 @@ discard block |
||
| 540 | 540 | $sortDoctypes = []; |
| 541 | 541 | foreach ($this->documentTypeRepository->findAll() as $documentType) { |
| 542 | 542 | if ($documentType->getName() && $documentType->getDisplayname()) { |
| 543 | - $sortDoctypes[] = "if (doc['doctype'].value == '".$documentType->getName()."')" |
|
| 544 | - ." return '".$documentType->getDisplayname()."';"; |
|
| 543 | + $sortDoctypes[] = "if (doc['doctype'].value == '" . $documentType->getName() . "')" |
|
| 544 | + ." return '" . $documentType->getDisplayname() . "';"; |
|
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | $sortDoctypes = implode(" ", $sortDoctypes); |
| 549 | 549 | |
| 550 | - return $sortDoctypes." return '';"; |
|
| 550 | + return $sortDoctypes . " return '';"; |
|
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | } |
@@ -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 \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface |
@@ -51,8 +50,7 @@ discard block |
||
| 51 | 50 | * |
| 52 | 51 | * @return mixed |
| 53 | 52 | */ |
| 54 | - public function getSettings() |
|
| 55 | - { |
|
| 53 | + public function getSettings() { |
|
| 56 | 54 | $frameworkConfiguration = $this->configurationManager->getConfiguration( |
| 57 | 55 | \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK |
| 58 | 56 | ); |
@@ -78,8 +76,7 @@ discard block |
||
| 78 | 76 | public function buildQuery( |
| 79 | 77 | $itemsPerPage, $workspaceFilter, $from = 0, $bookmarkIdentifiers = [], $filters = [], |
| 80 | 78 | $excludeFilters = [], $sortField = null, $sortOrder = null, $queryString = null |
| 81 | - ) |
|
| 82 | - { |
|
| 79 | + ) { |
|
| 83 | 80 | |
| 84 | 81 | if ($workspaceFilter) { |
| 85 | 82 | $workspaceFilter = [0 => $workspaceFilter]; |
@@ -478,8 +475,7 @@ discard block |
||
| 478 | 475 | } |
| 479 | 476 | |
| 480 | 477 | |
| 481 | - protected function getSortScriptUniversityCollection($collection) |
|
| 482 | - { |
|
| 478 | + protected function getSortScriptUniversityCollection($collection) { |
|
| 483 | 479 | $script = "for (int i = 0; i < doc['collections'].length; ++i) {"; |
| 484 | 480 | $script .= " if (doc['collections'][i] == '".$collection."') {"; |
| 485 | 481 | $script .= " return '1';"; |
@@ -490,8 +486,7 @@ discard block |
||
| 490 | 486 | return $script; |
| 491 | 487 | } |
| 492 | 488 | |
| 493 | - protected function getSortScriptHasFiles() |
|
| 494 | - { |
|
| 489 | + protected function getSortScriptHasFiles() { |
|
| 495 | 490 | $script = "if (doc['hasFiles'].value == 'true') {"; |
| 496 | 491 | $script .= " return '1';"; |
| 497 | 492 | $script .= "}"; |
@@ -500,8 +495,7 @@ discard block |
||
| 500 | 495 | return $script; |
| 501 | 496 | } |
| 502 | 497 | |
| 503 | - protected function getSortScriptCreatorRole($feUserUid) |
|
| 504 | - { |
|
| 498 | + protected function getSortScriptCreatorRole($feUserUid) { |
|
| 505 | 499 | $script = "if (doc['creator'].value == '".$feUserUid."') {"; |
| 506 | 500 | $script .= " return '1';"; |
| 507 | 501 | $script .= "}"; |
@@ -517,8 +511,7 @@ discard block |
||
| 517 | 511 | } |
| 518 | 512 | |
| 519 | 513 | |
| 520 | - protected function getSortScriptState() |
|
| 521 | - { |
|
| 514 | + protected function getSortScriptState() { |
|
| 522 | 515 | $sortStates = []; |
| 523 | 516 | foreach (DocumentWorkflow::PLACES as $state) { |
| 524 | 517 | if (array_key_exists($state, DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING)) { |
@@ -535,8 +528,7 @@ discard block |
||
| 535 | 528 | } |
| 536 | 529 | |
| 537 | 530 | |
| 538 | - protected function getSortScriptDoctype() |
|
| 539 | - { |
|
| 531 | + protected function getSortScriptDoctype() { |
|
| 540 | 532 | $sortDoctypes = []; |
| 541 | 533 | foreach ($this->documentTypeRepository->findAll() as $documentType) { |
| 542 | 534 | if ($documentType->getName() && $documentType->getDisplayname()) { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository |
| 36 | 36 | * @inject |
| 37 | 37 | */ |
| 38 | - protected $documentTypeRepository = null; |
|
| 38 | + protected $documentTypeRepository = NULL; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * security |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * @var \EWW\Dpf\Security\Security |
| 44 | 44 | * @inject |
| 45 | 45 | */ |
| 46 | - protected $security = null; |
|
| 46 | + protected $security = NULL; |
|
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function buildQuery( |
| 79 | 79 | $itemsPerPage, $workspaceFilter, $from = 0, $bookmarkIdentifiers = [], $filters = [], |
| 80 | - $excludeFilters = [], $sortField = null, $sortOrder = null, $queryString = null |
|
| 80 | + $excludeFilters = [], $sortField = NULL, $sortOrder = NULL, $queryString = NULL |
|
| 81 | 81 | ) |
| 82 | 82 | { |
| 83 | 83 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | foreach ($filters as $key => $filterValues) { |
| 255 | 255 | $queryFilterPart = []; |
| 256 | - if (in_array($key, $validKeys, true)) { |
|
| 256 | + if (in_array($key, $validKeys, TRUE)) { |
|
| 257 | 257 | if ($key == 'universityCollection') { |
| 258 | 258 | if ($filterValues && is_array($filterValues)) { |
| 259 | 259 | if (in_array("true", $filterValues)) { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * @var \EWW\Dpf\Domain\Repository\FrontendUserRepository |
| 38 | 38 | * @inject |
| 39 | 39 | */ |
| 40 | - protected $frontendUserRepository = null; |
|
| 40 | + protected $frontendUserRepository = NULL; |
|
| 41 | 41 | |
| 42 | 42 | protected $client; |
| 43 | 43 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | ], |
| 141 | 141 | 'mappings' => [ |
| 142 | 142 | '_source' => [ |
| 143 | - 'enabled' => true |
|
| 143 | + 'enabled' => TRUE |
|
| 144 | 144 | ], |
| 145 | 145 | //'dynamic' => 'strict', |
| 146 | 146 | 'properties' => [ |
@@ -203,11 +203,11 @@ discard block |
||
| 203 | 203 | ], |
| 204 | 204 | 'fobId' => [ |
| 205 | 205 | //'type' => 'keyword' |
| 206 | - 'enabled' => false |
|
| 206 | + 'enabled' => FALSE |
|
| 207 | 207 | ], |
| 208 | 208 | 'index' => [ |
| 209 | 209 | //'type' => 'integer' |
| 210 | - 'enabled' => false |
|
| 210 | + 'enabled' => FALSE |
|
| 211 | 211 | ] |
| 212 | 212 | ] |
| 213 | 213 | ], |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | if ($document->getCreator()) { |
| 262 | 262 | $data->creator = $document->getCreator(); |
| 263 | 263 | } else { |
| 264 | - $data->creator = null; |
|
| 264 | + $data->creator = NULL; |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | |
@@ -289,9 +289,9 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | $files = $document->getFile(); |
| 291 | 291 | if ($files->count() > 0) { |
| 292 | - $data->hasFiles = true; |
|
| 292 | + $data->hasFiles = TRUE; |
|
| 293 | 293 | } else { |
| 294 | - $data->hasFiles = false; |
|
| 294 | + $data->hasFiles = FALSE; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | |
@@ -328,11 +328,11 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | $data->source = $document->getSourceDetails(); |
| 330 | 330 | |
| 331 | - $data->universityCollection = false; |
|
| 331 | + $data->universityCollection = FALSE; |
|
| 332 | 332 | if ($data->collections && is_array($data->collections)) { |
| 333 | 333 | foreach ($data->collections as $collection) { |
| 334 | 334 | if ($collection == $this->getSettings()['universityCollection']) { |
| 335 | - $data->universityCollection = true; |
|
| 335 | + $data->universityCollection = TRUE; |
|
| 336 | 336 | break; |
| 337 | 337 | } |
| 338 | 338 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | if ($embargoDate instanceof \DateTime) { |
| 343 | 343 | $data->embargoDate = $embargoDate->format("Y-m-d"); |
| 344 | 344 | } else { |
| 345 | - $data->embargoDate = null; |
|
| 345 | + $data->embargoDate = NULL; |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | $data->originalSourceTitle = $internalFormat->getOriginalSourceTitle(); |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | * @param array $query search query |
| 410 | 410 | * @return array result list |
| 411 | 411 | */ |
| 412 | - public function search($query, $type = null) |
|
| 412 | + public function search($query, $type = NULL) |
|
| 413 | 413 | { |
| 414 | 414 | try { |
| 415 | 415 | // define type and index |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | use TYPO3\CMS\Core\Log\LogManager; |
| 24 | 24 | use TYPO3\CMS\Extbase\Utility\LocalizationUtility; |
| 25 | 25 | |
| 26 | -class ElasticSearch |
|
| 27 | -{ |
|
| 26 | +class ElasticSearch { |
|
| 28 | 27 | /** |
| 29 | 28 | * |
| 30 | 29 | * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface |
@@ -60,8 +59,7 @@ discard block |
||
| 60 | 59 | /** |
| 61 | 60 | * elasticsearch client constructor |
| 62 | 61 | */ |
| 63 | - public function __construct() |
|
| 64 | - { |
|
| 62 | + public function __construct() { |
|
| 65 | 63 | $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class); |
| 66 | 64 | |
| 67 | 65 | $this->elasticsearchMapper = $objectManager->get(ElasticsearchMapper::class); |
@@ -94,8 +92,7 @@ discard block |
||
| 94 | 92 | * |
| 95 | 93 | * @return mixed |
| 96 | 94 | */ |
| 97 | - public function getSettings() |
|
| 98 | - { |
|
| 95 | + public function getSettings() { |
|
| 99 | 96 | $frameworkConfiguration = $this->configurationManager->getConfiguration( |
| 100 | 97 | \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK |
| 101 | 98 | ); |
@@ -108,8 +105,7 @@ discard block |
||
| 108 | 105 | * |
| 109 | 106 | * @param $indexName |
| 110 | 107 | */ |
| 111 | - protected function initializeIndex($indexName) |
|
| 112 | - { |
|
| 108 | + protected function initializeIndex($indexName) { |
|
| 113 | 109 | $paramsIndex = [ |
| 114 | 110 | 'index' => $indexName, |
| 115 | 111 | 'body' => [ |
@@ -247,8 +243,7 @@ discard block |
||
| 247 | 243 | * |
| 248 | 244 | * @param Document $document |
| 249 | 245 | */ |
| 250 | - public function index($document) |
|
| 251 | - { |
|
| 246 | + public function index($document) { |
|
| 252 | 247 | $data = json_decode($this->elasticsearchMapper->getElasticsearchJson($document)); |
| 253 | 248 | |
| 254 | 249 | if (!$data) { |
@@ -377,8 +372,7 @@ discard block |
||
| 377 | 372 | * |
| 378 | 373 | * @param string $identifier |
| 379 | 374 | */ |
| 380 | - public function delete($identifier) |
|
| 381 | - { |
|
| 375 | + public function delete($identifier) { |
|
| 382 | 376 | try { |
| 383 | 377 | |
| 384 | 378 | $params = [ |
@@ -404,8 +398,7 @@ discard block |
||
| 404 | 398 | /** |
| 405 | 399 | * @param $identifier |
| 406 | 400 | */ |
| 407 | - public function getDocument($identifier) |
|
| 408 | - { |
|
| 401 | + public function getDocument($identifier) { |
|
| 409 | 402 | $params = [ |
| 410 | 403 | 'index' => $this->indexName, |
| 411 | 404 | 'id' => $identifier |
@@ -420,8 +413,7 @@ discard block |
||
| 420 | 413 | * @param array $query search query |
| 421 | 414 | * @return array result list |
| 422 | 415 | */ |
| 423 | - public function search($query, $type = null) |
|
| 424 | - { |
|
| 416 | + public function search($query, $type = null) { |
|
| 425 | 417 | try { |
| 426 | 418 | // define type and index |
| 427 | 419 | if (empty($query['index'])) { |
@@ -453,8 +445,7 @@ discard block |
||
| 453 | 445 | * Get the results |
| 454 | 446 | * @return mixed |
| 455 | 447 | */ |
| 456 | - public function getResults() |
|
| 457 | - { |
|
| 448 | + public function getResults() { |
|
| 458 | 449 | // return results from the last search request |
| 459 | 450 | return $this->results; |
| 460 | 451 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function searchRequest($searchTerm) { |
| 26 | 26 | $mail = $this->clientConfigurationManager->getSetting("adminEmail"); |
| 27 | - $response = Request::get($this->apiUrl . '' . $searchTerm .'?email=' . $mail) |
|
| 27 | + $response = Request::get($this->apiUrl . '' . $searchTerm . '?email=' . $mail) |
|
| 28 | 28 | ->send(); |
| 29 | 29 | if ($response->body->HTTP_status_code == 404) { |
| 30 | 30 | return ['entries' => '']; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function getDataRequest($id) { |
| 39 | 39 | $mail = $this->clientConfigurationManager->getSetting("adminEmail"); |
| 40 | - $response = Request::get($this->apiUrl . '' . $id .'?email=' . $mail) |
|
| 40 | + $response = Request::get($this->apiUrl . '' . $id . '?email=' . $mail) |
|
| 41 | 41 | ->send(); |
| 42 | 42 | |
| 43 | 43 | if ($response->body->HTTP_status_code == 404) { |
@@ -5,8 +5,7 @@ |
||
| 5 | 5 | use TYPO3\CMS\Extbase\Object\ObjectManager; |
| 6 | 6 | use \Httpful\Request; |
| 7 | 7 | |
| 8 | -class UnpaywallDataService |
|
| 9 | -{ |
|
| 8 | +class UnpaywallDataService { |
|
| 10 | 9 | /** |
| 11 | 10 | * clientConfigurationManager |
| 12 | 11 | * |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | protected function getPersonRequestBody($id) { |
| 48 | 48 | $graphQl = '{ |
| 49 | - person (id:"'.$id.'") |
|
| 49 | + person (id:"'.$id . '") |
|
| 50 | 50 | { |
| 51 | 51 | _createDate |
| 52 | 52 | _createUser |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | protected function getSearchPersonBody($searchTerm) { |
| 74 | 74 | $graphQl = '{ |
| 75 | - staff(filter: {fullName: "'.$searchTerm.'"}, pageSize: 100) |
|
| 75 | + staff(filter: {fullName: "'.$searchTerm . '"}, pageSize: 100) |
|
| 76 | 76 | { |
| 77 | 77 | entries |
| 78 | 78 | { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | protected function getOrgaRequestBody($id) { |
| 99 | 99 | $graphQl = '{ |
| 100 | - organisationalUnit(id:'.$id.') { |
|
| 100 | + organisationalUnit(id:'.$id . ') { |
|
| 101 | 101 | titleDe |
| 102 | 102 | id |
| 103 | 103 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | protected function getSearchOrgaBody($searchTerm) { |
| 110 | 110 | $graphQl = '{ |
| 111 | - organisationalUnits(filter: {text: "'.$searchTerm.'"}) |
|
| 111 | + organisationalUnits(filter: {text: "'.$searchTerm . '"}) |
|
| 112 | 112 | { |
| 113 | 113 | entries |
| 114 | 114 | { |
@@ -5,8 +5,7 @@ |
||
| 5 | 5 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
| 6 | 6 | use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; |
| 7 | 7 | |
| 8 | -class FisDataService |
|
| 9 | -{ |
|
| 8 | +class FisDataService { |
|
| 10 | 9 | /** |
| 11 | 10 | * @var string |
| 12 | 11 | */ |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | return $response->body->data->person; |
| 37 | 37 | } catch (\Throwable $e) { |
| 38 | - return null; |
|
| 38 | + return NULL; |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | return $response->body->data->staff; |
| 49 | 49 | } catch (\Throwable $e) { |
| 50 | - return null; |
|
| 50 | + return NULL; |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | return $response->body->data->organisationalUnit; |
| 61 | 61 | } catch (\Throwable $e) { |
| 62 | - return null; |
|
| 62 | + return NULL; |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | return $response->body->data->organisationalUnits; |
| 73 | 73 | } catch (\Throwable $e) { |
| 74 | - return null; |
|
| 74 | + return NULL; |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function getDataRequest($zdbId) { |
| 33 | - $response = Request::get($this->apiUrl . 'resource/' . $zdbId .'/') |
|
| 33 | + $response = Request::get($this->apiUrl . 'resource/' . $zdbId . '/') |
|
| 34 | 34 | ->send(); |
| 35 | 35 | |
| 36 | 36 | return $response->body; |
@@ -3,8 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | use \Httpful\Request; |
| 5 | 5 | |
| 6 | -class ZdbDataService |
|
| 7 | -{ |
|
| 6 | +class ZdbDataService { |
|
| 8 | 7 | |
| 9 | 8 | protected $apiUrl = 'https://www.zeitschriftendatenbank.de/api/hydra/'; |
| 10 | 9 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | public function searchPersonRequest($searchTerm) { |
| 21 | 21 | $response = Request::get($this->apiUrl . '/expanded-search/?q=' . $this->searchTermReplacement($searchTerm)) |
| 22 | 22 | ->expectsJson() |
| 23 | - ->addHeader('Accept','*/*') |
|
| 23 | + ->addHeader('Accept', '*/*') |
|
| 24 | 24 | ->addHeader('Content-Type', 'application/vnd.orcid+json') |
| 25 | 25 | ->send(); |
| 26 | 26 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function getPersonData($orcidId) { |
| 31 | 31 | $response = Request::get($this->apiUrl . '/expanded-search/?q=orcid:' . $orcidId) |
| 32 | 32 | ->expectsJson() |
| 33 | - ->addHeader('Accept','*/*') |
|
| 33 | + ->addHeader('Accept', '*/*') |
|
| 34 | 34 | ->addHeader('Content-Type', 'application/vnd.orcid+json') |
| 35 | 35 | ->send(); |
| 36 | 36 | |
@@ -3,8 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | use \Httpful\Request; |
| 5 | 5 | |
| 6 | -class OrcidDataService |
|
| 7 | -{ |
|
| 6 | +class OrcidDataService { |
|
| 8 | 7 | protected $apiUrl = 'https://pub.orcid.org/v3.0'; |
| 9 | 8 | |
| 10 | 9 | protected $params = '&start=0&rows=20'; |
@@ -3,8 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | use \Httpful\Request; |
| 5 | 5 | |
| 6 | -class RorDataService |
|
| 7 | -{ |
|
| 6 | +class RorDataService { |
|
| 8 | 7 | |
| 9 | 8 | protected $apiUrl = 'https://api.ror.org/organizations'; |
| 10 | 9 | |
@@ -3,8 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | use \Httpful\Request; |
| 5 | 5 | |
| 6 | -class GndDataService |
|
| 7 | -{ |
|
| 6 | +class GndDataService { |
|
| 8 | 7 | |
| 9 | 8 | protected $apiUrl = 'http://lobid.org/gnd/'; |
| 10 | 9 | |