details:   /erp/devel/int/rev/eecd5dedc0dc
changeset: 6455:eecd5dedc0dc
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu Feb 18 12:36:08 2010 +0100
summary:   fixed bug 11113: Small fixes and improved comments

details:   /erp/devel/int/rev/160a70ea1019
changeset: 6456:160a70ea1019
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu Feb 18 13:44:45 2010 +0100
summary:   related to issue 11039: Fixed access problem for not admin roles

details:   /erp/devel/int/rev/4a410faff223
changeset: 6457:4a410faff223
user:      Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
date:      Thu Feb 18 18:22:05 2010 +0530
summary:   Fixes Issue 11793: An error appears when a csv is imported in Import 
File Loader.

details:   /erp/devel/int/rev/7b157c34710b
changeset: 6458:7b157c34710b
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu Feb 18 14:40:22 2010 +0100
summary:   fixed erp_devel_int-pgsql-db-full-consistency-test build #353

details:   /erp/devel/int/rev/063c6835e1aa
changeset: 6459:063c6835e1aa
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu Feb 18 16:12:39 2010 +0100
summary:   fixed bug 12338: In settlement window, in relation mode, are not 
shown all records

details:   /erp/devel/int/rev/d75125e81ced
changeset: 6460:d75125e81ced
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Feb 18 18:22:01 2010 +0100
summary:   Added comment to javadoc

diffstat:

 src-db/database/sourcedata/AD_FIELD.xml                   |   1 +
 src/org/openbravo/base/model/domaintype/DomainType.java   |   3 ++
 src/org/openbravo/erpCommon/ad_forms/FileImport.java      |  17 ++++++++++----
 src/org/openbravo/erpCommon/ad_forms/FileImport_data.xsql |   5 ++-
 src/org/openbravo/erpCommon/obps/ActivationKey.java       |  11 +++++----
 src/org/openbravo/erpCommon/utility/VerticalMenu.java     |  13 +++++++----
 src/org/openbravo/reference/ui/UIText.java                |   2 +-
 7 files changed, 34 insertions(+), 18 deletions(-)

diffs (174 lines):

diff -r 0e103bbcd82f -r d75125e81ced src-db/database/sourcedata/AD_FIELD.xml
--- a/src-db/database/sourcedata/AD_FIELD.xml   Thu Feb 18 11:12:09 2010 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml   Thu Feb 18 18:22:01 2010 +0100
@@ -194386,6 +194386,7 @@
 <!--7FDC7A18D86B83EAE040007F01012E08-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--7FDC7A18D86B83EAE040007F01012E08-->  <NAME><![CDATA[Last Ping]]></NAME>
 <!--7FDC7A18D86B83EAE040007F01012E08-->  <DESCRIPTION><![CDATA[Time for the 
last time the session sent ping]]></DESCRIPTION>
+<!--7FDC7A18D86B83EAE040007F01012E08-->  <HELP><![CDATA[Stores the last time 
the session made ping through the UI. In this way it is possible to determine 
whether the browser was closed without doing log out.]]></HELP>
 <!--7FDC7A18D86B83EAE040007F01012E08-->  
<ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--7FDC7A18D86B83EAE040007F01012E08-->  <AD_TAB_ID><![CDATA[475]]></AD_TAB_ID>
 <!--7FDC7A18D86B83EAE040007F01012E08-->  
<AD_COLUMN_ID><![CDATA[7FDC7A18D86783EAE040007F01012E08]]></AD_COLUMN_ID>
diff -r 0e103bbcd82f -r d75125e81ced 
src/org/openbravo/base/model/domaintype/DomainType.java
--- a/src/org/openbravo/base/model/domaintype/DomainType.java   Thu Feb 18 
11:12:09 2010 +0100
+++ b/src/org/openbravo/base/model/domaintype/DomainType.java   Thu Feb 18 
18:22:01 2010 +0100
@@ -67,6 +67,9 @@
   /**
    * Is called during the initialization of the model layer. Is called after 
the
    * {...@link #setModelProvider(ModelProvider)}.
+   * 
+   * Note: any subclass should clean-up and close database connections or 
hibernate sessions. If
+   * this is not done then the update.database task may hang when disabling 
foreign keys.
    */
   void initialize();
 
