@@ -34,8 +34,7 @@ discard block |
||
| 34 | 34 | /** |
| 35 | 35 | * DocumentController |
| 36 | 36 | */ |
| 37 | -class DocumentController extends AbstractController |
|
| 38 | -{ |
|
| 37 | +class DocumentController extends AbstractController { |
|
| 39 | 38 | |
| 40 | 39 | /** |
| 41 | 40 | * documentRepository |
@@ -134,8 +133,7 @@ discard block |
||
| 134 | 133 | /** |
| 135 | 134 | * DocumentController constructor. |
| 136 | 135 | */ |
| 137 | - public function __construct() |
|
| 138 | - { |
|
| 136 | + public function __construct() { |
|
| 139 | 137 | parent::__construct(); |
| 140 | 138 | |
| 141 | 139 | $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); |
@@ -150,8 +148,7 @@ discard block |
||
| 150 | 148 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 151 | 149 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 152 | 150 | */ |
| 153 | - public function logoutAction() |
|
| 154 | - { |
|
| 151 | + public function logoutAction() { |
|
| 155 | 152 | $cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class); |
| 156 | 153 | $uri = $cObj->typolink_URL([ |
| 157 | 154 | 'parameter' => $this->settings['loginPage'], |
@@ -389,8 +386,7 @@ discard block |
||
| 389 | 386 | * @param string $reason |
| 390 | 387 | * @return void |
| 391 | 388 | */ |
| 392 | - public function discardAction(Document $document, $tstamp, $reason = NULL) |
|
| 393 | - { |
|
| 389 | + public function discardAction(Document $document, $tstamp, $reason = NULL) { |
|
| 394 | 390 | if (!$this->authorizationChecker->isGranted(DocumentVoter::DISCARD, $document)) { |
| 395 | 391 | if ( |
| 396 | 392 | $this->editingLockService->isLocked( |
@@ -418,8 +414,7 @@ discard block |
||
| 418 | 414 | * @param string $reason |
| 419 | 415 | * @return void |
| 420 | 416 | */ |
| 421 | - public function postponeAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp, $reason = NULL) |
|
| 422 | - { |
|
| 417 | + public function postponeAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp, $reason = NULL) { |
|
| 423 | 418 | if (!$this->authorizationChecker->isGranted(DocumentVoter::POSTPONE, $document)) { |
| 424 | 419 | if ( |
| 425 | 420 | $this->editingLockService->isLocked( |
@@ -448,8 +443,7 @@ discard block |
||
| 448 | 443 | * @param integer $tstamp |
| 449 | 444 | * @return void |
| 450 | 445 | */ |
| 451 | - public function deleteLocallyAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) |
|
| 452 | - { |
|
| 446 | + public function deleteLocallyAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) { |
|
| 453 | 447 | if ($document->getObjectIdentifier()) { |
| 454 | 448 | $voterAttribute = DocumentVoter::DELETE_WORKING_COPY; |
| 455 | 449 | } else { |
@@ -525,8 +519,7 @@ discard block |
||
| 525 | 519 | * @param Document $document |
| 526 | 520 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 527 | 521 | */ |
| 528 | - public function duplicateAction(\EWW\Dpf\Domain\Model\Document $document) |
|
| 529 | - { |
|
| 522 | + public function duplicateAction(\EWW\Dpf\Domain\Model\Document $document) { |
|
| 530 | 523 | if (!$this->authorizationChecker->isGranted(DocumentVoter::DUPLICATE, $document)) { |
| 531 | 524 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_duplicate.accessDenied'; |
| 532 | 525 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
@@ -587,8 +580,7 @@ discard block |
||
| 587 | 580 | * @param integer $tstamp |
| 588 | 581 | * @return void |
| 589 | 582 | */ |
| 590 | - public function releasePublishAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) |
|
| 591 | - { |
|
| 583 | + public function releasePublishAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) { |
|
| 592 | 584 | if (!$this->authorizationChecker->isGranted(DocumentVoter::RELEASE_PUBLISH, $document)) { |
| 593 | 585 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_ingest.accessDenied'; |
| 594 | 586 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
@@ -608,8 +600,7 @@ discard block |
||
| 608 | 600 | * @param integer $tstamp |
| 609 | 601 | * @return void |
| 610 | 602 | */ |
| 611 | - public function releaseActivateAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) |
|
| 612 | - { |
|
| 603 | + public function releaseActivateAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) { |
|
| 613 | 604 | if (!$this->authorizationChecker->isGranted(DocumentVoter::RELEASE_ACTIVATE, $document)) { |
| 614 | 605 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_activate.accessDenied'; |
| 615 | 606 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
@@ -627,8 +618,7 @@ discard block |
||
| 627 | 618 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 628 | 619 | * @return void |
| 629 | 620 | */ |
| 630 | - public function registerAction(\EWW\Dpf\Domain\Model\Document $document) |
|
| 631 | - { |
|
| 621 | + public function registerAction(\EWW\Dpf\Domain\Model\Document $document) { |
|
| 632 | 622 | if (!$this->authorizationChecker->isGranted(DocumentVoter::REGISTER, $document)) { |
| 633 | 623 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_register.accessDenied'; |
| 634 | 624 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
@@ -666,8 +656,7 @@ discard block |
||
| 666 | 656 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 667 | 657 | * @return void |
| 668 | 658 | */ |
| 669 | - public function showDetailsAction(Document $document) |
|
| 670 | - { |
|
| 659 | + public function showDetailsAction(Document $document) { |
|
| 671 | 660 | if (!$this->authorizationChecker->isGranted(DocumentVoter::SHOW_DETAILS, $document)) { |
| 672 | 661 | $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_showDetails.accessDenied'; |
| 673 | 662 | $this->flashMessage($document, $key, AbstractMessage::ERROR); |
@@ -698,8 +687,7 @@ discard block |
||
| 698 | 687 | } |
| 699 | 688 | |
| 700 | 689 | |
| 701 | - public function cancelListTaskAction() |
|
| 702 | - { |
|
| 690 | + public function cancelListTaskAction() { |
|
| 703 | 691 | $this->redirectToDocumentList(); |
| 704 | 692 | } |
| 705 | 693 | |
@@ -742,8 +730,7 @@ discard block |
||
| 742 | 730 | /** |
| 743 | 731 | * initializeAction |
| 744 | 732 | */ |
| 745 | - public function initializeAction() |
|
| 746 | - { |
|
| 733 | + public function initializeAction() { |
|
| 747 | 734 | $this->authorizationChecker->denyAccessUnlessLoggedIn(); |
| 748 | 735 | |
| 749 | 736 | parent::initializeAction(); |
@@ -769,8 +756,7 @@ discard block |
||
| 769 | 756 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 770 | 757 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 771 | 758 | */ |
| 772 | - protected function redirectToDocumentList($message = null) |
|
| 773 | - { |
|
| 759 | + protected function redirectToDocumentList($message = null) { |
|
| 774 | 760 | list($action, $controller, $redirectUri) = $this->session->getStoredAction(); |
| 775 | 761 | |
| 776 | 762 | if ($redirectUri) { |
@@ -785,8 +771,7 @@ discard block |
||
| 785 | 771 | * |
| 786 | 772 | * @return mixed |
| 787 | 773 | */ |
| 788 | - protected function getStoragePID() |
|
| 789 | - { |
|
| 774 | + protected function getStoragePID() { |
|
| 790 | 775 | return $this->settings['persistence']['classes']['EWW\Dpf\Domain\Model\Document']['newRecordStoragePid']; |
| 791 | 776 | } |
| 792 | 777 | |
@@ -797,8 +782,7 @@ discard block |
||
| 797 | 782 | * @param string $severity |
| 798 | 783 | * @param string $defaultMessage |
| 799 | 784 | */ |
| 800 | - protected function flashMessage(\EWW\Dpf\Domain\Model\Document $document, $key, $severity, $defaultMessage = "") |
|
| 801 | - { |
|
| 785 | + protected function flashMessage(\EWW\Dpf\Domain\Model\Document $document, $key, $severity, $defaultMessage = "") { |
|
| 802 | 786 | // Show success or failure of the action in a flash message |
| 803 | 787 | if ($document) { |
| 804 | 788 | $args[] = $document->getTitle(); |
@@ -825,8 +809,7 @@ discard block |
||
| 825 | 809 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 826 | 810 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 827 | 811 | */ |
| 828 | - protected function updateDocument(\EWW\Dpf\Domain\Model\Document $document, $workflowTransition, $reason) |
|
| 829 | - { |
|
| 812 | + protected function updateDocument(\EWW\Dpf\Domain\Model\Document $document, $workflowTransition, $reason) { |
|
| 830 | 813 | switch ($workflowTransition) { |
| 831 | 814 | case DocumentWorkflow::TRANSITION_DISCARD: |
| 832 | 815 | $messageKeyPart = 'document_discard'; |
@@ -28,8 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | use TYPO3\CMS\Extbase\Persistence\ObjectStorage; |
| 30 | 30 | |
| 31 | -class DocumentFormBackofficeController extends AbstractDocumentFormController |
|
| 32 | -{ |
|
| 31 | +class DocumentFormBackofficeController extends AbstractDocumentFormController { |
|
| 33 | 32 | /** |
| 34 | 33 | * documentTransferManager |
| 35 | 34 | * |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | /** |
| 72 | 71 | * DocumentController constructor. |
| 73 | 72 | */ |
| 74 | - public function __construct() |
|
| 75 | - { |
|
| 73 | + public function __construct() { |
|
| 76 | 74 | parent::__construct(); |
| 77 | 75 | |
| 78 | 76 | $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); |
@@ -113,8 +111,7 @@ discard block |
||
| 113 | 111 | */ |
| 114 | 112 | public function editAction( |
| 115 | 113 | \EWW\Dpf\Domain\Model\DocumentForm $documentForm, bool $suggestMod = false, $activeFileTab = false |
| 116 | - ) |
|
| 117 | - { |
|
| 114 | + ) { |
|
| 118 | 115 | /** @var \EWW\Dpf\Domain\Model\Document $document */ |
| 119 | 116 | $document = $this->documentRepository->findByUid($documentForm->getDocumentUid()); |
| 120 | 117 | |
@@ -161,8 +158,7 @@ discard block |
||
| 161 | 158 | * @param \EWW\Dpf\Domain\Model\DocumentForm $documentForm |
| 162 | 159 | * @param bool $restore |
| 163 | 160 | */ |
| 164 | - public function createSuggestionDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $restore = FALSE) |
|
| 165 | - { |
|
| 161 | + public function createSuggestionDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $restore = FALSE) { |
|
| 166 | 162 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
| 167 | 163 | |
| 168 | 164 | $hasFilesFlag = true; |
@@ -233,8 +229,7 @@ discard block |
||
| 233 | 229 | } |
| 234 | 230 | |
| 235 | 231 | |
| 236 | - public function updateAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm) |
|
| 237 | - { |
|
| 232 | + public function updateAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm) { |
|
| 238 | 233 | if ($this->request->getArgument('documentData')['suggestMod']) { |
| 239 | 234 | $restore = $this->request->getArgument('documentData')['suggestRestore']; |
| 240 | 235 | $this->forward('createSuggestionDocument', null, null, ['documentForm' => $documentForm, 'restore' => $restore]); |
@@ -267,8 +262,7 @@ discard block |
||
| 267 | 262 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 268 | 263 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 269 | 264 | */ |
| 270 | - public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = null) |
|
| 271 | - { |
|
| 265 | + public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = null) { |
|
| 272 | 266 | try { |
| 273 | 267 | /** @var \EWW\Dpf\Domain\Model\Document $document */ |
| 274 | 268 | $document = $this->documentRepository->findByUid($documentForm->getDocumentUid()); |
@@ -415,8 +409,7 @@ discard block |
||
| 415 | 409 | } |
| 416 | 410 | } |
| 417 | 411 | |
| 418 | - public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm) |
|
| 419 | - { |
|
| 412 | + public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm) { |
|
| 420 | 413 | /** @var \EWW\Dpf\Helper\DocumentMapper $documentMapper */ |
| 421 | 414 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
| 422 | 415 | |
@@ -481,8 +474,7 @@ discard block |
||
| 481 | 474 | * |
| 482 | 475 | * @return void |
| 483 | 476 | */ |
| 484 | - public function cancelEditAction($documentUid = 0) |
|
| 485 | - { |
|
| 477 | + public function cancelEditAction($documentUid = 0) { |
|
| 486 | 478 | if ($documentUid) { |
| 487 | 479 | /** @var $document \EWW\Dpf\Domain\Model\Document */ |
| 488 | 480 | $document = $this->documentRepository->findByUid($documentUid); |
@@ -501,14 +493,12 @@ discard block |
||
| 501 | 493 | * |
| 502 | 494 | * @return void |
| 503 | 495 | */ |
| 504 | - public function cancelNewAction() |
|
| 505 | - { |
|
| 496 | + public function cancelNewAction() { |
|
| 506 | 497 | $this->redirect('list'); |
| 507 | 498 | } |
| 508 | 499 | |
| 509 | 500 | |
| 510 | - public function initializeAction() |
|
| 511 | - { |
|
| 501 | + public function initializeAction() { |
|
| 512 | 502 | $this->authorizationChecker->denyAccessUnlessLoggedIn(); |
| 513 | 503 | |
| 514 | 504 | parent::initializeAction(); |
@@ -522,8 +512,7 @@ discard block |
||
| 522 | 512 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException |
| 523 | 513 | * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException |
| 524 | 514 | */ |
| 525 | - protected function redirectToDocumentList($message = null) |
|
| 526 | - { |
|
| 515 | + protected function redirectToDocumentList($message = null) { |
|
| 527 | 516 | list($action, $controller, $redirectUri) = $this->session->getStoredAction(); |
| 528 | 517 | |
| 529 | 518 | if ($redirectUri) { |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * DocumentFormController |
| 27 | 27 | */ |
| 28 | -abstract class AbstractDocumentFormController extends AbstractController |
|
| 29 | -{ |
|
| 28 | +abstract class AbstractDocumentFormController extends AbstractController { |
|
| 30 | 29 | |
| 31 | 30 | /** |
| 32 | 31 | * documentRepository |
@@ -81,8 +80,7 @@ discard block |
||
| 81 | 80 | * |
| 82 | 81 | * @return void |
| 83 | 82 | */ |
| 84 | - public function listAction() |
|
| 85 | - { |
|
| 83 | + public function listAction() { |
|
| 86 | 84 | $documents = $this->documentRepository->findAll(); |
| 87 | 85 | |
| 88 | 86 | $documentTypes = $this->documentTypeRepository->findAll(); |
@@ -127,8 +125,7 @@ discard block |
||
| 127 | 125 | * |
| 128 | 126 | * @return void |
| 129 | 127 | */ |
| 130 | - public function initializeNewAction() |
|
| 131 | - { |
|
| 128 | + public function initializeNewAction() { |
|
| 132 | 129 | |
| 133 | 130 | $requestArguments = $this->request->getArguments(); |
| 134 | 131 | |
@@ -157,14 +154,12 @@ discard block |
||
| 157 | 154 | * @ignorevalidation $newDocumentForm |
| 158 | 155 | * @return void |
| 159 | 156 | */ |
| 160 | - public function newAction(DocumentForm $newDocumentForm = null, $returnDocumentId = 0) |
|
| 161 | - { |
|
| 157 | + public function newAction(DocumentForm $newDocumentForm = null, $returnDocumentId = 0) { |
|
| 162 | 158 | $this->view->assign('returnDocumentId', $returnDocumentId); |
| 163 | 159 | $this->view->assign('documentForm', $newDocumentForm); |
| 164 | 160 | } |
| 165 | 161 | |
| 166 | - public function initializeCreateAction() |
|
| 167 | - { |
|
| 162 | + public function initializeCreateAction() { |
|
| 168 | 163 | |
| 169 | 164 | $requestArguments = $this->request->getArguments(); |
| 170 | 165 | |
@@ -198,8 +193,7 @@ discard block |
||
| 198 | 193 | * @param \EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm |
| 199 | 194 | * @return void |
| 200 | 195 | */ |
| 201 | - public function createAction(DocumentForm $newDocumentForm) |
|
| 202 | - { |
|
| 196 | + public function createAction(DocumentForm $newDocumentForm) { |
|
| 203 | 197 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
| 204 | 198 | |
| 205 | 199 | /* @var $newDocument \EWW\Dpf\Domain\Model\Document */ |
@@ -248,8 +242,7 @@ discard block |
||
| 248 | 242 | |
| 249 | 243 | } |
| 250 | 244 | |
| 251 | - public function initializeEditAction() |
|
| 252 | - { |
|
| 245 | + public function initializeEditAction() { |
|
| 253 | 246 | $requestArguments = $this->request->getArguments(); |
| 254 | 247 | |
| 255 | 248 | if (array_key_exists('document', $requestArguments)) { |
@@ -279,13 +272,11 @@ discard block |
||
| 279 | 272 | * @ignorevalidation $documentForm |
| 280 | 273 | * @return void |
| 281 | 274 | */ |
| 282 | - public function editAction(DocumentForm $documentForm) |
|
| 283 | - { |
|
| 275 | + public function editAction(DocumentForm $documentForm) { |
|
| 284 | 276 | $this->view->assign('documentForm', $documentForm); |
| 285 | 277 | } |
| 286 | 278 | |
| 287 | - public function initializeUpdateAction() |
|
| 288 | - { |
|
| 279 | + public function initializeUpdateAction() { |
|
| 289 | 280 | $requestArguments = $this->request->getArguments(); |
| 290 | 281 | |
| 291 | 282 | if ($this->request->hasArgument('documentData')) { |
@@ -318,8 +309,7 @@ discard block |
||
| 318 | 309 | * @param \EWW\Dpf\Domain\Model\DocumentForm $documentForm |
| 319 | 310 | * @return void |
| 320 | 311 | */ |
| 321 | - public function updateAction(DocumentForm $documentForm) |
|
| 322 | - { |
|
| 312 | + public function updateAction(DocumentForm $documentForm) { |
|
| 323 | 313 | $documentMapper = $this->objectManager->get(DocumentMapper::class); |
| 324 | 314 | |
| 325 | 315 | /* @var $updateDocument \EWW\Dpf\Domain\Model\Document */ |
@@ -360,18 +350,15 @@ discard block |
||
| 360 | 350 | * |
| 361 | 351 | * @return void |
| 362 | 352 | */ |
| 363 | - public function cancelAction() |
|
| 364 | - { |
|
| 353 | + public function cancelAction() { |
|
| 365 | 354 | $this->redirectToList(); |
| 366 | 355 | } |
| 367 | 356 | |
| 368 | - protected function redirectAfterUpdate() |
|
| 369 | - { |
|
| 357 | + protected function redirectAfterUpdate() { |
|
| 370 | 358 | $this->redirect('list'); |
| 371 | 359 | } |
| 372 | 360 | |
| 373 | - protected function redirectToList($message = null) |
|
| 374 | - { |
|
| 361 | + protected function redirectToList($message = null) { |
|
| 375 | 362 | $this->redirect('list'); |
| 376 | 363 | } |
| 377 | 364 | |
@@ -17,8 +17,7 @@ discard block |
||
| 17 | 17 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
| 18 | 18 | use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; |
| 19 | 19 | |
| 20 | -class FileUrlViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper |
|
| 21 | -{ |
|
| 20 | +class FileUrlViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper { |
|
| 22 | 21 | /** |
| 23 | 22 | * Secret API key for delivering inactive documents. |
| 24 | 23 | * @var string |
@@ -44,8 +43,7 @@ discard block |
||
| 44 | 43 | * @param string $uri |
| 45 | 44 | * |
| 46 | 45 | */ |
| 47 | - public function render($uri) |
|
| 48 | - { |
|
| 46 | + public function render($uri) { |
|
| 49 | 47 | $fileUri = $this->buildFileUri($uri); |
| 50 | 48 | |
| 51 | 49 | // pass configured API secret key parameter to enable dissemination for inactive documents |
@@ -59,8 +57,7 @@ discard block |
||
| 59 | 57 | /** |
| 60 | 58 | * Construct file URI |
| 61 | 59 | */ |
| 62 | - protected function buildFileUri($uri) |
|
| 63 | - { |
|
| 60 | + protected function buildFileUri($uri) { |
|
| 64 | 61 | $uploadFileUrl = new \EWW\Dpf\Helper\UploadFileUrl; |
| 65 | 62 | |
| 66 | 63 | if (strpos(strtolower($uri), "datastreams")) { |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | * The TYPO3 project - inspiring people to share! |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -class DocumentCleaner |
|
| 18 | -{ |
|
| 17 | +class DocumentCleaner { |
|
| 19 | 18 | |
| 20 | 19 | /** |
| 21 | 20 | * clientRepository |
@@ -55,8 +54,7 @@ discard block |
||
| 55 | 54 | * @param \EWW\Dpf\Domain\Model\Document $openedDocument |
| 56 | 55 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 57 | 56 | */ |
| 58 | - public function cleanUpDocuments($actionMethodName, $controllerClass) |
|
| 59 | - { |
|
| 57 | + public function cleanUpDocuments($actionMethodName, $controllerClass) { |
|
| 60 | 58 | $excludeActions = [ |
| 61 | 59 | \EWW\Dpf\Controller\DocumentController::class => [ |
| 62 | 60 | 'showDetailsAction', |
@@ -105,8 +103,7 @@ discard block |
||
| 105 | 103 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 106 | 104 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException |
| 107 | 105 | */ |
| 108 | - protected function cleanUpOutdatedTemporaryDocuments() |
|
| 109 | - { |
|
| 106 | + protected function cleanUpOutdatedTemporaryDocuments() { |
|
| 110 | 107 | // Remove outdated temporary documents from the document table. |
| 111 | 108 | $outdatedTemporaryDocuments = $this->documentRepository->findOutdatedTemporaryDocuments(3600); |
| 112 | 109 | foreach ($outdatedTemporaryDocuments as $outdatedTemporaryDocument) { |
@@ -119,8 +116,7 @@ discard block |
||
| 119 | 116 | /** |
| 120 | 117 | * Unlocks all editing locks of the current user. |
| 121 | 118 | */ |
| 122 | - protected function cleanUpEditingLocks($actionMethodName, $controllerClass) |
|
| 123 | - { |
|
| 119 | + protected function cleanUpEditingLocks($actionMethodName, $controllerClass) { |
|
| 124 | 120 | $excludeActions = [ |
| 125 | 121 | \EWW\Dpf\Controller\DocumentController::class => [ |
| 126 | 122 | 'duplicateAction' |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | use EWW\Dpf\Domain\Workflow\DocumentWorkflow; |
| 20 | 20 | use EWW\Dpf\Services\ProcessNumber\ProcessNumberGenerator; |
| 21 | 21 | |
| 22 | -class DocumentMapper |
|
| 23 | -{ |
|
| 22 | +class DocumentMapper { |
|
| 24 | 23 | |
| 25 | 24 | /** |
| 26 | 25 | * objectManager |
@@ -77,8 +76,7 @@ discard block |
||
| 77 | 76 | * @param bool $generateEmptyFields |
| 78 | 77 | * @return \EWW\Dpf\Domain\Model\DocumentForm |
| 79 | 78 | */ |
| 80 | - public function getDocumentForm(Document $document, $generateEmptyFields = true) |
|
| 81 | - { |
|
| 79 | + public function getDocumentForm(Document $document, $generateEmptyFields = true) { |
|
| 82 | 80 | $documentForm = new \EWW\Dpf\Domain\Model\DocumentForm(); |
| 83 | 81 | $documentForm->setUid($document->getDocumentType()->getUid()); |
| 84 | 82 | $documentForm->setDisplayName($document->getDocumentType()->getDisplayName()); |
@@ -298,8 +296,7 @@ discard block |
||
| 298 | 296 | return $documentForm; |
| 299 | 297 | } |
| 300 | 298 | |
| 301 | - public function getDocument($documentForm) |
|
| 302 | - { |
|
| 299 | + public function getDocument($documentForm) { |
|
| 303 | 300 | |
| 304 | 301 | if ($documentForm->getDocumentUid()) { |
| 305 | 302 | $document = $this->documentRepository->findByUid($documentForm->getDocumentUid()); |
@@ -357,8 +354,7 @@ discard block |
||
| 357 | 354 | return $document; |
| 358 | 355 | } |
| 359 | 356 | |
| 360 | - public function getMetadata($documentForm) |
|
| 361 | - { |
|
| 357 | + public function getMetadata($documentForm) { |
|
| 362 | 358 | |
| 363 | 359 | foreach ($documentForm->getItems() as $page) { |
| 364 | 360 | |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | |
| 18 | -class Mods |
|
| 19 | -{ |
|
| 18 | +class Mods { |
|
| 20 | 19 | /** |
| 21 | 20 | * metadataObjectRepository |
| 22 | 21 | * |
@@ -36,13 +35,11 @@ discard block |
||
| 36 | 35 | |
| 37 | 36 | protected $modsDom; |
| 38 | 37 | |
| 39 | - public function __construct($modsXml) |
|
| 40 | - { |
|
| 38 | + public function __construct($modsXml) { |
|
| 41 | 39 | $this->setModsXml($modsXml); |
| 42 | 40 | } |
| 43 | 41 | |
| 44 | - public function setModsXml($modsXml) |
|
| 45 | - { |
|
| 42 | + public function setModsXml($modsXml) { |
|
| 46 | 43 | $modsDom = new \DOMDocument(); |
| 47 | 44 | if (!empty($modsXml)) { |
| 48 | 45 | if (is_null(@$modsDom->loadXML($modsXml))) { |
@@ -52,19 +49,16 @@ discard block |
||
| 52 | 49 | $this->modsDom = $modsDom; |
| 53 | 50 | } |
| 54 | 51 | |
| 55 | - public function getModsXml() |
|
| 56 | - { |
|
| 52 | + public function getModsXml() { |
|
| 57 | 53 | return $this->modsDom->saveXML(); |
| 58 | 54 | } |
| 59 | 55 | |
| 60 | - public function getModsXpath() |
|
| 61 | - { |
|
| 56 | + public function getModsXpath() { |
|
| 62 | 57 | $xpath = \EWW\Dpf\Helper\XPath::create($this->modsDom); |
| 63 | 58 | return $xpath; |
| 64 | 59 | } |
| 65 | 60 | |
| 66 | - public function getTitle() |
|
| 67 | - { |
|
| 61 | + public function getTitle() { |
|
| 68 | 62 | $titleNode = $this->getModsXpath()->query('/mods:mods/mods:titleInfo[@usage="primary"]/mods:title'); |
| 69 | 63 | |
| 70 | 64 | if ($titleNode->length == 0) { |
@@ -74,8 +68,7 @@ discard block |
||
| 74 | 68 | } |
| 75 | 69 | |
| 76 | 70 | |
| 77 | - public function setTitle($title) |
|
| 78 | - { |
|
| 71 | + public function setTitle($title) { |
|
| 79 | 72 | $titleNode = $this->getModsXpath()->query('/mods:mods/mods:titleInfo[@usage="primary"]/mods:title'); |
| 80 | 73 | |
| 81 | 74 | if ($titleNode->length == 0) { |
@@ -88,13 +81,11 @@ discard block |
||
| 88 | 81 | } |
| 89 | 82 | |
| 90 | 83 | |
| 91 | - public function getAuthors() |
|
| 92 | - { |
|
| 84 | + public function getAuthors() { |
|
| 93 | 85 | return $this->getPersons("aut"); |
| 94 | 86 | } |
| 95 | 87 | |
| 96 | - public function getPublishers() |
|
| 97 | - { |
|
| 88 | + public function getPublishers() { |
|
| 98 | 89 | return $this->getPersons("edt"); |
| 99 | 90 | } |
| 100 | 91 | |
@@ -104,8 +95,7 @@ discard block |
||
| 104 | 95 | * @param $role |
| 105 | 96 | * @return array |
| 106 | 97 | */ |
| 107 | - protected function getPersons($role) |
|
| 108 | - { |
|
| 98 | + protected function getPersons($role) { |
|
| 109 | 99 | $xpath = $this->getModsXpath(); |
| 110 | 100 | |
| 111 | 101 | $authorNode = $xpath->query('/mods:mods/mods:name[mods:role/mods:roleTerm[@type="code"]="'.$role.'"]'); |
@@ -134,8 +124,7 @@ discard block |
||
| 134 | 124 | return $authors; |
| 135 | 125 | } |
| 136 | 126 | |
| 137 | - public function setDateIssued($date) |
|
| 138 | - { |
|
| 127 | + public function setDateIssued($date) { |
|
| 139 | 128 | |
| 140 | 129 | $originInfo = $this->getModsXpath()->query('/mods:mods/mods:originInfo[@eventType="distribution"]'); |
| 141 | 130 | |
@@ -175,8 +164,7 @@ discard block |
||
| 175 | 164 | } |
| 176 | 165 | |
| 177 | 166 | |
| 178 | - public function getPublishingYear() |
|
| 179 | - { |
|
| 167 | + public function getPublishingYear() { |
|
| 180 | 168 | $year = $this->getModsXpath()->query('/mods:mods/mods:originInfo[@eventType="publication"]/mods:dateIssued[@encoding="iso8601"]'); |
| 181 | 169 | if ($year->length > 0) { |
| 182 | 170 | return $year->item(0)->nodeValue; |
@@ -185,8 +173,7 @@ discard block |
||
| 185 | 173 | return null; |
| 186 | 174 | } |
| 187 | 175 | |
| 188 | - public function getOriginalSourceTitle() |
|
| 189 | - { |
|
| 176 | + public function getOriginalSourceTitle() { |
|
| 190 | 177 | $node= $this->getModsXpath()->query('/mods:mods/mods:relatedItem[@type="original"]/mods:titleInfo/mods:title'); |
| 191 | 178 | if ($node->length > 0) { |
| 192 | 179 | return $node->item(0)->nodeValue; |
@@ -195,8 +182,7 @@ discard block |
||
| 195 | 182 | return null; |
| 196 | 183 | } |
| 197 | 184 | |
| 198 | - public function getDateIssued() |
|
| 199 | - { |
|
| 185 | + public function getDateIssued() { |
|
| 200 | 186 | |
| 201 | 187 | $dateIssued = $this->getModsXpath()->query('/mods:mods/mods:originInfo[@eventType="distribution"]/mods:dateIssued[@encoding="iso8601"][@keyDate="yes"]'); |
| 202 | 188 | if ($dateIssued->length > 0) { |
@@ -206,8 +192,7 @@ discard block |
||
| 206 | 192 | return null; |
| 207 | 193 | } |
| 208 | 194 | |
| 209 | - public function removeDateIssued() |
|
| 210 | - { |
|
| 195 | + public function removeDateIssued() { |
|
| 211 | 196 | |
| 212 | 197 | $dateIssued = $this->getModsXpath()->query('/mods:mods/mods:originInfo[@eventType="distribution"]/mods:dateIssued[@encoding="iso8601"][@keyDate="yes"]'); |
| 213 | 198 | if ($dateIssued->length > 0) { |
@@ -216,8 +201,7 @@ discard block |
||
| 216 | 201 | |
| 217 | 202 | } |
| 218 | 203 | |
| 219 | - public function hasQucosaUrn() |
|
| 220 | - { |
|
| 204 | + public function hasQucosaUrn() { |
|
| 221 | 205 | $urnNodeList = $this->getModsXpath()->query('/mods:mods/mods:identifier[@type="qucosa:urn"]'); |
| 222 | 206 | |
| 223 | 207 | $hasUrn = false; |
@@ -230,8 +214,7 @@ discard block |
||
| 230 | 214 | return $hasUrn; |
| 231 | 215 | } |
| 232 | 216 | |
| 233 | - public function getQucosaUrn() |
|
| 234 | - { |
|
| 217 | + public function getQucosaUrn() { |
|
| 235 | 218 | $urnNodeList = $this->getModsXpath()->query('/mods:mods/mods:identifier[@type="qucosa:urn"]'); |
| 236 | 219 | $urnList = ''; |
| 237 | 220 | |
@@ -243,8 +226,7 @@ discard block |
||
| 243 | 226 | return $urnList; |
| 244 | 227 | } |
| 245 | 228 | |
| 246 | - public function addQucosaUrn($urn) |
|
| 247 | - { |
|
| 229 | + public function addQucosaUrn($urn) { |
|
| 248 | 230 | $rootNode = $this->getModsXpath()->query('/mods:mods'); |
| 249 | 231 | |
| 250 | 232 | if ($rootNode->length == 1) { |
@@ -258,8 +240,7 @@ discard block |
||
| 258 | 240 | |
| 259 | 241 | } |
| 260 | 242 | |
| 261 | - public function clearAllUrn() |
|
| 262 | - { |
|
| 243 | + public function clearAllUrn() { |
|
| 263 | 244 | $urnNodeList = $this->getModsXpath()->query('/mods:mods/mods:identifier[@type="urn"]'); |
| 264 | 245 | |
| 265 | 246 | foreach ($urnNodeList as $urnNode) { |
@@ -275,8 +256,7 @@ discard block |
||
| 275 | 256 | /** |
| 276 | 257 | * @return string |
| 277 | 258 | */ |
| 278 | - public function getSourceDetails() |
|
| 279 | - { |
|
| 259 | + public function getSourceDetails() { |
|
| 280 | 260 | $data = []; |
| 281 | 261 | |
| 282 | 262 | $dataNodes[] = $this->getModsXpath()->query('/mods:mods/mods:relatedItem[@type="original"]'); |
@@ -17,8 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * File |
| 19 | 19 | */ |
| 20 | -class File extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity |
|
| 21 | -{ |
|
| 20 | +class File extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { |
|
| 22 | 21 | |
| 23 | 22 | /** |
| 24 | 23 | * title |
@@ -110,8 +109,7 @@ discard block |
||
| 110 | 109 | * |
| 111 | 110 | * @return string $title |
| 112 | 111 | */ |
| 113 | - public function getTitle() |
|
| 114 | - { |
|
| 112 | + public function getTitle() { |
|
| 115 | 113 | return $this->title; |
| 116 | 114 | } |
| 117 | 115 | |
@@ -121,8 +119,7 @@ discard block |
||
| 121 | 119 | * @param string $title |
| 122 | 120 | * @return void |
| 123 | 121 | */ |
| 124 | - public function setTitle($title) |
|
| 125 | - { |
|
| 122 | + public function setTitle($title) { |
|
| 126 | 123 | $this->title = $title; |
| 127 | 124 | } |
| 128 | 125 | |
@@ -131,8 +128,7 @@ discard block |
||
| 131 | 128 | * |
| 132 | 129 | * @return string $label |
| 133 | 130 | */ |
| 134 | - public function getLabel() |
|
| 135 | - { |
|
| 131 | + public function getLabel() { |
|
| 136 | 132 | return $this->label; |
| 137 | 133 | } |
| 138 | 134 | |
@@ -142,8 +138,7 @@ discard block |
||
| 142 | 138 | * @param string $label |
| 143 | 139 | * @return void |
| 144 | 140 | */ |
| 145 | - public function setLabel($label) |
|
| 146 | - { |
|
| 141 | + public function setLabel($label) { |
|
| 147 | 142 | $this->label = $label; |
| 148 | 143 | } |
| 149 | 144 | |
@@ -152,8 +147,7 @@ discard block |
||
| 152 | 147 | * |
| 153 | 148 | * @return boolean $download |
| 154 | 149 | */ |
| 155 | - public function getDownload() |
|
| 156 | - { |
|
| 150 | + public function getDownload() { |
|
| 157 | 151 | return $this->download; |
| 158 | 152 | } |
| 159 | 153 | |
@@ -163,8 +157,7 @@ discard block |
||
| 163 | 157 | * @param string $download |
| 164 | 158 | * @return void |
| 165 | 159 | */ |
| 166 | - public function setDownload($download) |
|
| 167 | - { |
|
| 160 | + public function setDownload($download) { |
|
| 168 | 161 | $this->download = $download; |
| 169 | 162 | } |
| 170 | 163 | |
@@ -173,8 +166,7 @@ discard block |
||
| 173 | 166 | * |
| 174 | 167 | * @return boolean $archive |
| 175 | 168 | */ |
| 176 | - public function getArchive() |
|
| 177 | - { |
|
| 169 | + public function getArchive() { |
|
| 178 | 170 | return $this->archive; |
| 179 | 171 | } |
| 180 | 172 | |
@@ -184,8 +176,7 @@ discard block |
||
| 184 | 176 | * @param boolean $archive |
| 185 | 177 | * @return void |
| 186 | 178 | */ |
| 187 | - public function setArchive($archive) |
|
| 188 | - { |
|
| 179 | + public function setArchive($archive) { |
|
| 189 | 180 | $this->archive = $archive; |
| 190 | 181 | } |
| 191 | 182 | |
@@ -194,8 +185,7 @@ discard block |
||
| 194 | 185 | * |
| 195 | 186 | * @return boolean $fileGroupDeleted |
| 196 | 187 | */ |
| 197 | - public function isFileGroupDeleted() |
|
| 198 | - { |
|
| 188 | + public function isFileGroupDeleted() { |
|
| 199 | 189 | return $this->fileGroupDeleted; |
| 200 | 190 | } |
| 201 | 191 | |
@@ -204,8 +194,7 @@ discard block |
||
| 204 | 194 | * |
| 205 | 195 | * @return boolean $fileGroupDeleted |
| 206 | 196 | */ |
| 207 | - public function setFileGroupDeleted($fileGroupDeleted) |
|
| 208 | - { |
|
| 197 | + public function setFileGroupDeleted($fileGroupDeleted) { |
|
| 209 | 198 | $this->fileGroupDeleted = $fileGroupDeleted; |
| 210 | 199 | } |
| 211 | 200 | |
@@ -214,8 +203,7 @@ discard block |
||
| 214 | 203 | * |
| 215 | 204 | * @return string $contentType |
| 216 | 205 | */ |
| 217 | - public function getContentType() |
|
| 218 | - { |
|
| 206 | + public function getContentType() { |
|
| 219 | 207 | return $this->contentType; |
| 220 | 208 | } |
| 221 | 209 | |
@@ -225,8 +213,7 @@ discard block |
||
| 225 | 213 | * @param string $contentType |
| 226 | 214 | * @return void |
| 227 | 215 | */ |
| 228 | - public function setContentType($contentType) |
|
| 229 | - { |
|
| 216 | + public function setContentType($contentType) { |
|
| 230 | 217 | $this->contentType = $contentType; |
| 231 | 218 | } |
| 232 | 219 | |
@@ -235,8 +222,7 @@ discard block |
||
| 235 | 222 | * |
| 236 | 223 | * @return string $link |
| 237 | 224 | */ |
| 238 | - public function getLink() |
|
| 239 | - { |
|
| 225 | + public function getLink() { |
|
| 240 | 226 | return $this->link; |
| 241 | 227 | } |
| 242 | 228 | |
@@ -246,8 +232,7 @@ discard block |
||
| 246 | 232 | * @param string $link |
| 247 | 233 | * @return void |
| 248 | 234 | */ |
| 249 | - public function setLink($link) |
|
| 250 | - { |
|
| 235 | + public function setLink($link) { |
|
| 251 | 236 | $this->link = $link; |
| 252 | 237 | } |
| 253 | 238 | |
@@ -256,8 +241,7 @@ discard block |
||
| 256 | 241 | * |
| 257 | 242 | * @return string $status |
| 258 | 243 | */ |
| 259 | - public function getStatus() |
|
| 260 | - { |
|
| 244 | + public function getStatus() { |
|
| 261 | 245 | return $this->status; |
| 262 | 246 | } |
| 263 | 247 | |
@@ -267,8 +251,7 @@ discard block |
||
| 267 | 251 | * @param string $status |
| 268 | 252 | * @return void |
| 269 | 253 | */ |
| 270 | - public function setStatus($status) |
|
| 271 | - { |
|
| 254 | + public function setStatus($status) { |
|
| 272 | 255 | $this->status = $status; |
| 273 | 256 | } |
| 274 | 257 | |
@@ -277,8 +260,7 @@ discard block |
||
| 277 | 260 | * |
| 278 | 261 | * @return \EWW\Dpf\Domain\Model\Document $document |
| 279 | 262 | */ |
| 280 | - public function getDocument() |
|
| 281 | - { |
|
| 263 | + public function getDocument() { |
|
| 282 | 264 | return $this->document; |
| 283 | 265 | } |
| 284 | 266 | |
@@ -288,8 +270,7 @@ discard block |
||
| 288 | 270 | * @param \EWW\Dpf\Domain\Model\Document $document |
| 289 | 271 | * @return void |
| 290 | 272 | */ |
| 291 | - public function setDocument(\EWW\Dpf\Domain\Model\Document $document) |
|
| 292 | - { |
|
| 273 | + public function setDocument(\EWW\Dpf\Domain\Model\Document $document) { |
|
| 293 | 274 | $this->document = $document; |
| 294 | 275 | } |
| 295 | 276 | |
@@ -298,8 +279,7 @@ discard block |
||
| 298 | 279 | * |
| 299 | 280 | * @return boolean $primaryFile |
| 300 | 281 | */ |
| 301 | - public function getPrimaryFile() |
|
| 302 | - { |
|
| 282 | + public function getPrimaryFile() { |
|
| 303 | 283 | return $this->primaryFile; |
| 304 | 284 | } |
| 305 | 285 | |
@@ -309,8 +289,7 @@ discard block |
||
| 309 | 289 | * @param boolean $primaryFile |
| 310 | 290 | * @return void |
| 311 | 291 | */ |
| 312 | - public function setPrimaryFile($primaryFile) |
|
| 313 | - { |
|
| 292 | + public function setPrimaryFile($primaryFile) { |
|
| 314 | 293 | $this->primaryFile = $primaryFile; |
| 315 | 294 | } |
| 316 | 295 | |
@@ -319,8 +298,7 @@ discard block |
||
| 319 | 298 | * |
| 320 | 299 | * @return boolean |
| 321 | 300 | */ |
| 322 | - public function isPrimaryFile() |
|
| 323 | - { |
|
| 301 | + public function isPrimaryFile() { |
|
| 324 | 302 | return $this->primaryFile; |
| 325 | 303 | } |
| 326 | 304 | |
@@ -329,8 +307,7 @@ discard block |
||
| 329 | 307 | * |
| 330 | 308 | * @return string $datastreamIdentifier |
| 331 | 309 | */ |
| 332 | - public function getDatastreamIdentifier() |
|
| 333 | - { |
|
| 310 | + public function getDatastreamIdentifier() { |
|
| 334 | 311 | return $this->datastreamIdentifier; |
| 335 | 312 | } |
| 336 | 313 | |
@@ -340,8 +317,7 @@ discard block |
||
| 340 | 317 | * @param string $datastreamIdentifier |
| 341 | 318 | * @return void |
| 342 | 319 | */ |
| 343 | - public function setDatastreamIdentifier($datastreamIdentifier) |
|
| 344 | - { |
|
| 320 | + public function setDatastreamIdentifier($datastreamIdentifier) { |
|
| 345 | 321 | $this->datastreamIdentifier = $datastreamIdentifier; |
| 346 | 322 | } |
| 347 | 323 | |
@@ -373,8 +349,7 @@ discard block |
||
| 373 | 349 | * |
| 374 | 350 | * @return string |
| 375 | 351 | */ |
| 376 | - public function getUrl() |
|
| 377 | - { |
|
| 352 | + public function getUrl() { |
|
| 378 | 353 | $url = $this->getLink(); |
| 379 | 354 | |
| 380 | 355 | // FIXME: Checking for "datastreams" in the URL is Fedora 3 specific, for Fedora 4 we need a better solution. |