Skip to content

Commit

Permalink
more guide entries #8889
Browse files Browse the repository at this point in the history
  • Loading branch information
landreev committed May 23, 2023
1 parent 4d9e9b1 commit e757a77
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
18 changes: 18 additions & 0 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,24 @@ The fully expanded example above (without environment variables) looks like this
curl -H X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx https://demo.dataverse.org/api/dataverses/root/guestbookResponses?guestbookId=1 -o myResponses.csv
.. _collection-attributes-api:

Change Collection Attributes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block::
curl -H X-Dataverse-key:$API_TOKEN $SERVER_URL/api/dataverses/$ID/attribute/$ATTRIBUTE?value=$VALUE
The following attributes are supported:

* ``alias`` Collection alias
* ``name`` Name
* ``description`` Description
* ``affiliation`` Affiliation
* ``filePIDsEnabled`` ("true" or "false") Enables or disables registraion of file-level PIDs in datasets within the collection (overriding the instance-wide setting).


Datasets
--------

Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2712,7 +2712,7 @@ If you don't want to register file-based PIDs for your installation, set:

Note: File-level PID registration was added in Dataverse Software 4.9; it could not be disabled until Dataverse Software 4.9.3.

It is possible to override the installation-wide setting for specific collections. For example, it registration of PIDs for files can be enabled in a specific collection when it is disabled instance-wide. Or it can be disabled in specific collections where it is enabled by default. See ... for details.
It is possible to override the installation-wide setting for specific collections. For example, it registration of PIDs for files can be enabled in a specific collection when it is disabled instance-wide. Or it can be disabled in specific collections where it is enabled by default. See :ref:`collection-attributes-api` for details.

.. _:IndependentHandleService:

Expand Down
14 changes: 12 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public class Dataverses extends AbstractApiBean {

@EJB
SwordServiceBean swordService;

@POST
@AuthRequired
public Response addRoot(@Context ContainerRequestContext crc, String body) {
Expand Down Expand Up @@ -610,12 +610,22 @@ public Response updateAttribute(@Context ContainerRequestContext crc, @PathParam
case "affiliation":
collection.setAffiliation(value);
break;
/* commenting out the code from the draft pr #9462:
case "versionPidsConduct":
CollectionConduct conduct = CollectionConduct.findBy(value);
if (conduct == null) {
return badRequest("'" + value + "' is not one of [" +
String.join(",", CollectionConduct.asList()) + "]");
}
collection.setDatasetVersionPidConduct(conduct);
break;
*/
case "filePIDsEnabled":
collection.setFilePIDsEnabled(parseBooleanOrDie(value));
default:
return badRequest("'" + attribute + "' is not a supported attribute");
}

// Off to persistence layer
execCommand(new UpdateDataverseCommand(collection, null, null, dvRequest, null));

Expand Down

0 comments on commit e757a77

Please sign in to comment.