remm        01/10/10 19:02:46

  Modified:    src/wrappers/catalina AdminHost.java SlideHost.java
                        WebdavHost.java
  Log:
  - The webapp paths are now based on catalinaBase, which should solve the
    problems reported when running from a directory other
    that $SLIDE_HOME/server.
  - The slide specific webapps are now in /slide/slide-*.war.
  
  Revision  Changes    Path
  1.2       +22 -6     jakarta-slide/src/wrappers/catalina/AdminHost.java
  
  Index: AdminHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/wrappers/catalina/AdminHost.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AdminHost.java    2001/09/24 01:40:34     1.1
  +++ AdminHost.java    2001/10/11 02:02:46     1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/wrappers/catalina/AdminHost.java,v 1.1 
2001/09/24 01:40:34 remm Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/09/24 01:40:34 $
  + * $Header: /home/cvs/jakarta-slide/src/wrappers/catalina/AdminHost.java,v 1.2 
2001/10/11 02:02:46 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/10/11 02:02:46 $
    *
    * ====================================================================
    *
  @@ -105,7 +105,7 @@
    * Slide administrator implementation of Host.
    *
    * @author Remy Maucherat
  - * @version $Revision: 1.1 $ $Date: 2001/09/24 01:40:34 $
  + * @version $Revision: 1.2 $ $Date: 2001/10/11 02:02:46 $
    */
   
   public class AdminHost
  @@ -173,11 +173,11 @@
           while (namespaceNames.hasMoreElements()) {
               String name = (String) namespaceNames.nextElement();
               try {
  -                File managerWar = new File("admin/slide-admin.war");
  -                install("/" + name, managerWar.toURL());
  +                URL adminWar = getAdminWebappURL();
  +                install("/" + name, adminWar);
                   if (name.equals(defaultNamespace)) {
                       // Also install the deafult namespace as the root context
  -                    install("", managerWar.toURL());
  +                    install("", adminWar);
                   }
               } catch (IOException e) {
                   // Can't happen
  @@ -304,6 +304,22 @@
               log(sm.getString("standardHost.installError", contextPath), e);
               throw new IOException(e.toString());
           }
  +
  +    }
  +
  +
  +    // ------------------------------------------------------ Protected Methods
  +
  +
  +    /**
  +     * Return the full path to the admin webapp.
  +     */
  +    protected URL getAdminWebappURL()
  +        throws IOException {
  +
  +        File file = new File(System.getProperty("catalina.base"));
  +        file = new File(file, "slide/slide-admin.war");
  +        return new URL("file", null, file.getCanonicalPath());
   
       }
   
  
  
  
  1.6       +25 -11    jakarta-slide/src/wrappers/catalina/SlideHost.java
  
  Index: SlideHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/wrappers/catalina/SlideHost.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SlideHost.java    2001/09/24 08:17:09     1.5
  +++ SlideHost.java    2001/10/11 02:02:46     1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/wrappers/catalina/SlideHost.java,v 1.5 
2001/09/24 08:17:09 remm Exp $
  - * $Revision: 1.5 $
  - * $Date: 2001/09/24 08:17:09 $
  + * $Header: /home/cvs/jakarta-slide/src/wrappers/catalina/SlideHost.java,v 1.6 
2001/10/11 02:02:46 remm Exp $
  + * $Revision: 1.6 $
  + * $Date: 2001/10/11 02:02:46 $
    *
    * ====================================================================
    *
  @@ -106,7 +106,7 @@
    * Slide implementation of Host.
    *
    * @author Remy Maucherat
  - * @version $Revision: 1.5 $ $Date: 2001/09/24 08:17:09 $
  + * @version $Revision: 1.6 $ $Date: 2001/10/11 02:02:46 $
    */
   
   public class SlideHost
  @@ -172,14 +172,10 @@
           boolean installDefault = true;
           
           try {
  -            File rootWar = new File("webapps/ROOT.war");
  -            if (rootWar.exists()) {
  -                install("", rootWar.toURL());
  -                installDefault = false;
  -            }
  +            URL welcomeWar = getWelcomeWebappURL();
  +            install("", welcomeWar);
  +            installDefault = false;
           } catch (IOException e) {
  -            // Can't happen
  -            e.printStackTrace();
           }
           
           Enumeration namespaceNames = domain.enumerateNamespaces();
  @@ -276,6 +272,24 @@
               log(sm.getString("standardHost.installError", contextPath), e);
               throw new IOException(e.toString());
           }
  +
  +    }
  +
  +
  +    // ------------------------------------------------------ Protected Methods
  +
  +
  +    /**
  +     * Return the full path to the welcome webapp.
  +     */
  +    protected URL getWelcomeWebappURL()
  +        throws IOException {
  +
  +        File file = new File(System.getProperty("catalina.base"));
  +        file = new File(file, "slide/slide-welcome.war");
  +        if (!file.exists())
  +            throw new IOException();
  +        return new URL("file", null, file.getCanonicalPath());
   
       }
   
  
  
  
  1.4       +23 -7     jakarta-slide/src/wrappers/catalina/WebdavHost.java
  
  Index: WebdavHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/wrappers/catalina/WebdavHost.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WebdavHost.java   2001/09/08 20:03:12     1.3
  +++ WebdavHost.java   2001/10/11 02:02:46     1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/wrappers/catalina/WebdavHost.java,v 1.3 
2001/09/08 20:03:12 remm Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/09/08 20:03:12 $
  + * $Header: /home/cvs/jakarta-slide/src/wrappers/catalina/WebdavHost.java,v 1.4 
2001/10/11 02:02:46 remm Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/10/11 02:02:46 $
    *
    * ====================================================================
    *
  @@ -104,7 +104,7 @@
    * Slide Webdav implementation of Host.
    *
    * @author Remy Maucherat
  - * @version $Revision: 1.3 $ $Date: 2001/09/08 20:03:12 $
  + * @version $Revision: 1.4 $ $Date: 2001/10/11 02:02:46 $
    */
   
   public class WebdavHost
  @@ -172,11 +172,11 @@
           while (namespaceNames.hasMoreElements()) {
               String name = (String) namespaceNames.nextElement();
               try {
  -                File webdavWar = new File("webdav/webdav.war");
  -                install("/" + name, webdavWar.toURL());
  +                URL webdavWar = getWebDAVWebappURL();
  +                install("/" + name, webdavWar);
                   if (name.equals(defaultNamespace)) {
                       // Also install the deafult namespace as the root context
  -                    install("", webdavWar.toURL());
  +                    install("", webdavWar);
                   }
               } catch (IOException e) {
                   // Can't happen
  @@ -310,6 +310,22 @@
               log(sm.getString("standardHost.installError", contextPath), e);
               throw new IOException(e.toString());
           }
  +
  +    }
  +
  +
  +    // ------------------------------------------------------ Protected Methods
  +
  +
  +    /**
  +     * Return the full path to the WebDAV webapp.
  +     */
  +    protected URL getWebDAVWebappURL()
  +        throws IOException {
  +
  +        File file = new File(System.getProperty("catalina.base"));
  +        file = new File(file, "slide/slide-webdav.war");
  +        return new URL("file", null, file.getCanonicalPath());
   
       }
   
  
  
  


Reply via email to