Place this code in a Layout module and reference that module in TR.props
or place the code in a Screen.getLayout(RunData) method and have the
method return the Layout module that you would put into TR.props.  This
screen would then be the base class for any other Screens in your app.

john mcnally

Madhavi Ginjupalli wrote:
> 
> Hi,
> 
> i'm using this in the doBuildTemplate(RunData data, Context context )
> method of Index.java to change the layout template for 'test' user.
> But it works only for the Index.vm ,for other templates the layout
> goes back to the one specified in the TurbineResources.properties.
> 
>         if(user.getUserName().equalsIgnoreCase("test"))
>                 data.setLayoutTemplate("/DefaultTest.vm");
> 
> Any idea how to do this??
> 
> Thanks,
> Madhavi
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> Jason van Zyl
> Sent: Tuesday, May 22, 2001 9:37 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Hypersonic SQL and turbine
> 
> Olivier Michot wrote:
> >
> > I'm new in turbine.
> > I have some problem when I try to build the database newapps with torque
> >
> > Thank you very much to help me?
> 
> You have to create the database yourself right now, and then
> use the
> 
> database.manual.creation = true
> 
> option.
> 
> I'm not sure if anyone has tried to have the hypersonic db
> created automatically. If you want to figure it out and send
> us the goods that would be appreciated. If not then you'll
> have to do what I outlined above.
> 
> >
> > Olivier Michot
> >
> > ===============================================================
> >
> > In the log of velocity : VM_global_library.vm is not found
> >                          sql/db-init/hypersonic/windows.vm is not found
> >
> > To help me, you will find some log
> > 1. my config
> > 2. newapp.properties
> > 3. velocity.log
> > 4. LOG BUILD (after c:\...\ant init)
> >
> > ***********************************************************************
> > Config
> > ***********************************************************************
> >         nt4.0 sp6
> >         ant 1.3
> >         turbine tdk-2.1b2
> >         Hypersonic SQL
> >         Java 1.1.3
> >
> > ***********************************************************************
> > 2. files newapp.properties:
> > ***********************************************************************
> >
> > # -------------------------------------------------------------------
> > #
> > # P R O J E C T  P R O P E R T I E S
> > #
> > # -------------------------------------------------------------------
> > # These are the properties for your Turbine project. The properties
> > # in this file will override properties set anywhere else.
> > # -------------------------------------------------------------------
> >
> > project=newapp
> >
> > # -------------------------------------------------------------------
> > #
> > #  T A R G E T  D A T A B A S E
> > #
> > # -------------------------------------------------------------------
> > # This is the target database, only considered when generating
> > # the SQL for your Turbine project. Your possible choices are
> > #
> > # db2
> > # hypersonic
> > # mysql
> > # oracle,
> > # postgresql
> > #
> > # Default: none
> > # -------------------------------------------------------------------
> >
> > database=hypersonic
> > #database=mysql
> > #database.manual.creation = true
> >
> > # -------------------------------------------------------------------
> > #
> > #  T A R G E T  P L A T F O R M
> > #
> > # -------------------------------------------------------------------
> > # Your options for targetPlatform are: unix | windows
> > # Your options for targetPlatformExt are: sh | bat
> > # -------------------------------------------------------------------
> >
> > targetPlatform = windows
> > targetPlatformExt = bat
> >
> > # -------------------------------------------------------------------
> > #
> > #  O B J E C T  M O D E L  I N F O R M A T I O N
> > #
> > # -------------------------------------------------------------------
> > # These settings will allow you to customize the way your
> > # Peer-based object model is created.
> > # -------------------------------------------------------------------
> >
> > extend=TurbineMapBuilder
> > mapname=TurbineMap
> > suffix=MapBuilder
> > targetPackage=org.mycompany.newapp.om
> > addSaveMethod=true
> > addGetByNameMethod=false
> > complexObjectModel=true
> > basePrefix=Base
> >
> > # -------------------------------------------------------------------
> > #
> > #  D A T A B A S E  S E T T I N G S
> > #
> > # -------------------------------------------------------------------
> > # JDBC connection settings. This is used by the JDBCToXML task that
> > # will create an XML database schema from JDBC metadata. These
> > # settings are also used by the SQL Ant task to initialize your
> > # Turbine system with the generated SQL.
> > # -------------------------------------------------------------------
> >
> > #--------------------------------------------------------------------
> > # HSQL use
> > # FULLPATH = full path to where you want the database
> > # Note: either torque or HSQL is really touchy about extra spaces
> > # or other stuff after each line below.
> > #--------------------------------------------------------------------
> > databaseUrl=jdbc:HypersonicSQL:newapp
> > databaseDriver=org.hsql.jdbcDriver
> > databaseUser=sa
> > databasePassword=
> >
> > ***********************************************************************
> > 3. velocity.log
> > ***********************************************************************
> > Tue May 22 14:11:47 GMT+02:00 2001 AvalonLogSystem initialized using
> > logfile F:\App\tdk\webapps\newapp\WEB-INF\build\velocity.log
> > Tue May 22 14:11:47 GMT+02:00 2001   [info]   [info] Default Properties
> > File: org\apache\velocity\runtime\defaults\velocity.properties
> > Tue May 22 14:11:47 GMT+02:00 2001   [info] Resource Loader Instantiated:
> > org.apache.velocity.runtime.resource.loader.FileResourceLoader
> > Tue May 22 14:11:47 GMT+02:00 2001   [info] FileResourceLoader :
> > initialization starting.
> > Tue May 22 14:11:47 GMT+02:00 2001   [info] FileResourceLoader : adding
> > path 'F:\App\tdk\webapps\newapp\WEB-INF\build\bin\torque\templates'
> > Tue May 22 14:11:47 GMT+02:00 2001   [info] FileResourceLoader :
> > initialization complete.
> > Tue May 22 14:11:47 GMT+02:00 2001   [info] Loaded Pluggable Directive:
> > org.apache.velocity.runtime.directive.Literal
> > Tue May 22 14:11:47 GMT+02:00 2001   [info] Loaded Pluggable Directive:
> > org.apache.velocity.runtime.directive.Macro
> > Tue May 22 14:11:47 GMT+02:00 2001   [info] Loaded Pluggable Directive:
> > org.apache.velocity.runtime.directive.Parse
> > Tue May 22 14:11:47 GMT+02:00 2001   [info] Loaded Pluggable Directive:
> > org.apache.velocity.runtime.directive.Include
> > Tue May 22 14:11:47 GMT+02:00 2001   [info] Loaded Pluggable Directive:
> > org.apache.velocity.runtime.directive.Foreach
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] Created: 20 parsers.
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] Velocimacro : initialization
> > starting.
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] Velocimacro : adding VMs from
> > VM library template : VM_global_library.vm
> > Tue May 22 14:11:48 GMT+02:00 2001  [error] ResourceManager : unable to
> > find resource 'VM_global_library.vm' in any resource loader.
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] Velocimacro : error using  VM
> > library template VM_global_library.vm :
> > org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> > resource 'VM_global_library.vm'
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] Velocimacro : allowInline =
> > true : VMs can be defined inline in templates
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] Velocimacro :
> > allowInlineToOverride = false : VMs defined inline may NOT replace
> > previous VM definitions
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] Velocimacro : allowInlineLocal
> > = false : VMs defined inline will be  global in scope if allowed.
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] Velocimacro : messages on  :
> > VM system will output logging messages
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] Velocimacro : initialization
> > complete.
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] Velocity successfully started.
> > Tue May 22 14:11:48 GMT+02:00 2001   [info] ResourceManager : found
> > sql/db-init/Control.vm with loader
> > org.apache.velocity.runtime.resource.loader.FileResourceLoader
> > Tue May 22 14:11:48 GMT+02:00 2001  [error] ResourceManager : unable to
> > find resource 'sql/db-init/hypersonic/windows.vm' in any resource loader.
> > Tue May 22 14:11:48 GMT+02:00 2001  [error] Method parse threw exception
> > for reference $generator in template sql/db-init/Control.vm at  [2,1]
> >
> > ***********************************************************************
> > 4. LOG BUILD (after c:\...\ant init)
> > ***********************************************************************
> >
> > project-id-table-init-sql:
> >      [echo] +------------------------------------------+
> >      [echo] |                                          |
> >      [echo] | Generating PROJECT initialization SQL    |
> >      [echo] | for ID Broker system!                    |
> >      [echo] |                                          |
> >      [echo] +------------------------------------------+
> > F:\App\tdk\webapps\newapp\WEB-INF\src\sql\newapp-id-table-init.sql
> >
> > init-tasks:
> >
> > create-database:
> > F:\App\tdk\webapps\newapp\WEB-INF\src\sql\create-database.bat
> > org.apache.velocity.exception.MethodInvocationException: Invocation of
> > method 'parse' in
> > class org.apache.velocity.texen.Generator
> > threw exception class
> > org.apache.velocity.exception.ResourceNotFoundException
> >         at
> >
> org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:265
> )
> >         at
> >
> org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.ja
> va:171)
> >         at
> >
> org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.jav
> a:207)
> >         at
> >
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:25
> 9)
> >         at org.apache.velocity.Template.merge(Template.java:283)
> >         at org.apache.velocity.texen.Generator.parse(Generator.java:345)
> >         at
> > org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:425)
> >         at
> > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:124)
> >         at org.apache.tools.ant.Target.execute(Target.java:153)
> >         at org.apache.tools.ant.Project.runTarget(Project.java:898)
> >         at org.apache.tools.ant.Project.executeTarget(Project.java:536)
> >         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:213)
> >         at
> > org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:103)
> >         at org.apache.tools.ant.Target.execute(Target.java:153)
> >         at org.apache.tools.ant.Project.runTarget(Project.java:898)
> >         at org.apache.tools.ant.Project.executeTarget(Project.java:536)
> >         at org.apache.tools.ant.Project.executeTargets(Project.java:510)
> >         at org.apache.tools.ant.Main.runBuild(Main.java:421)
> >         at org.apache.tools.ant.Main.main(Main.java:149)
> >
> > BUILD FAILED
> 
> --
> jvz.
> 
> Jason van Zyl
> [EMAIL PROTECTED]
> 
> http://jakarta.apache.org/velocity
> http://jakarta.apache.org/turbine
> http://jakarta.apache.org/commons
> http://tambora.zenplex.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to