def _generateDataTableHtml(self, fileManData, fileNo, outDir):
     tName = normalizePackageName(fileManData.name)
     fieldNamesList = self.schemaParser._allSchema[fileNo].getFieldNames()
     # Note: We are not normalizing fileNo here
     with open(os.path.join(outDir, "%s.html" % fileNo), 'w') as output:
         output.write("<html>\n")
         # All files are now "large files" and need the ajexSrc file
         ajexSrc = "%s_array.txt" % fileNo
         outputLargeDataListTableHeader(output,
                                        ajexSrc,
                                        tName,
                                        columns=fieldNamesList,
                                        searchColumnNames=fieldNamesList,
                                        hideColumnNames=[""])
         output.write("<body id=\"dt_example\">")
         output.write("""<div id="container" style="width:80%">""")
         output.write("<h1>File %s(%s) Data List</h1>" % (tName, fileNo))
         outputDataTableHeader(output, fieldNamesList, tName)
         output.write("<tbody>\n")
         # Don't add rows to import from Ajex
         output.write("</tbody>\n")
         output.write("</table>\n")
         output.write("</div>\n")
         output.write("</div>\n")
         output.write("</body></html>\n")
     # Write out the data file in JSON format
     outJson = {
         "aaData": self._getTableRows(fileManData, fileNo, fieldNamesList)
     }
     with open(os.path.join(outDir, ajexSrc), 'w') as output:
         # Ensure that the OSEHRA Encoder is used to write out data.
         json.dump(outJson, output, ensure_ascii=False, cls=OSEHRAEncoder)
Example #2
0
 def _generateDataTableHtml(self, fileManData, fileNo, outDir):
     isLargeFile = len(fileManData.dataEntries) > 4500
     tName = normalizePackageName(fileManData.name)
     # Note: We are not normalizing fileNo here
     with open(os.path.join(outDir, "%s.html" % fileNo), 'w') as output:
         output.write("<html>\n")
         if isLargeFile:
             ajexSrc = "%s_array.txt" % fileNo
             outputLargeDataListTableHeader(output, ajexSrc, tName)
         else:
             outputDataListTableHeader(output, tName)
         output.write("<body id=\"dt_example\">")
         output.write("""<div id="container" style="width:80%">""")
         output.write("<h1>File %s(%s) Data List</h1>" % (tName, fileNo))
         writeTableListInfo(output, tName)
         if not isLargeFile:
             output.write("<tbody>\n")
             rows = self._getTableRows(fileManData, fileNo)
             for tableRow in rows:
                 output.write("<tr>\n")
                 for item in tableRow:
                     output.write("<td>%s</td>\n" % item)
                 output.write("</tr>\n")
         output.write("</tbody>\n")
         output.write("</table>\n")
         output.write("</div>\n")
         output.write("</div>\n")
         output.write("</body></html>\n")
     if isLargeFile:
         logger.info("Writing Ajax file: %s" % ajexSrc)
         """ Write out the data file in JSON format """
         outJson = {"aaData": self._getTableRows(fileManData, fileNo)}
         with open(os.path.join(outDir, ajexSrc), 'w') as output:
             json.dump(outJson, output)
Example #3
0
 def _generateDataTableHtml(self, fileManData, fileNo, outDir):
   isLargeFile = len(fileManData.dataEntries) > 4500
   tName = normalizePackageName(fileManData.name)
   fieldNamesList =  self.schemaParser._allSchema[fileNo].getFieldNames()
   # Note: We are not normalizing fileNo here
   with open(os.path.join(outDir, "%s.html" % fileNo), 'w') as output:
     output.write("<html>\n")
     # All files are now "large files" and need the ajexSrc file
     ajexSrc = "%s_array.txt" % fileNo
     outputLargeDataListTableHeader(output, ajexSrc, tName, columns=fieldNamesList, searchColumnNames=fieldNamesList, hideColumnNames=[""] )
     output.write("<body id=\"dt_example\">")
     output.write("""<div id="container" style="width:80%">""")
     output.write("<h1>File %s(%s) Data List</h1>" % (tName, fileNo))
     outputDataTableHeader(output, fieldNamesList, tName)
     output.write("<tbody>\n")
     # Don't add rows to import from Ajex
     output.write("</tbody>\n")
     output.write("</table>\n")
     output.write("</div>\n")
     output.write("</div>\n")
     output.write ("</body></html>\n")
   """ Write out the data file in JSON format """
   outJson = {"aaData": self._getTableRows(fileManData, fileNo, fieldNamesList)}
   with open(os.path.join(outDir, ajexSrc), 'w') as output:
     # Ensure that the OSEHRA Encoder is used to write out data.
     json.dump(outJson, output,ensure_ascii=False, cls=OSEHRAEncoder)
