diff --git a/web-access-app/src/main/resources/recordTransformations/modsToFullRecord.xsl b/web-access-app/src/main/resources/recordTransformations/modsToFullRecord.xsl
index cf29d91084..f5cc370fa7 100644
--- a/web-access-app/src/main/resources/recordTransformations/modsToFullRecord.xsl
+++ b/web-access-app/src/main/resources/recordTransformations/modsToFullRecord.xsl
@@ -525,8 +525,10 @@
-
+
+
+
diff --git a/web-common/src/main/java/edu/unc/lib/boxc/web/common/services/AccessCopiesService.java b/web-common/src/main/java/edu/unc/lib/boxc/web/common/services/AccessCopiesService.java
index 235ee9504c..488d337db8 100644
--- a/web-common/src/main/java/edu/unc/lib/boxc/web/common/services/AccessCopiesService.java
+++ b/web-common/src/main/java/edu/unc/lib/boxc/web/common/services/AccessCopiesService.java
@@ -136,6 +136,7 @@ public String getThumbnailId(ContentObjectRecord contentObjectRecord, AccessGrou
log.debug("Found thumbnail object directly assigned to object {}", thumbId);
return thumbId;
}
+
// Don't need to check any further if object isn't a work or doesn't contain files with thumbnails
if (!ResourceType.Work.name().equals(contentObjectRecord.getResourceType())
|| contentObjectRecord.getFileFormatCategory() == null
diff --git a/web-common/src/main/java/edu/unc/lib/boxc/web/common/services/PermissionsHelper.java b/web-common/src/main/java/edu/unc/lib/boxc/web/common/services/PermissionsHelper.java
index 29218f80b4..bbfe17aea7 100644
--- a/web-common/src/main/java/edu/unc/lib/boxc/web/common/services/PermissionsHelper.java
+++ b/web-common/src/main/java/edu/unc/lib/boxc/web/common/services/PermissionsHelper.java
@@ -48,18 +48,6 @@ public boolean hasOriginalAccess(AccessGroupSet principals, ContentObjectRecord
return hasDatastreamAccess(principals, ORIGINAL_FILE, metadata);
}
- /**
- * Returns true if the principals can access thumbnails belonging to
- * the requested object, if present.
- *
- * @param principals
- * @param metadata
- * @return
- */
- public boolean hasThumbnailAccess(AccessGroupSet principals, ContentObjectRecord metadata) {
- return hasDatastreamAccess(principals, THUMBNAIL_SMALL, metadata);
- }
-
/**
* Returns true if the principals can access the image preview belonging to
* the requested object, if present.
@@ -75,7 +63,7 @@ public boolean hasImagePreviewAccess(AccessGroupSet principals, ContentObjectRec
/**
* Returns true if the principals can access the MODS description belonging to
* the requested object, if present.
- *
+ *
* @param metadata
* @return
*/
@@ -93,7 +81,7 @@ public boolean hasDescriptionAccess(AccessGroupSet principals, ContentObjectReco
* @return
*/
public boolean hasDatastreamAccess(AccessGroupSet principals, DatastreamType datastream,
- ContentObjectRecord metadata) {
+ ContentObjectRecord metadata) {
notNull(principals, "Requires agent principals");
notNull(datastream, "Requires datastream type");
notNull(metadata, "Requires metadata object");
@@ -168,4 +156,4 @@ public AccessControlService getAccessControlService() {
public void setAccessControlService(AccessControlService accessControlService) {
this.accessControlService = accessControlService;
}
-}
+}
\ No newline at end of file
diff --git a/web-common/src/test/java/edu/unc/lib/boxc/web/common/services/AccessCopiesServiceTest.java b/web-common/src/test/java/edu/unc/lib/boxc/web/common/services/AccessCopiesServiceTest.java
index fc17173f61..950af5449f 100644
--- a/web-common/src/test/java/edu/unc/lib/boxc/web/common/services/AccessCopiesServiceTest.java
+++ b/web-common/src/test/java/edu/unc/lib/boxc/web/common/services/AccessCopiesServiceTest.java
@@ -371,4 +371,4 @@ private void hasPermissions(ContentObjectSolrRecord contentObject, boolean hasAc
private void populateResultList(ContentObjectRecord... objects) {
when(searchResultResponse.getResultList()).thenReturn(Arrays.asList(objects));
}
-}
+}
\ No newline at end of file
diff --git a/web-common/src/test/java/edu/unc/lib/boxc/web/common/services/PermissionsHelperTest.java b/web-common/src/test/java/edu/unc/lib/boxc/web/common/services/PermissionsHelperTest.java
index 68ec7c9622..fe7a2589f3 100644
--- a/web-common/src/test/java/edu/unc/lib/boxc/web/common/services/PermissionsHelperTest.java
+++ b/web-common/src/test/java/edu/unc/lib/boxc/web/common/services/PermissionsHelperTest.java
@@ -162,4 +162,4 @@ public void testDoesNotHaveEnhancedIfLoggedIn() {
private void assignPermission(Permission permission, boolean value) {
when(accessControlService.hasAccess(any(PID.class), eq(principals), eq(permission))).thenReturn(value);
}
-}
+}
\ No newline at end of file
diff --git a/web-services-app/src/main/java/edu/unc/lib/boxc/web/services/processing/DownloadImageService.java b/web-services-app/src/main/java/edu/unc/lib/boxc/web/services/processing/DownloadImageService.java
index 4c58d81254..278f94ebe5 100644
--- a/web-services-app/src/main/java/edu/unc/lib/boxc/web/services/processing/DownloadImageService.java
+++ b/web-services-app/src/main/java/edu/unc/lib/boxc/web/services/processing/DownloadImageService.java
@@ -35,6 +35,9 @@ public class DownloadImageService {
*/
public ResponseEntity streamImage(ContentObjectRecord contentObjectRecord, String size)
throws IOException {
+ if (contentObjectRecord.getDatastreamObject(DatastreamType.JP2_ACCESS_COPY.getId()) == null) {
+ return ResponseEntity.notFound().build();
+ }
String pidString = contentObjectRecord.getPid().getId();
String url = buildURL(pidString, size);
diff --git a/web-services-app/src/main/java/edu/unc/lib/boxc/web/services/rest/modify/ThumbnailController.java b/web-services-app/src/main/java/edu/unc/lib/boxc/web/services/rest/modify/ThumbnailController.java
index 94441bb031..c29024188c 100644
--- a/web-services-app/src/main/java/edu/unc/lib/boxc/web/services/rest/modify/ThumbnailController.java
+++ b/web-services-app/src/main/java/edu/unc/lib/boxc/web/services/rest/modify/ThumbnailController.java
@@ -11,6 +11,7 @@
import edu.unc.lib.boxc.model.api.ids.PID;
import edu.unc.lib.boxc.model.api.objects.FileObject;
import edu.unc.lib.boxc.model.api.objects.RepositoryObjectLoader;
+import edu.unc.lib.boxc.model.api.objects.WorkObject;
import edu.unc.lib.boxc.model.fcrepo.ids.PIDs;
import edu.unc.lib.boxc.operations.jms.thumbnails.ThumbnailRequest;
import edu.unc.lib.boxc.operations.jms.thumbnails.ThumbnailRequestSender;
@@ -46,6 +47,8 @@
@Controller
public class ThumbnailController {
private static final Logger log = LoggerFactory.getLogger(ThumbnailController.class);
+ public static final String OLD_THUMBNAIL_ID = "oldThumbnailId";
+ public static final String ACTION = "action";
@Autowired
private ImportThumbnailService service;
@@ -71,7 +74,7 @@ ResponseEntity |