Example #1
0
    def _generateInteractiveForm(self):
        """
        Generates the HTML for the interactive form.
        Returns (sTopOfForm, sEndOfForm)
        """

        #
        # The top of the form.
        #
        sTop  = '<form action="#" method="get" id="graphwiz-form">\n' \
                ' <input type="hidden" name="%s" value="%s"/>\n' \
                ' <input type="hidden" name="%s" value="%u"/>\n' \
                % ( WuiMain.ksParamAction,                 WuiMain.ksActionGraphWiz,
                    WuiMain.ksParamGraphWizSrcTestSetId,   self._dParams[WuiMain.ksParamGraphWizSrcTestSetId],
                    )

        sTop += ' <div id="graphwiz-nav">\n'
        sTop  += '  <script type="text/javascript">\n' \
                 '   window.onresize = function(){ return graphwizOnResizeRecalcWidth("graphwiz-nav", "%s"); }\n' \
                 '   window.onload   = function(){ return graphwizOnLoadRememberWidth("graphwiz-nav"); }\n' \
                 '  </script>\n' \
               % ( WuiMain.ksParamGraphWizWidth, )

        #
        # Top: First row.
        #
        sTop += '  <div id="graphwiz-top-1">\n'

        # time.
        sNow = self._dParams[WuiMain.ksParamEffectiveDate]
        if sNow is None: sNow = ''
        sTop += '   <div id="graphwiz-time">\n'
        sTop  += '    <label for="%s">Starting:</label>\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-time-input"/>\n' \
               % ( WuiMain.ksParamEffectiveDate,
                   WuiMain.ksParamEffectiveDate, WuiMain.ksParamEffectiveDate, sNow, )

        sTop += '    <input type="hidden" name="%s" value="%u"/>\n' % (
            WuiMain.ksParamReportPeriods,
            1,
        )
        sTop  += '    <label for="%s"> Going back:\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-period-input"/>\n' \
               % ( WuiMain.ksParamReportPeriodInHours,
                   WuiMain.ksParamReportPeriodInHours, WuiMain.ksParamReportPeriodInHours,
                   utils.formatIntervalHours(self._dParams[WuiMain.ksParamReportPeriodInHours]) )
        sTop += '   </div>\n'

        # Graph options top row.
        sTop += '   <div id="graphwiz-top-options-1">\n'

        # graph type.
        sTop  += '    <label for="%s">Graph:</label>\n' \
                 '    <select name="%s" id="%s">\n' \
               % ( WuiMain.ksParamGraphWizImpl, WuiMain.ksParamGraphWizImpl, WuiMain.ksParamGraphWizImpl, )
        for (sImpl, sDesc) in WuiMain.kaasGraphWizImplCombo:
            sTop  += '     <option value="%s"%s>%s</option>\n' \
                   % (sImpl, ' selected' if sImpl == self._dParams[WuiMain.ksParamGraphWizImpl] else '', sDesc)
        sTop += '    </select>\n'

        # graph size.
        sTop  += '    <label for="%s">Graph size:</label>\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-pixel-input"> x\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-pixel-input">\n' \
                 '    <label for="%s">Dpi:</label>'\
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-dpi-input">\n' \
                 '    <button type="button" onclick="%s">Defaults</button>\n' \
               % ( WuiMain.ksParamGraphWizWidth,
                   WuiMain.ksParamGraphWizWidth,  WuiMain.ksParamGraphWizWidth,  self._dParams[WuiMain.ksParamGraphWizWidth],
                   WuiMain.ksParamGraphWizHeight, WuiMain.ksParamGraphWizHeight, self._dParams[WuiMain.ksParamGraphWizHeight],
                   WuiMain.ksParamGraphWizDpi,
                   WuiMain.ksParamGraphWizDpi,    WuiMain.ksParamGraphWizDpi,    self._dParams[WuiMain.ksParamGraphWizDpi],
                   webutils.escapeAttr('return graphwizSetDefaultSizeValues("graphwiz-nav", "%s", "%s", "%s");'
                                       % ( WuiMain.ksParamGraphWizWidth, WuiMain.ksParamGraphWizHeight,
                                           WuiMain.ksParamGraphWizDpi )),
                 )

        sTop += '   </div>\n'
        # (options row 1)

        sTop += '  </div>\n'
        # (end of row 1)

        #
        # Top: Second row.
        #
        sTop += '  <div id="graphwiz-top-2">\n'

        # Submit
        sFormButton = '<button type="submit">Refresh</button>\n'
        sTop += '   <div id="graphwiz-top-submit">' + sFormButton + '</div>\n'

        # Options.
        sTop += '   <div id="graphwiz-top-options-2">\n'

        sTop  += '    <input type="checkbox" name="%s" id="%s" value="1"%s/>\n' \
                 '    <label for="%s">Tabular data</label>\n' \
               % ( WuiMain.ksParamGraphWizTabular, WuiMain.ksParamGraphWizTabular,
                   ' checked' if self._dParams[WuiMain.ksParamGraphWizTabular] else '',
                   WuiMain.ksParamGraphWizTabular)

        if hasattr(self.oGraphClass, 'setXkcdStyle'):
            sTop  += '    <input type="checkbox" name="%s" id="%s" value="1"%s/>\n' \
                     '    <label for="%s">xkcd-style</label>\n' \
                   % ( WuiMain.ksParamGraphWizXkcdStyle, WuiMain.ksParamGraphWizXkcdStyle,
                       ' checked' if self._dParams[WuiMain.ksParamGraphWizXkcdStyle] else '',
                       WuiMain.ksParamGraphWizXkcdStyle)
        elif self._dParams[WuiMain.ksParamGraphWizXkcdStyle]:
            sTop  += '    <input type="hidden" name="%s" id="%s" value="1"/>\n' \
                   % ( WuiMain.ksParamGraphWizXkcdStyle, WuiMain.ksParamGraphWizXkcdStyle, )

        if not hasattr(self.oGraphClass, 'kfNoErrorBarsSupport'):
            sTop  += '    <input type="checkbox" name="%s" id="%s" value="1"%s title="%s"/>\n' \
                     '    <label for="%s">Error bars,</label>\n' \
                     '    <label for="%s">max: </label>\n' \
                     '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-maxerrorbar-input" title="%s"/>\n' \
                   % ( WuiMain.ksParamGraphWizErrorBarY, WuiMain.ksParamGraphWizErrorBarY,
                       ' checked' if self._dParams[WuiMain.ksParamGraphWizErrorBarY] else '',
                       'Error bars shows some of the max and min results on the Y-axis.',
                       WuiMain.ksParamGraphWizErrorBarY,
                       WuiMain.ksParamGraphWizMaxErrorBarY,
                       WuiMain.ksParamGraphWizMaxErrorBarY, WuiMain.ksParamGraphWizMaxErrorBarY,
                       self._dParams[WuiMain.ksParamGraphWizMaxErrorBarY],
                       'Maximum number of Y-axis error bar per graph. (Too many makes it unreadable.)'
                       )
        else:
            if self._dParams[WuiMain.ksParamGraphWizErrorBarY]:
                sTop += '<input type="hidden" name="%s" id="%s" value="1">\n' \
                      % ( WuiMain.ksParamGraphWizErrorBarY, WuiMain.ksParamGraphWizErrorBarY, )
            sTop += '<input type="hidden" name="%s" id="%s" value="%u">\n' \
                  % ( WuiMain.ksParamGraphWizMaxErrorBarY, WuiMain.ksParamGraphWizMaxErrorBarY,
                      self._dParams[WuiMain.ksParamGraphWizMaxErrorBarY], )

        sTop  += '    <label for="%s">Font size: </label>\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-fontsize-input"/>\n' \
               % ( WuiMain.ksParamGraphWizFontSize,
                   WuiMain.ksParamGraphWizFontSize, WuiMain.ksParamGraphWizFontSize,
                   self._dParams[WuiMain.ksParamGraphWizFontSize], )

        sTop  += '    <label for="%s">Data series: </label>\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-maxpergraph-input" title="%s"/>\n' \
               % ( WuiMain.ksParamGraphWizMaxPerGraph,
                   WuiMain.ksParamGraphWizMaxPerGraph, WuiMain.ksParamGraphWizMaxPerGraph,
                   self._dParams[WuiMain.ksParamGraphWizMaxPerGraph],
                   'Max data series per graph.' )

        sTop += '   </div>\n'
        # (options row 2)

        sTop += '  </div>\n'
        # (end of row 2)

        sTop += ' </div>\n'
        # end of top.

        #
        # The end of the page selection.
        #
        sEnd = ' <div id="graphwiz-end-selection">\n'

        #
        # Testbox selection
        #
        aidTestBoxes = list(self._dParams[WuiMain.ksParamGraphWizTestBoxIds])
        sEnd += '  <div id="graphwiz-testboxes" class="graphwiz-end-selection-group">\n' \
                '   <h3>TestBox Selection:</h3>\n' \
                '   <ol class="tmgraph-testboxes">\n'

        # Get a list of eligible testboxes from the DB.
        for oTestBox in self._oModel.getEligibleTestBoxes():
            try:
                aidTestBoxes.remove(oTestBox.idTestBox)
            except:
                sChecked = ''
            else:
                sChecked = ' checked'
            sEnd += '   <li><input type="checkbox" name="%s" value="%s" id="gw-tb-%u"%s/>' \
                    '<label for="gw-tb-%u">%s</label></li>\n' \
                  % ( WuiMain.ksParamGraphWizTestBoxIds, oTestBox.idTestBox, oTestBox.idTestBox, sChecked,
                      oTestBox.idTestBox, oTestBox.sName)

        # List testboxes that have been checked in a different period or something.
        for idTestBox in aidTestBoxes:
            oTestBox = self._oModel.oCache.getTestBox(idTestBox)
            sEnd += '   <li><input type="checkbox" name="%s" value="%s" id="gw-tb-%u" checked/>' \
                    '<label for="gw-tb-%u">%s</label></li>\n' \
                  % ( WuiMain.ksParamGraphWizTestBoxIds, oTestBox.idTestBox, oTestBox.idTestBox,
                      oTestBox.idTestBox, oTestBox.sName)

        sEnd += '   </ol>\n' \
                ' </div>\n'

        #
        # Build category selection.
        #
        aidBuildCategories = list(
            self._dParams[WuiMain.ksParamGraphWizBuildCatIds])
        sEnd += '  <div id="graphwiz-buildcategories" class="graphwiz-end-selection-group">\n' \
                '   <h3>Build Category Selection:</h3>\n' \
                '   <ol class="tmgraph-buildcategories">\n'
        for oBuildCat in self._oModel.getEligibleBuildCategories():
            try:
                aidBuildCategories.remove(oBuildCat.idBuildCategory)
            except:
                sChecked = ''
            else:
                sChecked = ' checked'
            sEnd += '    <li><input type="checkbox" name="%s" value="%s" id="gw-bc-%u" %s/>' \
                    '<label for="gw-bc-%u">%s / %s / %s / %s</label></li>\n' \
                  % ( WuiMain.ksParamGraphWizBuildCatIds, oBuildCat.idBuildCategory, oBuildCat.idBuildCategory, sChecked,
                      oBuildCat.idBuildCategory,
                      oBuildCat.sProduct, oBuildCat.sBranch, oBuildCat.sType, ' & '.join(oBuildCat.asOsArches) )
        assert len(aidBuildCategories) == 0
        # SQL should return all currently selected.

        sEnd += '   </ol>\n' \
                ' </div>\n'

        #
        # Testcase variations.
        #
        sEnd += '  <div id="graphwiz-testcase-variations" class="graphwiz-end-selection-group">\n' \
                '   <h3>Miscellaneous:</h3>\n' \
                '   <ol>'

        sEnd += '    <li>\n' \
                '     <input type="checkbox" id="%s" name="%s" value="1"%s/>\n' \
                '     <label for="%s">Separate by testcase variation.</label>\n' \
                '    </li>\n' \
              % ( WuiMain.ksParamGraphWizSepTestVars, WuiMain.ksParamGraphWizSepTestVars,
                  ' checked' if self._dParams[WuiMain.ksParamGraphWizSepTestVars] else '',
                  WuiMain.ksParamGraphWizSepTestVars )


        sEnd += '    <li>\n' \
                '     <lable for="%s">Test case ID:</label>\n' \
                '     <input type="text" id="%s" name="%s" value="%s" readonly/>\n' \
                '    </li>\n' \
              % ( WuiMain.ksParamGraphWizTestCaseIds,
                  WuiMain.ksParamGraphWizTestCaseIds, WuiMain.ksParamGraphWizTestCaseIds,
                  ','.join([str(i) for i in self._dParams[WuiMain.ksParamGraphWizTestCaseIds]]), )

        sEnd += '   </ol>\n' \
                '  </div>\n'

        #sEnd += '   <h3>&nbsp;</h3>\n';

        #
        # Finish up the form.
        #
        sEnd += '  <div id="graphwiz-end-submit"><p>' + sFormButton + '</p></div>\n'
        sEnd += ' </div>\n' \
                '</form>\n'

        return (sTop, sEnd)