Example #4
0
 def _generateDataTableHtml(self, fileManData, fileNo):
   outDir = self.outDir
   isLargeFile = len(fileManData.dataEntries) > 4500
   tName = normalizePackageName(fileManData.name)
   outDir = os.path.join(self.outDir, fileNo.replace(".","_"))
   if not os.path.exists(outDir):
     os.mkdir(outDir)
   with open("%s/%s.html" % (outDir, fileNo), 'w') as output:
     output.write("<html>\n")
     if isLargeFile:
       ajexSrc = "%s_array.txt" % fileNo
       outputLargeDataListTableHeader(output, ajexSrc, tName)
     else:
       outputDataListTableHeader(output, tName)
     output.write("<body id=\"dt_example\">")
     output.write("""<div id="container" style="width:80%">""")
     output.write("<h1>File %s(%s) Data List</h1>" % (tName, fileNo))
     writeTableListInfo(output, tName)
     if not isLargeFile:
       output.write("<tbody>\n")
       for ien in getKeys(fileManData.dataEntries.keys(), float):
         dataEntry = fileManData.dataEntries[ien]
         if not dataEntry.name:
           logging.warn("no name for %s" % dataEntry)
           continue
         name = dataEntry.name
         if isFilePointerType(dataEntry):
           link, name = convertFilePointerToHtml(dataEntry.name)
         dataHtmlLink = "<a href=\"../%s/%s\">%s</a>" % (fileNo.replace(".","_"),getDataEntryHtmlFile(dataEntry, ien, fileNo),
                                                   name)
         tableRow = [dataHtmlLink, dataEntry.ien]
         output.write("<tr>\n")
         """ table body """
         for item in tableRow:
           output.write("<td>%s</td>\n" % item)
         output.write("</tr>\n")
     output.write("</tbody>\n")
     output.write("</table>\n")
     output.write("</div>\n")
     output.write("</div>\n")
     output.write ("</body></html>\n")
   if isLargeFile:
     logging.info("Ajex source file: %s" % ajexSrc)
     """ Write out the data file in JSON format """
     outJson = {"aaData": []}
     with open(os.path.join(outDir, ajexSrc), 'w') as output:
       outArray =  outJson["aaData"]
       for ien in getKeys(fileManData.dataEntries.keys(), float):
         dataEntry = fileManData.dataEntries[ien]
         if not dataEntry.name:
           logging.warn("no name for %s" % dataEntry)
           continue
         name = dataEntry.name
         if isFilePointerType(dataEntry):
           link, name = convertFilePointerToHtml(dataEntry.name)
         dataHtmlLink = "<a href=\"../%s/%s\">%s</a>" % (fileNo.replace(".","_"),getDataEntryHtmlFile(dataEntry, ien, fileNo),
                                                   name)
         outArray.append([dataHtmlLink, ien])
       json.dump(outJson, output)
