Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e809783
Use config array instead of object in ProQuestFSG search factory
rtloftus Sep 3, 2026
36acdf7
backend reqs
rtloftus Sep 3, 2026
f0d68c9
composer fix
rtloftus Sep 3, 2026
1981620
composer fix
rtloftus Sep 3, 2026
42e90d0
backend blender fix
rtloftus Sep 3, 2026
288b3bd
openurl
rtloftus Sep 3, 2026
45d8974
record collection
rtloftus Sep 3, 2026
9423c35
composer fix
rtloftus Sep 3, 2026
4ae1524
composer fix
rtloftus Sep 3, 2026
53b29f8
Merge branch 'dev' into proquest-fsg
demiankatz Sep 4, 2026
990e333
Update module/VuFindSearch/src/VuFindSearch/Backend/EDS/Backend.php
rtloftus Sep 8, 2026
82df893
Update module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFac…
rtloftus Sep 8, 2026
6d81afb
Update module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFac…
rtloftus Sep 8, 2026
d3b5222
Update module/VuFindSearch/src/VuFindSearch/Backend/Blender/Response/…
rtloftus Sep 8, 2026
e8104d7
Update module/VuFindSearch/src/VuFindSearch/Backend/Blender/Response/…
rtloftus Sep 8, 2026
5742236
Update module/VuFindSearch/src/VuFindSearch/Backend/Blender/Backend.php
rtloftus Sep 8, 2026
02b9cd1
Update module/VuFindSearch/src/VuFindSearch/Backend/Blender/Backend.php
rtloftus Sep 8, 2026
1660fcb
Update module/VuFindSearch/src/VuFindSearch/Backend/Solr/SimilarBuild…
rtloftus Sep 8, 2026
00968cf
fixed parser error
rtloftus Sep 8, 2026
e14e20a
similarbuilder reversion
rtloftus Sep 9, 2026
c51b2a7
sb test
rtloftus Sep 9, 2026
2d96c8a
reversion of sb part
rtloftus Sep 9, 2026
364bf48
eds backend test reversion
rtloftus Sep 9, 2026
66aa6df
eds backend reversion
rtloftus Sep 9, 2026
e43ae5c
recordcollection reversion
rtloftus Sep 9, 2026
0777f4c
blender backend
rtloftus Sep 9, 2026
c66489f
blender backend test
rtloftus Sep 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use Laminas\Http\Client;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Psr\Container\ContainerInterface;
use VuFind\Config\Config;
use VuFind\Service\GetServiceTrait;

