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

Update Existing Previewers to support new Preview Mode #6210

Closed
djbrooke opened this issue Sep 24, 2019 · 17 comments
Closed

Update Existing Previewers to support new Preview Mode #6210

djbrooke opened this issue Sep 24, 2019 · 17 comments

Comments

@djbrooke
Copy link
Contributor

djbrooke commented Sep 24, 2019

QDR (@qqmyers, @adam3smith) has created a few previewers for common data formats. These previewers make use of the Dataverse external tools framework. They are here: https://github.com/QualitativeDataRepository/dataverse-previewers

In #3758, we'll introduce the idea of "preview mode" for external tools. This basically allows an external tool to be iframed in to Dataverse using a preview friendly, slimmed down version. Proof of concept code for this work is on this branch: https://github.com/IQSS/dataverse/tree/3758-file-pg-preview.

We should update the preview tools that QDR has made to allow for preview mode so that installations can iframe in these helpful previewers. We'll add additional previewers in other issues.

@djbrooke
Copy link
Contributor Author

@4tikhonov, @pdurbin suggested that I ping you in regards to our plans as well.

@pdurbin
Copy link
Member

pdurbin commented Sep 24, 2019

Right. Specifically I was thinking of notes for 2019-09-10 Dataverse Community Call at https://groups.google.com/d/msg/dataverse-community/hxRBTbKUjXQ/xyGG92N7AAAJ

"* (Slava) We started to work on a spreadsheet viewer to add to https://github.com/QualitativeDataRepository/dataverse-previewers"

@pdurbin
Copy link
Member

pdurbin commented Oct 17, 2019

@juancorr as we discussed in IRC today, let's see if we can work on this together. (Thanks again for contributing a Spanish translation to the File Previewers!) I'll spin up the branch at https://github.com/IQSS/dataverse/compare/3758-file-pg-preview on EC2 so we have a place to play around with the new code on the Dataverse side.

@juancorr
Copy link

juancorr commented Oct 18, 2019 via email

@pdurbin
Copy link
Member

pdurbin commented Oct 22, 2019

@juancorr thanks!

To all, the work and discussion has moved (at least for now) to https://github.com/QualitativeDataRepository/dataverse-previewers/issues/24

@pdurbin
Copy link
Member

pdurbin commented Oct 22, 2019

@pdurbin
Copy link
Member

pdurbin commented Oct 23, 2019

Here's an example of a file landing page of a PDF where one can see the current state of the pull request above: http://ec2-34-230-54-112.compute-1.amazonaws.com:8080/file.xhtml?fileId=51&datasetVersionId=5

HTTPS version: https://ec2-34-230-54-112.compute-1.amazonaws.com/file.xhtml?fileId=51&datasetVersionId=5

@djbrooke djbrooke self-assigned this Oct 23, 2019
@qqmyers
Copy link
Member

qqmyers commented Oct 23, 2019

I'm seeing an error in the console: net::ERR_CERT_COMMON_NAME_INVALID for the metadata call https://ec2-34-230-54-112.compute-1.amazonaws.com/api/datasets/39/versions/1.0. So - I don't think this is related to your change, just a problem in doing ajax to URLs with bad certs .
AFAIK, the only way to address this is to trust the cert on your machine.

@djbrooke djbrooke assigned pdurbin and unassigned djbrooke Oct 23, 2019
@juancorr
Copy link

Hi @pdurbin, @qqmyers and @djbrooke

I have not achieved to load by AJAX external content in our test server. I have tried the instructions of this page (and anothers) https://stackoverflow.com/questions/10343892/glassfish-how-to-set-access-control-allow-origin-header , but Glassfish refuse to load external content with the message:

"Solicitud desde otro origen bloqueada: la política de mismo origen impide leer el recurso remoto en http://oaimadrono.uned.es/dataverse-previewers/previewers/Te…://oaimadrono.uned.es:8080&datasetid=4125&datasetversion=1.0 (razón: falta la cabecera CORS 'Access-Control-Allow-Origin')." .

Any idea about how load external content using Ajax in Glassfish?

@pdurbin
Copy link
Member

pdurbin commented Oct 24, 2019

@juancorr are you talking about http://oaimadrono.uned.es:8080/file.xhtml?persistentId=doi:10.21950/VJADUC/SXOIDE or some other server? I see you're in http://chat.dataverse.org if it's easier to chat about the problem there.

@qqmyers
Copy link
Member

qqmyers commented Oct 24, 2019

@juancorr - I think that your issue is in the apache server that is serving the TextPreviewer.html file rather than glassfish. The issue is because your glassfish server is on port 8080 which is considered a different server than the same machine with port 80 where the TextPreviewer.html is coming from. There are lots of web sources for how to enable CORS in apache.

I think this is supported by the github.io server if you use the previewers there.

For development, an alternative might be to put the prievewers in glassfish/dataverse. I used to have them at /src/main/webapp/resources/previewers in our fork and could access them at /resources/previewers./* . In your case, that would cause the previewers to be on the same server (same 8080 port) and thereby avoid the CORS issue.

@pdurbin
Copy link
Member

pdurbin commented Oct 24, 2019

@qqmyers you've got me thinking... maybe in https://github.com/QualitativeDataRepository/dataverse-previewers#installation we could write a bit more about self hosting the previewers. I put mine in /var/www/html and added ProxyPassMatch ^/dataverse-previewers ! to /etc/httpd/conf.d/ssl.conf. I'd be happy to create an issue for this if you'd like. Lots of ways to skin this cat.

@qqmyers
Copy link
Member

qqmyers commented Oct 24, 2019

@pdurbin - sure. (It was your idea to host them though...). Unless you think using the hosted ones is not the preferred/recommendable option at this point, I'd suggest we put 'alternate install methods' on a separate page.

Also - I think your method (or variant) would also solve @juancorr 's issue since it would make the previewers come from the same host/port.

@pdurbin
Copy link
Member

pdurbin commented Oct 24, 2019

Was it? 😄 I'm just thinking people should have options. 😄 When I make an issue, I'll circle back and leave a comment here.

pdurbin added a commit to GlobalDataverseCommunityConsortium/dataverse-previewers that referenced this issue Oct 24, 2019
@pdurbin
Copy link
Member

pdurbin commented Oct 24, 2019

I just closed my original pull request (lots of noise about line endings in there and now merge conflicts) and opened a fresh one at https://github.com/QualitativeDataRepository/dataverse-previewers/pull/27 where I tried to incorporate feedback from the original pull request.

I'll move this issue into code review.

@pdurbin pdurbin removed their assignment Oct 24, 2019
@juancorr
Copy link

juancorr commented Oct 24, 2019 via email

@djbrooke
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants