You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by pa...@apache.org on 2018/10/09 16:26:22 UTC
svn commit: r1843306 - in /turbine/core/trunk: pom.xml src/site/site.xml
xdocs/howto/migrate-from-4_0-howto.xml xdocs/images/turbine-project.png
Author: painter
Date: Tue Oct 9 16:26:22 2018
New Revision: 1843306
URL: http://svn.apache.org/viewvc?rev=1843306&view=rev
Log:
Update logo images to feather, start migration howto from t4 to t5
Added:
turbine/core/trunk/xdocs/howto/migrate-from-4_0-howto.xml
Modified:
turbine/core/trunk/pom.xml
turbine/core/trunk/src/site/site.xml
turbine/core/trunk/xdocs/images/turbine-project.png
Modified: turbine/core/trunk/pom.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/pom.xml?rev=1843306&r1=1843305&r2=1843306&view=diff
==============================================================================
--- turbine/core/trunk/pom.xml (original)
+++ turbine/core/trunk/pom.xml Tue Oct 9 16:26:22 2018
@@ -1119,8 +1119,7 @@
<maven.compiler.target>1.8</maven.compiler.target>
<!-- TODO: Change for release -->
- <!--turbine.site.path>turbine/development/turbine-4.1</turbine.site.path-->
- <turbine.site.path>turbine/turbine-4.0</turbine.site.path>
+ <turbine.site.path>turbine/turbine-5.0</turbine.site.path>
<fulcrum.intake>2.0.0-SNAPSHOT</fulcrum.intake>
<fulcrum.security>1.1.3-SNAPSHOT</fulcrum.security>
<slf4j.version>1.7.25</slf4j.version>
Modified: turbine/core/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/site/site.xml?rev=1843306&r1=1843305&r2=1843306&view=diff
==============================================================================
--- turbine/core/trunk/src/site/site.xml (original)
+++ turbine/core/trunk/src/site/site.xml Tue Oct 9 16:26:22 2018
@@ -22,7 +22,7 @@
<bannerLeft>
<name>Apache Turbine</name>
- <src>/images/turbine-project.png</src>
+ <src>/images/turbine-project-apache-separate.png</src>
<alt>Apache Turbine</alt>
<href>http://turbine.apache.org/</href>
</bannerLeft>
@@ -79,6 +79,7 @@
<item name="Migrating from 2.1 to 2.2" href="/howto/migrate-from-2_1-howto.html"/>
<item name="Migrating from 2.2 to 2.3" href="/howto/migrate-from-2_2-howto.html"/>
<item name="Migrating from 2.3 to 4.0" href="/howto/migrate-from-2_3-howto.html"/>
+ <item name="Migrating from 4.0 to 5.0" href="/howto/migrate-from-4_0-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"/>
Added: turbine/core/trunk/xdocs/howto/migrate-from-4_0-howto.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/xdocs/howto/migrate-from-4_0-howto.xml?rev=1843306&view=auto
==============================================================================
--- turbine/core/trunk/xdocs/howto/migrate-from-4_0-howto.xml (added)
+++ turbine/core/trunk/xdocs/howto/migrate-from-4_0-howto.xml Tue Oct 9 16:26:22 2018
@@ -0,0 +1,124 @@
+<?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 4.0 to 5.0</title>
+ </properties>
+
+<body>
+
+<section name="Introduction">
+<p>
+ This document describes the basic steps needed to migrate an
+ application written for Turbine 4.0 to Turbine 5.0.
+</p>
+<p>
+ Migrating from Turbine 4.0 to Turbine 5.0 is mostly a task of
+ updating any references to commons-config and insuring that you
+ are using Parts for file upload rather than the old FileItem object.
+</p>
+</section>
+
+<section name="Updating configuration">
+<p>
+ TurbineResources.properties have changed making it less verbose
+ to point to the log4j config file.
+
+ <ul>
+ <li>Remove the WEB-INF/conf/ prefix from your log4j config file location</li>
+ </ul>
+</p>
+</section>
+
+
+
+<section name="Migrating file upload to Parts">
+
+<p>
+ In turbine-4.0.1 and prior, file uploads were processed through the
+ data.getParameters().getFileItem("file_field_name") method and returned
+ a FileItem object.
+</p>
+
+<p>
+ With Turbine-5.0, the framework is now using Java servlet 3.1.0.
+ As such, you will need to migrate this code using the
+ new Part object from the servlet spec. This actually saves you some
+ time since you don't have to convert the FileItem to a byte array and
+ then into an InputStream for processing.. you auto-magically get an
+ getInputStream() method on your javax.servlet.http.Part object to then
+ do as you please...
+</p>
+
+<source>
+<![CDATA[
+
+ // all file items are now parts
+ Part fileItem = data.getParameters().getPart("file");
+
+ if (fileItem != null) {
+
+ InputStream is = fileItem.getInputStream();
+ BufferedReader bfReader = null;
+ try {
+ bfReader = new BufferedReader(new InputStreamReader(is));
+ String line = null;
+ while ((line = bfReader.readLine()) != null) {
+
+ // do something with the input here ...
+
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ if (is != null)
+ is.close();
+ } catch (Exception ex) {
+
+ }
+ }
+ }
+
+]]>
+</source>
+
+<p>
+ And if you really do need a byte array (for example to store the
+ contents as a binary object in the database), you can do this using the
+ following method calls.
+</p>
+
+<source>
+<![CDATA[
+
+ InputStream is = fileItem.getInputStream();
+ byte[] byteArray = IOUtils.toByteArray(is);
+
+]]>
+</source>
+
+</section>
+
+
+</body>
+</document>
Modified: turbine/core/trunk/xdocs/images/turbine-project.png
URL: http://svn.apache.org/viewvc/turbine/core/trunk/xdocs/images/turbine-project.png?rev=1843306&r1=1843305&r2=1843306&view=diff
==============================================================================
Binary files - no diff available.