On Wed, 31 Dec 2003, De Swert Pierre (GFDI) wrote:

> I have reused the ant build files of the ojb-blank project to build my
> own things. I have added a target to produce an ojb repository and a
> project schema via ojb doclets, a target to generate the database by
> means of torque (by the way, the repository.xml file is missing in the
> ojb-blank project).

If you mean that the file generated by the XDoclet OJB module misses the
OJB core tables, then you are right, but this is on purpose. The module
only generates the repository_user.xml part (see the OJB unit tests for
the proposed structure of the repository xml files).

>  
> 1.How to avoid editing the project-schema generated via ojb doclets?  I
> have to replace "http://jakarta.apache.org/turbine/dtd/database.dtd
> <http://jakarta.apache.org/turbine/dtd/database.dtd> " with
> "src/schema/database.dtd", otherwise ...
> 
>    [torque-sql] Using contextProperties file:
> E:\Workspaces\pds\myproject\build.properties
>    [torque-sql] Using classpath
>    [torque-sql] Generating to file
> E:\Workspaces\pds\myproject\src\sql\report.myproject.sql.generation
>    [torque-sql] Parsing file: 'myproject-schema.xml'
>    [torque-sql] (transform.DTDResolver               140 ) Resolver:
> used    http://jakarta.apache.org/turbine/dtd/database.dtd
>    [torque-sql] (transform.DTDResolver               160 ) Couldn't read
> DTD specified in XML schema: 
>    [torque-sql] java.net.UnknownHostException: jakarta.apache.org

This is a known problem with some XML parsers. There is an (for whatever
reason yet undocumented) attribute of the torque sub task called
'dtdUrl' that allows to specify the url of the dtd in the build file.

> 2. Is it possible to configure the ojbdoclet task to generate the ojb
> repository and torque schema in to different directories?

Not easily (you can have paths in the destinationFile attributes if
you really want to). But you could generate them in some intermediate 
directory (e.g. build/schemas) and then move them to their designated
directories using ant tasks.

> 3. Is it fitting to generate the ojb repository in src/resources and
> torque schema in src/schema?

Probably, but I generally avoid adding files to the src directory during
the build process but rather use an intermediate directory (build, target
or similar). Also during runtime you only need the repository xml
files. The torque schema is only required to initialize the database (via
ant task).

Tom



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to