当前位置: 代码迷 >> Web前端 >> turbine layout control(2)helloworld example
  详细解决方案

turbine layout control(2)helloworld example

热度:1007   发布时间:2012-11-06 14:07:00.0
turbine layout control(二)helloworld example
turbine layout control(二)helloworld example

official website
http://turbine.apache.org/index.html

demo tutorial
http://henning.schmiedehausen.org/turbine/

read book <turbine trutorial.pdf>

Hello World

copy a tomcat to the turbine directory and create a file build.properties:
maven.appserver.home=E:/turbine/apache-tomcat-6.0.20

Setup Build Environment
>maven -Dturbine.app.name=helloworld turbine:setup

success and create a directory named helloworld.

Compile Application
>maven java:compile

Deploy it to the web container
>maven turbine:deploy

find a good way to fix the 301 error when download the jars from maven1, add some configuration to build.properties:
maven.repo.remote=http://repository.atlassian.com,http://mirrors.ibiblio.org/pub/mirrors/maven,http://www.ibiblio.org/maven

build error message:
BUILD FAILED
File...... C:\Users\dell\.maven\cache\maven-jar-plugin-1.6.1\plugin.jelly
Element... ant:fail
Line...... 53
Column.... 19
You must define currentVersion in your POM.

change the build.properties file place to
Maven2 is  ${user.home}/.m2/settings.xml
Maven1 is  ${user.home}/build.properties

and go to the directory
E:\turbine\helloworld>maven java:compile
E:\turbine\helloworld>maven turbine:deploy

Run The Container
visit the local server http://localhost:8080/helloworld/

What has happened during my working
turbine:setup     generates a new application
java:compile       builds the .class files
turbine:deploy    intalls the web application
turbine:war        Bind war for deployment
site                   documentation

Setup for Eclipse
>maven turbine:install-libs      Fetch all necessary libraries

Generate Eclipse Configuration
>maven eclipse

The Turbine View is composed from
Page           Everything you see
Screen        Content of the page
Navigation    Top,Bottom,Menu
Layout        Where to put everything

Velocity and Turbine
Turbine provides classes for Velocity integration:
Pages: VelocityPage
Screens: VelocityScreen,VelocitySecureScreen
Layouts: VelocityOnlyLayout,VelocityDirectLayout
Navigation: VelocityNavigation

Existing Services

Services used by the HelloWorld application:
AssemblerBroker----->Module Management
RunData Service----->Run Data Management
Template Service---->Template Lookup
Velocity Service ----->Velocity Rendering
Pull Service ----------->Tools
Factory & Pool Service--->Object Management

late init:  Initialization at first lookup
early init: Initialization at Turbine startup

default is late init

Yes, after all the work, I know that turbine is really a big framework, it consistent  of ormapping, validator, security and etc.
But all I need is dynamic layout and actions. I think I will do some extra work to separet what I need.
  相关解决方案