Package org.wikipediacleaner.api.data

Examples of org.wikipediacleaner.api.data.PageAnalysis$Result


    return ResourceConfig.getGlobalMessage(errCode);
  }   

  public static final DispositionReport buildDispositionReport(int errNo) {
    DispositionReport dr = new DispositionReport();
    Result res = new Result();
    res.setErrno(errNo);
   
    ErrInfo ei = new ErrInfo();
    ei.setErrCode(lookupErrCode(errNo));
    ei.setValue(lookupErrText(errNo));
   
    res.setErrInfo(ei);
   
    dr.getResult().add(res);
       
    return dr;
  }
View Full Code Here


      log.error(e.getMessage(),e);
      throw new DispositionReportFaultMessage(e.getMessage(), null);
    }
   
    DispositionReport dr = new DispositionReport();
    Result res = new Result();
    dr.getResult().add(res);
   
    return dr;
  }
View Full Code Here

   
   
    new ValidateSubscriptionListener().validateNotification(body);
     
    DispositionReport dr = new DispositionReport();
    Result res = new Result();
    dr.getResult().add(res);
    return dr;
  }
View Full Code Here

    } catch (Exception e) {
      e.printStackTrace();
    }
     
    DispositionReport dr = new DispositionReport();
    Result res = new Result();
    dr.getResult().add(res);
    return dr;
  }
View Full Code Here

    String okTemplate = configuration.getString(WPCConfigurationString.DAB_OK_TEMPLATE);
    if ((okTemplate == null) || okTemplate.trim().isEmpty()) {
      return;
    }
    okTemplate = okTemplate.trim();
    PageAnalysis analysis = page.getAnalysis(page.getContents(), false);
    List<PageElementTemplate> templates = analysis.getTemplates(okTemplate);
    if ((templates == null) || templates.isEmpty()) {
      return;
    }
    for (PageElementTemplate template : templates) {
      boolean done = false;
View Full Code Here

  /* (non-Javadoc)
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) {
    String contents = textComponent.getText();
    PageAnalysis analysis = page.getAnalysis(contents, true);
    contents = algorithm.fix(fixName, analysis, textComponent);
    textComponent.setText(contents);
    if (button != null) {
      button.doClick();
      textComponent.setModified(true);
View Full Code Here

      }
    } else {
      api.retrieveSectionContents(getWikipedia(), page, section.intValue());
    }
    if (doAnalysis) {
      PageAnalysis analysis = page.getAnalysis(page.getContents(), true);
      analysis.performFullPageAnalysis();
    }
    return returnPage;
  }
View Full Code Here

    List<PageElementImage> images = analysis.getImages();
    for (PageElementImage image : images) {
      String description = image.getDescription();
      if (description != null) {
        description = description.trim();
        PageAnalysis descAnalysis = analysis.getPage().getAnalysis(description, false);
        List<PageElementTag> smallTags = descAnalysis.getTags(PageElementTag.TAG_HTML_SMALL);
        if ((smallTags != null) && (!smallTags.isEmpty())) {
          int lastTest = 0;
          int currentDepth = 0;
          boolean onlySmall = true;
          for (PageElementTag smallTag : smallTags) {
View Full Code Here

            image.getWiki(),
            Collections.singletonList(imagePage), false, false);

        // Use image description on the wiki
        if (Boolean.TRUE.equals(imagePage.isExisting())) {
          PageAnalysis pageAnalysis = imagePage.getAnalysis(imagePage.getContents(), true);
          for (PageElementTemplate template : pageAnalysis.getTemplates()) {
            if (Page.areSameTitle("Information", template.getTemplateName())) {
              String description = template.getParameterValue("Description");
              if ((description != null) && (description.trim().length() > 0)) {
                result.add(description.trim());
              }
            }
          }
        }

        // 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()) {
            if (Page.areSameTitle("Information", template.getTemplateName())) {
              String global = template.getParameterValue("Description");
              if ((global != null) && (global.trim().length() > 0)) {
                PageAnalysis descAnalysis = commonsPage.getAnalysis(global, true);
                for (PageElementTemplate template2 : descAnalysis.getTemplates()) {
                  if (Page.areSameTitle(image.getWiki().getSettings().getCode(), template2.getTemplateName())) {
                    String description = template2.getParameterValue("1");
                    if ((description != null) && (description.trim().length() > 0)) {
                      result.add(description.trim());
                    }
View Full Code Here

      window.actionSelectErrorType();
      return;
    }
    textPage.setText(page.getContents());
    textPage.setModified(false);
    PageAnalysis pageAnalysis = page.getAnalysis(textPage.getText(), true);
    List<CheckErrorPage> errorsFound = CheckError.analyzeErrors(
        window.allAlgorithms, pageAnalysis, false);
    modelErrors.clear();
    initialErrors = new ArrayList<CheckErrorPage>();
    boolean errorFound = false;
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.api.data.PageAnalysis$Result

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.