From 84f93dd0ac016516a9408f6ebf7249af6fe73bcd Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 22 Nov 2013 08:17:27 +0800 Subject: [PATCH 1/2] Update core product version to 2.0.0. Fixed installation and script. --- org.adempiere.server-feature/build.xml | 4 ++-- org.idempiere.eclipse.platform-feature/update.bat | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/org.adempiere.server-feature/build.xml b/org.adempiere.server-feature/build.xml index d47ae20552..2574c8cc76 100644 --- a/org.adempiere.server-feature/build.xml +++ b/org.adempiere.server-feature/build.xml @@ -39,8 +39,8 @@ - + diff --git a/org.idempiere.eclipse.platform-feature/update.bat b/org.idempiere.eclipse.platform-feature/update.bat index c94db344cf..d3805cce4c 100644 --- a/org.idempiere.eclipse.platform-feature/update.bat +++ b/org.idempiere.eclipse.platform-feature/update.bat @@ -7,6 +7,10 @@ cp idempiere.ini idempiere.ini.sav if exist server.xml.sav del /q server.xml.sav if exist plugins/org.adempiere.tomcat.config_1.0.0/META-INF/tomcat/server.xml ( copy plugins/org.adempiere.tomcat.config_1.0.0/META-INF/tomcat/server.xml server.xml.sav + del /q plugins/org.adempiere.tomcat.config_1.0.0/META-INF/tomcat/server.xml +) +if exist plugins/org.adempiere.tomcat.config_2.0.0/META-INF/tomcat/server.xml ( + copy plugins/org.adempiere.tomcat.config_2.0.0/META-INF/tomcat/server.xml server.xml.sav ) java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %~dp0 -repository %1 -u org.adempiere.server.product @@ -15,6 +19,6 @@ java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.ins cp idempiere.ini.sav idempiere.ini if exist server.xml.sav ( - copy server.xml.sav plugins/org.adempiere.tomcat.config_1.0.0/META-INF/tomcat/server.xml + copy server.xml.sav plugins/org.adempiere.tomcat.config_2.0.0/META-INF/tomcat/server.xml del /q server.xml.sav ) From 30f1b4a70f39b9a43db020163e573131f936c962 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 21 Nov 2013 21:24:46 -0500 Subject: [PATCH 2/2] IDEMPIERE-1563 Data Packout export all columns even if the Select hasn't all / IDEMPIERE-1564 Data Packout not exporting translations --- .../handler/GenericPOElementHandler.java | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java index 265ab607cb..9078b413b7 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/GenericPOElementHandler.java @@ -18,6 +18,7 @@ package org.adempiere.pipo2.handler; import java.sql.PreparedStatement; import java.sql.ResultSet; +import java.sql.SQLException; import java.sql.Statement; import java.util.List; import java.util.logging.Level; @@ -28,13 +29,14 @@ import org.adempiere.exceptions.AdempiereException; import org.adempiere.model.GenericPO; import org.adempiere.pipo2.AbstractElementHandler; import org.adempiere.pipo2.DataElementParameters; +import org.adempiere.pipo2.Element; import org.adempiere.pipo2.ElementHandler; import org.adempiere.pipo2.PIPOContext; +import org.adempiere.pipo2.PackOut; import org.adempiere.pipo2.PackoutItem; import org.adempiere.pipo2.PoExporter; -import org.adempiere.pipo2.Element; -import org.adempiere.pipo2.PackOut; import org.adempiere.pipo2.PoFiller; +import org.compiere.model.MColumn; import org.compiere.model.MRole; import org.compiere.model.MTable; import org.compiere.model.PO; @@ -88,6 +90,7 @@ public class GenericPOElementHandler extends AbstractElementHandler { return; } po.saveEx(); + element.recordId = po.get_ID(); } public void endElement(PIPOContext ctx, Element element) throws SAXException { @@ -108,6 +111,7 @@ public class GenericPOElementHandler extends AbstractElementHandler { int tableId = Env.getContextAsInt(ctx.ctx, DataElementParameters.AD_TABLE_ID); String tableName = MTable.getTableName(ctx.ctx, tableId); List excludes = defaultExcludeList(tableName); + boolean checkExcluded = ! sql.toLowerCase().startsWith("select *"); Statement stmt = null; ResultSet rs = null; try { @@ -122,6 +126,31 @@ public class GenericPOElementHandler extends AbstractElementHandler { boolean createElement = isPackOutElement(ctx, po); + if (checkExcluded) { // IDEMPIERE-1563 + MTable table = MTable.get(ctx.ctx, tableId); + for (MColumn column : table.getColumns(false)) { + try { + rs.findColumn(column.getColumnName()); + } catch (SQLException e) { + if (column.getColumnName().equals("AD_Client_ID") || column.getColumnName().equals("AD_Org_ID")) { + throw new Exception("SQL Statement must include AD_Client_ID and AD_Org_ID"); + } + if (!excludes.contains(column.getColumnName().toLowerCase())) { + excludes.add(column.getColumnName().toLowerCase()); + } + } + } + for (String keycol : po.get_KeyColumns()) { + if (excludes.contains(keycol.toLowerCase())) { + throw new Exception("SQL Statement must include key columns"); + } + } + if (excludes.contains(po.getUUIDColumnName().toLowerCase())) { + throw new Exception("SQL Statement must include UUID column"); + } + checkExcluded = false; + } + if (createElement) { if (po.get_ID() > 0) { ElementHandler handler = ctx.packOut.getHandler(po.get_TableName()); @@ -136,6 +165,12 @@ public class GenericPOElementHandler extends AbstractElementHandler { document.startElement("","", tableName, atts); PoExporter filler = new PoExporter(ctx, document, po); filler.export(excludes, true); + ctx.packOut.getCtx().ctx.put("Table_Name",tableName); + try { + new CommonTranslationHandler().packOut(ctx.packOut,document,null,po.get_ID()); + } catch(Exception e) { + if (log.isLoggable(Level.INFO)) log.info(e.toString()); + } } }