# HG changeset patch
# User Asier Lostalé <asier.lostale@openbravo.com>
# Date 1538392564 -7200
#      Mon Oct 01 13:16:04 2018 +0200
# Node ID c28110c4594f57d02ce7d99ecf7d2a73e07f4f5c
# Parent  629e6710431eb541c3754c5adec65e10cc570b03
fixed issue 39431: mark application as distributable

  Application is now marked as distributable in web.xml if it is set to be deployed
  in cluster.

diff -r 629e6710431e -r c28110c4594f src-wad/src/org/openbravo/wad/Wad.java
--- a/src-wad/src/org/openbravo/wad/Wad.java	Tue Oct 09 10:15:50 2018 +0200
+++ b/src-wad/src/org/openbravo/wad/Wad.java	Mon Oct 01 13:16:04 2018 +0200
@@ -65,6 +65,7 @@
   private static String sqlDateFormat;
   private static boolean generateAllClassic250Windows;
   private static boolean excludeCDI;
+  private static boolean cluster;
 
   private static final Logger log4j = Logger.getLogger(Wad.class);
 
@@ -233,6 +234,12 @@
         excludeCDI = argv[18].equals("true");
       }
 
+      if (argv.length <= 19) {
+        cluster = false;
+      } else {
+        cluster = argv[19].equals("true");
+      }
+
       log4j.info("File connection: " + strFileConnection);
       log4j.info("window: " + strWindowName);
       log4j.info("module: " + module);
@@ -248,6 +255,7 @@
       log4j.info("Quick mode: " + quick);
       log4j.info("Generate all 2.50 windows: " + generateAllClassic250Windows);
       log4j.info("Exclude CDI: " + excludeCDI);
+      log4j.info("Cluster: " + cluster);
 
       final File fileFin = new File(dirFin);
       if (!fileFin.exists()) {
@@ -709,8 +717,9 @@
       throws ServletException, IOException {
     try {
       log4j.info("Processing web.xml");
-      final XmlDocument xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/wad/webConf")
-          .createXmlDocument();
+
+      final XmlDocument xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/wad/webConf",
+          new String[] { cluster ? "" : "distributable" }).createXmlDocument();
 
       String excludeWeldListener = excludeCDI ? WELD_LISTENER_ID : NONE;
       xmlDocument.setData("structureListener", WadData.selectListener(pool, excludeWeldListener));
diff -r 629e6710431e -r c28110c4594f src-wad/src/org/openbravo/wad/web.xml
--- a/src-wad/src/org/openbravo/wad/web.xml	Tue Oct 09 10:15:50 2018 +0200
+++ b/src-wad/src/org/openbravo/wad/web.xml	Mon Oct 01 13:16:04 2018 +0200
@@ -19,6 +19,9 @@
   -->
 
 <web-app id="webapp">
+  <FIELDS_TMP id="distributable">
+    <distributable/>
+  </FIELDS_TMP>
   <FIELDS_TMP id="sectionListener">
     <listener>
       <display-name>
diff -r 629e6710431e -r c28110c4594f src/build.xml
--- a/src/build.xml	Tue Oct 09 10:15:50 2018 +0200
+++ b/src/build.xml	Mon Oct 01 13:16:04 2018 +0200
@@ -304,7 +304,7 @@
   
   <target name="wad" depends="init, wadvalidation">
     <java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}" failonerror="true">
-      <arg line="'${base.config}' '${tab}' '${build.AD}/org/openbravo/erpWindows' '${build.AD}/org/openbravo/erpCommon' '${build.sqlc}/src' '${webTab}' '${build.AD}/org/openbravo/erpCommon/ad_actionButton' '${base.design}' '${base.translate.structure}' 'dummyValueUnused' '..' '${attach.path}' '${web.url}' '${base.src}' '${complete}' '${module}' 'noquick' '${wad.generateAllClassic250Windows}' '${exclude.cdi}'" />
+      <arg line="'${base.config}' '${tab}' '${build.AD}/org/openbravo/erpWindows' '${build.AD}/org/openbravo/erpCommon' '${build.sqlc}/src' '${webTab}' '${build.AD}/org/openbravo/erpCommon/ad_actionButton' '${base.design}' '${base.translate.structure}' 'dummyValueUnused' '..' '${attach.path}' '${web.url}' '${base.src}' '${complete}' '${module}' 'noquick' '${wad.generateAllClassic250Windows}' '${exclude.cdi}' '${cluster}'" />
       <classpath refid="wad.class.path" />
       <syspropertyset>
          <propertyref name="java.security.egd" />
@@ -315,7 +315,7 @@
 
   <target name="wad.quick" depends="init, wadvalidation">
     <java classname="org.openbravo.wad.Wad" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
-      <arg line="'${base.config}' '${tab}' '${build.AD}/org/openbravo/erpWindows' '${build.AD}/org/openbravo/erpCommon' '${build.sqlc}/src' '${webTab}' '${build.AD}/org/openbravo/erpCommon/ad_actionButton' '${base.design}' '${base.translate.structure}' 'dummyValueUnused' '..' '${attach.path}' '${web.url}' '${base.src}' '${complete}' '${module}' 'quick' '${wad.generateAllClassic250Windows}' '${exclude.cdi}'" />
+      <arg line="'${base.config}' '${tab}' '${build.AD}/org/openbravo/erpWindows' '${build.AD}/org/openbravo/erpCommon' '${build.sqlc}/src' '${webTab}' '${build.AD}/org/openbravo/erpCommon/ad_actionButton' '${base.design}' '${base.translate.structure}' 'dummyValueUnused' '..' '${attach.path}' '${web.url}' '${base.src}' '${complete}' '${module}' 'quick' '${wad.generateAllClassic250Windows}' '${exclude.cdi}' '${cluster}'" />
       <classpath refid="wad.class.path" />
       <syspropertyset>
          <propertyref name="java.security.egd" />
