How to extend/customize HTML checker

Step 1. Develop IHtmlChecker implementation

  1. Receive IHtmlCheckTarget that contains target HTML information as HtmlEvalUtil (Please see HtmlEvalUtil for more details.)
  2. Check accessibility of content by using DOM API and data from HtmlEvalUtil
  3. Create and return IProblemItem for each accessibility issue
    IProblemItem problem = new ProblemItemImpl("CheckItemID");
  4. (Please see org.eclipse.actf.examples.adesigner.eval.html.internal.CheckEngine as reference implementation.)

Step 2. Write XML and properties file for configurations

Guideline XML

includes guideline item information, such as name, URL of help page, etc.

Reference implementation for WCAG 2.0

Check Item XML

defines mapping between implemented check items and guideline items.
It also defines corresponding criteria for each check item, such as Compliance, Listenability, My Company's guide, etc.

Reference implementation

Properties file for error messages

defines error messages for each implemented check items. Use id defined in Check Item XML as key of the properties.

Reference implementation

Step 3. Implement ICheckerInfoProvider and refer your XML/properties file

Example implementation

public class MyCheckerInfoProvider implements ICheckerInfoProvider {
  private static final String BUNDLE_NAME = 
    "org.eclipse.myproject.description"; //$NON-NLS-1$

  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);

  public InputStream[] getCheckItemInputStreams() {
    InputStream is = OdfChecker.class.getResourceAsStream("resources/checkitem.xml");
    return new InputStream[] { is };
  }

  public InputStream[] getGuidelineInputStreams() {
    InputStream is = OdfChecker.class.getResourceAsStream("resources/guideline.xml");
    return new InputStream[] { is };
  }

  public ResourceBundle getDescriptionRB() {
    return RESOURCE_BUNDLE;
  }

}

Step 4. Register your checker as an extension

Register your checker implementation by using org.eclipse.actf.visualization.eval.checkers Extension Points.