Example #5
0
    def _generateICRSummaryPageImpl(self, inputJson, listName, pkgName, isForAll=False):
        outDir = self._outDir
        pkgHtmlName = pkgName
        outFilename = "%s/%s-%s.html" % (outDir, pkgName, listName)
        if not isForAll:
            if pkgName in pkgMap:
                pkgName = pkgMap[pkgName]
            pkgHtmlName = pkgName + '-ICR.html'
            outFilename = "%s/%s" % (outDir, pkgHtmlName)
        with open(outFilename, 'w+') as output:
            output.write("<html>\n")
            tName = safeElementId("%s-%s" % (listName, pkgName))
            useAjax = useAjaxDataTable(len(inputJson))
            columnNames = [x[0] for x in summary_list_fields]
            searchColumns = ['IA #', 'Name', 'Custodial Package',
                             'Date Created', 'File #', 'Remote Procedure',
                             'Routine', 'Date Activated']
            if useAjax:
                ajaxSrc = '%s_array.txt' % pkgName
                outputLargeDataListTableHeader(output, ajaxSrc, tName,
                                                columnNames, searchColumns)
            else:
                outputDataListTableHeader(output, tName, columnNames, searchColumns)
            output.write("<body id=\"dt_example\">")
            output.write("""<div id="container" style="width:80%">""")

            if isForAll:
                output.write("<h1>%s %s</h1>" % (pkgName, listName))
            else:
                output.write("<h2 align=\"right\"><a href=\"./All-%s.html\">"
                             "All %s</a></h2>" % (listName, listName))
                output.write("<h1>Package: %s %s</h1>" % (pkgName, listName))
            # pkgLinkName = getPackageHRefLink(pkgName)
            outputDataTableHeader(output, columnNames, tName)
            outputDataTableFooter(output, columnNames, tName)
            """ table body """
            output.write("<tbody>\n")
            if not useAjax:
                """ Now convert the ICR Data to Table data """
                for icrSummary in inputJson:
                    output.write("<tr>\n")
                    for item in icrSummary:
                        #output.write("<td class=\"ellipsis\">%s</td>\n" % item)
                        output.write("<td>%s</td>\n" % item)
                    output.write("</tr>\n")
            else:
                logging.info("Ajax source file: %s" % ajaxSrc)
                """ Write out the data file in JSON format """
                outJson = {"aaData": []}
                with open(os.path.join(outDir, ajaxSrc), 'w') as ajaxOut:
                    outArray =  outJson["aaData"]
                    for icrSummary in inputJson:
                        outArray.append(icrSummary)
                    json.dump(outJson, ajaxOut)
            output.write("</tbody>\n")
            output.write("</table>\n")
            output.write("</div>\n")
            output.write("</div>\n")
            output.write ("</body></html>\n")
Example #6
0
 def _generateDataTableHtml(self, fileManData, fileNo):
     outDir = self.outDir
     isLargeFile = len(fileManData.dataEntries) > 4500
     tName = normalizePackageName(fileManData.name)
     with open("%s/%s.html" % (outDir, fileNo), "w") as output:
         output.write("<html>\n")
         if isLargeFile:
             ajexSrc = "%s_array.txt" % fileNo
             outputLargeDataListTableHeader(output, ajexSrc, tName)
         else:
             outputDataListTableHeader(output, tName)
         output.write('<body id="dt_example">')
         output.write("""<div id="container" style="width:80%">""")
         output.write("<h1>File %s(%s) Data List</h1>" % (tName, fileNo))
         writeTableListInfo(output, tName)
         if not isLargeFile:
             output.write("<tbody>\n")
             for ien in getKeys(fileManData.dataEntries.keys(), float):
                 dataEntry = fileManData.dataEntries[ien]
                 if not dataEntry.name:
                     logging.warn("no name for %s" % dataEntry)
                     continue
                 name = dataEntry.name
                 if isFilePointerType(dataEntry):
                     link, name = convertFilePointerToHtml(dataEntry.name)
                 dataHtmlLink = '<a href="%s">%s</a>' % (getDataEntryHtmlFile(dataEntry, ien, fileNo), name)
                 tableRow = [dataHtmlLink, dataEntry.ien]
                 output.write("<tr>\n")
                 """ table body """
                 for item in tableRow:
                     output.write("<td>%s</td>\n" % item)
                 output.write("</tr>\n")
         output.write("</tbody>\n")
         output.write("</table>\n")
         output.write("</div>\n")
         output.write("</div>\n")
         output.write("</body></html>\n")
     if isLargeFile:
         logging.info("Ajex source file: %s" % ajexSrc)
         """ Write out the data file in JSON format """
         outJson = {"aaData": []}
         with open(os.path.join(outDir, ajexSrc), "w") as output:
             outArray = outJson["aaData"]
             for ien in getKeys(fileManData.dataEntries.keys(), float):
                 dataEntry = fileManData.dataEntries[ien]
                 if not dataEntry.name:
                     logging.warn("no name for %s" % dataEntry)
                     continue
                 name = dataEntry.name
                 if isFilePointerType(dataEntry):
                     link, name = convertFilePointerToHtml(dataEntry.name)
                 dataHtmlLink = '<a href="%s">%s</a>' % (getDataEntryHtmlFile(dataEntry, ien, fileNo), name)
                 outArray.append([dataHtmlLink, ien])
             json.dump(outJson, output)
