details:   https://code.openbravo.com/erp/devel/pi/rev/f73c0354c932
changeset: 15120:f73c0354c932
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Wed Jan 11 18:02:52 2012 +0100
summary:   Fixed issue 13649. Exclude Audit Info will now also apply to 
children objects

diffstat:

 src/org/openbravo/dal/xml/EntityXMLConverter.java     |  18 ++++++++++++++++--
 src/org/openbravo/service/dataset/DataSetService.java |  18 +++++++++++-------
 2 files changed, 27 insertions(+), 9 deletions(-)

diffs (75 lines):

diff -r b240f0e3f5c9 -r f73c0354c932 
src/org/openbravo/dal/xml/EntityXMLConverter.java
--- a/src/org/openbravo/dal/xml/EntityXMLConverter.java Wed Jan 11 17:49:56 
2012 +0100
+++ b/src/org/openbravo/dal/xml/EntityXMLConverter.java Wed Jan 11 18:02:52 
2012 +0100
@@ -288,6 +288,11 @@
 
   protected void export(BaseOBObject obObject, boolean 
isAddedBecauseReferenced)
       throws SAXException {
+    export(obObject, isAddedBecauseReferenced, null);
+  }
+
+  protected void export(BaseOBObject obObject, boolean 
isAddedBecauseReferenced,
+      Boolean excludeAuditInfo) throws SAXException {
     final String entityName = DalUtil.getEntityName(obObject);
 
     final AttributesImpl entityAttrs = new AttributesImpl();
@@ -327,7 +332,10 @@
       exportableProperties = 
DataSetService.getInstance().getExportableProperties(obObject, dst,
           dst.getDataSetColumnList(), optionExportTransientInfo);
     } else {
-      exportableProperties = obObject.getEntity().getProperties();
+      exportableProperties = new 
ArrayList<Property>(obObject.getEntity().getProperties());
+      if (excludeAuditInfo != null && excludeAuditInfo) {
+        DataSetService.getInstance().removeAuditInfo(exportableProperties);
+      }
     }
 
     // export each property
@@ -429,7 +437,13 @@
         for (final Object o : childObjects) {
           // embed in the parent
           if (isOptionEmbedChildren()) {
-            export((BaseOBObject) o, false);
+            final DataSetTable dst = 
dataSetTablesByEntity.get(obObject.getEntity());
+            if ((excludeAuditInfo != null && excludeAuditInfo)
+                || (dst != null && dst.isExcludeAuditInfo())) {
+              export((BaseOBObject) o, false, true);
+            } else {
+              export((BaseOBObject) o, false);
+            }
           } else {
             // add the child as a tag, the child entityname is
             // used as the tagname
diff -r b240f0e3f5c9 -r f73c0354c932 
src/org/openbravo/service/dataset/DataSetService.java
--- a/src/org/openbravo/service/dataset/DataSetService.java     Wed Jan 11 
17:49:56 2012 +0100
+++ b/src/org/openbravo/service/dataset/DataSetService.java     Wed Jan 11 
18:02:52 2012 +0100
@@ -454,18 +454,22 @@
 
     // Remove the auditinfo
     if (dataSetTable.isExcludeAuditInfo()) {
-      final List<Property> toRemove = new ArrayList<Property>();
-      for (final Property p : exportables) {
-        if (p.isAuditInfo()) {
-          toRemove.add(p);
-        }
-      }
-      exportables.removeAll(toRemove);
+      removeAuditInfo(exportables);
     }
 
     return exportables;
   }
 
+  public void removeAuditInfo(List<Property> properties) {
+    final List<Property> toRemove = new ArrayList<Property>();
+    for (final Property p : properties) {
+      if (p.isAuditInfo()) {
+        toRemove.add(p);
+      }
+    }
+    properties.removeAll(toRemove);
+  }
+
   // compares the content of a list by converting the id to a hex
   public static class BaseOBIDHexComparator implements Comparator<Object> {
 

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to