portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r607450 [36/36] - in /portals/pluto/trunk: ./ assembly/src/main/assembly/ assembly/src/main/resources/ maven-pluto-plugin/ maven-pluto-plugin/src/main/java/org/apache/pluto/maven/ pluto-ant-tasks/ pluto-ant-tasks/src/assemble/ pluto-ant-tas...
Date Sat, 29 Dec 2007 17:32:18 GMT
Modified: portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/FileSystemInstaller.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/FileSystemInstaller.java?rev=607450&r1=607449&r2=607450&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/FileSystemInstaller.java
(original)
+++ portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/FileSystemInstaller.java
Sat Dec 29 09:31:56 2007
@@ -1,136 +1,136 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.pluto.util.install.file;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.pluto.util.UtilityException;
-import org.apache.pluto.util.install.InstallationConfig;
-import org.apache.pluto.util.install.PortalInstaller;
-
-/**
- * File System based installer.  Copies files to the appropriate
- * locations.
- *
- */
-public abstract class FileSystemInstaller implements PortalInstaller {
-
-    protected void copyFilesToDirectory(Collection dependencies, File destination)
-    throws IOException {
-        Iterator it = dependencies.iterator();
-        while(it.hasNext()) {
-            File from = (File)it.next();
-            FileUtils.copyFileToDirectory(from, destination);
-        }
-    }
-
-    protected void removeFilesFromDirectory(Collection dependencies, File destination)
-            throws IOException {
-        Iterator it = dependencies.iterator();
-        while(it.hasNext()) {
-            File from = (File)it.next();
-            File delete = new File(destination, from.getName());
-            delete.delete();
-        }
-    }
-
-    protected void copyFileToDirectory(File file, File destination)
-    throws IOException {
-        FileUtils.copyFileToDirectory(file, destination);
-    }
-
-    /**
-     * NOTE: Order is important.  If the server is running, we want to
-     *       make sure that the correct order is preserved
-     *
-     * 1) Install endorsed dependencies
-     * 2) Install shared dependencies
-     * 4) Prep Time
-     *    -- Create a domain directory for the portal
-     *    -- Init the configs holder
-     * 5) Install the Portlet Applications
-     * 6) Install the Portal Application
-     * 7) Finally, install the configs
-     * @param config
-     * @throws org.apache.pluto.util.UtilityException
-     */
-    public void install(InstallationConfig config) throws UtilityException {
-        File endorsedDir = getEndorsedDir(config);
-        File sharedDir = getSharedDir(config);
-        File domainDir = getWebAppDir(config);
-
-        endorsedDir.mkdirs();
-        sharedDir.mkdirs();
-        domainDir.mkdirs();
-
-        try {
-            copyFilesToDirectory(config.getEndorsedDependencies(), endorsedDir);
-            copyFilesToDirectory(config.getSharedDependencies(), sharedDir);
-
-            copyFilesToDirectory(config.getPortletApplications().values(),  domainDir);
-            copyFileToDirectory(config.getPortalApplication(), domainDir);
-
-            writeConfiguration(config);
-        }
-        catch(IOException io) {
-            throw new UtilityException(
-                "Unable to install portal to Tomcat",
-                io,
-                config.getInstallationDirectory()
-            );
-        }
-    }
-
-    public abstract void writeConfiguration(InstallationConfig config)
-    throws IOException;
-
-    protected abstract File getEndorsedDir(InstallationConfig config );
-
-    protected abstract File getSharedDir(InstallationConfig config);
-
-    protected abstract File getWebAppDir(InstallationConfig config);
-
-    public void uninstall(InstallationConfig config)
-    throws UtilityException {
-        File endorsedDir = getEndorsedDir(config);
-        File sharedDir = getSharedDir(config);
-        File domainDir = getWebAppDir(config);
-
-        endorsedDir.mkdirs();
-        sharedDir.mkdirs();
-        domainDir.mkdirs();
-
-        try {
-            removeFilesFromDirectory(config.getEndorsedDependencies(), endorsedDir);
-            removeFilesFromDirectory(config.getSharedDependencies(), sharedDir);
-            removeFilesFromDirectory(config.getPortletApplications().values(),  domainDir);
-
-            File delete = new File(domainDir, config.getPortalApplication().getName());
-            delete.delete();
-        }
-        catch(IOException io) {
-            throw new UtilityException("Unable to remove files. ", io, config.getInstallationDirectory());
-        }
-
-   }
-
-    public abstract boolean isValidInstallationDirectory(File installDir);
-}
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util.install.file;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.pluto.util.UtilityException;
+import org.apache.pluto.util.install.InstallationConfig;
+import org.apache.pluto.util.install.PortalInstaller;
+
+/**
+ * File System based installer.  Copies files to the appropriate
+ * locations.
+ *
+ */
+public abstract class FileSystemInstaller implements PortalInstaller {
+
+    protected void copyFilesToDirectory(Collection dependencies, File destination)
+    throws IOException {
+        Iterator it = dependencies.iterator();
+        while(it.hasNext()) {
+            File from = (File)it.next();
+            FileUtils.copyFileToDirectory(from, destination);
+        }
+    }
+
+    protected void removeFilesFromDirectory(Collection dependencies, File destination)
+            throws IOException {
+        Iterator it = dependencies.iterator();
+        while(it.hasNext()) {
+            File from = (File)it.next();
+            File delete = new File(destination, from.getName());
+            delete.delete();
+        }
+    }
+
+    protected void copyFileToDirectory(File file, File destination)
+    throws IOException {
+        FileUtils.copyFileToDirectory(file, destination);
+    }
+
+    /**
+     * NOTE: Order is important.  If the server is running, we want to
+     *       make sure that the correct order is preserved
+     *
+     * 1) Install endorsed dependencies
+     * 2) Install shared dependencies
+     * 4) Prep Time
+     *    -- Create a domain directory for the portal
+     *    -- Init the configs holder
+     * 5) Install the Portlet Applications
+     * 6) Install the Portal Application
+     * 7) Finally, install the configs
+     * @param config
+     * @throws org.apache.pluto.util.UtilityException
+     */
+    public void install(InstallationConfig config) throws UtilityException {
+        File endorsedDir = getEndorsedDir(config);
+        File sharedDir = getSharedDir(config);
+        File domainDir = getWebAppDir(config);
+
+        endorsedDir.mkdirs();
+        sharedDir.mkdirs();
+        domainDir.mkdirs();
+
+        try {
+            copyFilesToDirectory(config.getEndorsedDependencies(), endorsedDir);
+            copyFilesToDirectory(config.getSharedDependencies(), sharedDir);
+
+            copyFilesToDirectory(config.getPortletApplications().values(),  domainDir);
+            copyFileToDirectory(config.getPortalApplication(), domainDir);
+
+            writeConfiguration(config);
+        }
+        catch(IOException io) {
+            throw new UtilityException(
+                "Unable to install portal to Tomcat",
+                io,
+                config.getInstallationDirectory()
+            );
+        }
+    }
+
+    public abstract void writeConfiguration(InstallationConfig config)
+    throws IOException;
+
+    protected abstract File getEndorsedDir(InstallationConfig config );
+
+    protected abstract File getSharedDir(InstallationConfig config);
+
+    protected abstract File getWebAppDir(InstallationConfig config);
+
+    public void uninstall(InstallationConfig config)
+    throws UtilityException {
+        File endorsedDir = getEndorsedDir(config);
+        File sharedDir = getSharedDir(config);
+        File domainDir = getWebAppDir(config);
+
+        endorsedDir.mkdirs();
+        sharedDir.mkdirs();
+        domainDir.mkdirs();
+
+        try {
+            removeFilesFromDirectory(config.getEndorsedDependencies(), endorsedDir);
+            removeFilesFromDirectory(config.getSharedDependencies(), sharedDir);
+            removeFilesFromDirectory(config.getPortletApplications().values(),  domainDir);
+
+            File delete = new File(domainDir, config.getPortalApplication().getName());
+            delete.delete();
+        }
+        catch(IOException io) {
+            throw new UtilityException("Unable to remove files. ", io, config.getInstallationDirectory());
+        }
+
+   }
+
+    public abstract boolean isValidInstallationDirectory(File installDir);
+}

