You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by lu...@apache.org on 2011/04/25 19:10:56 UTC

svn commit: r1096525 - in /turbine/core/trunk: src/site/site.xml xdocs/howto/index.xml xdocs/howto/migrate-from-2_3-howto.xml

Author: ludwig
Date: Mon Apr 25 17:10:56 2011
New Revision: 1096525

URL: http://svn.apache.org/viewvc?rev=1096525&view=rev
Log:
Began work on a migration guide from 2.3 to 4.0

Added:
    turbine/core/trunk/xdocs/howto/migrate-from-2_3-howto.xml
Modified:
    turbine/core/trunk/src/site/site.xml
    turbine/core/trunk/xdocs/howto/index.xml

Modified: turbine/core/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/site/site.xml?rev=1096525&r1=1096524&r2=1096525&view=diff
==============================================================================
--- turbine/core/trunk/src/site/site.xml (original)
+++ turbine/core/trunk/src/site/site.xml Mon Apr 25 17:10:56 2011
@@ -88,6 +88,9 @@
         <item name="Hibernate OM Howto"  href="/howto/hibernate-howto.html"/>
         <item name="Intake Howto"        href="/howto/intake-howto.html"/>
         <item name="JSP Howto"           href="/howto/jsp-howto.html"/>
+       	<item name="Migrating from 2.1 to 2.2" href="migrate-from-2_1-howto.html"/>
+        <item name="Migrating from 2.2 to 2.3" href="migrate-from-2_2-howto.html"/>
+        <item name="Migrating from 2.3 to 4.0" href="migrate-from-2_3-howto.html"/>
         <item name="Pull Model Howto"    href="/howto/pullmodel-howto.html"/>
         <item name="Python Howto"        href="/howto/python-howto.html"/>
         <item name="Security Howto"      href="/howto/security-howto.html"/>

Modified: turbine/core/trunk/xdocs/howto/index.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/xdocs/howto/index.xml?rev=1096525&r1=1096524&r2=1096525&view=diff
==============================================================================
--- turbine/core/trunk/xdocs/howto/index.xml (original)
+++ turbine/core/trunk/xdocs/howto/index.xml Mon Apr 25 17:10:56 2011
@@ -36,6 +36,7 @@
         <li><a href="jsp-howto.html">JSP Howto</a></li>
         <li><a href="migrate-from-2_1-howto.html">Migrating from 2.1 to 2.2</a></li>
         <li><a href="migrate-from-2_2-howto.html">Migrating from 2.2 to 2.3</a></li>
+        <li><a href="migrate-from-2_3-howto.html">Migrating from 2.3 to 4.0</a></li>
         <li><a href="pullmodel-howto.html">Pull Model Howto</a></li>
         <li><a href="python-howto.html">Python Howto</a></li>
         <li><a href="security-howto.html">Security Howto</a></li>

Added: turbine/core/trunk/xdocs/howto/migrate-from-2_3-howto.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/xdocs/howto/migrate-from-2_3-howto.xml?rev=1096525&view=auto
==============================================================================
--- turbine/core/trunk/xdocs/howto/migrate-from-2_3-howto.xml (added)
+++ turbine/core/trunk/xdocs/howto/migrate-from-2_3-howto.xml Mon Apr 25 17:10:56 2011
@@ -0,0 +1,117 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+
+<document>
+
+ <properties>
+  <title>Migrating from 2.3 to 4.0</title>
+ </properties>
+
+<body>
+
+<section name="Introduction">
+<p>
+    This document describes the basic steps needed to migrate an
+    application written for Turbine 2.3 to Turbine 4.0.
+</p>
+<p>
+	Migrating from Turbine 2.3 to Turbine 4.0 is mostly a task of 
+	moving from the old service format to the new one. One of the 
+	biggest purposes with Turbine 4 was to decouple the different services
+	and move them to <a href="http://turbine.apache.org/fulcrum/">Fulcrum</a>.
+	Many of the released components of Fulcrum correspond to 
+	a previous Turbine service that is no longer bundeled with the
+	Turbine core. 
+</p>
+<p>
+	The services has been converted to Avalon components and do not 
+	implement the Service interface any more. Turbine still handles 
+	services that do implement the Service interface though so no
+	rewrite is necessary if you have written services of your own.
+	The new services can also be accessed in pretty much the same way
+	as the old ones, as long as the AvalonComponentService is properly configured.
+</p>
+</section>
+
+<section name="Accessing the new services">
+<p>
+	What needs to be done to access the decoupled services can be 
+	summarised in 4 steps:
+	<ul>
+		<li>Make sure the AvalonComponentService is properly configured</li>
+		<li>Add the services you need to your project dependency and to roleConfiguration.xml</li>
+		<li>Access the Fulcrum services with class name instead of service name</li>
+		<li>Remove any reference to the static facade classes and access the interfaces directly</li>
+	</ul>
+</p>
+<subsection name="Make sure the AvalonComponentService is properly configured">
+<p>
+	The AvalonComponentService allows you to retrieve the new services 
+	via the old TurbineServices interface. Make sure that the AvalonComponentService 
+	is added in your TurbineResources.properties and that you use TurbineYaafiComponentService as 
+	the implementing class. 
+</p>
+<source>
+<![CDATA[
+services.AvalonComponentService.classname=org.apache.turbine.services.avaloncomponent.TurbineYaafiComponentService
+services.AvalonComponentService.earlyInit=true
+]]>
+</source>
+<p>
+	The service <em>must</em> be the first service in TurbineResources.properties and it <em>must</em> be initialized early.
+	Also make sure that <a href="http://turbine.apache.org/fulcrum/fulcrum-yaafi/">Fulcrum YAAFI</a>
+	is added to your project dependency.
+</p>
+</subsection>
+<subsection name="Add the services you need to your project dependency and to roleConfiguration.xml">
+<p>
+	Many services that were previously included in Turbine has been converted to Avalon
+	components and moved to Fulcrum. You only need to add the ones used in your project as
+	a dependency. Each service has its own documentation and it is described on their project
+	page how you can configure them, but common for all is that they need to be added to your
+	roleConfiguration.xml file. Adding a service to roleConfiguration.xml is equivalent to adding
+	a Turbine service to TurbineResources.properties.
+</p>
+</subsection>
+<subsection name="Access the Fulcrum services with class name instead of service name">
+<p>
+	As you may have noticed in the documentation for the Fulcrum components, the name for 
+	the different services is the full class name. Therefore the input parameter in the
+	getService method of TurbineServices needs to be the full class name of the service.
+	Usually this is stored in a static field called ROLE. Ex:
+</p>
+<source>
+<![CDATA[
+ParseService parserService = (ParserService)TurbineServices.getInstance().getService(ParserService.ROLE);
+]]>
+</source>
+</subsection>
+<subsection name="Remove any reference to the static facade classes and access the interfaces directly">
+<p>
+	The new services do not have a static facade class like the old ones 
+	(org.apache.turbine.services.localization.Localization for LocalizationService,
+	org.apache.turbine.services.cache.TurbineGlobalCache for GlobalCacheService etc).
+	If you have used these facade classes, you now need to access the service directly via
+	the interface instead. How to access the classes is described in the previous section. 
+</p>
+</subsection>
+</section>
+</body>
+</document>