GlobalDataverseCommunityConsortium / dataverse-previewers

A collection of Datafile Previewers that can be configured to work with Dataverse
MIT License
13 stars 38 forks source link

Can i check if these previewers are compatible with dataverse 5.5? #60

Closed ghost closed 2 years ago

ghost commented 2 years ago

hi,

Can i check if these previewers are compatible with dataverse 5.5?

I have added all the previewers to my dataverse by pasting all the commands under https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers#curl-commands-to-configure-these-tools-with-your-dataverse-instance

I have also run "curl http://localhost:8080/api/admin/externalTools" to confirm they are installed.

However, when i click on "Read Document" for pdf files (see appended pic), I get this error "Unable to retrieve metadata.errorTexterror" (see appended pic). This error also show up for all the other formats with a "preview option" i.e. images, csv, mp3 and mp4 files. image image

In addition, my datasetdisplay (see appended pic) looks different from this example https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/blob/master/examples/datasetdisplay.png. The preview option is under the download icon instead of showing up as a button like the example. image

So, i would like to check if these previewers are compatible with dataverse 5.5.

Thank you in advance!

qqmyers commented 2 years ago

Yes, the previewers should be compatible with 5.5/all versions of Dataverse. I suspect two things are going on:

1) W.r.t. showing up as an explore tool – there was a change as of v5.2 to split the concept of ‘explore’ and ‘preview’ tools. (Preview tools show up as a separate icon and appear inline in the file page, explore tools show up as you’re seeing). If you had previewers installed already (prior to v 5.2), updating Dataverse will make them appear as previewers automatically. To install previewers into newer Dataverse versions, there are examples at https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/blob/develop/5.2curlcommands.md that address the change. (FWIW: We’ve gotten behind in moving these from the develop branch to the master branch – that is complicated by the fact that the develop branch also has new versions of previewers with better internationalization and because the default option is to use the previewers hosted from github.io, so merging changes from the develop branch immediately effects all sites using the previewers from github.io. We also want to move the previewers from the GlobalDataverseCommunityConsortium repository to the ‘gdcc’ repository to shorten the URLs which also involves changes for those running the previewers from github.io. In any case, I’ll prioritize getting the post v5.2 instructions out where they are more visible).

2) The error in being able to read metadata is possibly due to CORS, especially if you are using S3 with direct download. Basically CORS is a restriction stopping scripts on a page from one web server accessing and displaying content from another, unless that second site allows it. The best way to tell is to open the development tools/console in your browser and to look at the source of the error, e.g. if you look at the Network pane and refresh the page, you should see a calls to get the metadata and data that are failing for some reason. The URLs being called are inaccessible for some reason, possibly a CORS problem, but, if you have a typo or misconfiguration, the URLs used might not actually point to your Dataverse/your data storage like they should. If the issue is CORS, the info at https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/wiki/Using-Previewers-with-download-redirects-from-S3 explains how to enable CORS requests if you are using S3/direct downloads. Dataverse also has an :AllowCors setting that can’t be false if you want to use the previewers served from github.io. In either case, if you can’t figure out what is going wrong after looking at the error on the Network pane, send the details of your Dataverse’s URL, what URL the previewer is calling, and what the browser says the error is and we can hopefully diagnose remotely. (Note that if CORS is not allowed by policy at your site, you can host the previewers locally and avoid the need for it.)

Hope that helps, -- Jim

