jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaqu...@apache.org
Subject svn commit: r766536 - in /incubator/jspwiki/trunk/src/java/org/apache/wiki/action: AbstractPageActionBean.java DeleteActionBean.java UploadActionBean.java
Date Sun, 19 Apr 2009 22:26:47 GMT
Author: ajaquith
Date: Sun Apr 19 22:26:47 2009
New Revision: 766536

URL: http://svn.apache.org/viewvc?rev=766536&view=rev
Log:
Fixed bug where the WikiPage references stored by WikiActionBeanContext and the underlying
WikiContext were not synchronized. As a result, AbstractPageActionBean's m_page field is now
private.

Modified:
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/AbstractPageActionBean.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DeleteActionBean.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UploadActionBean.java

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/AbstractPageActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/AbstractPageActionBean.java?rev=766536&r1=766535&r2=766536&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/AbstractPageActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/AbstractPageActionBean.java Sun
Apr 19 22:26:47 2009
@@ -42,8 +42,6 @@
  */
 public class AbstractPageActionBean extends AbstractActionBean
 {
-    protected WikiPage m_page = null;
-
     /**
      * Returns the WikiPage; defaults to <code>null</code>.
      * 
@@ -51,7 +49,7 @@
      */
     public WikiPage getPage()
     {
-        return m_page;
+        return getContext().getPage();
     }
 
     /**
@@ -68,7 +66,6 @@
     @Validate( required = true )
     public void setPage( WikiPage page )
     {
-        m_page = page;
         getContext().setPage( page );
     }
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DeleteActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DeleteActionBean.java?rev=766536&r1=766535&r2=766536&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DeleteActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DeleteActionBean.java Sun Apr
19 22:26:47 2009
@@ -67,7 +67,8 @@
         // If all versions of a page or attachment should be deleted, redirect
         // to the main page (for page) or parent page (for attachment)
         WikiEngine engine = getContext().getEngine();
-        String pageName = m_page.getName();
+        WikiPage page = getPage();
+        String pageName = page.getName();
         if( m_version == Integer.MIN_VALUE )
         {
             HttpServletRequest request = getContext().getRequest();
@@ -86,9 +87,9 @@
         }
 
         // If attachment deleted; always redirect to parent page
-        if( m_page.isAttachment() )
+        if( page.isAttachment() )
         {
-            String redirPage = m_page.getParent().getName();
+            String redirPage = page.getParent().getName();
             return new RedirectResolution( ViewActionBean.class, "view" ).addParameter( "page",
redirPage );
         }
 
@@ -138,7 +139,7 @@
         if( engine.pageExists( getPage().getName(), m_version ) )
         {
             // While we're at it, set the correct version for the bean
-            m_page = engine.getPage( getPage().getName(), m_version );
+            setPage( engine.getPage( getPage().getName(), m_version ) );
             return;
         }
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UploadActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UploadActionBean.java?rev=766536&r1=766535&r2=766536&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UploadActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/UploadActionBean.java Sun Apr
19 22:26:47 2009
@@ -116,7 +116,7 @@
             }
         }
 
-        return new RedirectResolution( ViewActionBean.class, "attachments" ).addParameter(
"page", m_page.getName() );
+        return new RedirectResolution( ViewActionBean.class, "attachments" ).addParameter(
"page", getPage().getName() );
     }
     
     @ValidationMethod
@@ -225,7 +225,7 @@
         data.close();
         filebean.delete();
 
-        log.info( "User " + user + " uploaded attachment to " + m_page.getName() + " called
" + filename + ", size " + att.getSize() );
+        log.info( "User " + user + " uploaded attachment to " + getPage().getName() + " called
" + filename + ", size " + att.getSize() );
 
         return created;
     }



Mime
View raw message