cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r487078 - in /cocoon/branches/BRANCH_2_1_X: src/blocks/javaflow/java/org/apache/cocoon/samples/flow/java/PersistenceFlow.java src/blocks/javaflow/samples/screens/employee-result.xml status.xml
Date Thu, 14 Dec 2006 07:42:05 GMT
Author: cziegeler
Date: Wed Dec 13 23:42:04 2006
New Revision: 487078

URL: http://svn.apache.org/viewvc?view=rev&rev=487078
Log:
The JavaFlow OJB sample overwrote the first entry on insert instead of adding a new entry.
Applied patch by Jeroen Reijn.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/cocoon/samples/flow/java/PersistenceFlow.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/samples/screens/employee-result.xml
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/cocoon/samples/flow/java/PersistenceFlow.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/cocoon/samples/flow/java/PersistenceFlow.java?view=diff&rev=487078&r1=487077&r2=487078
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/cocoon/samples/flow/java/PersistenceFlow.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/java/org/apache/cocoon/samples/flow/java/PersistenceFlow.java
Wed Dec 13 23:42:04 2006
@@ -46,10 +46,17 @@
     }
 
     public void doInsertEmployee() throws BindingException {
+    	
+    	int id = 1;
+        // Get id as parameter
+        if (getRequest().getParameter("id")!=null)
+            id = Integer.parseInt(getRequest().getParameter("id"));
+    	
         // Create a empty Bean
         Employee employee = new Employee();
         // Fill some initial data to the bean
-        employee.setId(1);
+
+        employee.setId(id);
         // Load form descriptor
         FormInstance form = new FormInstance("forms/employee.xml");
         // Load form binding

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/samples/screens/employee-result.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/samples/screens/employee-result.xml?view=diff&rev=487078&r1=487077&r2=487078
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/samples/screens/employee-result.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/javaflow/samples/screens/employee-result.xml Wed
Dec 13 23:42:04 2006
@@ -25,6 +25,7 @@
    <column title="Apache OJB example">
      <p>The values retrieved from the database:</p>
      <table>
+      <jx:set var="nrOfItems" value="${employee.size()}"/>
       <jx:forEach var="item" items="${employee}">
         <tr>
           <td>ID: </td><td>${item.id}</td>
@@ -35,7 +36,7 @@
         </tr>
       </jx:forEach>
      </table>
-     <p><a href="insertEmployee.do">insert</a></p>
+     <p><a href="insertEmployee.do?id=${nrOfItems+1}">insert</a></p>
    </column>
   </row>
  </body>

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/status.xml?view=diff&rev=487078&r1=487077&r2=487078
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Wed Dec 13 23:42:04 2006
@@ -184,6 +184,10 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.10" date="TBD">
+   <action dev="CZ" type="fix" fixes-bug="COCOON-1970" due-to="Jeroen Reijn">
+      The JavaFlow OJB sample overwrote the first entry on insert instead of adding a new
entry.
+      This has been fixed.
+   </action>
    <action dev="CZ" type="remove">
      Core: Removed the buggy WildhardHelper. Use the new improved WildcardMatcherHelper.
    </action>



Mime
View raw message