ExoLab     OpenEJB     OpenJMS     OpenORB     Castor     Tyrex     
 

Main
  Home
  Download
  API
  Schema
  Mailing Lists
  CVS / Bugzilla
  Support

XML
  Using XML
  Source Generator
  Schema Support
  XML Mapping
  XML FAQ

JDO
  Using JDO
  JDO Config
  Types
  JDO Mapping
  JDO FAQ
  Other Features

Advanced JDO
  OQL
  Trans. & Locks
  Design
  KeyGen
  Long Trans.
  Nested Attrs.
  Pooling Examples
  Blobs and PostgreSQL

More
  Presentations
  The Examples
  Extras and 3rd Party Tools
  Test Framework -- JDO
  Test Framework -- XML
  Configuration
  Tips & Tricks
  Full JavaDoc

About
  License
  Contributors
  Status, Todo
  Changelog
  Library
  Contact

  



The Castor configuration file
Dependent Libraries
Castor XML
Castor JDO
Castor DSML
Building Castor
Directory Structure

The Castor configuration file

Castor uses a configuration file for environmental properties that are shared across all the Castor sub systems. The configuration file is specified as a Java properties file with the name castor.properties.

The Castor JAR includes a default configuration file. A configuration file in the Java library directory (e.g. /jdk1.2/lib) can be used to override the default configuration file with system wide properties. In addition, a configuration file can be placed in the classpath and will override both the system wide properties and default configuration.

When running the provided examples, Castor will use the configuration file located in the examples directory which specifies additional debugging information and pretty printing of all produced XML documents.

The following properties are currently supported in the configuration file:

  # Defines the default XML parser to be used by castor
  # The parser must implement org.xml.sax.Parser
  #
  org.exolab.castor.parser=org.apache.xerces.parsers.SAXParser

  # Defines the default XML serializer to be used by castor
  # The serializer must implement org.apache.xml.serialize.Serializer
  #
  org.exolab.castor.serializer=org.apache.xml.serialize.XMLSerializer

  # True if all documents should be indented on output by default
  #
  org.exolab.castor.indent=false

  # True if all documents should be validated on input by default
  #
  org.exolab.castor.validation=true

  # Comma separated list of SAX 2 features that should be enabled
  # for the default parser
  #
  org.exolab.castor.features=

  # True if should produce verbose messages
  #
  org.exolab.castor.debug=false

  # List of collection handlers for Java 1.1 and Java 1.2 run-times
  #
  org.exolab.castor.mapping.collections=\
    org.exolab.castor.mapping.loader.J1CollectionHandlers,\
    org.exolab.castor.mapping.loader.J2CollectionHandlers

  # List of persistence factories for the supported database servers
  #
  org.exolab.castor.jdo.engines=\
    org.exolab.castor.jdo.drivers.OracleFactory,\
    org.exolab.castor.jdo.drivers.PostgreSQLFactory,\
    org.exolab.castor.jdo.drivers.SybaseFactory,\
    org.exolab.castor.jdo.drivers.SQLServerFactory,\
    org.exolab.castor.jdo.drivers.DB2Factory,\
    org.exolab.castor.jdo.drivers.GenericFactory

  # List of key generator factories 
  #
  org.exolab.castor.jdo.keyGeneratorFactories=\
    org.exolab.castor.jdo.drivers.MaxKeyGeneratorFactory,\
    org.exolab.castor.jdo.drivers.HighLowKeyGeneratorFactory,\
    org.exolab.castor.jdo.drivers.IdentityKeyGeneratorFactory,\
    org.exolab.castor.jdo.drivers.SequenceKeyGeneratorFactory

  # Collection handlers for the source code generator
  #
  org.exolab.castor.builder.type.j2=\
    org.exolab.castor.builder.FieldInfoFactoryJ2
  org.exolab.castor.builder.type.j1=\
    org.exolab.castor.builder.FieldInfoFactory
  org.exolab.castor.builder.type.odmg=\
    org.exolab.castor.builder.FieldInfoFactoryODMG30

