Skip to content

Commit

Permalink
DIS-36 CloudSource integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Oct 17, 2024
1 parent 3e4583c commit c72b50e
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 0 deletions.
14 changes: 14 additions & 0 deletions code/web/Drivers/marmot_inc/SearchSources.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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') {
Expand Down
18 changes: 18 additions & 0 deletions code/web/release_notes/24.10.10.MD
Original file line number Diff line number Diff line change
@@ -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)

<div markdown="1" class="settings">

#### 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
</div>

## This release includes code contributions from
- Grove For Libraries
- Mark Noble (MDN)

## This release includes sponsored developments from
- CLEVNET
27 changes: 27 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.10.10.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

function getUpdates24_10_10(): array {
$curTime = time();
return [
/*'name' => [
'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',
],
],
];
}
28 changes: 28 additions & 0 deletions code/web/sys/LibraryLocation/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ class Library extends DataObject {
$repeatInInnReach;
public /** @noinspection PhpUnused */
$repeatInWorldCat;
public $repeatInCloudSource;
public $cloudSourceBaseUrl;
public $overDriveScopeId;

public $hooplaLibraryID;
Expand Down Expand Up @@ -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',
Expand Down
10 changes: 10 additions & 0 deletions code/web/sys/LibraryLocation/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class Location extends DataObject {
public $repeatInOnlineCollection;
public $repeatInInnReach;
public $repeatInWorldCat;
public $repeatInCloudSource;
public $vdxFormId;
public $vdxLocation;
public $systemsToRepeatIn;
Expand Down Expand Up @@ -162,6 +163,7 @@ function getNumericColumnNames(): array {
'repeatInOnlineCollection',
'repeatInInnReach',
'repeatInWorldCat',
'repeatInCloudSource',
'showEmailThis',
'showShareOnExternalSites',
'showFavorites',
Expand Down Expand Up @@ -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,
],
],
],
[
Expand Down

0 comments on commit c72b50e

Please sign in to comment.