From: ed3of @.*** Sent: Sunday, October 17, 2021 11:38 PM To: GlobalDataverseCommunityConsortium/dataverse-previewers Cc: Subscribed Subject: [GlobalDataverseCommunityConsortium/dataverse-previewers] Can i check if these previewers are compatible with dataverse 5.5? (Issue #60)

hi,

Can i check if these previewers are compatible with dataverse 5.5?

I have added all the previewers to my dataverse by pasting all the commands under https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers#curl-commands-to-configure-these-tools-with-your-dataverse-instance

I have also run "curl http://localhost:8080/api/admin/externalTools" to confirm they are installed.

However, when i click on "Read Document" for pdf files (see appended pic), I get this error "Unable to retrieve metadata.errorTexterror" (see appended pic). This error also show up for all the other formats with a "preview option" i.e. images, csv, mp3 and mp4 files. [image]https://user-images.githubusercontent.com/92703478/137664786-85616dd1-2ec9-4216-93a9-2e8f47071c8a.png [image]https://user-images.githubusercontent.com/92703478/137664803-05e68b79-1f02-48dc-9a6c-52f951ca6f2d.png

In addition, my datasetdisplay (see appended pic) looks different from this example https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/blob/master/examples/datasetdisplay.png. The preview option is under the download icon instead of showing up as a button like the example. [image]https://user-images.githubusercontent.com/92703478/137664633-3833ab58-3a5b-47a7-b10c-19bfb3b25ed5.png

So, i would like to check if these previewers are compatible with dataverse 5.5.

Thank you in advance!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/issues/60, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABTLRTYLGXFLI4NLL7RKW2LUHOJCHANCNFSM5GFTSHMQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

qqmyers commented 2 years ago

FWIW: One other possibility I saw when testing (by looking in the browser Network pane): If you are running a test Dataverse at an http:// address and are using the previewers from github.io where are served over https://, the browser will block access and result in the ‘Unable to retrieve metadata’ error. IN this case you can install previewers locally or set your Dataverse up on https://.

-- Jim

From: James Myers Sent: Monday, October 18, 2021 8:13 AM To: GlobalDataverseCommunityConsortium/dataverse-previewers; GlobalDataverseCommunityConsortium/dataverse-previewers Cc: Subscribed Subject: RE: [GlobalDataverseCommunityConsortium/dataverse-previewers] Can i check if these previewers are compatible with dataverse 5.5? (Issue #60)

Yes, the previewers should be compatible with 5.5/all versions of Dataverse. I suspect two things are going on:

1) W.r.t. showing up as an explore tool – there was a change as of v5.2 to split the concept of ‘explore’ and ‘preview’ tools. (Preview tools show up as a separate icon and appear inline in the file page, explore tools show up as you’re seeing). If you had previewers installed already (prior to v 5.2), updating Dataverse will make them appear as previewers automatically. To install previewers into newer Dataverse versions, there are examples at https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/blob/develop/5.2curlcommands.md that address the change. (FWIW: We’ve gotten behind in moving these from the develop branch to the master branch – that is complicated by the fact that the develop branch also has new versions of previewers with better internationalization and because the default option is to use the previewers hosted from github.io, so merging changes from the develop branch immediately effects all sites using the previewers from github.io. We also want to move the previewers from the GlobalDataverseCommunityConsortium repository to the ‘gdcc’ repository to shorten the URLs which also involves changes for those running the previewers from github.io. In any case, I’ll prioritize getting the post v5.2 instructions out where they are more visible).

2) The error in being able to read metadata is possibly due to CORS, especially if you are using S3 with direct download. Basically CORS is a restriction stopping scripts on a page from one web server accessing and displaying content from another, unless that second site allows it. The best way to tell is to open the development tools/console in your browser and to look at the source of the error, e.g. if you look at the Network pane and refresh the page, you should see a calls to get the metadata and data that are failing for some reason. The URLs being called are inaccessible for some reason, possibly a CORS problem, but, if you have a typo or misconfiguration, the URLs used might not actually point to your Dataverse/your data storage like they should. If the issue is CORS, the info at https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/wiki/Using-Previewers-with-download-redirects-from-S3 explains how to enable CORS requests if you are using S3/direct downloads. Dataverse also has an :AllowCors setting that can’t be false if you want to use the previewers served from github.io. In either case, if you can’t figure out what is going wrong after looking at the error on the Network pane, send the details of your Dataverse’s URL, what URL the previewer is calling, and what the browser says the error is and we can hopefully diagnose remotely. (Note that if CORS is not allowed by policy at your site, you can host the previewers locally and avoid the need for it.)

Hope that helps, -- Jim