Example #7
0
    def _generateRequirementsSummaryPageImpl(self,
                                             inputJson,
                                             listName,
                                             pkgName,
                                             isForAll=False):
        outDir = self._outDir
        listName = listName.strip()
        pkgName = pkgName.strip()
        # TODO: Use Utility functions to generate filename name
        pkgHtmlName = pkgName.replace('/', '_')
        outFilename = "%s/%s-%s.html" % (outDir, pkgName.replace(
            '/', '_'), listName)
        if not isForAll:
            outFilename = "%s/%s-Req.html" % (outDir, pkgHtmlName)
        with open(outFilename, 'w+') as output:
            output.write("<html>\n")
            tName = "%s-%s" % (listName.replace(
                ' ', '_'), pkgName.replace(' ', '_'))
            useAjax = False  #useAjaxDataTable(len(inputJson))
            columnNames = fieldList
            searchColumns = searchColumnList
            if useAjax:
                ajaxSrc = '%s_array.txt' % pkgName
                outputLargeDataListTableHeader(output, ajaxSrc, tName,
                                               columnNames, searchColumns)
            else:
                outputDataListTableHeader(output,
                                          tName,
                                          columnNames,
                                          searchColumns,
                                          hideColumnNames=['Recently Updated'])
            output.write("<body id=\"dt_example\">")
            output.write("""<div id="container" style="width:80%">""")

            if isForAll:
                output.write("<h1>%s %s</h1>" % (pkgName, listName))
                reqData = inputJson
            else:
                reqData = inputJson[pkgName]
                output.write("<h2 align=\"right\"><a href=\"./All-%s.html\">"
                             "All %s</a></h2>" % (listName, listName))
                output.write("<h1>BFF Entry: %s %s</h1>" % (pkgName, listName))
            outputDataTableHeader(output, columnNames, tName)
            outputDataTableFooter(output, columnNames, tName)
            """ table body """
            output.write("<tbody>\n")
            if not useAjax:
                """ Now convert the requirements Data to Table data """
                for reqEntry in reqData:
                    output.write("<tr>\n")
                    if not isForAll:
                        reqSummary = self._convertReqEntryToSummaryInfo(
                            reqEntry)
                        if not reqSummary in allReqs:
                            allReqs.append(reqSummary)
                    else:
                        reqSummary = reqEntry
                    for idx, item in enumerate(fieldList):
                        # List of objects should be displayed as a UL object
                        if isinstance(reqSummary[idx], list):
                            output.write("<td><ul>")
                            for entry in reqSummary[idx]:
                                if pkgName in entry:
                                    output.write(
                                        "<li class='disabled'>%s</li>\n" %
                                        entry)
                                else:
                                    output.write("<li>%s</li>\n" % entry)
                            output.write("</ul></td>")
                        # Otherwise, write it out as is
                        else:
                            if pkgName in str(reqSummary[idx]):
                                output.write("<td class='disabled'>%s</td>\n" %
                                             reqSummary[idx])
                            else:
                                output.write("<td>%s</td>\n" % reqSummary[idx])
                    output.write("</tr>\n")
            else:
                logger.info("Ajax source file: %s" % ajaxSrc)
                """ Write out the data file in JSON format """
                outJson = {"aaData": []}
                with open(os.path.join(outDir, ajaxSrc), 'w') as ajaxOut:
                    outArray = outJson["aaData"]
                    for reqSummary in inputJson:
                        outArray.append(reqSummary)
                    json.dump(outJson, ajaxOut)
            output.write("</tbody>\n")
            output.write("</table>\n")
            output.write("</div>\n")
            output.write("</div>\n")
            output.write("</body></html>\n")
