Skip to content

Commit

Permalink
Update CMO to MyCoRe 2023.06.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhofmann authored and kkrebs committed Dec 10, 2024
1 parent 7ab34e3 commit 5b0d052
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 244 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ More information about MyCoRe are available at http://www.mycore.org
- Go to cmo-webapp
- Install solr with the command: `mvn solr-runner:copyHome solr-runner:installSolrPlugins`
- Run solr with the command `mvn solr-runner:start` (End with mvn solr-runner:stop)
- Run Jetty with the command: `mvn jetty:run` (End with ctrl+c)
- Fast rebuild and Jetty restart `mvn clean install -DskipTests -pl cmo-module && mvn jetty:run -pl cmo-webapp` (End with ctrl+c)
- Run Tomcat with the command: `mvn org.codehaus.cargo:cargo-maven3-plugin:run` (End with ctrl+c)
- Fast rebuild and Jetty restart `mvn clean install -pl cmo-module && mvn clean install org.codehaus.cargo:cargo-maven3-plugin:run -pl cmo-webapp` (End with ctrl+c)

## Update

Expand Down
2 changes: 1 addition & 1 deletion cmo-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.vzg.cmo</groupId>
<artifactId>cmo-parent</artifactId>
<version>2021.06-SNAPSHOT</version>
<version>2023.06-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>cmo-cli</artifactId>
Expand Down
28 changes: 18 additions & 10 deletions cmo-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>de.vzg.cmo</groupId>
<artifactId>cmo-parent</artifactId>
<version>2021.06-SNAPSHOT</version>
<version>2023.06-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>cmo-module</artifactId>
Expand Down Expand Up @@ -126,6 +126,18 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-hikaricp</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand All @@ -134,10 +146,6 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -159,13 +167,9 @@
<artifactId>solr-solrj</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
Expand Down Expand Up @@ -236,5 +240,9 @@
<groupId>org.webjars</groupId>
<artifactId>momentjs</artifactId>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Locale;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.mycore.common.xml.MCRXMLFunctions;
import org.mycore.common.xsl.MCRParameterCollector;
Expand Down
2 changes: 1 addition & 1 deletion cmo-module/src/main/java/de/vzg/cmo/CMOZipTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public MCRContent transform(MCRContent mcrContent) throws IOException {
final Document xml = mcrContent.asXML();
final List<Element> zipXMLEntry = xml.getRootElement().getChildren("entry", ZIP_NAMESPACE);
return new MCRZipContent(zipXMLEntry);
} catch (JDOMException | SAXException e) {
} catch (JDOMException e) {
throw new MCRException("Error while getting xml of source", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.io.IOException;
import java.net.URI;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.core.Response;

import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,21 @@
import java.io.IOException;
import java.util.stream.Stream;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;

import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.mycore.access.MCRAccessManager;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.common.content.MCRContent;
import org.mycore.common.content.MCRJDOMContent;
import org.mycore.common.content.transformer.MCRContentTransformerFactory;
import org.mycore.common.xml.MCRLayoutTransformerFactory;
import org.mycore.component.fo.common.content.xml.MCRLayoutTransformerFoFactory;
import org.mycore.datamodel.metadata.MCRObjectID;
import org.mycore.frontend.cli.MCRObjectCommands;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class MEIPostProcessor extends MCRPostProcessorXSL {

@Override
public Document process(Document xml) throws IOException, JDOMException, SAXException {
public Document process(Document xml) throws IOException, JDOMException {
Document returns = super.process(xml);

MEIWrapper.getWrapper(returns.getRootElement()).orderTopLevelElement();
Expand Down
29 changes: 27 additions & 2 deletions cmo-module/src/main/resources/config/cmo/mycore.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,37 @@ MCR.CLI.Classes.External=%MCR.CLI.Classes.External%,de.vzg.cmo.model.cli.MCRCMOI
MCR.Solr.Proxy.WhiteList=%MCR.Solr.Proxy.WhiteList%,/mods_nameIdentifier
MCR.Jersey.Resource.Packages=%MCR.Jersey.Resource.Packages%,de.vzg.cmo.resources

# until we are ready to switch to Saxon by default:
MCR.LayoutService.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl
MCR.Layout.Transformer.Factory.XSLFolder=xsl

#required for mycore-solr
MCR.URIResolver.xslImports.solr-document=solr-basetemplate.xsl,mycoreobject-dynamicfields.xsl,mods-solr.xsl,iview2-solr.xsl

MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,solr-layout-utils.xsl
MCR.ContentTransformer.response.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl
MCR.ContentTransformer.response.Stylesheet=%MCR.ContentTransformer.response-prepared.Stylesheet%,xsl/response.xsl
MCR.ContentTransformer.response-browse.Stylesheet=xsl/response-browse.xsl
MCR.ContentTransformer.mycoreobject-solrdocument.Class=org.mycore.common.content.transformer.MCRXSL2JAXBTransformer
MCR.ContentTransformer.mycoreobject-solrdocument.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl
MCR.ContentTransformer.mycoreobject-solrdocument.Stylesheet=xsl/mycoreobject-solrdocument.xsl
MCR.ContentTransformer.mycoreobject-solrdocument.Context=org.mycore.solr.index.document.jaxb
MCR.ContentTransformer.response-solrdocument.Class=org.mycore.common.content.transformer.MCRXSL2JAXBTransformer
MCR.ContentTransformer.response-solrdocument.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl
MCR.ContentTransformer.response-solrdocument.Stylesheet=xsl/response2batch.xsl,%MCR.ContentTransformer.mycoreobject-solrdocument.Stylesheet%
MCR.ContentTransformer.response-solrdocument.Context=%MCR.ContentTransformer.mycoreobject-solrdocument.Context%
MCR.ContentTransformer.response-prepared.Class=org.mycore.common.content.transformer.MCRXSLTransformer
MCR.ContentTransformer.response-prepared.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl
MCR.ContentTransformer.response-prepared.Stylesheet=xsl/response-join-results.xsl,xsl/response-addDocId.xsl,xsl/response-addDerivates.xsl
MCR.URIResolver.xslIncludes.xeditorTemplates=solr-xeditor-templates.xsl


##############################################################################
# Solr #
##############################################################################

MCR.Solr.DynamicFields=false
MCR.Solr.ServerURL=http:\/\/localhost:8983/solr/cmo
MCR.Solr.ServerURL=http:\/\/localhost:8983/
MCR.Solr.Core.main.Name=cmo

##############################################################################
Expand Down Expand Up @@ -54,7 +79,7 @@ MCR.LanguageClassification=rfc5646
MCR.DOI.HostingInstitution=Max Weber Stiftung - Deutsche Geisteswissenschaftliche Institute im Ausland
MCR.DOI.HostingInstitution.ROR=02esxtn62

MCR.PI.Service.Datacite=org.mycore.pi.doi.MCRDOIService
#MCR.PI.Service.Datacite=org.mycore.pi.doi.MCRDOIService
MCR.PI.Service.Datacite.Generator=CMODOI
MCR.PI.Service.Datacite.MetadataService=CMOMetadataService
MCR.PI.Service.Datacite.Transformer=datacite
Expand Down
22 changes: 18 additions & 4 deletions cmo-module/src/test/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,27 @@
<mapping-file>META-INF/mycore-user2-mappings.xml</mapping-file>
<mapping-file>META-INF/mycore-pi-mappings.xml</mapping-file>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:mem:mycore" />
<property name="javax.persistence.jdbc.user" value="sa" />
<property name="javax.persistence.jdbc.password" value="" />
<!-- postgres -->
<!-- <property name="jakarta.persistence.jdbc.driver" value="org.postgresql.Driver" /> -->
<!-- <property name="jakarta.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/postgres" /> -->
<!-- h2 -->
<property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver" />
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:cmo-module" />

<property name="jakarta.persistence.jdbc.user" value="postgres" />
<property name="jakarta.persistence.jdbc.password" value="junit" />
<property name="hibernate.cache.use_second_level_cache" value="false" />
<property name="hibernate.jdbc.batch_size" value="0" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.globally_quoted_identifiers" value="true" />
<property name="hibernate.globally_quoted_identifiers_skip_column_definitions" value="true" />
<!-- We better always test with defined schema -->
<property name="hibernate.default_schema" value="junit" />

<!-- hikari -->
<property name="hibernate.connection.provider_class" value="org.hibernate.hikaricp.internal.HikariCPConnectionProvider" />
<property name="hibernate.hikari.maximumPoolSize" value="10" />
</properties>
</persistence-unit>
</persistence>
90 changes: 66 additions & 24 deletions cmo-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.vzg.cmo</groupId>
<artifactId>cmo-parent</artifactId>
<version>2021.06-SNAPSHOT</version>
<version>2023.06-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>cmo-webapp</artifactId>
Expand All @@ -18,6 +18,18 @@
<!-- solr.location>${user.home}/AppData/Local/MyCoRe/dev-cmo/data/solr</solr.location -->
<solr-runner.solrMirrorURL>https://archive.apache.org/dist/lucene/solr/</solr-runner.solrMirrorURL>
<solr-runner.solrVersionString>7.7.3</solr-runner.solrVersionString>
<tomcat.version>10.1.11</tomcat.version>
<cargo.container.zipUrlInstaller.downloadDir>${settings.localRepository}/../cargo/containers</cargo.container.zipUrlInstaller.downloadDir>
<cargo.debug.address>8295</cargo.debug.address>
<cargo.debug.suspend>n</cargo.debug.suspend>
<cargo.deployable.default.artifactId>${project.artifactId}</cargo.deployable.default.artifactId>
<cargo.deployable.default.context>/</cargo.deployable.default.context>
<cargo.deployable.default.groupId>${project.groupId}</cargo.deployable.default.groupId>
<cargo.rmi.port>8290</cargo.rmi.port>
<cargo.servlet.port>8291</cargo.servlet.port>
<cargo.start.jvmargs />
<cargo.tomcat.ajp.port>8292</cargo.tomcat.ajp.port>
<cargo.tomcat.connector.maxHttpHeaderSize>8192</cargo.tomcat.connector.maxHttpHeaderSize>
</properties>
<build>
<finalName>cmo-${project.version}</finalName>
Expand All @@ -39,30 +51,60 @@
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven3-plugin</artifactId>
<version>1.10.9</version>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<systemProperties>
<systemProperty>
<name>MCR.AppName</name>
<value>${MCR.AppName}</value>
</systemProperty>
<systemProperty>
<name>MCR.DataPrefix</name>
<value>dev</value>
</systemProperty>
<systemProperty>
<name>MCR.SASS.DeveloperMode</name>
<value>false</value>
</systemProperty>
<systemProperty>
<name>project.basedir</name>
<value>${project.basedir}</value>
</systemProperty>
</systemProperties>
<contextXml>${project.basedir}/src/etc/jetty-context.xml</contextXml>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<properties>
<context>/cmo</context>
</properties>
</deployable>
</deployables>
<configuration>
<users>
<user>
<name>submitter</name>
<password>submitter123</password>
<roles>
<role>submitter</role>
<role>users</role>
</roles>
</user>
<user>
<name>editor</name>
<password>editor123</password>
<roles>
<role>editor</role>
<role>users</role>
</roles>
</user>
</users>
<home>${project.build.directory}/catalina-base</home>
<properties>
<cargo.rmi.port>${cargo.rmi.port}</cargo.rmi.port>
<cargo.servlet.port>${cargo.servlet.port}</cargo.servlet.port>
<cargo.tomcat.ajp.port>${cargo.tomcat.ajp.port}</cargo.tomcat.ajp.port>
<cargo.tomcat.uriencoding>UTF-8</cargo.tomcat.uriencoding>
<cargo.tomcat.connector.maxHttpHeaderSize>${cargo.tomcat.connector.maxHttpHeaderSize}</cargo.tomcat.connector.maxHttpHeaderSize>
<!-- fixes IIIF identifier encoding issues -->
<cargo.start.jvmargs>-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -DMCR.AppName=${MCR.AppName} -DMCR.DataPrefix=dev -DMCR.SASS.DeveloperMode=false</cargo.start.jvmargs>
</properties>
</configuration>
<container>
<containerId>tomcat10x</containerId>
<artifactInstaller>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>${tomcat.version}</version>
<type>tar.gz</type>
</artifactInstaller>
</container>


</configuration>
</plugin>
<plugin>
Expand Down
4 changes: 2 additions & 2 deletions cmo-webapp/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>cmo</display-name>
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>MIR</display-name>
<absolute-ordering>
<name>cmo_module</name>
<name>mycore</name>
Expand Down
Loading

0 comments on commit 5b0d052

Please sign in to comment.