jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mets...@apache.org
Subject svn commit: r1553820 - in /jspwiki/trunk: ./ jspwiki-war/src/main/java/org/apache/wiki/ jspwiki-war/src/main/java/org/apache/wiki/providers/ jspwiki-war/src/test/java/org/apache/wiki/providers/
Date Sat, 28 Dec 2013 12:35:01 GMT
Author: metskem
Date: Sat Dec 28 12:35:01 2013
New Revision: 1553820

URL: http://svn.apache.org/r1553820
Log:
2013-12-28  Harry Metske (metskem@apache.org)

       * 2.10.0-svn-61

       * fixed JSPWIKI-807 VersioningFileProvider pageExist failure to properly handle latest
version

Modified:
    jspwiki/trunk/ChangeLog
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingProvider.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/WikiPageProvider.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/providers/CounterProvider.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/providers/VerySimpleProvider.java

Modified: jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/jspwiki/trunk/ChangeLog?rev=1553820&r1=1553819&r2=1553820&view=diff
==============================================================================
--- jspwiki/trunk/ChangeLog (original)
+++ jspwiki/trunk/ChangeLog Sat Dec 28 12:35:01 2013
@@ -1,3 +1,9 @@
+2013-12-28  Harry Metske (metskem@apache.org)
+
+       * 2.10.0-svn-61
+
+       * fixed JSPWIKI-807 VersioningFileProvider pageExist failure to properly handle latest
version
+
 2013-12-27  Harry Metske (metskem@apache.org)
 
        * 2.10.0-svn-60

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java?rev=1553820&r1=1553819&r2=1553820&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java Sat Dec 28 12:35:01
2013
@@ -491,11 +491,7 @@ public class PageManager extends ModuleM
         	return pageExists( pageName );
         }
 
-        if( m_provider instanceof CachingProvider ) {
-            return ( ( CachingProvider )m_provider ).pageExists( pageName , version );
-        }
-
-        return m_provider.getPageInfo( pageName, version ) != null;
+        return m_provider.pageExists( pageName , version );
     }
 
     /**

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java?rev=1553820&r1=1553819&r2=1553820&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java Sat Dec 28 12:35:01
2013
@@ -72,7 +72,7 @@ public final class Release {
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "60";
+    public static final String     BUILD         = "61";
     
     /**
      *  This is the generic version string you should use when printing out the version.
 It is of 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java?rev=1553820&r1=1553819&r2=1553820&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java
(original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java
Sat Dec 28 12:35:01 2013
@@ -230,7 +230,15 @@ public abstract class AbstractFileProvid
     {
         File pagefile = findPage( page );
 
-        return pagefile.exists();        
+        return pagefile.exists();
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    public boolean pageExists( String page, int version )
+    {
+        return pageExists (page);
     }
 
     /**

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingProvider.java?rev=1553820&r1=1553819&r2=1553820&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingProvider.java
(original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingProvider.java
Sat Dec 28 12:35:01 2013
@@ -56,7 +56,7 @@ import org.apache.wiki.util.TextUtil;
 //        for a lot of things.  RefactorMe.
 
 public class CachingProvider
-    implements WikiPageProvider, VersioningProvider
+    implements WikiPageProvider
 {
     private static final Logger log = Logger.getLogger(CachingProvider.class);
 
@@ -208,8 +208,7 @@ public class CachingProvider
                 return true;
             }
 
-            if( m_provider instanceof VersioningProvider )
-                return ((VersioningProvider) m_provider).pageExists( pageName, version );
+            return m_provider.pageExists( pageName, version );
         }
 
         try

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java?rev=1553820&r1=1553819&r2=1553820&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java
(original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java
Sat Dec 28 12:35:01 2013
@@ -55,7 +55,6 @@ import org.apache.wiki.util.FileUtil;
  */
 public class VersioningFileProvider
     extends AbstractFileProvider
-    implements VersioningProvider
 {
     private static final Logger     log = Logger.getLogger(VersioningFileProvider.class);
    
@@ -584,7 +583,7 @@ public class VersioningFileProvider
      */
     public boolean pageExists( String pageName, int version )
     {
-        if (version == WikiPageProvider.LATEST_VERSION) {
+        if (version == WikiPageProvider.LATEST_VERSION || version == findLatestVersion( pageName
) ) {
             return pageExists(pageName);
         }
 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/WikiPageProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/WikiPageProvider.java?rev=1553820&r1=1553819&r2=1553820&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/WikiPageProvider.java
(original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/providers/WikiPageProvider.java
Sat Dec 28 12:35:01 2013
@@ -66,6 +66,16 @@ public interface WikiPageProvider
     boolean pageExists( String page );
 
     /**
+     * Return true, if page with a particular version exists.
+     *
+     * @param page    The page name to check for
+     * @param version The version to check
+     * @return True, if page exists; false otherwise.
+     */
+
+    public boolean pageExists(String page, int version);
+
+    /**
      *  Finds pages based on the query.   Only applicable to providers
      *  which implement the FastSearch interface.  Otherwise JSPWiki
      *  will use its internal cache.

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/providers/CounterProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/providers/CounterProvider.java?rev=1553820&r1=1553819&r2=1553820&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/providers/CounterProvider.java
(original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/providers/CounterProvider.java
Sat Dec 28 12:35:01 2013
@@ -81,12 +81,14 @@ public class CounterProvider
     {
         m_pageExistsCalls++;
 
-        //System.out.println("PAGE="+page);
-        //TestEngine.trace();
-
         return findPage( page ) != null;
     }
 
+    public boolean pageExists( String page, int version )
+    {
+        return pageExists (page);
+    }
+
     public Collection findPages( QueryItem[] query )
     {
         return null;

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/providers/VerySimpleProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/providers/VerySimpleProvider.java?rev=1553820&r1=1553819&r2=1553820&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/providers/VerySimpleProvider.java
(original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/providers/VerySimpleProvider.java
Sat Dec 28 12:35:01 2013
@@ -77,6 +77,14 @@ public class VerySimpleProvider implemen
     }
 
     /**
+     *  Always returns true.
+     */
+    public boolean pageExists( String page, int version )
+    {
+        return true;
+    }
+
+    /**
      *  Always returns null.
      */
     public Collection findPages( QueryItem[] query )



Mime
View raw message