Package org.wikipediacleaner.api.data

Examples of org.wikipediacleaner.api.data.QueryResult


    }
    if (wikipedia.getConnection().getLgToken() == null) {
      throw new APIException("You must be logged in to update pages");
    }
    int attemptNumber = 0;
    QueryResult result = null;
    do {
      attemptNumber++;
      Map<String, String> properties = getProperties(ApiRequest.ACTION_EDIT, true);
      properties.put("assert", "user");
      if (page.getContentsTimestamp() != null) {
View Full Code Here


    }
    if (wikipedia.getConnection().getLgToken() == null) {
      throw new APIException("You must be logged in to update pages");
    }
    int attemptNumber = 0;
    QueryResult result = null;
    do {
      attemptNumber++;
      Map<String, String> properties = getProperties(ApiRequest.ACTION_EDIT, true);
      properties.put("assert", "user");
      if (page.getContentsTimestamp() != null) {
View Full Code Here

  public Object construct() {
    setText(GT._("Retrieving MediaWiki API"));
    API api = APIFactory.getAPI();

    // Updating page contents
    QueryResult queryResult = null;
    try {
      setText(GT._("Updating page contents"));
      queryResult = api.updatePage(
          getWikipedia(), page, text,
          getWikipedia().createUpdatePageComment(comment, null, false),
          forceWatch);
    } catch (APIException e) {
      return e;
    }

    // Take contributions into account
    if ((contributions != null) &&
        (getWikipedia().getContributions() != null)) {
      getWikipedia().getContributions().increaseContributions(contributions);
    }

    // Updating disambiguation warning
    if (updateDabWarning) {
      try {
        UpdateDabWarningTools dabWarningTools = new UpdateDabWarningTools(
            getWikipedia(), this, createDabWarning, false);
        PageAnalysis pageAnalysis = page.getAnalysis(text, true);
        dabWarningTools.updateWarning(
            pageAnalysis, queryResult.getPageNewRevId(),
            null, null, null, null, null);
      } catch (APIException e) {
        return e;
      }
    }

    // Updating ISBN warning
    if (updateISBNWarning) {
      try {
        UpdateISBNWarningTools isbnWarningTools = new UpdateISBNWarningTools(
            getWikipedia(), this, createISBNWarning, false);
        PageAnalysis pageAnalysis = page.getAnalysis(text, true);
        isbnWarningTools.updateWarning(
            pageAnalysis, queryResult.getPageNewRevId(),
            null, null, null, null, null);
      } catch (APIException e) {
        return e;
      }
    }
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.api.data.QueryResult

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.