Package info.bliki.wiki.tags

Examples of info.bliki.wiki.tags.WPATag


      } else {
        hrefLink = fExternalWikiBaseURL.replace("${title}", "");
      }
    }

    WPATag aTagNode = new WPATag();
    aTagNode.addAttribute("title", topic, true);
    String href = hrefLink;
    if (hashSection != null) {
      href = href + '#' + encodeTitleDotUrl(hashSection, true);
    }
    aTagNode.addAttribute("href", href, true);
    if (cssClass != null) {
      aTagNode.addAttribute("class", cssClass, true);
    }
    aTagNode.addObjectAttribute("wikilink", topic);

    pushNode(aTagNode);
    if (parseRecursive) {
      WikipediaParser.parseRecursive(topicDescription.trim(), this,
          false, true);
    } else {
      aTagNode.addChild(new ContentToken(topicDescription));
    }
    popNode();
  }
View Full Code Here


                    return;
                }
                for (Object node : nodes) {
                    if (node instanceof WPATag) {
                        // extract wikilink annotations
                        WPATag tag = (WPATag) node;
                        String wikilinkLabel = (String) tag.getAttributes().get(
                                WIKILINK_TITLE_ATTR_KEY);
                        String wikilinkTarget = (String) tag.getAttributes().get(
                                WIKILINK_TARGET_ATTR_KEY);
                        if (wikilinkLabel != null) {
                            int colonIdx = wikilinkLabel.indexOf(':');
                            if (colonIdx == -1) {
                                // do not serialize non-topic wiki-links such as
                                // translation links missing from the
                                // INTERWIKI_LINK map
                                int start = countingBuffer.currentPosition;
                                tag.getBodyString(countingBuffer);
                                int end = countingBuffer.currentPosition;
                                if (!wikilinkTarget.startsWith("#")) {
                                    wikilinks.add(new Annotation(start, end, wikilinkLabel, wikilinkTarget));
                                }
                            }
                        } else {
                            tag.getBodyString(countingBuffer);
                        }

                    } else if (node instanceof ContentToken) {
                        ContentToken contentToken = (ContentToken) node;
                        countingBuffer.append(contentToken.getContent());
View Full Code Here

    // // Show only descriptions no internal wiki links
    // ContentToken text = new ContentToken(topicDescription);
    // // append(text);
    // aTagNode.addChild(text);

    WPATag aTagNode = new WPATag();
    // append(aTagNode);
    aTagNode.addAttribute("id", "w", true);
    String href = topic;
    if (hashSection != null) {
      href = href + '#' + hashSection;
    }
    aTagNode.addAttribute("href", href, true);
    if (cssClass != null) {
      aTagNode.addAttribute("class", cssClass, true);
    }
    aTagNode.addObjectAttribute("wikilink", topic);
    pushNode(aTagNode);
    WikipediaParser.parseRecursive(topicDescription.trim(), this, false, true);
    popNode();
    // ContentToken text = new ContentToken(topicDescription);
    // aTagNode.addChild(text);
View Full Code Here

    // // Show only descriptions no internal wiki links
    // ContentToken text = new ContentToken(topicDescription);
    // // append(text);
    // aTagNode.addChild(text);

    WPATag aTagNode = new WPATag();
    // append(aTagNode);
    aTagNode.addAttribute("id", "w", true);
    String href = topic;
    if (hashSection != null) {
      href = href + '#' + hashSection;
    }
    aTagNode.addAttribute("href", href, true);
    if (cssClass != null) {
      aTagNode.addAttribute("class", cssClass, true);
    }
    aTagNode.addObjectAttribute("wikilink", topic);
    pushNode(aTagNode);
    WikipediaParser.parseRecursive(topicDescription.trim(), this, false, true);
    popNode();
    // ContentToken text = new ContentToken(topicDescription);
    // aTagNode.addChild(text);
View Full Code Here

      } else {
        hrefLink = fExternalWikiBaseURL.replace("${title}", "");
      }
    }

    WPATag aTagNode = new WPATag();
    // append(aTagNode);
    aTagNode.addAttribute("title", topic, true);
    String href = hrefLink;
    if (hashSection != null) {
      href = href + '#' + encodeTitleDotUrl(hashSection, true);
    }
    aTagNode.addAttribute("href", href, true);
    if (cssClass != null) {
      aTagNode.addAttribute("class", cssClass, true);
    }
    aTagNode.addObjectAttribute("wikilink", topic);

    pushNode(aTagNode);
    if (parseRecursive) {
      WikipediaParser.parseRecursive(topicDescription.trim(), this, false, true);
    } else {
      aTagNode.addChild(new ContentToken(topicDescription));
    }
    popNode();
  }
