This repository has been archived by the owner on Oct 6, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated export capability to include:
Merging of the Export buttons into a single drop-down button required modification of the webapp/html/columns.html file.
Updating the PDF export functionality to use a join query required modification to the "PDF_export" method in the handlers/web_api.py file and creating a new method "build_sentences_for_export" in the service/data_svc.py file. The "build_sentences_for_export" method uses two join queries to retrieve the sentence and sentence hits data from the database and return the data to the "pdf_export" method.
Updating the PDF export functionality to highlight found sentences in the PDF document generated required modification to the "pdf_export" method in the handlers/web_api.py file to add a style attribute to the sentence object. This style attribute was interpreted by the PDF make library to bold the sentence rather than highlight the sentence in the PDF document.
Adding the Export to Word capability required the following steps:
Note: This separate ajax POST request is required because the server method returns binary data not JSON data
Note: The two separate jquery ajax requests should be combined into a single request, but I did not want to dramatically change the way the application works, i.e. one method to get the JSON object data and another to generate the output, especially since the api is currently being revised.
To test, enter a report url and title, click "Submit", when the report appears in the "Needs Review" card, click "Analyze" to bring up the analysis/edit page.
On the analysis/edit page, click the highlighted sentences to see the techniques found for that sentence, and click the "Accept" button to confirm the technique.
After going through the report and confirming techniques found, click the "Export to.." drop-down button and select "Export to PDF" or "Export to Word" to generate and download the document