details:   /erp/devel/pi/rev/089cdca2f1b5
changeset: 9010:089cdca2f1b5
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Fri Nov 26 16:06:57 2010 +0100
summary:   Issue 15308: make code in wad more private to facilitate some cleanup

details:   /erp/devel/pi/rev/fc84c3b9955c
changeset: 9011:fc84c3b9955c
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Fri Nov 26 16:07:55 2010 +0100
summary:   Issue 15308: Remove some unused (and now private) code

details:   /erp/devel/pi/rev/457a10871cb0
changeset: 9012:457a10871cb0
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Fri Nov 26 16:10:07 2010 +0100
summary:   Issue 15308: Remove code for some long unused command line 
parameters in Wad
- directory Translate, translation to, Base path, Src path
They are still passed to Wad by the build.xml files to keep that interface
stable

details:   /erp/devel/pi/rev/4d16fada2ef5
changeset: 9013:4d16fada2ef5
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Fri Nov 26 16:12:35 2010 +0100
summary:   Fixed 15308: Last part remove some more unsued code

diffstat:

 src-wad/src/org/openbravo/wad/Wad.java                            |  131 
++-------
 src-wad/src/org/openbravo/wad/WadActionButton.java                |   15 +-
 src-wad/src/org/openbravo/wad/WadConnection.java                  |   13 +-
 src-wad/src/org/openbravo/wad/WadUtility.java                     |   10 +-
 src-wad/src/org/openbravo/wad/WadUtility_data.xsql                |   17 +-
 src-wad/src/org/openbravo/wad/validation/WADValidationResult.java |    4 +-
 src-wad/src/org/openbravo/wad/validation/WADValidator.java        |    2 +-
 7 files changed, 46 insertions(+), 146 deletions(-)

diffs (truncated from 399 to 300 lines):

