You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by me...@apache.org on 2013/01/03 21:37:15 UTC

svn commit: r1428579 - in /incubator/jspwiki/trunk: ChangeLog etc/web.xml src/org/apache/wiki/Release.java src/org/apache/wiki/attachment/AttachmentServlet.java src/org/apache/wiki/dav/ tests/org/apache/wiki/AllTests.java tests/org/apache/wiki/dav/

Author: metskem
Date: Thu Jan  3 20:37:15 2013
New Revision: 1428579

URL: http://svn.apache.org/viewvc?rev=1428579&view=rev
Log:
2013-01-02  Harry Metske <me...@apache.org>

       * 2.9.1-svn-11
       
       * JSPWIKI-513 - Remove DAV support from JSPWiki

Removed:
    incubator/jspwiki/trunk/src/org/apache/wiki/dav/
    incubator/jspwiki/trunk/tests/org/apache/wiki/dav/
Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/etc/web.xml
    incubator/jspwiki/trunk/src/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/org/apache/wiki/attachment/AttachmentServlet.java
    incubator/jspwiki/trunk/tests/org/apache/wiki/AllTests.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=1428579&r1=1428578&r2=1428579&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Thu Jan  3 20:37:15 2013
@@ -1,4 +1,10 @@
-201-01-01  Harry Metske <me...@apache.org>
+2013-01-02  Harry Metske <me...@apache.org>
+
+       * 2.9.1-svn-11
+       
+       * JSPWIKI-513 - Remove DAV support from JSPWiki
+
+2013-01-01  Harry Metske <me...@apache.org>
 
        * 2.9.1-svn-10
        

Modified: incubator/jspwiki/trunk/etc/web.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/etc/web.xml?rev=1428579&r1=1428578&r2=1428579&view=diff
==============================================================================
--- incubator/jspwiki/trunk/etc/web.xml (original)
+++ incubator/jspwiki/trunk/etc/web.xml Thu Jan  3 20:37:15 2013
@@ -74,10 +74,6 @@
    </filter-mapping>
    <filter-mapping>
        <filter-name>WikiServletFilter</filter-name>
-       <url-pattern>/dav/*</url-pattern>
-   </filter-mapping>
-   <filter-mapping>
-       <filter-name>WikiServletFilter</filter-name>
        <url-pattern>/RPCU/</url-pattern>
    </filter-mapping>
    <filter-mapping>
@@ -161,11 +157,6 @@
        <load-on-startup>1</load-on-startup>
    </servlet>
 
-   <servlet>
-       <servlet-name>DAVServlet</servlet-name>
-       <servlet-class>org.apache.wiki.dav.WikiDavServlet</servlet-class>
-   </servlet>
-
    <!--
        Attachment exchange handler.
      -->
@@ -213,13 +204,6 @@
        <servlet-name>WikiServlet</servlet-name>
        <url-pattern>/wiki/*</url-pattern>
    </servlet-mapping>
-
-   <!-- Remove to enable WebDav. EXPERIMENTAL FEATURE!
-   <servlet-mapping>
-       <servlet-name>DAVServlet</servlet-name>
-       <url-pattern>/dav/*</url-pattern>
-   </servlet-mapping>
-   -->
    
    <servlet-mapping>
        <servlet-name>com.metaparadigm.jsonrpc.JSONRPCServlet</servlet-name>

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/Release.java?rev=1428579&r1=1428578&r2=1428579&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/Release.java Thu Jan  3 20:37:15 2013
@@ -75,7 +75,7 @@ public final class Release
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "10";
+    public static final String     BUILD         = "11";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/org/apache/wiki/attachment/AttachmentServlet.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/org/apache/wiki/attachment/AttachmentServlet.java?rev=1428579&r1=1428578&r2=1428579&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/org/apache/wiki/attachment/AttachmentServlet.java (original)
+++ incubator/jspwiki/trunk/src/org/apache/wiki/attachment/AttachmentServlet.java Thu Jan  3 20:37:15 2013
@@ -31,6 +31,7 @@ import java.util.Properties;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -45,12 +46,6 @@ import org.apache.wiki.*;
 import org.apache.wiki.api.exceptions.RedirectException;
 import org.apache.wiki.auth.AuthorizationManager;
 import org.apache.wiki.auth.permissions.PermissionFactory;
-import org.apache.wiki.dav.AttachmentDavProvider;
-import org.apache.wiki.dav.DavPath;
-import org.apache.wiki.dav.DavProvider;
-import org.apache.wiki.dav.WebdavServlet;
-import org.apache.wiki.dav.methods.DavMethod;
-import org.apache.wiki.dav.methods.PropFindMethod;
 import org.apache.wiki.i18n.InternationalizationManager;
 import org.apache.wiki.providers.ProviderException;
 import org.apache.wiki.ui.progress.ProgressItem;
@@ -69,13 +64,12 @@ import org.apache.wiki.util.HttpUtil;
  *
  *  @since 1.9.45.
  */
