You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Jeffrey Gehrung <je...@yahoo.com> on 2002/08/22 20:41:01 UTC
A How-To: TDK2.2-b2, TORQUE 3.0-3b, PostgreSQL
As a new subscriber, this is my initial post. Relied
on all your help thus far & thought I'd return the
favor...
Here I'm providing complete instructions to build
NEWAPP using the Turbine TDK with decoupled Torque...
(and tested them)
Note: simple changes were required to an existing,
lengthy XML file, "build-torque.xml". Due to its
length, I've attached it here. I'm not familiar with
this list-server's handling of attachements. I've
described the necessary changes below, as well...
=========================================================
Building NEWAPP using decoupled TORQUE (3.0-b3) and
TURBINE (TDK 2.2-b2 )
# ==== 1) SETTING UP TORQUE
=============================================
obtain TORQUE downloads
SRC - retrieve
http://jakarta.apache.org/builds/jakarta-turbine/torque/release/3.0-b3/torque-3.0-b3-src.tar.gz
SUPPLEMENTS - retrieve
http://jakarta.apache.org/builds/jakarta-turbine/torque/release/3.0-b3/torque-3.0-b3.tar.gz
untar SRC gz - no build necessary here (from
...-src.tar.gz into a torque-3.0-b3 dir)
untar SUPPLEMENTS gz - for necessary SCHEMA &
TEMPLATES (from ...tar.gz into the same torque-3.0-b3)
NOTE: untarring BOTH files is critical
- the TURBINE TDK will fail to build NEWAPP if
the template files are not found.
Now, dir "torque-3.0-b3" contains the following dirs:
docs,lib,master,schema,src,temnplates,torque
and related build and properties files.
then, modify TORQUE's build.properties as follows (I'm
using the postgresql db):
contents of file:
/home/jsg/downloads/torque-3.0-b3/build.properties
#
-------------------------------------------------------------------
#
# T O R Q U E C O N F I G U R A T I O N F I L E
#
#
-------------------------------------------------------------------
project = newapp
database = postgresql
targetPackage=org.apache.torque
basePrefix=Base
addSaveMethod=true
addGetByNameMethod=true
complexObjectModel=true
addTimeStamp=true
addIntakeRetrievable=false
useManagers=false
overloadKeySetters=true
useClasspath=false
createDatabaseUrl =
jdbc:postgresql://127.0.0.1:5432/template1
buildDatabaseUrl =
jdbc:postgresql://127.0.0.1:5432/newapp
databaseUrl = jdbc:postgresql://127.0.0.1:5432/newapp
databaseDriver = org.postgresql.Driver
databaseUser = postgres
databasePassword =
databaseHost = 127.0.0.1
sameJavaName=false
documentationFormat=html
initialID = 101
templatePath = templates
SQLControlTemplate = sql/base/Control.vm
OMControlTemplate = om/Control.vm
idTableControlTemplate = sql/id-table/Control.vm
DataDTDControlTemplate = data/Control.vm
DataDumpControlTemplate = data/dump/Control.vm
DataSQLControlTemplate = sql/load/Control.vm
DocControlTemplate = doc/Control.vm
outputDirectory=src
schemaDirectory=schema
# ==== 2) SETTING UP TURBINE
=============================================
TURBINE downloads
retrieve
http://jakarta.apache.org/builds/jakarta-turbine/turbine-2/release/2.2-b2/turbine-2.2-b2-src.zip
then, modify TURBINE's build.properties as follows:
(obviously substituting something for HOLSTEIN)
#
-------------------------------------------------------------------
#
# T U R B I N E C O N F I G U R A T I O N F I L E
#
#
-------------------------------------------------------------------
/home/jsg/downloads/tdk-2.2-b2/build.properties
tdk.turbineVersion = 2
tdk.project = newapp
target.package = org.holstein.newapp
target.directory = org/holstein/newapp
tdk.home = .
perform the "ANT"
afterwards, subdirectory ...webapp/newapp will exist
# ==== 3a) BUILDING TDK's NEWAPP
=============================================
before continuing, be sure your database engine is
running and that it has a user account with
the username / psw you'll be using. This process
will create a DB (NEWAPP) and security tables.
then, modify NEWAPP's build.properties as follows:
/home/jsg/downloads/tdk-2.2-b2.kp2/webapps/newapp/WEB-INF/build/build.properties
#
-------------------------------------------------------------------
#
# P R O J E C T P R O P E R T I E S
#
#
-------------------------------------------------------------------
tdk.turbineVersion = 2
tdk.project = newapp
project = ${tdk.project}
app.root = ../${tdk.project}
build.webappRoot = ${tdk.home}/webapps/${tdk.project}
build.dest = ${build.webappRoot}/WEB-INF/classes
target.directory = org/holstein/${tdk.project}
target.package = org.holstein.${tdk.project}
version = 0.1
src.dir =
${tdk.home}/webapps/${tdk.project}/WEB-INF/src
conf.dir =
${tdk.home}/webapps/${tdk.project}/WEB-INF/conf
master.conf.dir =
${tdk.home}/tdk/ancillary/${tdk.turbineVersion}/src/conf
debug = on
optimize = off
deprecation = on
idTableDatabase = ${tdk.project}
# todo!!!
lib.dir = ${build.webappRoot}/WEB-INF/lib
# - - - make appropriate path changes & note addition
of app.home !!!!!!
tdk.home=/home/jsg/downloads/tdk-2.2-b2
torque.home = /home/jsg/downloads/torque-3.0-b3
app.home = ${build.webappRoot}/WEB-INF
outputDirectory = src
schemaDirectory = conf
database = postgresql
target.database = ${database}
database.name = ${tdk.project}
createDatabaseUrl =
jdbc:postgresql://127.0.0.1:5432/template1
buildDatabaseUrl =
jdbc:postgresql://127.0.0.1:5432/${tdk.project}
databaseUrl =
jdbc:postgresql://127.0.0.1:5432/${tdk.project}
databaseDriver = org.postgresql.Driver
databaseUser = postgres
databasePassword =
databaseHost = 127.0.0.1
torque.buildFile=build-torque.xml
extend=TurbineMapBuilder
mapname=TurbineMap
suffix=MapBuilder
targetPackage=org.holstein.${tdk.project}.om
targetDirectory=org/holstein/${tdk.project}/om
addSaveMethod=true
addGetByNameMethod=false
complexObjectModel=true
basePrefix=Base
useManagers=false
overloadKeySetters=true
useClasspath=true
templatePath=/home/jsg/downloads/torque-3.0-b3/templates/
SQLControlTemplate = sql/base/Control.vm
OMControlTemplate = om/Control.vm
idTableControlTemplate = sql/id-table/Control.vm
securityControlTemplate = sql/security/Control.vm
DataDTDControlTemplate = data/Control.vm
DataDumpControlTemplate = data/dump/Control.vm
DataSQLControlTemplate = sql/load/Control.vm
initialID = 101
# - - - - - - - - - - - - - - - -
After studying the ANT manual (for 10 minutes), I
modified the build-torque.xml file...
You'll nee to modify the NEWAPP's build-torque.xml as
follows:
edit file:
/home/jsg/downloads/tdk-2.2-b2/webapps/newapp/WEB-INF/build/build-torque.xml
Excluding the following (first) reference to
"torque.home"(appearing in the first 4 lines of the
file)
<project name="Torque" default="main" basedir=".">
<!-- property name="torque.home" value="."/ -->
perform a global search/replace:
search for: torque.home
replace subsequent instances with: app.home
# ==== 3b) BUILDING TDK's NEWAPP
=============================================
now, from the ..webapps/newapp/WEB-INF/build
directory...
run: ant init -v (I include the -v to get visible
log of the build activity)
Should yield - BUILD SUCCESSFUL (Total time: 48
seconds)
check your DB - should now have new DB "NEWAPP" also
SECOND, THIRD
# ==== 3b) THE END
=============================================
That's my story and I'm stickin to it....
Jeff Gehrung
Holstein Association USA
Brattleboro, VT
jgehrung@holstein.com
jeffgehrung@yahoo.com
__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
=====
Sent by his excellence:
Jeffrey S. Gehrung
Karnak will answer all questions at:
jeffgehrung@yahoo.com
When unavailable, "42" answers most ?s.
__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
torque3.0-b4: specific order in sqldb.map?
Posted by peter neubauer <pe...@yahoo.se>.
Hi,
I'm wondering what is determining the order the entries appear in
sqldb.map?
No matter what target I execute first, the id-table-schema.sql=default
is located near the bottom of the file, which leads to errors executing
the rest of the files since ID_TABLE doesn't exist.
Has anyone had the same problem?
Regards
/peter
_____________________________________________________
F�lj VM p� n�ra h�ll p� Yahoo!s officielle VM-sajt www.yahoo.se/vm2002
H�ll dig ajour med nyheter och resultat, med vinnare och f�rlorare...
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>