Skip to content

Commit 8d511d6

Browse files
Merge pull request #11 from AtlasSystems/feature/33859/UpdateSiteCodeDocumentation
Feature/33859/update site code documentation
2 parents bb15f15 + 79b1b5a commit 8d511d6

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Catalog.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ settings.AutoRetrieveItems = GetSetting("AutoRetrieveItems");
1010
settings.RemoveTrailingSpecialCharacters = GetSetting("RemoveTrailingSpecialCharacters");
1111
settings.AlmaApiUrl = GetSetting("AlmaAPIURL");
1212
settings.AlmaApiKey = GetSetting("AlmaAPIKey");
13-
settings.PrimoSiteCode = GetSetting("PrimoSiteCode");
13+
settings.PrimoCode = GetSetting("PrimoCode");
1414
settings.IdSuffix = GetSetting("IdSuffix");
1515

1616
local interfaceMngr = nil;
@@ -252,13 +252,13 @@ function PerformSearch(searchInfo)
252252
end
253253

254254
local searchUrl = "";
255-
local encodedSiteCode = Utility.URLEncode(settings.PrimoSiteCode):gsub("%%", "%%%%");
255+
local encodedSiteCode = Utility.URLEncode(settings.PrimoCode):gsub("%%", "%%%%");
256256
local encodedSearchType = Utility.URLEncode(DataMapping.SearchTypes[searchInfo[1]]["PrimoField"]):gsub("%%", "%%%%");
257257
local encodedSearchTerm = Utility.URLEncode(searchTerm):gsub("%%", "%%%%");
258258

259259
--Construct the search url based on the base catalog url and search style.
260260
searchUrl = settings.CatalogUrl .. DataMapping.SearchStyleUrls[searchInfo[2]]
261-
:gsub("{PrimoSiteCode}", encodedSiteCode)
261+
:gsub("{PrimoCode}", encodedSiteCode)
262262
:gsub("{SearchType}", encodedSearchType)
263263
:gsub("{SearchTerm}", encodedSearchTerm);
264264

Config.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
33
<Name>Alma Primo Definitive Catalog Search</Name>
44
<Author>Atlas Systems</Author>
5-
<Version>1.2.2</Version>
5+
<Version>2.0.0</Version>
66
<Active>True</Active>
77
<Type>Addon</Type>
88
<Description>Catalog Search and Import Addon that uses Alma as the catalog and Primo or Primo VE as the discovery layer.</Description>
@@ -39,8 +39,8 @@
3939
<Setting name="AlmaAPIKey" value="" type="string">
4040
<Description>API key used for interacting with the Alma API.</Description>
4141
</Setting>
42-
<Setting name="PrimoSiteCode" value="" type="string">
43-
<Description>The code that identifies the site in Primo Deep Links. Ex: vid={PrimoSiteCode}</Description>
42+
<Setting name="PrimoCode" value="" type="string">
43+
<Description>For Primo, the Primo Site Code that identifies the site in Primo Deep Links. Ex: vid={Primo Site Code} For Primo VE, the Primo View Code (including the colon) is also included in this setting. Ex: vid={Primo Site Code}:{Primo View Code}</Description>
4444
</Setting>
4545
<Setting name="IdSuffix" value="" type="string">
4646
<Description>The last four digits of MMS IDs and IE IDs for your institution. This setting is required and should not be left blank.</Description>

