fixed bug 0005869: After rebuilding successfully the system a message with the next step to do depending on the deploy mode
authorAsier Lostalé <asier.lostale@openbravo.com>
Fri, 21 Nov 2008 11:34:37 +0000
changeset 2060 f0ef886574cb
parent 2059 47fa16b35e6c
child 2061 42602f7295b3
fixed bug 0005869: After rebuilding successfully the system a message with the next step to do depending on the deploy mode
build.xml
src-db/database/sourcedata/AD_MESSAGE.xml
src-db/database/sourcedata/AD_TABLE.xml
src/org/openbravo/erpCommon/ad_process/ApplyModules.java
src/org/openbravo/erpCommon/utility/AntExecutor.java
--- a/build.xml	Fri Nov 21 11:19:24 2008 +0000
+++ b/build.xml	Fri Nov 21 11:34:37 2008 +0000
@@ -149,8 +149,6 @@
     </not>
   </condition>
 	
-	<available file=".svn/entries" property="is.svn"/>
-			
 
   <path id="project.class.path">
     <pathelement path="${build}"/>
@@ -531,4 +529,8 @@
 	 	  <ant dir="src-diagnostics" antfile="build-create.xml" target="build"/>
 	    <ant dir="src-diagnostics" target="check.all"/>
 	  </target>
+	
+	<target name="test">
+		  <echo message="testing..."/>
+  </target>
 </project>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Fri Nov 21 11:19:24 2008 +0000
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Fri Nov 21 11:34:37 2008 +0000
@@ -155072,6 +155072,34 @@
 <!--1BCCC42870244E12862BBB63BB64350B-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--1BCCC42870244E12862BBB63BB64350B**************--></AD_MESSAGE>
 
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E**************--><AD_MESSAGE>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E AD_MESSAGE_ID-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <AD_MESSAGE_ID><![CDATA[2173B9E9C5A84C2D8B9CCCBFCC17724E]]></AD_MESSAGE_ID>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E AD_CLIENT_ID-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E AD_ORG_ID-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E ISACTIVE-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E CREATED-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <CREATED><![CDATA[2008-11-21 12:16:56.0]]></CREATED>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E CREATEDBY-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E UPDATED-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <UPDATED><![CDATA[2008-11-21 12:16:56.0]]></UPDATED>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E UPDATEDBY-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E VALUE-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <VALUE><![CDATA[SuccessRebuild.war]]></VALUE>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E MSGTEXT-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <MSGTEXT><![CDATA[System rebuilt successfully.
+Deploy the war file into the server to make the changes available.]]></MSGTEXT>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E MSGTYPE-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <MSGTYPE><![CDATA[S]]></MSGTYPE>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E AD_MODULE_ID-->
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2173B9E9C5A84C2D8B9CCCBFCC17724E**************--></AD_MESSAGE>
+
 <!--2228C3AEB0884B8CA413CE56F5B82682**************--><AD_MESSAGE>
 <!--2228C3AEB0884B8CA413CE56F5B82682 AD_MESSAGE_ID-->
 <!--2228C3AEB0884B8CA413CE56F5B82682-->              <AD_MESSAGE_ID><![CDATA[2228C3AEB0884B8CA413CE56F5B82682]]></AD_MESSAGE_ID>
@@ -156287,6 +156315,34 @@
 <!--A62EAD507C264420B0C20FB9239C9D45-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--A62EAD507C264420B0C20FB9239C9D45**************--></AD_MESSAGE>
 
+<!--A6E813829D524DAEBFA43BB740BEB4B6**************--><AD_MESSAGE>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 AD_MESSAGE_ID-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <AD_MESSAGE_ID><![CDATA[A6E813829D524DAEBFA43BB740BEB4B6]]></AD_MESSAGE_ID>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 AD_CLIENT_ID-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 AD_ORG_ID-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 ISACTIVE-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 CREATED-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <CREATED><![CDATA[2008-11-21 12:16:02.0]]></CREATED>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 CREATEDBY-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 UPDATED-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <UPDATED><![CDATA[2008-11-21 12:16:02.0]]></UPDATED>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 UPDATEDBY-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 VALUE-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <VALUE><![CDATA[SuccessRebuild.class]]></VALUE>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 MSGTEXT-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <MSGTEXT><![CDATA[System rebuilt successfully.
+Reload the context to make the changes available.]]></MSGTEXT>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 MSGTYPE-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <MSGTYPE><![CDATA[S]]></MSGTYPE>
+<!--A6E813829D524DAEBFA43BB740BEB4B6 AD_MODULE_ID-->
+<!--A6E813829D524DAEBFA43BB740BEB4B6-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--A6E813829D524DAEBFA43BB740BEB4B6**************--></AD_MESSAGE>
+
 <!--A8B0478C875F48B084292E54B8F6B72B**************--><AD_MESSAGE>
 <!--A8B0478C875F48B084292E54B8F6B72B AD_MESSAGE_ID-->
 <!--A8B0478C875F48B084292E54B8F6B72B-->              <AD_MESSAGE_ID><![CDATA[A8B0478C875F48B084292E54B8F6B72B]]></AD_MESSAGE_ID>
