Examples of retrieveContents()


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

        // Retrieve image descriptions
        Page imagePage = DataManager.getPage(
            image.getWiki(),
            image.getNamespace() + ":" + image.getImage(),
            null, null, null);
        api.retrieveContents(
            image.getWiki(),
            Collections.singletonList(imagePage), false, false);

        // Use image description on the wiki
        if (Boolean.TRUE.equals(imagePage.isExisting())) {
View Full Code Here

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

        // Retrieve image description on Commons
        Page commonsPage = DataManager.getPage(
            EnumWikipedia.COMMONS,
            "File:" + image.getImage(),
            null, null, null);
        api.retrieveContents(
            EnumWikipedia.COMMONS,
            Collections.singletonList(commonsPage), false, false);
        if (Boolean.TRUE.equals(commonsPage.isExisting())) {
          PageAnalysis pageAnalysis = commonsPage.getAnalysis(commonsPage.getContents(), true);
          for (PageElementTemplate template : pageAnalysis.getTemplates()) {
View Full Code Here

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

      String translationPage = wpcConfiguration.getString(WPCConfigurationString.CW_TRANSLATION_PAGE);
      if (translationPage != null) {
        Page page = DataManager.getPage(
            wiki, translationPage,
            null, null, null);
        api.retrieveContents(wiki, Collections.singleton(page), false, false);
        if (Boolean.TRUE.equals(page.isExisting())) {
          cwConfiguration.setWikiConfiguration(new StringReader(page.getContents()));
        }
      }
    } catch (APIException e) {
View Full Code Here

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

    setText(prefix + " - " + GT._("Analyzing page {0}", page.getTitle()));

    // Retrieve page content
    API api = APIFactory.getAPI();
    api.retrieveContents(getWikipedia(), Collections.singletonList(page), true, false);
    PageAnalysis analysis = page.getAnalysis(page.getContents(), true);

    // Check that robots are authorized to change this page
    if (saveModifications) {
      WPCConfiguration config = getWikipedia().getConfiguration();
View Full Code Here

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

    //api.retrieveLinksWithRedirects(from, original, null, null);
    api.initializeRedirect(from, Collections.singletonList(original));
    if (!original.isRedirect()) {
      return link;
    }
    api.retrieveContents(from, Collections.singletonList(original), false, true);
    link = api.getLanguageLink(from, getWikipedia(), original.getRedirectTitle());
    if (link == null) {
      return null;
    }
    String destination = original.getRedirectDestination();
View Full Code Here

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

        }
      }

      API api = APIFactory.getAPI();
      Page category = DataManager.getPage(toWikipedia, "Category:" + title, null, null, null);
      api.retrieveContents(toWikipedia, Collections.singletonList(category), false, false);
      if (category.isExisting() == null) {
        Utilities.displayWarning(
            textPane.getParent(),
            GT._(
                "Unable to find if category {0} exists in \"{1}\".",
View Full Code Here

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

        if (updatePage) {
          try {
            Page page = DataManager.getPage(wiki, pageName, null, null, null);
            API api = APIFactory.getAPI();
            api.retrieveContents(wiki, Collections.singletonList(page), false, false);
            String contents = page.getContents();
            if (contents != null) {
              int begin = -1;
              int end = -1;
              for (PageElementComment comment : page.getAnalysis(contents, true).getComments()) {
View Full Code Here

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

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

   */
  @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

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

      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
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.