Example #2
0
    def _generateInteractiveForm(self):
        """
        Generates the HTML for the interactive form.
        Returns (sTopOfForm, sEndOfForm)
        """

        #
        # The top of the form.
        #
        sTop  = '<form action="#" method="get" id="graphwiz-form">\n' \
                ' <input type="hidden" name="%s" value="%s"/>\n' \
                ' <input type="hidden" name="%s" value="%u"/>\n' \
                % ( WuiMain.ksParamAction,                 WuiMain.ksActionGraphWiz,
                    WuiMain.ksParamGraphWizSrcTestSetId,   self._dParams[WuiMain.ksParamGraphWizSrcTestSetId],
                    );

        sTop  += ' <div id="graphwiz-nav">\n';
        sTop  += '  <script type="text/javascript">\n' \
                 '   window.onresize = function(){ return graphwizOnResizeRecalcWidth("graphwiz-nav", "%s"); }\n' \
                 '   window.onload   = function(){ return graphwizOnLoadRememberWidth("graphwiz-nav"); }\n' \
                 '  </script>\n' \
               % ( WuiMain.ksParamGraphWizWidth, );

        #
        # Top: First row.
        #
        sTop  += '  <div id="graphwiz-top-1">\n';

        # time.
        sNow = self._dParams[WuiMain.ksParamEffectiveDate];
        if sNow is None: sNow = '';
        sTop  += '   <div id="graphwiz-time">\n';
        sTop  += '    <label for="%s">Starting:</label>\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-time-input"/>\n' \
               % ( WuiMain.ksParamEffectiveDate,
                   WuiMain.ksParamEffectiveDate, WuiMain.ksParamEffectiveDate, sNow, );

        sTop  += '    <input type="hidden" name="%s" value="%u"/>\n' % ( WuiMain.ksParamReportPeriods, 1, );
        sTop  += '    <label for="%s"> Going back:\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-period-input"/>\n' \
               % ( WuiMain.ksParamReportPeriodInHours,
                   WuiMain.ksParamReportPeriodInHours, WuiMain.ksParamReportPeriodInHours,
                   utils.formatIntervalHours(self._dParams[WuiMain.ksParamReportPeriodInHours]) );
        sTop  += '   </div>\n';

        # Graph options top row.
        sTop  += '   <div id="graphwiz-top-options-1">\n';

        # graph type.
        sTop  += '    <label for="%s">Graph:</label>\n' \
                 '    <select name="%s" id="%s">\n' \
               % ( WuiMain.ksParamGraphWizImpl, WuiMain.ksParamGraphWizImpl, WuiMain.ksParamGraphWizImpl, );
        for (sImpl, sDesc) in WuiMain.kaasGraphWizImplCombo:
            sTop  += '     <option value="%s"%s>%s</option>\n' \
                   % (sImpl, ' selected' if sImpl == self._dParams[WuiMain.ksParamGraphWizImpl] else '', sDesc);
        sTop  += '    </select>\n';

        # graph size.
        sTop  += '    <label for="%s">Graph size:</label>\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-pixel-input"> x\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-pixel-input">\n' \
                 '    <label for="%s">Dpi:</label>'\
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-dpi-input">\n' \
                 '    <button type="button" onclick="%s">Defaults</button>\n' \
               % ( WuiMain.ksParamGraphWizWidth,
                   WuiMain.ksParamGraphWizWidth,  WuiMain.ksParamGraphWizWidth,  self._dParams[WuiMain.ksParamGraphWizWidth],
                   WuiMain.ksParamGraphWizHeight, WuiMain.ksParamGraphWizHeight, self._dParams[WuiMain.ksParamGraphWizHeight],
                   WuiMain.ksParamGraphWizDpi,
                   WuiMain.ksParamGraphWizDpi,    WuiMain.ksParamGraphWizDpi,    self._dParams[WuiMain.ksParamGraphWizDpi],
                   webutils.escapeAttr('return graphwizSetDefaultSizeValues("graphwiz-nav", "%s", "%s", "%s");'
                                       % ( WuiMain.ksParamGraphWizWidth, WuiMain.ksParamGraphWizHeight,
                                           WuiMain.ksParamGraphWizDpi )),
                 );

        sTop  += '   </div>\n'; # (options row 1)

        sTop  += '  </div>\n'; # (end of row 1)

        #
        # Top: Second row.
        #
        sTop  += '  <div id="graphwiz-top-2">\n';

        # Submit
        sFormButton = '<button type="submit">Refresh</button>\n';
        sTop  += '   <div id="graphwiz-top-submit">' + sFormButton + '</div>\n';


        # Options.
        sTop  += '   <div id="graphwiz-top-options-2">\n';

        sTop  += '    <input type="checkbox" name="%s" id="%s" value="1"%s/>\n' \
                 '    <label for="%s">Tabular data</label>\n' \
               % ( WuiMain.ksParamGraphWizTabular, WuiMain.ksParamGraphWizTabular,
                   ' checked' if self._dParams[WuiMain.ksParamGraphWizTabular] else '',
                   WuiMain.ksParamGraphWizTabular);

        if hasattr(self.oGraphClass, 'setXkcdStyle'):
            sTop  += '    <input type="checkbox" name="%s" id="%s" value="1"%s/>\n' \
                     '    <label for="%s">xkcd-style</label>\n' \
                   % ( WuiMain.ksParamGraphWizXkcdStyle, WuiMain.ksParamGraphWizXkcdStyle,
                       ' checked' if self._dParams[WuiMain.ksParamGraphWizXkcdStyle] else '',
                       WuiMain.ksParamGraphWizXkcdStyle);
        elif self._dParams[WuiMain.ksParamGraphWizXkcdStyle]:
            sTop  += '    <input type="hidden" name="%s" id="%s" value="1"/>\n' \
                   % ( WuiMain.ksParamGraphWizXkcdStyle, WuiMain.ksParamGraphWizXkcdStyle, );

        if not hasattr(self.oGraphClass, 'kfNoErrorBarsSupport'):
            sTop  += '    <input type="checkbox" name="%s" id="%s" value="1"%s title="%s"/>\n' \
                     '    <label for="%s">Error bars,</label>\n' \
                     '    <label for="%s">max: </label>\n' \
                     '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-maxerrorbar-input" title="%s"/>\n' \
                   % ( WuiMain.ksParamGraphWizErrorBarY, WuiMain.ksParamGraphWizErrorBarY,
                       ' checked' if self._dParams[WuiMain.ksParamGraphWizErrorBarY] else '',
                       'Error bars shows some of the max and min results on the Y-axis.',
                       WuiMain.ksParamGraphWizErrorBarY,
                       WuiMain.ksParamGraphWizMaxErrorBarY,
                       WuiMain.ksParamGraphWizMaxErrorBarY, WuiMain.ksParamGraphWizMaxErrorBarY,
                       self._dParams[WuiMain.ksParamGraphWizMaxErrorBarY],
                       'Maximum number of Y-axis error bar per graph. (Too many makes it unreadable.)'
                       );
        else:
            if self._dParams[WuiMain.ksParamGraphWizErrorBarY]:
                sTop += '<input type="hidden" name="%s" id="%s" value="1">\n' \
                      % ( WuiMain.ksParamGraphWizErrorBarY, WuiMain.ksParamGraphWizErrorBarY, );
            sTop += '<input type="hidden" name="%s" id="%s" value="%u">\n' \
                  % ( WuiMain.ksParamGraphWizMaxErrorBarY, WuiMain.ksParamGraphWizMaxErrorBarY,
                      self._dParams[WuiMain.ksParamGraphWizMaxErrorBarY], );

        sTop  += '    <label for="%s">Font size: </label>\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-fontsize-input"/>\n' \
               % ( WuiMain.ksParamGraphWizFontSize,
                   WuiMain.ksParamGraphWizFontSize, WuiMain.ksParamGraphWizFontSize,
                   self._dParams[WuiMain.ksParamGraphWizFontSize], );

        sTop  += '    <label for="%s">Data series: </label>\n' \
                 '    <input type="text" name="%s" id="%s" value="%s" class="graphwiz-maxpergraph-input" title="%s"/>\n' \
               % ( WuiMain.ksParamGraphWizMaxPerGraph,
                   WuiMain.ksParamGraphWizMaxPerGraph, WuiMain.ksParamGraphWizMaxPerGraph,
                   self._dParams[WuiMain.ksParamGraphWizMaxPerGraph],
                   'Max data series per graph.' );

        sTop  += '   </div>\n'; # (options row 2)

        sTop  += '  </div>\n'; # (end of row 2)

        sTop  += ' </div>\n'; # end of top.

        #
        # The end of the page selection.
        #
        sEnd = ' <div id="graphwiz-end-selection">\n';

        #
        # Testbox selection
        #
        aidTestBoxes = list(self._dParams[WuiMain.ksParamGraphWizTestBoxIds]);
        sEnd += '  <div id="graphwiz-testboxes" class="graphwiz-end-selection-group">\n' \
                '   <h3>TestBox Selection:</h3>\n' \
                '   <ol class="tmgraph-testboxes">\n';

        # Get a list of eligible testboxes from the DB.
        for oTestBox in self._oModel.getEligibleTestBoxes():
            try:    aidTestBoxes.remove(oTestBox.idTestBox);
            except: sChecked = '';
            else:   sChecked = ' checked';
            sEnd += '   <li><input type="checkbox" name="%s" value="%s" id="gw-tb-%u"%s/>' \
                    '<label for="gw-tb-%u">%s</label></li>\n' \
                  % ( WuiMain.ksParamGraphWizTestBoxIds, oTestBox.idTestBox, oTestBox.idTestBox, sChecked,
                      oTestBox.idTestBox, oTestBox.sName);

        # List testboxes that have been checked in a different period or something.
        for idTestBox in aidTestBoxes:
            oTestBox = self._oModel.oCache.getTestBox(idTestBox);
            sEnd += '   <li><input type="checkbox" name="%s" value="%s" id="gw-tb-%u" checked/>' \
                    '<label for="gw-tb-%u">%s</label></li>\n' \
                  % ( WuiMain.ksParamGraphWizTestBoxIds, oTestBox.idTestBox, oTestBox.idTestBox,
                      oTestBox.idTestBox, oTestBox.sName);

        sEnd += '   </ol>\n' \
                ' </div>\n';

        #
        # Build category selection.
        #
        aidBuildCategories = list(self._dParams[WuiMain.ksParamGraphWizBuildCatIds]);
        sEnd += '  <div id="graphwiz-buildcategories" class="graphwiz-end-selection-group">\n' \
                '   <h3>Build Category Selection:</h3>\n' \
                '   <ol class="tmgraph-buildcategories">\n';
        for oBuildCat in self._oModel.getEligibleBuildCategories():
            try:    aidBuildCategories.remove(oBuildCat.idBuildCategory);
            except: sChecked = '';
            else:   sChecked = ' checked';
            sEnd += '    <li><input type="checkbox" name="%s" value="%s" id="gw-bc-%u" %s/>' \
                    '<label for="gw-bc-%u">%s / %s / %s / %s</label></li>\n' \
                  % ( WuiMain.ksParamGraphWizBuildCatIds, oBuildCat.idBuildCategory, oBuildCat.idBuildCategory, sChecked,
                      oBuildCat.idBuildCategory,
                      oBuildCat.sProduct, oBuildCat.sBranch, oBuildCat.sType, ' & '.join(oBuildCat.asOsArches) );
        assert len(aidBuildCategories) == 0; # SQL should return all currently selected.

        sEnd += '   </ol>\n' \
                ' </div>\n';

        #
        # Testcase variations.
        #
        sEnd += '  <div id="graphwiz-testcase-variations" class="graphwiz-end-selection-group">\n' \
                '   <h3>Miscellaneous:</h3>\n' \
                '   <ol>';

        sEnd += '    <li>\n' \
                '     <input type="checkbox" id="%s" name="%s" value="1"%s/>\n' \
                '     <label for="%s">Separate by testcase variation.</label>\n' \
                '    </li>\n' \
              % ( WuiMain.ksParamGraphWizSepTestVars, WuiMain.ksParamGraphWizSepTestVars,
                  ' checked' if self._dParams[WuiMain.ksParamGraphWizSepTestVars] else '',
                  WuiMain.ksParamGraphWizSepTestVars );


        sEnd += '    <li>\n' \
                '     <lable for="%s">Test case ID:</label>\n' \
                '     <input type="text" id="%s" name="%s" value="%s" readonly/>\n' \
                '    </li>\n' \
              % ( WuiMain.ksParamGraphWizTestCaseIds,
                  WuiMain.ksParamGraphWizTestCaseIds, WuiMain.ksParamGraphWizTestCaseIds,
                  ','.join([str(i) for i in self._dParams[WuiMain.ksParamGraphWizTestCaseIds]]), );

        sEnd += '   </ol>\n' \
                '  </div>\n';

        #sEnd += '   <h3>&nbsp;</h3>\n';

        #
        # Finish up the form.
        #
        sEnd += '  <div id="graphwiz-end-submit"><p>' + sFormButton + '</p></div>\n';
        sEnd += ' </div>\n' \
                '</form>\n';

        return (sTop, sEnd);