@@ -18,8 +18,7 @@ discard block |
||
| 18 | 18 | use \TYPO3\CMS\Core\Log\LogManager; |
| 19 | 19 | use \TYPO3\CMS\Core\Utility\GeneralUtility; |
| 20 | 20 | |
| 21 | -class Notifier |
|
| 22 | -{ |
|
| 21 | +class Notifier { |
|
| 23 | 22 | |
| 24 | 23 | /** |
| 25 | 24 | * clientRepository |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | protected $documentTypeRepository = null; |
| 40 | 39 | |
| 41 | 40 | |
| 42 | - public function sendNewDocumentNotification(\EWW\Dpf\Domain\Model\Document $document) |
|
| 43 | - { |
|
| 41 | + public function sendNewDocumentNotification(\EWW\Dpf\Domain\Model\Document $document) { |
|
| 44 | 42 | |
| 45 | 43 | try { |
| 46 | 44 | $client = $this->clientRepository->findAll()->current(); |
@@ -117,8 +115,7 @@ discard block |
||
| 117 | 115 | |
| 118 | 116 | } |
| 119 | 117 | |
| 120 | - public function sendIngestNotification(\EWW\Dpf\Domain\Model\Document $document) |
|
| 121 | - { |
|
| 118 | + public function sendIngestNotification(\EWW\Dpf\Domain\Model\Document $document) { |
|
| 122 | 119 | |
| 123 | 120 | try { |
| 124 | 121 | $client = $this->clientRepository->findAll()->current(); |
@@ -230,8 +227,7 @@ discard block |
||
| 230 | 227 | } |
| 231 | 228 | } |
| 232 | 229 | |
| 233 | - public function sendRegisterNotification(\EWW\Dpf\Domain\Model\Document $document) |
|
| 234 | - { |
|
| 230 | + public function sendRegisterNotification(\EWW\Dpf\Domain\Model\Document $document) { |
|
| 235 | 231 | |
| 236 | 232 | try { |
| 237 | 233 | $client = $this->clientRepository->findAll()->current(); |
@@ -290,8 +286,7 @@ discard block |
||
| 290 | 286 | |
| 291 | 287 | } |
| 292 | 288 | |
| 293 | - protected function replaceMarkers($message, $args) |
|
| 294 | - { |
|
| 289 | + protected function replaceMarkers($message, $args) { |
|
| 295 | 290 | if (is_array($args)) { |
| 296 | 291 | foreach ($args as $key => $value) { |
| 297 | 292 | $message = str_replace($key, $value, $message); |
@@ -301,8 +296,7 @@ discard block |
||
| 301 | 296 | } |
| 302 | 297 | |
| 303 | 298 | |
| 304 | - protected function sendMail($reveiver, $subject, $body, $args, $mailType) |
|
| 305 | - { |
|
| 299 | + protected function sendMail($reveiver, $subject, $body, $args, $mailType) { |
|
| 306 | 300 | $emailReceiver = array(); |
| 307 | 301 | $emailReceiver[$reveiver] = $reveiver; |
| 308 | 302 | $message = (new \TYPO3\CMS\Core\Mail\MailMessage()) |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | use \EWW\Dpf\Services\Logger\TransferLogger; |
| 23 | 23 | use \Httpful\Request; |
| 24 | 24 | |
| 25 | -class FedoraRepository implements Repository |
|
| 26 | -{ |
|
| 25 | +class FedoraRepository implements Repository { |
|
| 27 | 26 | |
| 28 | 27 | /** |
| 29 | 28 | * documentTransferLogRepository |
@@ -64,8 +63,7 @@ discard block |
||
| 64 | 63 | * @return string |
| 65 | 64 | * @throws \Exception |
| 66 | 65 | */ |
| 67 | - public function ingest($document, $metsXml) |
|
| 68 | - { |
|
| 66 | + public function ingest($document, $metsXml) { |
|
| 69 | 67 | try { |
| 70 | 68 | |
| 71 | 69 | $response = Request::post($this->clientConfigurationManager->getSwordHost() . "/sword/" . $this->getSWORDCollection()) |
@@ -84,8 +82,7 @@ discard block |
||
| 84 | 82 | TransferLogger::Log('INGEST', $document->getUid(), null, $response); |
| 85 | 83 | throw new \EWW\Dpf\Exceptions\IngestDocumentErrorException("Fedora error while ingest document."); |
| 86 | 84 | } |
| 87 | - } |
|
| 88 | - catch (\Exception $exception) { |
|
| 85 | + } catch (\Exception $exception) { |
|
| 89 | 86 | TransferLogger::Log('INGEST', $document->getUid(), null, $exception->getMessage()); |
| 90 | 87 | |
| 91 | 88 | if ($exception instanceof \Httpful\Exception\ConnectionErrorException) { |
@@ -107,8 +104,7 @@ discard block |
||
| 107 | 104 | * @return string |
| 108 | 105 | * @throws \Exception |
| 109 | 106 | */ |
| 110 | - public function update($document, $metsXml) |
|
| 111 | - { |
|
| 107 | + public function update($document, $metsXml) { |
|
| 112 | 108 | |
| 113 | 109 | $remoteId = $document->getObjectIdentifier(); |
| 114 | 110 | |
@@ -149,8 +145,7 @@ discard block |
||
| 149 | 145 | * @return string |
| 150 | 146 | * @throws \Exception |
| 151 | 147 | */ |
| 152 | - public function retrieve($remoteId) |
|
| 153 | - { |
|
| 148 | + public function retrieve($remoteId) { |
|
| 154 | 149 | |
| 155 | 150 | try { |
| 156 | 151 | $response = Request::get($this->clientConfigurationManager->getFedoraHost() . "/fedora/objects/" . $remoteId . "/methods/qucosa:SDef/getMETSDissemination") |
@@ -186,8 +181,7 @@ discard block |
||
| 186 | 181 | * @return string |
| 187 | 182 | * @throws \Exception |
| 188 | 183 | */ |
| 189 | - public function getNextDocumentId() |
|
| 190 | - { |
|
| 184 | + public function getNextDocumentId() { |
|
| 191 | 185 | try { |
| 192 | 186 | $response = Request::get($this->clientConfigurationManager->getFedoraHost() . "/fedora/management/getNextPID?numPIDs=1&namespace=qucosa&xml=true") |
| 193 | 187 | ->authenticateWith($this->clientConfigurationManager->getFedoraUser(), $this->clientConfigurationManager->getFedoraPassword()) |
@@ -224,8 +218,7 @@ discard block |
||
| 224 | 218 | * @return boolean |
| 225 | 219 | * @throws \Exception |
| 226 | 220 | */ |
| 227 | - public function delete($document, $state) |
|
| 228 | - { |
|
| 221 | + public function delete($document, $state) { |
|
| 229 | 222 | |
| 230 | 223 | $remoteId = $document->getObjectIdentifier(); |
| 231 | 224 | |
@@ -274,8 +267,7 @@ discard block |
||
| 274 | 267 | * @param \Httpful\Response $response |
| 275 | 268 | * @return string |
| 276 | 269 | */ |
| 277 | - protected function getRemoteDocumentId($response) |
|
| 278 | - { |
|
| 270 | + protected function getRemoteDocumentId($response) { |
|
| 279 | 271 | |
| 280 | 272 | // Get repository ID and write into document |
| 281 | 273 | $responseDom = new \DOMDocument(); |
@@ -292,8 +284,7 @@ discard block |
||
| 292 | 284 | return null; |
| 293 | 285 | } |
| 294 | 286 | |
| 295 | - protected function getOwnerId($pid = NULL) |
|
| 296 | - { |
|
| 287 | + protected function getOwnerId($pid = NULL) { |
|
| 297 | 288 | if ($pid) { |
| 298 | 289 | $this->clientConfigurationManager->setConfigurationPid($pid); |
| 299 | 290 | } |
@@ -306,8 +297,7 @@ discard block |
||
| 306 | 297 | return $ownerId; |
| 307 | 298 | } |
| 308 | 299 | |
| 309 | - protected function getSWORDCollection() |
|
| 310 | - { |
|
| 300 | + protected function getSWORDCollection() { |
|
| 311 | 301 | return $this->clientConfigurationManager->getSwordCollectionNamespace(); |
| 312 | 302 | } |
| 313 | 303 | } |
@@ -9,8 +9,7 @@ |
||
| 9 | 9 | use EWW\Dpf\Domain\Repository\DocumentRepository; |
| 10 | 10 | |
| 11 | 11 | |
| 12 | -class EmbargoTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask |
|
| 13 | -{ |
|
| 12 | +class EmbargoTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask { |
|
| 14 | 13 | |
| 15 | 14 | public function execute() { |
| 16 | 15 | |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * Document |
| 22 | 22 | */ |
| 23 | -class Document extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity |
|
| 24 | -{ |
|
| 23 | +class Document extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { |
|
| 25 | 24 | /** |
| 26 | 25 | * title |
| 27 | 26 | * |
@@ -183,8 +182,7 @@ discard block |
||
| 183 | 182 | /** |
| 184 | 183 | * __construct |
| 185 | 184 | */ |
| 186 | - public function __construct() |
|
| 187 | - { |
|
| 185 | + public function __construct() { |
|
| 188 | 186 | //Do not remove the next line: It would break the functionality |
| 189 | 187 | $this->initStorageObjects(); |
| 190 | 188 | } |
@@ -194,8 +192,7 @@ discard block |
||
| 194 | 192 | * |
| 195 | 193 | * @return void |
| 196 | 194 | */ |
| 197 | - protected function initStorageObjects() |
|
| 198 | - { |
|
| 195 | + protected function initStorageObjects() { |
|
| 199 | 196 | $this->file = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); |
| 200 | 197 | } |
| 201 | 198 | |
@@ -204,8 +201,7 @@ discard block |
||
| 204 | 201 | * |
| 205 | 202 | * @return string $title |
| 206 | 203 | */ |
| 207 | - public function getTitle() |
|
| 208 | - { |
|
| 204 | + public function getTitle() { |
|
| 209 | 205 | return $this->title; |
| 210 | 206 | } |
| 211 | 207 | |
@@ -215,8 +211,7 @@ discard block |
||
| 215 | 211 | * @param string $title |
| 216 | 212 | * @return void |
| 217 | 213 | */ |
| 218 | - public function setTitle($title) |
|
| 219 | - { |
|
| 214 | + public function setTitle($title) { |
|
| 220 | 215 | $this->title = $title; |
| 221 | 216 | //htmlspecialchars_decode($title,ENT_QUOTES); |
| 222 | 217 | } |
@@ -226,8 +221,7 @@ discard block |
||
| 226 | 221 | * |
| 227 | 222 | * @return array $authors |
| 228 | 223 | */ |
| 229 | - public function getAuthors() |
|
| 230 | - { |
|
| 224 | + public function getAuthors() { |
|
| 231 | 225 | return array_map('trim', explode(";", $this->authors)); |
| 232 | 226 | } |
| 233 | 227 | |
@@ -237,8 +231,7 @@ discard block |
||
| 237 | 231 | * @param array $authors |
| 238 | 232 | * @return void |
| 239 | 233 | */ |
| 240 | - public function setAuthors($authors) |
|
| 241 | - { |
|
| 234 | + public function setAuthors($authors) { |
|
| 242 | 235 | $authors = implode("; ", $authors); |
| 243 | 236 | $this->authors = $authors; |
| 244 | 237 | } |
@@ -248,8 +241,7 @@ discard block |
||
| 248 | 241 | * |
| 249 | 242 | * @return string $xmlData |
| 250 | 243 | */ |
| 251 | - public function getXmlData() |
|
| 252 | - { |
|
| 244 | + public function getXmlData() { |
|
| 253 | 245 | return $this->xmlData; |
| 254 | 246 | } |
| 255 | 247 | |
@@ -259,8 +251,7 @@ discard block |
||
| 259 | 251 | * @param string $xmlData |
| 260 | 252 | * @return void |
| 261 | 253 | */ |
| 262 | - public function setXmlData($xmlData) |
|
| 263 | - { |
|
| 254 | + public function setXmlData($xmlData) { |
|
| 264 | 255 | $this->xmlData = $xmlData; |
| 265 | 256 | } |
| 266 | 257 | |
@@ -269,8 +260,7 @@ discard block |
||
| 269 | 260 | * |
| 270 | 261 | * @return string $slubInfoData |
| 271 | 262 | */ |
| 272 | - public function getSlubInfoData() |
|
| 273 | - { |
|
| 263 | + public function getSlubInfoData() { |
|
| 274 | 264 | return $this->slubInfoData; |
| 275 | 265 | } |
| 276 | 266 | |
@@ -279,8 +269,7 @@ discard block |
||
| 279 | 269 | * |
| 280 | 270 | * @return string $slubInfoData |
| 281 | 271 | */ |
| 282 | - public function setSlubInfoData($slubInfoData) |
|
| 283 | - { |
|
| 272 | + public function setSlubInfoData($slubInfoData) { |
|
| 284 | 273 | $this->slubInfoData = $slubInfoData; |
| 285 | 274 | } |
| 286 | 275 | |
@@ -289,8 +278,7 @@ discard block |
||
| 289 | 278 | * |
| 290 | 279 | * @return \EWW\Dpf\Domain\Model\DocumentType $documentType |
| 291 | 280 | */ |
| 292 | - public function getDocumentType() |
|
| 293 | - { |
|
| 281 | + public function getDocumentType() { |
|
| 294 | 282 | return $this->documentType; |
| 295 | 283 | } |
| 296 | 284 | |
@@ -300,8 +288,7 @@ discard block |
||
| 300 | 288 | * @param \EWW\Dpf\Domain\Model\DocumentType $documentType |
| 301 | 289 | * @return void |
| 302 | 290 | */ |
| 303 | - public function setDocumentType(\EWW\Dpf\Domain\Model\DocumentType $documentType) |
|
| 304 | - { |
|
| 291 | + public function setDocumentType(\EWW\Dpf\Domain\Model\DocumentType $documentType) { |
|
| 305 | 292 | $this->documentType = $documentType; |
| 306 | 293 | } |
| 307 | 294 | |
@@ -310,8 +297,7 @@ discard block |
||
| 310 | 297 | * |
| 311 | 298 | * @return string |
| 312 | 299 | */ |
| 313 | - public function getObjectIdentifier() |
|
| 314 | - { |
|
| 300 | + public function getObjectIdentifier() { |
|
| 315 | 301 | return $this->objectIdentifier; |
| 316 | 302 | } |
| 317 | 303 | |
@@ -321,8 +307,7 @@ discard block |
||
| 321 | 307 | * @param string $objectIdentifier |
| 322 | 308 | * @return void |
| 323 | 309 | */ |
| 324 | - public function setObjectIdentifier($objectIdentifier) |
|
| 325 | - { |
|
| 310 | + public function setObjectIdentifier($objectIdentifier) { |
|
| 326 | 311 | // Due to uniqe key uc_object_identifier, which should ignore empty object identifiers. |
| 327 | 312 | $this->objectIdentifier = empty($objectIdentifier)? null : $objectIdentifier; |
| 328 | 313 | } |
@@ -332,8 +317,7 @@ discard block |
||
| 332 | 317 | * |
| 333 | 318 | * @return string |
| 334 | 319 | */ |
| 335 | - public function getReservedObjectIdentifier() |
|
| 336 | - { |
|
| 320 | + public function getReservedObjectIdentifier() { |
|
| 337 | 321 | return $this->reservedObjectIdentifier; |
| 338 | 322 | } |
| 339 | 323 | |
@@ -343,8 +327,7 @@ discard block |
||
| 343 | 327 | * @param string $reservedObjectIdentifier |
| 344 | 328 | * @return void |
| 345 | 329 | */ |
| 346 | - public function setReservedObjectIdentifier($reservedObjectIdentifier) |
|
| 347 | - { |
|
| 330 | + public function setReservedObjectIdentifier($reservedObjectIdentifier) { |
|
| 348 | 331 | $this->reservedObjectIdentifier = $reservedObjectIdentifier; |
| 349 | 332 | } |
| 350 | 333 | |
@@ -353,8 +336,7 @@ discard block |
||
| 353 | 336 | * |
| 354 | 337 | * @return string |
| 355 | 338 | */ |
| 356 | - public function getTransferStatus() |
|
| 357 | - { |
|
| 339 | + public function getTransferStatus() { |
|
| 358 | 340 | return $this->transferStatus; |
| 359 | 341 | } |
| 360 | 342 | |
@@ -364,8 +346,7 @@ discard block |
||
| 364 | 346 | * @param string |
| 365 | 347 | * @return void |
| 366 | 348 | */ |
| 367 | - public function setTransferStatus($transferStatus) |
|
| 368 | - { |
|
| 349 | + public function setTransferStatus($transferStatus) { |
|
| 369 | 350 | $this->transferStatus = $transferStatus; |
| 370 | 351 | } |
| 371 | 352 | |
@@ -374,8 +355,7 @@ discard block |
||
| 374 | 355 | * |
| 375 | 356 | * @return integer |
| 376 | 357 | */ |
| 377 | - public function getTransferDate() |
|
| 378 | - { |
|
| 358 | + public function getTransferDate() { |
|
| 379 | 359 | return $this->transferDate; |
| 380 | 360 | } |
| 381 | 361 | |
@@ -385,8 +365,7 @@ discard block |
||
| 385 | 365 | * @param integer $transferDate |
| 386 | 366 | * @return void |
| 387 | 367 | */ |
| 388 | - public function setTransferDate($transferDate) |
|
| 389 | - { |
|
| 368 | + public function setTransferDate($transferDate) { |
|
| 390 | 369 | $this->transferDate = $transferDate; |
| 391 | 370 | } |
| 392 | 371 | |
@@ -395,8 +374,7 @@ discard block |
||
| 395 | 374 | * |
| 396 | 375 | * @var integer |
| 397 | 376 | */ |
| 398 | - public function getTransferErrorCode() |
|
| 399 | - { |
|
| 377 | + public function getTransferErrorCode() { |
|
| 400 | 378 | return $this->transferErrorCode; |
| 401 | 379 | } |
| 402 | 380 | |
@@ -406,8 +384,7 @@ discard block |
||
| 406 | 384 | * @param integer $transferErrorCode |
| 407 | 385 | * @return void |
| 408 | 386 | */ |
| 409 | - public function setTransferErrorCode($transferErrorCode) |
|
| 410 | - { |
|
| 387 | + public function setTransferErrorCode($transferErrorCode) { |
|
| 411 | 388 | $this->transferErrorCode = $transferErrorCode; |
| 412 | 389 | } |
| 413 | 390 | |
@@ -416,8 +393,7 @@ discard block |
||
| 416 | 393 | * |
| 417 | 394 | * @var string |
| 418 | 395 | */ |
| 419 | - public function getTransferResponse() |
|
| 420 | - { |
|
| 396 | + public function getTransferResponse() { |
|
| 421 | 397 | return $this->transferResponse; |
| 422 | 398 | } |
| 423 | 399 | |
@@ -427,8 +403,7 @@ discard block |
||
| 427 | 403 | * @param string $transferResponse |
| 428 | 404 | * @return void |
| 429 | 405 | */ |
| 430 | - public function setTransferResponse($transferResponse) |
|
| 431 | - { |
|
| 406 | + public function setTransferResponse($transferResponse) { |
|
| 432 | 407 | $this->transferResponse = $transferResponse; |
| 433 | 408 | } |
| 434 | 409 | |
@@ -437,8 +412,7 @@ discard block |
||
| 437 | 412 | * |
| 438 | 413 | * @var integer |
| 439 | 414 | */ |
| 440 | - public function getTransferHttpStatus() |
|
| 441 | - { |
|
| 415 | + public function getTransferHttpStatus() { |
|
| 442 | 416 | return $this->transferHttpStatus; |
| 443 | 417 | } |
| 444 | 418 | |
@@ -448,8 +422,7 @@ discard block |
||
| 448 | 422 | * @param integer $transferHttpStatus |
| 449 | 423 | * @return void |
| 450 | 424 | */ |
| 451 | - public function setTransferHttpStatus($transferHttpStatus) |
|
| 452 | - { |
|
| 425 | + public function setTransferHttpStatus($transferHttpStatus) { |
|
| 453 | 426 | $this->transferHttpStatus = $transferHttpStatus; |
| 454 | 427 | } |
| 455 | 428 | |
@@ -459,8 +432,7 @@ discard block |
||
| 459 | 432 | * @param \EWW\Dpf\Domain\Model\File $file |
| 460 | 433 | * @return void |
| 461 | 434 | */ |
| 462 | - public function addFile(\EWW\Dpf\Domain\Model\File $file) |
|
| 463 | - { |
|
| 435 | + public function addFile(\EWW\Dpf\Domain\Model\File $file) { |
|
| 464 | 436 | $this->file->attach($file); |
| 465 | 437 | } |
| 466 | 438 | |
@@ -470,8 +442,7 @@ discard block |
||
| 470 | 442 | * @param \EWW\Dpf\Domain\Model\File $fileToRemove The File to be removed |
| 471 | 443 | * @return void |
| 472 | 444 | */ |
| 473 | - public function removeFile(\EWW\Dpf\Domain\Model\File $fileToRemove) |
|
| 474 | - { |
|
| 445 | + public function removeFile(\EWW\Dpf\Domain\Model\File $fileToRemove) { |
|
| 475 | 446 | $this->file->detach($fileToRemove); |
| 476 | 447 | } |
| 477 | 448 | |
@@ -480,8 +451,7 @@ discard block |
||
| 480 | 451 | * |
| 481 | 452 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\File> $file |
| 482 | 453 | */ |
| 483 | - public function getFile() |
|
| 484 | - { |
|
| 454 | + public function getFile() { |
|
| 485 | 455 | return $this->file; |
| 486 | 456 | } |
| 487 | 457 | |
@@ -491,8 +461,7 @@ discard block |
||
| 491 | 461 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\File> $file |
| 492 | 462 | * @return void |
| 493 | 463 | */ |
| 494 | - public function setFile(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $file) |
|
| 495 | - { |
|
| 464 | + public function setFile(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $file) { |
|
| 496 | 465 | $this->file = $file; |
| 497 | 466 | } |
| 498 | 467 | |
@@ -501,8 +470,7 @@ discard block |
||
| 501 | 470 | * |
| 502 | 471 | * @return array |
| 503 | 472 | */ |
| 504 | - public function getFileData() |
|
| 505 | - { |
|
| 473 | + public function getFileData() { |
|
| 506 | 474 | |
| 507 | 475 | $fileId = new \EWW\Dpf\Services\Transfer\FileId($this); |
| 508 | 476 | |
@@ -552,8 +520,7 @@ discard block |
||
| 552 | 520 | * |
| 553 | 521 | * @return array |
| 554 | 522 | */ |
| 555 | - public function getCurrentFileData() |
|
| 556 | - { |
|
| 523 | + public function getCurrentFileData() { |
|
| 557 | 524 | |
| 558 | 525 | $fileId = new \EWW\Dpf\Services\Transfer\FileId($this); |
| 559 | 526 | |
@@ -601,8 +568,7 @@ discard block |
||
| 601 | 568 | * |
| 602 | 569 | * @return boolean $changed |
| 603 | 570 | */ |
| 604 | - public function getChanged() |
|
| 605 | - { |
|
| 571 | + public function getChanged() { |
|
| 606 | 572 | return $this->changed; |
| 607 | 573 | } |
| 608 | 574 | |
@@ -612,8 +578,7 @@ discard block |
||
| 612 | 578 | * @param boolean $changed |
| 613 | 579 | * @return void |
| 614 | 580 | */ |
| 615 | - public function setChanged($changed) |
|
| 616 | - { |
|
| 581 | + public function setChanged($changed) { |
|
| 617 | 582 | $this->changed = $changed; |
| 618 | 583 | } |
| 619 | 584 | |
@@ -622,8 +587,7 @@ discard block |
||
| 622 | 587 | * |
| 623 | 588 | * @return boolean $valid |
| 624 | 589 | */ |
| 625 | - public function getValid() |
|
| 626 | - { |
|
| 590 | + public function getValid() { |
|
| 627 | 591 | return $this->valid; |
| 628 | 592 | } |
| 629 | 593 | |
@@ -633,8 +597,7 @@ discard block |
||
| 633 | 597 | * @param boolean $valid |
| 634 | 598 | * @return void |
| 635 | 599 | */ |
| 636 | - public function setValid($valid) |
|
| 637 | - { |
|
| 600 | + public function setValid($valid) { |
|
| 638 | 601 | $this->valid = $valid; |
| 639 | 602 | } |
| 640 | 603 | |
@@ -643,8 +606,7 @@ discard block |
||
| 643 | 606 | * |
| 644 | 607 | * @return string |
| 645 | 608 | */ |
| 646 | - public function getDateIssued() |
|
| 647 | - { |
|
| 609 | + public function getDateIssued() { |
|
| 648 | 610 | return empty($this->dateIssued) ? '' : $this->dateIssued; |
| 649 | 611 | } |
| 650 | 612 | |
@@ -654,8 +616,7 @@ discard block |
||
| 654 | 616 | * @param string $dateIssued |
| 655 | 617 | * @return void |
| 656 | 618 | */ |
| 657 | - public function setDateIssued($dateIssued) |
|
| 658 | - { |
|
| 619 | + public function setDateIssued($dateIssued) { |
|
| 659 | 620 | $this->dateIssued = empty($dateIssued) ? '' : $dateIssued; |
| 660 | 621 | } |
| 661 | 622 | |
@@ -665,8 +626,7 @@ discard block |
||
| 665 | 626 | * |
| 666 | 627 | * @return string |
| 667 | 628 | */ |
| 668 | - public function getProcessNumber() |
|
| 669 | - { |
|
| 629 | + public function getProcessNumber() { |
|
| 670 | 630 | return $this->processNumber; |
| 671 | 631 | } |
| 672 | 632 | |
@@ -676,8 +636,7 @@ discard block |
||
| 676 | 636 | * @param string $processNumber |
| 677 | 637 | * @return void |
| 678 | 638 | */ |
| 679 | - public function setProcessNumber($processNumber) |
|
| 680 | - { |
|
| 639 | + public function setProcessNumber($processNumber) { |
|
| 681 | 640 | $this->processNumber = trim($processNumber); |
| 682 | 641 | } |
| 683 | 642 | |
@@ -687,8 +646,7 @@ discard block |
||
| 687 | 646 | * |
| 688 | 647 | * @return string |
| 689 | 648 | */ |
| 690 | - public function getSubmitterName() |
|
| 691 | - { |
|
| 649 | + public function getSubmitterName() { |
|
| 692 | 650 | try { |
| 693 | 651 | $slub = new \EWW\Dpf\Helper\Slub($this->getSlubInfoData()); |
| 694 | 652 | return $slub->getSubmitterName(); |
@@ -702,8 +660,7 @@ discard block |
||
| 702 | 660 | * |
| 703 | 661 | * @return string |
| 704 | 662 | */ |
| 705 | - public function getQucosaUrn() |
|
| 706 | - { |
|
| 663 | + public function getQucosaUrn() { |
|
| 707 | 664 | $mods = new \EWW\Dpf\Helper\Mods($this->getXmlData()); |
| 708 | 665 | return $mods->getQucosaUrn(); |
| 709 | 666 | } |
@@ -713,8 +670,7 @@ discard block |
||
| 713 | 670 | * |
| 714 | 671 | * @return int |
| 715 | 672 | */ |
| 716 | - public function getCreator() |
|
| 717 | - { |
|
| 673 | + public function getCreator() { |
|
| 718 | 674 | return $this->creator? $this->creator : 0; |
| 719 | 675 | } |
| 720 | 676 | |
@@ -724,23 +680,19 @@ discard block |
||
| 724 | 680 | * @param int $creator |
| 725 | 681 | * @return void |
| 726 | 682 | */ |
| 727 | - public function setCreator($creator) |
|
| 728 | - { |
|
| 683 | + public function setCreator($creator) { |
|
| 729 | 684 | $this->creator = $creator; |
| 730 | 685 | } |
| 731 | 686 | |
| 732 | - public function getState() |
|
| 733 | - { |
|
| 687 | + public function getState() { |
|
| 734 | 688 | return $this->state; |
| 735 | 689 | } |
| 736 | 690 | |
| 737 | - public function setState($state) |
|
| 738 | - { |
|
| 691 | + public function setState($state) { |
|
| 739 | 692 | $this->state = $state; |
| 740 | 693 | } |
| 741 | 694 | |
| 742 | - public function getRemoteState() |
|
| 743 | - { |
|
| 695 | + public function getRemoteState() { |
|
| 744 | 696 | $state = explode(':', $this->state); |
| 745 | 697 | if (is_array($state) && array_key_exists(1, $state)) { |
| 746 | 698 | return $state[1]; |
@@ -778,8 +730,7 @@ discard block |
||
| 778 | 730 | /** |
| 779 | 731 | * @return string |
| 780 | 732 | */ |
| 781 | - public function getRemoteLastModDate() |
|
| 782 | - { |
|
| 733 | + public function getRemoteLastModDate() { |
|
| 783 | 734 | return $this->remoteLastModDate; |
| 784 | 735 | } |
| 785 | 736 | |
@@ -787,16 +738,14 @@ discard block |
||
| 787 | 738 | * @param string $remoteLastModDate |
| 788 | 739 | * @return void |
| 789 | 740 | */ |
| 790 | - public function setRemoteLastModDate($remoteLastModDate) |
|
| 791 | - { |
|
| 741 | + public function setRemoteLastModDate($remoteLastModDate) { |
|
| 792 | 742 | $this->remoteLastModDate = $remoteLastModDate; |
| 793 | 743 | } |
| 794 | 744 | |
| 795 | 745 | /** |
| 796 | 746 | * @return integer |
| 797 | 747 | */ |
| 798 | - public function getTstamp() |
|
| 799 | - { |
|
| 748 | + public function getTstamp() { |
|
| 800 | 749 | return $this->tstamp; |
| 801 | 750 | } |
| 802 | 751 | |
@@ -811,8 +760,7 @@ discard block |
||
| 811 | 760 | /** |
| 812 | 761 | * @param bool $suggestion |
| 813 | 762 | */ |
| 814 | - public function setSuggestion(bool $suggestion) |
|
| 815 | - { |
|
| 763 | + public function setSuggestion(bool $suggestion) { |
|
| 816 | 764 | $this->suggestion = $suggestion; |
| 817 | 765 | } |
| 818 | 766 | |
@@ -827,8 +775,7 @@ discard block |
||
| 827 | 775 | /** |
| 828 | 776 | * @param string $linkedUid |
| 829 | 777 | */ |
| 830 | - public function setLinkedUid(string $linkedUid) |
|
| 831 | - { |
|
| 778 | + public function setLinkedUid(string $linkedUid) { |
|
| 832 | 779 | $this->linkedUid = $linkedUid; |
| 833 | 780 | } |
| 834 | 781 | |
@@ -843,8 +790,7 @@ discard block |
||
| 843 | 790 | /** |
| 844 | 791 | * @param string $comment |
| 845 | 792 | */ |
| 846 | - public function setComment(string $comment) |
|
| 847 | - { |
|
| 793 | + public function setComment(string $comment) { |
|
| 848 | 794 | $this->comment = $comment; |
| 849 | 795 | } |
| 850 | 796 | |
@@ -881,8 +827,7 @@ discard block |
||
| 881 | 827 | * |
| 882 | 828 | * @return string|int |
| 883 | 829 | */ |
| 884 | - public function getDocumentIdentifier() |
|
| 885 | - { |
|
| 830 | + public function getDocumentIdentifier() { |
|
| 886 | 831 | return $this->getObjectIdentifier()? $this->getObjectIdentifier() : $this->getUid(); |
| 887 | 832 | } |
| 888 | 833 | |
@@ -891,8 +836,7 @@ discard block |
||
| 891 | 836 | * |
| 892 | 837 | * @return bool |
| 893 | 838 | */ |
| 894 | - public function isWorkingCopy() |
|
| 895 | - { |
|
| 839 | + public function isWorkingCopy() { |
|
| 896 | 840 | return $this->getObjectIdentifier() && !$this->isTemporary() && !$this->isSuggestion(); |
| 897 | 841 | } |
| 898 | 842 | |
@@ -902,8 +846,7 @@ discard block |
||
| 902 | 846 | * |
| 903 | 847 | * @return bool |
| 904 | 848 | */ |
| 905 | - public function isTemporaryCopy() |
|
| 906 | - { |
|
| 849 | + public function isTemporaryCopy() { |
|
| 907 | 850 | return $this->getObjectIdentifier() && $this->isTemporary() && !$this->isSuggestion(); |
| 908 | 851 | } |
| 909 | 852 | |
@@ -913,8 +856,7 @@ discard block |
||
| 913 | 856 | * |
| 914 | 857 | * @return string|null |
| 915 | 858 | */ |
| 916 | - public function getPublicationYear() |
|
| 917 | - { |
|
| 859 | + public function getPublicationYear() { |
|
| 918 | 860 | $mods = new Mods($this->getXmlData()); |
| 919 | 861 | $year = $mods->getPublishingYear(); |
| 920 | 862 | return $year? $year : ""; |
@@ -925,8 +867,7 @@ discard block |
||
| 925 | 867 | * |
| 926 | 868 | * @return string|null |
| 927 | 869 | */ |
| 928 | - public function getMainTitle() |
|
| 929 | - { |
|
| 870 | + public function getMainTitle() { |
|
| 930 | 871 | $mods = new Mods($this->getXmlData()); |
| 931 | 872 | $title = $mods->getTitle(); |
| 932 | 873 | return $title? $title : ""; |
@@ -938,8 +879,7 @@ discard block |
||
| 938 | 879 | * |
| 939 | 880 | * @return string|null |
| 940 | 881 | */ |
| 941 | - public function getSourceDetails() |
|
| 942 | - { |
|
| 882 | + public function getSourceDetails() { |
|
| 943 | 883 | $mods = new Mods($this->getXmlData()); |
| 944 | 884 | $data = $mods->getSourceDetails(); |
| 945 | 885 | return $data; |
@@ -956,8 +896,7 @@ discard block |
||
| 956 | 896 | /** |
| 957 | 897 | * @param \DateTime|null $embargoDate |
| 958 | 898 | */ |
| 959 | - public function setEmbargoDate(?\DateTime $embargoDate) |
|
| 960 | - { |
|
| 899 | + public function setEmbargoDate(?\DateTime $embargoDate) { |
|
| 961 | 900 | $this->embargoDate = $embargoDate; |
| 962 | 901 | } |
| 963 | 902 | |
@@ -972,8 +911,7 @@ discard block |
||
| 972 | 911 | /** |
| 973 | 912 | * @param \DateTime|null $embargoDate |
| 974 | 913 | */ |
| 975 | - public function setEmbargoDate(?\DateTime $embargoDate) |
|
| 976 | - { |
|
| 914 | + public function setEmbargoDate(?\DateTime $embargoDate) { |
|
| 977 | 915 | $this->embargoDate = $embargoDate; |
| 978 | 916 | } |
| 979 | 917 | |
@@ -17,8 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * MetadataObject |
| 19 | 19 | */ |
| 20 | -class MetadataObject extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements MetadataMandatoryInterface |
|
| 21 | -{ |
|
| 20 | +class MetadataObject extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements MetadataMandatoryInterface { |
|
| 22 | 21 | |
| 23 | 22 | /** |
| 24 | 23 | * name |
@@ -158,8 +157,7 @@ discard block |
||
| 158 | 157 | * |
| 159 | 158 | * @return string $name |
| 160 | 159 | */ |
| 161 | - public function getName() |
|
| 162 | - { |
|
| 160 | + public function getName() { |
|
| 163 | 161 | return $this->name; |
| 164 | 162 | } |
| 165 | 163 | |
@@ -169,8 +167,7 @@ discard block |
||
| 169 | 167 | * @param string $name |
| 170 | 168 | * @return void |
| 171 | 169 | */ |
| 172 | - public function setName($name) |
|
| 173 | - { |
|
| 170 | + public function setName($name) { |
|
| 174 | 171 | $this->name = $name; |
| 175 | 172 | } |
| 176 | 173 | |
@@ -179,8 +176,7 @@ discard block |
||
| 179 | 176 | * |
| 180 | 177 | * @return string $displayName |
| 181 | 178 | */ |
| 182 | - public function getDisplayName() |
|
| 183 | - { |
|
| 179 | + public function getDisplayName() { |
|
| 184 | 180 | return $this->displayName; |
| 185 | 181 | } |
| 186 | 182 | |
@@ -190,8 +186,7 @@ discard block |
||
| 190 | 186 | * @param string $displayName |
| 191 | 187 | * @return void |
| 192 | 188 | */ |
| 193 | - public function setDisplayName($displayName) |
|
| 194 | - { |
|
| 189 | + public function setDisplayName($displayName) { |
|
| 195 | 190 | $this->displayName = $displayName; |
| 196 | 191 | } |
| 197 | 192 | |
@@ -200,8 +195,7 @@ discard block |
||
| 200 | 195 | * |
| 201 | 196 | * @return integer $maxIteration |
| 202 | 197 | */ |
| 203 | - public function getMaxIteration() |
|
| 204 | - { |
|
| 198 | + public function getMaxIteration() { |
|
| 205 | 199 | return $this->maxIteration; |
| 206 | 200 | } |
| 207 | 201 | |
@@ -211,8 +205,7 @@ discard block |
||
| 211 | 205 | * @param integer $maxIteration |
| 212 | 206 | * @return void |
| 213 | 207 | */ |
| 214 | - public function setMaxIteration($maxIteration) |
|
| 215 | - { |
|
| 208 | + public function setMaxIteration($maxIteration) { |
|
| 216 | 209 | $this->maxIteration = $maxIteration; |
| 217 | 210 | } |
| 218 | 211 | |
@@ -221,8 +214,7 @@ discard block |
||
| 221 | 214 | * |
| 222 | 215 | * @return string $mandatory |
| 223 | 216 | */ |
| 224 | - public function getMandatory() |
|
| 225 | - { |
|
| 217 | + public function getMandatory() { |
|
| 226 | 218 | return $this->mandatory; |
| 227 | 219 | } |
| 228 | 220 | |
@@ -232,8 +224,7 @@ discard block |
||
| 232 | 224 | * @param string $mandatory |
| 233 | 225 | * @return void |
| 234 | 226 | */ |
| 235 | - public function setMandatory($mandatory) |
|
| 236 | - { |
|
| 227 | + public function setMandatory($mandatory) { |
|
| 237 | 228 | $this->mandatory = $mandatory; |
| 238 | 229 | } |
| 239 | 230 | |
@@ -242,8 +233,7 @@ discard block |
||
| 242 | 233 | * |
| 243 | 234 | * @return boolean $modsExtension |
| 244 | 235 | */ |
| 245 | - public function getModsExtension() |
|
| 246 | - { |
|
| 236 | + public function getModsExtension() { |
|
| 247 | 237 | return $this->modsExtension; |
| 248 | 238 | } |
| 249 | 239 | |
@@ -253,8 +243,7 @@ discard block |
||
| 253 | 243 | * @param boolean $modsExtension |
| 254 | 244 | * @return void |
| 255 | 245 | */ |
| 256 | - public function setModsExtension($modsExtension) |
|
| 257 | - { |
|
| 246 | + public function setModsExtension($modsExtension) { |
|
| 258 | 247 | $this->modsExtension = $modsExtension; |
| 259 | 248 | } |
| 260 | 249 | |
@@ -263,8 +252,7 @@ discard block |
||
| 263 | 252 | * |
| 264 | 253 | * @return boolean |
| 265 | 254 | */ |
| 266 | - public function isModsExtension() |
|
| 267 | - { |
|
| 255 | + public function isModsExtension() { |
|
| 268 | 256 | return $this->modsExtension; |
| 269 | 257 | } |
| 270 | 258 | |
@@ -273,8 +261,7 @@ discard block |
||
| 273 | 261 | * |
| 274 | 262 | * @return string $mapping |
| 275 | 263 | */ |
| 276 | - public function getMapping() |
|
| 277 | - { |
|
| 264 | + public function getMapping() { |
|
| 278 | 265 | return $this->mapping; |
| 279 | 266 | } |
| 280 | 267 | |
@@ -284,8 +271,7 @@ discard block |
||
| 284 | 271 | * @param string $mapping |
| 285 | 272 | * @return void |
| 286 | 273 | */ |
| 287 | - public function setMapping($mapping) |
|
| 288 | - { |
|
| 274 | + public function setMapping($mapping) { |
|
| 289 | 275 | $this->mapping = $mapping; |
| 290 | 276 | } |
| 291 | 277 | |
@@ -294,8 +280,7 @@ discard block |
||
| 294 | 280 | * |
| 295 | 281 | * @return string $relativeMapping |
| 296 | 282 | */ |
| 297 | - public function getRelativeMapping() |
|
| 298 | - { |
|
| 283 | + public function getRelativeMapping() { |
|
| 299 | 284 | $modsRegExp = "/^.*?mods:mods/i"; |
| 300 | 285 | $mapping = preg_replace($modsRegExp, "", $this->mapping); |
| 301 | 286 | return trim($mapping, " /"); |
@@ -306,8 +291,7 @@ discard block |
||
| 306 | 291 | * |
| 307 | 292 | * @return integer $inputField |
| 308 | 293 | */ |
| 309 | - public function getInputField() |
|
| 310 | - { |
|
| 294 | + public function getInputField() { |
|
| 311 | 295 | return $this->inputField; |
| 312 | 296 | } |
| 313 | 297 | |
@@ -317,8 +301,7 @@ discard block |
||
| 317 | 301 | * @param integer $inputField |
| 318 | 302 | * @return void |
| 319 | 303 | */ |
| 320 | - public function setInputField($inputField) |
|
| 321 | - { |
|
| 304 | + public function setInputField($inputField) { |
|
| 322 | 305 | $this->inputField = $inputField; |
| 323 | 306 | } |
| 324 | 307 | |
@@ -327,8 +310,7 @@ discard block |
||
| 327 | 310 | * |
| 328 | 311 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EWW\Dpf\Domain\Model\MetadataObject> $metadataObject |
| 329 | 312 | */ |
| 330 | - public function getChildren() |
|
| 331 | - { |
|
| 313 | + public function getChildren() { |
|
| 332 | 314 | return null; |
| 333 | 315 | } |
| 334 | 316 | |
@@ -337,8 +319,7 @@ discard block |
||
| 337 | 319 | * |
| 338 | 320 | * @return \EWW\Dpf\Domain\Model\InputOptionList $inputOptionList |
| 339 | 321 | */ |
| 340 | - public function getInputOptionList() |
|
| 341 | - { |
|
| 322 | + public function getInputOptionList() { |
|
| 342 | 323 | return $this->inputOptionList; |
| 343 | 324 | } |
| 344 | 325 | |
@@ -348,8 +329,7 @@ discard block |
||
| 348 | 329 | * @param \EWW\Dpf\Domain\Model\InputOptionList $inputOptionList |
| 349 | 330 | * @return void |
| 350 | 331 | */ |
| 351 | - public function setInputOptionList(\EWW\Dpf\Domain\Model\InputOptionList $inputOptionList) |
|
| 352 | - { |
|
| 332 | + public function setInputOptionList(\EWW\Dpf\Domain\Model\InputOptionList $inputOptionList) { |
|
| 353 | 333 | $this->inputOptionList = $inputOptionList; |
| 354 | 334 | } |
| 355 | 335 | |
@@ -358,8 +338,7 @@ discard block |
||
| 358 | 338 | * |
| 359 | 339 | * @return string $fillOutService |
| 360 | 340 | */ |
| 361 | - public function getFillOutService() |
|
| 362 | - { |
|
| 341 | + public function getFillOutService() { |
|
| 363 | 342 | return $this->fillOutService; |
| 364 | 343 | } |
| 365 | 344 | |
@@ -369,8 +348,7 @@ discard block |
||
| 369 | 348 | * @param string $fillOutService |
| 370 | 349 | * @return void |
| 371 | 350 | */ |
| 372 | - public function setFillOutService($fillOutService) |
|
| 373 | - { |
|
| 351 | + public function setFillOutService($fillOutService) { |
|
| 374 | 352 | $this->fillOutService = $fillOutService; |
| 375 | 353 | } |
| 376 | 354 | |
@@ -379,8 +357,7 @@ discard block |
||
| 379 | 357 | * |
| 380 | 358 | * @return array $accessRestrictionRoles |
| 381 | 359 | */ |
| 382 | - public function getAccessRestrictionRoles() |
|
| 383 | - { |
|
| 360 | + public function getAccessRestrictionRoles() { |
|
| 384 | 361 | if ($this->accessRestrictionRoles) { |
| 385 | 362 | return array_map('trim', explode(',', $this->accessRestrictionRoles)); |
| 386 | 363 | } else { |
@@ -394,8 +371,7 @@ discard block |
||
| 394 | 371 | * @param array $accessRestrictionRoles |
| 395 | 372 | * @return void |
| 396 | 373 | */ |
| 397 | - public function setAccessRestrictionRoles($accessRestrictionRoles) |
|
| 398 | - { |
|
| 374 | + public function setAccessRestrictionRoles($accessRestrictionRoles) { |
|
| 399 | 375 | $this->accessRestrictionRoles = implode(',', $accessRestrictionRoles); |
| 400 | 376 | } |
| 401 | 377 | |
@@ -404,8 +380,7 @@ discard block |
||
| 404 | 380 | * |
| 405 | 381 | * @return boolean $consent |
| 406 | 382 | */ |
| 407 | - public function getConsent() |
|
| 408 | - { |
|
| 383 | + public function getConsent() { |
|
| 409 | 384 | return $this->consent; |
| 410 | 385 | } |
| 411 | 386 | |
@@ -415,8 +390,7 @@ discard block |
||
| 415 | 390 | * @param boolean $consent |
| 416 | 391 | * @return void |
| 417 | 392 | */ |
| 418 | - public function setConsent($consent) |
|
| 419 | - { |
|
| 393 | + public function setConsent($consent) { |
|
| 420 | 394 | $this->consent = $consent; |
| 421 | 395 | } |
| 422 | 396 | |
@@ -425,8 +399,7 @@ discard block |
||
| 425 | 399 | * |
| 426 | 400 | * @return string $defaultValue |
| 427 | 401 | */ |
| 428 | - public function getDefaultValue() |
|
| 429 | - { |
|
| 402 | + public function getDefaultValue() { |
|
| 430 | 403 | return $this->defaultValue; |
| 431 | 404 | } |
| 432 | 405 | |
@@ -436,8 +409,7 @@ discard block |
||
| 436 | 409 | * @param string $defaultValue |
| 437 | 410 | * @return void |
| 438 | 411 | */ |
| 439 | - public function setDefaultValue($defaultValue) |
|
| 440 | - { |
|
| 412 | + public function setDefaultValue($defaultValue) { |
|
| 441 | 413 | $this->defaultValue = $defaultValue; |
| 442 | 414 | } |
| 443 | 415 | |
@@ -446,8 +418,7 @@ discard block |
||
| 446 | 418 | * |
| 447 | 419 | * @return string $validation |
| 448 | 420 | */ |
| 449 | - public function getValidation() |
|
| 450 | - { |
|
| 421 | + public function getValidation() { |
|
| 451 | 422 | return $this->validation; |
| 452 | 423 | } |
| 453 | 424 | |
@@ -457,8 +428,7 @@ discard block |
||
| 457 | 428 | * @param string $validation |
| 458 | 429 | * @return void |
| 459 | 430 | */ |
| 460 | - public function setValidation($validation) |
|
| 461 | - { |
|
| 431 | + public function setValidation($validation) { |
|
| 462 | 432 | $this->validation = $validation; |
| 463 | 433 | } |
| 464 | 434 | |
@@ -467,8 +437,7 @@ discard block |
||
| 467 | 437 | * |
| 468 | 438 | * @return string $dataType |
| 469 | 439 | */ |
| 470 | - public function getDataType() |
|
| 471 | - { |
|
| 440 | + public function getDataType() { |
|
| 472 | 441 | return $this->dataType; |
| 473 | 442 | } |
| 474 | 443 | |
@@ -478,32 +447,28 @@ discard block |
||
| 478 | 447 | * @param string $dataType |
| 479 | 448 | * @return void |
| 480 | 449 | */ |
| 481 | - public function setDataType($dataType) |
|
| 482 | - { |
|
| 450 | + public function setDataType($dataType) { |
|
| 483 | 451 | $this->dataType = $dataType; |
| 484 | 452 | } |
| 485 | 453 | |
| 486 | 454 | /** |
| 487 | 455 | * @return string |
| 488 | 456 | */ |
| 489 | - public function getGndFieldUid() |
|
| 490 | - { |
|
| 457 | + public function getGndFieldUid() { |
|
| 491 | 458 | return $this->gndFieldUid; |
| 492 | 459 | } |
| 493 | 460 | |
| 494 | 461 | /** |
| 495 | 462 | * @param string $gndFieldUid |
| 496 | 463 | */ |
| 497 | - public function setGndFieldUid($gndFieldUid) |
|
| 498 | - { |
|
| 464 | + public function setGndFieldUid($gndFieldUid) { |
|
| 499 | 465 | $this->gndFieldUid = $gndFieldUid; |
| 500 | 466 | } |
| 501 | 467 | |
| 502 | 468 | /** |
| 503 | 469 | * @return integer |
| 504 | 470 | */ |
| 505 | - public function getMaxInputLength() |
|
| 506 | - { |
|
| 471 | + public function getMaxInputLength() { |
|
| 507 | 472 | if ($this->maxInputLength == 0) { |
| 508 | 473 | if ($this->inputField == self::input) { |
| 509 | 474 | return 255; |
@@ -518,8 +483,7 @@ discard block |
||
| 518 | 483 | /** |
| 519 | 484 | * @return integer |
| 520 | 485 | */ |
| 521 | - public function setMaxInputLength($maxInputLength) |
|
| 522 | - { |
|
| 486 | + public function setMaxInputLength($maxInputLength) { |
|
| 523 | 487 | $this->maxInputLength = $maxInputLength; |
| 524 | 488 | } |
| 525 | 489 | |
@@ -534,8 +498,7 @@ discard block |
||
| 534 | 498 | /** |
| 535 | 499 | * @param bool $embargo |
| 536 | 500 | */ |
| 537 | - public function setEmbargo(bool $embargo) |
|
| 538 | - { |
|
| 501 | + public function setEmbargo(bool $embargo) { |
|
| 539 | 502 | $this->embargo = $embargo; |
| 540 | 503 | } |
| 541 | 504 | |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | * The TYPO3 project - inspiring people to share! |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -class DocumentFormField extends AbstractFormElement |
|
| 18 | -{ |
|
| 17 | +class DocumentFormField extends AbstractFormElement { |
|
| 19 | 18 | |
| 20 | 19 | protected $value; |
| 21 | 20 | |
@@ -55,13 +54,11 @@ discard block |
||
| 55 | 54 | */ |
| 56 | 55 | protected $maxInputLength; |
| 57 | 56 | |
| 58 | - public function getValue() |
|
| 59 | - { |
|
| 57 | + public function getValue() { |
|
| 60 | 58 | return $this->value; |
| 61 | 59 | } |
| 62 | 60 | |
| 63 | - public function setValue($value, $defaultValue = '') |
|
| 64 | - { |
|
| 61 | + public function setValue($value, $defaultValue = '') { |
|
| 65 | 62 | |
| 66 | 63 | $this->hasDefaultValue = !empty($defaultValue); |
| 67 | 64 | |
@@ -92,13 +89,11 @@ discard block |
||
| 92 | 89 | } |
| 93 | 90 | } |
| 94 | 91 | |
| 95 | - public function getInputField() |
|
| 96 | - { |
|
| 92 | + public function getInputField() { |
|
| 97 | 93 | return $this->inputField; |
| 98 | 94 | } |
| 99 | 95 | |
| 100 | - public function setInputField($inputField) |
|
| 101 | - { |
|
| 96 | + public function setInputField($inputField) { |
|
| 102 | 97 | $this->inputField = $inputField; |
| 103 | 98 | } |
| 104 | 99 | |
@@ -106,8 +101,7 @@ discard block |
||
| 106 | 101 | * |
| 107 | 102 | * @return array |
| 108 | 103 | */ |
| 109 | - public function getInputOptions() |
|
| 110 | - { |
|
| 104 | + public function getInputOptions() { |
|
| 111 | 105 | return $this->inputOptions; |
| 112 | 106 | } |
| 113 | 107 | |
@@ -115,8 +109,7 @@ discard block |
||
| 115 | 109 | * |
| 116 | 110 | * @param \EWW\Dpf\Domain\Model\InputOptionList $inputOptionList |
| 117 | 111 | */ |
| 118 | - public function setInputOptions(\EWW\Dpf\Domain\Model\InputOptionList $inputOptionList = null) |
|
| 119 | - { |
|
| 112 | + public function setInputOptions(\EWW\Dpf\Domain\Model\InputOptionList $inputOptionList = null) { |
|
| 120 | 113 | |
| 121 | 114 | $this->inputOptions = array(); |
| 122 | 115 | |
@@ -136,8 +129,7 @@ discard block |
||
| 136 | 129 | * |
| 137 | 130 | * @return string $fillOutService |
| 138 | 131 | */ |
| 139 | - public function getFillOutService() |
|
| 140 | - { |
|
| 132 | + public function getFillOutService() { |
|
| 141 | 133 | return $this->fillOutService; |
| 142 | 134 | } |
| 143 | 135 | |
@@ -147,8 +139,7 @@ discard block |
||
| 147 | 139 | * @param string $fillOutService |
| 148 | 140 | * @return void |
| 149 | 141 | */ |
| 150 | - public function setFillOutService($fillOutService) |
|
| 151 | - { |
|
| 142 | + public function setFillOutService($fillOutService) { |
|
| 152 | 143 | $this->fillOutService = $fillOutService; |
| 153 | 144 | } |
| 154 | 145 | |
@@ -157,8 +148,7 @@ discard block |
||
| 157 | 148 | * |
| 158 | 149 | * @return boolean $consent |
| 159 | 150 | */ |
| 160 | - public function getConsent() |
|
| 161 | - { |
|
| 151 | + public function getConsent() { |
|
| 162 | 152 | return $this->consent; |
| 163 | 153 | } |
| 164 | 154 | |
@@ -168,23 +158,19 @@ discard block |
||
| 168 | 158 | * @param boolean $consent |
| 169 | 159 | * @return void |
| 170 | 160 | */ |
| 171 | - public function setConsent($consent) |
|
| 172 | - { |
|
| 161 | + public function setConsent($consent) { |
|
| 173 | 162 | $this->consent = $consent; |
| 174 | 163 | } |
| 175 | 164 | |
| 176 | - public function getHasDefaultValue() |
|
| 177 | - { |
|
| 165 | + public function getHasDefaultValue() { |
|
| 178 | 166 | return $this->hasDefaultValue; |
| 179 | 167 | } |
| 180 | 168 | |
| 181 | - public function getValidation() |
|
| 182 | - { |
|
| 169 | + public function getValidation() { |
|
| 183 | 170 | return $this->validation; |
| 184 | 171 | } |
| 185 | 172 | |
| 186 | - public function setValidation($validation) |
|
| 187 | - { |
|
| 173 | + public function setValidation($validation) { |
|
| 188 | 174 | $this->validation = $validation; |
| 189 | 175 | } |
| 190 | 176 | |
@@ -193,8 +179,7 @@ discard block |
||
| 193 | 179 | * |
| 194 | 180 | * @return string |
| 195 | 181 | */ |
| 196 | - public function getDataType() |
|
| 197 | - { |
|
| 182 | + public function getDataType() { |
|
| 198 | 183 | return $this->dataType; |
| 199 | 184 | } |
| 200 | 185 | |
@@ -204,8 +189,7 @@ discard block |
||
| 204 | 189 | * @param string $dataType |
| 205 | 190 | * @return void |
| 206 | 191 | */ |
| 207 | - public function setDataType($dataType) |
|
| 208 | - { |
|
| 192 | + public function setDataType($dataType) { |
|
| 209 | 193 | $this->dataType = $dataType; |
| 210 | 194 | } |
| 211 | 195 | |
@@ -9,8 +9,7 @@ discard block |
||
| 9 | 9 | use EWW\Dpf\Domain\Workflow\DocumentWorkflow; |
| 10 | 10 | use EWW\Dpf\Controller\AbstractController; |
| 11 | 11 | |
| 12 | -class DocumentManager |
|
| 13 | -{ |
|
| 12 | +class DocumentManager { |
|
| 14 | 13 | /** |
| 15 | 14 | * objectManager |
| 16 | 15 | * |
@@ -75,8 +74,7 @@ discard block |
||
| 75 | 74 | * @return Document|null |
| 76 | 75 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 77 | 76 | */ |
| 78 | - public function read($identifier) |
|
| 79 | - { |
|
| 77 | + public function read($identifier) { |
|
| 80 | 78 | if (!$identifier) { |
| 81 | 79 | return null; |
| 82 | 80 | } |
@@ -121,8 +119,7 @@ discard block |
||
| 121 | 119 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 122 | 120 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException |
| 123 | 121 | */ |
| 124 | - public function update(Document $document, $workflowTransition = null, $deletedFiles = [], $newFiles = []) |
|
| 125 | - { |
|
| 122 | + public function update(Document $document, $workflowTransition = null, $deletedFiles = [], $newFiles = []) { |
|
| 126 | 123 | // xml data fields are limited to 64 KB |
| 127 | 124 | if (strlen($document->getXmlData()) >= 64 * 1024 || strlen($document->getSlubInfoData() >= 64 * 1024)) { |
| 128 | 125 | throw new \EWW\Dpf\Exceptions\DocumentMaxSizeErrorException("Maximum document size exceeded."); |
@@ -183,7 +180,7 @@ discard block |
||
| 183 | 180 | } |
| 184 | 181 | |
| 185 | 182 | // check embargo |
| 186 | - if(!$this->hasActiveEmbargo($document)){ |
|
| 183 | + if(!$this->hasActiveEmbargo($document)) { |
|
| 187 | 184 | $this->removeDocument($document); |
| 188 | 185 | } else { |
| 189 | 186 | $document->setState(DocumentWorkflow::LOCAL_STATE_IN_PROGRESS . ':' . $document->getRemoteState()); |
@@ -221,8 +218,7 @@ discard block |
||
| 221 | 218 | /** |
| 222 | 219 | * @return DocumentTransferManager |
| 223 | 220 | */ |
| 224 | - protected function getDocumentTransferManager() |
|
| 225 | - { |
|
| 221 | + protected function getDocumentTransferManager() { |
|
| 226 | 222 | /** @var DocumentTransferManager $documentTransferManager */ |
| 227 | 223 | $documentTransferManager = $this->objectManager->get(DocumentTransferManager::class); |
| 228 | 224 | |
@@ -244,8 +240,7 @@ discard block |
||
| 244 | 240 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 245 | 241 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException |
| 246 | 242 | */ |
| 247 | - protected function updateFiles(Document $document, $deletedFiles, $newFiles) |
|
| 248 | - { |
|
| 243 | + protected function updateFiles(Document $document, $deletedFiles, $newFiles) { |
|
| 249 | 244 | // Delete files |
| 250 | 245 | /** @var File $deleteFile */ |
| 251 | 246 | foreach ($deletedFiles as $deleteFile) { |
@@ -272,8 +267,7 @@ discard block |
||
| 272 | 267 | * @param $document |
| 273 | 268 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 274 | 269 | */ |
| 275 | - protected function removeDocument($document) |
|
| 276 | - { |
|
| 270 | + protected function removeDocument($document) { |
|
| 277 | 271 | $files = $this->fileRepository->findByDocument($document->getUid()); |
| 278 | 272 | foreach ($files as $file) { |
| 279 | 273 | $this->fileRepository->remove($file); |
@@ -292,8 +286,7 @@ discard block |
||
| 292 | 286 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException |
| 293 | 287 | * @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException |
| 294 | 288 | */ |
| 295 | - protected function updateRemotely($document, $workflowTransition = null, $deletedFiles = [], $newFiles = []) |
|
| 296 | - { |
|
| 289 | + protected function updateRemotely($document, $workflowTransition = null, $deletedFiles = [], $newFiles = []) { |
|
| 297 | 290 | $lastModDate = $this->getDocumentTransferManager()->getLastModDate($document->getObjectIdentifier()); |
| 298 | 291 | $docLastModDate = $document->getRemoteLastModDate(); |
| 299 | 292 | if ($lastModDate !== $docLastModDate && !empty($docLastModDate)) { |
@@ -330,7 +323,7 @@ discard block |
||
| 330 | 323 | |
| 331 | 324 | if ($this->getDocumentTransferManager()->update($document)) { |
| 332 | 325 | |
| 333 | - if(!$this->hasActiveEmbargo($document)){ |
|
| 326 | + if(!$this->hasActiveEmbargo($document)) { |
|
| 334 | 327 | $this->removeDocument($document); |
| 335 | 328 | } else { |
| 336 | 329 | $document->setState(DocumentWorkflow::LOCAL_STATE_IN_PROGRESS . ':' . $document->getRemoteState()); |
@@ -346,10 +339,9 @@ discard block |
||
| 346 | 339 | * @return bool (true: if no embargo is set or embargo is expired, false: embargo is active) |
| 347 | 340 | * @throws \Exception |
| 348 | 341 | */ |
| 349 | - protected function hasActiveEmbargo($document) |
|
| 350 | - { |
|
| 342 | + protected function hasActiveEmbargo($document) { |
|
| 351 | 343 | $currentDate = new \DateTime('now'); |
| 352 | - if($currentDate > $document->getEmbargoDate()){ |
|
| 344 | + if($currentDate > $document->getEmbargoDate()) { |
|
| 353 | 345 | // embargo is expired |
| 354 | 346 | return false; |
| 355 | 347 | } else { |