Hello Stephen,
please find attached once again a patch for the ojb repository. I fixed the
stuff concerning the properties, but also I fixed a bug, when overgiving
datamodels instead of datamodel to the Mainrepository.vm.
For the properties-stuff please see also the following mail, which I
stumbled across in the Velocity Mailing List:
--- snip ---
> There are several cases where I need to access system properties in
order to
> set specific velocity related properties. I was wondering if there is a way
> to access them in the velocity.properties similar to log4j's mechanism
where
> you can access system properties via ${property-name} syntax. Does
something
> similar exist in velocity?
There is no way to do that - your Velocity initialization code would have
to do something ahead of time. That would be an interesting little tool for
commons if its not there already...
-- Geir Magnusson Jr. Research & Development, Adeptra Inc.
[EMAIL PROTECTED] +1-203-247-1713
--- snap ---
Hope this clarifys things a little.
At 13:26 25.09.2002 -0500, you wrote:
>For some reason, I feel I'm treading lightly here, but won't ${ojb.xxx}
>work?
>
>- Stephen
>
> > -----Original Message-----
> > From: Markus M. May [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, September 25, 2002 12:40 PM
> > To: Turbine Torque Developers List
> > Subject: RE: [patch] ojb templates
> >
> > I have tried to use the ojb.xxx stuff, but it does not work at least
>on my
> > machine. It seems, that Velocity tries to retrieve the value ojb.xxx
>with a
> > getter method from an ojb object. And this is not available, I
>believe.
> >
>
>
>--
>To unsubscribe,
>e-mail: <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
---+++--------------------+++---------------------+++---
Markus M. May
[EMAIL PROTECTED]
Provide you with free J2EE projects
Please use my public key at:
http://www.javafreedom.org/mmay_javafreedom_org.key
---+++--------------------+++---------------------+++---
Index: Control.vm
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine-torque/src/templates/ojb/repository/Control.vm,v
retrieving revision 1.3
diff -u -r1.3 Control.vm
--- Control.vm 16 Apr 2002 07:51:18 -0000 1.3
+++ Control.vm 27 Sep 2002 09:14:17 -0000
@@ -1,6 +1,12 @@
#set ( $basepath = $generator.OutputPath)
-$generator.parse("ojb/repository/MainRepository.vm","repository.xml","dataModels",$dataModels)
+#foreach ($dataModel in $dataModels)
+
+#if($velocityCount==1)
+$generator.parse("ojb/repository/MainRepository.vm","repository.xml","dataModel",$dataModel)
+#end
+
+#end
#foreach ($dataModel in $dataModels)
#set ( $outFile = "repository_${dataModel.shortName}.xml" )
Index: MainRepository.vm
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine-torque/src/templates/ojb/repository/MainRepository.vm,v
retrieving revision 1.3
diff -u -r1.3 MainRepository.vm
--- MainRepository.vm 3 Jul 2002 01:08:44 -0000 1.3
+++ MainRepository.vm 27 Sep 2002 09:14:17 -0000
@@ -1,5 +1,3 @@
-#set ( $database = $dataModel.database )
-
<?xml version="1.0" encoding="UTF-8"?>
<!-- defining entities for include-files -->
@@ -15,10 +13,10 @@
the Connection specified here will be used. -->
<jdbc-connection-descriptor id="default"
- platform="${ojb.platform}"
+ platform="${ojbPlatform}"
jdbc-level="${jdbcLevel}"
- #if (${ojb.useJNDI} == "true")
- jndi-datasource-name="${ojb.JNDISource}"
+ #if ($ojbUseJNDI == true)
+ jndi-datasource-name="${ojbJNDISource}"
#else
driver="${databaseDriver}"
protocol="jdbc"
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>