You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2008/04/01 00:06:45 UTC

svn commit: r643173 - in /ofbiz/trunk/framework/appserver: ./ src/org/ofbiz/appservers/ templates/wasce2/

Author: jleroux
Date: Mon Mar 31 15:06:42 2008
New Revision: 643173

URL: http://svn.apache.org/viewvc?rev=643173&view=rev
Log:
A 1st operational version of a tool which allows running OFBiz under IBM Websphere Application Server Community Edition 2 (WASCE)

Added:
    ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateGeronimoDeployment.java   (with props)
    ofbiz/trunk/framework/appserver/templates/wasce2/
    ofbiz/trunk/framework/appserver/templates/wasce2/README   (with props)
    ofbiz/trunk/framework/appserver/templates/wasce2/application.xml   (with props)
    ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-application.xml   (with props)
    ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-web.xml   (with props)
Modified:
    ofbiz/trunk/framework/appserver/README
    ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateContainer.java

Modified: ofbiz/trunk/framework/appserver/README
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/README?rev=643173&r1=643172&r2=643173&view=diff
==============================================================================
--- ofbiz/trunk/framework/appserver/README (original)
+++ ofbiz/trunk/framework/appserver/README Mon Mar 31 15:06:42 2008
@@ -1,5 +1,5 @@
-
-To generate configuration files from the templates in a sub-directory of the templates directory just run something like (from the ofbiz.home directory):
+For Websphere community edition or Geronimo refer to the Guidelines in the OFBiz documentation : http://docs.ofbiz.org/x/Ah
+Else to generate configuration files from the templates in a sub-directory of the templates directory just run something like (from the ofbiz.home directory):
 
 java -jar ofbiz.jar -setup test
 

Modified: ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateContainer.java?rev=643173&r1=643172&r2=643173&view=diff
==============================================================================
--- ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateContainer.java (original)
+++ ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateContainer.java Mon Mar 31 15:06:42 2008
@@ -6,9 +6,9 @@
  * 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
@@ -21,6 +21,8 @@
 
 import java.util.Map;
 import java.util.List;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.io.*;
 
@@ -39,19 +41,20 @@
  * GenerateContainer - Generates Configuration Files For Application Servers
  * ** This container requires StartInfoLoader to be loaded at startup.
  * ** This container requires the ComponentContainer to be loaded first.
