Skip to content

Commit

Permalink
initial commit for release v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteph-de committed May 11, 2023
1 parent 80a58d9 commit f52cfd6
Show file tree
Hide file tree
Showing 506 changed files with 27,619 additions and 201 deletions.
403 changes: 202 additions & 201 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DEMel Webapplication
====================

Copyright 2023,
DEMel project team, Rostock University, 18051 Rostock, Germany

22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
DEMel web portal
=====================

The **Diccionario del Español Medieval electrónico (DEMel)** is a semantically pre-structured and lemmatized database
dedicated to the Medieval Spanish.

The DEMel web portal is currently hosted at: <https://demel.uni-rostock.de>.

It is based on the digitized archive of the Diccionario del Español Medieval (DEM), which was discontinued at the end
of 2007 for financial reasons. With more than 600 literary and non-literary works or collections of texts and documents
as sources, the material represents the Spanish vocabulary from the 10th to the beginning of the 15th century.
In total, the database contains about 650,000 attestations of more than 31,000 lemmas.

The project is funded by the *German Research Foundation* (Deutsche Forschungsgemeinschaft, DFG) with the project number
[282533776](https://gepris.dfg.de/gepris/projekt/282533776).

The implementation of web application started in 2018.
The relaunch of version 2.0 occured in May 2023.

On this Github repository we plan to release stable milestones of the source code for the web portal.
<hr>
Copyright 2023, DEMel project team, Rostock University, 18051 Rostock, Germany
198 changes: 198 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.uni.rostock.demel</groupId>
<artifactId>demel-webapp-bs5</artifactId>
<version>0.2.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Web portal for DEMel</name>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.5</version>
</parent>

<properties>
<start-class>de.uni.rostock.demel.DEMelWebApp</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>8.11.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
<version>1.3.30</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>datatables</artifactId>
<version>1.13.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>datatables-plugins</artifactId>
<version>1.13.1</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.42</version>
</dependency>

<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.6.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>select2</artifactId>
<version>4.0.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>select2-bootstrap-5-theme</artifactId>
<version>1.3.0</version>
<exclusions>
<exclusion>
<groupId>org.webjars.npm</groupId>
<artifactId>bootstrap</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>tinymce</artifactId>
<version>6.3.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.4</version>
</dependency>
<dependency>
<groupId>de.uni.rostock.ub.digibib</groupId>
<artifactId>unirostock-theme-bs5</artifactId>
<!-- <version>0.5-SNAPSHOT</version> -->
<version>0.5.2</version>
</dependency>
</dependencies>
<build>
<finalName>demel_portal</finalName>
<!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes" update them in DevMode -->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>${start-class}</mainClass>
<executable>true</executable>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.7.3.4</version>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.7.3.4</version>
</plugin>
</plugins>
</reporting>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* This file is part of the DEMel web application.
*
* Copyright 2023
* DEMel project team, Rostock University, 18051 Rostock, Germany
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.uni.rostock.demel;

import java.io.IOException;
import java.security.Principal;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.catalina.connector.ClientAbortException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;

@ControllerAdvice
public class DEMelDefaultExceptionHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(DEMelDefaultExceptionHandler.class);

@ExceptionHandler({ IOException.class, ClientAbortException.class })
@ResponseStatus(HttpStatus.REQUEST_TIMEOUT)
public void clientAbortExceptionHandler(HttpServletRequest request, HttpServletResponse response, Exception e) {
// This usually means the browser closed or disconnected or
// something. We can't do anything. To avoid excessive stack traces
// in log, just print a simple message and return null
String username = "<NONE>";
Principal principal = request.getUserPrincipal();
if (principal != null) {
username = principal.getName();
}
LOGGER.warn("ClientAbortException: username={},remoteAddr={},userAgent={},requestedURL={}", username,
request.getRemoteAddr(), request.getHeader("User-Agent"), request.getRequestURL());

//return new ResponseEntity<String>("Bad Request", HttpStatus.BAD_REQUEST);
}
}
71 changes: 71 additions & 0 deletions src/main/java/de/uni/rostock/demel/DEMelUtilityCommands.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* This file is part of the DEMel web application.
*
* Copyright 2023
* DEMel project team, Rostock University, 18051 Rostock, Germany
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.uni.rostock.demel;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;

import de.uni.rostock.demel.data.model.dictionary.Source;
import de.uni.rostock.demel.data.service.solr.SolrAttestationUpdateService;
import de.uni.rostock.demel.data.service.solr.SolrSourceQueryService;
import de.uni.rostock.demel.data.service.solr.SolrSourceUpdateService;

//@SpringBootApplication
/**
* Application should be run with property as parameter: --spring.main.web-application-type=NONE
*
* @author Robert Stephan
*
*/
public class DEMelUtilityCommands
implements CommandLineRunner {

@Autowired
SolrAttestationUpdateService attUpdService;

@Autowired
SolrSourceUpdateService sourceUpdService;

@Autowired
SolrSourceQueryService sourceQueryService;

private static Logger LOG = LoggerFactory
.getLogger(DEMelUtilityCommands.class);

public static void main(String[] args) {
LOG.info("STARTING THE APPLICATION");
SpringApplication.run(DEMelUtilityCommands.class, args);
LOG.info("APPLICATION FINISHED");
}

@Override
public void run(String... args) {
LOG.info("EXECUTING : command line runner");
// sourceUpdService.reindexAllBibitems();
for (int i = 0; i < args.length; ++i) {
LOG.info("args[{}]: {}", i, args[i]);
}

Source s = sourceQueryService.findById("b0011");
System.out.println(s);
}
}
Loading

0 comments on commit f52cfd6

Please sign in to comment.