Commit 1fbd4fdf authored by root's avatar root
Browse files

docs() : update 2.7

parent b69c1d5a
<?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\demorm_publique\bundle\medona\Controller;
/**
* trait for archive transfer
*
* @package Medona
* @author Alexis Ragot <alexis.ragot@maarch.org>
*/
class ArchiveTransfer extends \ext\thirdPartyArchiving\bundle\medona\Controller\ArchiveTransfer
{
/**
* Create a message
* @param medona/message $message The message object
*
* @throws \Exception
*
* @return string The new message identifier
*/
public function create($message)
{
$message->reference = $message->reference . "_" . \laabs::newTimestamp()->getTimestamp();
// Check unique
$unique = array(
'type' => $message->type,
'senderOrgRegNumber' => $message->senderOrgRegNumber,
'reference' => $message->reference,
);
if ($this->sdoFactory->exists("medona/message", $unique)) {
$this->sendError("103", "The message has already been received ('%s' Ref. '%s' from '%s')", array($message->type, $message->reference, $message->senderOrgRegNumber));
throw \laabs::newException("medona/invalidMessageException", "The message has already been received ('%s' Ref. '%s' from '%s')", 409, null, array($message->type, $message->reference, $message->senderOrgRegNumber));
}
$transactionControl = !$this->sdoFactory->inTransaction();
if ($transactionControl) {
$this->sdoFactory->beginTransaction();
}
try {
if ($accountToken = \laabs::getToken('AUTH')) {
$message->accountId = $accountToken->accountId;
}
if (isset($message->object)) {
$message->data = json_encode($message->object);
}
$this->sdoFactory->create($message, 'medona/message');
if (is_array($message->unitIdentifier)) {
foreach ($message->unitIdentifier as $unitIdentifier) {
$this->sdoFactory->create($unitIdentifier);
}
}
} catch (\Exception $exception) {
if ($transactionControl) {
$this->sdoFactory->rollback();
}
throw $exception;
}
if ($transactionControl) {
$this->sdoFactory->commit();
}
return $message->messageId;
}
}
<?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\demorm_publique\bundle\seda\Controller;
class ArchiveTransferComposition extends \ext\archivesPubliques\bundle\seda\Controller\ArchiveTransferComposition
{
/**
* Receive message with all contents embedded
* @param object $messageObject The message
* @param bool $isTemplate True if the message is a template
*
* @return string The new message identifier
*/
public function create($messageObject, $isTemplate=false)
{
$message = $this->composeMessage($messageObject);
$message->messageId = \laabs::newId();
if ($isTemplate) {
$message->status = 'template';
}
$message->reference = $message->reference . "_" . \laabs::newTimestamp()->getTimestamp();
if ($this->sdoFactory->exists('medona/message', array('type'=>$message->type, 'senderOrgRegNumber'=>$message->senderOrgRegNumber, 'reference'=>$message->reference))) {
throw \laabs::newException("seda/invalidMessageException", "L'identifiant du message existe déjà.");
}
$messageDir = $this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId;
if (!is_dir($messageDir)) {
mkdir($messageDir, 0777, true);
}
$this->sdoFactory->create($message, 'medona/message');
return $message->messageId;
}
}
<?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\demorm_publique\bundle\seda\Controller;
class ArchiveTransferComposition extends \ext\archivesPubliques\bundle\seda2\Controller\ArchiveTransferComposition
{
/**
* Receive message with all contents embedded
* @param object $messageObject The message
* @param bool $isTemplate True if the message is a template
*
* @return string The new message identifier
*/
public function create($messageObject, $isTemplate=false)
{
$message = $this->composeMessage($messageObject);
$message->messageId = \laabs::newId();
$message->isIncoming = true;
if ($isTemplate) {
$message->status = 'template';
}
$message->reference = $message->reference . "_" . \laabs::newTimestamp()->getTimestamp();
if ($this->sdoFactory->exists('medona/message', array('type'=>$message->type, 'senderOrgRegNumber'=>$message->senderOrgRegNumber, 'reference'=>$message->reference))) {
throw \laabs::newException("seda2/invalidMessageException", "L'identifiant du message existe déjà.");
}
$messageDir = $this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId;
if (!is_dir($messageDir)) {
mkdir($messageDir, 0777, true);
}
$this->sdoFactory->create($message, 'medona/message');
return $message->messageId;
}
}
\ No newline at end of file
......@@ -55,7 +55,6 @@ class authentication extends \presentation\maarchRM\Presenter\auth\authenticatio
$date->add(new \DateInterval('PT4H'));
$view = $this->view;
$view->addHeaders();
......
......@@ -26,7 +26,7 @@
Caps Lock On
</div>
<div style="color: red;">
<p>Ceci est une version de démo de Maarch RM V2.6.3 avec son extension "Archives Publiques" (<a href="//cdn.maarch.org/demorm/MaarchRM_Guide2Visite_SpherePublique.pdf" target="_blank">Guide de visite</a>)</p>
<p>Ceci est une version de démo de Maarch RM V2.7 avec son extension "Archives Publiques" (<a href="//cdn.maarch.org/demorm/MaarchRM_Guide2Visite_SpherePublique.pdf" target="_blank">Guide de visite</a>)</p>
<p>Le jeu de démo est disponible <a href="//cdn.maarch.org/demorm/ArchiveTransfer_RM_AP.zip" target="_blank">ici</a></p>
<p>Prochaine remise à zéro des données à <?merge nextExecution ?> (Europe / Paris)</p>
<hr/>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment