You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Fabio Daprile <fa...@wuerth-phoenix.com> on 2002/05/16 13:51:51 UTC

Migration from TDK 2.1 to TDK 2.2 done with success!!! A HowTo!

Hi all,

I've finally been able to migrate from TDK 2.1 to TDK 2.2.

1) First you need to download the TDK 2.2 from the jakarta site.

2) Second you need to generate your application with "ant".
To do this you need to modify the build.properties file in the tdk 
directory.

Hereafter my build.properties:

# -------------------------------------------------------------------------
# This is where you control the initial generation of the Turbine
# sample webapp.
# -------------------------------------------------------------------------

tdk.turbineVersion = 2
tdk.project = bugtrack
target.package = com.wuerth.phoenix.bugtrack
target.directory = com/wuerth/phoenix/bugtrack
tdk.home = .

3) Now you need to edit the build.properties file to generate the peers 
(in WEB-INF/build) (i use the decoupled torque to generate the peers layer)
Hereafter my build.properties file:

# -------------------------------------------------------------------
#
# P R O J E C T  P R O P E R T I E S
#
# -------------------------------------------------------------------

tdk.turbineVersion = 2
tdk.project = bugtrack
tdk.home = /TDK2/tdk
# This currently duplicated because the torque templates have
# a dependency on $project.
project = bugtrack
app.root = ../${tdk.project}
build.webappRoot = ${tdk.home}/webapps/${tdk.project}
target.package = com.wuerth.phoenix.bugtrack
target.directory = com/wuerth/phoenix/bugtrack
build.dest = ${build.webappRoot}/WEB-INF/classes
version = 0.1
src.dir = ${tdk.home}/webapps/bugtrack/WEB-INF/src
conf.dir = ${tdk.home}/webapps/bugtrack/WEB-INF/conf
master.conf.dir = ${tdk.home}/tdk/ancillary/${tdk.turbineVersion}/src/conf
debug = on
optimize = off
deprecation = on
idTableDatabase = bugtrack

# todo!!!
lib.dir = ${build.webappRoot}/WEB-INF/lib
torque.home = ${build.webappRoot}/WEB-INF
outputDirectory = src
schemaDirectory = conf

# -------------------------------------------------------------------
#
#  D A T A B A S E  S E T T I N G S
#
# -------------------------------------------------------------------

database.name = bugtrack
database = mysql
createDatabaseUrl = jdbc:mysql://127.0.0.1/bugtrack
buildDatabaseUrl = jdbc:mysql://127.0.0.1/bugtrack
databaseUrl = jdbc:mysql://127.0.0.1/bugtrack
databaseDriver = org.gjt.mm.mysql.Driver
databaseUser= fabio
databasePassword= elirpadt
databaseHost = 127.0.0.1



# -------------------------------------------------------------------
#
#  T O R Q U E  C O N F I G U R A T I O N
#
# -------------------------------------------------------------------
# These settings will allow you to customize the way your
# Peer-based object model is created.
# -------------------------------------------------------------------

torque.buildFile=build-torque.xml

extend=TurbineMapBuilder
mapname=TurbineMap
suffix=MapBuilder
targetPackage=com.wuerth.phoenix.bugtrack.om
targetDirectory=com/wuerth/phoenix/bugtrack/om
addSaveMethod=true
addGetByNameMethod=false
complexObjectModel=true
basePrefix=Base

# -------------------------------------------------------------------
#
#  C O N T R O L  T E M P L A T E S
#
# -------------------------------------------------------------------

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


4) Now you can generate the Peers with ant.init from WEB-INF/build

5) once you've generated the peers, copy all the sources from yur oldest 
application, copy only the modules and the part of the OM that you've
modified.
In these files you need to move some imports:

old imports

import org.apache.turbine.util.db.Criteria;
import org.apache.turbine.om.peer.BasePeer;
import org.apache.turbine.util.db.pool.DBConnection;

new imports

import org.apache.torque.util.Criteria;
import org.apache.torque.util.BasePeer;

6) now you need to configure the TurbineResources.properties and the 
torque.properties

here the essential part of my turbine.prop

# -------------------------------------------------------------------
# $Id: TurbineResources.master,v 1.11 2002/03/13 19:44:19 mpoeschl Exp $
#
# This is the configuration file for Turbine.
#
# Note that strings containing "," (comma) characters must backslash
# escape the comma (i.e. '\,')
#
# -------------------------------------------------------------------

# -------------------------------------------------------------------
#
#  L O G S
#
# -------------------------------------------------------------------
# This is the configuration for the logging system. In most cases
# you don't need to modify anything. However, if you wish to add more
# facilities or modify the existing settings, then you can do so.
#
# destination.file: A path relative to the web app root
# -------------------------------------------------------------------
services.LoggingService.facilities=system,debug,security
services.LoggingService.default=system
services.LoggingService.loggingConfig=org.apache.turbine.services.logging.PropertiesLoggingConfig

# A facility for system logging.
services.LoggingService.system.destination.file=/logs/turbine.log
services.LoggingService.system.className=org.apache.turbine.services.logging.FileLogger
services.LoggingService.system.level=INFO

# A facility for the scheduler service
# To disable started/stopped messages set the level to ERROR
services.LoggingService.scheduler.destination.file=/logs/turbine.log
services.LoggingService.scheduler.className=org.apache.turbine.services.logging.FileLogger
services.LoggingService.scheduler.level=INFO

# A facility for debugging applications. Messages will go both
# to the log file and the server console.
services.LoggingService.debug.destination.file=/logs/turbine.log
services.LoggingService.debug.destination.console=true
services.LoggingService.debug.className=org.apache.turbine.services.logging.FileLogger
services.LoggingService.debug.level=INFO

# A facility for SQL query logging
# To enable SQL query logging, set the system and sql log level to DEBUG
services.LoggingService.sql.destination.file=/logs/turbine.log
services.LoggingService.sql.className=org.apache.turbine.services.logging.FileLogger
services.LoggingService.sql.level=ERROR

# A facility for security audit. NOTE! As of 23 Jan 2001
# Turbine does not have any standard security auditing
# functionality. It's up to your application.
services.LoggingService.security.destination.file=/logs/turbine.log
services.LoggingService.security.className=org.apache.turbine.services.logging.FileLogger
services.LoggingService.security.level=INFO

# An example configuration for automatic log rotation using Log4Java
# This will keep the log file size under 1MB and save up to 5 backup copies
services.LoggingService.rotation.destination.file=/logs/turbine.log
services.LoggingService.rotation.file.size=1048576
services.LoggingService.rotation.file.backups=5
services.LoggingService.rotation.className=org.apache.turbine.services.logging.Log4JavaLogger
services.LoggingService.rotation.level=INFO

# An example configuration for using *NIX syslogd with Log4Java
services.LoggingService.syslog.destination.syslogd.host=my.syslog.server.com
services.LoggingService.syslog.destination.syslogd.facility=LOG_DAEMON
services.LoggingService.syslog.className=org.apache.turbine.services.logging.Log4JavaLogger
services.LoggingService.syslog.level=INFO

# An example configuration for using remote Log4Java server
services.LoggingService.remote.destination.remote.host=my.remote.server.com
services.LoggingService.remote.destination.remote.port=1099
services.LoggingService.remote.className=org.apache.turbine.services.logging.Log4JavaLogger
services.LoggingService.remote.level=INFO

# An example configuration for sending error reports as email with Log4Java
# notes:
# * uses 'mail.server' as SMTP server to send mail through
# * log4j will send the email when an ERROR is logged, with
#   'buffer.size' previous (non-ERROR) logs included in the email
# * configured to log to a file as well otherwise stacktraces are lost
services.LoggingService.email.destination.file=/logs/turbine.log
services.LoggingService.email.destination.email.from=root@localhost
services.LoggingService.email.destination.email.to=root@localhost
services.LoggingService.email.destination.email.subject=Turbine Error Report
services.LoggingService.email.destination.email.buffer.size=512
services.LoggingService.email.className=org.apache.turbine.services.logging.Log4JavaLogger
services.LoggingService.email.level=INFO

# -------------------------------------------------------------------
#
#  M A I L  S E R V E R
#
# -------------------------------------------------------------------
# Your mail server for outgoing email.
#
# Default: null
# -------------------------------------------------------------------

mail.server=smtp-terlano.it.wuerth.com

# -------------------------------------------------------------------
# SMTP-From header for your outgoing messages
#
# All failed delivery messages will be returned to this address.
# If unset, these messages will be sent to the address in the
# From header (standard behaviour)
#
# Default: null
# -------------------------------------------------------------------

mail.smtp.from=

# -------------------------------------------------------------------
#
#  M O D U L E  C A C H I N G
#
# -------------------------------------------------------------------
# This determines whether or not to cache the modules in memory.  For
# development, turn this off.  For production, turn this on.
#
# Default: false
# -------------------------------------------------------------------

module.cache=false

# If module.cache=true, then how large should we make the hashtables
# by default.

action.cache.size=20
layout.cache.size=10
navigation.cache.size=10
page.cache.size=5
screen.cache.size=50
scheduledjob.cache.size=10

# -------------------------------------------------------------------
#
#  M O D U L E  P A C K A G E S
#
# -------------------------------------------------------------------
# This is the "classpath" for Turbine.  In order to locate your own
# modules, you should add them to this path.  For example, if you have
# com.company.actions, com.company.screens, com.company.navigations,
# then this setting would be "com.company,org.apache.turbine.modules".
# This path is searched in order.  For example, Turbine comes with a
# screen module named "Login".  If you wanted to have your own screen
# module named "Login", then you would specify the path to your
# modules before the others.
#
# Default: org.apache.turbine.modules
# -------------------------------------------------------------------

