Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename Private URL to Preview URL and other changes #10961

Merged
merged 49 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
cd2fa36
#8184 ui-bundle changes
sekmiller Oct 8, 2024
06d4fa5
#8184 fix integration test text
sekmiller Oct 8, 2024
bc8e88b
Delete previewurl-popup-fragment.xhtml
sekmiller Oct 8, 2024
e85c422
#8184 update popup and Bundle
sekmiller Oct 16, 2024
94a8942
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Oct 16, 2024
8084bc6
#8184 change nominal url add redirect
sekmiller Oct 16, 2024
bc79834
#8184 revert redirect url
sekmiller Oct 16, 2024
53e2f0e
#8184 fix unit tests
sekmiller Oct 16, 2024
57960c6
#8184 fix existing test
sekmiller Oct 16, 2024
1b8a257
#8184 update constructor/test urls
sekmiller Oct 16, 2024
9285c92
Update dataset-management.rst
sekmiller Oct 17, 2024
8af5b1c
#8184 add updated api endpoints - deprecate private url
sekmiller Oct 17, 2024
34509dc
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Oct 22, 2024
c8b9b38
#8184 display url in popup upon creation
sekmiller Oct 22, 2024
5ae208d
#8184 add release notes
sekmiller Oct 22, 2024
05fd0f8
Update native-api.rst
sekmiller Oct 22, 2024
9a1a0d8
Update native-api.rst
sekmiller Oct 22, 2024
c1acf33
#8184 add endpoints for get by token
sekmiller Oct 22, 2024
0f5fbd1
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Oct 22, 2024
43652f7
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Oct 23, 2024
857cac5
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Oct 23, 2024
daa4cd8
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Oct 24, 2024
d35ecc7
Update native-api.rst reference typo
sekmiller Oct 24, 2024
c2350df
Update dataset-management.rst
sekmiller Oct 24, 2024
9c4b643
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Oct 24, 2024
81a76ef
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Oct 28, 2024
016fc9a
#8184 hide breadcrumbs/header for anon access
sekmiller Oct 29, 2024
5606cff
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Oct 29, 2024
fa904b6
#8184 acceptance testing
sekmiller Oct 30, 2024
a9a60bd
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Oct 30, 2024
a8dbae4
#8184 update disable button labels
sekmiller Oct 31, 2024
42ac8c0
#8184 update popup message per Julian
sekmiller Oct 31, 2024
0b216bb
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 1, 2024
19f6b71
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 5, 2024
3fa89f0
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 6, 2024
9eea8d0
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 6, 2024
1e4fe8e
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 7, 2024
3266d88
Update doc/release-notes/8184-rename-private-url.md
sekmiller Nov 7, 2024
d6001c9
#8184 remove deprecated code redundancy
sekmiller Nov 7, 2024
b64d448
Update native-api.rst
sekmiller Nov 7, 2024
e4e0ee4
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 12, 2024
373f0f7
link to issues and PR in release note
pdurbin Nov 12, 2024
1cd7496
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 13, 2024
aec2722
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 14, 2024
480cb40
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 18, 2024
7f1c2d9
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 19, 2024
18db323
#8184 fix typo
sekmiller Nov 19, 2024
79c9ebe
Merge branch 'develop' into 8184-preview-url-changes
sekmiller Nov 19, 2024
32b7d32
#8184 update refresh delete popup
sekmiller Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/release-notes/8184-rename-private-url.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
###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.
pdurbin marked this conversation as resolved.
Show resolved Hide resolved
43 changes: 22 additions & 21 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2002,70 +2002,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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pdurbin marked this conversation as resolved.
Show resolved Hide resolved

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 @@ -2924,23 +2925,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 @@ -2966,15 +2967,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
20 changes: 10 additions & 10 deletions doc/sphinx-guides/source/user/dataset-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Certain file types in the Dataverse installation are supported by additional fun
File Previews
-------------

