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

Final PDF report for Transport Infratructure Studies (TM Studies) #148

Closed
patrickkaleta opened this issue Mar 4, 2020 · 14 comments
Closed
Assignees
Labels
enhancement New feature or request STALLED Further Action is requested

Comments

@patrickkaleta
Copy link

Subtask of #134

Comment from Angela:

As stated on 01 - Add Study, the Summary will be a request for the full Summary to the TM, however the CSIS will need to provide an extra one containing the Summary for the Adaptation Options as an additional document.

@ghilbrae as discussed previously, the TM will generate the final report and the CSIS will provide additional summaries for the Adaptation options.
How exactly are we going to do this? Would it be enough for the TM if CSIS provides a REST endpoint where the TM could request details about all included adaptation options. That information could then included in your final PDF report? WDYT?

@ghilbrae
Copy link
Contributor

ghilbrae commented Apr 8, 2020

We've been thinking about this for a while. The approach that we are considering now is as follows:

  • Using a specific URL for each section in the TM. This would trigger the PDF generation that would end with a PDF generated by the TM and another one generated by the CSIS per each section.
  • URLs will work the same as defined on this comment Transport Module integration description #134 (comment) . Except for Hazard, in this case the URL contains the variables from which the user needs or wants information included in the report. To address this we think that when the user requests the report for hazard the TM sends the URL back and that on is stored in the CSIS.
  • Another option would be for us to simply send the PDFs that can be generated when the users makes the request and you handle them as you see fit.
  • Another option might be to use a URL which would lead to a page/form in the TM where the user can do the selection of what they want to include in the report and once its done the URL for the PDF (or the PDF itself) is made available to the user.

What do you think? Are any of them feasible? Which one would you prefer?

An additional PDF would be the one that's generated by the CSIS, we do not have any control over that so we think that should be an option too so these studies also produce a PDF with the information stored in the CSIS (EU-GL, adaptation options, etc.). This way we ensure that we have the adaptations options that the TM does not handle.

@patrickkaleta
Copy link
Author

@ghilbrae yes, it would be a possibility to simply generate two separate PDFs - one in the CSIS with all the information that the CSIS has available and another one in the TM with all the information that the TM has available. But I don't know how useful it would be for the users if they had to look up information about their study in two separate PDFs.

  • Using a specific URL for each section in the TM. This would trigger the PDF generation that would end with a PDF generated by the TM and another one generated by the CSIS per each section.

This sounds to me like you want to create a separate PDF for each individual Step of the Study, is that correct? To me that sounds like an overkill - it would be enough to just create one PDF with all the steps.
(Also the PDF capabilities of Drupal are limited, so we cannot combine multiple PDFs into one.)

I was thinking that maybe the TM could send us the missing information and the CSIS takes care of the whole PDF. What information does the TM have, which is not in the CSIS - AFAIK it's the tables and maps, right? How were you planning to get those into the PDF? Probably also create snapshots of them, so that they can be added to the PDF as images. If that's the case, you could either directly push those images into the CSIS or just notify us that new images for a study are available and the CSIS will then grab them.

What do yo think?

@patrickkaleta
Copy link
Author

patrickkaleta commented Apr 27, 2020

If you already have a working PDF generator in the TM then we can leave it at that for now and in the CSIS we will just link to the created PDF in the TM. And we will offer a second PDF inside the CSIS with additional information, which is not included in the TM.

@ghilbrae
Copy link
Contributor

We've discussed this a bit. One way to include the TM specific information in the general report would be to access all necessary information in a json call. Of course, it would be possible to send ready made PDFs to have them embedded (I suppose PHP can do that), but it would be very difficult to have consistent aesthetics.

@patrickkaleta
Copy link
Author

Of course, it would be possible to send ready made PDFs to have them embedded (I suppose PHP can do that), but it would be very difficult to have consistent aesthetics.

Sending generated PDFs between the CSIS and the TM seem unnecessary to me. If the TM creates a (partial) PDF, it wouldn't be necessary for the CSIS to also have an actual copy of it. In the CSIS we could just show a link to the user, where he/she could access your PDF.

We've discussed this a bit. One way to include the TM specific information in the general report would be to access all necessary information in a json call.

I agree. This would be a simple solution. Question: Who will create the PDFs - CSIS or TM?
@ghilbrae is the TM already capable of generating PDFs? If yes (or if it wouldn't be much work), I don't have a problem with leaving this functionality to the TM, since in Drupal our options are limited and the current PDFs don't look to overwhelmingly good.

@patrickkaleta
Copy link
Author

@ghilbrae if you like we can have a short dedicated telco regarding this topic somewhen this week. WDYT?

@ghilbrae
Copy link
Contributor

How about tomorrow? We can meet from 9.00 to 10.30 or after 12. Another option could be to meet after Monday's meeting.

@patrickkaleta
Copy link
Author

How about tomorrow? We can meet from 9.00 to 10.30 or after 12. Another option could be to meet after Monday's meeting.

Ok let's make it 9:30 tomorrow. We really shouldn't need more than an hour for that. I'll send you an invite.

@patrickkaleta
Copy link
Author

So after our discussion today, we decided the following approach:

  • start with easiest solution by generating two separate PDFs - one created by CSIS and the other by the TM
  • in the CSIS Study-Summary tab next to the usual "Download report" button, we will add a link to the second PDF, so that users can access it

In the future, we could then possibly switch to a Single-PDF approach by either providing the CSIS or the TM with the missing information from the other tool. Things that need to be considered for that:

  • which tool can produce PDFs more efficiently? (necessary workload, quality of PDF results, ...)
  • tables in TM probably won't be saved as images first before including them in the PDF, so that approach differs from CSIS

@p-a-s-c-a-l
Copy link
Member

Is this done yet?

@patrickkaleta
Copy link
Author

@rapto what's the status for the PDF generation in the TM?

@p-a-s-c-a-l p-a-s-c-a-l added the STALLED Further Action is requested label Jun 5, 2020
@ghilbrae
Copy link
Contributor

ghilbrae commented Jun 11, 2020

@patrickkaleta as discussed on Monday, we are able to produce PDFs for testing now.

The URL that should be used is https://clarity.saver.red/reference/ID/pdf The resulting PDF is blank for now, but it should be enough for testing the integration. We'll let you know when the full PDF is available. As discussed previously, we think that the current report (the one generated by the CSIS) should still be available along with the one coming form the TM.

@patrickkaleta
Copy link
Author

I've included the link to the PDF generated by the TM. On the Study Summary page the available PDF(s) are now listed in the right sidebar.

@ghilbrae as you said, the page is ATM mostly blank, so I'm going to leave this issue open, so that you can keep us updated about the progress on your side.

@ghilbrae
Copy link
Contributor

Perfect! Thank you very much. I'll update the issue when the PDF is less blank 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request STALLED Further Action is requested
Projects
None yet
Development

No branches or pull requests

5 participants