diff --git a/code/palace_project_export/palace_project_export.jar b/code/palace_project_export/palace_project_export.jar index e6d29a4ea4..5d009a1bd3 100644 Binary files a/code/palace_project_export/palace_project_export.jar and b/code/palace_project_export/palace_project_export.jar differ diff --git a/code/palace_project_export/src/org/aspendiscovery/palace_project/PalaceProjectExportMain.java b/code/palace_project_export/src/org/aspendiscovery/palace_project/PalaceProjectExportMain.java index cc40d1f26b..5f2127f9a0 100644 --- a/code/palace_project_export/src/org/aspendiscovery/palace_project/PalaceProjectExportMain.java +++ b/code/palace_project_export/src/org/aspendiscovery/palace_project/PalaceProjectExportMain.java @@ -366,7 +366,7 @@ private static void setLastUpdateTimeForSetting(boolean doFullReload, long setti } } - private static SimpleDateFormat dateModifiedFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); + private static final SimpleDateFormat dateModifiedFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); private static void extractRecordsForPalaceProjectCollection(String collectionName, HashMap validCollections, HashMap headers, PalaceProjectCollection collection, HashMap titlesForCollection, boolean doFullReload, long indexStartTime) { logEntry.addNote("Extracting Records for " + collectionName + " in setting " + collection.settingId); //Index all records in the collection diff --git a/code/reindexer/reindexer.jar b/code/reindexer/reindexer.jar index 0c891fd5f4..db6ce778de 100644 Binary files a/code/reindexer/reindexer.jar and b/code/reindexer/reindexer.jar differ diff --git a/code/reindexer/src/org/aspen_discovery/grouping/BaseMarcRecordGrouper.java b/code/reindexer/src/org/aspen_discovery/grouping/BaseMarcRecordGrouper.java index 3789eda029..8eb35c4852 100644 --- a/code/reindexer/src/org/aspen_discovery/grouping/BaseMarcRecordGrouper.java +++ b/code/reindexer/src/org/aspen_discovery/grouping/BaseMarcRecordGrouper.java @@ -93,8 +93,12 @@ String setGroupingCategoryForWork(Record marcRecord, GroupedWork workForTitle) { switch (baseSettings.getFormatSource()) { case "bib": String format = formatClassifier.getFirstFormatFromBib(marcRecord, baseSettings); - if (formatsToFormatCategory.containsKey(format.toLowerCase())) { - groupingFormat = categoryMap.getOrDefault(formatsToFormatCategory.get(format.toLowerCase()), "other"); + String formatLower = format.toLowerCase(); + if (formatLower.contains("graphic novel") || (formatLower.contains("comic") && !formatLower.contains("ecomic")) || formatLower.contains("manga")) { + formatLower = "graphic novel"; + } + if (formatsToFormatCategory.containsKey(formatLower)) { + groupingFormat = categoryMap.getOrDefault(formatsToFormatCategory.get(formatLower), "other"); }else{ groupingFormat = "book"; } diff --git a/code/reindexer/src/org/aspen_discovery/grouping/RecordGroupingProcessor.java b/code/reindexer/src/org/aspen_discovery/grouping/RecordGroupingProcessor.java index 15fd88536d..a00e50afae 100644 --- a/code/reindexer/src/org/aspen_discovery/grouping/RecordGroupingProcessor.java +++ b/code/reindexer/src/org/aspen_discovery/grouping/RecordGroupingProcessor.java @@ -687,6 +687,7 @@ public String processRecord(RecordIdentifier primaryIdentifier, String title, St formatsToFormatCategory.put("xps", "ebook"); formatsToFormatCategory.put("bingepass", "other"); formatsToFormatCategory.put("graphicnovel", "comic"); + formatsToFormatCategory.put("graphic novel", "comic"); formatsToFormatCategory.put("manga", "comic"); formatsToFormatCategory.put("comic", "comic"); } diff --git a/code/reindexer/src/org/aspen_discovery/reindexer/PalaceProjectProcessor.java b/code/reindexer/src/org/aspen_discovery/reindexer/PalaceProjectProcessor.java index 351dbb2317..b1e57ed7d1 100644 --- a/code/reindexer/src/org/aspen_discovery/reindexer/PalaceProjectProcessor.java +++ b/code/reindexer/src/org/aspen_discovery/reindexer/PalaceProjectProcessor.java @@ -281,68 +281,71 @@ void processRecord(AbstractGroupedWorkSolr groupedWork, String identifier, BaseI while (collectionsForTitleRS.next()) { long collectionId = collectionsForTitleRS.getLong("collectionId"); PalaceProjectCollection collection = allCollections.get(collectionId); - String collectionName = collection.displayName; - ItemInfo itemInfo = new ItemInfo(); - itemInfo.setItemIdentifier(identifier); - itemInfo.seteContentSource(collectionName); - itemInfo.setIsEContent(true); - itemInfo.seteContentUrl(contentUrl); - itemInfo.setShelfLocation("Online " + collectionName); - itemInfo.setDetailedLocation("Online " + collectionName); - itemInfo.setCallNumber("Online " + collectionName); - itemInfo.setSortableCallNumber("Online " + collectionName); - itemInfo.setFormat(primaryFormat); - itemInfo.setFormatCategory(formatCategory); - //Palace Project does not currently provide more info so can't give accurate number of copies, but we can tell if it's available or not - itemInfo.setNumCopies(1); - itemInfo.setAvailable(available); - itemInfo.setDetailedStatus("Available Online"); - itemInfo.setGroupedStatus("Available Online"); - itemInfo.setHoldable(false); - itemInfo.setInLibraryUseOnly(false); + //Collection will sometimes be null if the collection is deleted + if (collection != null) { + String collectionName = collection.displayName; + ItemInfo itemInfo = new ItemInfo(); + itemInfo.setItemIdentifier(identifier); + itemInfo.seteContentSource(collectionName); + itemInfo.setIsEContent(true); + itemInfo.seteContentUrl(contentUrl); + itemInfo.setShelfLocation("Online " + collectionName); + itemInfo.setDetailedLocation("Online " + collectionName); + itemInfo.setCallNumber("Online " + collectionName); + itemInfo.setSortableCallNumber("Online " + collectionName); + itemInfo.setFormat(primaryFormat); + itemInfo.setFormatCategory(formatCategory); + //Palace Project does not currently provide more info so can't give accurate number of copies, but we can tell if it's available or not + itemInfo.setNumCopies(1); + itemInfo.setAvailable(available); + itemInfo.setDetailedStatus("Available Online"); + itemInfo.setGroupedStatus("Available Online"); + itemInfo.setHoldable(false); + itemInfo.setInLibraryUseOnly(false); - Date dateAdded = new Date(productRS.getLong("dateFirstDetected") * 1000); - itemInfo.setDateAdded(dateAdded); + Date dateAdded = new Date(productRS.getLong("dateFirstDetected") * 1000); + itemInfo.setDateAdded(dateAdded); - boolean isTeen = audience.equals("Young Adult"); - boolean isKids = audience.equals("Juvenile"); - //Account for cases where audience is Unknown, General, etc - boolean isAdult = !isKids && !isTeen; + boolean isTeen = audience.equals("Young Adult"); + boolean isKids = audience.equals("Juvenile"); + //Account for cases where audience is Unknown, General, etc + boolean isAdult = !isKids && !isTeen; - for (Scope scope : indexer.getScopes()) { - boolean okToAdd; - PalaceProjectScope palaceProjectScope = scope.getPalaceProjectScope(); - if (palaceProjectScope != null) { - okToAdd = true; - }else{ - continue; - } - if (palaceProjectScope.getSettingId() != collection.settingId) { - okToAdd = false; - } - if (okToAdd) { - //Check based on the audience as well - okToAdd = false; - //noinspection RedundantIfStatement - if (isAdult && palaceProjectScope.isIncludeAdult()) { - okToAdd = true; - } - if (isTeen && palaceProjectScope.isIncludeTeen()) { + for (Scope scope : indexer.getScopes()) { + boolean okToAdd; + PalaceProjectScope palaceProjectScope = scope.getPalaceProjectScope(); + if (palaceProjectScope != null) { okToAdd = true; + } else { + continue; } - if (isKids && palaceProjectScope.isIncludeKids()) { - okToAdd = true; + if (palaceProjectScope.getSettingId() != collection.settingId) { + okToAdd = false; } if (okToAdd) { - ScopingInfo scopingInfo = itemInfo.addScope(scope); - groupedWork.addScopingInfo(scope.getScopeName(), scopingInfo); - scopingInfo.setLibraryOwned(true); - scopingInfo.setLocallyOwned(true); + //Check based on the audience as well + okToAdd = false; + //noinspection RedundantIfStatement + if (isAdult && palaceProjectScope.isIncludeAdult()) { + okToAdd = true; + } + if (isTeen && palaceProjectScope.isIncludeTeen()) { + okToAdd = true; + } + if (isKids && palaceProjectScope.isIncludeKids()) { + okToAdd = true; + } + if (okToAdd) { + ScopingInfo scopingInfo = itemInfo.addScope(scope); + groupedWork.addScopingInfo(scope.getScopeName(), scopingInfo); + scopingInfo.setLibraryOwned(true); + scopingInfo.setLocallyOwned(true); + } } } - } - palaceProjectRecord.addItem(itemInfo); + palaceProjectRecord.addItem(itemInfo); + } } } productRS.close();