Issue Number | 4734 |
---|---|
Summary | [Internal] Rewrite CGI scripts using legacy cdrcgi.header() function |
Created | 2019-11-23 11:47:34 |
Issue Type | Improvement |
Submitted By | Kline, Bob (NIH/NCI) [C] |
Assigned To | Kline, Bob (NIH/NCI) [C] |
Status | Closed |
Resolved | 2020-04-27 14:30:04 |
Resolution | Fixed |
Path | /home/bkline/backups/jira/ocecdr/issue.252780 |
In the earliest days of the CDR, the available tools for generating
and parsing XML and HTML were less capable than they are now, and -
partly for this reason - our scripts for building and handling HTML
forms and reports used a more error-prone and fragile approach, building
up HTML strings by hand, and using regular expressions for parsing them.
This also resulted in code whose handling of Unicode strings was not
correct. Many of the scripts used the function header() from the
cdrcgi
module to create the top portion of an HTML form or
report page, filling in the rest with markup created by hand. We have
since created and refined more robust classes for this purpose, and as
part of Kepler, all but five of the 64 CGI scripts which used that
function and approach were rewritten. There wasn't sufficient time to
rewrite them all, and the purpose of this ticket is to address the
rewriting of the remaining five scripts.
PubStatus.py
ReplaceCWDwithVersion.py
SummaryDateLastModified.py
SummaryMailerReport.py
TermHierarchyTree.py
~juther is the Summary Mailer report still used, now that we no longer create summary mailers?
~juther and ~oseipokuw: for the summary date last modified report, is it necessary to keep the current format, using custom code to pile all the tables into a single worksheet, or can we use the common framework for Excel reports, putting each table on its own tab?
We use this report for our monthly and annual reports. Having all the tables in a single worksheet makes it easier to spot variations and trends. So, that would be our preference.
Shall I preserve the other anomalies as well, like labeling the summary type column as "Board" (so, for example, Peds summaries have a "board" type of "treatment"), and labeling the audience column as "Type"?
Yes, we're still using this report for tracking Advisory Board reviews with mailer IDs.
I don't see where these anomalies are - are you still referring to the summaries DLM report?
Yes, those are in the "system" flavor of the report.
Ah, I see it now. I think we should change those column headings to match the content below. "Type" for the summary type information and "Audience" for HP/PAT. Thanks!
Just out of curiosity, what purpose does the "Audience" column serve, given that that entire block has the same audience, which is displayed right above the block?
I'm going to mark this ticket as "resolved" so you can look at the reports and make sure I haven't broken anything, but I never did get an answer to my last question.
It's redundant, I agree, but it does make it a little easier to quickly identify what you're looking at when scanning the document.
For the Summary Date Last Modified Report, please append the summary title with [Module] when it is included in the results, just like it is on PROD.
I can do that, but first let me make sure you're aware that "module" in this report means something different (available as a module) than it does for other reports (module only).
The Term Hierarchy Tree report produces the following error message when trying to access it:
Traceback (most recent call last): File
"D:\inetpub\wwwroot\cgi-bin\cdr\TermHierarchyTree.py", line 321, in
<module> Control().run() File "d:\cdr\lib\Python\cdrcgi.py", line
150, in init self.logger.info("started %s",
self.subtitle or "controller") File "d:\cdr\lib\Python\cdrcgi.py", line
699, in logger self.logger = cdr.Logging.get_logger(self.LOGNAME,
**opts) File "d:\cdr\lib\Python\cdr.py", line 4070, in get_logger
handler = logging.FileHandler(path, encoding="utf-8") File
"D:\Python\lib\logging_init.py", line 1087, in
init StreamHandler.init(self,
self.open()) File "D:\Python\lib\logging_init.py",
line 1116, in _open return open(self.baseFilename, self.mode,
encoding=self.encoding) PermissionError: [Errno 13] Permission denied:
'D:
cdr
Log
TermHierarchyTree.log'
D:\cdr\Log\tmpaw4bq24a.html contains the description of this error.
Yes, it is well understood. Thanks!
Sorry about that. This is a problem with the lower tiers which was introduced by the Windows server upgrades. When we reported it to CBIIT, the response came down to "too bad, deal with it." At least it's just on the lower tiers, where we can fix it ourselves when it happens (which I have done). Please try again.
Label restored.
Verified. Thanks!
Verified on DEV. Thanks! We have one more item to test - Replace CWD with Version report.
Verified on DEV. Thanks!
Verified on QA. Thanks!
Verified on PROD. Thanks!
Elapsed: 0:00:00.000640