Dependent Libraries

JARs required to build Castor and dependencies for various packages are contained in the lib directory. JARs required for distribution are marked with bold text:

ant.jarThe Ant build tool
jdbc-se2.0.jarJDBC 2.0 standard extension (JDO)
jndi.jarThe JNDI API (DSML/JNDI)
jta1.0.1.jarThe JTA API (transactions)
jtf-0.1.jarThe Java Testing Framework
ldapjdk.jarMozilla Directory SDK (DSML/MDS)
ldapsp.jarJNDI LDAP service provider from Mozilla
postgresql-6.3.jarPostgreSQL 6.3 driver with DataSource support (used in default example)
servlet.jarUsed by the Servlet examples
xerces.jarXerces XML library
xslp.jarXSL processor, used for documentation

Castor XML

Castor XML is dependent on the latest release of Xerces available from the library directory and XML Apache. Other XML parser may be used instead of Xerces, however, Xerces is required to provide the XML serializer package for XML document production.

Castor JDO

Castor JDO uses Castor XML for processing the XML mapping file and has the same dependency on Xerces.

In addition applications that use Castor JDO must include jdbc-se2.0.jar or any alternative JAR that includes the javax.sql.DataSource interface.

The JDO example uses the PostgreSQL database and depends on the provided JDBC driver which includes javax.sql.DataSource support. This driver is not required for distribution or if a different database server is used.

Castor DSML

Castor DSML is dependent on the latest release of Xerces available from the library directory and XML Apache. Other XML parser may be used instead of Xerces, however, Xerces is required to provide the XML serializer package for XML document production.

Castor DSML has two implementations, one that uses JNDI and one that uses the Mozilla Directory SDK. Applications that use the JNDI package (org.exolab.castor.dsml.jndi) are required to include jndi.jar or any alternative JAR that includes the JNDI 1.2 API. Applications that use the Mozilla Directory SDK (org.exolab.castor.dsml.mozilla) are required to include ldapjdk.jar or any alternative JAR that includes version 4.0 of the Mozilla Directory SDK.

We recommend using the Mozilla Directory SDK as the JNDI LDAP service provider and have positive experience using it with OpenLDAP. The JNDI LDAP service provider is included in the ldapsp.jar.

Building Castor

Castor uses Ant as the build environment. To build Castor from the source run build.sh or build.bat in the Castor root directory with one (or any) of the following targets:

targetsLists the build targets
cleanCleans the build and distribution directories
allCleans and builds all the packages and examples
releaseCleans and builds all the release packages (JAR, source, doc, tarball) in the dist directory
mainBuilds the main packages (including debugging info)
examplesBuilds the example packages (including debugging info)
testsBuilds the test packages (including debugging info)
jarBuilds the binary JAR in the dist directory
docBuilds the documentation
apiBuilds the API JavaDocs
javadocBuilds the full JavaDocs
sourceBuilds the source tarball in the dist directory
tarballBuilds the binary distribution in the dist directory
cvsUpdate the sources from the CVS

The tarball will includes the Castor JAR, all dependent library JARs, readme and license files, and all DTDs and XML schemas in the schema directory.

Directory Structure

src/mainThe source base for all the Castor modules
src/docDocumentation (in XML form)
src/schemaDTD and XML schema for Castor mapping files
src/examplesExamples for the various packages
src/testsTest cases for the various packages
src/etcAdditional files that are not part of the code base
libJARs required to build Castor and distributable JARs
build/classesWhen using Ant the Java classes are build in this directory
build/docWhen using Ant the HTML documentation is build in this directory
build/examplesWhen using the examples are build in this directory
build/testWhen using the test cases are build in this directory
distThe distribution directory
 
   
  
   
 


Copyright ) 1999-2003 ExoLab Group. All rights reserved.
 
Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and in other countries. XML, XML Schema, XSLT and related standards are trademarks or registered trademarks of MIT, INRIA, Keio or others, and a product of the World Wide Web Consortium. All other product names mentioned herein are trademarks of their respective owners.