Package org.wikipediacleaner.api.constants

Examples of org.wikipediacleaner.api.constants.EnumWikipedia


   * Action called when local watch list button is pressed.
   */
  public void actionWatchlistLocal() {
    Configuration config = Configuration.getConfiguration();
    List<String> pageNames = config.getStringList(getWikipedia(), Configuration.ARRAY_WATCH_PAGES);
    EnumWikipedia wikipedia = getWikipedia();
    if (wikipedia == null) {
      return;
    }
    new PageListWorker(
        wikipedia, this, null,
View Full Code Here


  /**
   * Action called when watch list button is pressed.
   */
  public void actionWatchlist() {
    EnumWikipedia wikipedia = getWikipedia();
    if (wikipedia == null) {
      return;
    }
    new PageListWorker(
        wikipedia, this, null,
View Full Code Here

   */
  public void actionChangeWiki() {
    comboUser.removeAllItems();
    comboUser.setSelectedItem("");
    if (comboWikipedia.getSelectedItem() instanceof EnumWikipedia) {
      EnumWikipedia wikipedia = (EnumWikipedia) comboWikipedia.getSelectedItem();
      Configuration configuration = Configuration.getConfiguration();
      Properties users = configuration.getProperties(wikipedia, Configuration.PROPERTIES_USERS);
      for (Object user : users.keySet()) {
        comboUser.addItem(user);
      }
View Full Code Here

   */
  public void actionChangeUser() {
    textPassword.setText("");
    if ((comboWikipedia.getSelectedItem() instanceof EnumWikipedia) &&
        (comboUser.getSelectedItem() instanceof String)) {
      EnumWikipedia wikipedia = (EnumWikipedia) comboWikipedia.getSelectedItem();
      Configuration configuration = Configuration.getConfiguration();
      Properties users = configuration.getProperties(wikipedia, Configuration.PROPERTIES_USERS);
      String password = users.getProperty(comboUser.getSelectedItem().toString());
      if (password != null) {
        textPassword.setText(password);
View Full Code Here

      int error = Integer.parseInt(errorNumber);
      notifyPageFixed(page, error);
      if (error > CheckErrorAlgorithm.MAX_ERROR_NUMBER_WITH_LIST) {
        return true;
      }
      EnumWikipedia wiki = page.getWikipedia();
      boolean useLabs = wiki.getConfiguration().getBoolean(WPCConfigurationBoolean.CW_USE_LABS);
      boolean markBoth = wiki.getConfiguration().getBoolean(WPCConfigurationBoolean.CW_MARK_BOTH);
      String code = wiki.getSettings().getCodeCheckWiki().replace("-", "_");
      Map<String, String> properties = new HashMap<String, String>();
      properties.put("id", Integer.toString(error));
      properties.put("project", code);

      // WMF Labs
View Full Code Here

   * @return List of detected errors.
   */
  public List<CheckWikiDetection> check(Page page) {
    try {
      List<CheckWikiDetection> detections = null;
      EnumWikipedia wiki = page.getWikipedia();
      boolean useLabs = wiki.getConfiguration().getBoolean(WPCConfigurationBoolean.CW_USE_LABS);
      boolean markBoth = wiki.getConfiguration().getBoolean(WPCConfigurationBoolean.CW_MARK_BOTH);
      String code = wiki.getSettings().getCodeCheckWiki().replace("-", "_");
      Map<String, String> properties = new HashMap<String, String>();
      properties.put("project", code);
      properties.put("article", page.getTitle());
      if (useLabs || markBoth) {
        detections = new ArrayList<CheckWikiDetection>();
View Full Code Here

    boolean result = false;
    List<PageElementExternalLink> links = analysis.getExternalLinks();
    if (links == null) {
      return result;
    }
    EnumWikipedia wiki = analysis.getWikipedia();
    WikiConfiguration wikiConf = wiki.getWikiConfiguration();
    String contents = analysis.getContents();
    for (PageElementExternalLink link : links) {
      if (link.hasSquare()) {
        String article = wikiConf.isArticleUrl(link.getLink());
        if ((article != null) &&
View Full Code Here

      // Parameters description
      try {
        Configuration config = Configuration.getConfiguration();
        boolean secured = config.getBoolean(null, ConfigurationValueBoolean.SECURE_URL);
        EnumWikipedia wiki = getWikipedia();
        String translationPage = wiki.getConfiguration().getString(
            WPCConfigurationString.CW_TRANSLATION_PAGE);
        String url = wiki.getSettings().getURL(translationPage, true, secured);
        StringBuilder parametersDescription = new StringBuilder();
        parametersDescription.append(GT._(
            "The error n°{0} can be configured with the following parameters in the <a href=\"{1}\">translation file</a> :",
            new Object[] { Integer.toString(errorNumber), url }));
        parametersDescription.append("\n<ul>");
View Full Code Here

   */
  public void actionErrorDetail() {
    Object selected = listAllErrors.getSelectedItem();
    if ((selected instanceof CheckError) &&
        (Utilities.isDesktopSupported())) {
      EnumWikipedia wiki = getWikipedia();
      CheckError error = (CheckError) selected;
      if (error.getAlgorithm().getLink() != null) {
        Utilities.browseURL(wiki, error.getAlgorithm().getLink(), true);
      } else {
        DecimalFormat format = new DecimalFormat("000");
        String description =
            "error_" +
            format.format(error.getErrorNumber()) +
            "_link_" +
            wiki.getSettings().getCodeCheckWiki();
        String translationPage = wiki.getConfiguration().getString(
            WPCConfigurationString.CW_TRANSLATION_PAGE);
        Utilities.displayInformationMessage(getParentComponent(), GT._(
            "There''s no page defined for this error type.\n" +
            "If you want to define a page you need to add :\n" +
            "  {0} = <page name> END\n" +
            "to the translation page ({1}) on \"{2}\"",
            new Object[] { description, translationPage, wiki.toString()
            }));
      }
    }
  }
View Full Code Here

   */
  public void actionErrorWhiteList() {
    Object selected = listAllErrors.getSelectedItem();
    if ((selected instanceof CheckError) &&
        (Utilities.isDesktopSupported())) {
      EnumWikipedia wiki = getWikipedia();
      CheckError error = (CheckError) selected;
      if (error.getAlgorithm().getWhiteListPageName() != null) {
        Utilities.browseURL(wiki, error.getAlgorithm().getWhiteListPageName(), true);
      } else {
        DecimalFormat format = new DecimalFormat("000");
        String parameter =
            "error_" +
            format.format(error.getErrorNumber()) +
            "_whitelistpage_" +
            wiki.getSettings().getCodeCheckWiki();
        String translationPage = wiki.getConfiguration().getString(
            WPCConfigurationString.CW_TRANSLATION_PAGE);
        Utilities.displayInformationMessage(getParentComponent(), GT._(
            "There''s no whitelist defined for this error type.\n" +
            "If you want to define a whitelist, you need to add:\n" +
            "  {0} = <page name> END\n" +
            "to the translation page ({1}) on \"{2}\"",
            new Object[] { parameter, translationPage, wiki.toString()
            }));
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.api.constants.EnumWikipedia

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.