Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
janvonde committed Apr 8, 2024
2 parents de458bb + 3c5b351 commit d384e53
Show file tree
Hide file tree
Showing 27 changed files with 7,345 additions and 360 deletions.
18 changes: 9 additions & 9 deletions goobi-viewer-indexer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.goobi.viewer</groupId>
<artifactId>viewer-indexer</artifactId>
<version>24.02</version>
<version>24.03-SNAPSHOT</version>


<name>Goobi viewer - Indexer</name>
Expand Down Expand Up @@ -41,14 +41,14 @@

<!-- intranda libraries -->
<alto.version>1.5.13</alto.version>
<iiif-api-model.version>2.6.2</iiif-api-model.version>
<iiif-api-model.version>2.6.3</iiif-api-model.version>
<normdataimporter.version>1.10.9</normdataimporter.version>

<!-- other libraries -->
<angus-mail.version>2.0.3</angus-mail.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<commons-configuration2.version>2.10.0</commons-configuration2.version>
<commons-io.version>2.15.1</commons-io.version>
<commons-configuration2.version>2.10.1</commons-configuration2.version>
<commons-io.version>2.16.0</commons-io.version>
<commons-jxpath.version>1.3</commons-jxpath.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-text.version>1.11.0</commons-text.version>
Expand All @@ -67,7 +67,7 @@
<junit.version>5.10.2</junit.version>
<metadata-extractor.version>2.19.0</metadata-extractor.version>
<solr.version>9.5.0</solr.version>
<sf-geojson.version>3.3.2</sf-geojson.version>
<sf-geojson.version>3.3.3</sf-geojson.version>
</properties>


Expand Down Expand Up @@ -300,7 +300,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<version>3.13.0</version>
<configuration>
<compilerArgument>-Xlint:deprecation</compilerArgument>
<compilerArgument>-Xlint:unchecked</compilerArgument>
Expand Down Expand Up @@ -390,7 +390,7 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.0</version>
<version>3.7.1</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -422,7 +422,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<version>0.8.12</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -477,7 +477,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.14.1</version>
<version>10.15.0</version>
</dependency>
</dependencies>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ public String[] index(Path cmsFile, Map<String, Path> dataFolders, final ISolrWr
IndexObject indexObj = new IndexObject(getNextIddoc(SolrIndexerDaemon.getInstance().getSearchIndex()));
logger.debug("IDDOC: {}", indexObj.getIddoc());

indexObj.setSourceDocFormat(FileFormat.CMS);

// LOGID
indexObj.setLogId("LOG0000");

Expand Down Expand Up @@ -224,9 +226,7 @@ public String[] index(Path cmsFile, Map<String, Path> dataFolders, final ISolrWr
ret[1] = "PI not found.";
throw new IndexerException(ret[1]);
}

// Set source doc format
indexObj.addToLucene(SolrConstants.SOURCEDOCFORMAT, FileFormat.CMS.name());

prepareUpdate(indexObj);

// Set title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -241,9 +239,7 @@ public String[] index(Document doc, Map<String, Path> dataFolders, ISolrWriteStr
}
pi = MetadataHelper.applyIdentifierModifications(pi);
// Do not allow identifiers with illegal characters
Pattern p = Pattern.compile("[^\\w|-]");
Matcher m = p.matcher(pi);
if (m.find()) {
if (!Utils.validatePi(pi)) {
ret[1] = "PI contains illegal characters: " + pi;
throw new IndexerException(ret[1]);
}
Expand Down Expand Up @@ -282,9 +278,6 @@ public String[] index(Document doc, Map<String, Path> dataFolders, ISolrWriteStr
logger.info("Solr write strategy injected by caller: {}", writeStrategy.getClass().getName());
}

// Set source doc format
indexObj.addToLucene(SolrConstants.SOURCEDOCFORMAT, FileFormat.DENKXWEB.name());

prepareUpdate(indexObj);

// Process TEI files
Expand Down Expand Up @@ -592,6 +585,8 @@ private static List<LuceneField> mapPagesToDocstruct(IndexObject indexObj, ISolr
* @throws FatalIndexerException
*/
private static void setSimpleData(IndexObject indexObj) throws FatalIndexerException {
indexObj.setSourceDocFormat(FileFormat.DENKXWEB);

Element structNode = indexObj.getRootStructNode();

// Set type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -238,9 +236,7 @@ public String[] index(Path dcFile, Map<String, Path> dataFolders, final ISolrWri
logger.info("Record PI: {}", pi);

// Do not allow identifiers with characters that cannot be used in file names
Pattern p = Pattern.compile("[^\\w|-]");
Matcher m = p.matcher(pi);
if (m.find()) {
if (!Utils.validatePi(pi)) {
ret[1] = new StringBuilder("PI contains illegal characters: ").append(pi).toString();
throw new IndexerException(ret[1]);
}
Expand Down Expand Up @@ -278,9 +274,7 @@ public String[] index(Path dcFile, Map<String, Path> dataFolders, final ISolrWri
checkOldDataFolder(dataFolders, DataRepository.PARAM_CMS, pi);
checkOldDataFolder(dataFolders, DataRepository.PARAM_TEIMETADATA, pi);
checkOldDataFolder(dataFolders, DataRepository.PARAM_ANNOTATIONS, pi);

// Set source doc format
indexObj.addToLucene(SolrConstants.SOURCEDOCFORMAT, FileFormat.DUBLINCORE.name());

prepareUpdate(indexObj);

// Process TEI files
Expand Down Expand Up @@ -717,11 +711,12 @@ void generatePageDocument(Element eleImage, String iddoc, String pi, Integer ord
* Sets DMDID, ID, TYPE and LABEL from the METS document.
*
* @param indexObj {@link IndexObject}
* @throws FatalIndexerException
*/
private static void setSimpleData(IndexObject indexObj) throws FatalIndexerException {
private static void setSimpleData(IndexObject indexObj) {
logger.trace("setSimpleData(IndexObject) - start");

indexObj.setSourceDocFormat(FileFormat.DUBLINCORE);

// LOGID
indexObj.setLogId("LOD_0000");
logger.trace("LOGID: {}", indexObj.getLogId());
Expand Down
Loading

0 comments on commit d384e53

Please sign in to comment.