Changeset 5480


Ignore:
Timestamp:
2003-09-09T14:42:32+12:00 (21 years ago)
Author:
mdewsnip
Message:

Added code to differentiate feature requests from bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/util/StatusHTML.java

    r5366 r5480  
    1111    static final private String LIGHT_RED   = "F0E0E0";
    1212
     13    static final private String DARK_BLUE   = "B0B0D0";
     14    static final private String LIGHT_BLUE  = "E0E0F0";
     15
    1316    static final private String FIXED_STR   = "Fixed";
    1417    static final private String NOTHING_STR   = "Nothing";
    1518
    16     static final private String FIXED = "  <!-- Header -->\n  <TR bgcolor=\"#B0D0B0\">\n    <TD colspan=\"2\"><STRONG><A name=\"23b\">GLI v2.3 beta - Closed Reports [FIXED_COUNT total]</A></STRONG></TD>\n  </TR>\n  <TR>\n    <TD bgcolor=\"#FFFFFF\" colspan=\"2\">In order recieved. Similar problems only mentioned once, with descriptions combined where possible.</TD>\n  </TR>\n  <TR>\n    <TD colspan=\"2\">&#160;</TD>\n  </TR>\n";
     19    static final private String FEATURES = "  <!-- Header -->\n  <TR bgcolor=\"#B0B0D0\">\n    <TD colspan=\"2\"><STRONG><A name=\"23b\">GLI v2.3 beta - Feature Requests [FEATURE_COUNT total]</A></STRONG></TD>\n  </TR>\n  <TR>\n    <TD bgcolor=\"#FFFFFF\" colspan=\"2\">In order received. Similar problems only mentioned once, with descriptions combined where possible.</TD>\n  </TR>\n  <TR>\n    <TD colspan=\"2\">&#160;</TD>\n  </TR>\n";
     20
     21    static final private String FIXED = "  <!-- Header -->\n  <TR bgcolor=\"#B0D0B0\">\n    <TD colspan=\"2\"><STRONG><A name=\"23b\">GLI v2.3 beta - Closed Reports [FIXED_COUNT total]</A></STRONG></TD>\n  </TR>\n  <TR>\n    <TD bgcolor=\"#FFFFFF\" colspan=\"2\">In order received. Similar problems only mentioned once, with descriptions combined where possible.</TD>\n  </TR>\n  <TR>\n    <TD colspan=\"2\">&#160;</TD>\n  </TR>\n";
    1722
    1823    static final private String FOOTER = "  <TR><TD>&nbsp;</TD></TR>\n</TABLE>\n<TABLE bgcolor=\"#FFFFFF\" width=\"100%\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">\n  <TR>\n    <TD align=\"center\">Written by John Thompson. Any comments, bug reports email <A href=\"mailto:[email protected]\">here</A>.</TD>\n  </TR>\n</TABLE>\n</BODY>\n</HTML>";
    1924    static final private String HEADER = "<HTML>\n<HEAD>\n<TITLE>GLI Project Status</TITLE>\n</HEAD>\n<BODY bgcolor=\"#CCCCCC\">\n<TABLE bgcolor=\"#FFFFFF\" width=\"100%\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">\n  <!-- Header -->\n  <TR bgcolor=\"#B0D0B0\">\n    <TD align=\"center\" colspan=\"7\"><FONT size=\"4\"><STRONG>Greenstone Librarian Interface (GLI) version 2.3 beta</STRONG></FONT></TD>\n  </TR>\n  <TR>\n    <TD colspan=\"7\">This page lists the features planned for the Greenstone Librarian Interface in its next release. It also details the various bugs that have been found and reported in this version of the GLI. You can also review the status reports for these other versions:</TD>\n  </TR>\n  <TR bgcolor=\"#B0D0B0\">\n    <TD align=\"center\">Status v2.3 beta</TD>\n    <TD align=\"center\"><A href=\"http://www.greenstone.org/gatherer/status_23c.html\">Status v2.3c</A></TD>\n    <TD align=\"center\"><A href=\"http://www.greenstone.org/gatherer/status_23b.html\">Status v2.3b</A></TD>\n    <TD align=\"center\"><A href=\"http://www.greenstone.org/gatherer/status_23a.html\">Status v2.3a</A></TD>\n    <TD align=\"center\"><A href=\"http://www.greenstone.org/gatherer/status_22b.html\">Status v2.2b</A></TD>\n    <TD align=\"center\"><A href=\"http://www.greenstone.org/gatherer/status_21.html\">Status v2.1</A></TD>\n    <TD align=\"center\"><A href=\"http://www.greenstone.org/gatherer/status_20.html\">Status v2.0</A></TD>\n  </TR>\n</TABLE>\n<BR/>\n<TABLE border=\"0\" cellpadding=\"5\" cellspacing=\"0\" width=\"100%\">\n";
    2025   
    21     static final private String PENDING = "  <TR><TD bgcolor=\"#CCCCCC\">&nbsp;</TD></TR>\n  <!-- Header -->\n  <TR bgcolor=\"#D0B0B0\">\n    <TD colspan=\"2\"><STRONG><A name=\"23b\">GLI v2.3 beta - Current Reports [PENDING_COUNT total]</A></STRONG></TD>\n  </TR>\n  <TR>\n    <TD bgcolor=\"#FFFFFF\" colspan=\"2\">In order recieved. Similar problems only mentioned once, with descriptions combined where possible.</TD>\n  </TR>\n  <TR>\n    <TD colspan=\"2\">&#160;</TD>\n  </TR>\n";
     26    static final private String PENDING = "  <TR><TD bgcolor=\"#CCCCCC\">&nbsp;</TD></TR>\n  <!-- Header -->\n  <TR bgcolor=\"#D0B0B0\">\n    <TD colspan=\"2\"><STRONG><A name=\"23b\">GLI v2.3 beta - Current Reports [PENDING_COUNT total]</A></STRONG></TD>\n  </TR>\n  <TR>\n    <TD bgcolor=\"#FFFFFF\" colspan=\"2\">In order received. Similar problems only mentioned once, with descriptions combined where possible.</TD>\n  </TR>\n  <TR>\n    <TD colspan=\"2\">&#160;</TD>\n  </TR>\n";
    2227
    2328    static final private String[] PREFIX = {    "  <TR><TD bgcolor=\"#DARK_COLOR\" valign=\"top\">ID#</TD>              <TD bgcolor=\"#DARK_COLOR\">","  <TR><TD bgcolor=\"#DARK_COLOR\" valign=\"top\">Description</TD>      <TD bgcolor=\"#LIGHT_COLOR\">","  <TR><TD bgcolor=\"#DARK_COLOR\" valign=\"top\">Reported By</TD>      <TD bgcolor=\"#FFFFFF\">","  <TR><TD bgcolor=\"#DARK_COLOR\" valign=\"top\">Platform</TD>         <TD bgcolor=\"#FFFFFF\">","  <TR><TD bgcolor=\"#DARK_COLOR\" valign=\"top\">Test Item#</TD>       <TD bgcolor=\"#FFFFFF\">","  <TR><TD bgcolor=\"#DARK_COLOR\" valign=\"top\">Status</TD>           <TD bgcolor=\"#FFFFFF\">","  <TR><TD bgcolor=\"#DARK_COLOR\" valign=\"top\">Proposed Solution</TD><TD bgcolor=\"#FFFFFF\">","  <TR><TD bgcolor=\"#DARK_COLOR\" valign=\"top\">Solution</TD><TD bgcolor=\"#FFFFFF\">",  "  <TR><TD bgcolor=\"#CCCCCC\">&nbsp;"};
     
    4752    LinkedList reports = new LinkedList();
    4853    try {
     54        int feature_count = 0;
    4955        int fixed_count = 0;
    5056        int pending_count = 0;
     
    5763        if(report.isFixed()) {
    5864            fixed_count++;
     65        }
     66        else if (report.isFeatureRequest()) {
     67            feature_count++;
    5968        }
    6069        else {
     
    7584        // Write out all the pending jobs
    7685        out.write((PENDING.replaceAll("PENDING_COUNT", String.valueOf(pending_count))).getBytes());
    77         for(int i = 0; i < reports.size(); i++) {
     86
     87        // Write out the bugs
     88        for (int i = 0; i < reports.size(); i++) {
    7889        Report report = (Report) reports.get(i);
    79         if(!report.isFixed()) {
     90        if (!report.isFixed() && !report.isFeatureRequest()) {
    8091            out.write(report.getBytes(DARK_RED, LIGHT_RED));
     92        }
     93        }
     94
     95        // Write out all the feature requests
     96        out.write((FEATURES.replaceAll("FEATURE_COUNT", String.valueOf(feature_count))).getBytes());
     97
     98        // Write out the feature requests
     99        for (int i = 0; i < reports.size(); i++) {
     100        Report report = (Report) reports.get(i);
     101        if (!report.isFixed() && report.isFeatureRequest()) {
     102            out.write(report.getBytes(DARK_BLUE, LIGHT_BLUE));
    81103        }
    82104        report = null;
     
    126148    }
    127149
     150    public boolean isFeatureRequest() {
     151        return (bug_id.indexOf("F") != -1);
     152    }
     153
    128154    public byte[] getBytes(String dark_color, String light_color) {
    129155        StringBuffer text_buffer = new StringBuffer();
Note: See TracChangeset for help on using the changeset viewer.