#* <tt>InterfacesXJCPlugin.jar</tt> that you can get [http://xml.w-wins.com/xjc-plugins/interfaces here]

+

#* <tt>InterfacesXJCPlugin.jar</tt>, you can download it [http://ubuntuone.com/7mZZkULtjiKxfCQfKVH2zG here]

Your build lib directory should now look at least like this:

Your build lib directory should now look at least like this:

<source lang="text">

<source lang="text">

Line 35:

Line 35:

The JAXB classes should now be generated in the <tt>code/gen</tt> directory of your bundle.

The JAXB classes should now be generated in the <tt>code/gen</tt> directory of your bundle.

−

{{note| JDK 1.5 needed |

+

=== Generating JAXB classes for a new crawler or agent configuration ===

−

+

−

This setup works correctly only when using a JDK 1.5 to run <tt>ant</tt>. With JDK 1.6 you'll get a message like this:

+

−

+

−

<source lang="text">

+

−

java.util.ServiceConfigurationError: com.sun.tools.xjc.Plugin:

+

−

Provider com.w_wins.xml.xjcplugins.InterfacePlugin could not be instantiated:

+

−

java.lang.ClassCastException

+

−

</source>

+

−

+

−

We are looking for a version of this plugin that works with JDK 1.6, too. Any hints are welcome.

+

−

}}

+

−

+

−

+

−

=== Generating JAXB classes for a new crawler configuration ===

+

# If you do not yet have a binary distribution of SMILA: [http://www.eclipse.org/smila/downloads.php Download] or build one.

# If you do not yet have a binary distribution of SMILA: [http://www.eclipse.org/smila/downloads.php Download] or build one.

−

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

+

# Copy <tt>org.eclipse.smila.connectivity.framework.schema_$VERSION.jar</tt> from the plugins directory of the SMILA distribution to <tt>lib/xjc</tt>. 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 <tt>SMILA.builder</tt> source bundle.

# Put your bundle next to the <tt>SMILA.builder</tt> source bundle.

# Add a <tt>code/gen</tt> folder to your bundle and add it as a source folder.

# Add a <tt>code/gen</tt> folder to your bundle and add it as a source folder.

Revision as of 08:27, 24 January 2012

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.

Generate Sources from Command line

Put SMILA.builder into the same folder as the bundle for which you are generating the folder (for all SMILA bundles this is the case after a checkout).

To generate the classes, you can now use:

ant -Dlib.dir=<SMILA-Build-Lib-Dir>

The JAXB classes should now be generated in the code/gen directory of your bundle.

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_$VERSION.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: