From c72b50ec56600b050f9dbf00c7712c94c96afe6a Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Thu, 17 Oct 2024 08:50:53 -0600 Subject: [PATCH] DIS-36 CloudSource integration --- code/web/Drivers/marmot_inc/SearchSources.php | 14 ++++++++++ code/web/release_notes/24.10.10.MD | 18 ++++++++++++ .../version_updates/24.10.10.php | 27 ++++++++++++++++++ code/web/sys/LibraryLocation/Library.php | 28 +++++++++++++++++++ code/web/sys/LibraryLocation/Location.php | 10 +++++++ 5 files changed, 97 insertions(+) create mode 100644 code/web/release_notes/24.10.10.MD create mode 100644 code/web/sys/DBMaintenance/version_updates/24.10.10.php diff --git a/code/web/Drivers/marmot_inc/SearchSources.php b/code/web/Drivers/marmot_inc/SearchSources.php index 999b9aed64..0779ea0320 100644 --- a/code/web/Drivers/marmot_inc/SearchSources.php +++ b/code/web/Drivers/marmot_inc/SearchSources.php @@ -70,6 +70,7 @@ private static function getSearchSourcesDefault() { $repeatSearchSetting = $location->repeatSearchOption; $repeatInWorldCat = $location->repeatInWorldCat == 1; $repeatInInnReach = $location->repeatInInnReach == 1; + $repeatInCloudSource = $location->repeatInCloudSource == 1; if (strlen($location->systemsToRepeatIn) > 0) { $systemsToRepeatIn = explode('|', $location->systemsToRepeatIn); } else { @@ -79,6 +80,7 @@ private static function getSearchSourcesDefault() { $repeatSearchSetting = $library->repeatSearchOption; $repeatInWorldCat = $library->repeatInWorldCat == 1; $repeatInInnReach = $library->repeatInInnReach == 1; + $repeatInCloudSource = $library->repeatInCloudSource == 1; $systemsToRepeatIn = explode('|', $library->systemsToRepeatIn); } @@ -302,6 +304,16 @@ private static function getSearchSourcesDefault() { ]; } + if ($repeatInCloudSource) { + $searchOptions['cloudSource'] = [ + 'name' => 'CloudSource', + 'description' => "Open Articles, eBooks, eTextBooks, and more from CloudSource.", + 'external' => true, + 'catalogType' => 'cloudSource', + 'hasAdvancedSearch' => false, + ]; + } + if ($repeatInInnReach) { $searchOptions['innReach'] = [ 'name' => $library->interLibraryLoanName, @@ -446,6 +458,8 @@ public function getExternalLink($searchSource, $type, $lookFor) : string { $baseUrl = substr($baseUrl, 0, strlen($baseUrl) -1); } return "$baseUrl/iii/encore/search/C|S" . $lookFor . "|Orightresult|U1?lang=eng&suite=def"; + } elseif ($searchSource == 'cloudSource') { + return $library->cloudSourceBaseUrl . '/search/results?qu=' . urlencode($lookFor) . '&te=1803299674&dt=list'; } elseif ($searchSource == 'amazon') { return "http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=" . urlencode($lookFor); } elseif ($searchSource == 'course-reserves-course-name') { diff --git a/code/web/release_notes/24.10.10.MD b/code/web/release_notes/24.10.10.MD new file mode 100644 index 0000000000..22d7bd7424 --- /dev/null +++ b/code/web/release_notes/24.10.10.MD @@ -0,0 +1,18 @@ +## Aspen Discovery Updates +### CloudSource Updates +- Allow repeating searches within [CloudSource](https://cloudsource.net) so open articles, eBooks, eTextbooks, and more can be searched. (DIS-36) + +
+ +#### New Settings +- Primary Configuration > Library Systems > CloudSource > Repeat In CloudSource +- Primary Configuration > Library Systems > CloudSource > CloudSource URL +- Primary Configuration > Library Systems > Locations > Searching > Search Box > Repeat In CloudSource +
+ +## This release includes code contributions from +- Grove For Libraries + - Mark Noble (MDN) + +## This release includes sponsored developments from +- CLEVNET \ No newline at end of file diff --git a/code/web/sys/DBMaintenance/version_updates/24.10.10.php b/code/web/sys/DBMaintenance/version_updates/24.10.10.php new file mode 100644 index 0000000000..2954a08407 --- /dev/null +++ b/code/web/sys/DBMaintenance/version_updates/24.10.10.php @@ -0,0 +1,27 @@ + [ + 'title' => '', + 'description' => '', + 'continueOnError' => false, + 'sql' => [ + '' + ] + ], //name*/ + + //mark - Grove + 'repeat_in_cloudsource' => [ + 'title' => 'Repeat in CloudSource', + 'description' => 'Add information to allow repeat in CloudSource to work properly.', + 'continueOnError' => true, + 'sql' => [ + 'ALTER TABLE library ADD COLUMN repeatInCloudSource TINYINT DEFAULT 0', + "ALTER TABLE library ADD COLUMN cloudSourceBaseUrl VARCHAR(255) DEFAULT ''", + 'ALTER TABLE location ADD COLUMN repeatInCloudSource TINYINT DEFAULT 0', + ], + ], + ]; +} \ No newline at end of file diff --git a/code/web/sys/LibraryLocation/Library.php b/code/web/sys/LibraryLocation/Library.php index 0039888db6..c757708b3d 100644 --- a/code/web/sys/LibraryLocation/Library.php +++ b/code/web/sys/LibraryLocation/Library.php @@ -161,6 +161,8 @@ class Library extends DataObject { $repeatInInnReach; public /** @noinspection PhpUnused */ $repeatInWorldCat; + public $repeatInCloudSource; + public $cloudSourceBaseUrl; public $overDriveScopeId; public $hooplaLibraryID; @@ -3750,6 +3752,32 @@ static function getObjectStructure($context = ''): array { ], ], ], + 'cloudSourceSection' => [ + 'property' => 'cloudSourceSection', + 'type' => 'section', + 'label' => 'CloudSource', + 'hideInLists' => true, + 'renderAsHeading' => true, + 'helpLink' => '', + 'properties' => [ + 'repeatInCloudSource' => [ + 'property' => 'repeatInCloudSource', + 'type' => 'checkbox', + 'label' => 'Repeat In CloudSource', + 'description' => 'Turn on to allow repeat search in CloudSource functionality.', + 'hideInLists' => true, + ], + 'cloudSourceBaseUrl' => [ + 'property' => 'cloudSourceBaseUrl', + 'type' => 'text', + 'label' => 'CloudSource URL', + 'description' => 'The base CloudSource URL to use while searching.', + 'note' => 'Will be similar to https://csclient2.ent.sirsi.net/client/en_US/{customer_name}.', + 'hideInLists' => true, + 'size' => '255', + ], + ], + ], 'hooplaSection' => [ 'property' => 'hooplaSection', 'type' => 'section', diff --git a/code/web/sys/LibraryLocation/Location.php b/code/web/sys/LibraryLocation/Location.php index 10d98ff24b..7e4595d9e6 100644 --- a/code/web/sys/LibraryLocation/Location.php +++ b/code/web/sys/LibraryLocation/Location.php @@ -94,6 +94,7 @@ class Location extends DataObject { public $repeatInOnlineCollection; public $repeatInInnReach; public $repeatInWorldCat; + public $repeatInCloudSource; public $vdxFormId; public $vdxLocation; public $systemsToRepeatIn; @@ -162,6 +163,7 @@ function getNumericColumnNames(): array { 'repeatInOnlineCollection', 'repeatInInnReach', 'repeatInWorldCat', + 'repeatInCloudSource', 'showEmailThis', 'showShareOnExternalSites', 'showFavorites', @@ -895,6 +897,14 @@ static function getObjectStructure($context = ''): array { 'hideInLists' => true, 'default' => false, ], + [ + 'property' => 'repeatInCloudSource', + 'type' => 'checkbox', + 'label' => 'Repeat In CloudSource', + 'description' => 'Turn on to allow repeat search in CloudSource functionality.', + 'hideInLists' => true, + 'default' => false, + ], ], ], [