details:   /erp/erp/devel/pi/rev/5119672b83ad
changeset: 4924:5119672b83ad
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Tue Sep 15 10:22:10 2009 +0200
summary:   Added maxmemory to update.database.java, to try to fix memory issues 
on automatic builds.

details:   /erp/erp/devel/pi/rev/62e892556d3d
changeset: 4925:62e892556d3d
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Tue Sep 15 10:39:57 2009 +0200
summary:   Added finally clause to the ShowImageLogo servlet.

details:   /erp/erp/devel/pi/rev/9e7a6a899faa
changeset: 4926:9e7a6a899faa
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Tue Sep 15 10:48:55 2009 +0200
summary:   Fixed isused values in ad_textinterfaces.

diffstat:

 src-db/database/build.xml                              |   2 +-
 src-db/database/sourcedata/AD_TEXTINTERFACES.xml       |   6 +-
 src/org/openbravo/erpCommon/utility/ShowImageLogo.java |  80 
++++++++++---------
 3 files changed, 45 insertions(+), 43 deletions(-)

diffs (137 lines):

diff -r 7185146af9f0 -r 9e7a6a899faa src-db/database/build.xml
--- a/src-db/database/build.xml Sun Sep 13 02:19:16 2009 +0200
+++ b/src-db/database/build.xml Tue Sep 15 10:48:55 2009 +0200
@@ -157,7 +157,7 @@
 
   <target name="update.database.java">
     <antcall target="fix.date.${bbdd.rdbms}" />
-    <java classname="org.openbravo.ddlutils.task.AlterDatabaseJava" 
fork="true">
+    <java classname="org.openbravo.ddlutils.task.AlterDatabaseJava" 
fork="true" maxmemory="${build.maxmemory}">
       <arg value="${bbdd.driver}"/>
       <arg value="${bbdd.owner.url}"/>
       <arg value="${bbdd.user}"/>
diff -r 7185146af9f0 -r 9e7a6a899faa 
src-db/database/sourcedata/AD_TEXTINTERFACES.xml
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml  Sun Sep 13 02:19:16 
2009 +0200
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml  Tue Sep 15 10:48:55 
2009 +0200
@@ -4426,7 +4426,7 @@
 <!--803637-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--803637-->  <TEXT><![CDATA[Attribute]]></TEXT>
 <!--803637-->  
<FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportProductionPDF.fo]]></FILENAME>
-<!--803637-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--803637-->  <ISUSED><![CDATA[N]]></ISUSED>
 <!--803637-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--803637--></AD_TEXTINTERFACES>
 
@@ -13377,7 +13377,7 @@
 <!--808473-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--808473-->  <TEXT><![CDATA[Totals]]></TEXT>
 <!--808473-->  
<FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.jrxml]]></FILENAME>
-<!--808473-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--808473-->  <ISUSED><![CDATA[N]]></ISUSED>
 <!--808473-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--808473--></AD_TEXTINTERFACES>
 
@@ -14004,7 +14004,7 @@
 <!--809756-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--809756-->  <TEXT><![CDATA[Totals]]></TEXT>
 <!--809756-->  
<FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportProjectProfitabilityJR.jrxml]]></FILENAME>
-<!--809756-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--809756-->  <ISUSED><![CDATA[N]]></ISUSED>
 <!--809756-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--809756--></AD_TEXTINTERFACES>
 
diff -r 7185146af9f0 -r 9e7a6a899faa 
src/org/openbravo/erpCommon/utility/ShowImageLogo.java
--- a/src/org/openbravo/erpCommon/utility/ShowImageLogo.java    Sun Sep 13 
02:19:16 2009 +0200
+++ b/src/org/openbravo/erpCommon/utility/ShowImageLogo.java    Tue Sep 15 
10:48:55 2009 +0200
@@ -56,50 +56,52 @@
     } else {
       adminMode = OBContext.getOBContext().isInAdministratorMode();
     }
