Package info.bliki.wiki.model

Examples of info.bliki.wiki.model.Reference


        "\n" +
        "<p>A <sup id=\"_ref-1\" class=\"reference\"><a href=\"#_note-1\" title=\"\">[1]</a></sup> and a <sup id=\"_ref-2\" class=\"reference\"><a href=\"#_note-2\" title=\"\">[2]</a></sup> Test</p><ol class=\"references\">\n" +
        "<li id=\"_note-1\"><b><a href=\"#_ref-1\" title=\"\">&#8593;</a></b> first reference</li><li id=\"_note-2\"><b><a href=\"#_ref-2\" title=\"\">&#8593;</a></b> second reference</li></ol>",
        wikiModel.render("A <ref>first reference</ref> and a <ref>second reference</ref> Test\n\n<references/>"));
    List list = wikiModel.getReferences();
    Reference ref = (Reference) list.get(0);
    assertTrue(ref.getRefString().equals("first reference"));
    ref = (Reference) list.get(1);
    assertTrue(ref.getRefString().equals("second reference"));
  }
View Full Code Here


        "\n" +
        "<p>aaa <sup id=\"_ref-Freitag_a\" class=\"reference\"><a href=\"#_note-Freitag\" title=\"\">[1]</a></sup> bbb<sup id=\"_ref-Arndt_a\" class=\"reference\"><a href=\"#_note-Arndt\" title=\"\">[2]</a></sup> <sup id=\"_ref-3\" class=\"reference\"><a href=\"#_note-3\" title=\"\">[3]</a></sup> </p><ol class=\"references\">\n" +
        "<li id=\"_note-1\"><b><a href=\"#_ref-1\" title=\"\">&#8593;</a></b> </li><li id=\"_note-2\"><b><a href=\"#_ref-2\" title=\"\">&#8593;</a></b> </li><li id=\"_note-3\"><b><a href=\"#_ref-3\" title=\"\">&#8593;</a></b> ccc</li></ol>",
        wikiModel.render("aaa <ref name=\"Freitag\"/> bbb<ref name=\"Arndt\"/> <ref>ccc</ref> <references/>"));
    List list = wikiModel.getReferences();
    Reference ref = (Reference) list.get(0);
    assertTrue(ref.getRefString().equals(""));
    ref = (Reference) list.get(1);
    assertTrue(ref.getRefString().equals(""));
    ref = (Reference) list.get(2);
    assertTrue(ref.getRefString().equals("ccc"));
  }
View Full Code Here

        "\n" +
        "<p>aaa <sup id=\"_ref-Freitag_a\" class=\"reference\"><a href=\"#_note-Freitag\" title=\"\">[1]</a></sup> bbb<sup id=\"_ref-Arndt_a\" class=\"reference\"><a href=\"#_note-Arndt\" title=\"\">[2]</a></sup> <sup id=\"_ref-3\" class=\"reference\"><a href=\"#_note-3\" title=\"\">[3]</a></sup> </p><ol class=\"references\">\n" +
        "<li id=\"_note-1\"><b><a href=\"#_ref-1\" title=\"\">&#8593;</a></b> </li><li id=\"_note-2\"><b><a href=\"#_ref-2\" title=\"\">&#8593;</a></b> arn</li><li id=\"_note-3\"><b><a href=\"#_ref-3\" title=\"\">&#8593;</a></b> ccc</li></ol>",
        wikiModel.render("aaa <ref name=Freitag></ref> bbb<ref  name=Arndt>arn</ref> <ref>ccc</ref> <references/>"));
    List list = wikiModel.getReferences();
    Reference ref = (Reference) list.get(0);
    assertTrue(ref.getRefString().equals(""));
    ref = (Reference) list.get(1);
    assertTrue(ref.getRefString().equals("arn"));
    ref = (Reference) list.get(2);
    assertTrue(ref.getRefString().equals("ccc"));
  }
View Full Code Here

        "\n" +
        "<p>aaa <sup id=\"_ref-Freitag_a\" class=\"reference\"><a href=\"#_note-Freitag\" title=\"\">[1]</a></sup> bbb<sup id=\"_ref-Arndt_a\" class=\"reference\"><a href=\"#_note-Arndt\" title=\"\">[2]</a></sup> <sup id=\"_ref-3\" class=\"reference\"><a href=\"#_note-3\" title=\"\">[3]</a></sup> </p><ol class=\"references\">\n" +
        "<li id=\"_note-1\"><b><a href=\"#_ref-1\" title=\"\">&#8593;</a></b> </li><li id=\"_note-2\"><b><a href=\"#_ref-2\" title=\"\">&#8593;</a></b> </li><li id=\"_note-3\"><b><a href=\"#_ref-3\" title=\"\">&#8593;</a></b> ccc</li></ol>",
        wikiModel.render("aaa <ref name=Freitag/> bbb<ref name=Arndt /> <ref>ccc</ref> <references/>"));
    List list = wikiModel.getReferences();
    Reference ref = (Reference) list.get(0);
    assertTrue(ref.getRefString().equals(""));
    ref = (Reference) list.get(1);
    assertTrue(ref.getRefString().equals(""));
    ref = (Reference) list.get(2);
    assertTrue(ref.getRefString().equals("ccc"));
  }