View Full Code Here

      } else {
        hrefLink = fExternalWikiBaseURL.replace("${title}", "");
      }
    }

    WPATag aTagNode = new WPATag();
    // append(aTagNode);
    aTagNode.addAttribute("title", topic, true);
    String href = hrefLink;
    if (hashSection != null) {
      href = href + '#' + encodeTitleDotUrl(hashSection, true);
    }
    aTagNode.addAttribute("href", href, true);
    if (cssClass != null) {
      aTagNode.addAttribute("class", cssClass, true);
    }
    aTagNode.addObjectAttribute("wikilink", topic);

    pushNode(aTagNode);
    if (parseRecursive) {
      WikipediaParser.parseRecursive(topicDescription.trim(), this, false, true);
    } else {
      aTagNode.addChild(new ContentToken(topicDescription));
    }
    popNode();
  }
View Full Code Here

  public String encodeTitleDotUrl(String wikiTitle, boolean firstCharacterAsUpperCase) {
    return Encoder.encodeTitleDotUrl(wikiTitle, firstCharacterAsUpperCase);
  }

  public void appendInternalLink(String topic, String hashSection, String topicDescription, String cssClass, boolean parseRecursive) {
    WPATag aTagNode = new WPATag();
    // append(aTagNode);
    // aTagNode.addAttribute("id", "w", true);
    String href = encodeTitleToUrl(topic, true);
    if (hashSection != null) {
      href = href + '#' + encodeTitleDotUrl(hashSection, true);
    }
    aTagNode.addAttribute("href", href, true);
    if (cssClass != null) {
      aTagNode.addAttribute("class", cssClass, true);
    }
    aTagNode.addObjectAttribute("wikilink", topic);

    pushNode(aTagNode);
    if (parseRecursive) {
      WikipediaParser.parseRecursive(topicDescription.trim(), this, false, true);
    } else {
      aTagNode.addChild(new ContentToken(topicDescription));
    }
    popNode();

    // ContentToken text = new ContentToken(topicDescription);
    // aTagNode.addChild(text);
View Full Code Here

    // // Show only descriptions no internal wiki links
    // ContentToken text = new ContentToken(topicDescription);
    // // append(text);
    // aTagNode.addChild(text);

    WPATag aTagNode = new WPATag();
    // append(aTagNode);
    aTagNode.addAttribute("id", "w", true);
    String href = topic;
    if (hashSection != null) {
      href = href + '#' + hashSection;
    }
    aTagNode.addAttribute("href", href, true);
    if (cssClass != null) {
      aTagNode.addAttribute("class", cssClass, true);
    }
    aTagNode.addObjectAttribute("wikilink", topic);
    pushNode(aTagNode);
    WikipediaParser.parseRecursive(topicDescription.trim(), this, false, true);
    popNode();
    // ContentToken text = new ContentToken(topicDescription);
    // aTagNode.addChild(text);
View Full Code Here

      } else {
        hrefLink = fExternalWikiBaseURL.replace("${title}", "");
      }
    }

    WPATag aTagNode = new WPATag();
    // append(aTagNode);
    aTagNode.addAttribute("title", topic, true);
    String href = hrefLink;
    if (hashSection != null) {
      href = href + '#' + encodeTitleDotUrl(hashSection, true);
    }
    aTagNode.addAttribute("href", href, true);
    if (cssClass != null) {
      aTagNode.addAttribute("class", cssClass, true);
    }
    aTagNode.addObjectAttribute("wikilink", topic);

    pushNode(aTagNode);
    if (parseRecursive) {
      WikipediaParser.parseRecursive(topicDescription.trim(), this, false, true);
    } else {
      aTagNode.addChild(new ContentToken(topicDescription));
    }
    popNode();
  }
View Full Code Here

  public String encodeTitleDotUrl(String wikiTitle, boolean firstCharacterAsUpperCase) {
    return Encoder.encodeTitleDotUrl(wikiTitle, firstCharacterAsUpperCase);
  }

  public void appendInternalLink(String topic, String hashSection, String topicDescription, String cssClass, boolean parseRecursive) {
    WPATag aTagNode = new WPATag();
    // append(aTagNode);
    // aTagNode.addAttribute("id", "w", true);
    String href = encodeTitleToUrl(topic, true);
    if (hashSection != null) {
      href = href + '#' + encodeTitleDotUrl(hashSection, true);
    }
    aTagNode.addAttribute("href", href, true);
    if (cssClass != null) {
      aTagNode.addAttribute("class", cssClass, true);
    }
    aTagNode.addObjectAttribute("wikilink", topic);

    pushNode(aTagNode);
    if (parseRecursive) {
      WikipediaParser.parseRecursive(topicDescription.trim(), this, false, true);
    } else {
      aTagNode.addChild(new ContentToken(topicDescription));
    }
    popNode();

    // ContentToken text = new ContentToken(topicDescription);
    // aTagNode.addChild(text);
View Full Code Here

TOP

Related Classes of info.bliki.wiki.tags.WPATag

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.