Verified Commit d6a7f3dd authored by Jerome Boucher's avatar Jerome Boucher

Merge branch 'develop' of labs.maarch.org:maarch/archivesPubliques into fix_merge_master_2.7

parents 13af2aaf eb95c726
# CHANGELOG
## Version 2.7
- `Added` Ressorties SEDA 2: Communication, restitution, transfert sortant, autorisations et notifications.
- `Added` Gestion du comportement des demandes de communications multiples.
- `Added` Possibilité de développer des connecteurs externes dédiés au versement.
- `Added` Connecteur prenant en charge les bordereaux incomplets et/ou non conformes générés par Archifiltre et RESIP.
- `Added` Connecteur prenant en charge les bordereaux incomplets et/ou non conformes générés par OCTAVE.
- `Added` Statistiques sur Versement, Elimination, Communication, Conservation, Restitution, Transfert Sortant.
- `Added` Prise en compte de la valeur FilePlanPosition pour verser dans les dossiers virtuels du service producteur
- `Added` Prise en compte des groupes d'objets-données dans les bordereaux de versement SEDA 2.1
- `Changed` Description d'objet archive rendue facultative dans le générateur de bordereaux SEDA 1.
- `Changed` Filtrage des profils utilisant un format SEDA1 dans le générateur de bordereaux SEDA 1.
- `Changed` amélioration de la gestion des erreurs lors d'un import en SEDA.
- `Fixed` Affichage des informations dans les bordereaux SEDA 2.
- `Fixed` Gestion des identifiants des documents versés simultanément dans le générateur de bordereaux SEDA 1.
- `Fixed` Gestion des modifications des métadonnées descriptives en SEDA 1.
## Version 2.6.3
- `Fixed` Correction d'un bug avec la balise contentDescription.
- `Fixed` Correction d'un bug empêchant de rechercher des archives SEDA 1 depuis le menu prinicpal.
......@@ -10,7 +27,8 @@
- `Added` Ajout de la directive LAABS_SECURE_COOKIE dans le fichier vhost par défaut permettant d'ajouter l'attribut secure aux cookies dans le cas d'une instance en HTTPS.
## Version 2.6.1
- `Fixed` Erreur lors de l'ajout de documents de plus de 2Mo dans le générateur de bordereaux
- `Fixed` Erreur lors de l'ajout de documents de plus de 2Mo dans le générateur de bordereaux.
## Version 2.6
......
# Migration vers 2.6.2
# Migration 2.6 vers 2.7
## Virtual host
## Ajout dans la configuration
Ajout de 2 directives concernant la sécurité dans le fichier vhost.conf.default :
*LAABS_SESSION_START* --> "Off" par défaut. Permet de ne pas créer de fichier de session inutile sur le serveur.
*LAABS_SECURE_COOKIE* --> désactivé par défaut. Permet d'ajouter l'attribut "secure" sur les cookies dans le cas d'une instance publiée en HTTPS.
Dans la section [recordsManagement], ajout de la directive `archiveIdGenerator` qui permet de configurer la cotation automatique lors d'un versement dans l'application.
Dans la section [medona], ajout de la directive `packageConnectors` qui permet la configuration de connecteurs pour faciliter le versement de paquets externes au format incomplet.
Dans la section nouvellement créee [dependency.timestamp], la directive `pathToOpenSSL` a été ajoutée pour faciliter la prise en charge sur Windows :
```
pathToOpenSSL="C:\Program Files\OpenSSL-Win64\bin\openssl"
```
### Ajout du bundle Statistiques dans virtual host
Afin d'accéder aux fonctionnalités relatives aux statistiques, le bundle `Statistics` doit être ajoutée à l'instance dans le fichier vhost.conf :
```
SetEnv LAABS_BUNDLES audit;auth;batchProcessing;contact;digitalResource;lifeCycle;organization;recordsManagement;filePlan;medona;mades;digitalSafe;Statistics
```
Modifications liées à la configuration de la session :
```
SetEnv LAABS_SESSION_START Off
#SetEnv LAABS_SECURE_COOKIE On
```
## Modification de configuration
Dans la section [presentation.maarchRM], la directive `maxResults` livré par défaut est désormais à 500.
Dans la section [auth], modification de la configuration du CSRF :
```
csrfConfig = '{
"cookieName" : "Csrf",
"tokenLength" : 32
}'
​```
Dans la section [recordsManagement], modification de la configuration des schémas de description :
```
descriptionSchemes = "{
'seda' : {
'label' : 'SEDA 1.0',
'type' : 'php',
'search' : 'archivesPubliques/content',
'uri' : 'archivesPubliques/content',
'controller' : '',
'presenter' : ''
},
'seda2' : {
'label' : 'SEDA 2.1',
'type' : 'php',
'search' : '',
'uri' : 'seda2/Content',
'controller' : '',
'presenter' : ''
},
'log' : {
'label' : 'log',
'type' : 'php',
'uri' : 'recordsManagement/log',
'search': 'recordsManagement/log'
}
}"
​```
### Ajout d'un droit utilisateur
Le privilège se prénommant `Traiter les communications` a été ajoutée, ce privilège peut être attribué dans la catégorie de droits 'Communication'.
Un point de menu `Communications à finaliser` a été ajouté sur l'écran d'Echange pour effectuer le traitement manuel des communications:
## Schéma SQL
Voir le fichier spécifique
laabs/src/ext/archivesPubliques/data/sql/pgsql/apV2.6_V2.7.sql
# Migration 2.4 vers 2.5
......
......@@ -221,7 +221,7 @@ class content implements \bundle\recordsManagement\Controller\archiveDescription
$contents = $this->sdoFactory->find("archivesPubliques/content", "archiveId='$archiveId'");
if (count($contents)) {
if (is_array($contents) && !empty($contents)) {
foreach ($contents as $content) {
if (!empty($content->resId)) {
continue;
......@@ -248,6 +248,7 @@ class content implements \bundle\recordsManagement\Controller\archiveDescription
foreach ($agents as $agent) {
$content->{$agent->contentName}[] = $agent;
}
$content = \laabs::cast($content, "archivesPubliques/contentDescription");
}
}
......@@ -289,6 +290,10 @@ class content implements \bundle\recordsManagement\Controller\archiveDescription
$contentDescription->text .= $this->getText($contentDescription);
if (!empty($contentDescription->language)) {
$contentDescription->language = \laabs::newTokenlist($contentDescription->language);
}
$this->sdoFactory->update($contentDescription, "archivesPubliques/content");
......@@ -468,7 +473,6 @@ class content implements \bundle\recordsManagement\Controller\archiveDescription
$keyword
);
$tableContentDescriptions = $this->sdoFactory->find("archivesPubliques/archiveDescription", $tableQueryString, $tableQueryParams, '>depositDate', 0, $maxResults);
// TEST CVA SEDA 2 Json index
......@@ -527,7 +531,6 @@ class content implements \bundle\recordsManagement\Controller\archiveDescription
* @param bool $isConverted
* @param bool $hasParent
* @param bool $partialRetentionRule
* @param integer $maxResults
*
* @return integer Nombre d'archives
*/
......@@ -635,8 +638,9 @@ class content implements \bundle\recordsManagement\Controller\archiveDescription
$queryParts['accessRule'] = $this->getAccessRuleAssert();
// content description
if ($contentId) {
$queryParts['contentId'] = "(archiveId = '*$contentId*' OR originatorArchiveId = '*$contentId*' OR depositorArchiveId = '*$contentId*')";
$queryParts['contentId'] = "(archiveId = '*$contentId*' OR originatorArchiveId = '*$contentId*' OR depositorArchiveId = '*$contentId*' OR archiverArchiveId = '*$contentId*')";
}
if ($archiveName) {
$queryParts['archiveName'] = "archiveName = '*$archiveName*'";
......@@ -729,7 +733,6 @@ class content implements \bundle\recordsManagement\Controller\archiveDescription
return [$queryParts, $queryParams];
}
protected function searchTable(
$queryParts,
$queryParams,
......@@ -1029,6 +1032,12 @@ class content implements \bundle\recordsManagement\Controller\archiveDescription
$queryParams['depositorOrgRegNumber'] = $depositorOrgRegNumber;
$queryParts['depositorOrgRegNumber'] = "depositorOrgRegNumber = :depositorOrgRegNumber";
}
if ($archiverArchiveId) {
$queryParams['archiverArchiveId'] = $archiverArchiveId;
$queryParts['archiverArchiveId'] = "archiverArchiveId = :archiverArchiveId";
}
if ($isConverted === true) {
$queryParts['isConverted'] = "(documentCount>0 and documentCopies>0)";
}
......
......@@ -167,4 +167,18 @@ class archiveDescription
* @var tokenList
*/
public $userOrgRegNumbers;
/**
* The originating date of the archive
*
* @var date
*/
public $originatingDate;
/**
* The archiver identifier of the archive
*
* @var string
*/
public $archiverArchiveId;
}
......@@ -25,6 +25,8 @@ SELECT DISTINCT
"archive"."retentionStartDate",
"archive"."retentionRuleCode",
"archive"."userOrgRegNumbers",
"archive"."originatingDate",
"archive"."archiverArchiveId",
"content"."contentId",
"content"."resId",
......
......@@ -54,7 +54,7 @@ class ArchiveDeliveryRequestReply extends abstractMessage
$unitIdentifier->schemeName = 'ArchivalAgencyArchiveIdentifier';
$archive->lifeCycleEvent = $this->lifeCycleJournalController->getEvents((string)$archive->archiveId, $archive->depositDate);
$archive = $this->sendArchive($archive, $withAttachment = true);
$archive = $this->sendArchive($message, $archive, $withAttachment = true);
$archiveDeliveryRequestReply->archive[] = $archive;
$archiveDeliveryRequestReply->unitIdentifier[] = $unitIdentifier;
......
......@@ -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($message, $archive, $withAttachment = true);
}
//$this->sendXml($message, $withData = false);
$this->sendXml($message, $withData = false);
}
}
\ No newline at end of file
}
......@@ -47,7 +47,7 @@ class ArchiveRestitution extends abstractMessage
$unitIdentifier = \laabs::newInstance('seda/ID');
$unitIdentifier->value = $archive->archiveId;
$unitIdentifier->schemeName = 'ArchivalAgencyArchiveIdentifier';
$archive = $this->sendArchive($archive, $withAttachment = true);
$archive = $this->sendArchive($message, $archive, $withAttachment = true);
$archiveRestitution->archive[] = $archive;
$archiveRestitution->unitIdentifier[] = $unitIdentifier;
......
......@@ -43,7 +43,7 @@ class ArchiveTransfer extends abstractMessage implements \bundle\medona\Controll
/**
* Receive message with all contents embedded
* @param string $message The message
* @param mixed $message The message
*/
public function receive($message)
{
......@@ -304,7 +304,6 @@ class ArchiveTransfer extends abstractMessage implements \bundle\medona\Controll
$this->errors[] = new \core\Error($errorMessage);
}
}
} else {
libxml_use_internal_errors(true);
$valid = $message->xml->relaxNGValidate($profileFile);
......@@ -343,7 +342,7 @@ class ArchiveTransfer extends abstractMessage implements \bundle\medona\Controll
$formatController = \laabs::newController("digitalResource/format");
$messageDir = dirname($message->path);
$attachments = array($messageDir.DIRECTORY_SEPARATOR.(string) $message->messageId.'.xml');
$attachments = array($message->path);
$receivedFiles = glob($messageDir.DIRECTORY_SEPARATOR."*.*");
......@@ -478,8 +477,6 @@ class ArchiveTransfer extends abstractMessage implements \bundle\medona\Controll
}
}
/**
* Extract description from Xml
* @param seda/message $message The message object with the xml
......@@ -704,9 +701,11 @@ class ArchiveTransfer extends abstractMessage implements \bundle\medona\Controll
if (isset($sedaContentDescription->filePlanPosition)) {
$content->filePlanPosition = \laabs::newTokenList();
foreach ($sedaContentDescription->filePlanPosition as $sedaFilePlanPosition) {
$content->filePlanPosition[] = (string) $sedaFilePlanPosition->value;
}
$archive->filePlanPosition = '/'.trim($sedaContentDescription->filePlanPosition[0]->value, '/');
}
if (isset($sedaContentDescription->keyword)) {
......@@ -884,7 +883,7 @@ class ArchiveTransfer extends abstractMessage implements \bundle\medona\Controll
case isset($sedaBinaryObject->filename):
$messageDir = dirname($this->message->path);
$filepath = $messageDir.DIRECTORY_SEPARATOR.$sedaBinaryObject->filename;
$stream = fopen($filepath, 'r');
$resource = $this->digitalResourceController->createFromStream($stream);
$resource->fileName = $sedaBinaryObject->filename;
......@@ -906,7 +905,7 @@ class ArchiveTransfer extends abstractMessage implements \bundle\medona\Controll
$resource->resId = $sedaBinaryObject->id;
$resource->archiveId = $archive->archiveId;
$resource->puid = $sedaBinaryObject->format;
if (isset($sedaBinaryObject->relatedData)) {
......
......@@ -202,7 +202,11 @@ class ArchiveTransferComposition extends abstractMessage
file_put_contents($filepath, $contents);
$format = $formatController->identifyFormat($filepath);
$document->attachment->format = $format->puid;
if (is_object($format)) {
$document->attachment->format = $format->puid;
} else {
$document->attachment->format = 'fmt/208';
}
}
return $documents;
......
......@@ -41,13 +41,13 @@ class ArchiveTransferReply extends abstractMessage implements \bundle\medona\Con
$archiveTransferReply->transferReplyIdentifier = \laabs::newInstance('seda/ID', $message->reference);
$archiveTransferReply->grantDate = $message->operationDate;
$archiveTransferReply->grantDate = $message->operationDate->format("Y-m-d\TH:i:s");;
$archiveTransferReply->archivalAgency = $this->sendOrganization($message->senderOrg);
$archiveTransferReply->transferringAgency = $this->sendOrganization($message->recipientOrg);
//$this->sendXml($message, $withData = false);
$this->sendXml($message, $withData = false);
}
}
......@@ -48,7 +48,7 @@ trait ArchiveTransferSendingTrait
foreach ($message->archive as $archive) {
$archive->lifeCycleEvent = $this->lifeCycleJournalController->getEvents((string) $archive->archiveId, $archive->depositDate);
$archive = $this->sendArchive($archive, $withAttachment = true);
$archive = $this->sendArchive($message, $archive, $withAttachment = true);
$archiveTransferReply->archive[] = $archive;
}
......
This diff is collapsed.
......@@ -2,10 +2,10 @@
<ArchiveTransferReply xmlns="fr:gouv:culture:archivesdefrance:seda:v1.0">
<?merge ArchiveTransferReply.comment ?><Comment><?merge . ?></Comment>
<Date><?merge ArchiveTransferReply.date.format('Y-m-d\TH:i:s\Z') ?></Date>
<GrantDate><?merge ArchiveTransferReply.grantDate ?></GrantDate>
<ReplyCode listID="[?merge ArchiveTransferReply.replyCode.listID @listID ?]" listName="[?merge ArchiveTransferReply.replyCode.listName @listName ?]" name="[?merge ArchiveTransferReply.replyCode.name @name ?]" listAgencyID="[?merge ArchiveTransferReply.replyCode.listAgencyID @listAgencyID ?]" listAgencyName="[?merge ArchiveTransferReply.replyCode.listAgencyName @listAgencyName ?]" listVersionID="[?merge ArchiveTransferReply.replyCode.listVersionID @listVersionID ?]" listSchemeURI="[?merge ArchiveTransferReply.replyCode.listSchemeDURI @listSchemeURI ?]" listURI="[?merge ArchiveTransferReply.replyCode.listURI @listURI ?]" languageID="[?merge ArchiveTransferReply.replyCode.languageID @languageID ?]"><?merge ArchiveTransferReply.replyCode ?></ReplyCode>
<TransferIdentifier schemeID="[?merge ArchiveTransferReply.transferIdentifier.schemeID @schemeID ?]" schemeName="[?merge ArchiveTransferReply.transferIdentifier.schemeName @schemeName ?]" schemeAgencyID="[?merge ArchiveTransferReply.transferIdentifier.schemeAgencyID @schemeAgencyID ?]" schemeAgencyName="[?merge ArchiveTransferReply.transferIdentifier.schemeAgencyName @schemeAgencyName ?]" schemeVersionID="[?merge ArchiveTransferReply.transferIdentifier.schemeVersionID @schemeVersionID ?]" schemeDataURI="[?merge ArchiveTransferReply.transferIdentifier.schemeDataURI @schemeDataURI ?]" schemeURI="[?merge ArchiveTransferReply.transferIdentifier.schemeURI @schemeURI ?]"><?merge ArchiveTransferReply.transferIdentifier ?></TransferIdentifier>
<TransferReplyIdentifier schemeID="[?merge ArchiveTransferReply.transferReplyIdentifier.schemeID @schemeID ?]" schemeName="[?merge ArchiveTransferReply.transferReplyIdentifier.schemeName @schemeName ?]" schemeAgencyID="[?merge ArchiveTransferReply.transferReplyIdentifier.schemeAgencyID @schemeAgencyID ?]" schemeAgencyName="[?merge ArchiveTransferReply.transferReplyIdentifier.schemeAgencyName @schemeAgencyName ?]" schemeVersionID="[?merge ArchiveTransferReply.transferReplyIdentifier.schemeVersionID @schemeVersionID ?]" schemeDataURI="[?merge ArchiveTransferReply.transferReplyIdentifier.schemeDataURI @schemeDataURI ?]" schemeURI="[?merge ArchiveTransferReply.transferReplyIdentifier.schemeURI @schemeURI ?]"><?merge ArchiveTransferReply.transferReplyIdentifier ?></TransferReplyIdentifier>
<GrantDate><?merge ArchiveTransferReply.grantDate ?></GrantDate>
<ArchivalAgency>
<?merge ArchiveTransferReply.archivalAgency $organization ?>
<?xinclude seda/Organization.xml ?>
......
<?php
/*
* Copyright (C) 2020 Maarch
*
* This file is part of bundle organization.
*
* Bundle organization 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 organization 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 organization. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Connectors;
/**
* @author Jerome Boucher <jerome.boucher@maarch.org>
*/
class Octave extends \bundle\medona\Connectors\Multiparts
{
use OctaveTrait;
/**
* Get archive transfer transformed by connector
*
* @param mixed $package The source of the message
* @param array $params Additional parameters
*
* @return array Array of medona/message object
*/
public function receive($package, $params, $messageDirectory)
{
$modelpath = parent::receive($package, $params, $messageDirectory);
$modelParams = $params;
unset($modelParams['attachments']);
$this->transformXml($modelpath, $modelParams);
return $modelpath;
}
}
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle seda.
*
* Bundle seda 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 seda 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 seda. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Connectors;
trait OctaveTrait
{
public function transformXml($messagePath, $params)
{
$xml = new \stdClass();
$xml = \laabs::newService('dependency/xml/Document');
$xml->load($messagePath);
$xml->xpath = \laabs::newService('dependency/xml/XPath', $xml);
$xml->xpath->registerNamespace('seda2', $xml->documentElement->namespaceURI);
$xml->documentElement->removeAttribute("xml:id");
$xml->documentElement->removeAttribute("xsi:schemaLocation");
foreach ($params as $paramKey => $paramValue) {
switch ($paramKey) {
case 'MessageIdentifier':
$messageIdentifierNode = $xml->xpath->query("//seda2:MessageIdentifier")->item(0);
if (is_null($paramValue)) {
$paramValue = \laabs::uniqid();
}
if (!is_null($messageIdentifierNode)) {
$messageIdentifierNode->nodeValue .= $paramValue;
}
break;
case 'ArchivalAgreement':
$archivalAgreementText = $xml->createTextNode($paramValue);
$archivalAgreementNode = $xml->createElement('ArchivalAgreement');
$archivalAgreementNode->appendChild($archivalAgreementText);
$codeListVersionsNode = $xml->xpath->query("//seda2:CodeListVersions")->item(0);
$xml->documentElement->insertBefore($archivalAgreementNode, $codeListVersionsNode);
break;
case 'ArchivalAgencyIdentifier':
$archivalAgencyIdentifierNode = $xml->xpath->query("//seda2:ArchivalAgency/seda2:Identifier")->item(0);
if (is_null($paramValue) && is_null($archivalAgencyIdentifierNode->item(0))) {
throw new \core\Exception\BadRequestException("Archival Agency is mandatory", 400);
}
if (!is_null($paramValue)) {
$archivalAgencyIdentifierNode->nodeValue = $paramValue;
}
break;
case 'TransferringAgencyIdentifier':
$transferringAgencyIdentifierNode = $xml->xpath->query("//seda2:TransferringAgency/seda2:Identifier")->item(0);
if (is_null($paramValue) && is_null($transferringAgencyIdentifierNode->item(0))) {
throw new \core\Exception\BadRequestException("Transferring Agency is mandatory", 400);
}
if (!is_null($paramValue)) {
$transferringAgencyIdentifierNode->nodeValue = $paramValue;
}
break;
case 'OriginatingAgencyIdentifier':
$originatingAgencyIdentifierText = $xml->createTextNode($paramValue);
$originatingAgencyIdentifierNode = $xml->createElement('OriginatingAgencyIdentifier');
$originatingAgencyIdentifierNode->appendChild($originatingAgencyIdentifierText);
$logBookNode = $xml->xpath->query("//seda2:ManagementMetadata/seda2:LogBook")->item(0);
$managementMetadataNode = $xml->xpath->query("//seda2:ManagementMetadata")->item(0);
$managementMetadataNode->insertBefore($originatingAgencyIdentifierNode, $logBookNode);
if (!is_null($params['ServiceLevel'])) {
$serviceLevelText = $xml->createTextNode($params['ServiceLevel']);
$serviceLevelNode = $xml->createElement('ServiceLevel');
$serviceLevelNode->appendChild($serviceLevelText);
$managementMetadataNode->insertBefore($serviceLevelNode, $originatingAgencyIdentifierNode);
}
break;
// Not currently in use
// case 'Language':
// foreach ($xml->xpath->query("//seda2:DataObjectPackage/seda2:DescriptiveMetadata//seda2:ArchiveUnit/seda2:Content") as $contentNode) {
// $nodes = [
// 'ObjectGroupExtenstionAbstract',
// 'Gps',
// 'Signature',
// 'Event',
// 'EndDate',
// 'StartDate',
// 'RegisteredDate',
// 'ReceivedDate',
// 'SentDate',
// 'AcquiredDate',
// 'TransactedDate',
// 'CreatedDate',
// 'RelatedObjectReference',
// 'Source',
// 'Sender',
// 'Transmitter',
// 'Recipient',
// 'Addressee',
// 'Writer',
// 'AuthorizedAgent',
// 'AgentAbstract',
// 'SubmissionAgency',
// 'OriginatingAgency',
// 'Coverage',
// 'Keyword',
// 'Tag',
// 'Version',
// 'Status',
// 'DescriptionLanguage'
// ];
// $insertBeforeNode = null;
// foreach ($nodes as $nodeName) {
// $node = $xml->xpath->query(".//seda2:" . $nodeName, $contentNode)->item(0);
// if (is_null($node)) {
// continue;
// } else {
// $insertBeforeNode = $node;
// }
// }
// $languageNode = $xml->xpath->query(".//seda2:Language", $contentNode)->item(0);
// if (!empty($paramValue)) {
// $newLanguageText = $xml->createTextNode($paramValue);
// $newLanguageNode = $xml->createElement('Language');
// $newLanguageNode->appendChild($newLanguageText);
// $contentNode->insertBefore($newLanguageNode, $insertBeforeNode);
// }
// }
// break;
default:
# code...
break;
}
}
file_put_contents($messagePath, $xml->saveXml());
}
}
<?php
/*
* Copyright (C) 2020 Maarch
*
* This file is part of bundle organization.
*
* Bundle organization 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 organization 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 organization. If not, see <http://www.gnu.org/licenses/>.
*/
namespace ext\archivesPubliques\bundle\seda2\Connectors;
/**
* @author Jerome Boucher <jerome.boucher@maarch.org>
*/