Skip to content

Commit

Permalink
Merge branch '24.05.00' into 24.06.00
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed May 12, 2024
2 parents 35f7134 + 1498b7c commit 39915ac
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
Binary file modified code/reindexer/reindexer.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,20 @@ public LinkedHashSet<FormatInfo> getFormatsForRecord(org.marc4j.marc.Record reco
}
}

/**
* Retrieve a format from the specified fallback field. This is untranslated because it gets translated later.
*
* @param record
* @param printFormats
* @param settings
*/
protected void getFormatFromFallbackField(org.marc4j.marc.Record record, LinkedHashSet<String> printFormats, BaseIndexingSettings settings) {
if (settings instanceof IndexingProfile) {
IndexingProfile indexingProfile = (IndexingProfile)settings;
Set<String> fields = MarcUtil.getFieldList(record, indexingProfile.getFallbackFormatField());
for (String curField : fields) {
if (indexingProfile.hasTranslation("format", curField.toLowerCase())) {
printFormats.add(indexingProfile.translateValue("format", curField));
printFormats.add( curField);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public LinkedHashSet<FormatInfo> getFormatsForRecord(org.marc4j.marc.Record reco
if (settings instanceof IndexingProfile) {
IndexingProfile profile = (IndexingProfile) settings;
String formatLower = format.toLowerCase();
if (profile.hasTranslation("format", formatLower)) {
formatInfo.format = profile.translateValue("format", formatLower);
}
if (profile.hasTranslation("format_category", formatLower)) {
formatInfo.formatCategory = profile.translateValue("format_category", formatLower);
}else{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import com.turning_leaf_technologies.marc.MarcUtil;
import com.turning_leaf_technologies.strings.AspenStringUtils;
import org.apache.logging.log4j.Logger;
import org.aspen_discovery.format_classification.IIIRecordFormatClassifier;
import org.aspen_discovery.format_classification.IlsRecordFormatClassifier;
import org.aspen_discovery.format_classification.KohaRecordFormatClassifier;
import org.aspen_discovery.format_classification.NashvilleRecordFormatClassifier;
import org.marc4j.marc.*;

import java.sql.Connection;
Expand Down Expand Up @@ -54,6 +58,22 @@ abstract class IlsRecordProcessor extends MarcRecordProcessor {
super.settings = this.settings;
profileType = indexingProfileRS.getString("name");

//Setup format classifier
switch (settings.getIndexingClass()) {
case "III":
formatClassifier = new IIIRecordFormatClassifier(logger);
break;
case "Koha":
formatClassifier = new KohaRecordFormatClassifier(logger);
break;
case "NashvilleCarlX":
formatClassifier = new NashvilleRecordFormatClassifier(logger);
break;
default:
formatClassifier = new IlsRecordFormatClassifier(logger);
break;
}

try {
String pattern = indexingProfileRS.getString("nonHoldableITypes");
if (pattern != null && !pattern.isEmpty()) {
Expand Down Expand Up @@ -1628,7 +1648,8 @@ public void loadPrintFormatInformation(RecordInfo recordInfo, org.marc4j.marc.Re
largePrintCheck(recordInfo, record);
return;
}
} if (recordInfo.hasItemFormats() && !recordInfo.allItemsHaveFormats()){
}
if (recordInfo.hasItemFormats() && !recordInfo.allItemsHaveFormats()){
//We're doing bib level formats, but we got some item level formats (probably eContent or something)
loadPrintFormatFromBib(recordInfo, record);
for (ItemInfo itemInfo : recordInfo.getRelatedItems()){
Expand Down
4 changes: 3 additions & 1 deletion sites/template.linux/conf/crontab_settings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,6 @@
######################################
# Run Clam AV Scans #
######################################
00 3 * * * root truncate -s0 /var/log/aspen-discovery/clam_av.log; /bin/clamscan --recursive=yes --quiet -i --exclude-dir=/var/lib/mysql --exclude-dir=/sys --exclude-dir=/data/aspen-discovery/{sitename}/solr7/ --exclude-dir=/var/log/aspen-discovery/{sitename} --exclude-dir=/data/aspen-discovery/{sitename}/covers/small --exclude-dir=/data/aspen-discovery/{sitename}/covers/medium --exclude-dir=/data/aspen-discovery/{sitename}/covers/large --log=/var/log/aspen-discovery/clam_av.log
00 3 * * * root truncate -s0 /var/log/aspen-discovery/clam_av.log; /bin/clamscan --recursive=yes --quiet -i --exclude-dir=/var/lib/mysql --exclude-dir=/sys --exclude-dir=/data/aspen-discovery/{sitename}/solr7/ --exclude-dir=/var/log/aspen-discovery/{sitename} --exclude-dir=/data/aspen-discovery/{sitename}/covers/small --exclude-dir=/data/aspen-discovery/{sitename}/covers/medium --exclude-dir=/data/aspen-discovery/{sitename}/covers/large --log=/var/log/aspen-discovery/clam_av.log

# Debian needs a blank line at the end of cron, make sure to add additional cron lines above this.

0 comments on commit 39915ac

Please sign in to comment.