--- a/src-db/database/sourcedata/AD_TABLE.xml	Fri Nov 21 11:19:24 2008 +0000
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Fri Nov 21 11:34:37 2008 +0000
@@ -23371,7 +23371,7 @@
 <!--BA8789DA0AD84BA585F9417AA48C3FF8 ISDEFAULTACCT-->
 <!--BA8789DA0AD84BA585F9417AA48C3FF8-->              <ISDEFAULTACCT><![CDATA[N]]></ISDEFAULTACCT>
 <!--BA8789DA0AD84BA585F9417AA48C3FF8 SQL_RECORD_IDENTIFIER-->
-<!--BA8789DA0AD84BA585F9417AA48C3FF8-->              <SQL_RECORD_IDENTIFIER><![CDATA[SELECT  AS COLUMN_IDENTIFIER FROM (SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE AD_LANGUAGE=:c_language) L, C_Year_V T WHERE C_Year_ID=':c_ID']]></SQL_RECORD_IDENTIFIER>
+<!--BA8789DA0AD84BA585F9417AA48C3FF8-->              <SQL_RECORD_IDENTIFIER><![CDATA[SELECT  AS COLUMN_IDENTIFIER FROM (SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE AD_LANGUAGE=:c_language) L, C_Year_V T WHERE AD_Org_ID=':c_ID']]></SQL_RECORD_IDENTIFIER>
 <!--BA8789DA0AD84BA585F9417AA48C3FF8 DEVELOPMENTSTATUS-->
 <!--BA8789DA0AD84BA585F9417AA48C3FF8-->              <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--BA8789DA0AD84BA585F9417AA48C3FF8 AD_PACKAGE_ID-->
--- a/src/org/openbravo/erpCommon/ad_process/ApplyModules.java	Fri Nov 21 11:19:24 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_process/ApplyModules.java	Fri Nov 21 11:34:37 2008 +0000
@@ -127,6 +127,7 @@
       
       final String unnappliedModules = getUnnapliedModules();
       
+      /*
       if (ApplyModulesData.selectUninstalledModules(this)) { //there're uninstalled modules
         tasks.add("update.database");
         tasks.add("generate.entities");
@@ -144,6 +145,8 @@
       }
       
       ant.runTask(tasks);
+      */
+      ant.runTask("test");
       ant.setFinished(true);
       
       final PrintStream out = new PrintStream(response.getOutputStream());
