Search in sources :

Example 6 with DefectTypeStandard

use of net.sourceforge.processdash.process.DefectTypeStandard in project processdash by dtuma.

the class DisplayDefectTypeStandard method writeContents.

/** Generate CGI script output. */
protected void writeContents() {
    DefectTypeStandard defectTypeStandard = null;
    if (parameters.get(NAME) != null)
        defectTypeStandard = DefectTypeStandard.getByName(getParameter(NAME), getDataRepository());
    if (defectTypeStandard == null)
        defectTypeStandard = DefectTypeStandard.get(getPrefix(), getDataRepository());
    String name = defectTypeStandard.getName();
    if (name == null)
        name = "";
    String title = resources.format("Title_FMT", name);
    out.println("<HTML><HEAD>" + cssLinkHTML());
    out.println("<TITLE>" + title + "</TITLE>");
    out.println("</HEAD><BODY>");
    out.println("<H1>" + title + "</H1>");
    out.print("<TABLE BORDER><TR><TD><B>");
    out.print(resources.getString("Type"));
    out.println("</B></TD>");
    out.print("    <TD><B>");
    out.print(resources.getString("Description"));
    out.println("</B></TD></TR>");
    String type, description;
    for (int i = 0; i < defectTypeStandard.options.size(); i++) {
        type = (String) defectTypeStandard.options.elementAt(i);
        description = (String) defectTypeStandard.comments.get(type);
        out.print("<TR><TD VALIGN=baseline>");
        out.print(HTMLUtils.escapeEntities(type));
        out.println("</TD>");
        out.print("    <TD VALIGN=baseline>");
        if (description == null)
            out.print("&nbsp;");
        else
            out.print(HTMLUtils.escapeEntities(description));
        out.println("</TD></TR>");
    }
    out.println("</TABLE>");
    out.println(//
    "<p class='doNotPrint'>" + //
    "<a href='/dash/dtsEdit.class'><i>" + resources.getHTML(//
    EditDefectTypeStandards.canEdit() ? "Create_Edit_Link" : "Standard.Page_Title") + "</i></a></p>");
    if ("PSP - text".equals(name) || "PSP - numbers".equals(name))
        out.println(COPYRIGHT_NOTICE);
    out.println("</BODY></HTML>");
}
Also used : DefectTypeStandard(net.sourceforge.processdash.process.DefectTypeStandard)

Example 7 with DefectTypeStandard

use of net.sourceforge.processdash.process.DefectTypeStandard in project processdash by dtuma.

the class EditDefectTypeStandards method getStandardsToExport.

private List<DefectTypeStandard> getStandardsToExport() {
    String[] selected = (String[]) parameters.get("sel_ALL");
    if (selected == null || selected.length == 0)
        return Collections.EMPTY_LIST;
    List<DefectTypeStandard> result = new ArrayList(selected.length);
    DataRepository data = getDataRepository();
    for (String selectedNum : selected) {
        String selectedName = getParameter("std" + selectedNum);
        DefectTypeStandard selectedStandard = DefectTypeStandard.getByName(selectedName, data);
        if (selectedStandard != null)
            result.add(selectedStandard);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) DataRepository(net.sourceforge.processdash.data.repository.DataRepository) DefectTypeStandard(net.sourceforge.processdash.process.DefectTypeStandard)

Aggregations

DefectTypeStandard (net.sourceforge.processdash.process.DefectTypeStandard)7 ArrayList (java.util.ArrayList)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 LinkedList (java.util.LinkedList)1 TreeMap (java.util.TreeMap)1 DataRepository (net.sourceforge.processdash.data.repository.DataRepository)1 Element (org.w3c.dom.Element)1 NodeList (org.w3c.dom.NodeList)1 XmlSerializer (org.xmlpull.v1.XmlSerializer)1