Examples of CheckError


Examples of hu.sztaki.ilab.longneck.process.CheckError

           
            // Increase case counter
            ++lastCase;
           
            if (lastCase >= switchObj.getCases().size()) {
                throw new CheckError(
                        new CheckResult(switchObj, false, null, null, "All cases failed.", errors));
            }
        }
View Full Code Here

Examples of hu.sztaki.ilab.longneck.process.CheckError

            }
           
            // Match against pattern and assign matched parts
            Matcher m = pattern.matcher(value);
            if (! m.find()) {
                throw new CheckError(
                        new CheckResult(this, false, fieldName, value,
                        String.format("Regular expression: '%1$s'", regexp)));
            }
           
            // Populate variable scope with matched parts
View Full Code Here

Examples of hu.sztaki.ilab.longneck.process.CheckError

           
            for (String fieldName : applyTo) {
                BlockUtils.setValue(fieldName, outValue, record, parentScope);
            }
        } catch (IllegalArgumentException ex) {
            throw new CheckError(new CheckResult(this, false, from, dateValue,
                    String.format("Field '%1$s' content '%2$s' does not match date pattern '%3$s'.",
                    from, dateValue, fromPattern)));
        } catch (UnsupportedOperationException ex) {
            log.error("joda-time pattern-based parsing is unsupported.", ex);
        }
View Full Code Here

Examples of hu.sztaki.ilab.longneck.process.CheckError

        } else {
            CheckResult andresult = constraints.check(record, parentScope);
            res = new CheckResult(this, andresult.isPassed(), checkedField, BlockUtils.getValue(checkedField, record, parentScope), summary, andresult.getCauses());
        }
        if (! res.isPassed()) {
            throw new CheckError(res);           
        }
    }
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckError

   */
  void actionSelectErrorType() {
    Object selection = listAllErrors.getSelectedItem();
    modelPages.clear();
    if (selection instanceof CheckError) {
      CheckError error = (CheckError) selection;

      // Button status
      buttonReloadError.setEnabled(true);
      buttonErrorDetail.setEnabled(true);
      buttonErrorList.setEnabled(true);
      buttonWhiteList.setEnabled(true);
      displayErrorDescription();

      // Pages
      int nbPages = error.getPageCount();
      for (int numPage = 0; numPage < nbPages; numPage++) {
        Page page = error.getPage(numPage);
        CheckErrorPage errorPage = new CheckErrorPage(page, error.getAlgorithm());
        if ((errorPage.isInWhiteList()) && (page.getPageId() != null)) {
          markPageAsFixed(error.getAlgorithm().getErrorNumberString(), page);
        } else {
          modelPages.addElement(errorPage);
        }
      }
      setPageLoaded(false);
      actionSelectPages();
      updateComponentState();
    } else {
      buttonReloadError.setEnabled(false);
      buttonErrorDetail.setEnabled(false);
      buttonErrorList.setEnabled(false);
      buttonWhiteList.setEnabled(false);
      displayErrorDescription();

      if (selection instanceof String) {
        List<String> listTmp = new ArrayList<String>();
        for (CheckError error : errors) {
          int nbPages = error.getPageCount();
          for (int numPage = 0; numPage < nbPages; numPage++) {
            Page page = error.getPage(numPage);
            listTmp.add(page.getTitle());
          }
        }
        Collections.sort(listTmp);
        List<String> listErrorPages = new ArrayList<String>();
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckError

    // Look in the global list of errors
    if (algorithm == null) {
      Object selection = listAllErrors.getSelectedItem();
      if (selection instanceof CheckError) {
        CheckError error = (CheckError) selection;
        algorithm = error.getAlgorithm();
      }
    }

    // Display description
    displayErrorDescription(algorithm);
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckError

  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._(
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckError

   */
  public void actionErrorList() {
    Object selected = listAllErrors.getSelectedItem();
    if ((selected instanceof CheckError) &&
        (Utilities.isDesktopSupported())) {
      CheckError error = (CheckError) selected;
      CheckWiki checkWiki = APIFactory.getCheckWiki();
      String url = checkWiki.getUrlDescription(getWikipedia(), error.getAlgorithm());
      Utilities.browseURL(url);
    }
  }
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckError

  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._(
View Full Code Here

Examples of org.wikipediacleaner.api.check.CheckError

   * Action called when Reload Error button is pressed.
   */
  public void actionReloadError() {
    Object selected = listAllErrors.getSelectedItem();
    if (selected instanceof CheckError) {
      CheckError error = (CheckError) selected;
      List<CheckErrorAlgorithm> algorithms = Collections.singletonList(error.getAlgorithm());
      CheckWikiProjectWorker reloadWorker = new CheckWikiProjectWorker(
          getWikipedia(), this, errors, algorithms,
          true, modelMaxErrors.getNumber().intValue());
      setupReloadWorker(reloadWorker);
      reloadWorker.start();
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.