sapa / performing-arts-ch-templates

1 stars 3 forks source link

PDF preview in Plateforme #555

Closed b2d3c closed 1 day ago

b2d3c commented 3 months ago

After #532 #492 ,

We choice to use nextcloud serveur of SAPA (https://cloud.sapa.swiss) S3 to store PDF. Voir https://github.com/sapa/performing-arts-ch-import/issues/51

We want to add :

fkraeutli commented 1 month ago

Do we have a type for the PDF? Assuming the PDF should be added through

$subject rico:hasInstantiation $value .
$value rico:hasCarrierType spav:<carrierTypeForPDF>
fkraeutli commented 1 month ago

update: I have started including a PDF viewer but need to make some server configuration changes to make it work. Test here: https://www.dev.performing-arts.ch/resource/sapa:pdfTest

fkraeutli commented 1 month ago

@b2d3c I managed to adjust the configuration at our end, however the PDFs are not loading from the SAPA cloud due to CORS errors. Is it possible to adjust the CORS headers on the cloud?

Image

b2d3c commented 1 month ago

Do we have a type for the PDF? Assuming the PDF should be added through

$subject rico:hasInstantiation $value .
$value rico:hasCarrierType spav:<carrierTypeForPDF>

I have ask for it Sparna : https://github.com/sapa/swiss-performing-arts-documentation/issues/3#issuecomment-2093117351

b2d3c commented 1 month ago

@b2d3c I managed to adjust the configuration at our end, however the PDFs are not loading from the SAPA cloud due to CORS errors. Is it possible to adjust the CORS headers on the cloud?

Image

I have send a mail today to oriented.net who host our cloud. They will contact you or make directly the changes.

b2d3c commented 1 month ago

Answer from Oriented.net :

There is an app "WebAppPassword" that you can enable on your wölkli private installation (cloud.sapa.swiss) that sets allowed origins for your installation:

https://apps.nextcloud.com/apps/webapppassword

Could you try installing this app and configure it to allow your application and see if that works?

It seems to me a little complex. I would propose to display in a first time only the link. See #595

b2d3c commented 1 month ago

It should be a solution through our server (via S3). @bardocuteam will send you, Florian, a new URL to check.

bardocuteam commented 3 weeks ago

Hey @fkraeutli, here is an URL to a PDF on the media server: https://media.performing-arts.ch/document/SAPA_Jahresbericht_2022_FR-1-1.pdf

fkraeutli commented 3 weeks ago

@bardocuteam Perfect, that is working

b2d3c commented 2 weeks ago

Dear @fkraeutli could you give us the link to the exemple ?

fkraeutli commented 2 weeks ago

I update the test link and it works: https://www.dev.performing-arts.ch/resource/sapa:pdfTest Where do you want to add the viewer in the template(s)?

b2d3c commented 2 weeks ago

You can display it in the same place of Viewer IIIF in Layout:Record.

In Form:Record, you can add the Feld in IIIF zone. Label "PDF/S3".

Test : https://www.dev.performing-arts.ch/resource/?uri=http%3A%2F%2Fdata.performing-arts.ch%2Fr%2F24028542-e5e5-4821-b05d-4b86dfbe9ad4

fkraeutli commented 1 week ago

Preview added and deployed to Dev

Screenshot 2024-06-20 at 12 37 50
b2d3c commented 1 week ago

Great!

3 Remarks :
1) You choose to use in Form the same box as SAPA Cloud. It's good but we have to change label. I propose "Related Documents (SAPA Cloud, S3)" image 2) We don't need a label in Layout. No "PDF/S3" 3) Could we have a size of the Viewer more in A4 proportions?

fkraeutli commented 1 week ago

Changed and deployed to Dev

b2d3c commented 1 week ago

Remark 1 : the changed label "Related Documents (SAPA Cloud, S3)" in Form is missing Remark 2 : Done! Remark 3 : ok. It's not perfekt but it's already better image

After the fix of Remark 1 : you cloud deploy in PROD !

Thanks a lot it' great.

fkraeutli commented 1 week ago

Done

b2d3c commented 1 week ago

I see that the viewer in a empty form, come too in case of no declaration.

DEV : https://www.dev.performing-arts.ch/resource/?uri=http%3A%2F%2Fdata.performing-arts.ch%2Fr%2F9ebba1c1-6e38-4e20-8eeb-aac405422145 image

PROD : http://data.performing-arts.ch/r/7831486c-8693-4d46-aedc-7b89fb13c0d7 image

fkraeutli commented 2 days ago

The issue is that the carrier type we use for PDF (spav:fvonl) is also used for other things. I added a filter that queries for the extension .pdf to account for this.

Changed and deployed to Dev and Prod

b2d3c commented 1 day ago

Thanks a lot !