Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated presentation logic #362

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 1 addition & 94 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<groupId>de.digitalcollections</groupId>
<artifactId>iiif-server-hymir</artifactId>
<version>5.1.9-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<url>https://github.com/dbmdz/iiif-server-hymir</url>
Expand Down Expand Up @@ -189,14 +189,6 @@
<version>7.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>nz.net.ultraq.thymeleaf</groupId>
<artifactId>thymeleaf-layout-dialect</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand Down Expand Up @@ -240,95 +232,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-conditionalcomments</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>html5shiv</artifactId>
<version>3.7.3-1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>mirador</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>ie10-viewport-bug-workaround</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>bootstrap</artifactId>
<version>4.6.0</version>
<exclusions>
<exclusion>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>dbmdz__mirador-canvaslink</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>dbmdz__mirador-downloadmenu</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>dbmdz__mirador-imagecropper</artifactId>
<version>2.4.6</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>dbmdz__mirador-keyboardnavigation</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>dbmdz__mirador-physicalruler</artifactId>
<version>1.3.4</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>dbmdz__mirador-sharebuttons</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>dbmdz__mirador-viewfromurl</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>jquery</artifactId>
<version>3.6.4</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>openseadragon</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>respond.js</artifactId>
<version>1.4.2</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,13 @@ public class CustomResponseHeaders {

private final List<ResponseHeader> imageTile;
private final List<ResponseHeader> imageInfo;
private final List<ResponseHeader> presentationManifest;
private final List<ResponseHeader> presentationAnnotationList;
private final List<ResponseHeader> presentationCollection;

// custom.iiif.headers
public CustomResponseHeaders(
List<ResponseHeader> all,
ImageResponseHeaders image,
PresentationResponseHeaders presentation) {
public CustomResponseHeaders(List<ResponseHeader> all, ImageResponseHeaders image) {
all = Objects.requireNonNullElseGet(all, Collections::emptyList);
image = Objects.requireNonNullElseGet(image, ImageResponseHeaders::empty);
presentation = Objects.requireNonNullElseGet(presentation, PresentationResponseHeaders::empty);
this.imageTile = concatenate(all, image.image);
this.imageInfo = concatenate(all, image.info);
this.presentationManifest = concatenate(all, presentation.manifest);
this.presentationAnnotationList = concatenate(all, presentation.annotationList);
this.presentationCollection = concatenate(all, presentation.collection);
}

private List<ResponseHeader> concatenate(
Expand All @@ -50,18 +40,6 @@ public List<ResponseHeader> forImageInfo() {
return unmodifiableList(imageInfo);
}

public List<ResponseHeader> forPresentationManifest() {
return unmodifiableList(presentationManifest);
}

public List<ResponseHeader> forPresentationCollection() {
return unmodifiableList(presentationCollection);
}

public List<ResponseHeader> forPresentationAnnotationList() {
return unmodifiableList(presentationAnnotationList);
}

protected static class ImageResponseHeaders {

private final List<ResponseHeader> image;
Expand All @@ -85,39 +63,6 @@ public static ImageResponseHeaders empty() {
}
}

@ConstructorBinding
protected static class PresentationResponseHeaders {

private final List<ResponseHeader> manifest;
private final List<ResponseHeader> collection;
private final List<ResponseHeader> annotationList;

public PresentationResponseHeaders(
List<ResponseHeader> manifest,
List<ResponseHeader> collection,
List<ResponseHeader> annotationList) {
this.manifest = Objects.requireNonNullElseGet(manifest, Collections::emptyList);
this.collection = Objects.requireNonNullElseGet(collection, Collections::emptyList);
this.annotationList = Objects.requireNonNullElseGet(annotationList, Collections::emptyList);
}

public List<ResponseHeader> getManifest() {
return unmodifiableList(manifest);
}

public List<ResponseHeader> getCollection() {
return unmodifiableList(collection);
}

public List<ResponseHeader> getAnnotationList() {
return unmodifiableList(annotationList);
}

public static PresentationResponseHeaders empty() {
return new PresentationResponseHeaders(emptyList(), emptyList(), emptyList());
}
}

public static class ResponseHeader {

private final String name;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,41 +1,18 @@
package de.digitalcollections.iiif.hymir.config;

import de.digitalcollections.commons.springmvc.interceptors.CurrentUrlAsModelAttributeHandlerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import org.springframework.web.util.UrlPathHelper;

@Configuration
public class SpringConfigWeb implements WebMvcConfigurer {

@Override
public void addInterceptors(InterceptorRegistry registry) {
LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
localeChangeInterceptor.setParamName("language");
registry.addInterceptor(localeChangeInterceptor);

CurrentUrlAsModelAttributeHandlerInterceptor currentUrlAsModelAttributeHandlerInterceptor =
new CurrentUrlAsModelAttributeHandlerInterceptor();
currentUrlAsModelAttributeHandlerInterceptor.deleteParams("language");
registry.addInterceptor(currentUrlAsModelAttributeHandlerInterceptor);
}

@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
// Needed for escaped slashes in identifiers
UrlPathHelper urlPathHelper = new UrlPathHelper();
urlPathHelper.setUrlDecode(false);
configurer.setUrlPathHelper(urlPathHelper);
}

@Bean
public LocaleResolver localeResolver() {
return new SessionLocaleResolver();
}
}

This file was deleted.

This file was deleted.

Loading