You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by cd...@apache.org on 2007/08/04 16:41:49 UTC
svn commit: r562725 [27/33] - in
/portals/pluto/branches/1.1-286-trunk-merge: ./ assembly/ assembly/src/
assembly/src/main/ assembly/src/main/assembly/ assembly/src/main/resources/
maven-pluto-plugin/ maven-pluto-plugin/src/ maven-pluto-plugin/src/main...
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/io/JarStreamingAssembly.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/io/JarStreamingAssembly.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/io/JarStreamingAssembly.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/io/JarStreamingAssembly.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,169 @@
+/*
+ * 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.assemble.io;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+import java.util.zip.CRC32;
+import java.util.zip.ZipEntry;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.util.assemble.Assembler;
+
+/**
+ * Utility class responsible for accepting a JarInputStream representing a web application archive,
+ * iterating over each JarEntry in the input stream and assembling the WAR web.xml for portlet
+ * deployment.
+ */
+public class JarStreamingAssembly {
+
+ private static final Log LOG = LogFactory.getLog( JarStreamingAssembly.class );
+
+ /**
+ * Reads the source JarInputStream, copying entries to the destination JarOutputStream.
+ * The web.xml and portlet.xml are cached, and after the entire archive is copied
+ * (minus the web.xml) a re-written web.xml is generated and written to the
+ * destination JAR.
+ *
+ * @param source the WAR source input stream
+ * @param dest the WAR destination output stream
+ * @param dispatchServletClass the name of the dispatch class
+ * @throws IOException
+ */
+ public static void assembleStream(JarInputStream source, JarOutputStream dest, String dispatchServletClass) throws IOException {
+
+ try {
+ //Need to buffer the web.xml and portlet.xml files for the rewritting
+ JarEntry servletXmlEntry = null;
+ byte[] servletXmlBuffer = null;
+ byte[] portletXmlBuffer = null;
+
+ JarEntry originalJarEntry;
+
+ //Read the source archive entry by entry
+ while ((originalJarEntry = source.getNextJarEntry()) != null) {
+
+ final JarEntry newJarEntry = smartClone(originalJarEntry);
+ originalJarEntry = null;
+
+ //Capture the web.xml JarEntry and contents as a byte[], don't write it out now or
+ //update the CRC or length of the destEntry.
+ if (Assembler.SERVLET_XML.equals(newJarEntry.getName())) {
+ servletXmlEntry = newJarEntry;
+ servletXmlBuffer = IOUtils.toByteArray(source);
+ }
+
+ //Capture the portlet.xml contents as a byte[]
+ else if (Assembler.PORTLET_XML.equals(newJarEntry.getName())) {
+ portletXmlBuffer = IOUtils.toByteArray(source);
+ dest.putNextEntry(newJarEntry);
+ IOUtils.write(portletXmlBuffer, dest);
+ }
+
+ //Copy all other entries directly to the output archive
+ else {
+ dest.putNextEntry(newJarEntry);
+ IOUtils.copy(source, dest);
+ }
+
+ dest.closeEntry();
+ dest.flush();
+
+ }
+
+ // If no portlet.xml was found in the archive, skip the assembly step.
+ if (portletXmlBuffer != null) {
+ // container for assembled web.xml bytes
+ final byte[] webXmlBytes;
+
+ // Checks to make sure the web.xml was found in the archive
+ if (servletXmlBuffer == null) {
+ throw new FileNotFoundException("File '" + Assembler.SERVLET_XML + "' could not be found in the source input stream.");
+ }
+
+ //Create streams of the byte[] data for the updater method
+ final InputStream webXmlIn = new ByteArrayInputStream(servletXmlBuffer);
+ final InputStream portletXmlIn = new ByteArrayInputStream(portletXmlBuffer);
+ final ByteArrayOutputStream webXmlOut = new ByteArrayOutputStream(servletXmlBuffer.length);
+
+ //Update the web.xml
+ WebXmlStreamingAssembly.assembleStream(webXmlIn, portletXmlIn, webXmlOut, dispatchServletClass);
+ IOUtils.copy( webXmlIn, webXmlOut );
+ webXmlBytes = webXmlOut.toByteArray();
+
+ //If no compression is being used (STORED) we have to manually update the size and crc
+ if (servletXmlEntry.getMethod() == ZipEntry.STORED) {
+ servletXmlEntry.setSize(webXmlBytes.length);
+ final CRC32 webXmlCrc = new CRC32();
+ webXmlCrc.update(webXmlBytes);
+ servletXmlEntry.setCrc(webXmlCrc.getValue());
+ }
+
+ //write out the assembled web.xml entry and contents
+ dest.putNextEntry(servletXmlEntry);
+ IOUtils.write(webXmlBytes, dest);
+
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug( "Jar stream " + source + " successfully assembled." );
+ }
+ } else {
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug( "No portlet XML file was found, assembly was not required." );
+ }
+
+ //copy the original, unmodified web.xml entry to the destination
+ dest.putNextEntry(servletXmlEntry);
+ IOUtils.write(servletXmlBuffer, dest);
+
+ if ( LOG.isDebugEnabled() ) {
+ LOG.debug( "Jar stream " + source + " successfully assembled." );
+ }
+ }
+
+ } finally {
+
+ dest.flush();
+ dest.close();
+
+ }
+ }
+
+ private static JarEntry smartClone(JarEntry originalJarEntry) {
+ final JarEntry newJarEntry = new JarEntry(originalJarEntry.getName());
+ newJarEntry.setComment(originalJarEntry.getComment());
+ newJarEntry.setExtra(originalJarEntry.getExtra());
+ newJarEntry.setMethod(originalJarEntry.getMethod());
+ newJarEntry.setTime(originalJarEntry.getTime());
+
+ //Must set size and CRC for STORED entries
+ if (newJarEntry.getMethod() == ZipEntry.STORED) {
+ newJarEntry.setSize(originalJarEntry.getSize());
+ newJarEntry.setCrc(originalJarEntry.getCrc());
+ }
+
+ return newJarEntry;
+ }
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/io/WebXmlStreamingAssembly.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/io/WebXmlStreamingAssembly.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/io/WebXmlStreamingAssembly.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/io/WebXmlStreamingAssembly.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,103 @@
+/*
+ * 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.assemble.io;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Iterator;
+
+import org.apache.pluto.descriptors.common.InitParamDD;
+import org.apache.pluto.descriptors.portlet.PortletAppDD;
+import org.apache.pluto.descriptors.portlet.PortletDD;
+import org.apache.pluto.descriptors.services.PortletAppDescriptorService;
+import org.apache.pluto.descriptors.services.WebAppDescriptorService;
+import org.apache.pluto.descriptors.services.castor.PortletAppDescriptorServiceImpl;
+import org.apache.pluto.descriptors.services.castor.WebAppDescriptorServiceImpl;
+import org.apache.pluto.descriptors.servlet.LoadOnStartupDD;
+import org.apache.pluto.descriptors.servlet.ServletDD;
+import org.apache.pluto.descriptors.servlet.ServletMappingDD;
+import org.apache.pluto.descriptors.servlet.WebAppDD;
+import org.apache.pluto.util.assemble.Assembler;
+
+/**
+ * Utility class responsible for accepting web.xml and portlet.xml as InputStreams, and assembling
+ * the web.xml to an OutputStream.
+ */
+public class WebXmlStreamingAssembly {
+
+ /**
+ * Assembles the web.xml represented by the <code>InputStream</code>.
+ *
+ * @param webXmlIn the unassembled web.xml file
+ * @param portletXmlIn the corresponding portlet.xml file
+ * @param assembledWebXmlOut the assembled web.xml file
+ * @param dispatchServletClass the dispatch servlet
+ * @throws IOException
+ */
+ public static void assembleStream(InputStream webXmlIn,
+ InputStream portletXmlIn,
+ OutputStream assembledWebXmlOut,
+ String dispatchServletClass)
+ throws IOException {
+ if (dispatchServletClass == null ||
+ dispatchServletClass.length() == 0 ||
+ dispatchServletClass.trim().length() == 0) {
+ dispatchServletClass = Assembler.DISPATCH_SERVLET_CLASS;
+ }
+
+ WebAppDescriptorService descriptorSvc = new WebAppDescriptorServiceImpl();
+ PortletAppDescriptorService portletAppDescriptorSvc = new PortletAppDescriptorServiceImpl();
+
+ WebAppDD webAppDDIn = descriptorSvc.read(webXmlIn);
+ PortletAppDD portletAppDD = portletAppDescriptorSvc.read(portletXmlIn);
+ portletXmlIn.close();
+
+ for (Iterator it = portletAppDD.getPortlets().iterator();
+ it.hasNext(); ) {
+
+ // Read portlet definition.
+ PortletDD portlet = (PortletDD) it.next();
+ String name = portlet.getPortletName();
+
+ ServletDD servlet = new ServletDD();
+ servlet.setServletName(name);
+
+ servlet.setServletClass(dispatchServletClass);
+
+ InitParamDD initParam = new InitParamDD();
+ initParam.setParamName("portlet-name");
+ initParam.setParamValue(name);
+ servlet.getInitParams().add(initParam);
+
+ LoadOnStartupDD onStartup = new LoadOnStartupDD();
+ onStartup.setPriority(1);
+ servlet.setLoadOnStartup(onStartup);
+
+ ServletMappingDD servletMapping = new ServletMappingDD();
+ servletMapping.setServletName(name);
+ servletMapping.setUrlPattern("/PlutoInvoker/" + name);
+
+ webAppDDIn.getServlets().add(servlet);
+ webAppDDIn.getServletMappings().add(servletMapping);
+
+ }
+
+ descriptorSvc.write(webAppDDIn, assembledWebXmlOut);
+
+ }
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/war/WarAssembler.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/war/WarAssembler.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/war/WarAssembler.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/assemble/war/WarAssembler.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,78 @@
+/*
+ * 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.assemble.war;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+
+import org.apache.pluto.util.UtilityException;
+import org.apache.pluto.util.assemble.AbstractArchiveAssembler;
+import org.apache.pluto.util.assemble.AssemblerConfig;
+import org.apache.pluto.util.assemble.io.JarStreamingAssembly;
+
+/**
+ *
+ * @version 1.0
+ * @since Nov 8, 2004
+ */
+public class WarAssembler extends AbstractArchiveAssembler {
+ // Constructor -------------------------------------------------------------
+
+ /**
+ * Default no-arg constructor.
+ */
+ public WarAssembler() {
+ // Do nothing.
+ }
+
+
+ // Assembler Impl ----------------------------------------------------------
+
+ public void assembleInternal(AssemblerConfig config)
+ throws UtilityException, IOException {
+
+ this.assembleWar(config.getSource(), config.getDestination(), config.getDispatchServletClass());
+
+ }
+
+ /**
+ * Reads the source JAR copying entries to the dest JAR. The web.xml and portlet.xml are cached
+ * and after the entire archive is copied (minus the web.xml) a re-written web.xml is generated
+ * and written to the destination JAR.
+ */
+ protected void assembleWar(File source, File dest, String dispatchServletClass) throws IOException {
+ final JarInputStream jarIn = new JarInputStream(new FileInputStream(source));
+ //Create the output JAR stream, copying the Manifest
+ final Manifest manifest = jarIn.getManifest();
+ //TODO add pluto notes to the Manifest?
+ final JarOutputStream jarOut = new JarOutputStream(new FileOutputStream(dest), manifest);
+
+ try {
+ JarStreamingAssembly.assembleStream(jarIn, jarOut, dispatchServletClass);
+ } finally {
+ jarIn.close();
+ jarOut.close();
+ }
+ }
+
+}
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/cli/AssemblerCLI.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/cli/AssemblerCLI.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/cli/AssemblerCLI.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/cli/AssemblerCLI.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,118 @@
+/*
+ * 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.cli;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.Option;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.PosixParser;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.pluto.util.assemble.Assembler;
+import org.apache.pluto.util.assemble.AssemblerFactory;
+import org.apache.pluto.util.assemble.AssemblerConfig;
+import org.apache.pluto.util.UtilityException;
+
+/**
+ * Command Line Interface to the Pluto Assembler.
+ *
+ * @version 1.0
+ * @since Oct 15, 2004
+ */
+public class AssemblerCLI {
+
+ private Options options;
+ private String[] args;
+
+ public AssemblerCLI(String[] args) {
+ this.args = args;
+ options = new Options();
+ Option destination =
+ new Option("d" , "destination", true,
+ "specify where the resulting webapp should be written ");
+ destination.setArgName("file");
+
+ Option debug =
+ new Option("debug", false, "print debug information.");
+ options.addOption(destination);
+ options.addOption(debug);
+ }
+
+ public void run() throws ParseException, IOException, UtilityException {
+ CommandLineParser parser = new PosixParser();
+ CommandLine line = parser.parse(options, args);
+
+ String[] args = line.getArgs();
+ if(args.length != 1) {
+ abort();
+ return;
+ }
+
+ String dest = line.getOptionValue("file");
+ if(dest == null) {
+ dest = args[0];
+ }
+
+ File source = new File(args[0]);
+ File result = new File(dest);
+ result.getParentFile().mkdirs();
+
+ if(!source.exists()) {
+ System.out.println("File does not exist: "+source.getCanonicalPath());
+ }
+
+
+ System.out.println("-----------------------------------------------");
+ System.out.println("Assembling: "+source.getCanonicalPath());
+ System.out.println(" to: "+result.getCanonicalPath());
+
+ File webXml = new File(args[0], Assembler.SERVLET_XML);
+ File portletXml = new File(args[0], Assembler.PORTLET_XML);
+
+ AssemblerConfig config = new AssemblerConfig();
+ config.setWebappDescriptor(webXml);
+ config.setPortletDescriptor(portletXml);
+ config.setDestination(webXml);
+
+ Assembler assembler = AssemblerFactory.getFactory()
+ .createAssembler(config);
+
+ config.setPortletDescriptor(portletXml);
+ config.setWebappDescriptor(webXml);
+
+ assembler.assemble(config);
+
+ System.out.println("Complete!");
+ }
+
+ public void abort() {
+ HelpFormatter help = new HelpFormatter();
+ help.defaultArgName = "webapp";
+ help.defaultWidth = 60;
+ help.printHelp("assemble", options);
+ }
+
+ public static void main(String[] args)
+ throws ParseException, IOException, UtilityException {
+ new AssemblerCLI(args).run();
+ }
+}
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/InstallationConfig.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/InstallationConfig.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/InstallationConfig.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/InstallationConfig.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,116 @@
+/*
+ * 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;
+
+import org.apache.pluto.util.install.ServerConfig;
+
+import java.util.List;
+import java.util.Map;
+import java.io.File;
+
+/**
+ * The installation configuration used to install Pluto to servlet container.
+ */
+public class InstallationConfig {
+
+ /**
+ * A list of depdencies that are shared amoungst web applications.
+ */
+ private List sharedDependencies;
+
+ /**
+ * A list of dependencies are are shared amoungst web applications.
+ */
+ private List endorsedDependencies;
+
+ /**
+ * A list of war files which are to be considered portal dependencies.
+ */
+ private Map portletApplications;
+
+ /**
+ * The location of the portal application being installed.
+ */
+ private File portalApplication;
+
+ /**
+ * The installation directory.
+ */
+ private File installationDirectory;
+
+ private String portalContextPath;
+
+ private ServerConfig serverConfig;
+
+
+ public List getSharedDependencies() {
+ return sharedDependencies;
+ }
+
+ public void setSharedDependencies(List sharedDependencies) {
+ this.sharedDependencies = sharedDependencies;
+ }
+
+ public List getEndorsedDependencies() {
+ return endorsedDependencies;
+ }
+
+ public void setEndorsedDependencies(List endorsedDependencies) {
+ this.endorsedDependencies = endorsedDependencies;
+ }
+
+ public Map getPortletApplications() {
+ return portletApplications;
+ }
+
+ public void setPortletApplications(Map portletApplications) {
+ this.portletApplications = portletApplications;
+ }
+
+ public File getPortalApplication() {
+ return portalApplication;
+ }
+
+ public void setPortalApplication(File portalApplication) {
+ this.portalApplication = portalApplication;
+ }
+
+ public File getInstallationDirectory() {
+ return installationDirectory;
+ }
+
+ public void setInstallationDirectory(File installationDirectory) {
+ this.installationDirectory = installationDirectory;
+ }
+
+ public String getPortalContextPath() {
+ return portalContextPath;
+ }
+
+ public void setPortalContextPath(String portalContextPath) {
+ this.portalContextPath = portalContextPath;
+ }
+
+ public ServerConfig getServerConfig() {
+ return serverConfig;
+ }
+
+ public void setServerConfig(ServerConfig serverConfig) {
+ this.serverConfig = serverConfig;
+ }
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/PortalInstaller.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/PortalInstaller.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/PortalInstaller.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/PortalInstaller.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+import org.apache.pluto.util.UtilityException;
+
+import java.io.File;
+
+public interface PortalInstaller {
+
+ void install(InstallationConfig config) throws UtilityException, UtilityException;
+
+ void uninstall(InstallationConfig config) throws UtilityException;
+
+ boolean isValidInstallationDirectory(File installDir);
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/PortalInstallerFactory.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/PortalInstallerFactory.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/PortalInstallerFactory.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/PortalInstallerFactory.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,80 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.apache.pluto.util.install.file.jetty.Jetty5FileSystemInstaller;
+import org.apache.pluto.util.install.file.tomcat5.Tomcat5FileSystemInstaller;
+import org.apache.pluto.util.install.file.tomcat6.Tomcat6FileSystemInstaller;
+
+/**
+ *
+ *
+ */
+public abstract class PortalInstallerFactory {
+
+ private static final ArrayList HANDLERS = new ArrayList();
+
+ static {
+ HANDLERS.add(new Tomcat6FileSystemInstaller());
+ HANDLERS.add(new Tomcat5FileSystemInstaller());
+ HANDLERS.add(new Jetty5FileSystemInstaller());
+ }
+
+ public static PortalInstaller getAppServerHandler(File installDir) {
+ String className = System.getProperty(PortalInstallerFactory.class.getName());
+ PortalInstaller installer = null;
+ if (className != null) {
+ installer = getHandler(className, installDir);
+ } else {
+ installer = findHandler(installDir);
+ }
+ return installer;
+ }
+
+ private static PortalInstaller getHandler(String className, File installDir) {
+ PortalInstaller ash;
+ try {
+ Class cl = Class.forName(className);
+ ash = (PortalInstaller)cl.newInstance();
+ if(ash.isValidInstallationDirectory(installDir)) {
+ return ash;
+ }
+ else {
+ throw new Exception("Invalid installation directory for handler: "+className);
+ }
+ }
+ catch(Exception e) {
+ throw new RuntimeException("Unable to instantiate class: "+className, e);
+ }
+ }
+
+ private static PortalInstaller findHandler(File installDir) {
+ Iterator it = HANDLERS.iterator();
+ while(it.hasNext()) {
+ PortalInstaller ash = (PortalInstaller)it.next();
+ if(ash.isValidInstallationDirectory(installDir)) {
+ return ash;
+ }
+ }
+ throw new RuntimeException("Unable to locate appropriate app server handler for: "+installDir.getAbsolutePath());
+ }
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/ServerConfig.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/ServerConfig.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/ServerConfig.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/ServerConfig.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,60 @@
+/*
+ * 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;
+
+/**
+ *
+ */
+public class ServerConfig {
+
+ private String domain = "MyDomain";
+ private String server = "MyServer";
+ private String host = "localhost";
+ private int port = 8080;
+
+ public String getDomain() {
+ return domain;
+ }
+
+ public void setDomain(String domain) {
+ this.domain = domain;
+ }
+
+ public String getServer() {
+ return server;
+ }
+
+ public void setServer(String server) {
+ this.server = server;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ public int getPort() {
+ return port;
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/FileSystemInstaller.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/FileSystemInstaller.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/FileSystemInstaller.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/FileSystemInstaller.java Sat Aug 4 07:41:23 2007
@@ -0,0 +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);
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/TomcatCrossContextGenerator.java Sat Aug 4 07:41:23 2007
@@ -0,0 +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;
+ }
+ }
+
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Call.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Call.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Call.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Call.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed 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;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: dxd0
+ * Date: Nov 11, 2005
+ * Time: 9:33:36 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class Call {
+
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Configure.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Configure.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Configure.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Configure.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed 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;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: dxd0
+ * Date: Nov 11, 2005
+ * Time: 9:32:49 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class Configure {
+
+ private String klass;
+
+ public String getKlass() {
+ return klass;
+ }
+
+ public void setKlass(String klass) {
+ this.klass = klass;
+ }
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Jetty5FileSystemInstaller.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Jetty5FileSystemInstaller.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Jetty5FileSystemInstaller.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/jetty/Jetty5FileSystemInstaller.java Sat Aug 4 07:41:23 2007
@@ -0,0 +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;
+ }
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat5/Tomcat5FileSystemInstaller.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat5/Tomcat5FileSystemInstaller.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat5/Tomcat5FileSystemInstaller.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat5/Tomcat5FileSystemInstaller.java Sat Aug 4 07:41:23 2007
@@ -0,0 +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();
+ }
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat6/Tomcat6FileSystemInstaller.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat6/Tomcat6FileSystemInstaller.java?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat6/Tomcat6FileSystemInstaller.java (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/main/java/org/apache/pluto/util/install/file/tomcat6/Tomcat6FileSystemInstaller.java Sat Aug 4 07:41:23 2007
@@ -0,0 +1,51 @@
+/*
+ * 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.tomcat6;
+
+import java.io.File;
+
+import org.apache.pluto.util.install.InstallationConfig;
+import org.apache.pluto.util.install.file.tomcat5.Tomcat5FileSystemInstaller;
+
+public class Tomcat6FileSystemInstaller extends Tomcat5FileSystemInstaller
+{
+
+ public boolean isValidInstallationDirectory( File installDir )
+ {
+ // Tomcat 6 - by default - does away with the classloader
+ // directories <tomcat>/server, <tomcat>/common, and <tomcat>/shared.
+ // Everything by default is installed under <tomcat>/lib.
+ File libDir = new File( installDir, "lib" );
+ File serverConf = new File( installDir, "conf/server.xml" );
+ File catalinaProps = new File( installDir, "conf/catalina.properties" );
+
+ return libDir.exists() && serverConf.exists() && catalinaProps.exists();
+ }
+
+ protected File getEndorsedDir( InstallationConfig config )
+ {
+ // Tomcat 6 uses <tomcat>/endorsed
+ return new File( config.getInstallationDirectory(), "endorsed" );
+ }
+
+ protected File getSharedDir( InstallationConfig config )
+ {
+ // Tomcat 6, by default, uses <tomcat>/lib
+ return new File( config.getInstallationDirectory(), "lib" );
+ }
+
+}
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/resources/configure_1_3.dtd
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/resources/configure_1_3.dtd?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/resources/configure_1_3.dtd (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto-util/src/resources/configure_1_3.dtd Sat Aug 4 07:41:23 2007
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright 2005-2006 The Apache Software Foundation
+
+ Licensed 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.
+-->
+<!--
+This is the document type descriptor for the
+org.mortbay.util.XmlConfiguration class. It allows a java object to be
+configured by with a sequence of Set, Put and Call elements. These tags are
+mapped to methods on the object to be configured as follows:
+
+ <Set name="Test">value</Set> == obj.setTest("value");
+ <Put name="Test">value</Put> == obj.put("Test","value");
+ <Call name="test"><Arg>value</Arg></Call> == obj.test("value");
+
+Values themselves may be configured objects that are created with the
+<New> tag or returned from a <Call> tag.
+
+Values are matched to arguments on a best effort approach, but types
+my be specified if a match is not achieved.
+
+$Id: configure_1_3.dtd,v 1.6 2005/03/29 12:02:50 gregwilkins Exp $
+-->
+
+<!ENTITY % CONFIG "Get|Set|Put|Call|New|Ref">
+<!ENTITY % VALUE "#PCDATA|Call|New|Get|SystemProperty|Array|Ref">
+
+<!ENTITY % TYPEATTR "type CDATA #IMPLIED " > <!-- String|Character|Short|Byte|Integer|Long|Boolean|Float|Double|char|short|byte|int|long|boolean|float|double|URL|InetAddress|InetAddrPort| #classname -->
+<!ENTITY % IMPLIEDCLASSATTR "class NMTOKEN #IMPLIED" >
+<!ENTITY % CLASSATTR "class NMTOKEN #REQUIRED" >
+<!ENTITY % NAMEATTR "name NMTOKEN #REQUIRED" >
+<!ENTITY % DEFAULTATTR "default CDATA #IMPLIED" >
+<!ENTITY % IDATTR "id NMTOKEN #IMPLIED" >
+<!ENTITY % REQUIREDIDATTR "id NMTOKEN #REQUIRED" >
+<!--
+Configure Element.
+This is the root element that specifies the class of object that
+can be configured:
+
+ <Configure class="com.acme.MyClass"> ... </Configure>
+
+A Configure element can contain Set, Put or Call elements.
+-->
+<!ELEMENT Configure (%CONFIG;)* >
+<!ATTLIST Configure %IMPLIEDCLASSATTR; %IDATTR; >
+
+
+<!--
+Set Element.
+This element maps to a call to a set method on the current object.
+The name and optional type attributes are used to select the set
+method. If the name given is xxx, then a setXxx method is used, or
+the xxx field is used of setXxx cannot be found.
+A Set element can contain value text and/or the value elements Call,
+New and SystemProperty. If no value type is specified, then white
+space is trimmed out of the value. If it contains multiple value
+elements they are added as strings before being converted to any
+specified type.
+
+A Set with a class attribute is treated as a static set method invocation.
+-->
+<!ELEMENT Set ( %VALUE; )* >
+<!ATTLIST Set %NAMEATTR; %TYPEATTR; %IMPLIEDCLASSATTR; >
+
+
+<!--
+Get Element.
+This element maps to a call to a get method or field on the current object.
+The name attribute is used to select the get method.
+If the name given is xxx, then a getXxx method is used, or
+the xxx field is used of setXxx cannot be found.
+A Get element can contain Set, Put and/or Call elements which act on the object
+returned by the get call.
+
+A Get with a class attribute is treated as a static get method or field.
+-->
+<!ELEMENT Get (%CONFIG;)*>
+<!ATTLIST Get %NAMEATTR; %IMPLIEDCLASSATTR; %IDATTR; >
+
+<!--
+Put Element.
+This element maps to a call to a put method on the current object,
+which must implement the Map interface. The name attribute is used
+as the put key and the optional type attribute can force the type
+of the value.
+
+A Put element can contain value text and/or the value elements Call,
+New and SystemProperty. If no value type is specified, then white
+space is trimmed out of the value. If it contains multiple value
+elements they are added as strings before being converted to any
+specified type.
+-->
+<!ELEMENT Put ( %VALUE; )* >
+<!ATTLIST Put %NAMEATTR; %TYPEATTR; >
+
+
+<!--
+Call Element.
+This element maps to an arbitrary call to a method on the current object,
+The name attribute and Arg elements are used to select the method.
+
+A Call element can contain a sequence of Arg elements followed by
+a sequence of Set, Put and/or Call elements which act on any object
+returned by the original call:
+
+ <Call name="test"><Arg>value1</Arg><Set name="Test">Value2</Set></Call>
+
+This is equivalent to:
+
+ Object o2 = o1.test("value1");
+ o2.setTest("value2");
+
+A Call with a class attribute is treated as a static call.
+
+-->
+<!ELEMENT Call (Arg*,(%CONFIG;)*)>
+<!ATTLIST Call %NAMEATTR; %IMPLIEDCLASSATTR; %IDATTR;>
+
+
+<!--
+Arg Element.
+This element defines a positional argument for the Call element.
+The optional type attribute can force the type of the value.
+
+An Arg element can contain value text and/or the value elements Call,
+New and SystemProperty. If no value type is specified, then white
+space is trimmed out of the value. If it contains multiple value
+elements they are added as strings before being converted to any
+specified type.
+-->
+<!ELEMENT Arg ( %VALUE; )* >
+<!ATTLIST Arg %TYPEATTR; >
+
+
+
+<!--
+New Element.
+This element allows the creation of a new object as part of a
+value of a Set, Put or Arg element. The class attribute determines
+the type of the new object and the contained Arg elements
+are used to select the constructor for the new object.
+
+A New element can contain a sequence of Arg elements followed by
+a sequence of Set, Put and/or Call elements which act on the new object:
+
+ <New class="com.acme.MyClass">
+ <Arg>value1</Arg><Set name="Test">Value2</Set>
+ </New>
+
+This is equivalent to:
+
+ Object o = new com.acme.MyClass("value1");
+ o.setTest("value2");
+
+-->
+<!ELEMENT New (Arg*,(%CONFIG;)*)>
+<!ATTLIST New %CLASSATTR; %IDATTR;>
+
+<!--
+Ref Element.
+This element allows a previously created object to be reference by id.
+
+A Ref element can contain a sequence of Set, Put and/or Call elements
+which act on the referenced object:
+
+ <Ref id="myobject">
+ <Set name="Test">Value2</Set>
+ </New>
+
+-->
+<!ELEMENT Ref ((%CONFIG;)*)>
+<!ATTLIST Ref %REQUIREDIDATTR;>
+
+<!--
+Array Element.
+This element allows the creation of a new array as part of a
+value of a Set, Put or Arg element. The type attribute determines
+the type of the new array and the contained Item elements
+are used for each element of the array
+
+ <Array type="java.lang.String">
+ <Item>value0</Arg>
+ <Item><New class="java.lang.String"><Arg>value1</Arg></New></Item>
+ </Array>
+
+This is equivalent to:
+ String[] a = new String[] { "value0", new String("value1") };
+
+-->
+<!ELEMENT Array (Item*)>
+<!ATTLIST Array %TYPEATTR; %IDATTR; >
+
+
+<!--
+Item Element.
+This element defines a positional argument for the Array element.
+The optional type attribute can force the type of the value.
+
+An Item element can contain value text and/or the value elements Call,
+New and SystemProperty. If no value type is specified, then white
+space is trimmed out of the value. If it contains multiple value
+elements they are added as strings before being converted to any
+specified type.
+-->
+<!ELEMENT Item ( %VALUE; )* >
+<!ATTLIST Item %TYPEATTR; %IDATTR; >
+
+
+<!--
+System Property Element.
+This element allows JVM System properties to be retrieved as
+part of the value of a Set, Put or Arg element.
+The name attribute specifies the property name and the optional
+default argument provides a default value.
+
+ <SystemProperty name="Test" default="value"/>
+
+This is equivalent to:
+
+ System.getProperty("Test","value");
+
+-->
+<!ELEMENT SystemProperty EMPTY>
+<!ATTLIST SystemProperty %NAMEATTR; %DEFAULTATTR; %IDATTR;>
+
+
+
Added: portals/pluto/branches/1.1-286-trunk-merge/pluto.nsi
URL: http://svn.apache.org/viewvc/portals/pluto/branches/1.1-286-trunk-merge/pluto.nsi?view=auto&rev=562725
==============================================================================
--- portals/pluto/branches/1.1-286-trunk-merge/pluto.nsi (added)
+++ portals/pluto/branches/1.1-286-trunk-merge/pluto.nsi Sat Aug 4 07:41:23 2007
@@ -0,0 +1,107 @@
+; Pluto script for Nullsoft Installer
+; $Id: pluto.nsi,v 1 2005/07/28 14:17:51 ddewolf Exp $
+
+ ;Compression options
+ CRCCheck on
+ SetCompress force
+ SetCompressor lzma
+ SetDatablockOptimize on
+
+ Name "Apache Pluto"
+ OutFile "portals-pluto.exe" ; The name of the unistaller file to write
+
+ ;Product information
+ VIAddVersionKey ProductName "Apache Pluto"
+ VIAddVersionKey CompanyName "Apache Software Foundation"
+ VIAddVersionKey LegalCopyright "Copyright (c) 1999-2005 The Apache Software Foundation"
+ VIAddVersionKey FileDescription "Apache Pluto Installer"
+ VIAddVersionKey FileVersion "2.0"
+ VIAddVersionKey ProductVersion "1.1.0"
+ VIAddVersionKey Comments "portals.apache.org/pluto"
+ VIAddVersionKey InternalName "portals-pluto-1.1.0.exe"
+ VIProductVersion 1.1.0.0
+
+!include "MUI.nsh"
+
+;---------------------------------
+;Installer Look and Feel Config
+; !define MUI_HEADERIMAGE
+; !define MUI_HEADERIMAGE_RIGHT
+; !define MUI_HEADERIMAGE_BITMAP header.bmp
+; !define MUI_WELCOMEFINISHPAGE_BITMAP side_left.bmp
+; !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README"
+; !define MUI_FINISHPAGE_RUN $INSTDIR\bin\startup.bat
+;
+; !define MUI_ABORTWARNING
+;
+; ;Install Page order
+; !insertmacro MUI_PAGE_WELCOME
+; !insertmacro MUI_PAGE_LICENSE README
+; !insertmacro MUI_PAGE_COMPONENTS
+; !insertmacro MUI_PAGE_DIRECTORY
+; !insertmacro MUI_PAGE_INSTFILES
+; !insertmacro MUI_PAGE_FINISH
+;
+; LicenseData README
+
+; Set prompt text for select components window and select directory window
+ComponentText "Select Pluto components to install."
+DirText "Select the Tomcat installation directory."
+
+; --------- Install the Portlet Container
+Section "Pluto Portlet Container (required)"
+
+ SetOutPath $INSTDIR\shared\lib ; Tomcat Shared Libaries
+ File pluto-descriptor-api\target\pluto-descriptor-api-1.1-SNAPSHOT.jar
+ File pluto-descriptor-impl\target\pluto-descriptor-impl-1.1-SNAPSHOT.jar
+ File pluto-container\target\pluto-container-1.1-SNAPSHOT.jar
+ ;File castor-0.9.6.jar
+ ;File portlet-api-1.0.jar
+
+ SetOutPath $INSTDIR\common\endorsed
+ ;File xercesImpl-2.6.2.jar
+ ;File xml-apis-1.0.b2.jar
+ ;File xmlParserAPIs-2.6.2.jar
+
+SectionEnd
+
+; --------- Install the Portal ----------
+Section "Pluto Portal Driver"
+
+ SetOutPath $INSTDIR\webapps
+ File "pluto-portal\target\pluto-portal.war"
+ ;File "\oname=pluto-portal.war" "pluto-portal\target\pluto-portal.war"
+
+ SetOutPath $INSTDIR\conf\Catalina\localhost
+ File "pluto-portal\src\main\resources\pluto.xml"
+
+SectionEnd
+
+; --------- Install the Deployer ----------
+Section "Pluto Portal Driver"
+
+ ; Execute the Deployer Installer!
+
+SectionEnd
+
+; --------- Install the TestSuite ----------
+Section "Pluto TestSuite"
+
+ SetOutPath $INSTDIR\webapps
+ File "pluto-testsuite\target\pluto-testsuite.war"
+
+ SetOutPath $INSTDIR\conf\Catalina\localhost
+ File "pluto-testsuite\src\main\resources\testsuite.xml"
+
+SectionEnd
+
+; ---------- Functions ---------
+ Function .onVerifyInstDir
+ IfFileExists $INSTDIR\bin\tomcat5.exe PathGood
+ Abort ; if $INSTDIR is not a winamp directory, don't let us install there
+ PathGood:
+ FunctionEnd
+
+; eof
+
+