diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusController.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusController.php index 1bd06d83b2..b31ad7e8c2 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusController.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusController.php @@ -13,6 +13,9 @@ use Alchemy\Phrasea\Application\Helper\DispatcherAware; use Alchemy\Phrasea\Controller\Controller; use Alchemy\Phrasea\Core\Event\Thesaurus as ThesaurusEvent; use Alchemy\Phrasea\Core\Event\Thesaurus\ThesaurusEvents; +use Alchemy\Phrasea\SearchEngine\Elastic\ElasticsearchOptions; +use Alchemy\Phrasea\WorkerManager\Event\PopulateIndexEvent; +use Alchemy\Phrasea\WorkerManager\Event\WorkerEvents; use Doctrine\DBAL\Driver\Connection; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -1222,6 +1225,26 @@ class ThesaurusController extends Controller ]); } + /** + * Order to populate databox + * + * @param Request $request + * @return \Symfony\Component\HttpFoundation\JsonResponse + */ + public function populate(Request $request) + { + $options = $this->getElasticsearchOptions(); + + $data['host'] = $options->getHost(); + $data['port'] = $options->getPort(); + $data['indexName'] = $options->getIndexName(); + $data['databoxIds'] = [$request->get('databox_id')]; + + $this->getDispatcher()->dispatch(WorkerEvents::POPULATE_INDEX, new PopulateIndexEvent($data)); + + return $this->app->json($data); + } + /** * @param Request $request * @return Response @@ -3031,4 +3054,12 @@ class ThesaurusController extends Controller { return $this->app['locales.available']; } + + /** + * @return ElasticsearchOptions + */ + private function getElasticsearchOptions() + { + return $this->app['elasticsearch.options']; + } } diff --git a/lib/Alchemy/Phrasea/ControllerProvider/Thesaurus/Thesaurus.php b/lib/Alchemy/Phrasea/ControllerProvider/Thesaurus/Thesaurus.php index 039cb4b96f..d5119eede9 100644 --- a/lib/Alchemy/Phrasea/ControllerProvider/Thesaurus/Thesaurus.php +++ b/lib/Alchemy/Phrasea/ControllerProvider/Thesaurus/Thesaurus.php @@ -60,6 +60,7 @@ class Thesaurus implements ControllerProviderInterface, ServiceProviderInterface $controllers->match('newterm.php', 'controller.thesaurus:newTerm'); $controllers->match('properties.php', 'controller.thesaurus:properties'); $controllers->match('thesaurus.php', 'controller.thesaurus:thesaurus')->bind('thesaurus_thesaurus'); + $controllers->match('populate', 'controller.thesaurus:populate')->bind('thesaurus_populate'); $controllers->match('xmlhttp/accept.x.php', 'controller.thesaurus:acceptXml'); $controllers->match('xmlhttp/acceptcandidates.x.php', 'controller.thesaurus:acceptCandidatesXml'); diff --git a/resources/locales/messages.de.xlf b/resources/locales/messages.de.xlf index 73f31106ad..a56196a754 100644 --- a/resources/locales/messages.de.xlf +++ b/resources/locales/messages.de.xlf @@ -1,4 +1,4 @@ - +
@@ -7,8 +7,8 @@
- - + + Form/Login/PhraseaAuthenticationForm.php Form/Configuration/EmailFormType.php @@ -12147,9 +12147,9 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben Auswahl entfernen prod/actions/Push.html.twig - + prod:videoeditor:subtitleRequestTab:: submit - Einreichen + Anfrage einreichen actions/Tools/videoEditor.html.twig @@ -12182,9 +12182,9 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben Automatische Untertitelung Anfrage actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:: Caption placeholder - Beschriftung Platzhalter + Geben Sie einen Untertitel ein actions/Tools/videoEditor.html.twig @@ -12207,9 +12207,9 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben Start actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:: add caption - Untertitel + Untertitel hinzufügen actions/Tools/videoEditor.html.twig @@ -12227,14 +12227,14 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben Untertitel Sprache auswählen actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:message:: error - prod:videoeditor:subtitletab:message:: error + Fehler beim speichern des Untertitels Controller/Prod/LanguageController.php - + prod:videoeditor:subtitletab:message:: success - prod:videoeditor:subtitletab:message:: success + Erfolg Controller/Prod/LanguageController.php diff --git a/resources/locales/messages.en.xlf b/resources/locales/messages.en.xlf index b594b6f2cd..4fb4ca45fd 100644 --- a/resources/locales/messages.en.xlf +++ b/resources/locales/messages.en.xlf @@ -1,4 +1,4 @@ - +
@@ -7,8 +7,8 @@
- - + + Form/Login/PhraseaAuthenticationForm.php Form/Configuration/EmailFormType.php @@ -9182,29 +9182,29 @@ Uploader admin/worker-manager/index.html.twig
- + admin::workermanager:tab:queueMonitor: Consumer count - Number of worker(s) + Number of worker(s) admin/worker-manager/worker_queue_monitor.html.twig - + admin::workermanager:tab:queueMonitor: Message count - Message count + Message count admin/worker-manager/worker_queue_monitor.html.twig - + admin::workermanager:tab:queueMonitor: Refresh list - Refresh + Refresh admin/worker-manager/worker_queue_monitor.html.twig - + admin::workermanager:tab:queueMonitor: description - Message queues status + Message queues status admin/worker-manager/worker_queue_monitor.html.twig - + admin::workermanager:tab:queueMonitor: title - Queues + Queues admin/worker-manager/index.html.twig @@ -9372,9 +9372,9 @@ Started admin/worker-manager/worker_info.html.twig - + admin::workermanager:tab:workerinfo: databox_name - Databox + Databox admin/worker-manager/worker_info.html.twig @@ -11808,9 +11808,11 @@ Warning: The current values will be overwritten by these new values Valid changes or Cancel prod/actions/edit_default.html.twig - + prod::editing::annulation: abandonner les modification ? - Cancelling editing will lose all edits. - Cancel : to go back to editing - OK : to close and lose edits + Cancelling editing will lose all edits. +- Cancel : to go back to editing +- OK : to close and lose edits Controller/Prod/LanguageController.php @@ -12153,9 +12155,9 @@ It is possible to place several search areas Delete Selection prod/actions/Push.html.twig - + prod:videoeditor:subtitleRequestTab:: submit - Submit + Submit Subtitling Request actions/Tools/videoEditor.html.twig @@ -12168,29 +12170,29 @@ It is possible to place several search areas Kind actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitleRequestTab:label:: Language destination - Destination Language + Subtitles language destination actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitleRequestTab:label:: Provider - Provider + Provider actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitleRequestTab:label:: Source Audio language - Audio language Source + Audio language Source actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitleTab:: title - Auto Subtitling request + Subtitle editing actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:: Caption placeholder - Caption placeholder + Type a subtitle actions/Tools/videoEditor.html.twig @@ -12213,9 +12215,9 @@ It is possible to place several search areas Start actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:: add caption - Subtitle + Add a Subtitle actions/Tools/videoEditor.html.twig @@ -12233,14 +12235,14 @@ It is possible to place several search areas Select subtitling language actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:message:: error - prod:videoeditor:subtitletab:message:: error + Error when saving subtitle Controller/Prod/LanguageController.php - + prod:videoeditor:subtitletab:message:: success - prod:videoeditor:subtitletab:message:: success + Success Controller/Prod/LanguageController.php diff --git a/resources/locales/messages.fr.xlf b/resources/locales/messages.fr.xlf index 9d807b7b84..52f22b762b 100644 --- a/resources/locales/messages.fr.xlf +++ b/resources/locales/messages.fr.xlf @@ -1,4 +1,4 @@ - +
@@ -7,8 +7,8 @@
- - + + Form/Login/PhraseaAuthenticationForm.php Form/Configuration/EmailFormType.php @@ -9202,9 +9202,9 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le Etat des files de message admin/worker-manager/worker_queue_monitor.html.twig
- + admin::workermanager:tab:queueMonitor: title - Files de message + Files de message admin/worker-manager/index.html.twig @@ -11808,11 +11808,11 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles Valider ou annuler les modifications prod/actions/edit_default.html.twig - + prod::editing::annulation: abandonner les modification ? L'annulation de l'édition effacera toutes les modifications. -- Annuler: pour revenir à l'édition -- OK: pour fermer et perdre les modifications + - Annuler: pour revenir à l'édition + - OK: pour fermer et perdre les modifications Controller/Prod/LanguageController.php @@ -12158,14 +12158,14 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles Supprimer la selection prod/actions/Push.html.twig - + prod:videoeditor:subtitleRequestTab:: submit - Sous-titrage automatique + Soumettre la demande actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitleRequestTab:: title - Edition des sous-titres + Sous-titrage Automatique actions/Tools/videoEditor.html.twig @@ -12173,19 +12173,19 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles Type actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitleRequestTab:label:: Language destination - Langue de destination + Langue de destination des sous-titres actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitleRequestTab:label:: Provider - Provider + Fournisseur actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitleRequestTab:label:: Source Audio language - Langue de la source (audio) + Langue de la source audio actions/Tools/videoEditor.html.twig @@ -12193,9 +12193,9 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles Edition de sous-titres actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:: Caption placeholder - Description + Sous-titre actions/Tools/videoEditor.html.twig @@ -12218,14 +12218,14 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles Début actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:: add caption - Sous-titre + Ajouter un sous-titre actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:: copy to clipboard - Copier dans le presse papier + Copier dans le presse papier actions/Tools/videoEditor.html.twig @@ -12233,19 +12233,19 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles Sauvegarder actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:: work on - Choisir une langue + Choisir une langue a éditer actions/Tools/videoEditor.html.twig - + prod:videoeditor:subtitletab:message:: error - prod:videoeditor:subtitletab:message:: error + Erreur lors de la sauvegarde des sous-titres Controller/Prod/LanguageController.php - + prod:videoeditor:subtitletab:message:: success - prod:videoeditor:subtitletab:message:: success + Sous-titres sauvegardé Controller/Prod/LanguageController.php