Propchange: portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/FileSystemInstaller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java?rev=607450&r1=607449&r2=607450&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java
(original)
+++ portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java
Sat Dec 29 09:31:56 2007
@@ -1,94 +1,94 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.pluto.util.install.file;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * TODO JavaDoc
- *
- * @version 1.0
- * @since Dec 11, 2005
- */
-public class TomcatCrossContextGenerator {
-	private static final String PLUTO_TEMP_DIR = "PlutoDomain";
-	private static Log LOG = LogFactory.getLog(TomcatCrossContextGenerator.class);
-
-    public static void main(String[] args) throws IOException {
-
-        File tomcatHome = new File(args[0]);
-        File webapps = new File(tomcatHome, "webapps");
-        File conf = new File(tomcatHome, "conf/Catalina/localhost");
-
-        File[] files = webapps.listFiles(new PortletFileNameFilter());
-        for(int i=0; i < files.length; i++) {
-            String fileName = files[i].getName();
-            String contextName = fileName.substring(0, fileName.indexOf(".war"));
-
-            createContextFile(conf, fileName, contextName);
-        }
-    }
-
-    /**
-     * Creates a tomcat-specific context deployment descriptor
-     * and deploys it.
-     *
-     * @param confDir Tomcat conf directory
-     * @param fileName File name of the war
-     * @param contextName The root name of the context file
-     * @throws IOException If there is a problem
-     */
-	public static void createContextFile(File confDir, String fileName, String contextName)
throws IOException {
-		PrintWriter out = null;
-		try {
-			StringBuffer contents = new StringBuffer();
-			contents.append("<Context ")
-			        .append("path=\"").append(contextName).append("\" ")
-			        .append("docBase=\"../").append(PLUTO_TEMP_DIR).append("/").append(fileName).append("\"
")
-			        .append("crossContext=\"true\">").append("</Context>");
-			File confFile = new File(confDir, contextName+".xml");
-			if (LOG.isInfoEnabled()) {
-				LOG.info("Writing file: "+ confFile.getAbsolutePath());
-			}
-			out = new PrintWriter(new FileWriter(confFile));
-			out.println(contents.toString());
-		} finally {
-			if (out != null) {
-				out.flush();
-				out.close();
-			}
-		}
-	}
-
-    public static class PortletFileNameFilter implements FilenameFilter {
-        public boolean accept(File dir, String name) {
-            if(name.startsWith("portlet") && name.endsWith(".war")) {
-                return true;
-            }
-            return false;
-        }
-    }
-
-
-}
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util.install.file;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * TODO JavaDoc
+ *
+ * @version 1.0
+ * @since Dec 11, 2005
+ */
+public class TomcatCrossContextGenerator {
+	private static final String PLUTO_TEMP_DIR = "PlutoDomain";
+	private static Log LOG = LogFactory.getLog(TomcatCrossContextGenerator.class);
+
+    public static void main(String[] args) throws IOException {
+
+        File tomcatHome = new File(args[0]);
+        File webapps = new File(tomcatHome, "webapps");
+        File conf = new File(tomcatHome, "conf/Catalina/localhost");
+
+        File[] files = webapps.listFiles(new PortletFileNameFilter());
+        for(int i=0; i < files.length; i++) {
+            String fileName = files[i].getName();
+            String contextName = fileName.substring(0, fileName.indexOf(".war"));
+
+            createContextFile(conf, fileName, contextName);
+        }
+    }
+
+    /**
+     * Creates a tomcat-specific context deployment descriptor
+     * and deploys it.
+     *
+     * @param confDir Tomcat conf directory
+     * @param fileName File name of the war
+     * @param contextName The root name of the context file
+     * @throws IOException If there is a problem
+     */
+	public static void createContextFile(File confDir, String fileName, String contextName)
throws IOException {
+		PrintWriter out = null;
+		try {
+			StringBuffer contents = new StringBuffer();
+			contents.append("<Context ")
+			        .append("path=\"").append(contextName).append("\" ")
+			        .append("docBase=\"../").append(PLUTO_TEMP_DIR).append("/").append(fileName).append("\"
")
+			        .append("crossContext=\"true\">").append("</Context>");
+			File confFile = new File(confDir, contextName+".xml");
+			if (LOG.isInfoEnabled()) {
+				LOG.info("Writing file: "+ confFile.getAbsolutePath());
+			}
+			out = new PrintWriter(new FileWriter(confFile));
+			out.println(contents.toString());
+		} finally {
+			if (out != null) {
+				out.flush();
+				out.close();
+			}
+		}
+	}
+
+    public static class PortletFileNameFilter implements FilenameFilter {
+        public boolean accept(File dir, String name) {
+            if(name.startsWith("portlet") && name.endsWith(".war")) {
+                return true;
+            }
+            return false;
+        }
+    }
+
+
+}

Propchange: portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Jetty5FileSystemInstaller.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Jetty5FileSystemInstaller.java?rev=607450&r1=607449&r2=607450&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Jetty5FileSystemInstaller.java
(original)
+++ portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Jetty5FileSystemInstaller.java
Sat Dec 29 09:31:56 2007
@@ -1,163 +1,163 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.pluto.util.install.file.jetty;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.pluto.util.UtilityException;
-import org.apache.pluto.util.install.InstallationConfig;
-import org.apache.pluto.util.install.file.FileSystemInstaller;
-
-public class Jetty5FileSystemInstaller extends FileSystemInstaller {
-
-    protected File getEndorsedDir(InstallationConfig config) {
-        File installationDirectory = config.getInstallationDirectory();
-        return new File(installationDirectory, "ext");
-    }
-
-    protected File getSharedDir(InstallationConfig config) {
-        File installationDirectory = config.getInstallationDirectory();
-        // Jetty 5.1 provides commons-logging.  Should be a nicer way
-        // for installers to indicate what dependencies are provided by the
-        // servlet container.
-        if ( new File(config.getInstallationDirectory(), "ext/commons-logging.jar").exists())
{
-            for (Iterator iter = config.getSharedDependencies().iterator(); iter.hasNext();)
{
-                File dep = (File) iter.next();
-                if (dep.getPath().contains("commons-logging-api")) {
-                    iter.remove();
-                }
-            }
-        }
-        return new File(installationDirectory, "ext");
-    }
-
-    protected File getWebAppDir(InstallationConfig config) {
-        File installationDirectory = config.getInstallationDirectory();
-        return new File(
-                installationDirectory, "webapps"
-        );
-    }
-
-    protected File getConfigurationDir(InstallationConfig config) {
-        File installationDirectory = config.getInstallationDirectory();
-        String engine = "Catalina";
-        String host = config.getServerConfig().getHost();
-        return new File(installationDirectory, "conf/" + engine + "/" + host);
-    }
-
-    public void uninstall(InstallationConfig config) {
-    }
-
-    public void deploy() {
-
-    }
-
-    public boolean isValidInstallationDirectory(File installDir) {
-        File serverConfig = new File(installDir, "etc/jetty.xml");
-        return serverConfig.exists();
-    }
-
-    /**
-     * NOTE: Order is important.  If the server is running, we want to
-     * make sure that the correct order is preserved
-     * <p/>
-     * 1) Install endorsed dependencies
-     * 2) Install shared dependencies
-     * 4) Prep Time
-     * -- Create a domain directory for the portal
-     * -- Init the configs holder
-     * 5) Install the Portlet Applications
-     * 6) Install the Portal Application
-     * 7) Finally, install the configs
-     *
-     * @param config
-     * @throws org.apache.pluto.util.UtilityException
-     *
-     */
-    public void install(InstallationConfig config) throws UtilityException {
-        File endorsedDir = getEndorsedDir(config);
-        File sharedDir = getSharedDir(config);
-        File domainDir = getWebAppDir(config);
-        domainDir.mkdirs();
-        File contextConfigurationDirectory = getConfigurationDir(config);
-
-        try {
-
-            // Jetty Doesn't need 'em
-            //copyFilesToDirectory(config.getEndorsedDependencies(), endorsedDir);
-
-            copyFilesToDirectory(config.getSharedDependencies(), sharedDir);
-
-            Iterator it = config.getPortletApplications().values().iterator();
-            while (it.hasNext()) {
-                File portletApp = (File) it.next();
-                FileUtils.copyFileToDirectory(portletApp, domainDir);
-            }
-
-            FileUtils.copyFileToDirectory(config.getPortalApplication(), domainDir);
-
-
-//            it = config.getPortletApplications().entrySet().iterator();
-//            while (it.hasNext()) {
-//                Map.Entry entry = (Map.Entry) it.next();
-//                String context = entry.getKey().toString();
-//                File portletApp = (File) entry.getValue();
-//
-//                File deployed = new File(domainDir, portletApp.getName());
-//                String contents = getPortletApplicationConfig(context, deployed);
-//                //FileWriter out = new FileWriter(
-//                //        new File(contextConfigurationDirectory, context + ".xml"));
-//                out.write(contents);
-//                out.flush();
-//                out.close();
-//            }
-
-//            File xmlFile = new File(contextConfigurationDirectory, config.getPortalContextPath()
+ ".xml");
-//            FileWriter out = new FileWriter(xmlFile);
-//            out.write(getPortalApplicationConfig(config));
-//            out.flush();
-//            out.close();
-        }
-        catch (IOException io) {
-            throw new UtilityException(io);
-        }
-    }
-
-    private String getPortalApplicationConfig(InstallationConfig config) {
-        File domainDir = this.getWebAppDir(config);
-        String war = domainDir.getAbsolutePath() + File.separatorChar +
-                config.getPortalApplication().getName();
-        String contextPath = config.getPortalContextPath();
-        return getConfigContents(war, contextPath);
-    }
-
-    private String getPortletApplicationConfig(String contextPath, File file) {
-        String war = file.getAbsolutePath();
-        return getConfigContents(war, contextPath);
-    }
-
-    public void writeConfiguration(InstallationConfig config) {
-
-    }
-
-    private String getConfigContents(String war, String contextPath) {
-        return "JettyConfigContents: war=" + war + "contextPath=" + contextPath;
-    }
-}
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util.install.file.jetty;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.pluto.util.UtilityException;
+import org.apache.pluto.util.install.InstallationConfig;
+import org.apache.pluto.util.install.file.FileSystemInstaller;
+
+public class Jetty5FileSystemInstaller extends FileSystemInstaller {
+
+    protected File getEndorsedDir(InstallationConfig config) {
+        File installationDirectory = config.getInstallationDirectory();
+        return new File(installationDirectory, "ext");
+    }
+
+    protected File getSharedDir(InstallationConfig config) {
+        File installationDirectory = config.getInstallationDirectory();
+        // Jetty 5.1 provides commons-logging.  Should be a nicer way
+        // for installers to indicate what dependencies are provided by the
+        // servlet container.
+        if ( new File(config.getInstallationDirectory(), "ext/commons-logging.jar").exists())
{
+            for (Iterator iter = config.getSharedDependencies().iterator(); iter.hasNext();)
{
+                File dep = (File) iter.next();
+                if (dep.getPath().contains("commons-logging-api")) {
+                    iter.remove();
+                }
+            }
+        }
+        return new File(installationDirectory, "ext");
+    }
+
+    protected File getWebAppDir(InstallationConfig config) {
+        File installationDirectory = config.getInstallationDirectory();
+        return new File(
+                installationDirectory, "webapps"
+        );
+    }
+
+    protected File getConfigurationDir(InstallationConfig config) {
+        File installationDirectory = config.getInstallationDirectory();
+        String engine = "Catalina";
+        String host = config.getServerConfig().getHost();
+        return new File(installationDirectory, "conf/" + engine + "/" + host);
+    }
+
+    public void uninstall(InstallationConfig config) {
+    }
+
+    public void deploy() {
+
+    }
+
+    public boolean isValidInstallationDirectory(File installDir) {
+        File serverConfig = new File(installDir, "etc/jetty.xml");
+        return serverConfig.exists();
+    }
+
+    /**
+     * NOTE: Order is important.  If the server is running, we want to
+     * make sure that the correct order is preserved
+     * <p/>
+     * 1) Install endorsed dependencies
+     * 2) Install shared dependencies
+     * 4) Prep Time
+     * -- Create a domain directory for the portal
+     * -- Init the configs holder
+     * 5) Install the Portlet Applications
+     * 6) Install the Portal Application
+     * 7) Finally, install the configs
+     *
+     * @param config
+     * @throws org.apache.pluto.util.UtilityException
+     *
+     */
+    public void install(InstallationConfig config) throws UtilityException {
+        File endorsedDir = getEndorsedDir(config);
+        File sharedDir = getSharedDir(config);
+        File domainDir = getWebAppDir(config);
+        domainDir.mkdirs();
+        File contextConfigurationDirectory = getConfigurationDir(config);
+
+        try {
+
+            // Jetty Doesn't need 'em
+            //copyFilesToDirectory(config.getEndorsedDependencies(), endorsedDir);
+
+            copyFilesToDirectory(config.getSharedDependencies(), sharedDir);
+
+            Iterator it = config.getPortletApplications().values().iterator();
+            while (it.hasNext()) {
+                File portletApp = (File) it.next();
+                FileUtils.copyFileToDirectory(portletApp, domainDir);
+            }
+
+            FileUtils.copyFileToDirectory(config.getPortalApplication(), domainDir);
+
+
+//            it = config.getPortletApplications().entrySet().iterator();
+//            while (it.hasNext()) {
+//                Map.Entry entry = (Map.Entry) it.next();
+//                String context = entry.getKey().toString();
+//                File portletApp = (File) entry.getValue();
+//
+//                File deployed = new File(domainDir, portletApp.getName());
+//                String contents = getPortletApplicationConfig(context, deployed);
+//                //FileWriter out = new FileWriter(
+//                //        new File(contextConfigurationDirectory, context + ".xml"));
+//                out.write(contents);
+//                out.flush();
+//                out.close();
+//            }
+
+//            File xmlFile = new File(contextConfigurationDirectory, config.getPortalContextPath()
+ ".xml");
+//            FileWriter out = new FileWriter(xmlFile);
+//            out.write(getPortalApplicationConfig(config));
+//            out.flush();
+//            out.close();
+        }
+        catch (IOException io) {
+            throw new UtilityException(io);
+        }
+    }
+
+    private String getPortalApplicationConfig(InstallationConfig config) {
+        File domainDir = this.getWebAppDir(config);
+        String war = domainDir.getAbsolutePath() + File.separatorChar +
+                config.getPortalApplication().getName();
+        String contextPath = config.getPortalContextPath();
+        return getConfigContents(war, contextPath);
+    }
+
+    private String getPortletApplicationConfig(String contextPath, File file) {
+        String war = file.getAbsolutePath();
+        return getConfigContents(war, contextPath);
+    }
+
+    public void writeConfiguration(InstallationConfig config) {
+
+    }
+
+    private String getConfigContents(String war, String contextPath) {
+        return "JettyConfigContents: war=" + war + "contextPath=" + contextPath;
+    }
+}