Example #8
0
def _generateICRSummaryPageImpl(inputJson, listName, pkgName, date, outDir,
                                isForAll=False):
    listName = listName.strip()
    pkgName = pkgName.strip()
    pkgHtmlName = pkgName
    outFilename = os.path.join(outDir, "%s-%s.html" % (pkgName, listName))
    if not isForAll:
        if pkgName in PACKAGE_MAP:
            pkgName = PACKAGE_MAP[pkgName]
        pkgHtmlName = pkgName + '-ICR.html'
        outFilename = "%s/%s" % (outDir, pkgHtmlName)
    with open(outFilename, 'w+') as output:
        output.write("<html>\n")
        tName = "%s-%s" % (listName.replace(' ', '_'), pkgName.replace(' ', '_'))
        useAjax = _useAjaxDataTable(len(inputJson))
        columnNames = [x[0] for x in SUMMARY_LIST_FIELDS]
        searchColumns = ['IA #', 'Name', 'Custodial Package',
                         'Date Created', 'File #', 'Remote Procedure',
                         'Routine', 'Date Activated', 'General Description']
        hideColumns = ['General Description']
        if useAjax:
            ajaxSrc = '%s_array.txt' % pkgName
            outputLargeDataListTableHeader(output, ajaxSrc, tName,
                                           columnNames, searchColumns,
                                           hideColumns)
        else:
            outputDataListTableHeader(output, tName, columnNames,
                                      searchColumns, hideColumns)
        output.write("<body id=\"dt_example\">")
        output.write("""<div id="container" style="width:80%">""")

        if isForAll:
            output.write("<h1>%s %s</h1>" % (pkgName, listName))
        else:
            output.write("<h2 align=\"right\"><a href=\"./All-%s.html\">"
                         "All %s</a></h2>" % (listName, listName))
            output.write("<h1>Package: %s %s</h1>" % (pkgName, listName))
        # pkgLinkName = _getPackageHRefLink(pkgName)
        outputDataTableHeader(output, columnNames, tName)
        outputDataTableFooter(output, columnNames, tName)
        """ table body """
        output.write("<tbody>\n")
        if not useAjax:
            """ Now convert the ICR Data to Table data """
            for icrSummary in inputJson:
                output.write("<tr>\n")
                for item in icrSummary:
                    #output.write("<td class=\"ellipsis\">%s</td>\n" % item)
                    output.write("<td>%s</td>\n" % item)
                output.write("</tr>\n")
        else:
            logger.debug("Ajax source file: %s" % ajaxSrc)
            """ Write out the data file in JSON format """
            outJson = {"aaData": []}
            with open(os.path.join(outDir, ajaxSrc), 'w') as ajaxOut:
                outArray =  outJson["aaData"]
                for icrSummary in inputJson:
                    outArray.append(icrSummary)
                json.dump(outJson, ajaxOut)
        output.write("</tbody>\n")
        output.write("</table>\n")
        if date is not None:
            link = "https://foia-vista.osehra.org/VistA_Integration_Agreement/"
            output.write("<a href=\"%s\">Generated from %s IA Listing Descriptions</a>" % (link, date))
        output.write("</div>\n")
        output.write("</div>\n")
        output.write ("</body></html>\n")