View Full Code Here

  @Override
  public void renderHTML(ITextConverter converter, Appendable writer, IWikiModel model) throws IOException {
    List<Reference> list = model.getReferences();
    if (list != null) {
      Reference ref;
      int counter;
      writer.append("<ol class=\"references\">\n");
      for (int i = 0; i < list.size(); i++) {
        ref = list.get(i);
        counter = ref.getCounter();
        writer.append("<li id=\"_note-");
        String nameAttribute = Encoder.encodeDotUrl(ref.getAttribute());
        if (counter == 0) {
          if (nameAttribute.length() == 0) {
            String i1 = Integer.toString(i + 1);
            writer.append(i1);
            writer.append("\"><b><a href=\"#_ref-");
            writer.append(i1);
          } else {
            writer.append(nameAttribute);
            writer.append("\"><b><a href=\"#_ref-");
            writer.append(nameAttribute);
          }
          // upwards arrow
          writer.append("\" title=\"\">&#8593;</a></b> ");// &uarr;
        } else {
          String note;
          char ch;
          writer.append(nameAttribute);
          writer.append("\">&#8593; "); // &uarr;
          for (int j = 0; j <= counter; j++) {

            if (j >= Reference.CHARACTER_REFS.length()) {
              ch = 'Z';
            } else {
              ch = Reference.CHARACTER_REFS.charAt(j);
            }
            if (j != 0) {
              note = nameAttribute + '_' + ch;
            } else {
              note = nameAttribute;
            }
            writer.append("<a href=\"#_ref-");
            writer.append(note);
            writer.append("\" title=\"\"><sup><i><b>" + ch + "</b></i></sup></a> ");
          }
        }
        writer.append(ref.getRefString());
        writer.append("</li>");
      }
      writer.append("\n</ol>");
    }
  }
View Full Code Here

    @Override
    public void renderHTML(ITextConverter converter, Appendable writer, IWikiModel model) throws IOException {
        List<Reference> list = model.getReferences();
        if (list != null) {
            Reference ref;
            int counter;
            writer.append("<ol class=\"references\">\n");
            for (int i = 0; i < list.size(); i++) {
                ref = list.get(i);
                counter = ref.getCounter();
                writer.append("<li id=\"_note-");
                String nameAttribute = Encoder.encodeDotUrl(ref.getAttribute());
                if (counter == 0) {
                    if (nameAttribute.length() == 0) {
                        String i1 = Integer.toString(i + 1);
                        writer.append(i1);
                        writer.append("\"><b><a href=\"#_ref-");
                        writer.append(i1);
                    } else {
                        writer.append(nameAttribute);
                        writer.append("\"><b><a href=\"#_ref-");
                        writer.append(nameAttribute);
                    }
                    // upwards arrow
                    writer.append("\" title=\"\">&#8593;</a></b> ");// &uarr;
                } else {
                    String note;
                    char ch;
                    writer.append(nameAttribute);
                    writer.append("\">&#8593; "); // &uarr;
                    for (int j = 0; j <= counter; j++) {

                        if (j >= Reference.CHARACTER_REFS.length()) {
                            ch = 'Z';
                        } else {
                            ch = Reference.CHARACTER_REFS.charAt(j);
                        }
                        if (j != 0) {
                            note = nameAttribute + '_' + ch;
                        } else {
                            note = nameAttribute;
                        }
                        writer.append("<a href=\"#_ref-");
                        writer.append(note);
                        writer.append("\" title=\"\"><sup><i><b>" + ch + "</b></i></sup></a> ");
                    }
                }
                writer.append(ref.getRefString());
                writer.append("</li>");
            }
            writer.append("\n</ol>");
        }
    }
