Unverified Commit 16f62e61 authored by Jerome Boucher's avatar Jerome Boucher
Browse files

feat/16693 : refactoring return for fulltext extraction

parent a99cdca5
Pipeline #12475 failed with stages
in 45 seconds
......@@ -839,13 +839,10 @@ trait archiveModificationTrait
{
$archiveIds = $this->sdoFactory->index('recordsManagement/archive', 'archiveId', 'fullTextIndexation=:fullTextIndexation', ['fullTextIndexation' => 'requested']);
if (empty($archiveIds)) {
throw \laabs::newException('recordsManagement/fullTextException', "No archive to extract");
}
$fullTextServices = \laabs::configuration('dependency.fileSystem')['fullTextServices'];
$archiveExtractedCount = 0;
$res = [];
foreach ($archiveIds as $archiveId) {
$fullText = "";
$digitalResources = $this->digitalResourceController->getResourcesByArchiveId($archiveId);
......@@ -880,7 +877,6 @@ trait archiveModificationTrait
$archive = $this->retrieve($archiveId);
$descriptionController = $this->useDescriptionController($archive->descriptionClass);
try {
$descriptionController->update($archive, $fullText);
$archive->fullTextIndexation = "indexed";
......@@ -889,13 +885,16 @@ trait archiveModificationTrait
throw new Exception("Error Processing Request", 1);
}
echo "Archive $archive->archiveName extracted" . PHP_EOL;
$logMessage = ["message" => "Archive %s extracted", "variables"=> $archive->archiveName];
\laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage);
$this->logMetadataModification($archive, true);
$archiveExtractedCount++;
}
echo "$archiveExtractedCount archives extracted" . PHP_EOL;
$logMessage = ["message" => "%s archive(s) extracted", "variables"=> $archiveExtractedCount];
\laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage);
return true;
}
......
......@@ -1947,3 +1947,9 @@ msgstr "Import du référentiel de règle de conservation"
msgid "result(s) on"
msgstr "résultat(s) sur"
msgid "Archive %s extracted"
msgstr "Archive %s extraite"
msgid "%s archive(s) extracted"
msgstr "%s archive(s) extraite(s)"
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