diff -r ada0aad2a115 -r 4d16fada2ef5 src-wad/src/org/openbravo/wad/Wad.java
--- a/src-wad/src/org/openbravo/wad/Wad.java    Fri Nov 26 16:24:04 2010 +0100
+++ b/src-wad/src/org/openbravo/wad/Wad.java    Fri Nov 26 16:12:35 2010 +0100
@@ -55,38 +55,23 @@
  * @author Fernando Iriazabal
  */
 public class Wad extends DefaultHandler {
-  static final int NUM_COLUMNS = 10;
-  static final int COLUMN_1_OF_1 = 11;
-  static final int COLUMN_1_OF_2 = 12;
-  static final int COLUMN_2_OF_2 = 22;
-  static final int NUM_TABS = 8;
-  static final int INCR_TABS = 8;
-  static final int HEIGHT_TABS = 38;
-  static final int MAX_COL_SIZE_RELATION = 50;
-  static final int MAX_SIZE_EDITION_1_COLUMNS = 90;
-  static final int MAX_SIZE_EDITION_2_COLUMNS = 45;
-  static final int MAX_TEXTBOX_LENGTH = 110;
-  static final double PIXEL_TO_LENGTH = 5.6;
-  static final double FIRST_COLS_SIZE = 60;
-  static final double SUBTABS_COL_SIZE = 30;
-  static final double RELATION_MINIMUM_LENGTH = 15.0;
-  static final int IMAGE_RELATION_WIDTH = 16;
-  static final int IMAGE_RELATION_HEIGHT = 16;
-  static final int IMAGE_BUTTON_WIDTH = 16;
-  static final int IMAGE_BUTTON_HEIGHT = 16;
-  XmlEngine xmlEngine;
-  protected WadConnection pool;
-  String strSystemSeparator;
-  static final String calendarDescription = "Calendar";
-  static final String clockDescription = "Clock";
-  static final String calculatorDescription = "Calculator";
-  static String calendarDescriptionTrl = "";
-  static String clockDescriptionTrl = "";
-  static String calculatorDescriptionTrl = "";
-  static String jsDateFormat;
-  static String sqlDateFormat;
-
-  static Logger log4j = Logger.getLogger(Wad.class);
+  private static final int COLUMN_1_OF_1 = 11;
+  private static final int COLUMN_1_OF_2 = 12;
+  private static final int COLUMN_2_OF_2 = 22;
+  private static final int NUM_TABS = 8;
+  private static final int INCR_TABS = 8;
+  private static final int HEIGHT_TABS = 38;
+  private static final int MAX_SIZE_EDITION_1_COLUMNS = 90;
+  private static final int MAX_SIZE_EDITION_2_COLUMNS = 45;
+  private static final int MAX_TEXTBOX_LENGTH = 110;
+  private static final double PIXEL_TO_LENGTH = 5.6;
+  private XmlEngine xmlEngine;
+  private WadConnection pool;
+  private String strSystemSeparator;
+  private static String jsDateFormat;
+  private static String sqlDateFormat;
+
+  private static final Logger log4j = Logger.getLogger(Wad.class);
 
   /**
    * Main function, entrusted to launch the process of generation of sources. 
The list of arguments
@@ -128,13 +113,9 @@
     String dirActionButton;
     boolean generateWebXml;
     boolean generateTabs;
-    String dirBaseTrl;
-    String translateStr;
     String dirWebClients;
-    String basePath;
     String attachPath;
     String webPath;
-    String strBaseSrc;
     boolean complete;
     boolean quick;
     if (argv.length < 1) {
@@ -196,16 +177,10 @@
         dirActionButton = argv[6];
 
       // Path to base translation generation
-      if (argv.length <= 7)
-        dirBaseTrl = dirFin;
-      else
-        dirBaseTrl = argv[7];
+      // was argv[7] no longer used
 
       // Translate base structure
-      if (argv.length <= 8)
-        translateStr = "";
-      else
-        translateStr = argv[8];
+      // was argv[8] no longer used
 
       // Path to find the client's web.xml file
       if (argv.length <= 9)
@@ -214,10 +189,7 @@
         dirWebClients = argv[9];
 
       // Path of the root project
-      if (argv.length <= 10)
-        basePath = dirFin;
-      else
-        basePath = argv[10];
+      // was argv[10] no longer used
 
       // Path of the attach files
       if (argv.length <= 11)
@@ -232,10 +204,7 @@
         webPath = argv[12];
 
       // Path to the src folder
-      if (argv.length <= 13)
-        strBaseSrc = dirFin;
-      else
-        strBaseSrc = argv[13];
+      // was argv[13] no longer used
 
       // Boolean to indicate if we are doing a complete generation
       if (argv.length <= 14)
@@ -271,13 +240,9 @@
       log4j.info("generate web.xml: " + generateWebXml);
       log4j.info("generate web.xml cliente: " + dirWebClients);
       log4j.info("generate tabs: " + generateTabs);
-      log4j.info("directory Translate : " + dirBaseTrl);
-      log4j.info("translation to : " + translateStr);
       log4j.info("File separator: " + wad.strSystemSeparator);
-      log4j.info("Base path: " + basePath);
       log4j.info("Attach path: " + attachPath);
       log4j.info("Web path: " + webPath);
-      log4j.info("Src path: " + strBaseSrc);
       log4j.info("Quick mode: " + quick);
 
       final File fileFin = new File(dirFin);
@@ -325,27 +290,6 @@
         return;
       }
 
-      final File fileTrl = new File(dirBaseTrl);
-      if (!fileTrl.exists()) {
-        log4j.error("No such directory: " + fileTrl.getAbsoluteFile());
-
-        return;
-      }
-
-      final File fileBase = new File(strBaseSrc);
-      if (!fileBase.exists()) {
-        log4j.error("No such directory: " + fileBase.getAbsoluteFile());
-
-        return;
-      }
-
-      final File fileBaseAplication = new File(basePath);
-      if (!fileBaseAplication.exists()) {
-        log4j.error("No such directory: " + 
fileBaseAplication.getAbsoluteFile());
-
-        return;
-      }
-
       // Calculate windows to generate
       String strCurrentWindow;
       final StringTokenizer st = new StringTokenizer(strWindowName, ",", 
false);
@@ -416,8 +360,7 @@
             log4j.info("Processing Window: " + tabsData[i].windowname + " - 
Tab: "
                 + tabsData[i].tabname + " - id: " + tabsData[i].tabid);
             log4j.debug("Processing: " + tabsData[i].tabid);
-            wad.processTab(fileFin, fileFinReloads, tabsData[i], fileTrl, 
dirBaseTrl, translateStr,
-                fileBase, fileBaseAplication);
+            wad.processTab(fileFin, fileFinReloads, tabsData[i]);
           }
         }
       }
@@ -529,8 +472,7 @@
 
           // build the html template
           WadActionButton.buildHtml(pool, xmlEngine, fileReference, fd[i], 
vecFields,
-              MAX_TEXTBOX_LENGTH, MAX_SIZE_EDITION_1_COLUMNS, "", false, 
calendarDescription,
-              clockDescription, calculatorDescription, jsDateFormat, 
vecReloads);
+              MAX_TEXTBOX_LENGTH, MAX_SIZE_EDITION_1_COLUMNS, "", false, 
jsDateFormat, vecReloads);
         }
       }
     } catch (final ServletException e) {
@@ -679,8 +621,7 @@
 
           // build the html template
           WadActionButton.buildHtml(pool, xmlEngine, fileReference, fd[i], 
vecFields,
-              MAX_TEXTBOX_LENGTH, MAX_SIZE_EDITION_1_COLUMNS, "", true, 
calendarDescription,
-              clockDescription, calculatorDescription, jsDateFormat, 
vecReloads);
+              MAX_TEXTBOX_LENGTH, MAX_SIZE_EDITION_1_COLUMNS, "", true, 
jsDateFormat, vecReloads);
         }
       }
     } catch (final ServletException e) {
@@ -798,21 +739,9 @@
    *          Path where are gonna be created the reloads sources.
    * @param tabsData
    *          An object containing the tabs info.
-   * @param fileTrl
-   *          Path where are gonna be created the translated sources.
-   * @param dirBaseTrl
-   *          Base path of the translated sources.
-   * @param translateStr
-   *          The base package structure for the translated sources.
-   * @param fileBase
-   *          The path to the project's manual sources.
-   * @param fileBaseAplication
-   *          The path to the project root directory.
    * @throws Exception
    */
-  private void processTab(File fileFin, File fileFinReloads, TabsData 
tabsData, File fileTrl,
-      String dirBaseTrl, String translateStr, File fileBase, File 
fileBaseAplication)
-      throws Exception {
+  private void processTab(File fileFin, File fileFinReloads, TabsData 
tabsData) throws Exception {
     try {
       final String tabNamePresentation = tabsData.realtabname;
       // tabName contains tab's UUID for non core tabs
@@ -4279,7 +4208,7 @@
    * @param fileConnection
    *          The path to the connection file.
    */
-  public void createXmlEngine(String fileConnection) {
+  private void createXmlEngine(String fileConnection) {
     // pass null as connection to running the translation at compile time
     xmlEngine = new XmlEngine(null);
     xmlEngine.isResource = true;
@@ -4298,7 +4227,7 @@
    * @param strFileConnection
    *          Path where is allocated the connection file.
    */
-  public void createPool(String strFileConnection) {
+  private void createPool(String strFileConnection) {
     pool = new WadConnection(strFileConnection);
     WADControl.setConnection(pool);
   }
@@ -4310,7 +4239,7 @@
    *          The FieldsData object to copy.
    * @return The new copy of the given FieldsData object.
    */
-  public FieldsData copyarrayElement(FieldsData from) {
+  private FieldsData copyarrayElement(FieldsData from) {
     final FieldsData toAux = new FieldsData();
     toAux.realname = from.realname;
     toAux.name = from.name;
@@ -4359,7 +4288,7 @@
    *          The array of FieldsData objects to copy.
    * @return The copy array of FieldsData objects.
    */
-  public FieldsData[] copyarray(FieldsData[] from) {
+  private FieldsData[] copyarray(FieldsData[] from) {
     log4j.debug("Starting copyarray: " + from.length);
     if (from == null)
       return null;
@@ -4377,7 +4306,7 @@
    * @param strFileProperties
    *          The path of the property file to read.
    */
-  public void readProperties(String strFileProperties) {
+  private void readProperties(String strFileProperties) {
     // Read properties file.
     final Properties properties = new Properties();
     try {
diff -r ada0aad2a115 -r 4d16fada2ef5 
src-wad/src/org/openbravo/wad/WadActionButton.java
--- a/src-wad/src/org/openbravo/wad/WadActionButton.java        Fri Nov 26 
16:24:04 2010 +0100
+++ b/src-wad/src/org/openbravo/wad/WadActionButton.java        Fri Nov 26 
16:12:35 2010 +0100
@@ -39,9 +39,7 @@
  * @author Fernando Iriazabal
  * 
  */
-public class WadActionButton {
-  static final int IMAGE_EDITION_WIDTH = 16;
-  static final int IMAGE_EDITION_HEIGHT = 16;
+class WadActionButton {
 
   /**
    * Generates the action button call for the java of the window.
@@ -744,12 +742,6 @@
    *          Language to translate.
    * @param isGeneric
    *          Indicates if is a generic action button or not.
-   * @param calendarDescription
-   *          String with the description for the calendar controls.
-   * @param clockDescription
-   *          String with the description for the clock controls.
-   * @param calculatorDescription
-   *          String with the description for the calc controls.
    * @param jsDateFormat
    *          Date format for js.
    * @param vecReloads
@@ -758,9 +750,8 @@
    */
   public static void buildHtml(ConnectionProvider conn, XmlEngine xmlEngine, 
File fileDir,
       FieldsData fd, Vector<Object> vecFields, int max_textbox_length,
-      int max_size_edition_1_columns, String strLanguage, boolean isGeneric,
-      String calendarDescription, String clockDescription, String 
calculatorDescription,
-      String jsDateFormat, Vector<Object> vecReloads) throws ServletException, 
IOException {
+      int max_size_edition_1_columns, String strLanguage, boolean isGeneric, 
String jsDateFormat,
+      Vector<Object> vecReloads) throws ServletException, IOException {
     final String[] discard = { "", "isGeneric", "fieldDiscardProcess", "" };
     if (fd.xmltext.equals(""))
       discard[0] = "helpDiscard";
diff -r ada0aad2a115 -r 4d16fada2ef5 
src-wad/src/org/openbravo/wad/WadConnection.java
--- a/src-wad/src/org/openbravo/wad/WadConnection.java  Fri Nov 26 16:24:04 
2010 +0100
+++ b/src-wad/src/org/openbravo/wad/WadConnection.java  Fri Nov 26 16:12:35 
2010 +0100
@@ -33,13 +33,12 @@
 import org.openbravo.database.ConnectionProvider;

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to