Code cleanup with comments and missing license header.

This commit is contained in:
Michael Spalti
2021-09-03 13:43:16 -07:00
parent e431f1687a
commit 08ea61f654
9 changed files with 26 additions and 43 deletions

View File

@@ -17,16 +17,18 @@ public class ObjectMapperFactory {
private ObjectMapperFactory() {}
/**
* Gets the jackson ObjectMapper with iiif configuration.
* @return
* Gets the jackson ObjectMapper with dbmdz configuration.
* https://github.com/dbmdz/iiif-apis/blob/main/src/main/java/de/digitalcollections/iiif/model/jackson/IiifObjectMapper.java
* @return jackson mapper
*/
public static ObjectMapper getIiifObjectMapper() {
return new IiifObjectMapper();
}
/**
* Gets the jackson SimpleModule with iiif configuration.
* @return
* Gets the jackson SimpleModule with dbmdz configuration.
* https://github.com/dbmdz/iiif-apis/blob/main/src/main/java/de/digitalcollections/iiif/model/jackson/IiifModule.java
* @return model
*/
public static SimpleModule getIiifModule() {
return new IiifModule();

View File

@@ -11,8 +11,8 @@ import de.digitalcollections.iiif.model.enums.ViewingHint;
import org.springframework.stereotype.Component;
/**
* IIIF Presentation API 2.1.1 ViewingHint is a hint to the client as to the most appropriate method of
* displaying the resource. This class wraps the ViewingHint enum from the domain model.
* API 2.1.1 ViewingHint is a hint to the client that suggests the appropriate method of
* displaying the resource.
*
* With IIIF Presentation API 3.0 the viewingHint property is renamed to "behavior".
*/

View File

@@ -76,9 +76,6 @@ public class CanvasGenerator implements IIIFResource {
*/
@Override
public Resource<Canvas> getResource() {
// if (canvas.getHeight() == null || canvas.getWidth() == null) {
// throw new RuntimeException("The Canvas resource requires both height and width dimensions.");
// }
return canvas;
}

View File

@@ -7,16 +7,16 @@
*/
package org.dspace.app.rest.iiif.model.generator;
import java.util.ArrayList;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
import de.digitalcollections.iiif.model.OtherContent;
import de.digitalcollections.iiif.model.sharedcanvas.Canvas;
import de.digitalcollections.iiif.model.sharedcanvas.Resource;
import de.digitalcollections.iiif.model.sharedcanvas.Sequence;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
import de.digitalcollections.iiif.model.OtherContent;
import de.digitalcollections.iiif.model.sharedcanvas.Canvas;
import de.digitalcollections.iiif.model.sharedcanvas.Resource;
import de.digitalcollections.iiif.model.sharedcanvas.Sequence;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
/**
* Facade for the current Presentation API version 2.1.1 domain model's Sequence class.

View File

@@ -22,7 +22,6 @@ import de.digitalcollections.iiif.model.sharedcanvas.Range;
import de.digitalcollections.iiif.model.sharedcanvas.Resource;
import de.digitalcollections.iiif.model.sharedcanvas.Sequence;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;

View File

@@ -9,7 +9,6 @@ package org.dspace.app.rest.iiif.service;
import java.util.UUID;
import org.dspace.app.rest.iiif.model.generator.CanvasGenerator;
import org.dspace.app.rest.iiif.model.generator.ImageContentGenerator;
import org.dspace.app.rest.iiif.model.generator.ImageServiceGenerator;
import org.dspace.app.rest.iiif.model.generator.ProfileGenerator;
@@ -85,26 +84,6 @@ public abstract class AbstractResourceService {
return IIIF_ENDPOINT + uuid + "/manifest";
}
/**
* Association of images with their respective canvases is done via annotations.
* Only the annotations that associate images or parts of images are included in
* the canvas in the images property. If a IIIF Image API service is available for
* the image, then a link to the services base URI should be included.
*
* This method adds an image annotations to a canvas for both thumbnail and full size
* images. The annotation references the IIIF image service.
*
* @param canvas the Canvas object.
* @param mimeType the image mime type
* @param bitstreamID the bitstream uuid
*/
// protected void addImage(CanvasGenerator canvas, String mimeType, UUID bitstreamID) throws
// RuntimeException {
// canvas.addThumbnail(getThumbnailAnnotation(bitstreamID, mimeType));
// // Add image content resource to canvas facade.
// canvas.addImage(getImageContent(bitstreamID, mimeType, imageUtil.getImageProfile(), IMAGE_PATH).getResource());
// }
/**
* A small image that depicts or pictorially represents the resource that
* the property is attached to, such as the title page, a significant image

View File

@@ -9,7 +9,7 @@ package org.dspace.app.rest.iiif.service;
import java.util.UUID;
public interface AnnotationService {
public interface SearchAnnotationService {
void initializeQuery(String endpoint, String manifestId, boolean validationEnabled);

View File

@@ -1,3 +1,10 @@
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.app.rest.iiif.service;
import java.sql.SQLException;

View File

@@ -39,7 +39,6 @@ import org.dspace.discovery.SolrSearchCore;
import org.dspace.services.factory.DSpaceServicesFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
@@ -48,7 +47,7 @@ import org.springframework.web.context.annotation.RequestScope;
*/
@Component
@RequestScope
public class WordHighlightSolrSearch implements AnnotationService {
public class WordHighlightSolrSearch implements SearchAnnotationService {
private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(WordHighlightSolrSearch.class);