From 2903b0888a8d8591f68dec2afca089bee17bdcfe Mon Sep 17 00:00:00 2001 From: Michael Heppler Date: Wed, 7 Oct 2020 15:34:05 -0400 Subject: [PATCH 001/576] Consolidated file metadata on dataset pg by using file-info-fragment from file replace pg [ref #7081] --- src/main/webapp/editdatafiles.xhtml | 1 + src/main/webapp/file-info-fragment.xhtml | 40 +++++++++-- src/main/webapp/filesFragment.xhtml | 92 ++---------------------- 3 files changed, 41 insertions(+), 92 deletions(-) diff --git a/src/main/webapp/editdatafiles.xhtml b/src/main/webapp/editdatafiles.xhtml index d81e6da22a1..0965ec5520c 100644 --- a/src/main/webapp/editdatafiles.xhtml +++ b/src/main/webapp/editdatafiles.xhtml @@ -43,6 +43,7 @@
+ diff --git a/src/main/webapp/file-info-fragment.xhtml b/src/main/webapp/file-info-fragment.xhtml index dff487454ea..a8ffd40cb7a 100644 --- a/src/main/webapp/file-info-fragment.xhtml +++ b/src/main/webapp/file-info-fragment.xhtml @@ -31,13 +31,43 @@
- #{fileMetadata.label} + + + #{fileMetadata.label} + + + + #{fileMetadata.label} +
+
- #{fileMetadata.dataFile.friendlyType} - - #{fileMetadata.dataFile.friendlySize} - - #{fileMetadata.fileDateToDisplay} -
#{fileMetadata.dataFile.checksumType}: #{fileMetadata.dataFile.checksumValue}
+ +
+ +
+ + + + + + + + +
+ +
+ +
+ + + +
diff --git a/src/main/webapp/filesFragment.xhtml b/src/main/webapp/filesFragment.xhtml index 62453b09fe5..bb7041bda66 100644 --- a/src/main/webapp/filesFragment.xhtml +++ b/src/main/webapp/filesFragment.xhtml @@ -365,93 +365,11 @@
-
-
-
- - - #{fileMetadata.label} - - - - - - - - #{fileMetadata.label} - - - - -
- -
-
- -
-
-
- - -
+ +             +             +             +            From f094b97dce164f28701492db089de3164c85ef14 Mon Sep 17 00:00:00 2001 From: Michael Heppler Date: Thu, 8 Oct 2020 11:19:49 -0400 Subject: [PATCH 002/576] Fixed download count error on file-info-fragment, as well as cleaned up thumbnail code [ref #7081] --- .../edu/harvard/iq/dataverse/DatasetPage.java | 9 --------- .../harvard/iq/dataverse/EditDatafilesPage.java | 14 -------------- src/main/webapp/file-info-fragment.xhtml | 15 ++++++--------- 3 files changed, 6 insertions(+), 32 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java index 458fcf56ab0..43d945c657c 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java @@ -1311,15 +1311,6 @@ public boolean isSuperUser(){ } return false; } - /* - TODO/OPTIMIZATION: This is still costing us N SELECT FROM GuestbookResponse queries, - where N is the number of files. This could of course be replaced by a query that'll - look up all N at once... Not sure if it's worth it; especially now that N - will always be 10, for the initial page load. -- L.A. 4.2.1 - */ - public Long getGuestbookResponseCount(FileMetadata fileMetadata) { - return guestbookResponseService.getCountGuestbookResponsesByDataFileId(fileMetadata.getDataFile().getId()); - } /** * Check Dataset related permissions * diff --git a/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java b/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java index 3a975d1018e..040988a6536 100644 --- a/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java @@ -2562,20 +2562,6 @@ public boolean isLocked() { return false; } - public boolean isThumbnailAvailable(FileMetadata fileMetadata) { - // new and optimized logic: - // - check download permission here (should be cached - so it's free!) - // - only then ask the file service if the thumbnail is available/exists. - // the service itself no longer checks download permissions. - if (!fileDownloadHelper.canDownloadFile(fileMetadata)) { - return false; - } - - return datafileService.isThumbnailAvailable(fileMetadata.getDataFile()); - } - - - private Boolean lockedFromEditsVar; public boolean isLockedFromEdits() { diff --git a/src/main/webapp/file-info-fragment.xhtml b/src/main/webapp/file-info-fragment.xhtml index a8ffd40cb7a..4fbfa4606f2 100644 --- a/src/main/webapp/file-info-fragment.xhtml +++ b/src/main/webapp/file-info-fragment.xhtml @@ -14,8 +14,8 @@
- - + @@ -24,7 +24,7 @@
-
+
@@ -48,16 +48,13 @@
- + - + +
From 56dc4c75ba9acf9c66906169bb9baa2dc74a7691 Mon Sep 17 00:00:00 2001 From: Michael Heppler Date: Thu, 8 Oct 2020 15:52:24 -0400 Subject: [PATCH 003/576] Removed additional editMode render logic not needed in file table on dataset pg [ref #7081] --- src/main/webapp/file-info-fragment.xhtml | 1 + src/main/webapp/filesFragment.xhtml | 35 ++++++------------------ 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/src/main/webapp/file-info-fragment.xhtml b/src/main/webapp/file-info-fragment.xhtml index 4fbfa4606f2..ddc4b97a017 100644 --- a/src/main/webapp/file-info-fragment.xhtml +++ b/src/main/webapp/file-info-fragment.xhtml @@ -32,6 +32,7 @@