From: ed3of @.*** Sent: Sunday, October 17, 2021 11:38 PM To: GlobalDataverseCommunityConsortium/dataverse-previewers Cc: Subscribed Subject: [GlobalDataverseCommunityConsortium/dataverse-previewers] Can i check if these previewers are compatible with dataverse 5.5? (Issue #60)

hi,

Can i check if these previewers are compatible with dataverse 5.5?

I have added all the previewers to my dataverse by pasting all the commands under https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers#curl-commands-to-configure-these-tools-with-your-dataverse-instance

I have also run "curl http://localhost:8080/api/admin/externalTools" to confirm they are installed.

However, when i click on "Read Document" for pdf files (see appended pic), I get this error "Unable to retrieve metadata.errorTexterror" (see appended pic). This error also show up for all the other formats with a "preview option" i.e. images, csv, mp3 and mp4 files. [image]https://user-images.githubusercontent.com/92703478/137664786-85616dd1-2ec9-4216-93a9-2e8f47071c8a.png [image]https://user-images.githubusercontent.com/92703478/137664803-05e68b79-1f02-48dc-9a6c-52f951ca6f2d.png

In addition, my datasetdisplay (see appended pic) looks different from this example https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/blob/master/examples/datasetdisplay.png. The preview option is under the download icon instead of showing up as a button like the example. [image]https://user-images.githubusercontent.com/92703478/137664633-3833ab58-3a5b-47a7-b10c-19bfb3b25ed5.png

So, i would like to check if these previewers are compatible with dataverse 5.5.

Thank you in advance!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/issues/60, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABTLRTYLGXFLI4NLL7RKW2LUHOJCHANCNFSM5GFTSHMQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

sergejzr commented 2 years ago

Good day, at least at our test installation the previewers work as expected. Our dataverse is runnig behind apache, so I checked out into apache content folder and added into VirtualHost.conf:

ProxyPassMatch ^/dataverse-previewers

So the perviewers would serve directly without proxeing requests to dataverse.

What I noticed is that previewers are using root urls like (in TextPreview.html): "link type="text/css" rel="stylesheet" href="/dataverse-previewers/previewers/css/preview.css"/" This makes it impossible to have previewers in a folder other than "/dataverse-previewers" (or you will have to add the "base" html tag, which requires changes in the original folder that I would like to avoid since I want to update the folder using git from time to time)

A side question - the previewers do, as the name suggests, preview contents of the file. They are not responsible for generating the thumbnails for different datatypes, right? I just saw pdf-thumbnail in README of this repository. How did you achieve that? https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/raw/master/examples/datasetdisplay.png?raw=true

qqmyers commented 2 years ago

Сергей,

Sounds like you’ve gotten the previewers to work locally, which is great – seems like a reasonable Apache config as well.

W.r.t. using the root URL: I think we’d be happy to have a better/more flexible setup if you/others have the time to create an issue and/or pull request to the dataset previewers repository. The one thing I think we want to preserve is the ability to run as is from github.io, but if there are changes that would make it easier to drop them in locally, that would be great.

W.r.t. the pdf thumbnail: No the previewers aren’t involved. That is actually created by ImageMagick (see https://guides.dataverse.org/en/latest/installation/prerequisites.html#installing-and-configuring-imagemagick). Note that on some operating systems there’s another step needed specifically for pdf thumbs: see https://github.com/IQSS/dataverse/issues/5617. Also note that there’s discussion of using GraphicsMagick instead (‘newer and more secure’ – see https://github.com/IQSS/dataverse/issues/8014).

-- Jim

From: Сергей @.*** Sent: Friday, October 22, 2021 9:45 AM To: GlobalDataverseCommunityConsortium/dataverse-previewers Cc: qqmyers; Comment Subject: Re: [GlobalDataverseCommunityConsortium/dataverse-previewers] Can i check if these previewers are compatible with dataverse 5.5? (Issue #60)

Good day, at least at our test installation the previewers work as expected. Our dataverse is runnig behind apache, so I checked out into apache content folder and added into VirtualHost.conf:

ProxyPassMatch ^/dataverse-previewers

So the perviewers would serve directly without proxeing requests to dataverse.

What I noticed is that previewers are using root urls like (in TextPreview.html): "" This makes it impossible to have previewers in a folder other than "/dataverse-previewers" (or you will have to add the "base" html tag, which requires changes in the original folder that I would like to avoid since I want to update the folder using git from time to time)

A side question - the previewers do, as the name suggests, preview contents of the file. They are not responsible for generating the thumbnails for different datatypes, right? I just saw pdf-thumbnail in README of this repository. How did you achieve that? https://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/raw/master/examples/datasetdisplay.png?raw=true

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/GlobalDataverseCommunityConsortium/dataverse-previewers/issues/60#issuecomment-949645971, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABTLRTYYCBSBRYHBKC3GL2DUIFTF3ANCNFSM5GFTSHMQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

sergejzr commented 2 years ago

Hello qqmyers, thank you! Yes, I think we can try around making the paths more flexible, I will report a solution if we find any. At the moment having configured Apache is just fine for us (also it is possible to use mod-rewrite to point to other folders, though it will make configuration more complicated). It is worth to mention that this configuration naturally solves the CORS problem.

Thank you also for pointing to imagemagick, I will have a closer look at it. Ideally would be to get previewers and thumbnails to work together to some extent.

PS: I just implemented syntax-highlighting using highlight.js as additional previewer for our installation. would be happy to contribute with this once we are done with all kind of testing (but this is really an off-topic here, sorry)

qqmyers commented 2 years ago

fwiw: relative paths were added in #52