Package org.wikipediacleaner.api

Examples of org.wikipediacleaner.api.MediaWiki.retrieveContents()


        if (toAdd) {
          tmpPages.add(page);
        }
      }
      if (!tmpPages.isEmpty()) {
        mw.retrieveContents(wiki, tmpPages, true, false, false, false);
      }
    }

    return true;
  }
View Full Code Here


   */
  @Override
  public Object construct() {
    try {
      MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
      mw.retrieveContents(getWikipedia(), page, false, false, false, true, false);
      mw.retrieveAllBacklinks(getWikipedia(), page, true);
      ArrayList<Page> pageAndRedirects = new ArrayList<Page>();
      pageAndRedirects.add(page);
      for (Page backlink : page.getBackLinksWithRedirects()) {
        if ((backlink != null) && (backlink.isRedirect())) {
View Full Code Here

      ArrayList<Page> pageAndRedirects = new ArrayList<Page>();
      pageAndRedirects.add(page);
      for (Page backlink : page.getBackLinksWithRedirects()) {
        if ((backlink != null) && (backlink.isRedirect())) {
          pageAndRedirects.add(backlink);
          mw.retrieveContents(getWikipedia(), backlink, false, false, false, false, false);
        }
      }
      mw.retrieveDisambiguationInformation(getWikipedia(), pageAndRedirects, null, false, false, false);
      mw.retrieveAllLinks(getWikipedia(), page, null, null, true, false);
    } catch (APIException e) {
View Full Code Here

  @Override
  public Object construct() {
    try {
      MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
      if (page != null) {
        mw.retrieveContents(getWikipedia(), page, true, false, true, false, true);
      } else {
        mw.retrieveContents(getWikipedia(), pages, true, true, false, true);
      }
      setText("Analyzing data");
    } catch (APIException e) {
View Full Code Here

    try {
      MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
      if (page != null) {
        mw.retrieveContents(getWikipedia(), page, true, false, true, false, true);
      } else {
        mw.retrieveContents(getWikipedia(), pages, true, true, false, true);
      }
      setText("Analyzing data");
    } catch (APIException e) {
      return e;
    }
View Full Code Here

              for (String pageName : whiteList) {
                Page page = DataManager.getPage(wiki, pageName, null, null, null);
                pages.add(page);
              }
              Collections.sort(pages);
              mw.retrieveContents(wiki, pages, true, false, false, false);
              for (Page page : pages) {
                if (Boolean.FALSE.equals(page.isExisting())) {
                  details.append("<li>");
                  details.append(GT._("The page {0} doesn''t exist on Wikipedia", page.getTitle()));
                  details.append("</li>");
View Full Code Here

    }
    MediaWiki mw = MediaWiki.getMediaWikiAccess(worker);
    if (section0) {
      mw.retrieveSectionContents(wiki, mapTalkPages.values(), 0, false);
    } else {
      mw.retrieveContents(wiki, mapTalkPages.values(), false, false, false, false);
    }
    mw.retrieveContents(wiki, mapTodoSubpages.values(), true, false, false, false);
    if (mw.shouldStop()) {
      return;
    }
View Full Code Here

    if (section0) {
      mw.retrieveSectionContents(wiki, mapTalkPages.values(), 0, false);
    } else {
      mw.retrieveContents(wiki, mapTalkPages.values(), false, false, false, false);
    }
    mw.retrieveContents(wiki, mapTodoSubpages.values(), true, false, false, false);
    if (mw.shouldStop()) {
      return;
    }

    // Update warning
View Full Code Here

  public Object construct() {
    try {
      MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
      final API api = APIFactory.getAPI();
      EnumWikipedia wiki = getWikipedia();
      mw.retrieveContents(wiki, page, false, false, false, true, false);
      api.retrieveLinks(wiki, page, Namespace.MAIN, knownPages, true, true);

      // Retrieve disambiguation information if not already retrieved
      List<Page> links = new ArrayList<Page>();
      for (Page link : page.getLinks()) {
View Full Code Here

            if (!link2.isRedirect()) {
              mw.retrieveAllLinks(wiki, link2, null, knownPages, false, false);
            }
            if (link.hasWiktionaryTemplate() &&
                (link.getContents() == null)) {
              mw.retrieveContents(wiki, link2, false, false, false, true, false);
            }
          }
        }
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.