Package info.bliki.wiki.filter.AbstractParser

Examples of info.bliki.wiki.filter.AbstractParser.ParsedPageName


      // less than "#REDIRECT" string
      return rawWikitext;
    }
    String redirectedLink = WikipediaParser.parseRedirect(rawWikitext, this);
    if (redirectedLink != null) {
      ParsedPageName redirParsedPage = AbstractParser.parsePageName(this, redirectedLink, fNamespace.getTemplate(), true, true);
      try {
        int level = incrementRecursionLevel();
        // TODO: what to do if parsing the title failed due to invalid syntax?
        if (level > Configuration.PARSER_RECURSION_LIMIT || !redirParsedPage.valid) {
          return "Error - getting content of redirected link: " + redirParsedPage.namespace + ":" + redirParsedPage.pagename;
View Full Code Here


   */
  @Override
  public void substituteTemplateCall(String templateName, Map<String, String> parameterMap, Appendable writer) throws IOException {
    Counter val = null;
    try {
      ParsedPageName parsedPagename = AbstractParser.parsePageName(this, templateName, fNamespace.getTemplate(), true, true);
      if (!parsedPagename.valid) {
        writer.append("{{");
        writer.append(templateName);
        writer.append("}}");
        return;
View Full Code Here

   */
  @Override
  public void substituteTemplateCall(String templateName, Map<String, String> parameterMap, Appendable writer) throws IOException {
    Counter val = null;
    try {
      ParsedPageName parsedPagename = AbstractParser.parsePageName(this, templateName, fNamespace.getTemplate(), true, true);
      if (!parsedPagename.valid) {
        writer.append("{{");
        writer.append(templateName);
        writer.append("}}");
        return;
View Full Code Here

      // less than "#REDIRECT" string
      return rawWikitext;
    }
    String redirectedLink = WikipediaParser.parseRedirect(rawWikitext, this);
    if (redirectedLink != null) {
      ParsedPageName redirParsedPage = AbstractParser.parsePageName(this, redirectedLink, fNamespace.getTemplate(), true, true);
      try {
        int level = incrementRecursionLevel();
        // TODO: what to do if parsing the title failed due to invalid syntax?
        if (level > Configuration.PARSER_RECURSION_LIMIT || !redirParsedPage.valid) {
          return "Error - getting content of redirected link: " + redirParsedPage.namespace + ":" + redirParsedPage.pagename;
View Full Code Here

    }
    TemplateParser.mergeParameters(parameterMap, unnamedParameters);

    final INamespace namespace = model.getNamespace();
    // TODO: remove trailing "#section"?!
    ParsedPageName parsedPagename = AbstractParser.parsePageName(model, templateName, namespace.getTemplate(), true, false);
    if (!parsedPagename.valid) {
      return "{{" + parsedPagename.pagename + "}}";
    }
   
    String plainContent = model.getRawWikiContent(parsedPagename, parameterMap);
View Full Code Here

      String wikiTopicName = isSubst ? list.get(0) : parseTrim(list.get(0), model);
     
      final INamespace namespace = model.getNamespace();
      // note: appended "#section" does not count for the check whether a page exists or not!
      // -> strip off
      ParsedPageName parsedPagename = AbstractParser.parsePageName(model, wikiTopicName, namespace.getMain(), false, true);
      String rawWikiContent = null;
      // if parsing failed, e.g. double "::" at the page titles beginning, this is the same as if the page does not exist.
      if (parsedPagename.valid) {
        rawWikiContent = model.getRawWikiContent(parsedPagename, null);
      }
View Full Code Here

    }
    TemplateParser.mergeParameters(parameterMap, unnamedParameters);

    final INamespace namespace = model.getNamespace();
    // TODO: remove trailing "#section"?!
    ParsedPageName parsedPagename = AbstractParser.parsePageName(model, templateName, namespace.getTemplate(), true, false);
    if (!parsedPagename.valid) {
      return "{{" + parsedPagename.pagename + "}}";
    }

    String plainContent = null;
View Full Code Here

      final INamespace namespace = model.getNamespace();
      // note: appended "#section" does not count for the check whether a page
      // exists or not!
      // -> strip off
      ParsedPageName parsedPagename = AbstractParser.parsePageName(model, wikiTopicName, namespace.getMain(), false, true);
      String rawWikiContent = null;
      // if parsing failed, e.g. double "::" at the page titles beginning, this
      // is the same as if the page does not exist.
      if (parsedPagename.valid) {
        try {
View Full Code Here

      // less than "#REDIRECT" string
      return rawWikitext;
    }
    String redirectedLink = WikipediaParser.parseRedirect(rawWikitext, this);
    if (redirectedLink != null) {
      ParsedPageName redirParsedPage = AbstractParser.parsePageName(this, redirectedLink, fNamespace.getTemplate(), true, true);
      return AbstractParser.getRedirectedRawContent(this, redirParsedPage, templateParameters);
    }
    return rawWikitext;
  }
View Full Code Here

      // less than "#REDIRECT" string
      return rawWikitext;
    }
    String redirectedLink = WikipediaParser.parseRedirect(rawWikitext, this);
    if (redirectedLink != null) {
      ParsedPageName redirParsedPage = AbstractParser.parsePageName(this, redirectedLink, fNamespace.getTemplate(), true, true);
      return AbstractParser.getRedirectedRawContent(this, redirParsedPage, templateParameters);
    }
    return rawWikitext;
  }
View Full Code Here

TOP

Related Classes of info.bliki.wiki.filter.AbstractParser.ParsedPageName

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.