Revision as of 11:12, 2 December 2011

Contents

Introduction

This page describes additional setup steps you need to do if you want to use JAXB to generate classes from XML schema descriptions for SMILA. This is also needed to be able to extend SMILA XML configuration file schemas, because we mostly use JAXB to parse them.

From the ZIP, copy jaxb2-basics-dist-$VERSION/dist/jaxb2-basics-ant-$VERSION.jar to <SMILA-Build-Lib-Dir>/xjc.

in SMILA.builder/xjc/build.xml edit the task definition for xjc: Replace this line:

<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">

with this one:

<taskdef name="xjc" classname="org.jvnet.jaxb2_commons.xjc.XJC2Task">

Now the above instructions should work using a JDK 1.6, too. Thanks, Giorgio!

Generating JAXB classes for a new crawler or agent configuration

If you do not yet have a binary distribution of SMILA: Download or build one.

Copy org.eclipse.smila.connectivity.framework.schema_0.5.0.jar from the plugins directory of the SMILA distribution to lib/xjc. This is necessary because crawler configurations extend a base schema and therefore need to access classes in this bundle.

Put your bundle next to the SMILA.builder source bundle.

Add a code/gen folder to your bundle and add it as a source folder.

Create a schemas directory in your bundle and put the XSD and JXB file there (use the same basename and xsd and jxb as suffixes).

Create a build.xml in the bundle directory with this content, replace $SCHEMA_NAME with the basename of the XSD/JXB files: