From 0fd6a233b9b60c6de583e9d9e0032ef2a38b672c Mon Sep 17 00:00:00 2001 From: Daniel Lienert Date: Mon, 10 Sep 2018 21:38:41 +0200 Subject: [PATCH] TASK: Listen on asset updated signal --- Classes/Domain/ExtractionManager.php | 2 ++ Classes/Package.php | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Classes/Domain/ExtractionManager.php b/Classes/Domain/ExtractionManager.php index 2ccad55..1c90703 100644 --- a/Classes/Domain/ExtractionManager.php +++ b/Classes/Domain/ExtractionManager.php @@ -12,6 +12,7 @@ */ use Neos\Flow\Annotations as Flow; +use Neos\Flow\ObjectManagement\Exception\UnknownObjectException; use Neos\Flow\ObjectManagement\ObjectManager; use Neos\Flow\Reflection\ReflectionService; use Neos\Flow\ResourceManagement\PersistentResource as FlowResource; @@ -53,6 +54,7 @@ class ExtractionManager * * @return MetaDataCollection * @throws ExtractorException + * @throws UnknownObjectException */ public function extractMetaData(Asset $asset) { diff --git a/Classes/Package.php b/Classes/Package.php index fba3bd0..87b20e9 100644 --- a/Classes/Package.php +++ b/Classes/Package.php @@ -30,8 +30,6 @@ class Package extends BasePackage public function boot(Bootstrap $bootstrap) { $dispatcher = $bootstrap->getSignalSlotDispatcher(); - $dispatcher->connect(AssetService::class, 'assetRemoved', ExtractionManager::class, 'extractMetaData'); - $dispatcher->connect(AssetService::class, 'assetResourceReplaced', ExtractionManager::class, 'extractMetaData'); $package = $this; $dispatcher->connect( Sequence::class, @@ -45,9 +43,10 @@ function (Step $step) use ($package, $bootstrap) { } /** - * Registers slots for signals in order to be able to index nodes + * Registers slots for signals in order to be able extract meta data from assets * * @param Bootstrap $bootstrap + * @throws \Neos\Flow\Exception */ public function registerExtractionSlot(Bootstrap $bootstrap) { @@ -57,6 +56,8 @@ public function registerExtractionSlot(Bootstrap $bootstrap) if (isset($settings['realtimeExtraction']['enabled']) && $settings['realtimeExtraction']['enabled'] === true) { $dispatcher = $bootstrap->getSignalSlotDispatcher(); $dispatcher->connect(AssetService::class, 'assetCreated', ExtractionManager::class, 'extractMetaData'); + $dispatcher->connect(AssetService::class, 'assetUpdated', ExtractionManager::class, 'extractMetaData'); + $dispatcher->connect(AssetService::class, 'assetRemoved', ExtractionManager::class, 'extractMetaData'); } } }