-public class AttachmentServlet
-    extends WebdavServlet
+public class AttachmentServlet extends HttpServlet
 {
     private static final int BUFFER_SIZE = 8192;
 
     private static final long serialVersionUID = 3257282552187531320L;
-
+    
     private WikiEngine m_engine;
     static Logger log = Logger.getLogger(AttachmentServlet.class.getName());
 
@@ -87,8 +81,6 @@ public class AttachmentServlet
 
     private String m_tmpDir;
 
-    private DavProvider m_attachmentProvider;
-
     /**
      *  The maximum size that an attachment can be.
      */
@@ -111,17 +103,13 @@ public class AttachmentServlet
     /**
      *  Initializes the servlet from WikiEngine properties.
      *   
-     *  {@inheritDoc}
      */
     public void init( ServletConfig config )
         throws ServletException
     {
-        super.init( config );
-
         m_engine         = WikiEngine.getInstance( config );
         Properties props = m_engine.getWikiProperties();
 
-        m_attachmentProvider = new AttachmentDavProvider( m_engine );
         m_tmpDir         = m_engine.getWorkDir()+File.separator+"attach-tmp";
 
         m_maxSize        = TextUtil.getIntegerProperty( props,
@@ -182,25 +170,6 @@ public class AttachmentServlet
     }
 
     /**
-     *  Implements the PROPFIND method.
-     *  
-     *  @param req The servlet request
-     *  @param res The servlet response
-     *  @throws IOException If input/output fails
-     *  @throws ServletException If the servlet has issues
-     */
-    public void doPropFind( HttpServletRequest req, HttpServletResponse res )
-        throws IOException, ServletException
-    {
-        DavMethod dm = new PropFindMethod( m_attachmentProvider );
-
-        String p = new String(req.getPathInfo().getBytes("ISO-8859-1"), "UTF-8");
-
-        DavPath path = new DavPath( p );
-
-        dm.execute( req, res, path );
-    }
-    /**
      *  Implements the OPTIONS method.
      *  
      *  @param req The servlet request
@@ -209,7 +178,6 @@ public class AttachmentServlet
 
     protected void doOptions( HttpServletRequest req, HttpServletResponse res )
     {
-        res.setHeader( "DAV", "1" ); // We support only Class 1
         res.setHeader( "Allow", "GET, PUT, POST, OPTIONS, PROPFIND, PROPPATCH, MOVE, COPY, DELETE");
         res.setStatus( HttpServletResponse.SC_OK );
     }
@@ -218,7 +186,6 @@ public class AttachmentServlet
      *  Serves a GET with two parameters: 'wikiname' specifying the wikiname
      *  of the attachment, 'version' specifying the version indicator.
      *  
-     *  {@inheritDoc}
      */
 
     // FIXME: Messages would need to be localized somehow.
@@ -459,7 +426,6 @@ public class AttachmentServlet
      * for the parent file. The second, named 'content', is the binary
      * content of the file.
      * 
-     * {@inheritDoc}
      */
     public void doPost( HttpServletRequest  req, HttpServletResponse res )
         throws IOException, ServletException
@@ -481,53 +447,6 @@ public class AttachmentServlet
     }
 
     /**
-     *  {@inheritDoc}
-     */
-    public void doPut( HttpServletRequest req, HttpServletResponse res )
-        throws IOException, ServletException
-    {
-        String errorPage = m_engine.getURL( WikiContext.ERROR, "", null, false ); // If something bad happened, Upload should be able to take care of most stuff
-
-        String p = new String(req.getPathInfo().getBytes("ISO-8859-1"), "UTF-8");
-        DavPath path = new DavPath( p );
-
-        try
-        {
-            InputStream data = req.getInputStream();
-
-            WikiContext context = m_engine.createContext( req, WikiContext.UPLOAD );
-
-            String wikipage = path.get( 0 );
-
-            errorPage = context.getURL( WikiContext.UPLOAD,
-                                        wikipage );
-
-            String changeNote = null; // FIXME: Does not quite work
-
-            boolean created = executeUpload( context, data,
-                                             path.getName(),
-                                             errorPage, wikipage,
-                                             changeNote,
-                                             req.getContentLength() );
-
-            if( created )
-                res.sendError( HttpServletResponse.SC_CREATED );
-            else
-                res.sendError( HttpServletResponse.SC_OK );
-        }
-        catch( ProviderException e )
-        {
-            res.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-                           e.getMessage() );
-        }
-        catch( RedirectException e )
-        {
-            res.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-                           e.getMessage() );
-        }
-    }
-
-    /**
      *  Validates the next page to be on the same server as this webapp.
      *  Fixes [JSPWIKI-46].
      */

Modified: incubator/jspwiki/trunk/tests/org/apache/wiki/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/org/apache/wiki/AllTests.java?rev=1428579&r1=1428578&r2=1428579&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/org/apache/wiki/AllTests.java (original)
+++ incubator/jspwiki/trunk/tests/org/apache/wiki/AllTests.java Thu Jan  3 20:37:15 2013
@@ -76,7 +76,6 @@ public class AllTests extends TestCase
         suite.addTest( org.apache.wiki.content.AllTests.suite() );
         suite.addTest( org.apache.wiki.attachment.AllTests.suite() );
         suite.addTest( org.apache.wiki.auth.AllTests.suite() );
-        suite.addTest( org.apache.wiki.dav.AllTests.suite() );
         suite.addTest( org.apache.wiki.diff.AllTests.suite() );
         suite.addTest( org.apache.wiki.filters.AllTests.suite() );
         suite.addTest( org.apache.wiki.htmltowiki.AllTests.suite() );