-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backend: ProQuest Federated Search Gateway #3991
Open
maccabeelevine
wants to merge
35
commits into
vufind-org:dev
Choose a base branch
from
maccabeelevine:proquest-federated-search-gateway
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 29 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
9263c83
Add ProQuest Federated Search Gateway backend. First working draft.
maccabeelevine 518de13
Support basic search indices
maccabeelevine e6c1cd1
Implement sorting
maccabeelevine 300c51f
Add search result limits
maccabeelevine df23ce6
Display database facets
maccabeelevine 0fb4406
Apply database filter
maccabeelevine 0f3021c
Support checkbox filters
maccabeelevine ebab982
Add OOTB facet settings
maccabeelevine 8305dd5
Add SearchCache support
maccabeelevine a23fefc
Fix NPE
maccabeelevine d77a08d
Fix single record load
maccabeelevine fc89632
Add next_prev_navigation
maccabeelevine 5d5b9d0
Fix copy/paste typo
maccabeelevine 896ba94
Remove dead code
maccabeelevine 6ffeaa3
Add retain/reset filters configs that work OOTB
maccabeelevine d856c11
Add pagination and recommendation settings, work OOTB
maccabeelevine b5a7ddd
Simply constant backend params
maccabeelevine 2d8b4c8
Support list view options
maccabeelevine f40b553
Fix typo
maccabeelevine a14a801
Remove dead code
maccabeelevine 86abb67
Add advanced search support
maccabeelevine ec2dc6c
Fix styles and add missing comments
maccabeelevine 4a0b7b5
Strip html from title
maccabeelevine 190abbe
Merge branch 'dev' into proquest-federated-search-gateway
maccabeelevine d698830
Convert to bootstrap5
maccabeelevine 9670ee6
Add recommendation module
maccabeelevine 2e85a0f
Fix styles
maccabeelevine d22ff04
Fix copy/paste typos
maccabeelevine 1741fb9
Fix more typos
maccabeelevine f58c0a4
Add tests
maccabeelevine f1c3776
Remove blank line
maccabeelevine e3824df
Perform search if necessary before getting facet list.
maccabeelevine 645eb82
Simplify conditional ParamBag creation
maccabeelevine 6b9ce46
Clean code.
maccabeelevine 2a4c875
Protect missing docs in response
maccabeelevine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
; This section contains global settings affecting search behavior. | ||
; For ProQuest Federated Search Gateway API documentation: | ||
; https://support.proquest.com/s/article/ProQuest-Academic-Platform-Federated-Search-Options | ||
[General] | ||
; This setting controls the default sort order of search results; the selected | ||
; option should be one of the options present in the [Sorting] section below. | ||
default_sort = relevance | ||
; This section controls the result limit options for search results. default_limit | ||
; sets the default number of results per page. limit_options is a comma-separated | ||
; list of numbers to be presented to the end-user. If only one limit is required, | ||
; set default_limit and leave limit_options commented out. | ||
; WARNING: using large limits may cause problems due to a variety of limitations, | ||
; especially if you support bulk operations (which can cause large URLs/requests). | ||
; If you must support large page sizes, you may need to raise the PHP memory_limit | ||
; and max_input_vars settings and/or adjust the Apache LimitRequestLine setting. | ||
default_limit = 20 | ||
; limit_options = 10,20,40,60,80,100 | ||
|
||
; These are the default recommendations modules to use when no specific setting | ||
; are found in the [TopRecommendations], [SideRecommendations] or | ||
; [NoResultsRecommendations] sections below. | ||
; See the comments above those sections for details on legal settings. You may | ||
; repeat these lines to load multiple recommendations. | ||
;default_top_recommend[] = TopFacets:FacetsTop:Primo | ||
default_side_recommend[] = SideFacets:Facets:CheckboxFacets:ProQuestFSG | ||
;default_noresults_recommend[] = SwitchTab | ||
default_noresults_recommend[] = RemoveFilters | ||
|
||
; When you filter a search using facets, should VuFind retain your current filters | ||
; on the next search and provide a reset button to clear them (true), or should it | ||
; always perform new searches unfiltered (false)? | ||
; retain_filters_by_default = true | ||
retain_filters_by_default = false | ||
|
||
; Whether to always (when there are active filters) display the "Reset Filters" | ||
; button regardless of the retain_filters_by_default setting. Default is false. | ||
; always_display_reset_filters = false | ||
always_display_reset_filters = true | ||
|
||
; This controls whether results are loaded with JavaScript when paging or changing | ||
; settings. Loading results this way improves performance and accessibility, and is | ||
; enabled by default. Loading will automatically fall back to non-JS mode if | ||
; JavaScript is not supported by the browser. | ||
load_results_with_js = true | ||
|
||
; This setting can be used to configure pagination control on top of results. | ||
; Possible options are: | ||
; empty string or false No top pagination (default) | ||
; simple Simple next/prev button pagination | ||
; full Full pagination alike to the one at the bottom of results | ||
;top_paginator = simple | ||
|
||
; The following two sections can be used to associate specific recommendations | ||
; modules with specific search types defined in the [Basic_Searches] section | ||
; below. For all the details on how these sections work, see the comments above | ||
; the equivalent sections of searches.ini. Recommendations work the same in | ||
; ProQuestFSG as they do in the regular Search module. | ||
;[SideRecommendations] | ||
; No search-specific settings by default -- add your own here. | ||
;[TopRecommendations] | ||
; No search-specific settings by default -- add your own here. | ||
|
||
maccabeelevine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
; The order of display is as shown below | ||
; The name of the index field is on the left | ||
; The display name of the field is on the right | ||
[Facets] | ||
Databases = "Source" | ||
|
||
; Checkbox facets are facets, which are getting displayed as checkboxes | ||
; pcAvailability is a special facet. It's used to show all records found in | ||
; PrimoCentral without checking the local availability against a holdingsfile. | ||
[CheckboxFacets] | ||
limitFullText = "fulltext_limit" | ||
limitScholarlyJournals = "scholarly_limit" | ||
limitPeerReviewed = "peer_reviewed_limit" | ||
|
||
; Facet display settings | ||
[Results_Settings] | ||
; By default, the side facets will only show 6 facets and then the "show more" | ||
; button. This can get configured with the showMore settings. | ||
; You can use the * to set a new default setting. | ||
showMore[*] = 6 | ||
; Or you can set a facet specific value by using the facet name as index. | ||
;showMore['rtype'] = 10 | ||
; Do we want any facets to be collapsed by default? | ||
;collapsedFacets = * | ||
|
||
; This section shows which search types will display in the basic search box at | ||
; the top of Primo pages. The name of each setting below corresponds with an | ||
; index defined in the Primo API. The value of each setting is the text to | ||
; display on screen. All on-screen text will be run through the translator, so | ||
; be sure to update language files if necessary. The order of these settings | ||
; will be maintained in the drop-down list in the UI. | ||
[Basic_Searches] | ||
cql.serverChoice = "All Fields" | ||
title = Title | ||
author = Author | ||
subject = Subject | ||
;abstract = Abstract | ||
|
||
; This section defines which search options will be included on the advanced | ||
; search screen. All the notes above [Basic_Searches] also apply here. | ||
[Advanced_Searches] | ||
cql.serverChoice = "All Fields" | ||
title = Title | ||
author = Author | ||
subject = Subject | ||
;abstract = Abstract | ||
|
||
; This section defines the sort options available on search results. | ||
[Sorting] | ||
relevance = sort_relevance | ||
date/descending = sort_year | ||
date/ascending = sort_year_asc | ||
|
||
; This section allows you to specify hidden sorting options. They can be used to create a | ||
|
||
; This section controls the behavior of the ProQuestFSGRecord module. | ||
[Record] | ||
; Set this to true in order to enable "next" and "previous" links to navigate | ||
; through the current result set from within the record view. | ||
next_prev_navigation = false | ||
|
||
; This section controls what happens when a record title in a search result list | ||
; is clicked. VuFind can either embed the full result directly in the list using | ||
; AJAX or can display it at its own separate URL as a full HTML page. | ||
; full - separate page (default) | ||
; tabs - embedded using tabs (see record/tabs.phtml) | ||
; accordion - embedded using an accordion (see record/accordion.phtml) | ||
; NOTE: To turn this feature on for favorite lists, see the lists_view setting | ||
; in the [Social] section of config.ini. | ||
; NOTE: This feature is incompatible with SyndeticsPlus content; please use | ||
; regular Syndetics if necessary. | ||
[List] | ||
view=full | ||
|
||
; This section provides settings for optional caching of search requests. | ||
[SearchCache] | ||
; Supported adapters: Memcached, Filesystem. Others may also work, but have not been | ||
; tested. | ||
;adapter = Memcached | ||
; Comma-separated list of servers for Memcached adapter: | ||
;options[servers] = "localhost:11211" | ||
; Cache directory for Filesystem adapter: | ||
;options[cache_dir] = "/tmp/search-cache" | ||
; Other options. See https://docs.laminas.dev/laminas-cache/storage/adapter/ for | ||
; documentation on options for different adapters. | ||
; ttl, Time to Live, i.e. cache entry life time in seconds. 300 seconds by default. | ||
;options[ttl] = 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
module/VuFind/src/VuFind/Controller/ProQuestFSGController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
/** | ||
* ProQuest Federated Search Gateway Controller | ||
* | ||
* PHP version 8 | ||
* | ||
* Copyright (C) Villanova University 2024. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
* @category VuFind | ||
* @package Controller | ||
* @author Demian Katz <[email protected]> | ||
* @author Maccabee Levine <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org Main Site | ||
*/ | ||
|
||
namespace VuFind\Controller; | ||
|
||
use Laminas\ServiceManager\ServiceLocatorInterface; | ||
|
||
/** | ||
* ProQuest Federated Search Gateway Controller | ||
* | ||
* @category VuFind | ||
* @package Controller | ||
* @author Demian Katz <[email protected]> | ||
* @author Maccabee Levine <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org Main Site | ||
*/ | ||
class ProQuestFSGController extends AbstractSearch | ||
{ | ||
/** | ||
* Constructor | ||
* | ||
* @param ServiceLocatorInterface $sm Service locator | ||
*/ | ||
public function __construct(ServiceLocatorInterface $sm) | ||
{ | ||
$this->searchClassId = 'ProQuestFSG'; | ||
parent::__construct($sm); | ||
} | ||
|
||
/** | ||
* Is the result scroller active? | ||
* | ||
* @return bool | ||
*/ | ||
protected function resultScrollerActive() | ||
{ | ||
$config = $this->getService(\VuFind\Config\PluginManager::class)->get('ProQuestFSG'); | ||
return $config->Record->next_prev_navigation ?? false; | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
module/VuFind/src/VuFind/Controller/ProQuestFSGrecordController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
/** | ||
* ProQuest Federated Search Gateway Record Controller | ||
* | ||
* PHP version 8 | ||
* | ||
* Copyright (C) Villanova University 2024. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
* @category VuFind | ||
* @package Controller | ||
* @author Demian Katz <[email protected]> | ||
* @author Maccabee Levine <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org Main Site | ||
*/ | ||
|
||
namespace VuFind\Controller; | ||
|
||
use Laminas\ServiceManager\ServiceLocatorInterface; | ||
|
||
/** | ||
* ProQuest Federated Search Gateway Record Controller | ||
* | ||
* @category VuFind | ||
* @package Controller | ||
* @author Demian Katz <[email protected]> | ||
* @author Maccabee Levine <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org Main Site | ||
*/ | ||
class ProQuestFSGrecordController extends AbstractRecord | ||
{ | ||
/** | ||
* Constructor | ||
* | ||
* @param ServiceLocatorInterface $sm Service locator | ||
*/ | ||
public function __construct(ServiceLocatorInterface $sm) | ||
{ | ||
// Override some defaults: | ||
$this->sourceId = 'ProQuestFSG'; | ||
|
||
// Call standard record controller initialization: | ||
parent::__construct($sm); | ||
} | ||
|
||
/** | ||
* Is the result scroller active? | ||
* | ||
* @return bool | ||
*/ | ||
protected function resultScrollerActive() | ||
{ | ||
$config = $this->getService(\VuFind\Config\PluginManager::class)->get('ProQuestFSG'); | ||
return $config->Record->next_prev_navigation ?? false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we probably need to add the result_limit setting here to limit the depth at which users can paginate into the results. If I try to jump to the end of a long result set, it loads for a long time and finally fails with: