Skip to content

Commit 1e04337

Browse files
authored
Merge branch 'develop' into 11885-bump-version-6-9
2 parents 1de6137 + 09a951b commit 1e04337

File tree

8 files changed

+29
-15
lines changed

8 files changed

+29
-15
lines changed

doc/release-notes/6.9-release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ See [the guides](https://guides.dataverse.org/en/6.9/developers/workflows.html#c
9595
- In prior versions of Dataverse, publishing a dataset via the superuser-only update-current-version option would not set the current curation status (if enabled/used) to none/empty and, in v6.7, would not maintain the curation status history. These issues are now resolved and the update-current-version option works the same as normal publication of a new version with regard to curation status. See #11783 and #11784.
9696
- This release fixes problems with guestbook questions being displayed at download when files are selected from the dataset files table when guestbook-at-request is enabled and not displaying when they should when access is requested from the file page. See #11800, #11808, and #11835.
9797
- The optional Croissant exporter has been updated to 0.1.6 to prevent variable names, variable descriptions, and variable types from being exposed for restricted files. See https://github.com/gdcc/exporter-croissant/pull/20 and #11752.
98+
- Manage Gustbooks page was optimized to load much faster for collections with large numbers of downloads recorded.
9899

99100
## API Updates
100101

src/main/java/edu/harvard/iq/dataverse/GuestbookResponse.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
@Index(columnList = "datafile_id"),
3333
@Index(columnList = "datasetversion_id"),
3434
@Index(columnList = "authenticateduser_id"),
35-
@Index(columnList = "dataset_id")
35+
@Index(columnList = "dataset_id"),
36+
@Index(columnList = "dataset_id, guestbook_id", name="INDEX_GUESTBOOKRESPONSE_dataset_id_guestbook_id"),
37+
@Index(columnList = "dataset_id, eventtype", name="INDEX_GUESTBOOKRESPONSE_dataset_id_eventtype")
3638
})
3739

3840
@NamedQueries(

src/main/java/edu/harvard/iq/dataverse/GuestbookResponseServiceBean.java

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -488,17 +488,25 @@ public Long findCount30Days(Long dataverseId) {
488488
return (Long) query.getSingleResult();
489489
}
490490

491-
public Long findCountAll() {
492-
return findCountAll(null);
493-
}
494-
495491
public Long findCountAll(Long dataverseId) {
496-
String queryString;
497-
if (dataverseId != null) {
498-
queryString = "select count(o.id) from GuestbookResponse o, DvObject v where o.dataset_id = v.id and v.owner_id = " + dataverseId + " ";
499-
} else {
500-
queryString = "select count(o.id) from GuestbookResponse o ";
492+
493+
if (dataverseId == null) {
494+
return null;
501495
}
496+
497+
// Note that this method used to support NULL dataverseId,
498+
// in which case it counted ALL the guestbookresponse rows
499+
// for the entire instance:
500+
// queryString = "select count(o.id) from GuestbookResponse o ";
501+
// I removed this code (it was not being used, thankfully) since
502+
// the query can be insanely expensive on a large production table.
503+
// That's why we use a stored procedure to "estimate" its size, in
504+
// the dedicated getTotalDownloadCount() method further below, for
505+
// example, when we need to show the total number of downloads on
506+
// the homepage. (L.A.)
507+
508+
String queryString = "select count(o.id) from GuestbookResponse o, DvObject v, Dataset d where o.dataset_id = v.id and v.id = d.id and v.owner_id = " + dataverseId + " ";
509+
502510

503511
Query query = em.createNativeQuery(queryString);
504512
return (Long) query.getSingleResult();

src/main/java/edu/harvard/iq/dataverse/ManageFilePermissionsPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ public void setRenderFileMessages(boolean renderFileMessages) {
586586

587587
public String getSignedUrlForRAHistoryCsv() {
588588
//Including /v1 is required for the signature to validate
589-
String apiPath = "/api/v1/datasets/" + dataset.getId() + "/files/permissions/history";
589+
String apiPath = "/api/v1/datasets/" + dataset.getId() + "/files/assignments/history";
590590

591591
try {
592592
// Get the application URL from the system config

src/main/java/edu/harvard/iq/dataverse/ManagePermissionsPage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,10 +701,10 @@ public String getSignedUrlForRAHistoryCsv() {
701701
//Including /v1 in these urls is required for the signature to validate
702702
if (dvObject instanceof Dataverse dv) {
703703
// For Dataverses, use the dataverses API endpoint with the alias
704-
apiPath = "/api/v1/dataverses/" + dv.getAlias() + "/permissions/history";
704+
apiPath = "/api/v1/dataverses/" + dv.getAlias() + "/assignments/history";
705705
} else if (dvObject instanceof Dataset) {
706706
// For Datasets, use the datasets API endpoint with the ID
707-
apiPath = "/api/v1/datasets/" + dvObject.getId() + "/permissions/history";
707+
apiPath = "/api/v1/datasets/" + dvObject.getId() + "/assignments/history";
708708
} else {
709709
// For other types (like DataFile), return null or a default path
710710
return null;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CREATE INDEX IF NOT EXISTS INDEX_GUESTBOOKRESPONSE_dataset_id_guestbook_id ON GUESTBOOKRESPONSE (dataset_id, guestbook_id);
2+
CREATE INDEX IF NOT EXISTS INDEX_GUESTBOOKRESPONSE_dataset_id_eventtype ON GUESTBOOKRESPONSE (dataset_id, eventtype);

src/main/webapp/permissions-manage-files.xhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
</div>
222222
<!-- Role Assignment History Panel -->
223223
<o:importConstants type="edu.harvard.iq.dataverse.settings.FeatureFlags" />
224-
<div class="panel panel-default" rendered="#{FeatureFlags.ROLE_ASSIGNMENT_HISTORY.enabled()}">
224+
<div class="panel panel-default" jsf:rendered="#{FeatureFlags.ROLE_ASSIGNMENT_HISTORY.enabled()}">
225225
<div data-toggle="collapse" data-target="#panelCollapseHistory" class="panel-heading text-info">
226226
#{bundle['dataverse.permissions.history']} <span class="glyphicon glyphicon-chevron-down" /> <span class="text-muted small pull-right">#{bundle['dataverse.permissions.history.description']}</span>
227227
</div>

src/main/webapp/permissions-manage.xhtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
xmlns:ui="http://java.sun.com/jsf/facelets"
66
xmlns:p="http://primefaces.org/ui"
77
xmlns:c="http://java.sun.com/jsp/jstl/core"
8+
xmlns:jsf="http://xmlns.jcp.org/jsf"
89
xmlns:o="http://omnifaces.org/ui"
910
xmlns:iqbs="http://xmlns.jcp.org/jsf/composite/iqbs">
1011

@@ -198,7 +199,7 @@
198199
</div>
199200
<!-- Role Assignment History Panel -->
200201
<o:importConstants type="edu.harvard.iq.dataverse.settings.FeatureFlags" />
201-
<div class="panel panel-default" rendered="#{FeatureFlags.ROLE_ASSIGNMENT_HISTORY.enabled()}">
202+
<div class="panel panel-default" jsf:rendered="#{FeatureFlags.ROLE_ASSIGNMENT_HISTORY.enabled()}">
202203
<div data-toggle="collapse" data-target="#panelCollapseHistory" class="panel-heading text-info">
203204
#{bundle['dataverse.permissions.history']} <span class="glyphicon glyphicon-chevron-down" /> <span class="text-muted small pull-right">#{bundle['dataverse.permissions.history.description']}</span>
204205
</div>

0 commit comments

Comments
 (0)