Dataverse installations can add previewers for common file types uploaded by their research communities. The previews appear on the file page. If a preview tool for a specific file type is available, the preview will be created and will display automatically, after terms have been agreed to or a guestbook entry has been made, if necessary. File previews are not available for restricted files unless they are being accessed using a Private URL. See also :ref:`privateurl`.
Dataverse installations can add previewers for common file types uploaded by their research communities. The previews appear on the file page. If a preview tool for a specific file type is available, the preview will be created and will display automatically, after terms have been agreed to or a guestbook entry has been made, if necessary. File previews are not available for restricted files unless they are being accessed using a Preview URL. See also :ref:`previewUrl`.

Previewers are available for the following file types:

Expand Down Expand Up @@ -676,23 +676,23 @@ Submit for Review

If you have a Contributor role (can edit metadata, upload files, and edit files, edit Terms, Guestbook, and submit datasets for review) in a Dataverse collection you can submit your dataset for review when you have finished uploading your files and filling in all of the relevant metadata fields. To submit your dataset for review, go to your dataset and click the "Submit for Review" button, which is located next to the "Edit" button on the upper-right. In the confirmation popup, you can review your selection of license (or custom terms, if available). Once you have confirmed the submission, the Admin or Curator for this Dataverse collection will be notified to review this dataset before they decide to either publish the dataset or click "Return to Author". If the dataset is published, the contributor will be notified that it is now published. If the dataset is returned to the author, the contributor of this dataset will be notified that they need to make modifications before it can be submitted for review again.

.. _privateurl:
.. _previewUrl:

Private URL to Review Unpublished Dataset
Preview URL to Review Unpublished Dataset
=========================================

Creating a Private URL for your dataset allows you to share your dataset (for viewing and downloading of files) before it is published to a wide group of individuals who may not have a user account on the Dataverse installation. Anyone you send the Private URL to will not have to log into the Dataverse installation to view the dataset.
Creating a Preview URL for your dataset allows you to share your dataset (for viewing and downloading of files) before it is published to a wide group of individuals who may not have a user account on the Dataverse installation. Anyone you send the Preview URL to will not have to log into the Dataverse installation to view the dataset.

**Note:** To create a Private URL, you must have the *ManageDatasetPermissions* permission for your dataset, usually given by the :ref:`roles <permissions>` *Curator* or *Administrator*.
**Note:** To create a Preview URL, you must have the *ManageDatasetPermissions* permission for your dataset, usually given by the :ref:`roles <permissions>` *Curator* or *Administrator*.

#. Go to your unpublished dataset
#. Select the “Edit” button
#. Select “Private URL” in the dropdown menu
#. In the pop-up select “Create Private URL” or "Create URL for Anonymized Access". The latter supports anonymous review by removing author names and other potentially identifying information from citations, version history tables, and some metadata fields (as configured by the administrator).
#. Copy the Private URL which has been created for this dataset and it can now be shared with anyone you wish to have access to view or download files in your unpublished dataset.
#. Select “Preview URL” in the dropdown menu
#. In the pop-up select “Create General Preview URL” or "Create URL for Anonymized Access". The latter supports anonymous review by removing author names and other potentially identifying information from citations, version history tables, and some metadata fields (as configured by the administrator).
#. Copy the Preview URL which has been created for this dataset and it can now be shared with anyone you wish to have access to view or download files in your unpublished dataset.

To disable a Private URL and to revoke access, follow the same steps as above until step #3 when you return to the popup, click the “Disable Private URL” button.
Note that only one PrivateURL (normal or with anonymized access) can be configured per dataset at a time.
To disable a Preview URL and to revoke access, follow the same steps as above until step #3 when you return to the popup, click the “Disable Preview URL” button.
Note that only one Preview URL (normal or with anonymized access) can be configured per dataset at a time.

