Linking to File in unpublished Dataset

18 views
Skip to first unread message

Sebastian Karcher

unread,
Jan 29, 2018, 12:37:41 PM1/29/18
to Dataverse Users Community
This is with version 4.6.2 of Dataverse:

For a project, I'd like to be able to link to individual file landing pages of an unpublished data project.

I have create a private URL for the dataset. What works is:
1. Got to the dataset with the private URL including the token https://<host>/privateurl.xhtml?token=***
2. Then go to the file https://<host>/file.xhtml?fileId=2485&version=DRAFT

I was hoping to be able to link to the file landing page directly by also passing the token as in
https://<host>/file.xhtml?fileId=2485&version=DRAFT&token=***
but that doesn't appear to work.

Is this at all possible? Any ideas other than to tell people "you need to first open the dataset landing page and then open the files in the same browser session"?

Thanks!
Sebastian

Philip Durbin

unread,
Jan 29, 2018, 1:23:48 PM1/29/18
to dataverse...@googlegroups.com
The best work around I can think of is to send two links. The order matters.

The first link would go to the dataset and have the Private URL token right in the link as usual. This link basically logs the user in as a special "PrivateUrlUser" (instead of a "Guest" user) and establishes a session.

The second link would go to the file in question. Because the session has already been established, it should work. Technically, you could also construct a URL directly to the file (API rather than landing page) to download the file, passing the Private URL token as an API token. It sounds like you want to show the landing page for the file though.

Private URL came along in Dataverse 4.5 and the file landing page came along in 4.6. The code would need to be updated to allow file landing pages to work with a Private URL. If you want to create a GitHub issue for this, please go ahead. It's a good idea.

I hope this helps,

Phil



--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/5e01c270-f016-4912-bd87-eaf71d2f9736%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Sebastian Karcher

unread,
Jan 29, 2018, 1:27:32 PM1/29/18
to dataverse...@googlegroups.com
Thanks Phil! Yes, I had come up with the two-step, but was hoping to avoid it.

The API call directly to the file including the token would actually work well for us, it just hadn't occurred to me that linking directly to the file was an option. If you have the syntax at hand, would you mind posting it if it's not too much of a bother? I'd have to dig into the API docs.

Best,
Sebastian

On Mon, Jan 29, 2018 at 1:23 PM, Philip Durbin <philip...@harvard.edu> wrote:
The best work around I can think of is to send two links. The order matters.

The first link would go to the dataset and have the Private URL token right in the link as usual. This link basically logs the user in as a special "PrivateUrlUser" (instead of a "Guest" user) and establishes a session.

The second link would go to the file in question. Because the session has already been established, it should work. Technically, you could also construct a URL directly to the file (API rather than landing page) to download the file, passing the Private URL token as an API token. It sounds like you want to show the landing page for the file though.

Private URL came along in Dataverse 4.5 and the file landing page came along in 4.6. The code would need to be updated to allow file landing pages to work with a Private URL. If you want to create a GitHub issue for this, please go ahead. It's a good idea.

I hope this helps,

Phil


On Mon, Jan 29, 2018 at 12:37 PM, Sebastian Karcher <sebastiankarcher2008@u.northwestern.edu> wrote:
This is with version 4.6.2 of Dataverse:

For a project, I'd like to be able to link to individual file landing pages of an unpublished data project.

I have create a private URL for the dataset. What works is:
1. Got to the dataset with the private URL including the token https://<host>/privateurl.xhtml?token=***
2. Then go to the file https://<host>/file.xhtml?fileId=2485&version=DRAFT

I was hoping to be able to link to the file landing page directly by also passing the token as in
https://<host>/file.xhtml?fileId=2485&version=DRAFT&token=***
but that doesn't appear to work.

Is this at all possible? Any ideas other than to tell people "you need to first open the dataset landing page and then open the files in the same browser session"?

Thanks!
Sebastian

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Sebastian Karcher, PhD
www.sebastiankarcher.com

Philip Durbin

unread,
Jan 29, 2018, 1:54:46 PM1/29/18
to dataverse...@googlegroups.com
We think (and document that) it's more secure to send the API token in the header like this...

curl -H 'X-Dataverse-key: 361ef811-9bf5-44f6-838f-0d9b95221612'

... but that doesn't work as a link. And this is just a read-only Private URL token acting like an API token. (Please don't post real, read/write API tokens in public places.)

The link above should work until I drop the database on my dev1 server, which could be any time. :)

The URL will make more sense once a file can have a DOI or Handle ( https://github.com/IQSS/dataverse/issues/2438 is in QA ). Right now you have to use the database id of a file ("21", above).

I hope this helps,

Phil





--
Sebastian Karcher, PhD
www.sebastiankarcher.com

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sebastian Karcher

unread,
Jan 29, 2018, 2:07:32 PM1/29/18
to dataverse...@googlegroups.com
Yes, thank you Phil, this is perfect and I confirm this works (and the Download URL via API is actually on the file landing page; sorry I didn't spot or remember that).
In other news, we've just reserved our first DOI from our closed beta and expect to release QDR's dataverse as a public beta within the next week or two.


--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Philip Durbin

unread,
Jan 29, 2018, 2:56:09 PM1/29/18
to dataverse...@googlegroups.com
Wow, nice. It would be great to get QDR on the map of installations. When you're ready, please follow the instructions at http://guides.dataverse.org/en/4.8.5/installation/config.html#putting-your-dataverse-installation-on-the-map-at-dataverse-org




--
Sebastian Karcher, PhD
www.sebastiankarcher.com

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sonia Barbosa

unread,
Jan 29, 2018, 4:54:31 PM1/29/18
to dataverse...@googlegroups.com
Exciting, Sebastian!
We've been requested by Gary to blog about your Dataverse. 

Best




--
Sebastian Karcher, PhD
www.sebastiankarcher.com

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages