Commit d5a5058c authored by Alexandre Morin's avatar Alexandre Morin
Browse files

Revert "Merge branch 'feature/6024-AsyncDeposit' into 'develop'"

This reverts commit 1976ef11
parent 1976ef11
...@@ -27,7 +27,8 @@ namespace ext\thirdPartyArchiving\bundle\medona\Controller; ...@@ -27,7 +27,8 @@ namespace ext\thirdPartyArchiving\bundle\medona\Controller;
* @package Medona * @package Medona
* @author Alexis Ragot <alexis.ragot@maarch.org> * @author Alexis Ragot <alexis.ragot@maarch.org>
*/ */
class Acknowledgement extends abstractMessage implements AcknowledgementInterface class Acknowledgement
extends abstractMessage
{ {
/** /**
...@@ -70,9 +71,34 @@ class Acknowledgement extends abstractMessage implements AcknowledgementInterfac ...@@ -70,9 +71,34 @@ class Acknowledgement extends abstractMessage implements AcknowledgementInterfac
} }
try { try {
$archiveTransferReplyController = \laabs::newController($message->schema.'/Acknowledgement'); if ($message->schema != 'medona') {
$archiveTransferReplyController->send($message); $archiveTransferReplyController = \laabs::newController($message->schema.'/Acknowledgement');
$archiveTransferReplyController->send($message);
} else {
/*$archiveTransferReply = $this->sendMessage($message);
$message->object = $archiveTransferReply;
$archiveTransferReply->replyCode = $this->sendReplyCode($message->replyCode);
if (isset($message->requestReference)) {
$archiveTransferReply->messageRequestIdentifier = \laabs::newInstance('medona/Identifier', $message->requestReference);
}
if (isset($message->operationDate)) {
$archiveTransferReply->grantDate = (string) $message->operationDate;
}
$archiveTransferReply->archivalAgency = $this->sendOrganization($message->senderOrg);
$archiveTransferReply->transferringAgency = $this->sendOrganization($message->recipientOrg);
// Generate XML
$this->generate($message);
$this->save($message);*/
}
$operationResult = true; $operationResult = true;
} catch (\Exception $e) { } catch (\Exception $e) {
......
<?php
/*
* Copyright (C) 2018 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\thirdPartyArchiving\bundle\medona\Controller;
/**
* Acknowledgement interface
*
* @package Medona
* @author Alexis Ragot <alexis.ragot@maarch.org>
*/
interface AcknowledgementInterface
{
/**
* Send an aknowledgement
* @param mixed $receivedMessage The received message or it's identifier
*
* @return object The acknowledgement
*/
public function send($receivedMessage);
}
...@@ -49,20 +49,22 @@ class ArchivalProfileModificationNotification extends ArchiveNotification ...@@ -49,20 +49,22 @@ class ArchivalProfileModificationNotification extends ArchiveNotification
$messages = array(); $messages = array();
$this->retentionRuleController = \laabs::newController('recordsManagement/retentionRule'); if (!\laabs::hasBundle("seda")) {
$retentionRule = $this->retentionRuleController->read($profile->retentionRuleCode); $this->retentionRuleController = \laabs::newController('recordsManagement/retentionRule');
$profile->retentionRuleDuration = $retentionRule->duration; $retentionRule = $this->retentionRuleController->read($profile->retentionRuleCode);
$profile->retentionRuleFinalDisposition = $retentionRule->finalDisposition; $profile->retentionRuleDuration = $retentionRule->duration;
$profile->retentionRuleFinalDisposition = $retentionRule->finalDisposition;
$this->accessRuleController = \laabs::newController('recordsManagement/accessRule');
$accessRule = $this->accessRuleController->edit($profile->accessRuleCode); $this->accessRuleController = \laabs::newController('recordsManagement/accessRule');
$profile->accessRuleDuration = $accessRule->duration; $accessRule = $this->accessRuleController->edit($profile->accessRuleCode);
$profile->accessRuleDuration = $accessRule->duration;
}
foreach ($recipients as $recipient) { foreach ($recipients as $recipient) {
$message = \laabs::newInstance('medona/message'); $message = \laabs::newInstance('medona/message');
$message->messageId = \laabs::newId(); $message->messageId = \laabs::newId();
$message->type = "ArchivalProfileModificationNotification"; $message->type = "ArchivalProfileModificationNotification";
$message->schema = "recordsManagement"; $message->schema = "medona";
$message->status = "sent"; $message->status = "sent";
$message->date = \laabs::newDatetime(null, "UTC"); $message->date = \laabs::newDatetime(null, "UTC");
$message->receptionDate = $message->date; $message->receptionDate = $message->date;
......
...@@ -46,7 +46,7 @@ class ArchiveConversionRequest extends abstractMessage ...@@ -46,7 +46,7 @@ class ArchiveConversionRequest extends abstractMessage
$message = \laabs::newInstance('medona/message'); $message = \laabs::newInstance('medona/message');
$message->messageId = \laabs::newId(); $message->messageId = \laabs::newId();
$message->schema = "recordsManagement"; $message->schema = "medona";
$message->type = "ArchiveConversionRequest"; $message->type = "ArchiveConversionRequest";
$message->status = 'processWait'; $message->status = 'processWait';
$message->date = \laabs::newDatetime(null, "UTC"); $message->date = \laabs::newDatetime(null, "UTC");
......
...@@ -175,7 +175,7 @@ class ArchiveDeliveryRequest extends abstractMessage ...@@ -175,7 +175,7 @@ class ArchiveDeliveryRequest extends abstractMessage
$message = \laabs::newInstance('medona/message'); $message = \laabs::newInstance('medona/message');
$message->messageId = \laabs::newId(); $message->messageId = \laabs::newId();
$schema = "recordsManagement"; $schema = "medona";
if (\laabs::hasBundle('seda') && $archives[0]->descriptionClass == 'archivesPubliques/content') { if (\laabs::hasBundle('seda') && $archives[0]->descriptionClass == 'archivesPubliques/content') {
$schema = "seda"; $schema = "seda";
} }
...@@ -212,10 +212,22 @@ class ArchiveDeliveryRequest extends abstractMessage ...@@ -212,10 +212,22 @@ class ArchiveDeliveryRequest extends abstractMessage
} }
try { try {
$archiveDeliveryRequestController = \laabs::newController($message->schema.'/ArchiveDeliveryRequest'); if ($message->schema != 'medona') {
$archiveDeliveryRequestController = \laabs::newController($message->schema.'/ArchiveDeliveryRequest');
$archiveDeliveryRequestController->send($message); $archiveDeliveryRequestController->send($message);
} else {
$archiveDeliveryRequest = $this->sendMessage($message);
$message->object = $archiveDeliveryRequest;
$archiveDeliveryRequest->requester = $this->sendOrganization($message->senderOrg);
if ($userName) {
$archiveDeliveryRequest->requester->userName = $userName;
}
$archiveDeliveryRequest->archivalAgency = $this->sendOrganization($message->recipientOrg);
$message->object->unitIdentifier = $message->unitIdentifier;
}
$operationResult = true; $operationResult = true;
$this->create($message); $this->create($message);
......
<?php
/*
* Copyright (C) 2018 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\thirdPartyArchiving\bundle\medona\Controller;
/**
* Archive delivery request interface
*
* @package Medona
* @author Alexis Ragot <alexis.ragot@maarch.org>
*/
interface ArchiveDeliveryRequestInterface
{
/**
* Send an archive delivery request
* @param Object $message The message
*/
public function send($message);
}
...@@ -127,9 +127,19 @@ class ArchiveDeliveryRequestReply extends abstractMessage ...@@ -127,9 +127,19 @@ class ArchiveDeliveryRequestReply extends abstractMessage
try { try {
mkdir($this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId, 0777, true); mkdir($this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId, 0777, true);
$archiveDeliveryRequestReplyController = \laabs::newController($message->schema.'/ArchiveDeliveryRequestReply'); if ($message->schema != 'medona') {
$archiveDeliveryRequestReplyController->send($message); $archiveDeliveryRequestReplyController = \laabs::newController($message->schema.'/ArchiveDeliveryRequestReply');
$archiveDeliveryRequestReplyController->send($message);
} else {
$archiveDeliveryRequestReply = $this->sendMessage($message);
$message->object = $archiveDeliveryRequestReply;
$archiveDeliveryRequestReply->requester = $this->sendOrganization($message->senderOrg);
$archiveDeliveryRequestReply->archivalAgency = $this->sendOrganization($message->recipientOrg);
$this->generate($message);
$this->save($message);
}
$operationResult = true; $operationResult = true;
} catch (\Exception $e) { } catch (\Exception $e) {
$message->status = "invalid"; $message->status = "invalid";
......
<?php
/*
* Copyright (C) 2018 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\thirdPartyArchiving\bundle\medona\Controller;
/**
* Archive delivery request reply interface
*
* @package Medona
* @author Alexis Ragot <alexis.ragot@maarch.org>
*/
interface ArchiveDeliveryRequestReplyInterface
{
/**
* Send message with all contents embedded
* @param object $message The message
*/
public function send($message);
}
...@@ -41,7 +41,7 @@ class ArchiveDestructionNotification extends ArchiveNotification ...@@ -41,7 +41,7 @@ class ArchiveDestructionNotification extends ArchiveNotification
$message->messageId = \laabs::newId(); $message->messageId = \laabs::newId();
$message->type = "ArchiveDestructionNotification"; $message->type = "ArchiveDestructionNotification";
$schema = "recordsManagement"; $schema = "medona";
if (\laabs::hasBundle('seda') && $archives[0]->descriptionClass == 'archivesPubliques/content') { if (\laabs::hasBundle('seda') && $archives[0]->descriptionClass == 'archivesPubliques/content') {
$schema = "seda"; $schema = "seda";
} }
...@@ -62,9 +62,16 @@ class ArchiveDestructionNotification extends ArchiveNotification ...@@ -62,9 +62,16 @@ class ArchiveDestructionNotification extends ArchiveNotification
$message->dataObjectCount = count($message->archive); $message->dataObjectCount = count($message->archive);
try { try {
$archiveModificationNotificationController = \laabs::newController($message->schema.'/ArchiveModificationNotification'); if ($message->schema != 'medona') {
$archiveModificationNotificationController->send($message);
$archiveModificationNotificationController = \laabs::newController($message->schema.'/ArchiveModificationNotification');
$archiveModificationNotificationController->send($message);
} else {
$this->generate($message);
$this->save($message);
}
$operationResult = true; $operationResult = true;
} catch (\Exception $e) { } catch (\Exception $e) {
......
...@@ -105,7 +105,7 @@ class ArchiveDestructionRequest extends abstractMessage ...@@ -105,7 +105,7 @@ class ArchiveDestructionRequest extends abstractMessage
$message = \laabs::newInstance('medona/message'); $message = \laabs::newInstance('medona/message');
$message->messageId = \laabs::newId(); $message->messageId = \laabs::newId();
$schema = "recordsManagement"; $schema = "medona";
if (\laabs::hasBundle('seda') && $archives[0]->descriptionClass == 'archivesPubliques/content') { if (\laabs::hasBundle('seda') && $archives[0]->descriptionClass == 'archivesPubliques/content') {
$schema = "seda"; $schema = "seda";
} }
...@@ -133,8 +133,21 @@ class ArchiveDestructionRequest extends abstractMessage ...@@ -133,8 +133,21 @@ class ArchiveDestructionRequest extends abstractMessage
$message->unitIdentifier[] = $unitIdentifier; $message->unitIdentifier[] = $unitIdentifier;
} }
$archiveDestructionRequestController = \laabs::newController($message->schema.'/ArchiveDestructionRequest'); if ($message->schema != 'medona') {
$archiveDestructionRequestController->send($message); $archiveDestructionRequestController = \laabs::newController($message->schema.'/ArchiveDestructionRequest');
$archiveDestructionRequestController->send($message);
} else {
$archiveDestructionRequest = $this->sendMessage($message);
$message->object = $archiveDestructionRequest;
$archiveDestructionRequest->originatingAgency = $this->sendOrganization($message->senderOrg);
$archiveDestructionRequest->archivalAgency = $this->sendOrganization($message->recipientOrg);
$message->object->unitIdentifier = $message->unitIdentifier;
$this->generate($message);
$this->save($message);
}
$this->create($message); $this->create($message);
} catch (\Exception $e) { } catch (\Exception $e) {
......
...@@ -45,7 +45,7 @@ class ArchiveModificationNotification extends ArchiveNotification ...@@ -45,7 +45,7 @@ class ArchiveModificationNotification extends ArchiveNotification
$message->messageId = \laabs::newId(); $message->messageId = \laabs::newId();
$message->type = "ArchiveModificationNotification"; $message->type = "ArchiveModificationNotification";
$schema = "recordsManagement"; $schema = "medona";
if (\laabs::hasBundle('seda') && $archives[0]->descriptionClass == 'archivesPubliques/content') { if (\laabs::hasBundle('seda') && $archives[0]->descriptionClass == 'archivesPubliques/content') {
$schema = "seda"; $schema = "seda";
} }
...@@ -77,9 +77,23 @@ class ArchiveModificationNotification extends ArchiveNotification ...@@ -77,9 +77,23 @@ class ArchiveModificationNotification extends ArchiveNotification
$message->dataObjectCount = count($message->archive); $message->dataObjectCount = count($message->archive);
try { try {
$archiveModificationNotificationController = \laabs::newController($message->schema.'/ArchiveModificationNotification'); if ($message->schema != 'medona') {
$archiveModificationNotificationController->send($message);
$archiveModificationNotificationController = \laabs::newController($message->schema.'/ArchiveModificationNotification');
$archiveModificationNotificationController->send($message);
} else {
$archiveModificationNotification = $this->sendMessage($message);
$message->object = $archiveModificationNotification;
$archiveModificationNotification->originatingAgency = $this->sendOrganization($message->senderOrg);
$archiveModificationNotification->archivalAgency = $this->sendOrganization($message->recipientOrg);
$message->object->unitIdentifier = $message->unitIdentifier;
$this->generate($message);
$this->save($message);
}
$operationResult = true; $operationResult = true;
} catch (\Exception $e) { } catch (\Exception $e) {
......
...@@ -177,9 +177,19 @@ class ArchiveRestitution extends abstractMessage ...@@ -177,9 +177,19 @@ class ArchiveRestitution extends abstractMessage
try { try {
mkdir($this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId, 0777, true); mkdir($this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId, 0777, true);
$archiveRestitutionController = \laabs::newController($message->schema.'/ArchiveRestitution'); if ($message->schema != 'medona') {
$archiveRestitutionController->send($message); $archiveRestitutionController = \laabs::newController($message->schema.'/ArchiveRestitution');
$archiveRestitutionController->send($message);
} else {
$archiveRestitution = $this->sendMessage($message);
$message->object = $archiveRestitution;
$archiveRestitution->requester = $this->sendOrganization($message->senderOrg);
$archiveRestitution->archivalAgency = $this->sendOrganization($message->recipientOrg);
$this->generate($message);
$this->save($message);
}
$operationResult = true; $operationResult = true;
} catch (\Exception $e) { } catch (\Exception $e) {
......
...@@ -129,7 +129,7 @@ class ArchiveRestitutionRequest extends abstractMessage ...@@ -129,7 +129,7 @@ class ArchiveRestitutionRequest extends abstractMessage
$message = \laabs::newInstance('medona/message'); $message = \laabs::newInstance('medona/message');
$message->messageId = \laabs::newId(); $message->messageId = \laabs::newId();
$message->schema = "recordsManagement"; $message->schema = "medona";
if (\laabs::hasBundle('seda') && $archives[0]->descriptionClass == 'archivesPubliques/content') { if (\laabs::hasBundle('seda') && $archives[0]->descriptionClass == 'archivesPubliques/content') {
$message->schema = "seda"; $message->schema = "seda";
} }
...@@ -157,8 +157,23 @@ class ArchiveRestitutionRequest extends abstractMessage ...@@ -157,8 +157,23 @@ class ArchiveRestitutionRequest extends abstractMessage
$message->unitIdentifier[] = $unitIdentifier; $message->unitIdentifier[] = $unitIdentifier;
} }
$archiveRestitutionRequestController = \laabs::newController($message->schema.'/ArchiveRestitutionRequest'); if ($message->schema != 'medona') {
$archiveRestitutionRequestController->send($message); $archiveRestitutionRequestController = \laabs::newController($message->schema.'/ArchiveRestitutionRequest');
$archiveRestitutionRequestController->send($message);
} else {
$archiveRestitutionRequest = $this->sendMessage($message);
$message->object = $archiveRestitutionRequest;
$archiveRestitutionRequest->requester = $this->sendOrganization($message->senderOrg);
if ($userName) {
$archiveRestitutionRequest->requester->userName = $userName;
}
$archiveRestitutionRequest->archivalAgency = $this->sendOrganization($message->recipientOrg);
$this->generate($message);
$this->save($message);
}
$operationResult = true; $operationResult = true;
...@@ -209,8 +224,19 @@ class ArchiveRestitutionRequest extends abstractMessage ...@@ -209,8 +224,19 @@ class ArchiveRestitutionRequest extends abstractMessage
$this->readOrgs($message); // read org names, addresses, communications, contacts $this->readOrgs($message); // read org names, addresses, communications, contacts
try { try {
$archiveRestitutionRequestController = \laabs::newController($message->schema.'/ArchiveRestitutionRequest'); if ($message->schema != 'medona') {
$archiveRestitutionRequestController->send($message); $archiveRestitutionRequestController = \laabs::newController($message->schema.'/ArchiveRestitutionRequest');
$archiveRestitutionRequestController->send($message);
} else {
$archiveRestitutionRequest = $this->sendMessage($message);
$message->object = $archiveRestitutionRequest;
$archiveRestitutionRequest->requester = $this->sendOrganization($message->senderOrg);
$archiveRestitutionRequest->archivalAgency = $this->sendOrganization($message->recipientOrg);
$this->generate($message);
$this->save($message);
}
$message->unitIdentifier = $this->sdoFactory->readChildren('medona/unitIdentifier', $requestMessage); $message->unitIdentifier = $this->sdoFactory->readChildren('medona/unitIdentifier', $requestMessage);
foreach ($message->unitIdentifier as $unitIdentifier) { foreach ($message->unitIdentifier as $unitIdentifier) {
......
...@@ -74,9 +74,19 @@ class ArchiveRestitutionRequestReply extends abstractMessage ...@@ -74,9 +74,19 @@ class ArchiveRestitutionRequestReply extends abstractMessage
try { try {
mkdir($this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId, 0777, true); mkdir($this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId, 0777, true);
$archiveRestitutionRequestReplyController = \laabs::newController($message->schema.'/ArchiveRestitutionRequestReply'); if ($message->schema != 'medona') {
$archiveRestitutionRequestReplyController->send($message); $archiveRestitutionRequestReplyController = \laabs::newController($message->schema.'/ArchiveRestitutionRequestReply');
$archiveRestitutionRequestReplyController->send($message);
} else {
$archiveRestitutionRequestReply = $this->sendMessage($message);
$message->object = $archiveRestitutionRequestReply;
$archiveRestitutionRequestReply->requester = $this->sendOrganization($message->senderOrg);
$archiveRestitutionRequestReply->archivalAgency = $this->sendOrganization($message->recipientOrg);
$this->generate($message);
$this->save($message);
}
$operationResult = true; $operationResult = true;
} catch (\Exception $e) { } catch (\Exception $e) {
......
<?php
/*
* Copyright (C) 2018 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\thirdPartyArchiving\bundle\medona\Controller;
/**
* Archive transfer interface
*
* @package Medona
* @author Alexis Ragot <alexis.ragot@maarch.org>
*/
interface ArchiveTransferInterface
{
/**
* Receive message with all contents embedded
* @param string $messageFile The message binary contents OR a filename
* @param array $attachments An array of attachment binary data