Author: hansbak
Date: Mon Feb 27 07:33:05 2012
New Revision: 1294048
URL: http://svn.apache.org/viewvc?rev=1294048&view=rev
Log:
In 'data export all' be able to select a fromdate , tabs to spaces in a birt
file from last commit. Contribution from Chattree
Modified:
ofbiz/trunk/framework/birt/src/org/ofbiz/birt/BirtFactory.java
ofbiz/trunk/framework/webtools/servicedef/services.xml
ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java
ofbiz/trunk/framework/webtools/webapp/webtools/entity/EntityExportAll.ftl
Modified: ofbiz/trunk/framework/birt/src/org/ofbiz/birt/BirtFactory.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/birt/src/org/ofbiz/birt/BirtFactory.java?rev=1294048&r1=1294047&r2=1294048&view=diff
==============================================================================
--- ofbiz/trunk/framework/birt/src/org/ofbiz/birt/BirtFactory.java (original)
+++ ofbiz/trunk/framework/birt/src/org/ofbiz/birt/BirtFactory.java Mon Feb 27
07:33:05 2012
@@ -36,8 +36,8 @@ import org.xml.sax.SAXException;
*
*/
public class BirtFactory {
-
- public final static String module = BirtFactory.class.getName();
+
+ public final static String module = BirtFactory.class.getName();
protected static IReportEngine engine;
Modified: ofbiz/trunk/framework/webtools/servicedef/services.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/servicedef/services.xml?rev=1294048&r1=1294047&r2=1294048&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/servicedef/services.xml (original)
+++ ofbiz/trunk/framework/webtools/servicedef/services.xml Mon Feb 27 07:33:05
2012
@@ -87,6 +87,7 @@ under the License.
<description>Exports all entities into xml files</description>
<permission-service service-name="entityMaintPermCheck"
main-action="VIEW"/>
<attribute name="outpath" type="String" mode="IN" optional="true"/>
+ <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
<attribute name="txTimeout" type="Integer" mode="IN" optional="true"/>
<attribute name="results" type="List" mode="OUT" optional="false"/>
</service>
Modified:
ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java?rev=1294048&r1=1294047&r2=1294048&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java
(original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java
Mon Feb 27 07:33:05 2012
@@ -31,6 +31,7 @@ import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.sql.Timestamp;
import java.text.NumberFormat;
import java.util.Collection;
import java.util.Iterator;
@@ -62,6 +63,8 @@ import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.DelegatorFactory;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityCondition;
+import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.model.ModelEntity;
import org.ofbiz.entity.model.ModelField;
import org.ofbiz.entity.model.ModelFieldType;
@@ -468,6 +471,7 @@ public class WebToolsServices {
Delegator delegator = dctx.getDelegator();
Locale locale = (Locale) context.get("locale");
String outpath = (String)context.get("outpath"); // mandatory
+ Timestamp fromDate = (Timestamp)context.get("fromDate");
Integer txTimeout = (Integer)context.get("txTimeout");
if (txTimeout == null) {
txTimeout = Integer.valueOf(7200);
@@ -505,7 +509,11 @@ public class WebToolsServices {
boolean beganTx = TransactionUtil.begin();
// some databases don't support cursors, or other
problems may happen, so if there is an error here log it and move on to get as
much as possible
try {
- values = delegator.find(curEntityName, null, null,
null, me.getPkFieldNames(), null);
+ List<EntityCondition> conds =
FastList.newInstance();
+ if (UtilValidate.isNotEmpty(fromDate)) {
+
conds.add(EntityCondition.makeCondition("createdStamp",
EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
+ }
+ values = delegator.find(curEntityName,
EntityCondition.makeCondition(conds), null, null, me.getPkFieldNames(), null);
} catch (Exception entityEx) {
results.add("["+fileNumber +"] [xxx] Error when
writing " + curEntityName + ": " + entityEx);
continue;
Modified:
ofbiz/trunk/framework/webtools/webapp/webtools/entity/EntityExportAll.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/entity/EntityExportAll.ftl?rev=1294048&r1=1294047&r2=1294048&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/entity/EntityExportAll.ftl
(original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/entity/EntityExportAll.ftl
Mon Feb 27 07:33:05 2012
@@ -29,6 +29,7 @@ under the License.
<hr />
<form method="post" action="<@ofbizUrl>entityExportAll</@ofbizUrl>">
${uiLabelMap.WebtoolsOutputDirectory}: <input type="text" size="60"
name="outpath" value="${outpath?if_exists}" /><br />
+ ${uiLabelMap.CommonFromDate}: <@htmlTemplate.renderDateTimeField
name="fromDate" event="" action="" className="" alert="" title="Format:
yyyy-MM-dd HH:mm:ss.SSS" value="" size="25" maxlength="30" id="fromDate"
dateType="date" shortDateInput=false timeDropdownParamName=""
defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName=""
classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour=""
ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/><br/>
${uiLabelMap.WebtoolsTimeoutSeconds}: <input type="text" size="6"
value="${txTimeout?default('7200')}" name="txTimeout"/><br />
<br />
<input type="submit" value="${uiLabelMap.WebtoolsExport}" />