Propchange: portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Jetty5FileSystemInstaller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat5/Tomcat5FileSystemInstaller.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat5/Tomcat5FileSystemInstaller.java?rev=607450&r1=607449&r2=607450&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat5/Tomcat5FileSystemInstaller.java
(original)
+++ portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat5/Tomcat5FileSystemInstaller.java
Sat Dec 29 09:31:56 2007
@@ -1,144 +1,144 @@
-/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.pluto.util.install.file.tomcat5;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.pluto.util.install.InstallationConfig;
-import org.apache.pluto.util.install.file.FileSystemInstaller;
-
-public class Tomcat5FileSystemInstaller extends FileSystemInstaller {
-
-//
-// PortalInstaller Interface
-//
-
-    /**
-     * Determine whether or not this is a valid Tomcat 5.x installation.
-     * @param installDir the proposed TOMCAT BASE directory
-     * @return true if and only if <code>conf/server.xml</code> and
-     *         <code>conf/catalina.properties exist.</code>
-     */
-    public boolean isValidInstallationDirectory(File installDir) {
-        File serverConfig = new File(installDir, "conf/server.xml");
-        File catalinaProps = new File(installDir, "conf/catalina.properties");
-        return serverConfig.exists() && catalinaProps.exists();
-    }
-
-//
-// FileSystemInstaller Implementation
-//
-
-    public void writeConfiguration(InstallationConfig config)
-    throws IOException {
-
-        File contextConfigurationDirectory = getConfigurationDir(config);
-        if (! contextConfigurationDirectory.exists()) {
-            contextConfigurationDirectory.mkdirs();
-        }
-            
-        Iterator it = config.getPortletApplications().entrySet().iterator();
-        while(it.hasNext()) {
-            Map.Entry entry = (Map.Entry)it.next();
-            String context = entry.getKey().toString();
-            File portletApp = (File)entry.getValue();
-
-            String deployed = "../"+config.getServerConfig().getDomain() +
-                    "/" +  portletApp.getName();
-            String contents = getPortletApplicationConfig(context, deployed);
-            FileWriter out = new FileWriter(
-                    new File(contextConfigurationDirectory, context+".xml"));
-            out.write(contents);
-            out.flush();
-            out.close();
-        }
-
-        File xmlFile =  new File(
-                contextConfigurationDirectory,
-                config.getPortalContextPath()+".xml"
-        );
-
-        FileWriter out = new FileWriter(xmlFile);
-        out.write(getPortalApplicationConfig(config));
-        out.flush();
-        out.close();
-    }
-
-    protected File getEndorsedDir(InstallationConfig config ) {
-        File installationDirectory = config.getInstallationDirectory();
-        return new File(installationDirectory, "common/endorsed");
-    }
-
-    protected File getSharedDir(InstallationConfig config) {
-        File installationDirectory = config.getInstallationDirectory();
-        // Tomcat 5 provides commons-logging-api.  Should be a nicer way
-        // for installers to indicate what dependencies are provided by the
-        // servlet container.
-        if ( new File(config.getInstallationDirectory(), "bin/commons-logging-api.jar").exists())
{
-            for (Iterator iter = config.getSharedDependencies().iterator(); iter.hasNext();)
{
-                File dep = (File) iter.next();
-                if (dep.getPath().contains("commons-logging-api")) {
-                    iter.remove();
-                }
-            }
-        }
-        return new File(installationDirectory, "shared/lib");
-    }
-
-    protected File getWebAppDir(InstallationConfig config) {
-        File installationDirectory = config.getInstallationDirectory();
-        return new File(
-            installationDirectory, config.getServerConfig().getDomain()
-        );
-    }
-
-//
-// Helpers
-//
-
-    protected File getConfigurationDir(InstallationConfig config) {
-        File installationDirectory = config.getInstallationDirectory();
-        String engine = "Catalina";
-        String host   = config.getServerConfig().getHost();
-        return new File(installationDirectory, "conf/"+engine+"/"+host);
-    }
-
-    private String getPortalApplicationConfig(InstallationConfig config) {
-        String war = "../"+config.getServerConfig().getDomain() +
-                "/" +  config.getPortalApplication().getName();
-        String contextPath = config.getPortalContextPath();
-        return getConfigContents(war, contextPath);
-    }
-
-    private String getPortletApplicationConfig(String contextPath, String file) {
-        return getConfigContents(file, contextPath);
-    }
-
-    private String getConfigContents(String war, String contextPath) {
-        StringBuffer contents = new StringBuffer();
-        contents.append("<Context ")
-                .append("path=\"").append(contextPath).append("\" ")
-                .append("docBase=\"").append(war).append("\" ")
-                .append("crossContext=\"true\">").append("</Context>");
-       return contents.toString();
-    }
-}
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util.install.file.tomcat5;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.pluto.util.install.InstallationConfig;
+import org.apache.pluto.util.install.file.FileSystemInstaller;
+
+public class Tomcat5FileSystemInstaller extends FileSystemInstaller {
+
+//
+// PortalInstaller Interface
+//
+
+    /**
+     * Determine whether or not this is a valid Tomcat 5.x installation.
+     * @param installDir the proposed TOMCAT BASE directory
+     * @return true if and only if <code>conf/server.xml</code> and
+     *         <code>conf/catalina.properties exist.</code>
+     */
+    public boolean isValidInstallationDirectory(File installDir) {
+        File serverConfig = new File(installDir, "conf/server.xml");
+        File catalinaProps = new File(installDir, "conf/catalina.properties");
+        return serverConfig.exists() && catalinaProps.exists();
+    }
+
+//
+// FileSystemInstaller Implementation
+//
+
+    public void writeConfiguration(InstallationConfig config)
+    throws IOException {
+
+        File contextConfigurationDirectory = getConfigurationDir(config);
+        if (! contextConfigurationDirectory.exists()) {
+            contextConfigurationDirectory.mkdirs();
+        }
+            
+        Iterator it = config.getPortletApplications().entrySet().iterator();
+        while(it.hasNext()) {
+            Map.Entry entry = (Map.Entry)it.next();
+            String context = entry.getKey().toString();
+            File portletApp = (File)entry.getValue();
+
+            String deployed = "../"+config.getServerConfig().getDomain() +
+                    "/" +  portletApp.getName();
+            String contents = getPortletApplicationConfig(context, deployed);
+            FileWriter out = new FileWriter(
+                    new File(contextConfigurationDirectory, context+".xml"));
+            out.write(contents);
+            out.flush();
+            out.close();
+        }
+
+        File xmlFile =  new File(
+                contextConfigurationDirectory,
+                config.getPortalContextPath()+".xml"
+        );
+
+        FileWriter out = new FileWriter(xmlFile);
+        out.write(getPortalApplicationConfig(config));
+        out.flush();
+        out.close();
+    }
+
+    protected File getEndorsedDir(InstallationConfig config ) {
+        File installationDirectory = config.getInstallationDirectory();
+        return new File(installationDirectory, "common/endorsed");
+    }
+
+    protected File getSharedDir(InstallationConfig config) {
+        File installationDirectory = config.getInstallationDirectory();
+        // Tomcat 5 provides commons-logging-api.  Should be a nicer way
+        // for installers to indicate what dependencies are provided by the
+        // servlet container.
+        if ( new File(config.getInstallationDirectory(), "bin/commons-logging-api.jar").exists())
{
+            for (Iterator iter = config.getSharedDependencies().iterator(); iter.hasNext();)
{
+                File dep = (File) iter.next();
+                if (dep.getPath().contains("commons-logging-api")) {
+                    iter.remove();
+                }
+            }
+        }
+        return new File(installationDirectory, "shared/lib");
+    }
+
+    protected File getWebAppDir(InstallationConfig config) {
+        File installationDirectory = config.getInstallationDirectory();
+        return new File(
+            installationDirectory, config.getServerConfig().getDomain()
+        );
+    }
+
+//
+// Helpers
+//
+
+    protected File getConfigurationDir(InstallationConfig config) {
+        File installationDirectory = config.getInstallationDirectory();
+        String engine = "Catalina";
+        String host   = config.getServerConfig().getHost();
+        return new File(installationDirectory, "conf/"+engine+"/"+host);
+    }
+
+    private String getPortalApplicationConfig(InstallationConfig config) {
+        String war = "../"+config.getServerConfig().getDomain() +
+                "/" +  config.getPortalApplication().getName();
+        String contextPath = config.getPortalContextPath();
+        return getConfigContents(war, contextPath);
+    }
+
+    private String getPortletApplicationConfig(String contextPath, String file) {
+        return getConfigContents(file, contextPath);
+    }
+
+    private String getConfigContents(String war, String contextPath) {
+        StringBuffer contents = new StringBuffer();
+        contents.append("<Context ")
+                .append("path=\"").append(contextPath).append("\" ")
+                .append("docBase=\"").append(war).append("\" ")
+                .append("crossContext=\"true\">").append("</Context>");
+       return contents.toString();
+    }
+}

Propchange: portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat5/Tomcat5FileSystemInstaller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/pluto/trunk/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat6/Tomcat6FileSystemInstaller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/pluto/trunk/pluto-util/src/resources/configure_1_3.dtd
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-util/src/resources/configure_1_3.dtd?rev=607450&r1=607449&r2=607450&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-util/src/resources/configure_1_3.dtd (original)
+++ portals/pluto/trunk/pluto-util/src/resources/configure_1_3.dtd Sat Dec 29 09:31:56 2007
@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
+<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
 -->
 <!--
 This is the document type descriptor for the

Propchange: portals/pluto/trunk/pluto-util/src/resources/configure_1_3.dtd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/pluto/trunk/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message