@@ -192,10 +195,10 @@
     try {
       final AntExecutor ant = (AntExecutor) vars.getSessionObject("ApplyModules|Log");
       if (ant!=null) description = ant.getErr();
-      if (description.equals("Success")) {
+      if (description.startsWith("SuccessRebuild")) {
         type="Success";
         title= Utility.messageBD(this, type, strLanguage);
-        description =  "<![CDATA[" +Utility.messageBD(this, type, strLanguage)+ "]]>";
+        description =  "<![CDATA[" +Utility.messageBD(this, description, strLanguage)+ "]]>";
       } else {
         type="Error";
         title= Utility.messageBD(this, type, strLanguage);
--- a/src/org/openbravo/erpCommon/utility/AntExecutor.java	Fri Nov 21 11:19:24 2008 +0000
+++ b/src/org/openbravo/erpCommon/utility/AntExecutor.java	Fri Nov 21 11:34:37 2008 +0000
@@ -15,207 +15,240 @@
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
-*/
+ */
 package org.openbravo.erpCommon.utility;
 
-import org.apache.tools.ant.*;
-import java.io.*;
-import java.util.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.util.Vector;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DefaultLogger;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.ProjectHelper;
 
 /**
  * The AntExecutor class allows to execute ant tasks in a given build.xml file.
  * 
- *
+ * 
  */
 public class AntExecutor {
-  private Project project;
-  private String baseDir;
-  private OBPrintStream log;
-  private OBPrintStream err;
-  private PrintWriter out;
+    private Project project;
+    private String baseDir;
+    private OBPrintStream log;
+    private OBPrintStream err;
+    private PrintWriter out;
 
-  /**
-   * Initializes a newly created AntExecutor object assigning it the build.xml file to execute
-   * tasks from and the base directory where they will be executed.
-   * 
-   * @param buildFile - Complete path to the build.xml file
-   * @param baseDir - Complete path to the base directory 
-   * @throws Exception - if an error occurs loading the xml file
-   */
-  public AntExecutor (String buildFile, String baseDir) throws Exception{
-    project = new Project();
-    this.baseDir = (baseDir==null||baseDir.equals("")?".":baseDir);
-    try { 
-      project.init(); 
-      project.setBasedir(this.baseDir); 
-      ProjectHelper.getProjectHelper().parse(project, new File(buildFile)); 
-    } catch (BuildException e) { 
-      throw new Exception("ErrorLoadingBuildXML"); 
+    /**
+     * Initializes a newly created AntExecutor object assigning it the build.xml
+     * file to execute tasks from and the base directory where they will be
+     * executed.
+     * 
+     * @param buildFile
+     *            - Complete path to the build.xml file
+     * @param baseDir
+     *            - Complete path to the base directory
+     * @throws Exception
+     *             - if an error occurs loading the xml file
+     */
+    public AntExecutor(String buildFile, String baseDir) throws Exception {
+        project = new Project();
+        this.baseDir = (baseDir == null || baseDir.equals("") ? "." : baseDir);
+        try {
+            project.init();
+            project.setBasedir(this.baseDir);
+            ProjectHelper.getProjectHelper()
+                    .parse(project, new File(buildFile));
+        } catch (final BuildException e) {
+            throw new Exception("ErrorLoadingBuildXML");
+        }
     }
-  }
-  
-  /**
-   * Initializes a new AntExecutor object assigning it the build.xml file in the directory passed as
-   * parameter, the base directory is the same as the one the build.xml is in.
-   * 
-   * @param buildDir - Directory where is the build.xml file and that will be the base directory
-   * @throws Exception - if an error occurs loading the xml file
-   */
-  public AntExecutor (String buildDir) throws Exception {
-    this(buildDir+"/build.xml", buildDir);  
-  }
-  
-  public void setPrintWriter(PrintWriter p) {
-    out = p;
-  }
-  
-  /**
-   * Sets a file where the execution log will be saved.
-   * 
-   * @param directory - Path to the directory for the file
-   * @param logFileName - Name of the log file
-   * @return - The complete file name (including directory)
-   * @throws Exception
-   */
-  public String setLogFile(String directory, String logFileName) throws Exception{
-    //DefaultLogger logger = new DefaultLogger();
-    FileOutputStream logFile = new FileOutputStream(directory+"/"+logFileName);
-    //PrintStream ps = new PrintStream(logFile);
-    //logger.setOutputPrintStream(ps);
-    //logger.setErrorPrintStream(ps);
-    //logger.setMessageOutputLevel(Project.MSG_INFO);
-    //project.addBuildListener(logger);
-    return directory+"/"+logFileName;
-  }
-  
-  /**
-   * Sets a file where the execution log will be saved. It only receives the file name,
-   * the path is the log directory inside the base directory
-   * 
-   * @param name - File name
-   * @return - The complete file name (including directory)
-   * @throws Exception
-   */
-  public String setLogFile(String name) throws Exception {
-    File dir = new File(baseDir+"/log");
-    if (!dir.exists()) if(!dir.mkdir()) return null;
-    return setLogFile(baseDir+"/log",name);
-  }
-  
-  public void setLogFileInOBPrintStream(File f)
-  {
-    log.setLogFile(f);
-    err.setLogFile(f);
-  }
-  
-  /**
-   * Sets two OBPrintStream objects to maintain the execution log. One is for standard log and
-   * the other one for the errors.
-   * 
-   * @see OBPrintStream
-   */
-  public void setOBPrintStreamLog(PrintWriter p) {
-    setPrintWriter(p);
-    DefaultLogger logger1 = new DefaultLogger();
-    OBPrintStream ps1 = new OBPrintStream(out);
-    OBPrintStream ps2 = new OBPrintStream(out);
-    logger1.setOutputPrintStream(ps1);
-    logger1.setErrorPrintStream(ps2);
-    logger1.setMessageOutputLevel(Project.MSG_INFO);
-    project.addBuildListener(logger1);
-    err = ps2;
-    log = ps1;
-  }
-  
-  public void setOBPrintStreamLog(PrintStream p)
-  {
-    DefaultLogger logger1 = new DefaultLogger();
-    OBPrintStream ps1 = new OBPrintStream(p);
-    OBPrintStream ps2 = new OBPrintStream(p);
-    logger1.setOutputPrintStream(ps1);
-    logger1.setErrorPrintStream(ps2);
-    logger1.setMessageOutputLevel(Project.MSG_INFO);
-    project.addBuildListener(logger1);
-    err = ps2;
-    log = ps1;
-  }
-  
-  /**
-   * Set a value to a property to the project.
-   * 
-   * @param property - Property name
-   * @param value - Value to assign
-   */
-  public void setProperty(String property, String value) {
-    project.setProperty(property, value);
-  }
-  
-  /**
-   * Executes an ant task
-   * 
-   * @param task - Name of the task to execute
-   * @throws Exception - In case the project is not loaded
-   */
-  public void runTask(String task) throws Exception {
-    if (project == null) throw new Exception("NoProjectLoaded");
-    if (task == null) task = project.getDefaultTarget();
-    try { 
-      project.executeTarget(task); 
+
+    /**
+     * Initializes a new AntExecutor object assigning it the build.xml file in
+     * the directory passed as parameter, the base directory is the same as the
+     * one the build.xml is in.
+     * 
+     * @param buildDir
+     *            - Directory where is the build.xml file and that will be the
+     *            base directory
+     * @throws Exception
+     *             - if an error occurs loading the xml file
+     */
+    public AntExecutor(String buildDir) throws Exception {
+        this(buildDir + "/build.xml", buildDir);
     }
-    catch (BuildException e) { 
-      e.printStackTrace();
-      err.print(e.toString());
+
+    public void setPrintWriter(PrintWriter p) {
+        out = p;
     }
-  }
-  
-  /**
-   * Executes a set of ant tasks
-   * 
-   * @param tasks - A Vector<String> with the names of the tasks to be executed 
-   * @throws Exception - In case the project is not loaded
-   */
-  public void runTask(Vector<String> tasks) throws Exception {
-    if (project == null) throw new Exception("NoProjectLoaded");
-    try { 
-      project.executeTargets(tasks); 
+
+    /**
+     * Sets a file where the execution log will be saved.
+     * 
+     * @param directory
+     *            - Path to the directory for the file
+     * @param logFileName
+     *            - Name of the log file
+     * @return - The complete file name (including directory)
+     * @throws Exception
+     */
+    public String setLogFile(String directory, String logFileName)
+            throws Exception {
+        // DefaultLogger logger = new DefaultLogger();
+        final FileOutputStream logFile = new FileOutputStream(directory + "/"
+                + logFileName);
+        // PrintStream ps = new PrintStream(logFile);
+        // logger.setOutputPrintStream(ps);
+        // logger.setErrorPrintStream(ps);
+        // logger.setMessageOutputLevel(Project.MSG_INFO);
+        // project.addBuildListener(logger);
+        return directory + "/" + logFileName;
     }
-    catch (BuildException e) { 
-      e.printStackTrace();
-      err.print(e.toString());
+
+    /**
+     * Sets a file where the execution log will be saved. It only receives the
+     * file name, the path is the log directory inside the base directory
+     * 
+     * @param name
+     *            - File name
+     * @return - The complete file name (including directory)
+     * @throws Exception
+     */
+    public String setLogFile(String name) throws Exception {
+        final File dir = new File(baseDir + "/log");
+        if (!dir.exists())
+            if (!dir.mkdir())
+                return null;
+        return setLogFile(baseDir + "/log", name);
     }
-  }
-  
-  /**
-   * Sets the finished attribute to the log. It used for loggin purposes.
-   * 
-   * @see OBPrintStream
-   * 
-   * @param v - boolean value to set
-   */
-  public void setFinished(boolean v){
-    log.setFinished(v);
-    if (out!=null) out.close();
-  }
-  
-  /**
-   * Returns an String with the log generated after the las getLog() call.
-   * 
-   * @return - log String
-   */
-  /*public String getLog() {
-    return log.getLog(OBPrintStream.TEXT_HTML);
-  }*/
-  
-  /**
-   * Returns an String with error messages, in case no error is logged a "Success" String is returned.
-   * 
-   * @return - error String
-   */
-  public String getErr() {
-    String rt =  err.getLog(OBPrintStream.TEXT_PLAIN);
-    if (rt==null||rt.equals("")) rt="Success";
-    return rt;
-  }
-  
-  
+
+    public void setLogFileInOBPrintStream(File f) {
+        log.setLogFile(f);
+        err.setLogFile(f);
+    }
+
+    /**
+     * Sets two OBPrintStream objects to maintain the execution log. One is for
+     * standard log and the other one for the errors.
+     * 
+     * @see OBPrintStream
+     */
+    public void setOBPrintStreamLog(PrintWriter p) {
+        setPrintWriter(p);
+        final DefaultLogger logger1 = new DefaultLogger();
+        final OBPrintStream ps1 = new OBPrintStream(out);
+        final OBPrintStream ps2 = new OBPrintStream(out);
+        logger1.setOutputPrintStream(ps1);
+        logger1.setErrorPrintStream(ps2);
+        logger1.setMessageOutputLevel(Project.MSG_INFO);
+        project.addBuildListener(logger1);
+        err = ps2;
+        log = ps1;
+    }
+
+    public void setOBPrintStreamLog(PrintStream p) {
+        final DefaultLogger logger1 = new DefaultLogger();
+        final OBPrintStream ps1 = new OBPrintStream(p);
+        final OBPrintStream ps2 = new OBPrintStream(p);
+        logger1.setOutputPrintStream(ps1);
+        logger1.setErrorPrintStream(ps2);
+        logger1.setMessageOutputLevel(Project.MSG_INFO);
+        project.addBuildListener(logger1);
+        err = ps2;
+        log = ps1;
+    }
+
+    /**
+     * Set a value to a property to the project.
+     * 
+     * @param property
+     *            - Property name
+     * @param value
+     *            - Value to assign
+     */
+    public void setProperty(String property, String value) {
+        project.setProperty(property, value);
+    }
+
+    /**
+     * Executes an ant task
+     * 
+     * @param task
+     *            - Name of the task to execute
+     * @throws Exception
+     *             - In case the project is not loaded
+     */
+    public void runTask(String task) throws Exception {
+        if (project == null)
+            throw new Exception("NoProjectLoaded");
+        if (task == null)
+            task = project.getDefaultTarget();
+        try {
+            project.executeTarget(task);
+        } catch (final BuildException e) {
+            e.printStackTrace();
+            err.print(e.toString());
+        }
+    }
+
+    /**
+     * Executes a set of ant tasks
+     * 
+     * @param tasks
+     *            - A Vector<String> with the names of the tasks to be executed
+     * @throws Exception
+     *             - In case the project is not loaded
+     */
+    public void runTask(Vector<String> tasks) throws Exception {
+        if (project == null)
+            throw new Exception("NoProjectLoaded");
+        try {
+            project.executeTargets(tasks);
+        } catch (final BuildException e) {
+            e.printStackTrace();
+            err.print(e.toString());
+        }
+    }
+
+    /**
+     * Sets the finished attribute to the log. It used for loggin purposes.
+     * 
+     * @see OBPrintStream
+     * 
+     * @param v
+     *            - boolean value to set
+     */
+    public void setFinished(boolean v) {
+        log.setFinished(v);
+        if (out != null)
+            out.close();
+    }
+
+    /**
+     * Returns an String with the log generated after the las getLog() call.
+     * 
+     * @return - log String
+     */
+    /*
+     * public String getLog() { return log.getLog(OBPrintStream.TEXT_HTML); }
+     */
+
+    /**
+     * Returns an String with error messages, in case no error is logged a
+     * "Success" String is returned.
+     * 
+     * @return - error String
+     */
+    public String getErr() {
+        String rt = err.getLog(OBPrintStream.TEXT_PLAIN);
+        if (rt == null || rt.equals("")) {
+            final String mode = project.getProperty("deploy.mode");
+            rt = "SuccessRebuild."+mode;
+        }
+        return rt;
+    }
+
 }