...
 
Commits (188)
......@@ -221,7 +221,7 @@ class content implements \bundle\recordsManagement\Controller\archiveDescription
$contents = $this->sdoFactory->find("archivesPubliques/content", "archiveId='$archiveId'");
if (count($contents)) {
if (!empty($contents)) {
foreach ($contents as $content) {
if (!empty($content->resId)) {
continue;
......
......@@ -21,10 +21,10 @@ namespace ext\archivesPubliques\bundle\seda\Controller;
/**
* Class for ArchiveModificationNotification message handling
*
*
* @author Alexandre Morin (Maarch) <alexandre.morin@maarch.org>
*/
class ArchiveModificationNotification
class ArchiveModificationNotification
extends abstractMessage
{
/**
......@@ -34,8 +34,8 @@ class ArchiveModificationNotification
public function send($message)
{
$archiveModificationNotification = abstractMessage::send($message);
$archiveModificationNotification->modificationNotificationIdentifier = \laabs::newInstance('seda/ID', $message->reference);
$archiveModificationNotification->modificationNotificationIdentifier = \laabs::newInstance('seda/ID', $message->reference);
if (isset($message->unitIdentifier)) {
foreach ($message->unitIdentifier as $unitIdentifier) {
......@@ -48,9 +48,9 @@ class ArchiveModificationNotification
$archiveModificationNotification->originatingAgency = $this->sendOrganization($message->recipientOrg);
foreach ($message->archive as $archive) {
$archiveModificationNotification->archive[] = $this->sendArchive($archive, $withAttachment = false);
$archiveModificationNotification->archive[] = $this->sendArchive($archive, $withAttachment = true);
}
//$this->sendXml($message, $withData = false);
$this->sendXml($message, $withData = false);
}
}
\ No newline at end of file
}
This diff is collapsed.
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle seda2.
*
* Bundle seda2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle seda2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle seda2. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for ArchiveDeliveryRequest message handling
*
* @author Alexis Ragot <alexis.ragot@maarch.org>
*/
class ArchiveDeliveryRequest extends abstractMessage
{
/**
* Receive message with all contents embedded
* @param string $message The message
*/
public function send($message)
{
$archiveDeliveryRequest = abstractMessage::send($message);
$archiveDeliveryRequest->derogation = $message->derogation;
$archiveDeliveryRequest->archivalAgency = $this->sendOrganization($message->recipientOrg);
$archiveDeliveryRequest->requester = $this->sendOrganization($message->senderOrg);
foreach ($message->unitIdentifier as $unitIdentifier) {
$archiveDeliveryRequest->unitIdentifier[] = $this->sendUnitIdentifier($unitIdentifier);
}
$archiveDeliveryRequest->dataObjectPackage = $this->sendDataObjectPackage($message, true);
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle medona.
*
* Bundle medona is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle medona is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle medona. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for DeliveryRequestReply message handling
*/
class ArchiveDeliveryRequestReply extends abstractMessage
{
/**
* Send message with all contents embedded
* @param string $message The message
*/
public function send($message)
{
$this->message = $message;
$archiveDeliveryRequestReply = abstractMessage::send($message);
$archiveDeliveryRequestReply->replyCode = $this->sendReplyCode($message->replyCode);
$archiveDeliveryRequestReply->messageRequestIdentifier = \laabs::newInstance('seda2/ID', $message->requestReference);
$archiveDeliveryRequestReply->authorizationRequestReplyIdentifier = (string) \laabs::newInstance('seda2/ID', $message->authorizationReference);
$archiveDeliveryRequestReply->archivalAgency = $this->sendOrganization($message->senderOrg);
$archiveDeliveryRequestReply->requester = $this->sendOrganization($message->recipientOrg);
foreach ($message->unitIdentifier as $unitIdentifier) {
$archiveDeliveryRequestReply->unitIdentifier[] = $this->sendUnitIdentifier($unitIdentifier);
}
$archiveDeliveryRequestReply->dataObjectPackage = $this->sendDataObjectPackage($message, true);
$this->sendXml($message, true);
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle medona.
*
* Bundle medona is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle medona is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle medona. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for ArchiveDestructionNotification message handling
*/
class ArchiveDestructionNotification extends abstractMessage
{
/**
* Send message with all contents embedded
* @param string $message The message
*/
public function send($message)
{
$archiveDestructionNotification = abstractMessage::send($message);
if (isset($message->authorizationMessages[0])) {
$archiveDestructionNotification->authorizationRequestReplyIdentifier = \laabs::newInstance('seda2/ID', $message->authorizationMessages[0]->reference);
}
$archiveDestructionNotification->archivalAgency = $this->sendOrganization($message->senderOrg);
$archiveDestructionNotification->originatingAgency = $this->sendOrganization($message->recipientOrg);
foreach ($message->unitIdentifier as $unitIdentifier) {
$archiveDestructionNotification->unitIdentifier[] = $this->sendUnitIdentifier($unitIdentifier);
}
$archiveModificationNotification->dataObjectPackage = $this->sendDataObjectPackage($message, false);
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle medona.
*
* Bundle medona is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle medona is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle medona. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for ArchiveDestructionNotification message handling
*/
class ArchiveDestructionRequest extends abstractMessage
{
/**
* Send message with all contents embedded
* @param string $message The message
*/
public function send($message)
{
$archiveDestructionRequest = abstractMessage::send($message);
$archiveDestructionRequest->destructionRequestIdentifier = \laabs::newInstance('seda2/ID', $message->reference);
$archiveDestructionRequest->destructionRequestIdentifier->schemeID = 'SIREN';
$archiveDestructionRequest->archivalAgency = $this->sendOrganization($message->recipientOrg);
$archiveDestructionRequest->requester = $this->sendOrganization($message->senderOrg);
foreach ($message->unitIdentifier as $unitIdentifier) {
$archiveDestructionRequest->unitIdentifier[] = $this->sendUnitIdentifier($unitIdentifier);
}
$archiveDestructionRequest->dataObjectPackage = $this->sendDataObjectPackage($message, true);
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle seda2.
*
* Bundle seda2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle seda2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle seda2. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for ArchiveModificationNotification message handling
*/
class ArchiveModificationNotification extends abstractMessage
{
/**
* Send message with all contents embedded
* @param string $message The message
*/
public function send($message)
{
$archiveModificationNotification = abstractMessage::send($message);
if (isset($message->unitIdentifier)) {
foreach ($message->unitIdentifier as $unitIdentifier) {
$archiveModificationNotification->unitIdentifier[] = $this->sendUnitIdentifier($unitIdentifier);
}
}
$archiveModificationNotification->archivalAgency = $this->sendOrganization($message->senderOrg);
$archiveModificationNotification->originatingAgency = $this->sendOrganization($message->recipientOrg);
$archiveModificationNotification->dataObjectPackage = $this->sendDataObjectPackage($message, false);
$this->sendXml($message, false);
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle medona.
*
* Bundle medona is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle medona is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle medona. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for restitution message handling
*/
class ArchiveRestitution extends ArchiveTransfer
{
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle seda2.
*
* Bundle seda2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle seda2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle seda2. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for ArchiveRestitutionRequest message handling
*
* @author Propser DE ALURE <prosper.delaure@maarch.org>
*/
class ArchiveRestitutionRequest extends abstractMessage
{
/**
* Receive message with all contents embedded
* @param string $message The message
*/
public function send($message)
{
$archiveRestitutionRequest = abstractMessage::send($message);
$archiveRestitutionRequest->archivalAgency = $this->sendOrganization($message->senderOrg);
$archiveRestitutionRequest->originatingAgency = $this->sendOrganization($message->recipientOrg);
foreach ($message->unitIdentifier as $unitIdentifier) {
$archiveRestitutionRequest->unitIdentifier[] = $this->sendUnitIdentifier($unitIdentifier);
}
$archiveRestitutionRequest->dataObjectPackage = $this->sendDataObjectPackage($message, true);
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle medona.
*
* Bundle medona is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle medona is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle medona. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for restitutionRequestReply message handling
*/
class ArchiveRestitutionRequestReply extends abstractMessage
{
/**
* Send message with all contents embedded
* @param string $message The message
*/
public function send($message)
{
$this->message = $message;
$archiveRestitutionRequestReply = abstractMessage::send($message);
$archiveRestitutionRequestReply->replyCode = $this->sendReplyCode($message->replyCode);
$archiveRestitutionRequestReply->messageRequestIdentifier = \laabs::newInstance('seda/ID', $message->requestReference);
$archiveRestitutionRequestReply->archivalAgency = $this->sendOrganization($message->senderOrg);
$archiveRestitutionRequestReply->originatingAgency = $this->sendOrganization($message->recipientOrg);
foreach ($this->message->unitIdentifier as $unitIdentifier) {
$archiveRestitutionRequestReply->unitIdentifier[] = $this->sendUnitIdentifier($unitIdentifier);
}
$archiveRestitutionRequestReply->dataObjectPackage = $this->sendDataObjectPackage($message, true);
}
}
......@@ -29,7 +29,8 @@ class ArchiveTransfer extends abstractMessage
{
use ArchiveTransferReceptionTrait,
ArchiveTransferValidationTrait,
ArchiveTransferProcessTrait;
ArchiveTransferProcessTrait,
ArchiveTransferSendingTrait;
public $droid;
public $jhove;
......
......@@ -241,13 +241,19 @@ trait ArchiveTransferProcessTrait
if (!empty($sedaArchive->dataObjectReference)) {
foreach ($sedaArchive->dataObjectReference as $dataObjectReference) {
if (isset($dataObjectReference->dataObjectGroupReferenceId)) {
// include group
} elseif (isset($dataObjectReference->dataObjectReferenceId)) {
if (isset($dataObjectReference->dataObjectReferenceId)) {
$binaryDataObject = $this->getBinaryDataObjectById($dataObjectReference->dataObjectReferenceId, $this->message);
$resource = $this->processBinaryObject($archive, $binaryDataObject, $dataObjectReference);
$resource = $this->processBinaryObject($archive, $binaryDataObject);
$archive->digitalResources[] = $resource;
} elseif (isset($dataObjectReference->dataObjectGroupReferenceId)) {
$binaryDataObjects = $this->getBinaryDataObjectsByGroupId($dataObjectReference->dataObjectGroupReferenceId, $this->message);
if (!$binaryDataObjects) {
continue;
}
foreach ($binaryDataObjects as $binaryDataObject) {
$resource = $this->processBinaryObject($archive, $binaryDataObject);
$archive->digitalResources[] = $resource;
}
}
}
}
......@@ -262,16 +268,19 @@ trait ArchiveTransferProcessTrait
foreach ($content as $key => $value) {
if (isset($value)) {
switch ($key) {
case 'archivingAgencyArchiveUnitIdentifier':
$archive->archiverArchiveId = $content->archivingAgencyArchiveUnitIdentifier = $value;
case 'archivalAgencyArchiveUnitIdentifier':
$value = (array) $value;
$archive->archiverArchiveId = $value[0];
break;
case 'originatingAgencyArchiveUnitIdentifier':
$archive->originatorArchiveId = $content->originatingAgencyArchiveUnitIdentifier = $value;
$value = (array) $value;
$archive->originatorArchiveId = $value[0];
break;
case 'transferringAgencyArchiveUnitIdentifier':
$archive->depositorArchiveId = $content->transferringAgencyArchiveUnitIdentifier = $value;
$value = (array) $value;
$archive->depositorArchiveId = $value[0];
break;
case 'descriptionLevel':
......@@ -283,44 +292,10 @@ trait ArchiveTransferProcessTrait
break;
case 'title':
if (\gettype($value) === 'array') {
$archive->archiveName = $value[0];
} else {
$archive->archiveName = $value;
}
$value = (array) $value;
$archive->archiveName = $value[0];
break;
/*case 'keyword':
if (!empty($value)) {
$content->keyword = [];
foreach ($value as $sedaKeyword) {
$content->keyword[] = $this->processKeyword($sedaKeyword);
}
}
break;
case 'custodialHistory':
if (!empty($value->custodialHistoryItem)) {
$content->custodialHistory = new \stdClass();
$content->custodialHistory->custodialHistoryItem = [];
foreach ($value->custodialHistoryItem as $sedaCustodialHistoryItem) {
$content->custodialHistory->custodialHistoryItem[] = $this->processCustodialHistoryItem($sedaCustodialHistoryItem);
}
}
break;
case 'authorizedAgent':
case 'writer':
case 'addressee':
case 'recipient':
if (!empty($value)) {
$content->{$key} = [];
foreach ($value as $agent) {
$content->{$key}[] = $this->processAgent($agent);
}
}
break;*/
case 'createdDate':
$archive->originatingDate = $value;
break;
......@@ -434,7 +409,7 @@ trait ArchiveTransferProcessTrait
}
}
protected function processBinaryObject($archive, $binaryDataObject, $dataObjectId)
protected function processBinaryObject($archive, $binaryDataObject)
{
$messageDir = dirname($this->message->path);
$filepath = $messageDir.DIRECTORY_SEPARATOR.$binaryDataObject->uri;
......@@ -479,7 +454,7 @@ trait ArchiveTransferProcessTrait
{
$targetBinaryDataObject = $this->getBinaryDataObjectById($sedaRelationship->target, $this->message);
$relatedResource = $this->processBinaryObject($archive, $targetBinaryDataObject, $sedaRelationship->target);
$relatedResource = $this->processBinaryObject($archive, $targetBinaryDataObject);
$relatedResource->relatedResId = $resource->resId;
$relatedResource->relationshipType = (string) $sedaRelationship->type;
......
......@@ -74,21 +74,41 @@ trait ArchiveTransferReceptionTrait
if (isset($message->object->archivalAgreement->value)) {
$message->archivalAgreementReference = $message->object->archivalAgreement->value;
}
$this->receiveAttachments($message);
}
protected function receiveAttachments($message)
{
$archives = $message->object->dataObjectPackage->descriptiveMetadata->archiveUnit;
$binaryDataObjects = (array) $message->object->dataObjectPackage->binaryDataObject;
$physicalDataObjects = (array) $message->object->dataObjectPackage->physicalDataObject;
$message->dataObjectCount = count($binaryDataObjects) + count($physicalDataObjects);
foreach ($archives as $archive) {
if ($archive->dataObjectReference) {
$this->validateDataObjectReferences($message, $archive);
if (is_null($message->object->dataObjectPackage)) {
$this->sendError("213");
} else {
$dataObjectPackage = $message->object->dataObjectPackage;
$archives = $dataObjectPackage->descriptiveMetadata->archiveUnit;
$binaryDataObjects = (array) $dataObjectPackage->binaryDataObject;
$physicalDataObjects = (array) $dataObjectPackage->physicalDataObject;
if (isset($dataObjectPackage->dataObjectGroup)) {
foreach ((array)$dataObjectPackage->dataObjectGroup as $dataObjectGroup) {
if (isset($dataObjectGroup->binaryDataObject)) {
foreach ($dataObjectGroup->binaryDataObject as $binaryDataObject) {
$binaryDataObjects[] = $binaryDataObject;
}
}
if (isset($dataObjectGroup->physicalDataObject)) {
foreach ($dataObjectGroup->physicalDataObject as $physicalDataObject) {
$physicalDataObjects[] = $physicalDataObject;
}
}
}
}
$message->dataObjectCount = count($binaryDataObjects) + count($physicalDataObjects);
foreach ($archives as $archive) {
if ($archive->dataObjectReference) {
$this->validateDataObjectReferences($message, $archive);
}
}
}
......@@ -97,10 +117,10 @@ trait ArchiveTransferReceptionTrait
$receivedFiles = glob($messageDir.DIRECTORY_SEPARATOR."*.*");
$declaredFiles = array($messageDir.DIRECTORY_SEPARATOR.(string) $message->messageId.".xml");
if (count($binaryDataObjects)) {
if (isset($binaryDataObjects) && is_array($binaryDataObjects) && !empty($binaryDataObjects)) {
foreach ($binaryDataObjects as $binaryDataObject) {
$dataObjectId = $binaryDataObject->id;
// Use attachment to create local file with uri access
if (isset($binaryDataObject->attachment)) {
$attachment = $binaryDataObject->attachment;
......
......@@ -22,8 +22,7 @@ namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for ArchiveTransferReply message handling
*/
class ArchiveTransferReply
extends abstractMessage
class ArchiveTransferReply extends abstractMessage
{
/**
* Generate a new archive delivery request reply
......@@ -35,14 +34,12 @@ class ArchiveTransferReply
$archiveTransferReply->replyCode = $this->sendReplyCode($message->replyCode);
$archiveTransferReply->messageRequestIdentifier = \laabs::newInstance('seda/ID', $message->requestReference);
$archiveTransferReply->messageIdentifier = \laabs::newInstance('seda/ID', $message->reference);
$archiveTransferReply->messageRequestIdentifier = \laabs::newInstance('seda2/ID', $message->requestReference);
$archiveTransferReply->archivalAgency = $this->sendOrganization($message->senderOrg);
$archiveTransferReply->transferringAgency = $this->sendOrganization($message->recipientOrg);
//$this->sendXml($message, $withData = false);
$archiveTransferReply->dataObjectPackage = $this->sendDataObjectPackage($message, false);
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle medona
*
* Bundle medona is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle medona is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle medona. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Trait for archive restitution
*
* @author Alexandre Morin <alexandre.morin@maarch.org>
**/
trait ArchiveTransferSendingTrait
{
/**
* Generate a new archive tranfer
* @param medona/message $message
*/
public function send($message)
{
$archiveTransferReply = abstractMessage::send($message);
$archiveTransferReply->transferRequestReplyIdentifier = \laabs::newInstance('seda2/ID', $message->reference);
$archiveTransferReply->archivalAgency = $this->sendOrganization($message->recipientOrg);
$archiveTransferReply->transferringAgency = $this->sendOrganization($message->senderOrg);
$archiveTransferReply->dataObjectPackage = $this->sendDataObjectPackage($message, true);
$this->sendXml($message, true);
}
}
......@@ -235,8 +235,9 @@ trait ArchiveTransferValidationTrait
{
$serviceLevelController = \laabs::newController("recordsManagement/serviceLevel");
if (isset($message->object->dataObjectPackage->managementMetadata->serviceLevel)) {
$serviceLevelReference = $message->object->dataObjectPackage->managementMetadata->serviceLevel->value;
$dataObjectPackage = $message->object->dataObjectPackage;
if (isset($dataObjectPackage->managementMetadata->serviceLevel)) {
$serviceLevelReference = $dataObjectPackage->managementMetadata->serviceLevel->value;
} elseif (isset($archivalAgreement)) {
$serviceLevelReference = $archivalAgreement->serviceLevelReference;
}
......@@ -262,7 +263,15 @@ trait ArchiveTransferValidationTrait
$allowedFormats = [];
}
$binaryDataObjects = (array) $message->object->dataObjectPackage->binaryDataObject;
$binaryDataObjects = (array) $dataObjectPackage->binaryDataObject;
if (isset($dataObjectPackage->dataObjectGroup)) {
foreach ((array)$dataObjectPackage->dataObjectGroup as $dataObjectGroup) {
if (!isset($dataObjectGroup->binaryDataObject)) {
continue;
}
$binaryDataObjects = array_merge($binaryDataObjects, $dataObjectGroup->binaryDataObject);
}
}
$messageDir = dirname($message->path); // List received files
......
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle medona.
*
* Bundle medona is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle medona is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle medona. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for AuthorizationOriginatingAgencyRequest message handling
*/
class AuthorizationControlAuthorityRequest extends abstractMessage
{
/**
* Send message with all contents embedded
* @param string $message The message
*/
public function send($message)
{
$authorizationControlAuthorityRequest = abstractMessage::send($message);
$authorizationControlAuthorityRequest->archivalAgency = $this->sendOrganization($message->senderOrg);
$authorizationControlAuthorityRequest->controlAuthority = $this->sendOrganization($message->recipientOrg);
if (isset($message->authorizationRequestContent)) {
$authorizationControlAuthorityRequest->authorizationRequestContent = $this->sendRequest($message->authorizationRequestContent);
}
$authorizationControlAuthorityRequest->dataObjectPackage = $this->sendDataObjectPackage($message, false);
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle medona.
*
* Bundle medona is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle medona is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle medona. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for AuthorizationControlAuthorityRequestReply message handling
*/
class AuthorizationControlAuthorityRequestReply extends abstractMessage
{
/**
* Send message with all contents embedded
* @param string $message The message
*/
public function send($message)
{
$authorizationControlAuthorityRequestReply = abstractMessage::send($message);
$authorizationControlAuthorityRequestReply->replyCode = $this->sendReplyCode($message->replyCode);
$authorizationControlAuthorityRequestReply->messageRequestIdentifier = \laabs::newInstance('seda2/ID', $message->requestReference);
$authorizationControlAuthorityRequestReply->archivalAgency = $this->sendOrganization($message->recipientOrg);
$authorizationControlAuthorityRequestReply->controlAuthority = $this->sendOrganization($message->senderOrg);
$authorizationControlAuthorityRequestReply->dataObjectPackage = $this->sendDataObjectPackage($message, false);
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle seda2.
*
* Bundle seda2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle seda2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle seda2. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for AuthorizationOriginatingAgencyRequest message handling
*/
class AuthorizationOriginatingAgencyRequest extends abstractMessage
{
/**
* Generate a new archive delivery request reply
* @param medona/message $message
*/
public function send($message)
{
$authorizationOriginatingAgencyRequest = abstractMessage::send($message);
$authorizationOriginatingAgencyRequest->authorizationRequestContent = $this->sendRequest($message->authorizationRequestContent);
$authorizationOriginatingAgencyRequest->archivalAgency = $this->sendOrganization($message->senderOrg);
$authorizationOriginatingAgencyRequest->originatingAgency = $this->sendOrganization($message->recipientOrg);
$authorizationOriginatingAgencyRequest->dataObjectPackage = $this->sendDataObjectPackage($message, false);
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle seda2.
*
* Bundle seda2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle seda2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle seda2. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Controller;
/**
* Class for AuthorizationOriginatingAgencyRequest message handling
*/
class AuthorizationOriginatingAgencyRequestReply extends abstractMessage
{
/**
* Generate a new archive delivery request reply
* @param medona/message $message
*/
public function send($message)
{
$authorizationOriginatingAgencyRequestReply = abstractMessage::send($message);
$authorizationOriginatingAgencyRequestReply->replyCode = $this->sendReplyCode($message->replyCode);
$authorizationOriginatingAgencyRequestReply->authorizationControlAuthorityRequestIdentifier = \laabs::newInstance('seda2/ID', $message->requestReference);
$authorizationOriginatingAgencyRequestReply->authorizationOriginatingAgencyRequestReplyIdentifier = \laabs::newInstance('seda2/ID', $message->reference);
$authorizationOriginatingAgencyRequestReply->archivalAgency = $this->sendOrganization($message->recipientOrg);
$authorizationOriginatingAgencyRequestReply->controlAuthority = $this->sendOrganization($message->senderOrg);
$authorizationOriginatingAgencyRequestReply->dataObjectPackage = $this->sendDataObjectPackage($message, false);
}
}
This diff is collapsed.
......@@ -2,18 +2,18 @@
namespace ext\archivesPubliques\bundle\seda2\Model;
/**
* All business message
* The abstract for all business message
*
* @package Seda2
* @author Alexandre Morin <alexandre.morin@maarch.org>
*
* @author Cyril VAZQUEZ (Maarch) <cyril.vazquez@maarch.org>
*
* @xmlns seda2 fr:gouv:culture:archivesdefrance:seda:v2.1
*
*/
class BusinessMessage extends Message
class AbstractBusinessMessage extends AbstractMessage
{
/**
* The archival agreement
* The message id
*
* @var seda2/ID
* @xpath seda2:ArchivalAgreement
......@@ -21,7 +21,7 @@ class BusinessMessage extends Message
public $archivalAgreement;
/**
* Code list versions
* The comments
*
* @var seda2/CodeListVersions
* @xpath seda2:CodeListVersions
......@@ -29,7 +29,7 @@ class BusinessMessage extends Message
public $codeListVersions;
/**
* Data object package
* The date
*
* @var seda2/DataObjectPackage
* @xpath seda2:DataObjectPackage
......
<?php
namespace ext\archivesPubliques\bundle\seda2\Model;
/**
* The abstract for all business message
*
* @package Seda2
* @author Cyril VAZQUEZ (Maarch) <cyril.vazquez@maarch.org>
*
* @xmlns seda2 fr:gouv:culture:archivesdefrance:seda:v2.1
*
*/
class AbstractMessage
{
/**
* The message id
*
* @var id
* @xvalue generate-id
*/
public $id;
/**
* The comments
*
* @var seda2/Comment[]
* @xpath seda2:Comment
*/
public $comment;
/**
* The date
*
* @var datetime
* @xpath seda2:Date
*/
public $date;
/**
* The message identifier
*
* @var seda2/ID
* @xpath seda2:MessageIdentifier
*/
public $messageIdentifier;
/**
* The signature
*
* @var seda2/SignatureMessage
* @xpath seda2:Signature
*/
public $signature;
}
......@@ -2,7 +2,7 @@
namespace ext\archivesPubliques\bundle\seda2\Model;
/**
* Writer
* Storage Rule
*
* @package Seda2
* @author Alexandre Morin <alexandre.morin@maarch.org>
......@@ -10,33 +10,45 @@ namespace ext\archivesPubliques\bundle\seda2\Model;
*
*
*/
class Writer extends Person
class AgentAbstract extends Recipient
{
/**
* Fonction
* Function
*
* @var string[]
* @xpath seda2:Function
*/
public $function;
/**
* Activité
* Activity
*
* @var string[]
* @xpath seda2:Activity
*/
public $activity;
/**
* Emploi
* Position
*
* @var string[]
* @xpath seda2:Position
*/
public $position;
/**
* Rôle
* Role
*
* @var string[]
* @xpath seda2:Role
*/
public $role;
/**
* Mandate
*
* @var string[]
* @xpath seda2:Mandate
*/
public $mandate;
}
......@@ -10,33 +10,9 @@ namespace ext\archivesPubliques\bundle\seda2\Model;
*
*
*/
class AppraisalRule
class AppraisalRule extends CommonRule
{
/**
* @var seda2/Rule[]
* @xpath seda2:Rule
*/
public $rule;
/**
* @var date[]
* @xpath seda2:StartDate
*/
public $startDate;
/**
* @var boolean
* @xpath seda2:PreventInheritance
*/
public $preventInheritance;
/**
* @var seda2/Rule[]
* @xpath seda2:RefNonRuleId
*/
public $refNonRuleId;
/**
* @var string
* @xpath seda2:FinalAction
*/
......
<?php
namespace ext\archivesPubliques\bundle\seda2\Model;
/**
* The archive transfer message
*
* @package Seda2
* @author Cyril VAZQUEZ (Maarch) <cyril.vazquez@maarch.org>
*
* @xmlns seda2 fr:gouv:culture:archivesdefrance:seda:v2.1
*
*/
class ArchiveDeliveryRequest extends AbstractBusinessMessage
{
/**
* @var boolean
* @xpath seda2:Derogation
*/
public $derogation;
/**
* @var seda2/ID[]
* @xpath seda2:UnitIdentifier
*/
public $unitIdentifier;
/**
* @var seda2/Organization
* @xpath seda2:ArchivalAgency
*/
public $archivalAgency;
/**
* @var seda2/Organization
* @xpath seda2:Requester
*/
public $requester;
}
<?php
namespace ext\archivesPubliques\bundle\seda2\Model;
/**
* The archive transfer message
*
* @package Seda2
* @author Cyril VAZQUEZ (Maarch) <cyril.vazquez@maarch.org>
*
* @xmlns seda2 fr:gouv:culture:archivesdefrance:seda2:v1.0
*
*/
class ArchiveDeliveryRequestReply extends AbstractBusinessMessage
{
/**
* @var seda2/Code
* @xpath seda2:ReplyCode
*/
public $replyCode;
/**
* @var seda2/Event[]
* @xpath seda2:Operation
*/
public $operation;
/**
* @var seda2/ID
* @xpath seda2:MessageRequestIdentifier
*/
public $messageRequestIdentifier;
/**
* @var seda2/ID
* @xpath seda2:AuthorizationRequestReplyIdentifier
*/
public $authorizationRequestReplyIdentifier;
/**
* @var seda2/ID[]
* @xpath seda2:UnitIdentifier
*/
public $unitIdentifier;
/**
* @var seda2/Organization
* @xpath seda2:ArchivalAgency
*/
public $archivalAgency;
/**
* @var seda2/Organization
* @xpath seda2:Requester
*/
public $requester;
}
<?php
namespace ext\archivesPubliques\bundle\seda2\Model;
/**
* The archive transfer message
*
* @package Seda2
* @author Cyril VAZQUEZ (Maarch) <cyril.vazquez@maarch.org>
*
* @xmlns seda2 fr:gouv:culture:archivesdefrance:seda:v2.1
*
*/
class ArchiveDestructionNotification extends AbstractBusinessMessage
{
/**
* @var seda2/ID
* @xpath seda2:AuthorizationRequestReplyIdentifier
*/
public $authorizationRequestReplyIdentifier;
/**
* @var seda2/ID[]
* @xpath seda2:UnitIdentifier
*/
public $unitIdentifier;
/**
* @var seda2/Organization
* @xpath seda2:ArchivalAgency
*/
public $archivalAgency;
/**
* @var seda2/Organization
* @xpath seda2:OriginatingAgency
*/
public $originatingAgency;
}
<?php
namespace ext\archivesPubliques\bundle\seda2\Model;
/**
* The archive transfer message
*
* @package Seda2
* @author Cyril VAZQUEZ (Maarch) <cyril.vazquez@maarch.org>
*
* @xmlns seda2 fr:gouv:culture:archivesdefrance:seda:v2.1
*
*/
class ArchiveDestructionRequest extends AbstractBusinessMessage
{
/**
* @var seda2/ID
* @xpath seda2:DestructionRequestIdentifier
*/
public $destructionRequestIdentifier;
/**
* @var boolean
* @xpath seda2:Derogation
*/
public $derogation;
/**
* @var seda2/ID[]
* @xpath seda2:UnitIdentifier
*/
public $unitIdentifier;
/**
* @var seda2/Organization
* @xpath seda2:ArchivalAgency
*/
public $archivalAgency;
/**
* @var seda2/Organization
* @xpath seda2:Requester
*/
public $requester;
}
<?php
namespace ext\archivesPubliques\bundle\seda2\Model;
/**
* The archive transfer message
*
* @package Seda2
* @author Cyril VAZQUEZ (Maarch) <cyril.vazquez@maarch.org>
*
* @xmlns seda2 fr:gouv:culture:archivesdefrance:seda:v2.1
*
*/
class ArchiveModificationNotification extends AbstractBusinessMessage
{
/**
* @var seda2/ID[]
* @xpath seda2:UnitIdentifier
*/
public $unitIdentifier;
/**
* @var seda2/Organization
* @xpath seda2:ArchivalAgency
*/
public $archivalAgency;
/**
* @var seda2/Organization
* @xpath seda2:OriginatingAgency
*/
public $originatingAgency;
}
<?php
namespace ext\archivesPubliques\bundle\seda2\Model;
/**
* The archive transfer message
*
* @package Seda2
* @author Cyril VAZQUEZ (Maarch) <cyril.vazquez@maarch.org>
*
* @xmlns seda2 fr:gouv:culture:archivesdefrance:seda:v2.1
*
*/
class ArchiveRestitution extends AbstractBusinessMessage
{
/**
* @var seda2/ID
* @xpath seda2:RestitutionIdentifier
*/
public $restitutionIdentifier;
/**
* @var seda2/ID
* @xpath seda2:RestitutionRequestReplyIdentifier
*/
public $restitutionRequestReplyIdentifier;
/**
* @var seda2/ID[]
* @xpath seda2:UnitIdentifier
*/
public $unitIdentifier;
/**
* @var seda2/Organization
* @xpath seda2:ArchivalAgency
*/
public $archivalAgency;
/**
* @var seda2/Organization
* @xpath seda2:OriginatingAgency
*/
public $originatingAgency;
}
<?php
namespace ext\archivesPubliques\bundle\seda2\Model;
/**
* @package Seda2
* @author Cyril VAZQUEZ (Maarch) <cyril.vazquez@maarch.org>
*
* @xmlns seda2 fr:gouv:culture:archivesdefrance:seda:v2.1
*
*/