View Full Code Here

        assertThat(wikiModel
                .render("A <ref>Reference</ref> Test\n\n<references/>", false)).isEqualTo("\n"
                + "<p>A <sup id=\"_ref-1\" class=\"reference\"><a href=\"#_note-1\" title=\"\">[1]</a></sup> Test</p><ol class=\"references\">\n"
                + "<li id=\"_note-1\"><b><a href=\"#_ref-1\" title=\"\">&#8593;</a></b> Reference</li>\n</ol>");
        List<Reference> list = wikiModel.getReferences();
        Reference ref = list.get(0);
        assertThat(ref.getRefString()).isEqualTo("Reference");
    }
View Full Code Here

    @Test public void testRef02() {
        assertThat(wikiModel.render("A <ref>first reference</ref> and a <ref>second reference</ref> Test\n\n<references/>", false)).isEqualTo("\n"
                + "<p>A <sup id=\"_ref-1\" class=\"reference\"><a href=\"#_note-1\" title=\"\">[1]</a></sup> and a <sup id=\"_ref-2\" class=\"reference\"><a href=\"#_note-2\" title=\"\">[2]</a></sup> Test</p><ol class=\"references\">\n"
                + "<li id=\"_note-1\"><b><a href=\"#_ref-1\" title=\"\">&#8593;</a></b> first reference</li><li id=\"_note-2\"><b><a href=\"#_ref-2\" title=\"\">&#8593;</a></b> second reference</li>\n</ol>");
        List<Reference> list = wikiModel.getReferences();
        Reference ref = list.get(0);
        assertThat(ref.getRefString()).isEqualTo("first reference");
        ref = list.get(1);
        assertThat(ref.getRefString()).isEqualTo("second reference");
    }
View Full Code Here

    @Test public void testRef03() {
        assertThat(wikiModel.render("aaa <ref name=\"Freitag\"/> bbb<ref name=\"Arndt\"/> <ref>ccc</ref> <references/>", false)).isEqualTo("\n" +
                "<p>aaa <sup id=\"_ref-Freitag\" class=\"reference\"><a href=\"#_note-Freitag\" title=\"\">[1]</a></sup> bbb<sup id=\"_ref-Arndt\" class=\"reference\"><a href=\"#_note-Arndt\" title=\"\">[2]</a></sup> <sup id=\"_ref-3\" class=\"reference\"><a href=\"#_note-3\" title=\"\">[3]</a></sup> </p><ol class=\"references\">\n" +
                "<li id=\"_note-Freitag\"><b><a href=\"#_ref-Freitag\" title=\"\">&#8593;</a></b> </li><li id=\"_note-Arndt\"><b><a href=\"#_ref-Arndt\" title=\"\">&#8593;</a></b> </li><li id=\"_note-3\"><b><a href=\"#_ref-3\" title=\"\">&#8593;</a></b> ccc</li>\n</ol>");
        List<Reference> list = wikiModel.getReferences();
        Reference ref = list.get(0);
        assertThat(ref.getRefString()).isEqualTo("");
        ref = list.get(1);
        assertThat(ref.getRefString()).isEqualTo("");
        ref = list.get(2);
        assertThat(ref.getRefString()).isEqualTo("ccc");
    }
View Full Code Here

    @Test public void testRef04() {
        assertThat(wikiModel.render("aaa <ref name=Freitag></ref> bbb<ref    name=Arndt>arn</ref> <ref>ccc</ref> <references/>", false)).isEqualTo("\n" +
                "<p>aaa <sup id=\"_ref-Freitag\" class=\"reference\"><a href=\"#_note-Freitag\" title=\"\">[1]</a></sup> bbb<sup id=\"_ref-Arndt\" class=\"reference\"><a href=\"#_note-Arndt\" title=\"\">[2]</a></sup> <sup id=\"_ref-3\" class=\"reference\"><a href=\"#_note-3\" title=\"\">[3]</a></sup> </p><ol class=\"references\">\n" +
                "<li id=\"_note-Freitag\"><b><a href=\"#_ref-Freitag\" title=\"\">&#8593;</a></b> </li><li id=\"_note-Arndt\"><b><a href=\"#_ref-Arndt\" title=\"\">&#8593;</a></b> arn</li><li id=\"_note-3\"><b><a href=\"#_ref-3\" title=\"\">&#8593;</a></b> ccc</li>\n</ol>");
        List<Reference> list = wikiModel.getReferences();
        Reference ref = list.get(0);
        assertThat(ref.getRefString()).isEqualTo("");
        ref = list.get(1);
        assertThat(ref.getRefString()).isEqualTo("arn");
        ref = list.get(2);
        assertThat(ref.getRefString()).isEqualTo("ccc");
    }
View Full Code Here

TOP

Related Classes of info.bliki.wiki.model.Reference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.