From a3d7cdb085fa2df15e05e2bebbc2562ed6a23e51 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Sat, 12 Apr 2008 10:15:18 +0000 Subject: [PATCH] A patch from Ray Barlow "XML export of a no-auto-stamp entity does not work" (https://issues.apache.org/jira/browse/OFBIZ-1728) - OFBIZ-1728 git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@647413 13f79535-47bb-0310-9956-ffa450edef68 --- .../webtools/WEB-INF/actions/entity/xmldsdump.bsh | 14 ++++++++++++-- .../webapp/webtools/entity/xmldsrawdump.jsp | 13 ++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/framework/webtools/webapp/webtools/WEB-INF/actions/entity/xmldsdump.bsh b/framework/webtools/webapp/webtools/WEB-INF/actions/entity/xmldsdump.bsh index 8dea3ac1a6..54f0d0fa80 100644 --- a/framework/webtools/webapp/webtools/WEB-INF/actions/entity/xmldsdump.bsh +++ b/framework/webtools/webapp/webtools/WEB-INF/actions/entity/xmldsdump.bsh @@ -220,7 +220,13 @@ if (tobrowser) { boolean beganTransaction = TransactionUtil.begin(3600); try { - EntityListIterator values = delegator.findListIteratorByCondition(curEntityName, entityDateCond, null, null, UtilMisc.toList("-createdTxStamp"), efo); + ModelEntity me = reader.getModelEntity(curEntityName); + EntityListIterator values = null; + if (me.getNoAutoStamp() == true) { + values = delegator.findListIteratorByCondition(curEntityName, null, null, null, me.getPkFieldNames(), efo); + } else { + values = delegator.findListIteratorByCondition(curEntityName, entityDateCond, null, null, UtilMisc.toList("-createdTxStamp"), efo); + } GenericValue value = null; long curNumberWritten = 0; @@ -275,7 +281,11 @@ if (outpath != null){ results.add("["+fileNumber +"] [vvv] " + curEntityName + " skipping view entity"); continue; } - values = delegator.findListIteratorByCondition(curEntityName, entityDateCond, null, null, me.getPkFieldNames(), efo); + if (me.getNoAutoStamp() == true) { + values = delegator.findListIteratorByCondition(curEntityName, null, null, null, me.getPkFieldNames(), efo); + } else { + values = delegator.findListIteratorByCondition(curEntityName, entityDateCond, null, null, me.getPkFieldNames(), efo); + } boolean isFirst = true; PrintWriter writer = null; int fileSplitNumber = 1; diff --git a/framework/webtools/webapp/webtools/entity/xmldsrawdump.jsp b/framework/webtools/webapp/webtools/entity/xmldsrawdump.jsp index 8374594912..8cec3c24bb 100644 --- a/framework/webtools/webapp/webtools/entity/xmldsrawdump.jsp +++ b/framework/webtools/webapp/webtools/entity/xmldsrawdump.jsp @@ -56,10 +56,17 @@ under the License. try { beganTransaction = TransactionUtil.begin(); - Iterator i = passedEntityNames.iterator(); - while(i.hasNext()) { + Iterator i = passedEntityNames.iterator(); + while(i.hasNext()) { String curEntityName = (String)i.next(); - EntityListIterator values = delegator.findListIteratorByCondition(curEntityName, entityDateCond, null, null); + + ModelEntity me = reader.getModelEntity(curEntityName); + EntityListIterator values = null; + if (me.getNoAutoStamp() == true) { + values = delegator.findListIteratorByCondition(curEntityName, null, null, null); + } else { + values = delegator.findListIteratorByCondition(curEntityName, entityDateCond, null, null); + } GenericValue value = null; while ((value = (GenericValue) values.next()) != null) {