Example #9
0
    def _generateICRSummaryPageImpl(self, inputJson, listName, pkgName, date, isForAll=False):
        outDir = self._outDir
        listName = listName.strip()
        pkgName = pkgName.strip()
        pkgHtmlName = pkgName
        outFilename = "%s/%s-%s.html" % (outDir, pkgName, listName)
        if not isForAll:
            if pkgName in pkgMap:
                pkgName = pkgMap[pkgName]
            pkgHtmlName = pkgName + '-ICR.html'
            outFilename = "%s/%s" % (outDir, pkgHtmlName)
        with open(outFilename, 'w+') as output:
            output.write("<html>\n")
            tName = "%s-%s" % (listName.replace(' ', '_'), pkgName.replace(' ', '_'))
            useAjax = useAjaxDataTable(len(inputJson))
            columnNames = [x[0] for x in summary_list_fields]
            searchColumns = ['IA #', 'Name', 'Custodial Package',
                             'Date Created', 'File #', 'Remote Procedure',
                             'Routine', 'Date Activated', 'General Description']
            hideColumns = ['General Description']
            if useAjax:
                ajaxSrc = '%s_array.txt' % pkgName
                outputLargeDataListTableHeader(output, ajaxSrc, tName,
                                               columnNames, searchColumns,
                                               hideColumns)
            else:
                outputDataListTableHeader(output, tName, columnNames,
                                          searchColumns, hideColumns)
            output.write("<body id=\"dt_example\">")
            output.write("""<div id="container" style="width:80%">""")

            if isForAll:
                output.write("<h1>%s %s</h1>" % (pkgName, listName))
            else:
                output.write("<h2 align=\"right\"><a href=\"./All-%s.html\">"
                             "All %s</a></h2>" % (listName, listName))
                output.write("<h1>Package: %s %s</h1>" % (pkgName, listName))
            # pkgLinkName = getPackageHRefLink(pkgName)
            outputDataTableHeader(output, columnNames, tName)
            outputDataTableFooter(output, columnNames, tName)
            """ table body """
            output.write("<tbody>\n")
            if not useAjax:
                """ Now convert the ICR Data to Table data """
                for icrSummary in inputJson:
                    output.write("<tr>\n")
                    for item in icrSummary:
                        #output.write("<td class=\"ellipsis\">%s</td>\n" % item)
                        output.write("<td>%s</td>\n" % item)
                    output.write("</tr>\n")
            else:
                logging.info("Ajax source file: %s" % ajaxSrc)
                """ Write out the data file in JSON format """
                outJson = {"aaData": []}
                with open(os.path.join(outDir, ajaxSrc), 'w') as ajaxOut:
                    outArray =  outJson["aaData"]
                    for icrSummary in inputJson:
                        outArray.append(icrSummary)
                    json.dump(outJson, ajaxOut)
            output.write("</tbody>\n")
            output.write("</table>\n")
            if date is not None:
                link = "https://foia-vista.osehra.org/VistA_Integration_Agreement/"
                output.write("<a href=\"%s\">Generated from %s IA Listing Descriptions</a>" % (link, date))
            output.write("</div>\n")
            output.write("</div>\n")
            output.write ("</body></html>\n")
    def _generateRequirementsSummaryPageImpl(self, inputJson, listName, pkgName, isForAll=False):
        outDir = self._outDir
        listName = listName.strip()
        pkgName = pkgName.strip()
        pkgHtmlName = pkgName.replace('/','_')
        outFilename = "%s/%s-%s.html" % (outDir, pkgName.replace('/','_'), listName)
        if not isForAll:
            outFilename = "%s/%s-Req.html" % (outDir, pkgHtmlName)
        with open(outFilename, 'w+') as output:
            output.write("<html>\n")
            tName = "%s-%s" % (listName.replace(' ', '_'), pkgName.replace(' ', '_'))
            useAjax = False #useAjaxDataTable(len(inputJson))
            columnNames = fieldList
            searchColumns = searchColumnList
            if useAjax:
                ajaxSrc = '%s_array.txt' % pkgName
                outputLargeDataListTableHeader(output, ajaxSrc, tName,
                                                columnNames, searchColumns)
            else:
                outputDataListTableHeader(output, tName, columnNames, searchColumns, hideColumnNames=['Recently Updated'])
            output.write("<body id=\"dt_example\">")
            output.write("""<div id="container" style="width:80%">""")

            if isForAll:
                output.write("<h1>%s %s</h1>" % (pkgName, listName))
                reqData= inputJson
            else:
                reqData=inputJson[pkgName]
                output.write("<h2 align=\"right\"><a href=\"./All-%s.html\">"
                             "All %s</a></h2>" % (listName, listName))
                output.write("<h1>BFF Entry: %s %s</h1>" % (pkgName, listName))
            outputDataTableHeader(output, columnNames, tName)
            outputDataTableFooter(output, columnNames, tName)
            """ table body """
            output.write("<tbody>\n")
            if not useAjax:
                """ Now convert the requirements Data to Table data """
                for reqEntry in reqData:
                    output.write("<tr>\n")
                    if not isForAll:
                      reqSummary = self._convertReqEntryToSummaryInfo(reqEntry);
                      if not reqSummary in allReqs:
                        allReqs.append(reqSummary)
                    else:
                      reqSummary = reqEntry
                    for idx,item in enumerate(fieldList):
                        # List of objects should be displayed as a UL object
                        if type(reqSummary[idx]) is list:
                          output.write("<td><ul>")
                          for entry in reqSummary[idx]:
                            if pkgName in entry:
                              output.write("<li class='disabled'>%s</li>\n" %  entry)
                            else:
                              output.write("<li>%s</li>\n" %  entry)
                          output.write("</ul></td>")
                        # Otherwise, write it out as is
                        else:
                          if pkgName in str(reqSummary[idx]):
                            output.write("<td class='disabled'>%s</td>\n" %  reqSummary[idx])
                          else:
                            output.write("<td>%s</td>\n" %  reqSummary[idx])
                    output.write("</tr>\n")
            else:
                logging.info("Ajax source file: %s" % ajaxSrc)
                """ Write out the data file in JSON format """
                outJson = {"aaData": []}
                with open(os.path.join(outDir, ajaxSrc), 'w') as ajaxOut:
                    outArray =  outJson["aaData"]
                    for reqSummary in inputJson:
                        outArray.append(reqSummary)
                    json.dump(outJson, ajaxOut)
            output.write("</tbody>\n")
            output.write("</table>\n")
            output.write("</div>\n")
            output.write("</div>\n")
            output.write ("</body></html>\n")