private String filterOldStyle(String line) {
    String[] pieces = line.split("\t", -1);

    if (filterTypes) pieces[1] = FilterDefectTypes.mapDefectType(pieces[1]);

    if (stripComments) pieces[6] = " ";

    if (phaseFilter != null) {
      pieces[2] = phaseFilter.getString(pieces[2]);
      pieces[3] = phaseFilter.getString(pieces[3]);
    }

    return StringUtils.join(Arrays.asList(pieces), "\t");
  }
  protected void writeContents() throws IOException {
    getDataRepository().waitForCalculations();

    String prefix = getPrefix();
    PropertyKey projectRootKey = getStartingKey();
    String projectRoot = projectRootKey.path();
    String currentFilter = SelectLabelFilter.getCurrentFilter(getDataRepository(), projectRoot);
    boolean isSnippet = (env.containsKey(SnippetEnvironment.SNIPPET_ID));
    boolean isIndiv = (getID(getPSPProperties(), projectRootKey).indexOf("Indiv") != -1);
    boolean useData = SelectWBSFilterTeamData.usesDataBasedFilter(getDataRepository(), projectRoot);

    out.println("<html><head>");
    out.println("<link rel=stylesheet type='text/css' href='/style.css'>");
    if (isSnippet && StringUtils.hasValue(currentFilter))
      out.println("<link rel=stylesheet type='text/css' href='/reports/filter-style.css'>");
    out.println("<style>");
    out.println(" body { margin: 0pt; padding: 2px }");
    out.println(" h1   { margin: 0pt; padding: 0pt }");
    out.println(" h2   { margin: 0pt; padding: 0pt }");
    out.println("</style></head><body>");
    out.print("<h1 style='margin-top:0pt'><!-- editLink -->");
    out.print(HTMLUtils.escapeEntities(projectRoot));
    out.println("</h1>");
    out.print("<h2>");

    writeFilterIcon(projectRoot, currentFilter);
    if (isIndiv) writeHierarchyIconIndiv(projectRoot);
    else if (useData) writeHierarchyIconData(projectRoot);
    else writeHierarchyIconFrame(prefix, projectRoot);

    out.println("</h2>");
    String cmsPageTitle = (String) env.get("cmsPageTitle");
    if (cmsPageTitle != null) {
      out.print("<h2>");
      out.print(HTMLUtils.escapeEntities(cmsPageTitle));
      out.println("</h2>");
    }
    out.println("</body></html>");
  }
예제 #3
0
  private void repairMasterProjectLinks() {
    if (!StringUtils.hasValue(masterPrefix)) return;

    String masterTagDataName = masterPrefix + "/" + processID + " Master Root Tag";
    Object tag = ctx.getData().getSimpleValue(masterTagDataName);
    if (!(tag instanceof TagData)) {
      couldNotRepairMasterLinks();
      return;
    }

    String url =
        WebServer.DASHBOARD_PROTOCOL
            + ":"
            + WebServer.urlEncodePath(masterPrefix)
            + "//"
            + processID
            + "/setup/subprojectEdit?do=update";
    try {
      InputStream in = new URL(url).openStream();
      while (in.read() != -1) ;
    } catch (Exception e) {
      couldNotRepairMasterLinks();
    }
  }
예제 #4
0
 private static String[] split_(String s) {
   String[] result = StringUtils.split(s, "\r\n");
   if (result.length == 1 && s.length() > 80) result = StringUtils.breakDownString(s, 65, true);
   return result;
 }
예제 #5
0
 public String interpolate(String s, StringMapper escape) {
   if (escape == null) return StringUtils.interpolate(this, s);
   else return StringUtils.interpolate(StringUtils.concat(escape, this), s);
 }