- * 
+ *
  */
 public class GenerateContainer implements Container {
 
     public static final String module = GenerateContainer.class.getName();
     public static final String source = "/framework/appserver/templates/";
     public static final String target = "/setup/";
+    private boolean isGeronimo = false;
+
 
     protected String configFile = null;
     protected String ofbizHome = null;
     protected String args[] = null;
 
-
     /**
      * @see org.ofbiz.base.container.Container#init(java.lang.String[], java.lang.String)
      */
@@ -59,6 +62,7 @@
         this.ofbizHome = System.getProperty("ofbiz.home");
         this.configFile = configFile;
         this.args = args;
+        this.isGeronimo = args[0].toLowerCase().contains("geronimo") || args[0].toLowerCase().contains("wasce");
     }
 
     /**
@@ -82,10 +86,29 @@
     private void generateFiles() throws ContainerException {
         File files[] = getTemplates();
         Map<String, Object> dataMap = buildDataMap();
+        if (isGeronimo) {
+            String serverType = args[0];
+            String geronimoHome = null;
+            if (args.length > 2) {
+                geronimoHome = args[2];
+            }
+            GenerateGeronimoDeployment geronimoDeployment = new GenerateGeronimoDeployment();
+            List classpathJars = geronimoDeployment.generate(serverType, geronimoHome);
+            if (classpathJars == null) {
+                throw new ContainerException("Error in Geronimo deployment, please check the log");
+            }
+            dataMap.put("classpathJars", classpathJars);
+        }
 
         //Debug.log("Using Data : " + dataMap, module);
+        String applicationPrefix = "";
+        if (args.length > 3 && args[3].length() > 0) {
+            applicationPrefix = args[3] + "-";
+        }
+        dataMap.put("applicationPrefix", applicationPrefix);
+        dataMap.put("pathSeparatorChar", File.pathSeparatorChar);
         for (File file: files) {
-            if (!file.isDirectory() && !file.isHidden()) {
+            if (isGeronimo && !(file.isDirectory() || file.isHidden() || file.getName().equalsIgnoreCase("geronimo-web.xml"))) { 
                 parseTemplate(file, dataMap);
             }
         }
@@ -116,6 +139,7 @@
         dataMap.put("classpathDirs", c[1]);
         dataMap.put("env", System.getProperties());
         dataMap.put("webApps", ComponentConfig.getAllWebappResourceInfos());
+        dataMap.put("ofbizHome", System.getProperty("ofbiz.home"));
         return dataMap;
     }
 
@@ -134,20 +158,30 @@
                 }
             }
         }
-
         List[] lists = { jar, dir };
         return lists;
     }
 
     private void parseTemplate(File templateFile, Map<String, Object> dataMap) throws ContainerException {
         Debug.log("Parsing template : " + templateFile.getAbsolutePath(), module);
+        Reader reader = null;
+        try {
+            reader = new InputStreamReader(new FileInputStream(templateFile));
+        } catch (FileNotFoundException e) {
+            throw new ContainerException(e);
+        }
 
         // create the target file/directory
         String targetDirectoryName = args.length > 1 ? args[1] : null;
         if (targetDirectoryName == null) {
             targetDirectoryName = target;
         }
-        String targetDirectory = ofbizHome + targetDirectoryName + args[0];
+        String targetDirectory = null;
+        if (!isGeronimo) {
+            targetDirectory = ofbizHome + targetDirectoryName + args[0];
+        } else {
+            targetDirectory = ofbizHome + targetDirectoryName;
+        }
         File targetDir = new File(targetDirectory);
         if (!targetDir.exists()) {
             boolean created = targetDir.mkdirs();

Added: ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateGeronimoDeployment.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateGeronimoDeployment.java?rev=643173&view=auto
==============================================================================
--- ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateGeronimoDeployment.java (added)
+++ ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateGeronimoDeployment.java Mon Mar 31 15:06:42 2008
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * 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.ofbiz.appservers;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.Writer;
+import java.nio.channels.FileChannel;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.ofbiz.base.component.ComponentConfig;
+import org.ofbiz.base.component.ComponentConfig.WebappInfo;
+import org.ofbiz.base.start.Classpath;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.StringUtil;
+import org.ofbiz.base.util.UtilURL;
+import org.ofbiz.base.util.template.FreeMarkerWorker;
+
+/**
+ * GenerateGeronimoRepository - Generate needed 3d parties jars (only? rather all jars for now, see commented lines below) in Geronimo (or WASCE) repository
+ *
+ */
+public class GenerateGeronimoDeployment {
+
+    public static final String module = GenerateGeronimoDeployment.class.getName();
+    public static final String source = "/framework/appserver/templates/";
+
+    protected  String geronimoRepository = null;
+    protected String geronimoHome = null;
+
+    @SuppressWarnings("unchecked")
+    public List<String> generate(String geronimoVersion, String geronimoHome) {
+        // Check environment for Geronimo Home
+        if (geronimoHome == null) {
+            geronimoHome = System.getenv("GERONIMO_HOME");
+            if (geronimoHome == null) {
+                Debug.logFatal("'GERONIMO_HOME' was not found in your environment. Please set the location of Geronimo into GERONIMO_HOME.", module);
+                return null;
+            }
+        }
+        geronimoRepository = geronimoHome + "/repository";
+        Debug.logInfo("The WASCE or Geronimo Repository is " + geronimoRepository, module);
+        Classpath classPath = new Classpath(System.getProperty("java.class.path"));
+        List<File> elements = classPath.getElements();
+        List<String> jar_version = new ArrayList<String>();
+        String jarPath = null;
+        String jarName = null;
+        String newJarName = null;
+        String jarNameSimple = null;
+        String jarVersion = "1.0";
+        int lastDash = -1;
+
+        for (File f: elements) {
+            if (f.exists()) {
+                if (f.isFile()) {
+                    jarPath = f.getAbsolutePath();
+                    jarName = f.getName();
+                    String jarNameWithoutExt = (String) jarName.subSequence(0, jarName.length()-4);
+                    lastDash = jarNameWithoutExt.lastIndexOf("-");
+                    if (lastDash > -1) {
+                        // get string between last dash and extension = version ?
+                        jarVersion = jarNameWithoutExt.substring(lastDash+1, jarNameWithoutExt.length());
+                        // get string before last dash
+                        jarNameSimple = jarNameWithoutExt.substring(0, lastDash);
+                        // Remove all but digits and "." and if length > 0 then it's already versioned
+                        boolean alreadyVersioned = 0 < StringUtil.removeRegex(jarVersion, "[^.0123456789]").length();
+                        if (! alreadyVersioned) {
+                            jarVersion = "1.0"; // by default put 1.0 version
+                            jarNameSimple = jarNameWithoutExt;
+                            newJarName = jarNameWithoutExt + "-" + jarVersion + ".jar";
+                        } else {
+                            newJarName = jarName;
+                        }
+                    } else {
+                        jarVersion = "1.0"; // by default put 1.0 version
+                        jarNameSimple = jarNameWithoutExt;
+                        newJarName = jarNameWithoutExt + "-" + jarVersion + ".jar";
+                    }
+
+                    jar_version.add(jarNameSimple + "#" + jarVersion);
+
+                    String targetDirectory = geronimoRepository + "/org/ofbiz/" + jarNameSimple + "/" + jarVersion;
+                    File targetDir = new File(targetDirectory);
+                    if (!targetDir.exists()) {
+                        boolean created = targetDir.mkdirs();
+                        if (!created) {
+                            Debug.logFatal("Unable to create target directory - " + targetDirectory, module);
+                            return null;
+                        }
+                    }
+
+                    if (!targetDirectory.endsWith("/")) {
+                        targetDirectory = targetDirectory + "/";
+                    }
+                    String newCompleteJarName= targetDirectory + newJarName;
+
+                    File newJarFile = new File(newCompleteJarName);
+                    // copy the jar to the target directory
+                    try {
+                        // Create channel on the source
+                        FileChannel srcChannel = new FileInputStream(jarPath).getChannel();
+
+                        // Create channel on the destination
+                        FileChannel dstChannel = new FileOutputStream(newCompleteJarName).getChannel();
+
+                        // Copy file contents from source to destination
+                        dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
+                        Debug.log("Created jar file : " + newJarName + " in WASCE or Geronimo repository", module);
+
+                        // Close the channels
+                        srcChannel.close();
+                        dstChannel.close();
+                    } catch (IOException e) {
+                        Debug.logFatal("Unable to create jar file - " + newJarName + " in WASCE or Geronimo repository (certainly already exists)", module);
+                        return null;
+                    }
+                }
+            }
+        }
+        List<ComponentConfig.WebappInfo> webApps  = ComponentConfig.getAllWebappResourceInfos();
+        File geronimoWebXml = new File(System.getProperty("ofbiz.home") + "/framework/appserver/templates/" + geronimoVersion + "/geronimo-web.xml");
+        for (ComponentConfig.WebappInfo webApp: webApps) {
+            if (null != webApp) {
+                parseTemplate(geronimoWebXml, webApp);
+            }
+        }
+        return jar_version;
+    }
+
+    private void parseTemplate(File templateFile, ComponentConfig.WebappInfo webApp){
+        Debug.log("Parsing template : " + templateFile.getAbsolutePath() + " for web app " + webApp.getName(), module);
+
+        Map<String, Object> dataMap= new HashMap<String, Object>();
+        dataMap.put("webApp", webApp);
+        String webAppGeronimoWebXmlFileName = webApp.getLocation() + "/WEB-INF/geronimo-web.xml";
+        String webAppGeronimoWebInfDirName = webApp.getLocation() + "/WEB-INF";
+        File webAppGeronimoWebInfDir = new File(webAppGeronimoWebInfDirName);
+
+        if (!(webAppGeronimoWebInfDir.exists() && webAppGeronimoWebInfDir.isDirectory())) {
+            Debug.logFatal("Unable to create - " + webAppGeronimoWebXmlFileName, module);
+            Debug.logFatal("The directory "+ webAppGeronimoWebInfDirName + " does not exist", module);
+            return;
+        }
+
+        Reader reader = null;
+        try {
+            reader = new InputStreamReader(new FileInputStream(templateFile));
+        } catch (FileNotFoundException e) {
+            Debug.logFatal("Unable to create - " + webAppGeronimoWebXmlFileName, module);
+            return;
+        }
+
+        // write the template to the target directory
+        Writer writer = null;
+        try {
+            writer = new FileWriter(webAppGeronimoWebXmlFileName);
+        } catch (IOException e) {
+            Debug.logFatal("Unable to create - " + webAppGeronimoWebXmlFileName, module);
+            return;
+        }
+        try {
+            FreeMarkerWorker.renderTemplate(UtilURL.fromFilename(templateFile.getAbsolutePath()).toExternalForm(), dataMap, writer);
+        } catch (Exception e) {
+            Debug.logFatal("Unable to create - " + webAppGeronimoWebXmlFileName, module);
+            return;
+        }
+
+        try {
+            writer.flush();
+            writer.close();
+        } catch (IOException e) {
+            Debug.logFatal("Unable to create - " + webAppGeronimoWebXmlFileName, module);
+            return;
+        }
+    }
+}

