cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r638157 - in /cocoon/trunk/tools/release-builder/getting-started: ./ README.txt app/ app/build.xml jetty/ jetty/getting-started.xml
Date Tue, 18 Mar 2008 00:38:41 GMT
Author: reinhard
Date: Mon Mar 17 17:38:38 2008
New Revision: 638157

URL: http://svn.apache.org/viewvc?rev=638157&view=rev
Log:
add build file, README and Jetty configuration file for the 'getting-started' application

Added:
    cocoon/trunk/tools/release-builder/getting-started/
    cocoon/trunk/tools/release-builder/getting-started/README.txt   (with props)
    cocoon/trunk/tools/release-builder/getting-started/app/
    cocoon/trunk/tools/release-builder/getting-started/app/build.xml   (with props)
    cocoon/trunk/tools/release-builder/getting-started/jetty/
    cocoon/trunk/tools/release-builder/getting-started/jetty/getting-started.xml   (with props)

Added: cocoon/trunk/tools/release-builder/getting-started/README.txt
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/release-builder/getting-started/README.txt?rev=638157&view=auto
==============================================================================
--- cocoon/trunk/tools/release-builder/getting-started/README.txt (added)
+++ cocoon/trunk/tools/release-builder/getting-started/README.txt Mon Mar 17 17:38:38 2008
@@ -0,0 +1,40 @@
+GENERAL
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This 'Getting Started Cocoon Application' demonstrates how a Cocoon 2.2
+based application that uses blocks can be organized and built.
+It is not intended to be used in production but demonstrates
+the necessary steps in order to build and deploy a Cocoon 2.2 application.
+
+Compared to a Maven 2 based build systems it lacks a lot of features,
+most notably it doesn't support quick development cycles like the
+Cocoon Maven 2 plugin does (See http://cocoon.apache.org/2.2/1159_1_1.html and
+http://cocoon.apache.org/2.2/maven-plugins/maven-plugin/1.0/1297_1_1.html).
+
+This means that whenever you change one of the files, you have to redo the
+complete build.
+
+
+STRUCTURE
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The demo application comes with a pre-packaged Jetty server (./jetty). In ./app
+you find a Cocoon application which consists of a block (./app/custom-block) and
+a Java web application (./app/webapp).
+
+In ./lib there are all libraries that are needed to run Cocoon Core, the Cocoon
+Template block and the Cocoon Flowscript block.
+
+
+HOW TO RUN
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+First make sure that you have installed Ant. Then move to the ./app directory and
+run 'ant run' from there.
+
+This will build the block (./app/custom-block), then the Java web application
+(./app/webapp) and launch a Jetty server. Then you can access it via
+http://localhost:8888/custom-block/.
+
+
+Enjoy!
\ No newline at end of file

Propchange: cocoon/trunk/tools/release-builder/getting-started/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/release-builder/getting-started/README.txt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/release-builder/getting-started/README.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cocoon/trunk/tools/release-builder/getting-started/app/build.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/release-builder/getting-started/app/build.xml?rev=638157&view=auto
==============================================================================
--- cocoon/trunk/tools/release-builder/getting-started/app/build.xml (added)
+++ cocoon/trunk/tools/release-builder/getting-started/app/build.xml Mon Mar 17 17:38:38 2008
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project default="run">
+
+  <property name="lib.dir" value="./lib" />
+
+  <!-- Build all blocks here -->
+  <target name="build-blocks">
+    <build-block block.name="custom-block" />
+  </target>
+
+  <!-- Build a Cocoon based web application that uses the blocks from above here -->
+  <target name="webapp" depends="build-blocks">
+    <property name="src.webapp.dir" value="./webapp" />
+    <property name="target.dir" value="./target" />
+    <property name="target.webapp.dir" value="${target.dir}/webapp" />
+    <property name="target.webapp.web-inf.lib.dir" value="${target.webapp.dir}/WEB-INF/lib"
/>
+
+    <mkdir dir="${target.webapp.dir}" />
+
+    <!-- Copy all configuration files for a Java web application to the target directory
-->
+    <copy todir="${target.webapp.dir}">
+      <fileset dir="${src.webapp.dir}/src/main/webapp" />
+    </copy>
+
+    <mkdir dir="${target.webapp.web-inf.lib.dir}" />
+    <copy todir="${target.webapp.web-inf.lib.dir}">
+      <fileset dir="${lib.dir}" />
+      <!-- That's definitly a hack: copy all block JAR files into the WEB-INF/lib directory
-->
+      <fileset dir="custom-block/target">
+        <include name="*.jar" />
+      </fileset>
+    </copy>
+
+  </target>
+
+  <macrodef name="build-block">
+    <attribute name="block.name" />
+    <sequential>
+      <property name="block.dir" value="@{block.name}" />
+      <property name="block.src.main.java" value="${block.dir}/src/main/java" />
+      <property name="block.src.main.resources" value="${block.dir}/src/main/resources"
/>
+      <property name="block.target.dir" value="${block.dir}/target" />
+      <property name="block.target.classes.dir" value="${block.target.dir}/classes" />
+
+      <!-- Create the classpath to compile a block -->
+      <path id="classpath">
+        <pathelement path="${classpath}" />
+        <fileset dir="${lib.dir}">
+          <include name="*.jar" />
+        </fileset>
+      </path>
+
+      <!-- Compile the block -->
+      <mkdir dir="${block.target.classes.dir}" />
+      <javac srcdir="${block.src.main.java}" destdir="${block.target.classes.dir}" classpathref="classpath"
/>
+
+      <!-- Package the block and set the block name as attribute to the manifest file
-->
+      <jar destfile="${block.target.dir}/@{block.name}.jar">
+        <fileset dir="${block.target.classes.dir}" />
+        <fileset dir="${block.src.main.resources}" />
+        <manifest>
+          <attribute name="Cocoon-Block-Name" value="@{block.name}" />
+        </manifest>
+      </jar>
+    </sequential>
+  </macrodef>
+
+  <!-- Use Jetty to run the web application -->
+  <target name="run" depends="webapp">
+    <property name="jetty.home" value="../jetty" />
+    <java jar="${jetty.home}/jetty-start-6.1.7.jar" fork="true" dir="${jetty.home}">
+      <jvmarg value="-Dfile.encoding=UTF-8" />
+      <arg value="${jetty.home}/getting-started.xml" />
+    </java>
+  </target>
+
+</project>

Propchange: cocoon/trunk/tools/release-builder/getting-started/app/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/release-builder/getting-started/app/build.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/release-builder/getting-started/app/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cocoon/trunk/tools/release-builder/getting-started/jetty/getting-started.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/release-builder/getting-started/jetty/getting-started.xml?rev=638157&view=auto
==============================================================================
--- cocoon/trunk/tools/release-builder/getting-started/jetty/getting-started.xml (added)
+++ cocoon/trunk/tools/release-builder/getting-started/jetty/getting-started.xml Mon Mar 17
17:38:38 2008
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
+<Configure id="Server" class="org.mortbay.jetty.Server">
+  <Set name="ThreadPool">
+    <New class="org.mortbay.thread.BoundedThreadPool">
+      <Set name="minThreads">2</Set>
+      <Set name="lowThreads">2</Set>
+      <Set name="maxThreads">10</Set>
+    </New>
+  </Set>
+  <Call name="addConnector">
+    <Arg>
+      <New class="org.mortbay.jetty.nio.SelectChannelConnector">
+        <Set name="port">
+          <SystemProperty name="jetty.port" default="8080"/>
+        </Set>
+        <Set name="maxIdleTime">30000</Set>
+        <Set name="Acceptors">2</Set>
+        <Set name="confidentialPort">8443</Set>
+      </New>
+    </Arg>
+  </Call>
+  <Set name="handler">
+    <New id="handlers" class="org.mortbay.jetty.handler.HandlerCollection">
+      <Set name="handlers">
+        <Array type="org.mortbay.jetty.Handler">
+          <Item>
+            <New id="contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
+          </Item>
+          <Item>
+            <New id="defaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
+          </Item>
+          <Item>
+            <New id="requestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
+          </Item>
+        </Array>
+      </Set>
+    </New>
+  </Set>
+  <New id="cocoon" class="org.mortbay.jetty.webapp.WebAppContext">
+    <Arg>
+      <Ref id="contexts"/>
+    </Arg>
+    <Arg>../app/target/webapp</Arg>
+    <Arg>/</Arg>
+  </New>
+  <Set name="stopAtShutdown">true</Set>
+  <Set name="sendServerVersion">true</Set>
+</Configure>

Propchange: cocoon/trunk/tools/release-builder/getting-started/jetty/getting-started.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/tools/release-builder/getting-started/jetty/getting-started.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/tools/release-builder/getting-started/jetty/getting-started.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message