Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into 11037_deploy_bet…
Browse files Browse the repository at this point in the history
…a_concurrency
  • Loading branch information
Don Sizemore committed Nov 26, 2024
2 parents a79015f + 1c17c3e commit 50fa86b
Show file tree
Hide file tree
Showing 64 changed files with 1,345 additions and 326 deletions.
1 change: 1 addition & 0 deletions conf/solr/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
<field name="datasetValid" type="boolean" stored="true" indexed="true" multiValued="false"/>

<field name="license" type="string" stored="true" indexed="true" multiValued="false"/>
<field name="fileCount" type="plong" stored="true" indexed="true" multiValued="false"/>

<!--
METADATA SCHEMA FIELDS
Expand Down
2 changes: 2 additions & 0 deletions doc/release-notes/10793-optimisticlockexception handling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Improvements have been made in handling the errors when a dataset has been edited in one window and an attempt is made to
edit/publish it in another.
21 changes: 21 additions & 0 deletions doc/release-notes/10888-add-api-for-comparing-dataset-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The following API have been added:

/api/datasets/{persistentId}/versions/{versionId0}/compare/{versionId1}

This API lists the changes between 2 dataset versions. The Json response shows the changes per field within the Metadata block and the Terms Of Access. Also listed are the files that have been added or removed. Files that have been modified will also display the new file data plus the fields that have been modified.
When compare includes an unpublished/draft version the api token must be associated with a user having view unpublished privileges
An error will be returned if VERSION0 was not created before VERSION1

Example of Metadata Block field change:
```json
{
"blockName": "Life Sciences Metadata",
"changed": [
{
"fieldName": "Design Type",
"oldValue": "",
"newValue": "Parallel Group Design; Nested Case Control Design"
}
]
}
```
8 changes: 8 additions & 0 deletions doc/release-notes/11018-update-dataverse-endpoint-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The updateDataverse API endpoint has been updated to support an "inherit from parent" configuration for metadata blocks, facets, and input levels.

When it comes to omitting any of these fields in the request JSON:

- Omitting ``facetIds`` or ``metadataBlockNames`` causes the Dataverse collection to inherit the corresponding configuration from its parent.
- Omitting ``inputLevels`` removes any existing custom input levels in the Dataverse collection.

Previously, not setting these fields meant keeping the existing ones in the Dataverse.
3 changes: 3 additions & 0 deletions doc/release-notes/7239-mydata-results-by-username.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Fix My Data filter results by username for Administrators

The filtering for the username on the MyData page was not working. This is only available for superusers. This fixes the "Results for Username" field to return the data for the desired user. See also #7239 and #10980.
11 changes: 11 additions & 0 deletions doc/release-notes/8184-rename-private-url.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
###Private URL renamed Preview URL

With this release the name of the URL that may be used by dataset administrators to share a draft version of a dataset has been changed from Private URL to Preview URL.

Also, additional information about the creation of Preview URLs has been added to the popup accessed via edit menu of the Dataset Page.

Any Private URLs created in previous versions of Dataverse will continue to work.

