Skip to content

Commit 1d3e2e4

Browse files
Merge branch 'develop' into 12030-unable-to-delete-dataverse-with-metrics
2 parents f4c6103 + 79ee88c commit 1d3e2e4

File tree

11 files changed

+32
-17
lines changed

11 files changed

+32
-17
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

doc/sphinx-guides/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
# built documents.
7171
#
7272
# The short X.Y version.
73-
version = '6.8'
73+
version = '6.9'
7474
# The full version, including alpha/beta/rc tags.
7575
release = version
7676

doc/sphinx-guides/source/versions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This list provides a way to refer to the documentation for previous and future v
88

99
- pre-release `HTML (not final!) <http://preview.guides.gdcc.io/en/develop/>`__ and `PDF (experimental!) <http://preview.guides.gdcc.io/_/downloads/en/develop/pdf/>`__ built from the :doc:`develop </developers/version-control>` branch :doc:`(how to contribute!) </contributor/documentation>`
1010
- |version|
11+
- `6.8 </en/6.8/>`__
1112
- `6.7.1 </en/6.7.1/>`__
1213
- `6.7 </en/6.7/>`__
1314
- `6.6 </en/6.6/>`__

modules/dataverse-parent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132

133133
<properties>
134134
<!-- This is a special Maven property name, do not change! -->
135-
<revision>6.8</revision>
135+
<revision>6.9</revision>
136136

137137
<target.java.version>17</target.java.version>
138138
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

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>

0 commit comments

Comments
 (0)