From 434b9a7851bbb973a5cb194058b4c81667cefba7 Mon Sep 17 00:00:00 2001 From: Alexander Blanchard Date: Thu, 14 Nov 2024 23:51:22 +0000 Subject: [PATCH] feat: Add Functions To IndexingProfiles.java --- .../indexing/IndexingProfile.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/java_shared_libraries/src/com/turning_leaf_technologies/indexing/IndexingProfile.java b/code/java_shared_libraries/src/com/turning_leaf_technologies/indexing/IndexingProfile.java index 3c58dae81d..a6bdeba3b6 100644 --- a/code/java_shared_libraries/src/com/turning_leaf_technologies/indexing/IndexingProfile.java +++ b/code/java_shared_libraries/src/com/turning_leaf_technologies/indexing/IndexingProfile.java @@ -75,6 +75,7 @@ public class IndexingProfile extends BaseIndexingSettings { private long lastUpdateOfAuthorities; private long lastChangeProcessed; private Pattern suppressRecordsWithUrlsMatching; + private Pattern treatItemsAsEcontent; private String fallbackFormatField; private boolean processRecordLinking; private int evergreenOrgUnitSchema; @@ -194,6 +195,7 @@ public IndexingProfile(String serverName, ResultSet indexingProfileRS, Connectio this.setDoAutomaticEcontentSuppression(indexingProfileRS.getBoolean("doAutomaticEcontentSuppression")); this.setSuppressRecordsWithUrlsMatching(indexingProfileRS.getString("suppressRecordsWithUrlsMatching")); + this.setTreatItemsAsEcontent(indexingProfileRS.getString("treatItemsAsEcontent")); this.setEContentDescriptor(getCharFromRecordSet(indexingProfileRS, "eContentDescriptor")); this.setLastYearCheckoutsSubfield(getCharFromRecordSet(indexingProfileRS, "lastYearCheckouts")); @@ -892,10 +894,22 @@ public void setSuppressRecordsWithUrlsMatching(String suppressRecordsWithUrlsMat } } + public void setTreatItemsAsEcontent(String treatItemsAsEcontent) { + if (treatItemsAsEcontent.isEmpty()){ + this.treatItemsAsEcontent = null; + } else { + this.treatItemsAsEcontent = Pattern.compile(treatItemsAsEcontent, Pattern.CASE_INSENSITIVE); + } + } + public Pattern getSuppressRecordsWithUrlsMatching() { return suppressRecordsWithUrlsMatching; } + public Pattern getTreatItemsAsEcontent() { + return treatItemsAsEcontent; + } + public void setFallbackFormatField(String fallbackFormatField) { this.fallbackFormatField = fallbackFormatField; }