module.packages=com.wuerth.phoenix.bugtrack.modules,org.apache.turbine.flux.modules

# -------------------------------------------------------------------
#
#  D A T A B A S E  S E T T I N G S
#
# -------------------------------------------------------------------
# These are your database settings.  Look in the
# org.apache.turbine.util.db.pool.* packages for more information.
# The default driver for Turbine is for MySQL.
#
# The parameters to connect to the default database.  You MUST
# configure these properly.
# -------------------------------------------------------------------

database.bugtrack.driver=org.gjt.mm.mysql.Driver
database.bugtrack.url=jdbc:mysql://cvsbolzano.it.wuerth.com:3306/bugtrack
database.bugtrack.username=mysql
database.bugtrack.password=1234

# The number of database connections to cache per ConnectionPool
# instance (specified per database).

database.bugtrack.maxConnections=50

# The amount of time (in milliseconds) that database connections will be
# cached (specified per database).
#
# Default: one hour = 60 * 60 * 1000

database.bugtrack.expiryTime=3600000

# The amount of time (in milliseconds) a connection request will have to 
wait
# before a time out occurs and an error is thrown.
#
# Default: ten seconds = 10 * 1000

database.connectionWaitTimeout=10000

# The interval (in milliseconds) between which the PoolBrokerService logs
# the status of it's ConnectionPools.
#
# Default: No logging = 0 = 0 * 1000

database.logInterval=0

# These are the supported JDBC drivers and their associated Turbine
# adaptor.  These properties are used by the DBFactory.  You can add
# all the drivers you want here.

database.adaptor=DBMM
database.adaptor.DBMM=org.gjt.mm.mysql.Driver

# Determines if the quantity column of the IDBroker's id_table should
# be increased automatically if requests for ids reaches a high
# volume.

database.idbroker.cleverquantity=true

# Determines if IDBroker should prefetch IDs or not.  If set to false
# this property has the effect of shutting off the housekeeping thread
# that attempts to prefetch the id's.  It also sets the # of id's grabbed
# per request to 1 regardless of the settings in the database.
# Default: true

database.idbroker.prefetch=true

and the torque.props

# -------------------------------------------------------------------
# $Id: Torque.master,v 1.1 2002/02/13 14:21:08 mpoeschl Exp $
#
# This is the configuration file for Torque.
#
# Note that strings containing "," (comma) characters must backslash
# escape the comma (i.e. '\,')
#
# -------------------------------------------------------------------

torque.applicationRoot = .

# -------------------------------------------------------------------
#
#  L O G G I N G
#
# -------------------------------------------------------------------
# We use Log4J for all Torque logging and we embed the log4j
# properties within our application configuration.
# -------------------------------------------------------------------

# This first category is required and the category
# must be named 'default'. This is used for all logging
# where an explicit category is not specified.

log4j.category.org.apache.torque = ALL, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
log4j.appender.org.apache.torque.file = 
${torque.applicationRoot}/logs/torque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p 
%c - %m%n
log4j.appender.org.apache.torque.append = false

# -------------------------------------------------------------------
#
#  T O R Q U E  P R O P E R T I E S
#
# -------------------------------------------------------------------
# These are your database settings. Look in the
# org.apache.torque.pool.* packages for more information.
#
# The parameters to connect to the default database.  You MUST
# configure these properly.
# -------------------------------------------------------------------

torque.database.default=bugtrack

torque.database.bugtrack.driver = org.gjt.mm.mysql.Driver
torque.database.bugtrack.url = 
jdbc:mysql://cvsbolzano.it.wuerth.com:3306/bugtrack
torque.database.bugtrack.username = mysql
torque.database.bugtrack.password = 1234

# The number of database connections to cache per ConnectionPool
# instance (specified per database).

torque.database.default.maxConnections=80

# The amount of time (in milliseconds) that database connections will be
# cached (specified per database).
#
# Default: one hour = 60 * 60 * 1000

torque.database.default.expiryTime=3600000

# The amount of time (in milliseconds) a connection request will have to 
wait
# before a time out occurs and an error is thrown.
#
# Default: ten seconds = 10 * 1000

torque.database.connectionWaitTimeout=10000

# The interval (in milliseconds) between which the PoolBrokerService logs
# the status of it's ConnectionPools.
#
# Default: No logging = 0 = 0 * 1000

torque.database.logInterval=0

# Determines if the quantity column of the IDBroker's id_table should
# be increased automatically if requests for ids reaches a high
# volume.

torque.idbroker.cleverquantity=true


then the porting should be done.
Be careful if you use Fulcrum service. I don't use it.

hope this can help!!

-- 
Fabio Daprile

Würth-Phoenix Srl
Via Kravogl 4, I-39100 Bolzano
Tel: +39 0471/564111 - (direct 564070)
Fax: +39 0471/564122

mailto:fabio.daprile@wuerth-phoenix.com
http://www.wuerth-phoenix.com
http://www.wuerth.com