Skip to content

Commit 88d280d

Browse files
Merge branch 'develop' into 12030-unable-to-delete-dataverse-with-metrics
2 parents 1798141 + f214ee4 commit 88d280d

26 files changed

Lines changed: 578 additions & 85 deletions

conf/keycloak/builtin-users-spi/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
</build>
101101

102102
<properties>
103-
<keycloak.version>26.4.7</keycloak.version>
103+
<keycloak.version>26.5.0</keycloak.version>
104104
<java.version>17</java.version>
105105
<jakarta.persistence.version>3.2.0</jakarta.persistence.version>
106106
<mindrot.jbcrypt.version>0.4</mindrot.jbcrypt.version>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## New Endpoint: POST `/dataverses/{id}/template/default/{templateId}`
2+
3+
A new endpoint has been implemented to set the default template to a given dataverse collection.
4+
5+
### Functionality
6+
- Sets the default template of the given dataverse collection.
7+
- You must have edit dataverse permission in the collection in order to use this endpoint.
8+
9+
## New Endpoint: DELETE `/dataverses/{id}/template/default`
10+
11+
A new endpoint has been implemented to remove the default template to a given dataverse collection.
12+
13+
### Functionality
14+
- Removes the default template of the given dataverse collection.
15+
- You must have edit dataverse permission in the collection in order to use this endpoint.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The My Data API now supports the `metadata_fields`, `sort` and `order`, `show_collections` and `fq` parameters, which enhances its functionality and brings it in line with the search API.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This release removes an undocumented restriction on the API calls to get, set, and delete archival status. They did not work on deaccessioned dataset versions and now do. (See https://guides.dataverse.org/en/latest/api/native-api.html#get-the-archival-status-of-a-dataset-by-version )
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Bug Fix
2+
3+
Handles from hdl.handle.net with urls of `/citation` instead of `/dataset.xhtml` were not properly redirecting. This fix adds a lookup for alternate PID so `/citation` endpoint will redirect to `/dataset.xhtml`
4+
5+

doc/sphinx-guides/source/api/native-api.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,50 @@ The fully expanded example above (without environment variables) looks like this
16391639
16401640
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X POST "https://demo.dataverse.org/api/dataverses/1/templates" --upload-file dataverse-template.json
16411641
1642+
Set a Default Template for a Collection
1643+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1644+
1645+
Sets a template as the default template for a collection:
1646+
1647+
.. code-block:: bash
1648+
1649+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1650+
export SERVER_URL=https://demo.dataverse.org
1651+
export ID=1
1652+
export TEMPLATEID=2
1653+
1654+
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/dataverses/$ID/template/default/$TEMPLATEID"
1655+
1656+
The fully expanded example above (without environment variables) looks like this:
1657+
1658+
.. code-block:: bash
1659+
1660+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X POST "https://demo.dataverse.org/api/dataverses/1/template/default/2"
1661+
1662+
You must have Edit Dataverse permission within the given dataverse collection to invoke this api.
1663+
1664+
Remove a Default Template for a Collection
1665+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1666+
1667+
Remove a template as the default template for a collection(Note: the template is not deleted; it will still be available for use in the collection):
1668+
1669+
.. code-block:: bash
1670+
1671+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1672+
export SERVER_URL=https://demo.dataverse.org
1673+
export ID=1
1674+
1675+
1676+
curl -H "X-Dataverse-key:$API_TOKEN" -X DELETE "$SERVER_URL/api/dataverses/$ID/template/default"
1677+
1678+
The fully expanded example above (without environment variables) looks like this:
1679+
1680+
.. code-block:: bash
1681+
1682+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X DELETE "https://demo.dataverse.org/api/dataverses/1/template/default"
1683+
1684+
You must have Edit Dataverse permission within the given dataverse collection to invoke this api.
1685+
16421686

16431687
Dataverse Role Assignment History
16441688
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -8690,6 +8734,16 @@ Parameters:
86908734
86918735
``per_page`` Number of results returned per page.
86928736
8737+
``metadata_fields`` Includes the requested fields for each dataset in the response. Multiple "metadata_fields" parameters can be used to include several fields. See :doc:`search` for further information on this parameter.
8738+
8739+
``show_collections`` Whether or not to include a list of parent and linked collections for each dataset search result.
8740+
8741+
``sort`` The sort field. Supported values include "name", "date" and "relevance".
8742+
8743+
``order`` The order in which to sort. Can either be "asc" or "desc".
8744+
8745+
``fq`` A filter query to filter the list returned. Multiple "fq" parameters can be used.
8746+
86938747
MyData Collection List
86948748
~~~~~~~~~~~~~~~~~~~~~~
86958749

doc/sphinx-guides/source/api/search.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Name Type Description
2727
q string The search term or terms. Using "title:data" will search only the "title" field. "*" can be used as a wildcard either alone or adjacent to a term (i.e. "bird*"). For example, https://demo.dataverse.org/api/search?q=title:data . For a list of fields to search, please see https://github.com/IQSS/dataverse/issues/2558 (for now).
2828
type string Can be either "dataverse", "dataset", or "file". Multiple "type" parameters can be used to include multiple types (i.e. ``type=dataset&type=file``). If omitted, all types will be returned. For example, https://demo.dataverse.org/api/search?q=*&type=dataset
2929
subtree string The identifier of the Dataverse collection to which the search should be narrowed. The subtree of this Dataverse collection and all its children will be searched. Multiple "subtree" parameters can be used to include multiple Dataverse collections. For example, https://demo.dataverse.org/api/search?q=data&subtree=birds&subtree=cats .
30-
sort string The sort field. Supported values include "name" and "date". See example under "order".
30+
sort string The sort field. Supported values include "name", "date" and "relevance". See example under "order".
3131
order string The order in which to sort. Can either be "asc" or "desc". For example, https://demo.dataverse.org/api/search?q=data&sort=name&order=asc
3232
per_page int The number of results to return per request. The default is 10. The max is 1000. See :ref:`iteration example <iteration-example>`.
3333
start int A cursor for paging through search results. See :ref:`iteration example <iteration-example>`.

docker-compose-dev.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ services:
141141
restart: on-failure
142142
ports:
143143
- "8983:8983"
144+
environment:
145+
- SOLR_OPTS=-Dsolr.jetty.request.header.size=102400
144146
networks:
145147
- dataverse
146148
command:

docker/compose/demo/compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ services:
141141
restart: on-failure
142142
ports:
143143
- "8983:8983"
144+
environment:
145+
- SOLR_OPTS=-Dsolr.jetty.request.header.size=102400
144146
networks:
145147
- dataverse
146148
command:

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
3838

3939
String persistentId = request.getParameter("persistentId");
4040
if (persistentId != null) {
41-
DvObject dob = dvObjectService.findByGlobalId(PidUtil.parseAsGlobalID(persistentId));
41+
GlobalId globalId = PidUtil.parseAsGlobalID(persistentId);
42+
DvObject dob = dvObjectService.findByGlobalId(globalId);
43+
if (dob == null) {
44+
// try to find with alternative PID
45+
dob = dvObjectService.findByAltGlobalId(globalId, DvObject.DType.Dataset);
46+
}
4247
if (dob != null) {
4348
if (dob instanceof Dataset) {
4449
response.sendRedirect("dataset.xhtml?persistentId=" + persistentId);

0 commit comments

Comments
 (0)