Fixed 6818
authorStefan Hühner <stefan.huehner@openbravo.com>
Fri, 09 Jan 2009 14:12:47 +0000
changeset 2553 e61d7b9f5942
parent 2552 5c613347b612
child 2554 5a40c2147270
Fixed 6818
Remove unused copy of all .xml/.jasper files to src-loc/design/en_US
-> WebContent size goes down by about 15mb
- do some unrelated cleanup on the src-trl files on the way
- unused fields, xsql-files, variables
src-trl/src/org/openbravo/translate/CommandLine_CopyFiles.java
src-trl/src/org/openbravo/translate/FlipImage.java
src-trl/src/org/openbravo/translate/LanguageCombo_data.xsql
src-trl/src/org/openbravo/translate/RTLSkin.java
src-trl/src/org/openbravo/translate/Translate.java
src-trl/src/org/openbravo/translate/Translate_data.xsql
src/build.xml
--- a/src-trl/src/org/openbravo/translate/CommandLine_CopyFiles.java	Fri Jan 09 14:04:11 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- *************************************************************************
- * The contents of this file are subject to the Openbravo  Public  License
- * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
- * Version 1.1  with a permitted attribution clause; you may not  use this
- * file except in compliance with the License. You  may  obtain  a copy of
- * the License at http://www.openbravo.com/legal/license.html 
- * Software distributed under the License  is  distributed  on  an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific  language  governing  rights  and  limitations
- * under the License. 
- * The Original Code is Openbravo ERP. 
- * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2007 Openbravo SL 
- * All Rights Reserved. 
- * Contributor(s):  ______________________________________.
- ************************************************************************
- */
-package org.openbravo.translate;
-
-import org.openbravo.utils.FileUtility;
-import org.openbravo.utils.DirFilter;
-import org.openbravo.database.CPStandAlone;
-
-import java.io.*;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PropertyConfigurator;
-
-class CommandLine_CopyFiles {
-    static Logger log4j = Logger.getLogger(CommandLine_CopyFiles.class);
-
-    public static void main(String argv[]) throws Exception {
-        PropertyConfigurator.configure("log4j.lcf");
-        String connectionFile;
-        String source;
-        String destiny;
-        DirFilter filter = null;
-        boolean overwrite = false;
-        boolean discardHidden = false;
-        String language = "";
-
-        if (argv.length < 6) {
-            log4j
-                    .error("Usage: java org.openbravo.erpCommon.utility.CommandLine_CopyFiles XmlPool.xml source destiny filter discard_hidden overwrite [language]");
-            return;
-        }
-
-        connectionFile = argv[0];
-        source = argv[1];
-        destiny = argv[2];
-        filter = new DirFilter(argv[3]);
-        if (argv[4].equals("true"))
-            discardHidden = true;
-        if (argv[5].equals("true"))
-            overwrite = true;
-        if (argv.length > 6)
-            language = argv[6];
-
-        File fileSource = new File(source);
-        if (!fileSource.exists())
-            throw new Exception("Source directory doesn't exists: " + source);
-
-        CPStandAlone conn = null;
-        try {
-            conn = new CPStandAlone(connectionFile);
-            LanguageComboData[] data = LanguageComboData.selectOthers(conn,
-                    language);
-            if (data != null && data.length > 0) {
-                for (int i = 0; i < data.length; i++) {
-                    File fileLang = new File(destiny, data[i].adLanguage);
-                    fileLang.mkdir();
-                    log4j.info("files copied to "
-                            + data[i].adLanguage
-                            + ": "
-                            + FileUtility.copy(fileSource, fileLang, filter,
-                                    discardHidden, overwrite));
-                }
-            }
-
-            conn.destroy();
-        } catch (Exception ex) {
-            if (conn != null)
-                conn.destroy();
-            throw ex;
-        }
-    }
-}
--- a/src-trl/src/org/openbravo/translate/FlipImage.java	Fri Jan 09 14:04:11 2009 +0000
+++ b/src-trl/src/org/openbravo/translate/FlipImage.java	Fri Jan 09 14:12:47 2009 +0000
@@ -19,8 +19,8 @@
 
 package org.openbravo.translate;
 
-import java.awt.*;
-import java.awt.image.*;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
 import java.io.File;
 import javax.imageio.ImageIO;
 
@@ -54,9 +54,4 @@
         saveImage(path, im);
     }
 
-    /**
-   * 
-   */
-    private static final long serialVersionUID = 1L;
-
 }
