Skip to content
Ondrej Zizka edited this page Jun 12, 2013 · 6 revisions

As of SwanLoom 0.10.4, XML and HTML reports are created during migration.

These reports are generated through JAXB and XSLT, using the annotations of the classes used for data objects during the migration.

User info

To change the directory to which the reports go, use the report.dir param:

report.dir=<path>

Developer info

The XML report is created through JAXB from the objects available from MigrationContext. The main report JAXB bean is org.jboss.loom.tools.report.MigrationReportJaxbBean:

@XmlRootElement(name="migrationReport")
@XmlAccessorType( XmlAccessType.NONE )
public class MigrationReportJaxbBean {

    @XmlElement
    public Configuration config;

    @XmlElement(name = "sourceServer", required = true)
    public ServerInfo sourceServer;

    @XmlElement
    public ComparisonResult comparisonResult;

    @XmlElementWrapper(name = "configsData")
    @XmlElement(name = "configData")
    @XmlJavaTypeAdapter( MigratorDataSubtypesAdapter.class )
    public Collection<MigratorData> configData;

    @XmlElementWrapper(name = "actions")
    @XmlElement(name = "action")
    @XmlJavaTypeAdapter( ToActionBeanAdapter.class )
    public List<IMigrationAction> actions;

    @XmlElement(name="finalException")
    @XmlJavaTypeAdapter( ToStringAdapter.class )
    public MigrationException finalException;

}

The parts are again JAXB beans, mostly prepared or adjusted by an XmlAdapter, which usually enrich the JAXB beans with human-oriented information like formatting and labels. For example, the CliCommandAction has this metadata:

@ActionDescriptor(
    header = "Perform CLI command:",
    props = {
        @Property(name="cliCommand", expr = "command.command", style = "code") // TODO
    }
)
public class CliCommandAction extends AbstractStatefulAction {
  • name is used as the name of attribute in XML report.
  • expr is an expression in BeanUtils EL and is used to format the value.
  • style is used in <div class="..."> in the HTML report, and is then used in custom CSS for given report part.

All of the above is created with the intend to reduce the extra amount of reporting code as much as possible, and to allow to make it easily extendable / pluggable.

More developer info to be added.