Example #1
0
 private void buildListOfAllPatterns(Domain domain, String prefix, int level)
     throws TermWareException {
   SortedSet directSystemNames = domain.getNamesOfSystems();
   Iterator systemsIterator = directSystemNames.iterator();
   while (systemsIterator.hasNext()) {
     String name = (String) systemsIterator.next();
     TermSystem system = domain.resolveSystem(name);
     SortedSet<String> names = system.getPatternNames();
     Iterator namesIterator = names.iterator();
     while (namesIterator.hasNext()) {
       String patternName = (String) namesIterator.next();
       if (!allPatterns_.containsKey(patternName)) {
         HashSet indexEntries = new HashSet();
         allPatterns_.put(patternName, indexEntries);
       }
       HashSet systemsSet = (HashSet) allPatterns_.get(patternName);
       systemsSet.add(new APIGen.PatternIndexEntry(prefix, domain, name, level));
     }
   }
   SortedSet domainsSet = domain.getNamesOfDirectSubdomains();
   Iterator domainsIterator = domainsSet.iterator();
   while (domainsIterator.hasNext()) {
     String subdomainName = (String) domainsIterator.next();
     Domain subdomain = domain.getDirectSubdomain(subdomainName);
     buildListOfAllPatterns(subdomain, prefix + subdomainName + "/", level + 1);
   }
 }
Example #2
0
  private void generateSystemPages(Domain domain, String prefix, int level)
      throws IOException, TermWareException {
    SortedSet directSystemNames = domain.getNamesOfSystems();
    Iterator systemsIterator = directSystemNames.iterator();
    while (systemsIterator.hasNext()) {
      String name = (String) systemsIterator.next();
      PrintStream out = openPrintStream(prefix + name, "all-patterns.html");
      printHeader(out, "patterns for " + name);
      out.println("<BODY BGCOLOR=\"white\">");
      out.println("<TABLE BORDER=\"0\" WIDTH=\"100%\">");
      out.println("<TR>");
      out.println("<TD NOWRAP><FONT size=\"+1\">");
      out.println("Patterns");
      out.println("</FONT></TD>");
      out.println("</TR></TABLE>");
      out.println("<TABLE BORDER=\"0\" WIDTH=\"100%\">");
      out.println("<TR><TD NOWRAP><P>");
      out.println("<FONT>");

      TermSystem system = domain.resolveSystem(name);
      SortedSet names = system.getPatternNames();
      Iterator namesIterator = names.iterator();
      while (namesIterator.hasNext()) {
        String patternName = (String) namesIterator.next();
        String uri = prefix + name + "/index.html#" + patternName;
        out.print("<A href=\"../");
        for (int i = 0; i < level; ++i) {
          out.print("../");
        }
        out.print(uri + "\" TARGET=\"transformerFrame\" >");
        out.print(patternName);
        out.println("</A>");
        out.println("<BR>");
      }
      out.println("</FONT>");
      out.println("</TD>");
      out.println("</TR>");
      out.println("</TABLE>");
      out.println("<P>&nbsp;</BODY></HTML>");
      out.close();
      out = openPrintStream(prefix + name, "index.html");
      TermSystem ts = domain.resolveSystem(name);
      printSystemIndexPage(out, prefix + name, ts);
      out.close();
    }
    SortedSet domainsSet = domain.getNamesOfDirectSubdomains();
    Iterator domainsIterator = domainsSet.iterator();
    while (domainsIterator.hasNext()) {
      String subdomainName = (String) domainsIterator.next();
      Domain subdomain = domain.getDirectSubdomain(subdomainName);
      generateSystemPages(subdomain, prefix + subdomainName + "/", level + 1);
    }
  }
Example #3
0
 private void printListOfSystems(PrintStream out, Domain domain, String prefix)
     throws TermWareException {
   SortedSet directSystemNames = domain.getNamesOfSystems();
   Iterator it = directSystemNames.iterator();
   while (it.hasNext()) {
     String name = (String) it.next();
     out.print("<A HREF=\"" + prefix + name + "/all-patterns.html\" TARGET=\"patternFrame\">");
     out.print(name);
     out.print("</A><BR>");
     out.println();
   }
   SortedSet subdomainNames = domain.getNamesOfDirectSubdomains();
   it = subdomainNames.iterator();
   while (it.hasNext()) {
     String name = (String) it.next();
     printListOfSystems(out, domain.getDirectSubdomain(name), name + "/");
   }
 }