-    OBContext.getOBContext().setInAdministratorMode(true);
+    try {
+      OBContext.getOBContext().setInAdministratorMode(true);
 
-    String logo = vars.getStringParameter("logo");
-    if (logo == null || logo.equals(""))
-      return;
+      String logo = vars.getStringParameter("logo");
+      if (logo == null || logo.equals(""))
+        return;
 
-    Image img = null;
-    if (logo.equals("yourcompanylogin")) {
-      img = OBDal.getInstance().get(SystemInformation.class, 
"0").getYourCompanyLoginImage();
-    } else if (logo.equals("youritservicelogin")) {
-      img = OBDal.getInstance().get(SystemInformation.class, 
"0").getYourItServiceLoginImage();
-    } else if (logo.equals("yourcompanymenu")) {
-      img = 
OBContext.getOBContext().getCurrentClient().getClientInformationList().get(0)
-          .getYourCompanyMenuImage();
-      if (img == null)
-        img = OBDal.getInstance().get(SystemInformation.class, 
"0").getYourCompanyMenuImage();
-    } else if (logo.equals("yourcompanybig")) {
-      img = 
OBContext.getOBContext().getCurrentClient().getClientInformationList().get(0)
-          .getYourCompanyBigImage();
-      if (img == null)
-        img = OBDal.getInstance().get(SystemInformation.class, 
"0").getYourCompanyBigImage();
-    } else if (logo.equals("yourcompanydoc")) {
-      img = 
OBContext.getOBContext().getCurrentOrganization().getOrganizationInformationList().get(
-          0).getYourCompanyDocumentImage();
-      if (img == null)
-        img = OBDal.getInstance().get(SystemInformation.class, 
"0").getYourCompanyDocumentImage();
-    } else
-      return;
-    if (img != null) {
-      byte[] imageBytes = img.getBindaryData();
-      if (imageBytes != null) {
+      Image img = null;
+      if (logo.equals("yourcompanylogin")) {
+        img = OBDal.getInstance().get(SystemInformation.class, 
"0").getYourCompanyLoginImage();
+      } else if (logo.equals("youritservicelogin")) {
+        img = OBDal.getInstance().get(SystemInformation.class, 
"0").getYourItServiceLoginImage();
+      } else if (logo.equals("yourcompanymenu")) {
+        img = 
OBContext.getOBContext().getCurrentClient().getClientInformationList().get(0)
+            .getYourCompanyMenuImage();
+        if (img == null)
+          img = OBDal.getInstance().get(SystemInformation.class, 
"0").getYourCompanyMenuImage();
+      } else if (logo.equals("yourcompanybig")) {
+        img = 
OBContext.getOBContext().getCurrentClient().getClientInformationList().get(0)
+            .getYourCompanyBigImage();
+        if (img == null)
+          img = OBDal.getInstance().get(SystemInformation.class, 
"0").getYourCompanyBigImage();
+      } else if (logo.equals("yourcompanydoc")) {
+        img = 
OBContext.getOBContext().getCurrentOrganization().getOrganizationInformationList()
+            .get(0).getYourCompanyDocumentImage();
+        if (img == null)
+          img = OBDal.getInstance().get(SystemInformation.class, 
"0").getYourCompanyDocumentImage();
+      } else
+        return;
+      if (img != null) {
+        byte[] imageBytes = img.getBindaryData();
+        if (imageBytes != null) {
+          OutputStream out = response.getOutputStream();
+          response.setContentLength(imageBytes.length);
+          out.write(imageBytes);
+          out.close();
+        }
+      } else { // If there is not image to show return blank.gif
+        String sourcePath = vars.getSessionValue("#sourcePath");
         OutputStream out = response.getOutputStream();
-        response.setContentLength(imageBytes.length);
-        out.write(imageBytes);
+        Utility.dumpFile(sourcePath + "/web/images/blank.gif", out);
         out.close();
+
       }
-    } else { // If there is not image to show return blank.gif
-      String sourcePath = vars.getSessionValue("#sourcePath");
-      OutputStream out = response.getOutputStream();
-      Utility.dumpFile(sourcePath + "/web/images/blank.gif", out);
-      out.close();
-
+    } finally {
+      OBContext.getOBContext().setInAdministratorMode(adminMode);
     }
-
-    OBContext.getOBContext().setInAdministratorMode(adminMode);
   }
 }

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to