\ No newline at end of file
--- a/src-trl/src/org/openbravo/translate/LanguageCombo_data.xsql	Fri Jan 09 14:04:11 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- *************************************************************************
- * The contents of this file are subject to the Openbravo  Public  License
- * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
- * Version 1.1  with a permitted attribution clause; you may not  use this
- * file except in compliance with the License. You  may  obtain  a copy of
- * the License at http://www.openbravo.com/legal/license.html 
- * Software distributed under the License  is  distributed  on  an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific  language  governing  rights  and  limitations
- * under the License. 
- * The Original Code is Openbravo ERP. 
- * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
- * All Rights Reserved. 
- * Contributor(s):  ______________________________________.
- ************************************************************************
--->
-
-
-
-
-
-<SqlClass name="LanguageComboData" package="org.openbravo.translate">
-   <SqlClassComment></SqlClassComment>
-   <SqlMethod name="select" type="preparedStatement" return="multiple">
-      <SqlMethodComment></SqlMethodComment>
-      <Sql>
-        SELECT AD_LANGUAGE, NAME 
-        FROM AD_LANGUAGE 
-        WHERE ISACTIVE='Y'
-        AND (ISSYSTEMLANGUAGE = 'Y' 
-        OR ISBASELANGUAGE = 'Y')
-        ORDER BY NAME
-      </Sql>
-   </SqlMethod>
-
-   <SqlMethod name="defaultLanguage" type="preparedStatement" return="String" default="">
-      <SqlMethodComment></SqlMethodComment>
-      <Sql>
-        SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE ISACTIVE='Y' AND ISBASELANGUAGE='Y'
-      </Sql>
-   </SqlMethod>
-
-   <SqlMethod name="selectOthers" type="preparedStatement" return="multiple">
-      <SqlMethodComment></SqlMethodComment>
-      <Sql>
-        SELECT AD_LANGUAGE 
-        FROM AD_LANGUAGE 
-        WHERE ISACTIVE='Y'
-        AND ISSYSTEMLANGUAGE = 'Y' 
-        AND ISBASELANGUAGE = 'N' 
-        ORDER BY NAME
-      </Sql>
-      <Parameter name="language" optional="true" after="WHERE " text=" AD_LANGUAGE = ? AND "/>
-   </SqlMethod>
-</SqlClass>
--- a/src-trl/src/org/openbravo/translate/RTLSkin.java	Fri Jan 09 14:04:11 2009 +0000
+++ b/src-trl/src/org/openbravo/translate/RTLSkin.java	Fri Jan 09 14:12:47 2009 +0000
@@ -18,8 +18,6 @@
  */
 package org.openbravo.translate;
 
-import org.openbravo.database.CPStandAlone;
-
 import java.io.*;
 import java.util.Vector;
 import java.lang.Math;
@@ -35,7 +33,6 @@
  **/
 public class RTLSkin {
     public static final String VERSION = "V1.0";
-    protected static CPStandAlone pool;
     static int count = 0;
     private static String srcDirRTLSkin = "";
     private static String srcDirLTRSkin = "";
@@ -330,10 +327,4 @@
         out.close();
     }
 
-    /**
-     * The method to close database connection.
-     */
-    public void destroy() {
-        pool.destroy();
-    }
 }
--- a/src-trl/src/org/openbravo/translate/Translate.java	Fri Jan 09 14:04:11 2009 +0000
+++ b/src-trl/src/org/openbravo/translate/Translate.java	Fri Jan 09 14:12:47 2009 +0000
@@ -21,7 +21,6 @@
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.StringTokenizer;
 import java.util.Vector;
@@ -49,12 +48,9 @@
     protected static CPStandAlone pool;
     static XMLReader parser;
     static TranslateData[] toLanguage;
-    static String fromLanguage;
     static String actualLanguage;
     static String fileTermination;
 
-    static PrintWriter printWriterTxt;
-    static boolean error;
     static boolean isHtml = false;
 
     static String actualTag;
@@ -101,7 +97,6 @@
             parser = new SAXParser();
         parser.setEntityResolver(new LocalEntityResolver());
         parser.setContentHandler(this);
-        fromLanguage = TranslateData.baseLanguage(pool);
         toLanguage = TranslateData.systemLanguage(pool);
         if (toLanguage.length == 0)
             log4j
@@ -373,7 +368,6 @@
 
         log4j.debug("File: " + fileParsing);
 
-        error = false;
         try {
             parser.parse(new InputSource(new FileReader(fileParsing)));
         } catch (final IOException e) {
--- a/src-trl/src/org/openbravo/translate/Translate_data.xsql	Fri Jan 09 14:04:11 2009 +0000
+++ b/src-trl/src/org/openbravo/translate/Translate_data.xsql	Fri Jan 09 14:12:47 2009 +0000
@@ -23,7 +23,7 @@
   <SqlMethod name="select" type="preparedStatement" return="multiple">
     <SqlMethodComment>Return the translation of a text</SqlMethodComment>
     <Sql>
-      select A.ad_textinterfaces_id, A.tr, '' AS NAME, A.o AS ORDEN, '' as ad_language, '' AS TOTAL
+      select A.ad_textinterfaces_id, A.tr, '' AS NAME, '' AS TOTAL
         from (select tt.ad_textinterfaces_id AS ad_textinterfaces_id, trim(tt.text) AS tr, 1 AS o
                 from ad_textinterfaces_trl tt
                where tt.ad_textinterfaces_id =  (select min(ad_textinterfaces_id)
@@ -172,12 +172,6 @@
     </Sql>
     <Parameter name="adTextinterfacesId"/>
   </SqlMethod>
-  <SqlMethod name="baseLanguage" type="preparedStatement" return="String" default="">
-    <SqlMethodComment>Return the translation of a text</SqlMethodComment>
-    <Sql>
-      SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE ISACTIVE='Y' AND ISBASELANGUAGE='Y'
-    </Sql>
-  </SqlMethod>
 
   <SqlMethod name="systemLanguage" type="preparedStatement" return="multiple">
     <SqlMethodComment>Return the translation of a text</SqlMethodComment>
--- a/src/build.xml	Fri Jan 09 14:04:11 2009 +0000
+++ b/src/build.xml	Fri Jan 09 14:12:47 2009 +0000
@@ -241,14 +241,6 @@
 		<copy todir="${build}">
 			<fileset file="${base.config}/quartz.properties" />
 		</copy>
-		<java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
-			<arg line="'${base.config}/Openbravo.properties' '${base.design}/design' '${base.design}' '.xml' 'true' 'false'" />
-			<classpath refid="project.class.path" />
-		</java>
-		<java classname="org.openbravo.translate.CommandLine_CopyFiles" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
-			<arg line="'${base.config}/Openbravo.properties' '${base.design}/design' '${base.design}' 'jasper' 'true' 'false'" />
-			<classpath refid="project.class.path" />
-		</java>
 		<antcall target="build.local.context" inheritAll="true" inheritrefs="true" />
 	</target>