Propchange: ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateGeronimoDeployment.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateGeronimoDeployment.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/appserver/src/org/ofbiz/appservers/GenerateGeronimoDeployment.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ofbiz/trunk/framework/appserver/templates/wasce2/README
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/templates/wasce2/README?rev=643173&view=auto
==============================================================================
--- ofbiz/trunk/framework/appserver/templates/wasce2/README (added)
+++ ofbiz/trunk/framework/appserver/templates/wasce2/README Mon Mar 31 15:06:42 2008
@@ -0,0 +1,45 @@
+<#--
+    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.
+-->
+
+Websphere Application Server Community Edition 2 Setup - 2008-03-31 - Jacques Le Roux
+
+To use WASCE 2 with OFBiz 4.0 follow the following steps (all steps assume Orion is already installed and working)
+
+=======================================================================================================================================================
+    If you use WASCE, copy the 2 lines below in the setJavaOpts section (Windows) or somewhere in the setEnv script you will find in GERONIMO_HOME/bin
+    If you use Geronimo, simply put these 2 lines at the top of the setArgs section (Windows) or somewhere in the Geronimo script.
+    If you need it, you may concatenate pre-existing JAVA_OPTS, same for CLASSPATH. But it's not needed for OFBiz alone.
+    On Windows dont' worry about the /or \ in ofbiz.home, they work both. 
+=======================================================================================================================================================
+
+<#assign classpath = ""/>
+<#list classpathDirs as dir>
+    <#assign classpath = classpath + dir + pathSeparatorChar/>
+</#list>
+<#assign classpath = classpath?substring(0, classpath?length - 1)/>
+set JAVA_OPTS=-Dofbiz.home="${ofbizHome}" -Xms256M -Xmx512M -XX:MaxPermSize=128M -Duser.language=en
+set CLASSPATH=${classpath}
+
+=======================================================================================================================================================
+    Change also this line of the geronimo script in the doneSetArgs section (Windows) or somewhere in the Geronimo script.
+=======================================================================================================================================================
+
+%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% -Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib\ext" -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar %_JARFILE% %_LONG_OPT% %CMD_LINE_ARGS%
+    to
+%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% -Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib\ext" -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%" -cp .;%_JARFILE%;%CLASSPATH% %_LONG_OPT% %CMD_LINE_ARGS% %MAINCLASS%

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/README
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/README
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ofbiz/trunk/framework/appserver/templates/wasce2/application.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/templates/wasce2/application.xml?rev=643173&view=auto
==============================================================================
--- ofbiz/trunk/framework/appserver/templates/wasce2/application.xml (added)
+++ ofbiz/trunk/framework/appserver/templates/wasce2/application.xml Mon Mar 31 15:06:42 2008
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<!-- This generates an application.xml file used in an exploded EAR structure (no WAR files).
+  The file is copied in the META-INF directory in this EAR structure ready to deploy using the inPlace deployer tool option
+  Eventually irrelevant generated modules and dependencies should be removed (but it should not hurt if not done)
+  The indentation is specifically done for the rendered file
+-->
+<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns="http://java.sun.com/xml/ns/javaee"
+  xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
+  id="Application_ID"
+  version="5">
+
+  <description>The Apache OFBiz Project</description>
+  <display-name>OFBiz</display-name>
+
+  <#list webApps as webapp>
+    <#assign location = webapp.getLocation()?if_exists/>
+    <#if location.contains("framework") && (location.contains("webtools") || location.contains("images"))
+      || location.contains("applications")
+      || location.contains("specialpurpose")
+      || location.contains("hot-deploy")>
+      <#if location.contains("framework") && (location.contains("webtools") || location.contains("images"))>
+        <#assign location = location.substring(location.lastIndexOf("framework"))/>
+      </#if>
+      <#if location.contains("applications")>
+        <#assign location = location.substring(location.lastIndexOf("applications"))/>
+      </#if>
+      <#if location.contains("specialpurpose")>
+        <#assign location = location.substring(location.lastIndexOf("specialpurpose"))/>
+      </#if>
+      <#if location.contains("hot-deploy") && !location.contains("images")>
+        <#assign location = location.substring(location.lastIndexOf("hot-deploy"))/>
+      </#if>
+      <#if !(location.contains("neogia") && location.contains("shipment"))
+        && !(location.contains("hot-deploy") && location.contains("images"))>
+  <module id="${applicationPrefix}${webapp.getName()}">
+    <web>
+      <web-uri>${location}/</web-uri>
+      <context-root>${webapp.getContextRoot()}</context-root>
+    </web>
+  </module>
+      </#if>
+    </#if>
+  </#list>
+</application>

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/application.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/application.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/application.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-application.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-application.xml?rev=643173&view=auto
==============================================================================
--- ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-application.xml (added)
+++ ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-application.xml Mon Mar 31 15:06:42 2008
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<!-- This generates a geronimo-application.xml file used in an exploded EAR structure (no WAR files).
+    The file is copied in the META-INF directory in this EAR structure ready to deploy using the inPlace deployer tool option
+    Eventually irrelevant generated modules and dependencies should be removed (but it should not hurt if not done)
+    The indentation is specifically done for the rendered file
+-->
+<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
+    xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
+    xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
+    <dep:environment>
+        <dep:moduleId>
+            <dep:groupId>org.ofbiz</dep:groupId>
+            <dep:artifactId>${applicationPrefix}ofbiz</dep:artifactId>
+            <dep:version>1.0</dep:version>
+            <dep:type>ear</dep:type>
+        </dep:moduleId>
+
+        <dep:dependencies>
+          <#list classpathJars as jar_version>
+            <#assign jar = jar_version.substring(0,jar_version.indexOf("#"))/>
+              <#assign version = jar_version.substring(jar_version.indexOf("#") + 1)/>
+            <dependency>
+                <dep:groupId>org.ofbiz</dep:groupId>
+                <dep:artifactId>${jar}</dep:artifactId>
+                <dep:version>${version}</dep:version>
+                <dep:type>jar</dep:type>
+            </dependency>
+          </#list>
+        </dep:dependencies>
+        <dep:hidden-classes/>
+        <dep:non-overridable-classes/>
+    </dep:environment>
+
+    <#list webApps as webapp>
+        <#assign location = webapp.getLocation()?if_exists/>
+        <#if location.contains("framework") && (location.contains("webtools") || location.contains("images"))
+            || location.contains("applications")
+            || location.contains("specialpurpose")
+            || location.contains("hot-deploy")>
+            <#if location.contains("framework") && (location.contains("webtools") || location.contains("images"))>
+                <#assign location = location.substring(location.lastIndexOf("framework"))/>
+            </#if>
+            <#if location.contains("applications")>
+                <#assign location = location.substring(location.lastIndexOf("applications"))/>
+            </#if>
+            <#if location.contains("specialpurpose")>
+                <#assign location = location.substring(location.lastIndexOf("specialpurpose"))/>
+            </#if>
+            <#if location.contains("hot-deploy") && !location.contains("images")>
+                <#assign location = location.substring(location.lastIndexOf("hot-deploy"))/>
+            </#if>
+            <#if !(location.contains("neogia") && location.contains("shipment"))
+                && !(location.contains("hot-deploy") && location.contains("images"))>
+    <module>
+        <web>${location}/</web>
+        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.2">
+            <context-root>${webapp.getContextRoot()}</context-root>
+        </web-app>
+    </module>
+            </#if>
+        </#if>
+    </#list>
+
+</application>

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-application.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-application.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-application.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-web.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-web.xml?rev=643173&view=auto
==============================================================================
--- ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-web.xml (added)
+++ ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-web.xml Mon Mar 31 15:06:42 2008
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<!-- This generates geronimo-web.xml files in each concerned webbapp, in an exploded EAR structure (no WAR files). -->
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
+    xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
+    xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
+    xmlns:security="http://geronimo.apache.org/xml/ns/security-1.2">
+
+    <dep:environment>
+        <dep:moduleId>
+            <dep:groupId>org.ofbiz.${webApp.getName()}</dep:groupId>
+            <dep:artifactId>${webApp.getName()}</dep:artifactId>
+            <dep:version>1.0</dep:version>
+            <dep:type>war</dep:type>
+        </dep:moduleId>
+        <dep:dependencies/>
+        <dep:hidden-classes/>
+        <dep:non-overridable-classes/>
+    </dep:environment>
+
+    <context-root>${webApp.getContextRoot()}</context-root>
+
+</web-app>

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-web.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/appserver/templates/wasce2/geronimo-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml