getMetsAllowedPhysicalTypes() {
+ return getStringList("init.mets.physicalElementTypes.type");
+ }
/**
* Overrides values in the config file (for unit test purposes).
diff --git a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/Hotfolder.java b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/Hotfolder.java
index 16603310..3b3cbc4b 100644
--- a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/Hotfolder.java
+++ b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/Hotfolder.java
@@ -33,8 +33,6 @@
import java.util.concurrent.LinkedBlockingQueue;
import java.util.stream.Stream;
-import jakarta.mail.MessagingException;
-
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
@@ -49,6 +47,7 @@
import io.goobi.viewer.indexer.DenkXwebIndexer;
import io.goobi.viewer.indexer.DocUpdateIndexer;
import io.goobi.viewer.indexer.DublinCoreIndexer;
+import io.goobi.viewer.indexer.EadIndexer;
import io.goobi.viewer.indexer.Indexer;
import io.goobi.viewer.indexer.LidoIndexer;
import io.goobi.viewer.indexer.MetsIndexer;
@@ -65,6 +64,7 @@
import io.goobi.viewer.indexer.model.datarepository.DataRepository;
import io.goobi.viewer.indexer.model.datarepository.strategy.AbstractDataRepositoryStrategy;
import io.goobi.viewer.indexer.model.datarepository.strategy.IDataRepositoryStrategy;
+import jakarta.mail.MessagingException;
/**
*
@@ -90,6 +90,8 @@ public class Hotfolder {
private boolean metsEnabled = true;
/** Constant lidoEnabled=true
*/
private boolean lidoEnabled = true;
+ /** Constant eadEnabled=true
*/
+ private boolean eadEnabled = true;
/** Constant denkxwebEnabled=true
*/
private boolean denkxwebEnabled = true;
/** If no indexedDC folder is configured, Dublin Core indexing will be automatically disabled via this flag. */
@@ -295,6 +297,12 @@ void initFolders(String hotfolderPathString, Configuration config) throws FatalI
logger.warn(" not defined - LIDO indexing is disabled.");
}
+ // EAD folder
+ if (StringUtils.isEmpty(config.getConfiguration(DataRepository.PARAM_INDEXED_EAD))) {
+ eadEnabled = false;
+ logger.warn("<{}> not defined - EAD indexing is disabled.", DataRepository.PARAM_INDEXED_EAD);
+ }
+
// DenkXweb folders
if (StringUtils.isEmpty(config.getConfiguration(DataRepository.PARAM_INDEXED_DENKXWEB))) {
denkxwebEnabled = false;
@@ -542,7 +550,7 @@ public long countRecordFiles() {
*/
private void checkFreeSpace() throws FatalIndexerException {
// TODO alternate check if RemainingSpaceStrategy is selected
- int freeSpace = (int) (hotfolderPath.toFile().getFreeSpace() / 1048576);
+ long freeSpace = hotfolderPath.toFile().getFreeSpace() / 1048576;
logger.debug("Available storage space in hotfolder: {}M", freeSpace);
if (freeSpace < minStorageSpace) {
logger.error("Insufficient free space: {} / {} MB available. Indexer will now shut down.", freeSpace, minStorageSpace);
@@ -563,11 +571,11 @@ private void checkFreeSpace() throws FatalIndexerException {
* @throws FatalIndexerException
*/
private boolean handleSourceFile(Path sourceFile, boolean fromReindexQueue, Map reindexSettings) throws FatalIndexerException {
- logger.trace("handleSourceFile: {}", sourceFile);
+ logger.info("handleSourceFile: {}", sourceFile);
// Always unselect repository
String filename = sourceFile.getFileName().toString();
try {
- if (filename.endsWith(".xml")) {
+ if (StringUtils.endsWithIgnoreCase(filename, FileTools.XML_EXTENSION)) {
// INPUT o. UPDATE
if (Files.size(sourceFile) == 0) {
// Check whether the file is actually empty or just hasn't finished copying yet
@@ -626,6 +634,19 @@ private boolean handleSourceFile(Path sourceFile, boolean fromReindexQueue, Map<
Files.delete(sourceFile);
}
break;
+ case EAD:
+ if (eadEnabled) {
+ try {
+ currentIndexer = new EadIndexer(this);
+ currentIndexer.addToIndex(sourceFile, false, reindexSettings);
+ } finally {
+ currentIndexer = null;
+ }
+ } else {
+ logger.error("EAD indexing is disabled - please make sure all folders are configured.");
+ Files.delete(sourceFile);
+ }
+ break;
case DENKXWEB:
if (denkxwebEnabled) {
try {
@@ -777,6 +798,10 @@ private void removeFromIndex(Path deleteFile, DataRepository dataRepository, boo
actualXmlFile =
Paths.get(dataRepository.getDir(DataRepository.PARAM_INDEXED_LIDO).toAbsolutePath().toString(), baseFileName + ".xml");
}
+ if (!Files.exists(actualXmlFile) && dataRepository.getDir(DataRepository.PARAM_INDEXED_EAD) != null) {
+ actualXmlFile =
+ Paths.get(dataRepository.getDir(DataRepository.PARAM_INDEXED_EAD).toAbsolutePath().toString(), baseFileName + ".xml");
+ }
if (!Files.exists(actualXmlFile) && dataRepository.getDir(DataRepository.PARAM_INDEXED_DENKXWEB) != null) {
actualXmlFile =
Paths.get(dataRepository.getDir(DataRepository.PARAM_INDEXED_DENKXWEB).toAbsolutePath().toString(), baseFileName + ".xml");
@@ -807,6 +832,8 @@ private void removeFromIndex(Path deleteFile, DataRepository dataRepository, boo
format = FileFormat.METS;
} else if (deleteFile.getParent().equals(dataRepository.getDir(DataRepository.PARAM_INDEXED_LIDO))) {
format = FileFormat.LIDO;
+ } else if (deleteFile.getParent().equals(dataRepository.getDir(DataRepository.PARAM_INDEXED_EAD))) {
+ format = FileFormat.EAD;
} else if (deleteFile.getParent().equals(dataRepository.getDir(DataRepository.PARAM_INDEXED_DENKXWEB))) {
format = FileFormat.DENKXWEB;
} else if (deleteFile.getParent().equals(dataRepository.getDir(DataRepository.PARAM_INDEXED_DUBLINCORE))) {
@@ -835,6 +862,7 @@ private void removeFromIndex(Path deleteFile, DataRepository dataRepository, boo
case CMS:
case DENKXWEB:
case DUBLINCORE:
+ case EAD:
case LIDO:
case METS:
case METS_MARC:
diff --git a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/JDomXP.java b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/JDomXP.java
index 1b1085be..ffdb09ec 100644
--- a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/JDomXP.java
+++ b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/JDomXP.java
@@ -56,6 +56,7 @@ public enum FileFormat {
METS,
METS_MARC,
LIDO,
+ EAD,
DENKXWEB,
DUBLINCORE,
WORLDVIEWS,
@@ -76,6 +77,8 @@ public static FileFormat getByName(String name) {
return METS_MARC;
case "LIDO":
return LIDO;
+ case "EAD":
+ return EAD;
case "DENKXWEB":
return DENKXWEB;
case "DUBLINCORE":
@@ -356,8 +359,8 @@ public String evaluateToCdata(String expr, Object parent) {
* @should convert string to NFC
*/
public static String objectToString(Object object) {
- if (object instanceof Element element) {
- return TextHelper.normalizeSequence(element.getText());
+ if (object instanceof Element ele) {
+ return TextHelper.normalizeSequence(ele.getText());
} else if (object instanceof Attribute attr) {
return TextHelper.normalizeSequence(attr.getValue());
} else if (object instanceof Text text) {
@@ -564,6 +567,7 @@ public static boolean writeXmlFile(Document doc, String filePath) {
* @should detect mets mods files correctly
* @should detect mets marc files correctly
* @should detect lido files correctly
+ * @should detect ead files correctly
* @should detect denkxweb files correctly
* @should detect dublin core files correctly
* @should detect worldviews files correctly
@@ -588,6 +592,10 @@ public static FileFormat determineFileFormat(File file) throws IOException {
if (xp.doc.getRootElement().getNamespace("lido") != null) {
return FileFormat.LIDO;
}
+ if (xp.doc.getRootElement().getNamespace() != null
+ && xp.doc.getRootElement().getNamespace().getURI().equals("urn:isbn:1-931666-22-9")) {
+ return FileFormat.EAD;
+ }
if (xp.doc.getRootElement().getNamespace() != null
&& xp.doc.getRootElement().getNamespace().getURI().equals("http://denkxweb.de/")) {
return FileFormat.DENKXWEB;
diff --git a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/MetadataHelper.java b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/MetadataHelper.java
index 591f5962..60f42e93 100644
--- a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/MetadataHelper.java
+++ b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/MetadataHelper.java
@@ -44,6 +44,7 @@
import de.intranda.digiverso.normdataimporter.model.Record;
import io.goobi.viewer.indexer.SolrIndexerDaemon;
import io.goobi.viewer.indexer.exceptions.FatalIndexerException;
+import io.goobi.viewer.indexer.helper.JDomXP.FileFormat;
import io.goobi.viewer.indexer.helper.language.LanguageHelper;
import io.goobi.viewer.indexer.model.GeoCoords;
import io.goobi.viewer.indexer.model.GroupedMetadata;
@@ -169,21 +170,24 @@ public static List retrieveElementMetadata(Element element, String
case "first":
if (parent.getDmdid() != null) {
childrenAndAncestors.add(parent.getDmdid());
- } else {
- logger.warn(LOG_DMDID_NOT_FOUND, parent.getLogId());
+ } else if (FileFormat.METS.equals(indexObj.getSourceDocFormat())
+ || FileFormat.METS_MARC.equals(indexObj.getSourceDocFormat())) {
+ logger.warn(LOG_DMDID_NOT_FOUND, indexObj.getLogId());
}
break;
case "all":
if (parent.getDmdid() != null) {
childrenAndAncestors.add(parent.getDmdid());
- } else {
- logger.warn(LOG_DMDID_NOT_FOUND, parent.getLogId());
+ } else if (FileFormat.METS.equals(indexObj.getSourceDocFormat())
+ || FileFormat.METS_MARC.equals(indexObj.getSourceDocFormat())) {
+ logger.warn(LOG_DMDID_NOT_FOUND, indexObj.getLogId());
}
while (parent.getParent() != null && !parent.getParent().isAnchor()) {
parent = parent.getParent();
if (parent.getDmdid() != null) {
childrenAndAncestors.add(parent.getDmdid());
- } else {
+ } else if (FileFormat.METS.equals(indexObj.getSourceDocFormat())
+ || FileFormat.METS_MARC.equals(indexObj.getSourceDocFormat())) {
logger.warn(LOG_DMDID_NOT_FOUND, parent.getLogId());
}
}
@@ -195,7 +199,8 @@ public static List retrieveElementMetadata(Element element, String
Element eleMdWrap = xp.getMdWrap(dmdId);
if (eleMdWrap != null) {
elementsToIterateOver.add(eleMdWrap);
- } else {
+ } else if (FileFormat.METS.equals(indexObj.getSourceDocFormat())
+ || FileFormat.METS_MARC.equals(indexObj.getSourceDocFormat())) {
logger.warn("Field {}: mets:mdWrap section not found for DMDID {}", fieldName, dmdId);
}
}
@@ -762,8 +767,7 @@ public static String applyValueDefaultModifications(String fieldValue) {
* @return a {@link java.lang.String} object.
* @should trim identifier
* @should apply replace rules
- * @should replace spaces with underscores
- * @should replace commas with underscores
+ * @should replace illegal characters with underscores
*/
public static String applyIdentifierModifications(String pi) {
if (StringUtils.isEmpty(pi)) {
@@ -779,9 +783,7 @@ public static String applyIdentifierModifications(String pi) {
ret = MetadataHelper.applyReplaceRules(ret, replaceRules);
}
}
- ret = ret.replace(" ", "_");
- ret = ret.replace(",", "_");
- ret = ret.replace(":", "_");
+ ret = ret.replaceAll("[ ,:()]", "_");
return ret;
}
@@ -889,7 +891,7 @@ public static String[] getPIFromXML(String prefix, JDomXP xp) {
List piConfig =
SolrIndexerDaemon.getInstance().getConfiguration().getMetadataConfigurationManager().getConfigurationListForField(SolrConstants.PI);
if (piConfig == null) {
- return null;
+ return new String[] {};
}
List xPathConfigurations = piConfig.get(0).getxPathConfigurations();
@@ -906,7 +908,7 @@ public static String[] getPIFromXML(String prefix, JDomXP xp) {
}
}
if (StringUtils.isNotEmpty(pi)) {
- if (piConfig.get(0).isAddToDefault()) {
+ if (isPiAddToDefault(piConfig)) {
return new String[] { pi, "addToDefault" };
}
return new String[] { pi };
@@ -916,6 +918,19 @@ public static String[] getPIFromXML(String prefix, JDomXP xp) {
return new String[] {};
}
+ /**
+ *
+ * @param piConfig
+ * @return true if PI is configured to be added to DEFAULT; false otherwise
+ */
+ public static boolean isPiAddToDefault(List piConfig) {
+ if (piConfig == null || piConfig.isEmpty()) {
+ return false;
+ }
+
+ return piConfig.get(0).isAddToDefault();
+ }
+
/**
*
* @param centuries
@@ -1090,6 +1105,9 @@ static GroupedMetadata getGroupedMetadata(Element ele, GroupEntity groupEntity,
Map> collectedValues = new HashMap<>();
ret.collectGroupMetadataValues(collectedValues, groupEntity.getSubfields(), ele, authorityDataEnabled, null);
+ if (!groupEntity.getSubfields().containsKey(SolrConstants.MD_VALUE)) {
+ logger.warn("'{}' not configured for grouped metadata field '{}'.", SolrConstants.MD_VALUE, groupLabel);
+ }
String mdValue = null;
Map additionalFieldsFromParent = new HashMap<>();
diff --git a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/Utils.java b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/Utils.java
index 7d217da8..57a25203 100644
--- a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/Utils.java
+++ b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/Utils.java
@@ -20,7 +20,9 @@
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLDecoder;
+import java.net.URLEncoder;
import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -100,6 +102,8 @@ public class Utils {
private static final String MAIL_PROPERTY_SMTP_HOST = "mail.smtp.host";
private static final String MAIL_PROPERTY_SMTP_PORT = "mail.smtp.port";
+ private static final char[] PI_ILLEGAL_CHARS = { '!', '?', '/', '\\', ':', ';', '(', ')', '@', '"', '\'' };
+
/**
* Private constructor.
*/
@@ -584,7 +588,7 @@ protected PasswordAuthentication getPasswordAuthentication() {
* @return a {@link java.lang.String} object.
*/
public static String removeRecordImagesFromCache(String pi) {
- if (StringUtils.isEmpty(SolrIndexerDaemon.getInstance().getConfiguration().getViewerAuthorizationToken())) {
+ if (StringUtils.isEmpty(SolrIndexerDaemon.getInstance().getConfiguration().getViewerAuthorizationToken()) || pi == null) {
return null;
}
@@ -598,7 +602,7 @@ public static String removeRecordImagesFromCache(String pi) {
sbUrl.append('/');
}
sbUrl.append("api/v1/cache/")
- .append(pi)
+ .append(URLEncoder.encode(pi, StandardCharsets.UTF_8))
.append("?content=true&thumbs=true&pdf=true")
.append("&token=")
.append(SolrIndexerDaemon.getInstance().getConfiguration().getViewerAuthorizationToken());
@@ -850,4 +854,23 @@ static String adaptField(String fieldName, String prefix) {
return fieldName;
}
}
+
+ /**
+ *
+ * validatePi.
+ *
+ *
+ * @param pi a {@link java.lang.String} object.
+ * @should return true if pi good
+ * @should return false if pi empty, blank or null
+ * @should return false if pi contains illegal characters
+ * @return a boolean.
+ */
+ public static boolean validatePi(String pi) {
+ if (StringUtils.isBlank(pi)) {
+ return false;
+ }
+
+ return !StringUtils.containsAny(pi, PI_ILLEGAL_CHARS);
+ }
}
diff --git a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/language/LanguageHelper.java b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/language/LanguageHelper.java
index 42bba826..67bac8c3 100644
--- a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/language/LanguageHelper.java
+++ b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/helper/language/LanguageHelper.java
@@ -83,7 +83,7 @@ public Language getLanguage(String isoCode) {
} else if (isoCode.length() == 2) {
languageConfig = getConfig().configurationsAt("language[iso_639-1=\"" + isoCode + "\"]").get(0);
}
- } catch (Throwable e) {
+ } catch (Exception e) {
throw new IllegalArgumentException("No matching language found for " + isoCode, e);
}
if (languageConfig == null) {
diff --git a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/IndexObject.java b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/IndexObject.java
index 64d279e1..4f232d39 100644
--- a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/IndexObject.java
+++ b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/IndexObject.java
@@ -30,6 +30,7 @@
import org.jdom2.Element;
import io.goobi.viewer.indexer.SolrIndexerDaemon;
+import io.goobi.viewer.indexer.helper.JDomXP.FileFormat;
import io.goobi.viewer.indexer.helper.MetadataHelper;
import io.goobi.viewer.indexer.helper.SolrSearchIndex;
import io.goobi.viewer.indexer.model.SolrConstants.DocType;
@@ -53,6 +54,8 @@ public class IndexObject {
/** Timestamps of each indexing of this record. */
private final List dateIndexed = new ArrayList<>();
+ private DocType docType = DocType.DOCSTRCT;
+ private FileFormat sourceDocFormat;
private String dmdId;
private String logId;
private String type;
@@ -115,7 +118,7 @@ public void pushSimpleDataToLuceneArray() {
String iddocString = String.valueOf(iddoc);
addToLucene(SolrConstants.IDDOC, iddocString);
addToLucene(SolrConstants.GROUPFIELD, iddocString);
- addToLucene(SolrConstants.DOCTYPE, DocType.DOCSTRCT.name());
+ addToLucene(SolrConstants.DOCTYPE, docType.name());
addToLucene(SolrConstants.PI, pi);
addToLucene(SolrConstants.PI_TOPSTRUCT, topstructPI);
if (StringUtils.isNotEmpty(parentPI)) {
@@ -165,6 +168,9 @@ public void pushSimpleDataToLuceneArray() {
addToLucene(SolrConstants.DOCSTRCT_TOP, getType());
}
addToLucene(SolrConstants.DATAREPOSITORY, getDataRepository());
+ if (sourceDocFormat != null) {
+ addToLucene(SolrConstants.SOURCEDOCFORMAT, sourceDocFormat.name());
+ }
}
/**
@@ -653,6 +659,34 @@ public IndexObject getParent() {
return parent;
}
+ /**
+ * @return the docType
+ */
+ public DocType getDocType() {
+ return docType;
+ }
+
+ /**
+ * @param docType the docType to set
+ */
+ public void setDocType(DocType docType) {
+ this.docType = docType;
+ }
+
+ /**
+ * @return the sourceDocFormat
+ */
+ public FileFormat getSourceDocFormat() {
+ return sourceDocFormat;
+ }
+
+ /**
+ * @param sourceDocFormat the sourceDocFormat to set
+ */
+ public void setSourceDocFormat(FileFormat sourceDocFormat) {
+ this.sourceDocFormat = sourceDocFormat;
+ }
+
/**
*
* setDmdid.
diff --git a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/SolrConstants.java b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/SolrConstants.java
index ee271e9d..a2409849 100644
--- a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/SolrConstants.java
+++ b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/SolrConstants.java
@@ -24,6 +24,7 @@
public final class SolrConstants {
public enum DocType {
+ ARCHIVE,
DOCSTRCT,
FILE,
GROUP,
@@ -108,6 +109,8 @@ public static MetadataGroupType getByName(final String name) {
public static final String DOCTYPE = "DOCTYPE";
/** Constant DOWNLOAD_URL_EXTERNAL="MD2_DOWNLOAD_URL"
*/
public static final String DOWNLOAD_URL_EXTERNAL = "MD2_DOWNLOAD_URL";
+ /** Constant EAD_NODE_ID="EAD_NODE_ID"
*/
+ public static final String EAD_NODE_ID = "EAD_NODE_ID";
/** Constant EVENTDATE="EVENTDATE"
*/
public static final String EVENTDATE = "EVENTDATE";
/** Constant EVENTDATEEND="EVENTDATEEND"
*/
diff --git a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/datarepository/DataRepository.java b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/datarepository/DataRepository.java
index c6441594..d9d93ca9 100644
--- a/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/datarepository/DataRepository.java
+++ b/goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/model/datarepository/DataRepository.java
@@ -58,6 +58,8 @@ public class DataRepository {
public static final String PARAM_INDEXED_METS = "indexedMets";
/** Constant PARAM_INDEXED_LIDO="indexedLido"
*/
public static final String PARAM_INDEXED_LIDO = "indexedLido";
+ /** Constant PARAM_INDEXED_EAD="indexedEad"
*/
+ public static final String PARAM_INDEXED_EAD = "indexedEad";
/** Constant PARAM_INDEXED_DENKXWEB="indexedDenkXweb"
*/
public static final String PARAM_INDEXED_DENKXWEB = "indexedDenkXweb";
/** Constant PARAM_INDEXED_DC="indexedDC"
*/
@@ -150,6 +152,7 @@ public DataRepository(final String path, final boolean createFolders) throws Fat
checkAndCreateDataSubdir(PARAM_INDEXED_METS, createFolders);
checkAndCreateDataSubdir(PARAM_INDEXED_LIDO, createFolders);
+ checkAndCreateDataSubdir(PARAM_INDEXED_EAD, createFolders);
checkAndCreateDataSubdir(PARAM_INDEXED_DENKXWEB, createFolders);
checkAndCreateDataSubdir(PARAM_INDEXED_DUBLINCORE, createFolders);
checkAndCreateDataSubdir(PARAM_INDEXED_CMS, createFolders);
@@ -242,11 +245,7 @@ private void checkAndCreateDataSubdir(String dataDirName, boolean create) throws
String config = SolrIndexerDaemon.getInstance().getConfiguration().getConfiguration(dataDirName);
if (StringUtils.isEmpty(config)) {
switch (dataDirName) {
- case PARAM_INDEXED_METS:
- case PARAM_INDEXED_LIDO:
- case PARAM_INDEXED_DENKXWEB:
- case PARAM_INDEXED_DUBLINCORE:
- case PARAM_INDEXED_CMS:
+ case PARAM_INDEXED_METS, PARAM_INDEXED_LIDO, PARAM_INDEXED_EAD, PARAM_INDEXED_DENKXWEB, PARAM_INDEXED_DUBLINCORE, PARAM_INDEXED_CMS:
return;
default:
throw new FatalIndexerException("No configuration found for '" + dataDirName + "', exiting...");
@@ -334,6 +333,8 @@ public int getNumRecords() throws IOException {
logger.info("Data repository '{}' contains {} METS records.", path, metsRecords);
int lidoRecords = countFiles(getDir(PARAM_INDEXED_LIDO));
logger.info("Data repository '{}' contains {} LIDO records.", path, lidoRecords);
+ int eadRecords = countFiles(getDir(PARAM_INDEXED_EAD));
+ logger.info("Data repository '{}' contains {} EAD records.", path, eadRecords);
int denkxwebRecords = countFiles(getDir(PARAM_INDEXED_DENKXWEB));
logger.info("Data repository '{}' contains {} DenkXweb records.", path, denkxwebRecords);
int dcRecords = countFiles(getDir(PARAM_INDEXED_DUBLINCORE));
@@ -341,7 +342,7 @@ public int getNumRecords() throws IOException {
int cmsRecords = countFiles(getDir(PARAM_INDEXED_CMS));
logger.info("Data repository '{}' contains {} CMS page records.", path, cmsRecords);
- return metsRecords + lidoRecords + denkxwebRecords + dcRecords + cmsRecords;
+ return metsRecords + lidoRecords + eadRecords + denkxwebRecords + dcRecords + cmsRecords;
}
/**
@@ -418,6 +419,18 @@ public void moveDataFoldersToRepository(DataRepository toRepository, String pi)
}
}
}
+ // EAD
+ if (getDir(PARAM_INDEXED_EAD) != null) {
+ Path oldRecordFile = Paths.get(getDir(PARAM_INDEXED_EAD).toAbsolutePath().toString(), pi + ".xml");
+ if (Files.isRegularFile(oldRecordFile)) {
+ try {
+ Files.delete(oldRecordFile);
+ logger.info("Deleted old repository EAD file: {}", oldRecordFile.toAbsolutePath());
+ } catch (IOException e) {
+ logger.error("Could not delete old repository EAD file: {}", oldRecordFile.toAbsolutePath());
+ }
+ }
+ }
// DENKXWEB
if (getDir(PARAM_INDEXED_DENKXWEB) != null) {
Path oldRecordFile = Paths.get(getDir(PARAM_INDEXED_DENKXWEB).toAbsolutePath().toString(), pi + ".xml");
diff --git a/goobi-viewer-indexer/src/main/resources/config_indexer.xml b/goobi-viewer-indexer/src/main/resources/config_indexer.xml
index ead3a825..1b595f7e 100644
--- a/goobi-viewer-indexer/src/main/resources/config_indexer.xml
+++ b/goobi-viewer-indexer/src/main/resources/config_indexer.xml
@@ -51,6 +51,7 @@
indexed_mets
indexed_lido
+ indexed_ead
indexed_denkxweb
indexed_dublincore
indexed_cms
@@ -117,6 +118,13 @@
it will be used for indexing image file paths. -->
BOOKVIEWER
ZOOMIFY
+
+
+ object
+ audio
+ video
+
@@ -261,6 +269,7 @@
- lido:administrativeMetadata/lido:recordWrap/lido:recordID
- //denkxweb:recId
- dc:identifier
+ - ead:ead/ead:archdesc/ead:dsc/ead:c[@level="collection"]/@id
first
@@ -273,15 +282,35 @@
-
-
- -
- mets:xmlData/mods:mods/mods:identifier[@type="archive-entry-id"]
- true
- false
-
-
-
+
+
+ -
+
+
+ - mets:xmlData/mods:mods/mods:identifier[@type="archive-entry-id"]
+ - @id
+
+
+ true
+ false
+
+
+
+
+
+
+ -
+
+
+ - @level
+ - ead:archdesc/@level
+
+
+ true
+ false
+
+
+