From 8c60fdeb72ff9d2bdaa7c8f0728afa93b686b616 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 1 Feb 2018 15:26:23 -0500 Subject: [PATCH] Modernize record tab plugin manager service. - Eliminate static factory. - Use fully qualified class name as service name. --- module/VuFind/config/module.config.php | 3 ++- .../VuFind/src/VuFind/Controller/AbstractRecord.php | 4 ++-- .../VuFind/src/VuFind/Controller/AjaxController.php | 4 ++-- .../src/VuFind/Controller/AuthorityController.php | 2 +- module/VuFind/src/VuFind/Service/Factory.php | 12 ------------ 5 files changed, 7 insertions(+), 18 deletions(-) diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 5789c763021..c5d9e0bfcbd 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -324,7 +324,7 @@ $config = [ 'VuFind\RecordDriver\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\RecordLoader' => 'VuFind\Service\Factory::getRecordLoader', 'VuFind\RecordRouter' => 'VuFind\Service\Factory::getRecordRouter', - 'VuFind\RecordTabPluginManager' => 'VuFind\Service\Factory::getRecordTabPluginManager', + 'VuFind\RecordTab\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\RelatedPluginManager' => 'VuFind\Service\Factory::getRelatedPluginManager', 'VuFind\ResolverDriverPluginManager' => 'VuFind\Service\Factory::getResolverDriverPluginManager', 'VuFind\Role\PermissionManager' => 'VuFind\Role\PermissionManagerFactory', @@ -389,6 +389,7 @@ $config = [ 'VuFind\IpAddressUtils' => 'VuFind\Net\IpAddressUtils', 'VuFind\RecommendPluginManager' => 'VuFind\Recommend\PluginManager', 'VuFind\RecordDriverPluginManager' => 'VuFind\RecordDriver\PluginManager', + 'VuFind\RecordTabPluginManager' => 'VuFind\RecordTab\PluginManager', ], ], 'translator' => [], diff --git a/module/VuFind/src/VuFind/Controller/AbstractRecord.php b/module/VuFind/src/VuFind/Controller/AbstractRecord.php index a74848fc8ff..291a972acf5 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractRecord.php +++ b/module/VuFind/src/VuFind/Controller/AbstractRecord.php @@ -629,7 +629,7 @@ class AbstractRecord extends AbstractBase } /** - * Support method to load tab information from the RecordTabPluginManager. + * Support method to load tab information from the RecordTab PluginManager. * * @return void */ @@ -637,7 +637,7 @@ class AbstractRecord extends AbstractBase { $driver = $this->loadRecord(); $request = $this->getRequest(); - $rtpm = $this->serviceLocator->get('VuFind\RecordTabPluginManager'); + $rtpm = $this->serviceLocator->get('VuFind\RecordTab\PluginManager'); $details = $rtpm->getTabDetailsForRecord( $driver, $this->getRecordTabConfig(), $request, $this->fallbackDefaultTab diff --git a/module/VuFind/src/VuFind/Controller/AjaxController.php b/module/VuFind/src/VuFind/Controller/AjaxController.php index 3f76d5dc13d..ba620a00daf 100644 --- a/module/VuFind/src/VuFind/Controller/AjaxController.php +++ b/module/VuFind/src/VuFind/Controller/AjaxController.php @@ -791,7 +791,7 @@ class AjaxController extends AbstractBase $config = $this->serviceLocator->get('Config'); $recordTabPlugin = $this->serviceLocator - ->get('VuFind\RecordTabPluginManager'); + ->get('VuFind\RecordTab\PluginManager'); $details = $recordTabPlugin ->getTabDetailsForRecord( $driver, @@ -800,7 +800,7 @@ class AjaxController extends AbstractBase 'Information' ); - $rtpm = $this->serviceLocator->get('VuFind\RecordTabPluginManager'); + $rtpm = $this->serviceLocator->get('VuFind\RecordTab\PluginManager'); $html = $this->getViewRenderer() ->render( "record/ajaxview-" . $viewtype . ".phtml", diff --git a/module/VuFind/src/VuFind/Controller/AuthorityController.php b/module/VuFind/src/VuFind/Controller/AuthorityController.php index d3f92529054..271ac2a0045 100644 --- a/module/VuFind/src/VuFind/Controller/AuthorityController.php +++ b/module/VuFind/src/VuFind/Controller/AuthorityController.php @@ -82,7 +82,7 @@ class AuthorityController extends AbstractSearch ->load($id, 'SolrAuth'); $request = $this->getRequest(); $tabs = $this->serviceLocator - ->get('VuFind\RecordTabPluginManager') + ->get('VuFind\RecordTab\PluginManager') ->getTabsForRecord($driver, $tabConfig, $request); return $this->createViewModel(['driver' => $driver, 'tabs' => $tabs]); } diff --git a/module/VuFind/src/VuFind/Service/Factory.php b/module/VuFind/src/VuFind/Service/Factory.php index 1afc598bf4d..15c75b494bf 100644 --- a/module/VuFind/src/VuFind/Service/Factory.php +++ b/module/VuFind/src/VuFind/Service/Factory.php @@ -273,18 +273,6 @@ class Factory ); } - /** - * Construct the RecordTab Plugin Manager. - * - * @param ServiceManager $sm Service manager. - * - * @return \VuFind\RecordTab\PluginManager - */ - public static function getRecordTabPluginManager(ServiceManager $sm) - { - return static::getGenericPluginManager($sm, 'RecordTab'); - } - /** * Construct the Related Plugin Manager. * -- GitLab