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(" ");
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>");
}
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;
}
Aggregations