diff -r 0e103bbcd82f -r d75125e81ced 
src/org/openbravo/erpCommon/ad_forms/FileImport.java
--- a/src/org/openbravo/erpCommon/ad_forms/FileImport.java      Thu Feb 18 
11:12:09 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/FileImport.java      Thu Feb 18 
18:22:01 2010 +0100
@@ -119,7 +119,7 @@
           constant = constant + 1;
         } else
           texto.append(parseField(data2[i].getField(String.valueOf(j - 
constant)),
-              data[j].fieldlength, data[j].datatype, data[j].dataformat, 
data[j].decimalpoint));
+              data[j].fieldlength, data[j].datatype, data[j].dataformat, 
data[j].decimalpoint, ""));
         if (i == 0 && strFirstLineHeader.equalsIgnoreCase("Y"))
           texto.append("</th>");
         else
@@ -175,7 +175,8 @@
             constant = constant + 1;
           } else
             strValues.append(parseField(data2[i].getField(String.valueOf(j - 
constant)),
-                data[j].fieldlength, data[j].datatype, data[j].dataformat, 
data[j].decimalpoint));
+                data[j].fieldlength, data[j].datatype, data[j].dataformat, 
data[j].decimalpoint,
+                data[j].referencename));
           strValues.append("'");
           strFields.append(strValues);
           strValues.delete(0, strValues.length());
