Skip to content

Commit

Permalink
Allow determination of format to take into account both Collection Co…
Browse files Browse the repository at this point in the history
…de and the translated Collection
  • Loading branch information
mdnoble73 committed May 15, 2024
1 parent 6b2ec93 commit 4f7efec
Show file tree
Hide file tree
Showing 24 changed files with 34 additions and 6 deletions.
Binary file modified code/axis_360_export/axis_360_export.jar
Binary file not shown.
Binary file modified code/carlx_export/carlx_export.jar
Binary file not shown.
Binary file modified code/cloud_library_export/cloud_library_export.jar
Binary file not shown.
Binary file modified code/course_reserves_indexer/course_reserves_indexer.jar
Binary file not shown.
Binary file modified code/cron/cron.jar
Binary file not shown.
Binary file modified code/events_indexer/events_indexer.jar
Binary file not shown.
Binary file modified code/evergreen_export/evergreen_export.jar
Binary file not shown.
Binary file modified code/evolve_export/evolve_export.jar
Binary file not shown.
Binary file modified code/hoopla_export/hoopla_export.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ private void loadTranslationMaps(Connection dbConn, BaseIndexingLogEntry logEntr
String value = mapValuesRS.getString("value");
String translation = mapValuesRS.getString("translation");

translationMap.put(value, translation);
translationMap.put(value.toLowerCase(), translation);
}
mapValuesRS.close();
if (translationMaps.containsKey(mapName)) {
Expand All @@ -370,12 +370,20 @@ private void loadTranslationMaps(Connection dbConn, BaseIndexingLogEntry logEntr
}else{
translationMaps.put("format_category", formatCategoryMap);
}
HashMap <String, String> formatBoostMap = new HashMap<>();
if (translationMaps.containsKey("format_boost")) {
formatBoostMap = translationMaps.get("format_boost");
}else{
translationMaps.put("format_boost", formatBoostMap);
}

translationMaps.put("format_category", formatCategoryMap);
while (formatMapRS.next()){
String format = formatMapRS.getString("value");
formatMap.put(format.toLowerCase(), formatMapRS.getString("format"));
formatCategoryMap.put(format.toLowerCase(), formatMapRS.getString("formatCategory"));
String formatLower = format.toLowerCase();
formatMap.put(formatLower, formatMapRS.getString("format"));
formatCategoryMap.put(formatLower, formatMapRS.getString("formatCategory"));
formatBoostMap.put(formatLower, formatMapRS.getString("formatBoost"));
}
formatMapRS.close();
}catch (Exception e){
Expand Down
Binary file modified code/koha_export/koha_export.jar
Binary file not shown.
Binary file modified code/oai_indexer/oai_indexer.jar
Binary file not shown.
Binary file modified code/overdrive_extract/overdrive_extract.jar
Binary file not shown.
Binary file modified code/palace_project_export/palace_project_export.jar
Binary file not shown.
Binary file modified code/polaris_export/polaris_export.jar
Binary file not shown.
Binary file modified code/reindexer/reindexer.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,31 @@ public FormatInfo getFormatInfoForItem(DataField itemField, BaseIndexingSettings
if (!foundFormatFromShelfLocation && !foundFormatFromSublocation && collectionCode != null) {
collectionCode = collectionCode.toLowerCase().trim();
if (profile.hasTranslation("format", collectionCode)) {
String translatedLocation = profile.translateValue("format", collectionCode);
if (translatedLocation != null && !translatedLocation.isEmpty()) {
String translatedFormat = profile.translateValue("format", collectionCode);
if (translatedFormat != null && !translatedFormat.isEmpty()) {
foundFormatFromCollection = true;
formatInfo.format = translatedLocation;
formatInfo.format = translatedFormat;
formatInfo.formatCategory = profile.translateValue("format_category", collectionCode);
if (profile.hasTranslation("format_boost", collectionCode)) {
formatBoost = profile.translateValue("format_boost", collectionCode);
}
}
}else{
//Check to see if the translated collection code is used
if (profile.hasTranslation("collection", collectionCode)) {
String translatedCollection = profile.translateValue("collection", collectionCode);
if (profile.hasTranslation("format", translatedCollection)) {
String translatedFormat = profile.translateValue("format", translatedCollection);
if (translatedFormat != null && !translatedFormat.isEmpty()) {
foundFormatFromCollection = true;
formatInfo.format = translatedFormat;
formatInfo.formatCategory = profile.translateValue("format_category", translatedCollection);
if (profile.hasTranslation("format_boost", translatedCollection)) {
formatBoost = profile.translateValue("format_boost", translatedCollection);
}
}
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ public void setGroupingCategory(String groupingCategory) {
groupingCategory = groupingCategory.toLowerCase();
if (!validCategories.matcher(groupingCategory).matches()) {
logEntry.incErrors("Invalid grouping category " + groupingCategory);
this.groupingCategory = "other";
}else {
this.groupingCategory = groupingCategory;
}
Expand Down
Binary file modified code/sideload_processing/sideload_processing.jar
Binary file not shown.
Binary file modified code/sierra_export_api/sierra_export_api.jar
Binary file not shown.
Binary file modified code/symphony_export/symphony_export.jar
Binary file not shown.
Binary file modified code/user_list_indexer/user_list_indexer.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions code/web/release_notes/24.05.01.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
- Load all default formats prior to loading custom format map for an indexing profile to ensure default values are available when translating values. (Ticket 132034) (*MDN*)
- Add Manga to default format maps. (*MDN*)

### Koha Updates
- Allow determination of format to take into account both Collection Code and the translated Collection. (Tickets 132079, 130358) (*MDN*)

## This release includes code contributions from
- ByWater Solutions
- Mark Noble (MDN)
Binary file modified code/web_indexer/web_indexer.jar
Binary file not shown.

0 comments on commit 4f7efec

Please sign in to comment.