Embargoes
=========
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -1935,13 +1935,13 @@ public void updateOwnerDataverse() {
if (selectedHostDataverse != null && selectedHostDataverse.getId() != null) {
ownerId = selectedHostDataverse.getId();
dataset.setOwner(selectedHostDataverse);
logger.info("New host dataverse id: "+ownerId);
logger.info("New host dataverse id: " + ownerId);
// discard the dataset already created
//If a global ID was already assigned, as is true for direct upload, keep it (if files were already uploaded, they are at the path corresponding to the existing global id)
GlobalId gid = dataset.getGlobalId();
dataset = new Dataset();
if(gid!=null) {
dataset.setGlobalId(gid);
if (gid != null) {
dataset.setGlobalId(gid);
}

// initiate from scratch: (isolate the creation of a new dataset in its own method?)
Expand Down Expand Up @@ -2287,8 +2287,17 @@ private String init(boolean initFull) {
JsfHelper.addWarningMessage(message);
}
}
if(isAnonymizedAccess()){
dataverseHeaderFragment.setBreadcrumbs(new ArrayList<>());
}
return null;
}

public void viewActionInitBreadcrumbs(){
if(!isAnonymizedAccess()){
dataverseHeaderFragment.initBreadcrumbs(dataset);
}
}

private void displayWorkflowComments() {
List<WorkflowComment> comments = workingVersion.getWorkflowComments();
Expand Down
72 changes: 68 additions & 4 deletions src/main/java/edu/harvard/iq/dataverse/api/Datasets.java
Original file line number Diff line number Diff line change
Expand Up @@ -2171,8 +2171,32 @@ public Response getAssignments(@Context ContainerRequestContext crc, @PathParam(

@GET
@AuthRequired
@Deprecated(forRemoval = true, since = "2024-10-17")
@Path("{id}/privateUrl")
public Response getPrivateUrlData(@Context ContainerRequestContext crc, @PathParam("id") String idSupplied) {
return getPreviewUrlData(crc, idSupplied);
}

@POST
@AuthRequired
@Deprecated(forRemoval = true, since = "2024-10-17")
@Path("{id}/privateUrl")
public Response createPrivateUrl(@Context ContainerRequestContext crc, @PathParam("id") String idSupplied, @DefaultValue("false") @QueryParam("anonymizedAccess") boolean anonymizedAccess) {
return createPreviewUrl(crc, idSupplied, anonymizedAccess);
}

@DELETE
@AuthRequired
@Deprecated(forRemoval = true, since = "2024-10-17")
@Path("{id}/privateUrl")
public Response deletePrivateUrl(@Context ContainerRequestContext crc, @PathParam("id") String idSupplied) {
return deletePreviewUrl(crc, idSupplied);
}

@GET
@AuthRequired
@Path("{id}/previewUrl")
public Response getPreviewUrlData(@Context ContainerRequestContext crc, @PathParam("id") String idSupplied) {
return response( req -> {
PrivateUrl privateUrl = execCommand(new GetPrivateUrlCommand(req, findDatasetOrDie(idSupplied)));
return (privateUrl != null) ? ok(json(privateUrl))
Expand All @@ -2182,8 +2206,8 @@ public Response getPrivateUrlData(@Context ContainerRequestContext crc, @PathPar

@POST
@AuthRequired
@Path("{id}/privateUrl")
public Response createPrivateUrl(@Context ContainerRequestContext crc, @PathParam("id") String idSupplied,@DefaultValue("false") @QueryParam ("anonymizedAccess") boolean anonymizedAccess) {
@Path("{id}/previewUrl")
public Response createPreviewUrl(@Context ContainerRequestContext crc, @PathParam("id") String idSupplied,@DefaultValue("false") @QueryParam ("anonymizedAccess") boolean anonymizedAccess) {
if(anonymizedAccess && settingsSvc.getValueForKey(SettingsServiceBean.Key.AnonymizedFieldTypeNames)==null) {
throw new NotAcceptableException("Anonymized Access not enabled");
}
Expand All @@ -2194,8 +2218,8 @@ public Response createPrivateUrl(@Context ContainerRequestContext crc, @PathPara

@DELETE
@AuthRequired
@Path("{id}/privateUrl")
public Response deletePrivateUrl(@Context ContainerRequestContext crc, @PathParam("id") String idSupplied) {
@Path("{id}/previewUrl")
public Response deletePreviewUrl(@Context ContainerRequestContext crc, @PathParam("id") String idSupplied) {
return response( req -> {
Dataset dataset = findDatasetOrDie(idSupplied);
PrivateUrl privateUrl = execCommand(new GetPrivateUrlCommand(req, dataset));
Expand All @@ -2208,6 +2232,7 @@ public Response deletePrivateUrl(@Context ContainerRequestContext crc, @PathPara
}, getRequestUser(crc));
}


@GET
@AuthRequired
@Path("{id}/thumbnail/candidates")
Expand Down Expand Up @@ -4833,6 +4858,33 @@ public Response getPrivateUrlDatasetVersion(@PathParam("privateUrlToken") String
}
return ok(responseJson);
}

@GET
@Path("previewUrlDatasetVersion/{previewUrlToken}")
public Response getPreviewUrlDatasetVersion(@PathParam("previewUrlToken") String previewUrlToken, @QueryParam("returnOwners") boolean returnOwners) {
PrivateUrlUser privateUrlUser = privateUrlService.getPrivateUrlUserFromToken(previewUrlToken);
if (privateUrlUser == null) {
return notFound("Private URL user not found");
}
boolean isAnonymizedAccess = privateUrlUser.hasAnonymizedAccess();
String anonymizedFieldTypeNames = settingsSvc.getValueForKey(SettingsServiceBean.Key.AnonymizedFieldTypeNames);
if(isAnonymizedAccess && anonymizedFieldTypeNames == null) {
throw new NotAcceptableException("Anonymized Access not enabled");
}
DatasetVersion dsv = privateUrlService.getDraftDatasetVersionFromToken(previewUrlToken);
if (dsv == null || dsv.getId() == null) {
return notFound("Dataset version not found");
}
JsonObjectBuilder responseJson;
if (isAnonymizedAccess) {
List<String> anonymizedFieldTypeNamesList = new ArrayList<>(Arrays.asList(anonymizedFieldTypeNames.split(",\\s")));
responseJson = json(dsv, anonymizedFieldTypeNamesList, true, returnOwners);
} else {
responseJson = json(dsv, null, true, returnOwners);
}
return ok(responseJson);
}


@GET
@Path("privateUrlDatasetVersion/{privateUrlToken}/citation")
Expand All @@ -4845,6 +4897,18 @@ public Response getPrivateUrlDatasetVersionCitation(@PathParam("privateUrlToken"
return (dsv == null || dsv.getId() == null) ? notFound("Dataset version not found")
: ok(dsv.getCitation(true, privateUrlUser.hasAnonymizedAccess()));
}

@GET
@Path("previewUrlDatasetVersion/{previewUrlToken}/citation")
public Response getPreviewUrlDatasetVersionCitation(@PathParam("previewUrlToken") String previewUrlToken) {
PrivateUrlUser privateUrlUser = privateUrlService.getPrivateUrlUserFromToken(previewUrlToken);
if (privateUrlUser == null) {
return notFound("Private URL user not found");
}
DatasetVersion dsv = privateUrlService.getDraftDatasetVersionFromToken(previewUrlToken);
return (dsv == null || dsv.getId() == null) ? notFound("Dataset version not found")
: ok(dsv.getCitation(true, privateUrlUser.hasAnonymizedAccess()));
}

@GET
@AuthRequired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class PrivateUrl {

public PrivateUrl(RoleAssignment roleAssignment, Dataset dataset, String dataverseSiteUrl) {
this.token = roleAssignment.getPrivateUrlToken();
this.link = dataverseSiteUrl + "/privateurl.xhtml?token=" + token;
this.link = dataverseSiteUrl + "/previewurl.xhtml?token=" + token;
this.dataset = dataset;
this.roleAssignment = roleAssignment;
}
Expand Down
Loading
Loading