Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Obtain Source Code

The source code is available from the NCSA opensource Git repository:

  git clone https://opensource.ncsa.illinois.edu/fisheye/git/dfdl.git

we are currently working (collectively) all on a branch so you must also issue the command:

 git checkout newBackEnd

Requirements

Daffodil requires Java 1.6 or higher. All scripts provided for running and testing are written in bash and tested in GNU Linux. Those scripts are not required though, so Daffodil should be able to run in other platforms as long as Java is installed

Apache Ant (1.7 or higher) is required for building using the provided script.

Daffodil is written in Scala 2.9, which must be installed in order to run Daffodil.

Building from Source

An Ant script is provided in $DAFFODIL/build.xml. To build Daffodil simply issue:

  $ ant -f $DAFFODIL/build.xml all

or, if inside the installation directory:

  $ ant all

 

Note: You will likely need to set available JVM memory for ant larger. For example, on a 64-bit Linux system, I have this in my .bashrc:

export ANT_OPTS="-XX:MaxPermSize=512m -Xmx6000m -Xms40m -Xss2m"

This might seem generous (6Gig!), and the more critical thing is the MaxPermSize, which defaults to much too small.

Compiling in eclipse

There are IDE's and eclipse plug-ins that can be used to build daffodil. See:

  http://www.scala-lang.org/node/91

Some time-dependent information: The As of November 2011, the Eclipse Indigo IDE (also known as version 3.7) and the current Scala plug-in for it (release 29, 2.0.0-beta, with this Eclipse update site: http://download.scala-ide.org/releases-29/2.0.0-beta), work for daffodil. They are robust enough to be useful, though there are some bugs still, and one must occasionally exit and re-enter Eclipse.

Tricks/Tips: You must increase the memory available, and specifically, the stack-size that Eclipse's JVM will use. This is done by editing eclipse.ini in the eclipse install directory. Below is an example of an eclipse.ini that works.

The first line "-clean" slows down starting Eclipse, but seems to be helpful given the current state of the Scala plug-in. Your mileage  may vary. The key changes are the last 3 lines. These set the minimum, maximum, and stack size to more reasonable values than the defaults. You need quite a bit of memory to use this IDE with Scala for Daffodil.

It is also very helpful when dealing with XML files to load the XML and XML-schema tools that are available in Eclipse.

-clean
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.100.v20110505
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms1000m
-Xmx1250m
-Xss2m

Eclipse XML Setup

Getting eclipse to validate DFDL Schemas using its XML validation capabilities requires some configuration. Without this you will get hundreds (at least) of XML and XML Schema validation errors from the daffodil code base.

There are two files of interest to this

  • daffodil-lib/eclipse-xml-catalog.xml
  • core/eclipse-settings.zip

The eclipse-xml-catalog is imported into Eclipse via File->Import->XML->XML Catalog.

The eclipse-settings zip file contains a .settings directory to be restored in your Eclipse workspace's ".metadata/.plugins/org.eclipse.core.runtime/.settings" directory.

These settings and catalog will change the configuration of eclipse substantially, and may not be suitable for projects other than Daffodil, so save your existing eclipse install directory and workspace's .metadata/.plugins/org.eclipse.core.runtime/.settings directory, if you are trying to share it across more than just Daffodil. You'll likely need to split out into two distinct workspaces and two distinct copies of eclipse.

With the settings and XML Catalog above, you can edit DFDL Schemas, and get support from Eclipse.

For example,

  • Edit core/tests/AA.dfdl.xsd in eclipse. Notice that it does not use xmlns="http://www.w3.org/2001/XMLSchema", which is the usual name space for XML Schema. Rather, it uses "http://www.ogf.org/dfdl/dfdl-1.0/XMLSchemaSubset" which provides much more DFDL-oriented schema validation.
  • Note that the file extension ".dfdl.xsd" is the standard way to identify a DFDL schema file.
  • Change one of the dfdl:inputValueCalc properties and misspell the property name. Save the file and you should see a validation error.
  • Validation using the DFDL XML Schema Subset URL will validate short form and long form DFDL annotations, and enforce DFDL's subset of XML Schema.

Contrarywise....

  • Edit core/tests/AH.dfdl.xsd in eclipse. Notice that it uses xmlns="http://www.w3.org/2001/XMLSchema", which is the usual name space for XML Schema. 
  • Note that the file extension ".dfdl.xsd" is the standard way to identify a DFDL schema file.
  • Change one of the dfdl:inputValueCalc properties and misspell the property name. Save the file and you will NOT see any validation error.
  • Change one of the attributes of the dfdl:defineVariable element, such as remove the name attribute and put in a ref="foo" attribute. Save, and you should see a validation error.
  • Validation using the standard XML Schema URL will NOT validate short form DFDL annotations, nor will it care if you put a long form annotation element named dfdl:foobar. But if you do get the name of a DFDL annotation element correct, then it will validate the properties on that annotation element.

Eclipse Unicode Setup

On Linux, UTF-8 and good unicode fonts are the default.

On Windows, a US install normally doesn't default to a Unicode friendly environment. One of the features of the Scala programming language is that it is completely unicode aware.

But, to make a USA windows default install of Windows itself, and Eclipse unicode friendly, you have to take a few steps.

These are described in the solution to this issue: https://opensource.ncsa.illinois.edu/jira/browse/DFDL-81. See the comments at the bottom for the settings.

  • No labels