DataMapping.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ DataMapping.SearchTypes["Catalog Number"] = {
111111
-- Words in brackets will be replaced by their corresponding settings or values by the addon.
112112
-- Only one Query and one Browse style URL may be defined. These will be concatenated to the
113113
-- end of the CatalogUrl setting when searching.
114-
DataMapping.SearchStyleUrls["Query"] = "search?vid={PrimoSiteCode}&query={SearchType},contains,{SearchTerm},AND&tab=books&search_scope=default_scope&mode=advanced";
115-
DataMapping.SearchStyleUrls["Browse"] = "browse?vid={PrimoSiteCode}&browseQuery={SearchTerm}&browseScope={SearchType}&innerPnxIndex=-1&numOfUsedTerms=-1&fn=BrowseSearch";
114+
DataMapping.SearchStyleUrls["Query"] = "search?vid={PrimoCode}&query={SearchType},contains,{SearchTerm},AND&tab=books&search_scope=default_scope&mode=advanced";
115+
DataMapping.SearchStyleUrls["Browse"] = "browse?vid={PrimoCode}&browseQuery={SearchTerm}&browseScope={SearchType}&innerPnxIndex=-1&numOfUsedTerms=-1&fn=BrowseSearch";
116116

117117
-- Source Fields: Aeon
118118
-- Only necessary for source fields not associated with a SearchType. To define source fields used in searches,

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The addon is located within an request or item record of an Atlas Product. It is
1515

1616
> **CatalogURL:** The base URL that the query strings are appended to. The Catalog URL structure is `{URL of the catalog}/primo-explore/` for Primo and `{URL of the catalog}/discovery/` for Primo VE.
1717
>
18-
> **HomeURL:** Home page of the catalog. The Home URL structure is `{URL of the catalog}/primo-explore/search?vid={Primo Site Code}` for Primo and `{URL of the catalog}/discovery/search?vid={Primo Site Code}` for Primo VE.
18+
> **HomeURL:** Home page of the catalog. The Home URL structure is `{URL of the catalog}/primo-explore/search?vid={Primo Site Code}` for Primo and `{URL of the catalog}/discovery/search?vid={Primo Site Code}:{Primo View Code}` for Primo VE.
1919
>
2020
> **AutoSearch:** Defines whether the search should be automatically performed when the form opens. *Default: `true`*
2121
>
@@ -34,7 +34,7 @@ The addon is located within an request or item record of an Atlas Product. It is
3434
>
3535
>**AlmaAPIKey:** API key used for interacting with the Alma API.
3636
>
37-
>**PrimoSiteCode:** The code that identifies the site in Primo Deep Links. Ex: vid={PrimoSiteCode}
37+
>**PrimoCode:** For Primo, the Primo Site Code that identifies the site in Primo Deep Links. Ex: `vid={Primo Site Code}` For Primo VE, the Primo View Code (including the colon) is also included in this setting. Ex: `vid={Primo Site Code}:{Primo View Code}`
3838
>
3939
>**IdSuffix:** The last four digits of MMS IDs and IE IDs for your institution. These can be found in the URL of any record opened from the results list. This setting is required and should not be left blank.
4040
@@ -69,8 +69,8 @@ Below are the default configurations for the catalog addon. The mappings within
6969
### SearchTypes
7070
The search URL is constructed using the formulas defined in *DataMapping.SearchStyleUrls["Query"]* and *DataMapping.SearchStyleUrls["Browse"]*. The default configurations are as follows:
7171

72-
>Query: *`{Catalog URL}`search?vid=`{Primo Site Code}`&query=`{Search Type}`,contains,`{Search Term}`AND&search_scope=default_scope&mode=advanced*
73-
>Browse: *`{Catalog URL}`browse?vid=`{Primo Site Code}`&browseQuery=`{Search Term}`&browseScope=`{Search Type}`&innerPnxIndex=-1&numOfUsedTerms=-1&fn=BrowseSearch"*
72+
>Query: *`{CatalogURL}`search?vid=`{PrimoCode}`&query=`{SearchType}`,contains,`{SearchTerm}`AND&search_scope=default_scope&mode=advanced*
73+
>Browse: *`{CatalogURL}`browse?vid=`{PrimoCode}`&browseQuery=`{SearchTerm}`&browseScope=`{SearchType}`&innerPnxIndex=-1&numOfUsedTerms=-1&fn=BrowseSearch"*
7474
7575
*Default SearchTypes Configuration:*
7676

0 commit comments

Comments
 (0)