/**
Expand Down Expand Up @@ -87,16 +86,16 @@ protected function createHttpClient(
/**
* Create cache for the connector if enabled in configuration.
*
* @param Config $searchConfig Search configuration
* @param array $searchConfig Search configuration
*
* @return ?StorageInterface
*/
protected function createConnectorCache(Config $searchConfig): ?StorageInterface
protected function createConnectorCache(array $searchConfig): ?StorageInterface
Comment thread
rtloftus marked this conversation as resolved.
{
if (empty($searchConfig->SearchCache->adapter)) {
if (empty($searchConfig['SearchCache']['adapter'])) {
return null;
}
$cacheConfig = $searchConfig->SearchCache->toArray();
$cacheConfig = $searchConfig['SearchCache'];
$options = $cacheConfig['options'] ?? [];
if (empty($options['namespace'])) {
$options['namespace'] = 'Index';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
use Psr\Container\ContainerExceptionInterface as ContainerException;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use VuFind\Config\Config;
use VuFind\Config\ConfigManagerInterface;
use VuFind\Search\Solr\CustomFilterListener;
use VuFind\Search\Solr\DeduplicationListener;
Expand Down Expand Up @@ -327,15 +326,15 @@ protected function createListeners(Backend $backend): void

// Load configurations:
$config = $this->configManager->getConfigArray($this->mainConfig);
$search = $this->configManager->getConfigObject($this->searchConfig);
$facet = $this->configManager->getConfigObject($this->facetConfig);
$search = $this->configManager->getConfigArray($this->searchConfig);
$facet = $this->configManager->getConfigArray($this->facetConfig);

// Attach default parameters listener first so that any other listeners can
// override the parameters as necessary:
if (!empty($search->General->default_parameters)) {
if (!empty($search['General']['default_parameters'])) {
$this->getDefaultParametersListener(
$backend,
$search->General->default_parameters->toArray()
$search['General']['default_parameters']
)->attach($events);
}

Expand All @@ -344,8 +343,7 @@ protected function createListeners(Backend $backend): void

// Conditional Filters
if (
isset($search->ConditionalHiddenFilters)
&& $search->ConditionalHiddenFilters->count() > 0
count($search['ConditionalHiddenFilters'] ?? []) > 0
) {
$this->getInjectConditionalFilterListener($backend, $search)->attach($events);
}
Expand All @@ -367,35 +365,35 @@ protected function createListeners(Backend $backend): void
}

// Apply field stripping if applicable:
if (isset($search->StripFields) && isset($search->IndexShards)) {
$strip = $search->StripFields->toArray();
if (isset($search['StripFields']) && isset($search['IndexShards'])) {
$strip = $search['StripFields'];
foreach ($strip as $k => $v) {
$strip[$k] = array_map('trim', explode(',', $v));
}
$mindexListener = new MultiIndexListener(
$backend,
$search->IndexShards->toArray(),
$search['IndexShards'],
$strip,
$this->loadSpecs()
);
$mindexListener->attach($events);
}

// Apply deduplication if applicable:
if (isset($search->Records->deduplication)) {
if (isset($search['Records']['deduplication'])) {
$this->getDeduplicationListener(
$backend,
$search->Records->deduplication
$search['Records']['deduplication']
)->attach($events);
}

// Attach hierarchical facet listener:
$this->getHierarchicalFacetListener($backend)->attach($events);

// Apply legacy filter conversion if necessary:
if (!empty($facet->LegacyFields)) {
if (!empty($facet['LegacyFields'])) {
$filterFieldConversionListener = new FilterFieldConversionListener(
$facet->LegacyFields->toArray()
$facet['LegacyFields']
);
$filterFieldConversionListener->attach($events);
}
Expand Down Expand Up @@ -488,10 +486,10 @@ protected function getHiddenFilters(): array
protected function createConnector(): Connector
{
$timeout = $this->getIndexConfig('timeout', 30);
$searchConfig = $this->configManager->getConfigObject($this->searchConfig);
$defaultFields = $searchConfig->General->default_record_fields ?? '*';
$searchConfig = $this->configManager->getConfigArray($this->searchConfig);
$defaultFields = $searchConfig['General']['default_record_fields'] ?? '*';

if (($searchConfig->Explain->enabled ?? false) && !str_contains($defaultFields, 'score')) {
if (($searchConfig['Explain']['enabled'] ?? false) && !str_contains($defaultFields, 'score')) {
$defaultFields .= ',score';
}

Expand Down Expand Up @@ -653,21 +651,21 @@ protected function getDeduplicationListener(Backend $backend, bool $enabled): De
* Get a custom filter listener for the backend (or null if not needed).
*
* @param BackendInterface $backend Search backend
* @param Config $facet Configuration of facets
* @param array $facet Configuration of facets
*
* @return ?CustomFilterListener
*/
protected function getCustomFilterListener(
BackendInterface $backend,
Config $facet
array $facet
): ?CustomFilterListener {
$customField = $facet->CustomFilters->custom_filter_field ?? 'vufind';
$customField = $facet['CustomFilters']['custom_filter_field'] ?? 'vufind';
$normal = $inverted = [];

foreach ($facet->CustomFilters->translated_filters ?? [] as $key => $val) {
foreach ($facet['CustomFilters']['translated_filters'] ?? [] as $key => $val) {
$normal[$customField . ':"' . $key . '"'] = $val;
}
foreach ($facet->CustomFilters->inverted_filters ?? [] as $key => $val) {
foreach ($facet['CustomFilters']['inverted_filters'] ?? [] as $key => $val) {
$inverted[$customField . ':"' . $key . '"'] = $val;
}
return empty($normal) && empty($inverted)
Expand Down Expand Up @@ -695,34 +693,34 @@ protected function getHierarchicalFacetListener(BackendInterface $backend): Hier
* Get a highlighting listener for the backend.
*
* @param BackendInterface $backend Search backend
* @param Config $search Search configuration
* @param array $search Search configuration
*
* @return InjectHighlightingListener
*/
protected function getInjectHighlightingListener(
BackendInterface $backend,
Config $search
array $search
): InjectHighlightingListener {
$fl = $search->General->highlighting_fields ?? '*';
$extras = $search->General->extra_hl_params ?? [];
$fl = $search['General']['highlighting_fields'] ?? '*';
$extras = $search['General']['extra_hl_params'] ?? [];
return new InjectHighlightingListener($backend, $fl, $extras);
}

/**
* Get a Conditional Filter Listener.
*
* @param BackendInterface $backend Search backend
* @param Config $search Search configuration
* @param array $search Search configuration
*
* @return InjectConditionalFilterListener
*/
protected function getInjectConditionalFilterListener(
BackendInterface $backend,
Config $search
array $search
): InjectConditionalFilterListener {
$listener = new InjectConditionalFilterListener(
$backend,
$search->ConditionalHiddenFilters->toArray()
$search['ConditionalHiddenFilters'] ?? []
);
$listener->setAuthorizationService(
$this->getService(\Lmc\Rbac\Mvc\Service\AuthorizationService::class)
Expand Down
33 changes: 16 additions & 17 deletions module/VuFind/src/VuFind/Search/Factory/EdsBackendFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
use Psr\Container\ContainerExceptionInterface as ContainerException;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use VuFind\Config\Config;
use VuFindSearch\Backend\EDS\Backend;
use VuFindSearch\Backend\EDS\Connector;
use VuFindSearch\Backend\EDS\QueryBuilder;
Expand Down Expand Up @@ -63,9 +62,9 @@ class EdsBackendFactory extends AbstractBackendFactory
/**
* EDS configuration.
*
* @var Config
* @var array
*/
protected Config $edsConfig;
protected array $edsConfig;

/**
* Default URL for the EDS Backend. Set here for the EDS API.
Expand Down Expand Up @@ -108,7 +107,7 @@ public function __invoke(
) {
$this->setup($container);
$this->edsConfig = $this->getService(\VuFind\Config\ConfigManagerInterface::class)
->getConfigObject($this->getServiceName());
->getConfigArray($this->getServiceName());
if ($this->serviceLocator->has(\VuFind\Log\Logger::class)) {
$this->logger = $this->getService(\VuFind\Log\Logger::class);
}
Expand Down Expand Up @@ -161,12 +160,12 @@ protected function createConnector(): Connector
$options = $this->createConnectorOptions();
$httpOptions = [
'sslverifypeer'
=> (bool)($this->edsConfig->General->sslverifypeer ?? true),
=> (bool)($this->edsConfig['General']['sslverifypeer'] ?? true),
];
$connector = new Connector(
$options,
$this->createHttpClient(
$this->edsConfig->General->timeout ?? 120,
$this->edsConfig['General']['timeout'] ?? 120,
$httpOptions
)
);
Expand All @@ -186,24 +185,24 @@ protected function createConnectorOptions(): array
{
$auth = $this->getService(\Lmc\Rbac\Mvc\Service\AuthorizationService::class);
$options = [
'search_http_method' => $this->edsConfig->General->search_http_method
'search_http_method' => $this->edsConfig['General']['search_http_method']
?? 'POST',
'api_url' => $this->edsConfig->General->api_url
'api_url' => $this->edsConfig['General']['api_url']
?? $this->defaultApiUrl,
'is_guest' => !$auth->isGranted('access.EDSExtendedResults'),
'send_user_ip' => $this->edsConfig->AdditionalHeaders->send_user_ip ?? false,
'send_user_ip' => $this->edsConfig['AdditionalHeaders']['send_user_ip'] ?? false,
];
if (isset($this->edsConfig->General->auth_url)) {
$options['auth_url'] = $this->edsConfig->General->auth_url;
if (isset($this->edsConfig['General']['auth_url'])) {
$options['auth_url'] = $this->edsConfig['General']['auth_url'];
}
if (isset($this->edsConfig->General->session_url)) {
$options['session_url'] = $this->edsConfig->General->session_url;
if (isset($this->edsConfig['General']['session_url'])) {
$options['session_url'] = $this->edsConfig['General']['session_url'];
}
if (!empty($this->edsConfig->EBSCO_Account->api_key)) {
$options['api_key'] = $this->edsConfig->EBSCO_Account->api_key;
if (!empty($this->edsConfig['EBSCO_Account']['api_key'])) {
$options['api_key'] = $this->edsConfig['EBSCO_Account']['api_key'];
}
if (!empty($this->edsConfig->EBSCO_Account->api_key_guest)) {
$options['api_key_guest'] = $this->edsConfig->EBSCO_Account->api_key_guest;
if (!empty($this->edsConfig['EBSCO_Account']['api_key_guest'])) {
$options['api_key_guest'] = $this->edsConfig['EBSCO_Account']['api_key_guest'];
}
if ($options['send_user_ip']) {
$options['ip_to_report'] = $this->getService(\VuFind\Net\UserIpReader::class)->getUserIp();
Expand Down
21 changes: 10 additions & 11 deletions module/VuFind/src/VuFind/Search/Factory/PrimoBackendFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
use Psr\Container\ContainerExceptionInterface as ContainerException;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use VuFind\Config\Config;
use VuFind\Search\Primo\InjectOnCampusListener;
use VuFind\Search\Primo\PrimoPermissionHandler;
use VuFindSearch\Backend\Primo\Backend;
Expand Down Expand Up @@ -69,9 +68,9 @@ class PrimoBackendFactory extends AbstractBackendFactory
/**
* Primo configuration.
*
* @var Config
* @var array
*/
protected Config $primoConfig;
protected array $primoConfig;

/**
* Primo backend class.
Expand Down Expand Up @@ -145,7 +144,7 @@ public function __invoke(
?array $options = null
) {
$this->setup($container);
$this->primoConfig = $this->getService(\VuFind\Config\ConfigManagerInterface::class)->getConfigObject('Primo');
$this->primoConfig = $this->getService(\VuFind\Config\ConfigManagerInterface::class)->getConfigArray('Primo');
if ($this->serviceLocator->has(\VuFind\Log\Logger::class)) {
$this->logger = $this->getService(\VuFind\Log\Logger::class);
}
Expand Down Expand Up @@ -208,7 +207,7 @@ protected function createRestConnector(): RestConnector
$permHandler = $this->getPermissionHandler();

// Load URLs and credentials:
if (empty($this->primoConfig->General->search_url)) {
if (empty($this->primoConfig['General']['search_url'])) {
throw new \Exception('Missing search_url in Primo.ini');
}
$instCode = isset($permHandler)
Expand All @@ -221,10 +220,10 @@ protected function createRestConnector(): RestConnector
);

// Create connector:
$timeout = $this->primoConfig->General->timeout ?? 30;
$timeout = $this->primoConfig['General']['timeout'] ?? 30;
$connector = new $this->restConnectorClass(
$this->primoConfig->General->jwt_url ?? '',
$this->primoConfig->General->search_url,
$this->primoConfig['General']['jwt_url'] ?? '',
$this->primoConfig['General']['search_url'],
$instCode,
function (string $url) use ($timeout) {
return $this->createHttpClient(
Expand Down Expand Up @@ -263,7 +262,7 @@ protected function createRecordCollectionFactory(): RecordCollectionFactory
$callback = function ($data) use ($manager) {
$driver = $manager->get('Primo');
$driver->setRawData($data);
if ($this->primoConfig->display_cdi_attributes ?? true) {
if ($this->primoConfig['display_cdi_attributes'] ?? true) {
foreach ($this->attributeLabelTypeMappings as $key => $config) {
if (in_array($key, $data['attributes'] ?? [])) {
$driver->addLabel($config['display'], $config['type']);
Expand Down Expand Up @@ -292,9 +291,9 @@ protected function getInjectOnCampusListener(): InjectOnCampusListener
*/
protected function getPermissionHandler(): ?PrimoPermissionHandler
{
if (isset($this->primoConfig->Institutions)) {
if (isset($this->primoConfig['Institutions'])) {
$permHandler = new PrimoPermissionHandler(
$this->primoConfig->Institutions
$this->primoConfig['Institutions']
);
$permHandler->setAuthorizationService(
$this->getService(AuthorizationService::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
use Psr\Container\ContainerExceptionInterface as ContainerException;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use VuFind\Config\Config;
use VuFindSearch\Backend\ProQuestFSG\Backend;
use VuFindSearch\Backend\ProQuestFSG\Connector;
use VuFindSearch\Backend\ProQuestFSG\Response\XML\RecordCollectionFactory;
Expand All @@ -62,16 +61,16 @@ class ProQuestFSGBackendFactory extends AbstractBackendFactory
/**
* VuFind configuration.
*
* @var Config
* @var array
*/
protected Config $config;
protected array $config;

/**
* ProQuestFSG configuration.
*
* @var Config
* @var array
*/
protected Config $proQuestFSGConfig;
protected array $proQuestFSGConfig;

/**
* Create an object.
Expand All @@ -96,8 +95,8 @@ public function __invoke(
) {
$this->setup($container);
$configManager = $this->getService(\VuFind\Config\ConfigManagerInterface::class);
$this->config = $configManager->getConfigObject('config');
$this->proQuestFSGConfig = $configManager->getConfigObject('ProQuestFSG');
$this->config = $configManager->getConfigArray('config');
$this->proQuestFSGConfig = $configManager->getConfigArray('ProQuestFSG');
if ($this->serviceLocator->has(\VuFind\Log\Logger::class)) {
$this->logger = $this->getService(\VuFind\Log\Logger::class);
}
Expand Down Expand Up @@ -127,7 +126,7 @@ protected function createBackend(Connector $connector): Backend
*/
protected function createConnector(): Connector
{
$connector = new Connector($this->createHttpClient(), $this->proQuestFSGConfig->toArray());
$connector = new Connector($this->createHttpClient(), $this->proQuestFSGConfig);
$connector->setLogger($this->logger);
if ($cache = $this->createConnectorCache($this->proQuestFSGConfig)) {
$connector->setCache($cache);
Expand Down
Loading