The old "privateUrl" API endpoints for the creation and deletion of Preview (formerly Private) URLs have been deprecated. They will continue to work but please switch to the "previewUrl" equivalents that have been [documented](https://dataverse-guide--10961.org.readthedocs.build/en/10961/api/native-api.html#create-a-preview-url-for-a-dataset) in the API Guide.

See also #8184, #8185, #10950, and #10961.
15 changes: 15 additions & 0 deletions doc/release-notes/8941-adding-fileCount-in-solr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Release Highlights

### Adding fileCount as SOLR field

A new search field called `fileCount` can be searched to discover the number of files per dataset. (#10598)

## Upgrade Instructions

1. Update your Solr `schema.xml` to include the new field.
For details, please see https://guides.dataverse.org/en/latest/admin/metadatacustomization.html#updating-the-solr-schema

2. Reindex Solr.
Once the schema.xml is updated, Solr must be restarted and a reindex initiated.
For details, see https://guides.dataverse.org/en/latest/admin/solr-search-index.html but here is the reindex command:
`curl http://localhost:8080/api/admin/index`
2 changes: 2 additions & 0 deletions doc/release-notes/expose-export-formats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# New API method for listing the available exporters
Found at `/api/info/exportFormats`, produces an object with available format names as keys, and as values an object with various info about the exporter. See also #10739.
165 changes: 129 additions & 36 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,17 @@ You should expect an HTTP 200 response and JSON beginning with "status":"OK" fol

Same as in :ref:`create-dataverse-api`, the request JSON supports an optional ``metadataBlocks`` object, with the following supported sub-objects:

- ``metadataBlockNames``: The names of the metadata blocks you want to add to the Dataverse collection.
- ``inputLevels``: The names of the fields in each metadata block for which you want to add a custom configuration regarding their inclusion or requirement when creating and editing datasets in the new Dataverse collection. Note that if the corresponding metadata blocks names are not specified in the ``metadataBlockNames``` field, they will be added automatically to the Dataverse collection.
- ``facetIds``: The names of the fields to use as facets for browsing datasets and collections in the new Dataverse collection. Note that the order of the facets is defined by their order in the provided JSON array.
- ``metadataBlockNames``: The names of the metadata blocks to be assigned to the Dataverse collection.
- ``inputLevels``: The names of the fields in each metadata block for which you want to add a custom configuration regarding their inclusion or requirement when creating and editing datasets in the Dataverse collection. Note that if the corresponding metadata blocks names are not specified in the ``metadataBlockNames``` field, they will be added automatically to the Dataverse collection.
- ``facetIds``: The names of the fields to use as facets for browsing datasets and collections in the Dataverse collection. Note that the order of the facets is defined by their order in the provided JSON array.

Note that setting any of these fields overwrites the previous configuration.

When it comes to omitting these fields in the JSON:

- Omitting ``facetIds`` or ``metadataBlockNames`` causes the Dataverse collection to inherit the corresponding configuration from its parent.
- Omitting ``inputLevels`` removes any existing custom input levels in the Dataverse collection.
- Omitting the entire ``metadataBlocks`` object in the request JSON would exclude the three sub-objects, resulting in the application of the two changes described above.

To obtain an example of how these objects are included in the JSON file, download :download:`dataverse-complete-optional-params.json <../_static/api/dataverse-complete-optional-params.json>` file and modify it to suit your needs.

Expand Down Expand Up @@ -1698,6 +1706,28 @@ The fully expanded example above (without environment variables) looks like this
curl "https://demo.dataverse.org/api/datasets/24/versions/1.0/metadata/citation"
Compare Versions of a Dataset
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns a list of fields that have changed between 2 Dataset versions within the Metadata and Terms of Access. Also includes the files that have been added or removed as well as files that have been modified.
When compare includes an unpublished/draft version the api token must be associated with a user having view unpublished privileges
An error will be returned if VERSION0 was not created before VERSION1

.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
export ID=24
export VERSION0=1.0
export VERSION1=:draft
curl "$SERVER_URL/api/datasets/$ID/versions/$VERSION0/compare/$VERSION1"
The fully expanded example above (without environment variables) looks like this:

.. code-block:: bash
curl "https://demo.dataverse.org/api/datasets/24/versions/:latest-published/compare/:draft"
Update Metadata For a Dataset
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -2006,70 +2036,71 @@ The fully expanded example above (without environment variables) looks like this
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X DELETE "https://demo.dataverse.org/api/datasets/2347/assignments/6"
Create a Private URL for a Dataset
Create a Preview URL for a Dataset
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Create a Private URL (must be able to manage dataset permissions):
Create a Preview URL (must be able to manage dataset permissions):

.. code-block:: bash
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
export ID=24
curl -H "X-Dataverse-key: $API_TOKEN" -X POST "$SERVER_URL/api/datasets/$ID/privateUrl"
curl -H "X-Dataverse-key: $API_TOKEN" -X POST "$SERVER_URL/api/datasets/$ID/previewUrl"
The fully expanded example above (without environment variables) looks like this:

.. code-block:: bash
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X POST "https://demo.dataverse.org/api/datasets/24/privateUrl"
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X POST "https://demo.dataverse.org/api/datasets/24/previewUrl"
If Anonymized Access has been enabled on a Dataverse installation (see the :ref:`:AnonymizedFieldTypeNames` setting), an optional 'anonymizedAccess' query parameter is allowed.
Setting anonymizedAccess=true in your call will create a PrivateURL that only allows an anonymized view of the Dataset (see :ref:`privateurl`).
Setting anonymizedAccess=true in your call will create a PreviewURL that only allows an anonymized view of the Dataset (see :ref:`previewUrl`).

.. code-block:: bash
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X POST "https://demo.dataverse.org/api/datasets/24/privateUrl?anonymizedAccess=true"
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X POST "https://demo.dataverse.org/api/datasets/24/previewUrl?anonymizedAccess=true"
Note: Previous endpoints with privateUrl instead of previewUrl are deprecated, but supported.

Get the Private URL for a Dataset
Get the Preview URL for a Dataset
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Get a Private URL from a dataset (if available):
Get a Preview URL from a dataset (if available):

.. code-block:: bash
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
export ID=24
curl -H "X-Dataverse-key: $API_TOKEN" "$SERVER_URL/api/datasets/$ID/privateUrl"
curl -H "X-Dataverse-key: $API_TOKEN" "$SERVER_URL/api/datasets/$ID/previewUrl"
The fully expanded example above (without environment variables) looks like this:

.. code-block:: bash
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" "https://demo.dataverse.org/api/datasets/24/privateUrl"
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" "https://demo.dataverse.org/api/datasets/24/previewUrl"
Delete the Private URL from a Dataset
Delete the Preview URL from a Dataset
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Delete a Private URL from a dataset (if it exists):
Delete a Preview URL from a dataset (if it exists):

.. code-block:: bash
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
export ID=24
curl -H "X-Dataverse-key: $API_TOKEN" -X DELETE "$SERVER_URL/api/datasets/$ID/privateUrl"
curl -H "X-Dataverse-key: $API_TOKEN" -X DELETE "$SERVER_URL/api/datasets/$ID/previewUrl"
The fully expanded example above (without environment variables) looks like this:

.. code-block:: bash
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X DELETE "https://demo.dataverse.org/api/datasets/24/privateUrl"
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X DELETE "https://demo.dataverse.org/api/datasets/24/previewUrl"
.. _add-file-api:

Expand Down Expand Up @@ -2928,23 +2959,23 @@ Signposting is not supported for draft dataset versions.
curl -H "Accept:application/json" "$SERVER_URL/api/datasets/:persistentId/versions/$VERSION/linkset?persistentId=$PERSISTENT_IDENTIFIER"
Get Dataset By Private URL Token
Get Dataset By Preview URL Token
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
export PRIVATE_URL_TOKEN=a56444bc-7697-4711-8964-e0577f055fd2
export PREVIEW_URL_TOKEN=a56444bc-7697-4711-8964-e0577f055fd2
curl "$SERVER_URL/api/datasets/privateUrlDatasetVersion/$PRIVATE_URL_TOKEN"
curl "$SERVER_URL/api/datasets/privateUrlDatasetVersion/$PREVIEW_URL_TOKEN"
If you want to include the Dataverse collections that this dataset is part of, you must set ``returnOwners`` query parameter to ``true``.

Usage example:

.. code-block:: bash
curl "https://demo.dataverse.org/api/datasets/privateUrlDatasetVersion/a56444bc-7697-4711-8964-e0577f055fd2?returnOwners=true"
curl "https://demo.dataverse.org/api/datasets/previewUrlDatasetVersion/a56444bc-7697-4711-8964-e0577f055fd2?returnOwners=true"
.. _get-citation:
Expand All @@ -2970,15 +3001,15 @@ Usage example:
curl -H "Accept:application/json" "$SERVER_URL/api/datasets/:persistentId/versions/$VERSION/{version}/citation?persistentId=$PERSISTENT_IDENTIFIER&includeDeaccessioned=true"
Get Citation by Private URL Token
Get Citation by Preview URL Token
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
export PRIVATE_URL_TOKEN=a56444bc-7697-4711-8964-e0577f055fd2
export PREVIEW_URL_TOKEN=a56444bc-7697-4711-8964-e0577f055fd2
curl "$SERVER_URL/api/datasets/privateUrlDatasetVersion/$PRIVATE_URL_TOKEN/citation"
curl "$SERVER_URL/api/datasets/previewUrlDatasetVersion/$PREVIEW_URL_TOKEN/citation"
.. _get-dataset-summary-field-names:

Expand Down Expand Up @@ -4858,6 +4889,35 @@ The fully expanded example above (without environment variables) looks like this
curl "https://demo.dataverse.org/api/info/settings/:MaxEmbargoDurationInMonths"
Get Export Formats
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the available export formats, including custom formats.
The response contains an object with available format names as keys, and as values an object with the following properties:
* ``displayName``
* ``mediaType``
* ``isHarvestable``
* ``isVisibleInUserInterface`` (corresponds to isAvailableToUsers)
* ``XMLNameSpace`` (only for XML exporters)
* ``XMLSchemaLocation`` (only for XML exporters)
* ``XMLSchemaVersion`` (only for XML exporters)
.. note:: See :ref:`curl-examples-and-environment-variables` if you are unfamiliar with the use of export below.
.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
curl "$SERVER_URL/api/info/exportFormats"
The fully expanded example above (without environment variables) looks like this:
.. code-block:: bash
curl "https://demo.dataverse.org/api/info/exportFormats"
.. _metadata-blocks-api:
Metadata Blocks
Expand Down Expand Up @@ -6084,29 +6144,62 @@ Saved Search
~~~~~~~~~~~~
The Saved Search, Linked Dataverses, and Linked Datasets features are only accessible to superusers except for linking a dataset. The following API endpoints were added to help people with access to the "admin" API make use of these features in their current form. Keep in mind that they are partially experimental.
The update of all saved search is run by a timer once a week (See :ref:`saved-search-timer`) so if you just created a saved search, you can run manually ``makelinks`` endpoint that will find new dataverses and datasets that match the saved search and then link the search results to the dataverse in which the saved search is defined.
The update of all saved search is run by a timer once a week (See :ref:`saved-search-timer`) so if you just created a saved search, you can run manually the ``makelinks`` endpoint that will find new dataverses and datasets that match the saved search and then link the search results to the dataverse in which the saved search is defined.
List all saved searches. ::
List All Saved Searches
^^^^^^^^^^^^^^^^^^^^^^^
GET http://$SERVER/api/admin/savedsearches/list
.. code-block:: bash
List a saved search by database id. ::
export SERVER_URL=https://demo.dataverse.org
GET http://$SERVER/api/admin/savedsearches/$id
curl "$SERVER_URL/api/admin/savedsearches/list"
Delete a saved search by database id.
List a Saved Search by Database ID
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``unlink=true`` query parameter unlinks all links (linked dataset or Dataverse collection) associated with the deleted saved search. Use of this parameter should be well considered as you cannot know if the links were created manually or by the saved search. After deleting a saved search with ``unlink=true``, we recommend running ``/makelinks/all`` just in case there was a dataset that was linked by another saved search. (Saved searches can link the same dataset.) Reindexing might be necessary as well.::
.. code-block:: bash
DELETE http://$SERVER/api/admin/savedsearches/$id?unlink=true
export SERVER_URL=https://demo.dataverse.org
export ID=1
Execute a saved search by database id and make links to Dataverse collections and datasets that are found. The JSON response indicates which Dataverse collections and datasets were newly linked versus already linked. The ``debug=true`` query parameter adds to the JSON response extra information about the saved search being executed (which you could also get by listing the saved search). ::
curl "$SERVER_URL/api/admin/savedsearches/$ID"
Delete a Saved Search by Database ID
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``unlink=true`` query parameter unlinks all links (linked dataset or Dataverse collection) associated with the deleted saved search. Use of this parameter should be well considered as you cannot know if the links were created manually or by the saved search. After deleting a saved search with ``unlink=true``, we recommend running ``/makelinks/all`` just in case there was a dataset that was linked by another saved search. (Saved searches can link the same dataset.) Reindexing might be necessary as well.
.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
export ID=1
PUT http://$SERVER/api/admin/savedsearches/makelinks/$id?debug=true
curl -X DELETE "$SERVER_URL/api/admin/savedsearches/$ID?unlink=true"
Execute all saved searches and make links to Dataverse collections and datasets that are found. ``debug`` works as described above. This happens automatically with a timer. For details, see :ref:`saved-search-timer` in the Admin Guide. ::
Execute a Saved Search and Make Links
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Execute a saved search by database id and make links to Dataverse collections and datasets that are found. The JSON response indicates which Dataverse collections and datasets were newly linked versus already linked. The ``debug=true`` query parameter adds to the JSON response extra information about the saved search being executed (which you could also get by listing the saved search).
.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
export ID=1
curl -X PUT "$SERVER_URL/api/admin/savedsearches/makelinks/$ID?debug=true"
Execute All Saved Searches and Make Links
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Execute all saved searches and make links to Dataverse collections and datasets that are found. ``debug`` works as described above. This happens automatically with a timer. For details, see :ref:`saved-search-timer` in the Admin Guide.
.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
export ID=1
PUT http://$SERVER/api/admin/savedsearches/makelinks/all?debug=true
curl -X PUT "$SERVER_URL/api/admin/savedsearches/makelinks/all?debug=true"
Dataset Integrity
~~~~~~~~~~~~~~~~~
Expand Down
Loading

0 comments on commit 50fa86b

Please sign in to comment.