@@ -228,7 +229,11 @@
   }
 
   private String parseField(String strTexto, String strLength, String 
strDataType,
-      String strDataFormat, String strDecimalPoint) throws ServletException {
+      String strDataFormat, String strDecimalPoint, String strReferenceName)
+      throws ServletException {
+    if (strReferenceName.equals("TableDir")) {
+      strLength = "32";
+    }
     if (strDataType.equals("D")) {
       strTexto = FileImportData.parseDate(this, strTexto, strDataFormat);
       return strTexto;
@@ -364,8 +369,10 @@
             sb.append(data[j].constantvalue);
             constant = constant + 1;
           } else
-            sb.append(parseField(data2[i].getField(String.valueOf(j - 
constant)),
-                data[j].fieldlength, data[j].datatype, data[j].dataformat, 
data[j].decimalpoint));
+            sb
+                .append(parseField(data2[i].getField(String.valueOf(j - 
constant)),
+                    data[j].fieldlength, data[j].datatype, data[j].dataformat,
+                    data[j].decimalpoint, ""));
           if (i == 0 && strFirstLineHeader.equalsIgnoreCase("Y"))
             sb.append("</th>");
           else
diff -r 0e103bbcd82f -r d75125e81ced 
src/org/openbravo/erpCommon/ad_forms/FileImport_data.xsql
--- a/src/org/openbravo/erpCommon/ad_forms/FileImport_data.xsql Thu Feb 18 
11:12:09 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/FileImport_data.xsql Thu Feb 18 
18:22:01 2010 +0100
@@ -28,10 +28,11 @@
       <SqlMethodComment></SqlMethodComment>
       <Sql> <![CDATA[
         SELECT f.SeqNo,c.ColumnName,f.StartNo,f.EndNo,f.DataType,c.FieldLength,
-        f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout, 
f.Name
-        FROM AD_ImpFormat_Row f,AD_Column c
+        f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout, 
f.Name, r.name AS referenceName
+        FROM AD_ImpFormat_Row f,AD_Column c, AD_Reference r
         WHERE AD_ImpFormat_ID = ?
         AND f.AD_Column_ID=c.AD_Column_ID
+        AND r.AD_Reference_ID=c.AD_Reference_ID
         ORDER BY SeqNo
       ]]></Sql>
     <Parameter name="adImpformatId"/>
diff -r 0e103bbcd82f -r d75125e81ced 
src/org/openbravo/erpCommon/obps/ActivationKey.java
--- a/src/org/openbravo/erpCommon/obps/ActivationKey.java       Thu Feb 18 
11:12:09 2010 +0100
+++ b/src/org/openbravo/erpCommon/obps/ActivationKey.java       Thu Feb 18 
18:22:01 2010 +0100
@@ -343,8 +343,7 @@
 
       // maxUsers==0 is unlimited concurrent users
       if (maxUsers != 0) {
-        boolean adminMode = OBContext.getOBContext().isInAdministratorMode();
-        OBContext.getOBContext().setInAdministratorMode(true);
+        boolean adminMode = 
OBContext.getOBContext().setInAdministratorMode(true);
         int activeSessions = 0;
         try {
           activeSessions = getActiveSessions(currentSession);
@@ -380,8 +379,10 @@
   }
 
   /**
-   * Looks for all active sessions that haven't send a ping during last 
PING_TIMEOUT_SECS seconds
-   * and deactivates them.
+   * Looks for all active sessions that have not had activity during last
+   * {...@link ActivationKey#PING_TIMEOUT_SECS} seconds and deactivates them. 
Activity is tracked by
+   * the requests the browser sends to look for alerts (see
+   * {...@link org.openbravo.erpCommon.utility.VerticalMenu}).
    */
   private boolean deactivateTimeOutSessions() {
     // Last valid ping time is current time substract timeout seconds
@@ -418,7 +419,7 @@
     if (currentSession != null && !currentSession.equals("")) {
       obCriteria.add(Expression.ne(Session.PROPERTY_ID, currentSession));
     }
-    return obCriteria.list().size();
+    return obCriteria.count();
   }
 
   public String toString(ConnectionProvider conn, String lang) {
diff -r 0e103bbcd82f -r d75125e81ced 
src/org/openbravo/erpCommon/utility/VerticalMenu.java
--- a/src/org/openbravo/erpCommon/utility/VerticalMenu.java     Thu Feb 18 
11:12:09 2010 +0100
+++ b/src/org/openbravo/erpCommon/utility/VerticalMenu.java     Thu Feb 18 
18:22:01 2010 +0100
@@ -61,7 +61,7 @@
     } else if (vars.commandIn("ALL")) {
       printPageDataSheet(response, vars, "0", true);
     } else if (vars.commandIn("ALERT")) {
-      pingSession(vars);
+      updateSessionLastActivity(vars);
       printPageAlert(response, vars);
     } else if (vars.commandIn("LOADING")) {
       printPageLoadingMenu(response, vars);
@@ -70,18 +70,21 @@
   }
 
   /**
-   * Updates the session's last ping value to keep trace of the last time the 
browser sent a ping
-   * for the current session.
+   * Updates last time the browser checked for alerts (ping) this info is 
later used (in
+   * {...@link org.openbravo.erpCommon.obps.ActivationKey}) to find no longer 
used sessions because the
+   * browser was closed without the user explicitly closing the session.
    */
-  private void pingSession(VariablesSecureApp vars) {
+  private void updateSessionLastActivity(VariablesSecureApp vars) {
     String sessionId = vars.getDBSession();
     Date now = new Date();
     log4j.debug("ping session:" + sessionId + " - time" + now);
     if (sessionId != null && !sessionId.isEmpty()) {
-      boolean adminMode = OBContext.getOBContext().isInAdministratorMode();
+      boolean adminMode = 
OBContext.getOBContext().setInAdministratorMode(true);
       try {
         Session session = OBDal.getInstance().get(Session.class, sessionId);
         session.setLastPing(now);
+        // flush to force commit in admin mode
+        OBDal.getInstance().flush();
       } catch (Exception e) {
         log4j.error("Error in session ping", e);
       } finally {
diff -r 0e103bbcd82f -r d75125e81ced src/org/openbravo/reference/ui/UIText.java
--- a/src/org/openbravo/reference/ui/UIText.java        Thu Feb 18 11:12:09 
2010 +0100
+++ b/src/org/openbravo/reference/ui/UIText.java        Thu Feb 18 18:22:01 
2010 +0100
@@ -18,7 +18,7 @@
  */
 package org.openbravo.reference.ui;
 
-public class UIText extends UIReference {
+public class UIText extends UIString {
   public UIText(String reference, String subreference) {
     super(reference, subreference);
   }

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to