Package org.wikipediacleaner.api

Examples of org.wikipediacleaner.api.MediaWiki


   * @throws APIException
   */
  private void constructDabWatch(List<Page> pages) throws APIException {
    if (elementNames != null) {
      List<Page> tmpPages = constructInternalPageList();
      MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
      mw.retrieveAllBacklinks(getWikipedia(), tmpPages, true);
      Configuration configuration = Configuration.getConfiguration();
      for (Page tmpPage : tmpPages) {
        List<Page> backlinks = tmpPage.getBackLinksWithRedirects();
        if (backlinks != null) {
          Properties pageProperties = configuration.getSubProperties(
View Full Code Here


   * @throws APIException
   */
  private void constructEmbeddedIn(List<Page> pages) throws APIException {
    if (elementNames != null) {
      List<Page> tmpPages = constructInternalPageList();
      MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
      pages.addAll(mw.retrieveAllEmbeddedIn(getWikipedia(), tmpPages, null, true));
    }
  }
View Full Code Here

  private void constructInternalLinks(
      List<Page> pages,
      boolean convertTalkPages) throws APIException {
    for (String dabList : elementNames) {
      Page page = DataManager.getPage(getWikipedia(), dabList, null, null, null);
      MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
      mw.retrieveAllLinks(getWikipedia(), page, null, null, true, true);
      Iterator<Page> iter = page.getLinks().iterator();
      while (iter.hasNext()) {
        Page link = iter.next();
        if (link != null) {
          if (convertTalkPages && !link.isArticle()) {
View Full Code Here

      Boolean exists = tmpPage.isExisting();
      if (!Boolean.TRUE.equals(exists)) {
        tmpPages2.add(tmpPage);
      }
    }
    MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
    List<Page> tmpPages3 = mw.retrieveAllEmbeddedIn(
        wiki, tmpPages2,
        wiki.getConfiguration().getEncyclopedicNamespaces(), true);
    pages.addAll(tmpPages3);
    Collections.sort(pages, PageComparator.getNamespaceFirstComparator());
  }
View Full Code Here

        wiki, Collections.singletonList(Namespace.MAIN), false);
    if ((tmpPages == null) || (tmpPages.isEmpty())) {
      return;
    }
    setText(GT._("Checking that protected titles have backlinks"));
    MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
    mw.retrieveAllBacklinks(wiki, tmpPages, true);
    for (Page page : tmpPages) {
      Integer backlinks = page.getBacklinksCountInMainNamespace();
      if ((backlinks != null) && (backlinks.intValue() > 0)) {
        pages.add(page);
      }
View Full Code Here

   * @see org.wikipediacleaner.gui.swing.utils.SwingWorker#construct()
   */
  @Override
  public Object construct() {
    try {
      MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
      if (textExpanded != null) {
        textExpanded.setText(mw.expandTemplates(getWikipedia(), title, textOriginal.getText()));
      }
      if (htmlPreview != null) {
        String text = mw.parseText(getWikipedia(), title, textOriginal.getText());
        htmlPreview.setHtml(
            "<html><head>" +
            "</head><body>" + text + "</body></html>");
      }
    } catch (APIException e) {
View Full Code Here

   * @see org.wikipediacleaner.gui.swing.utils.SwingWorker#construct()
   */
  @Override
  public Object construct() {
    try {
      MediaWiki mw = MediaWiki.getMediaWikiAccess(this);
      mw.retrieveAllBacklinks(getWikipedia(), pageList, true);
    } catch (APIException e) {
      return e;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.api.MediaWiki

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.