From 63558fa7f2c5af03664961703a6d8f48f9800705 Mon Sep 17 00:00:00 2001 From: Deepak Pansheriya Date: Thu, 13 Dec 2012 11:14:52 +0530 Subject: [PATCH] IDEMPIERE-460 Adding Support for Composite Webservice, RequestCtx, Scripting Support --- org.idempiere.webservices/.classpath | 10 +- .../META-INF/MANIFEST.MF | 24 +- .../WEB-INF/src/META-INF/cxf/services.xml | 16 +- .../src/com/_3e/ADInterface/ADInfo.java | 2 +- .../src/com/_3e/ADInterface/ADLookup.java | 24 +- .../src/com/_3e/ADInterface/ADService.java | 63 - .../com/_3e/ADInterface/ADServiceImpl.java | 1628 ----------------- .../src/com/_3e/ADInterface/InfoBPartner.java | 4 +- .../src/com/_3e/ADInterface/InfoProduct.java | 4 +- .../com/_3e/ADInterface/ModelADService.java | 16 +- .../_3e/ADInterface/ModelADServiceImpl.java | 1097 +++++++---- .../src/com/_3e/ADInterface/Process.java | 47 +- .../src/com/adaxa/ws/WebstoreService.java | 22 - .../src/com/adaxa/ws/WebstoreServiceImpl.java | 579 ------ .../src/com/bizidium/ws/CompositeService.java | 17 + .../com/bizidium/ws/CompositeServiceImpl.java | 350 ++++ .../ObPOSInterface/ExternalSales.java | 56 - .../ObPOSInterface/ExternalSalesImpl.java | 174 -- .../globalqss/ObPOSInterface/WebService.java | 60 - .../ObPOSInterface/WebServiceImpl.java | 79 - .../model/I_WS_WebServiceFieldInput.java | 63 + .../org/compiere/model/MWebServiceType.java | 72 +- .../model/X_WS_WebServiceFieldInput.java | 109 +- .../webservices/AbstractService.java | 603 ++++++ .../idempiere/webservices/IWSValidator.java | 28 + .../fault/IdempiereServiceFault.java | 6 +- .../WEB-INF/xsd/WebstoreSchema.xsd | 58 - .../xsd/{schema.xsd => idempiere-schema.xsd} | 100 +- .../WEB-INF/xsd/obschema.xsd | 239 --- org.idempiere.webservices/build.properties | 8 +- .../oracle/WS002_WebServicesDefinition.sql | 113 -- .../oracle/WS005_IdempiereWebservice.sql | 608 ++++++ .../WS002_WebServicesDefinition.sql | 114 -- .../postgresql/WS005_IdempiereWebservice.sql | 617 +++++++ org.idempiere.webservices/plugin.xml | 6 + .../schema/IWSValidator.exsd | 116 ++ 36 files changed, 3457 insertions(+), 3675 deletions(-) delete mode 100644 org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADService.java delete mode 100644 org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADServiceImpl.java delete mode 100644 org.idempiere.webservices/WEB-INF/src/com/adaxa/ws/WebstoreService.java delete mode 100644 org.idempiere.webservices/WEB-INF/src/com/adaxa/ws/WebstoreServiceImpl.java create mode 100644 org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeService.java create mode 100644 org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeServiceImpl.java delete mode 100644 org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/ExternalSales.java delete mode 100644 org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/ExternalSalesImpl.java delete mode 100644 org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/WebService.java delete mode 100644 org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/WebServiceImpl.java create mode 100644 org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/AbstractService.java create mode 100644 org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/IWSValidator.java delete mode 100644 org.idempiere.webservices/WEB-INF/xsd/WebstoreSchema.xsd rename org.idempiere.webservices/WEB-INF/xsd/{schema.xsd => idempiere-schema.xsd} (81%) delete mode 100644 org.idempiere.webservices/WEB-INF/xsd/obschema.xsd create mode 100644 org.idempiere.webservices/migration/oracle/WS005_IdempiereWebservice.sql create mode 100644 org.idempiere.webservices/migration/postgresql/WS005_IdempiereWebservice.sql create mode 100644 org.idempiere.webservices/plugin.xml create mode 100644 org.idempiere.webservices/schema/IWSValidator.exsd diff --git a/org.idempiere.webservices/.classpath b/org.idempiere.webservices/.classpath index 00507cc099..2aea2704d7 100644 --- a/org.idempiere.webservices/.classpath +++ b/org.idempiere.webservices/.classpath @@ -1,10 +1,12 @@ - - - - + + + + + + diff --git a/org.idempiere.webservices/META-INF/MANIFEST.MF b/org.idempiere.webservices/META-INF/MANIFEST.MF index e939c9af2e..77666081bf 100644 --- a/org.idempiere.webservices/META-INF/MANIFEST.MF +++ b/org.idempiere.webservices/META-INF/MANIFEST.MF @@ -7,17 +7,17 @@ Bundle-Activator: org.idempiere.webservices.Activator Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Import-Package: javax.servlet;version="3.0.0", javax.servlet.http;version="3.0.0", - org.apache.commons.codec;version="1.3.0", org.apache.commons.codec.binary;version="1.3.0", - org.apache.commons.logging;version="1.1.1", - org.osgi.framework;version="1.3.0" + org.osgi.framework;version="1.6.0" Require-Bundle: org.adempiere.base;bundle-version="1.0.0", org.adempiere.report.jasper.library;bundle-version="1.0.0", org.adempiere.ui;bundle-version="1.0.0", org.apache.ecs;bundle-version="1.0.0" -Bundle-ClassPath: WEB-INF/lib/stax2-api-3.1.1.jar, +Bundle-ClassPath: ., + WEB-INF/lib/spring-osgi-extender-1.2.1.jar, + WEB-INF/lib/spring-aop-3.0.7.RELEASE.jar, + WEB-INF/lib/stax2-api-3.1.1.jar, WEB-INF/lib/spring-web-3.0.7.RELEASE.jar, - ., WEB-INF/lib/spring-context-3.0.7.RELEASE.jar, WEB-INF/lib/spring-beans-3.0.7.RELEASE.jar, WEB-INF/lib/spring-core-3.0.7.RELEASE.jar, @@ -27,13 +27,15 @@ Bundle-ClassPath: WEB-INF/lib/stax2-api-3.1.1.jar, WEB-INF/lib/cxf-2.6.2.jar, WEB-INF/lib/neethi-3.0.2.jar, WEB-INF/lib/xmlschema-core-2.0.3.jar, - WEB-INF/lib/spring-aop-3.0.7.RELEASE.jar, WEB-INF/lib/cxf-rt-frontend-jaxws-2.6.1.jar, - WEB-INF/lib/generated_xbeans.jar, WEB-INF/lib/xmlbeans-2.5.0.jar, - WEB-INF/lib/composite_XMLSBean.jar + WEB-INF/lib/aopalliance-1.0.jar, + WEB-INF/lib/commons-logging-1.1.1.jar, + WEB-INF/lib/Idempiere-XMLSBean-1.0.jar Export-Package: com._3e.ADInterface, - com.adaxa.ws, - com.adaxa.ws.impl, - com.globalqss.ObPOSInterface + org.compiere.model, + org.idempiere.adInterface.x10, + org.idempiere.adInterface.x10.impl, + org.idempiere.webservices, + org.idempiere.webservices.fault Web-ContextPath: ADInterface diff --git a/org.idempiere.webservices/WEB-INF/src/META-INF/cxf/services.xml b/org.idempiere.webservices/WEB-INF/src/META-INF/cxf/services.xml index 32b51508ad..745bf5475e 100644 --- a/org.idempiere.webservices/WEB-INF/src/META-INF/cxf/services.xml +++ b/org.idempiere.webservices/WEB-INF/src/META-INF/cxf/services.xml @@ -1,27 +1,21 @@ - + - - - - - - - - - + + - + + diff --git a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADInfo.java b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADInfo.java index 2c6ad6e124..37c4ec6944 100644 --- a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADInfo.java +++ b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADInfo.java @@ -3,7 +3,7 @@ package com._3e.ADInterface; import java.sql.PreparedStatement; import java.sql.SQLException; -import pl.x3E.adInterface.DataRow; +import org.idempiere.adInterface.x10.DataRow; public interface ADInfo { public void setParameters( PreparedStatement pstmt, boolean forCount) throws SQLException; diff --git a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADLookup.java b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADLookup.java index a751b734db..f0fc31eaed 100644 --- a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADLookup.java +++ b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADLookup.java @@ -18,11 +18,11 @@ import org.compiere.util.KeyNamePair; import org.compiere.util.ValueNamePair; import org.compiere.util.WebSessionCtx; -import pl.x3E.adInterface.DataField; -import pl.x3E.adInterface.DataRow; -import pl.x3E.adInterface.DataSet; -import pl.x3E.adInterface.LookupValue; -import pl.x3E.adInterface.LookupValues; +import org.idempiere.adInterface.x10.DataField; +import org.idempiere.adInterface.x10.DataRow; +import org.idempiere.adInterface.x10.DataSet; +import org.idempiere.adInterface.x10.LookupValue; +import org.idempiere.adInterface.x10.LookupValues; /* * ADEMPIERE/COMPIERE @@ -42,8 +42,11 @@ public class ADLookup { static final int TYPE_BUISNESS_PARTNER = 002; private String m_columnName; + private int m_type; private String m_tableName; private String m_keyColumnName; + private Boolean IsQueryJoin; + private boolean m_isSOTRX; private final int MAX_PRODUCT_ROWS=500; @@ -69,7 +72,8 @@ public class ADLookup { private String getWhereClause( String keyColumn, DataRow params ) { - String whereClause = "IsSummary='N'"; + String whereClause = "IsSummary='N'"; + String lookupColumn = keyColumn; return whereClause; } @@ -128,6 +132,8 @@ public class ADLookup { String whereClause = getWhereClause(m_columnName, adr); String finalSQL=""; + IsQueryJoin = false; + String mode = "normal"; for (int i=0; i< adr.sizeOfFieldArray(); i++) { DataField f = adr.getFieldArray(i); @@ -194,14 +200,16 @@ public class ADLookup { //join�w if ((ile==1)) { - System.out.println("Znalaz�em 1 rekord wi�c szukam dla bez join. W kliencie zostanie automatycznie uzupe�niona warto�c"); + System.out.println("Znalaz�em 1 rekord wi�c szukam dla bez join. W kliencie zostanie automatycznie uzupe�niona warto�c"); + IsQueryJoin = false; } //Jesli wiecej niz jeden to uzywamy join�w //Spowoduje to wyswietlenie rekord�w spe�niajacych kryterium //w oknie LookUp'a if (ile>1) { - System.out.println("Znalaz�em wi�cej ni� 1 rekord wi�c szukam dla whereClause i z joinami. W kliencie zostanie wy�wietlone LookUpWindow z przefiltrowanymi rekordami."); + System.out.println("Znalaz�em wi�cej ni� 1 rekord wi�c szukam dla whereClause i z joinami. W kliencie zostanie wy�wietlone LookUpWindow z przefiltrowanymi rekordami."); + IsQueryJoin = true; } ds = getResult(info, ds, ile, mode); diff --git a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADService.java b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADService.java deleted file mode 100644 index c9aec3bb77..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADService.java +++ /dev/null @@ -1,63 +0,0 @@ -package com._3e.ADInterface; - - -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.jws.soap.SOAPBinding.ParameterStyle; -import javax.jws.soap.SOAPBinding.Style; -import javax.jws.soap.SOAPBinding.Use; - -import pl.x3E.adInterface.ADLoginRequestDocument; -import pl.x3E.adInterface.ADLoginResponseDocument; -import pl.x3E.adInterface.ADMenuDocument; -import pl.x3E.adInterface.DocActionDocument; -import pl.x3E.adInterface.GetLookupSearchDataReqDocument; -import pl.x3E.adInterface.GetProcessParamsDocument; -import pl.x3E.adInterface.LocationDocument; -import pl.x3E.adInterface.ProcessParamsDocument; -import pl.x3E.adInterface.RunProcessDocument; -import pl.x3E.adInterface.RunProcessResponseDocument; -import pl.x3E.adInterface.StandardResponseDocument; -import pl.x3E.adInterface.WindowDocument; -import pl.x3E.adInterface.WindowTabDataDocument; -import pl.x3E.adInterface.WindowTabDataReqDocument; - -@WebService(targetNamespace="http://3e.pl/ADInterface") -@SOAPBinding(style=Style.RPC,use=Use.LITERAL,parameterStyle=ParameterStyle.WRAPPED) -public interface ADService { - - public WindowDocument getADWindow(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="AD_Window_ID") int AD_Window_ID,@WebParam(name="AD_Menu_ID") int AD_Menu_ID); - //public WindowTabDataDocument getWindowTabData(int WindowNo, int AD_Window_ID, int AD_Menu_ID, int TabNo, int PrevTabNo, int PrevRecNo, boolean GetData) throws XFireFault; - //public WindowTabDataDocument getWindowTabData(int WindowNo, int AD_Window_ID, int AD_Menu_ID, int TabNo, int PrevTabNo, int PrevRecNo, boolean GetData, int RowStart, int RowCount) throws XFireFault; - public WindowTabDataDocument getWindowTabData(WindowTabDataReqDocument reqd); - - public WindowTabDataDocument getDataRow(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="TabNo") int TabNo,@WebParam(name="RowNo") int RowNo ); - public WindowTabDataDocument updateDataRow(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="TabNo") int TabNo,@WebParam(name="RowNo") int RowNo, WindowTabDataDocument data ); - public WindowTabDataDocument saveDataRow(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="TabNo") int TabNo,@WebParam(name="RowNo") int RowNo, WindowTabDataDocument data ); - public WindowTabDataDocument addNewDataRow(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="TabNo") int TabNo ); - public WindowTabDataDocument deleteDataRow(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="TabNo") int TabNo,@WebParam(name="RowNo") int RowNo ); - public WindowTabDataDocument ignoreDataRow(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="TabNo") int TabNo,@WebParam(name="RowNo") int RowNo ); - public WindowTabDataDocument refreshDataRow(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="TabNo") int TabNo,@WebParam(name="RowNo") int RowNo ); - - public WindowTabDataDocument getLookupSearchData(GetLookupSearchDataReqDocument req); - public WindowTabDataDocument getLookupData(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="TabNo") int TabNo,@WebParam(name="RowNo") int RowNo,@WebParam(name="columnName") String columnName ); - - public ADMenuDocument getADMenu(@WebParam(name="AD_Role_ID")int AD_Role_ID); - - public ADLoginResponseDocument login( ADLoginRequestDocument req ); - - public ProcessParamsDocument getProcessParams( GetProcessParamsDocument req ); - public RunProcessResponseDocument runProcess( RunProcessDocument req ); - - public StandardResponseDocument saveLocation( LocationDocument req ); - public LocationDocument getLocation( LocationDocument req ); - - public DocActionDocument getDocAction(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="TabNo") int TabNo,@WebParam(name="RowNo") int RowNo,@WebParam(name="ColName") String ColName ); - public StandardResponseDocument setDocAction(@WebParam(name="WindowNo") int WindowNo,@WebParam(name="TabNo") int TabNo,@WebParam(name="RowNo") int RowNo,@WebParam(name="ColName") String ColName,@WebParam(name="docAction") String docAction ); - - public String getVersion(); - - public boolean isLoggedIn(); - -} diff --git a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADServiceImpl.java b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADServiceImpl.java deleted file mode 100644 index 1ba062ab0f..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ADServiceImpl.java +++ /dev/null @@ -1,1628 +0,0 @@ -package com._3e.ADInterface; - -import java.io.StringWriter; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.Stack; -import java.util.logging.Level; - -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.compiere.model.GridField; -import org.compiere.model.GridFieldVO; -import org.compiere.model.GridTabVO; -import org.compiere.model.GridWindowVO; -import org.compiere.model.Lookup; -import org.compiere.model.MCountry; -import org.compiere.model.MLocation; -import org.compiere.model.MLookup; -import org.compiere.model.MQuery; -import org.compiere.model.MTree; -import org.compiere.model.MTreeNode; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Language; -import org.compiere.util.Login; -import org.compiere.util.ValueNamePair; -import org.idempiere.webservices.fault.IdempiereServiceFault; -import org.w3c.dom.Document; - -import pl.x3E.adInterface.ADLoginRequest; -import pl.x3E.adInterface.ADLoginRequestDocument; -import pl.x3E.adInterface.ADLoginResponse; -import pl.x3E.adInterface.ADLoginResponseDocument; -import pl.x3E.adInterface.ADMenuDocument; -import pl.x3E.adInterface.ADMenuItem; -import pl.x3E.adInterface.ADMenuItemList; -import pl.x3E.adInterface.DataField; -import pl.x3E.adInterface.DataRow; -import pl.x3E.adInterface.DataSet; -import pl.x3E.adInterface.DocAction; -import pl.x3E.adInterface.DocActionDocument; -import pl.x3E.adInterface.Field; -import pl.x3E.adInterface.FieldList; -import pl.x3E.adInterface.GetLookupSearchDataReq; -import pl.x3E.adInterface.GetLookupSearchDataReqDocument; -import pl.x3E.adInterface.GetProcessParamsDocument; -import pl.x3E.adInterface.Location; -import pl.x3E.adInterface.LocationDocument; -import pl.x3E.adInterface.LookupInfo; -import pl.x3E.adInterface.LookupValue; -import pl.x3E.adInterface.LookupValues; -import pl.x3E.adInterface.ProcessParamsDocument; -import pl.x3E.adInterface.RunProcessDocument; -import pl.x3E.adInterface.RunProcessResponseDocument; -import pl.x3E.adInterface.StandardResponse; -import pl.x3E.adInterface.StandardResponseDocument; -import pl.x3E.adInterface.Tab; -import pl.x3E.adInterface.TabList; -import pl.x3E.adInterface.Window; -import pl.x3E.adInterface.WindowDocument; -import pl.x3E.adInterface.WindowTabData; -import pl.x3E.adInterface.WindowTabDataDocument; -import pl.x3E.adInterface.WindowTabDataReq; -import pl.x3E.adInterface.WindowTabDataReqDocument; - -/* - * ADEMPIERE/COMPIERE - * - * replacement: - * GridField by GridFieldVO - * GridTabVO by GridTabVO - * GridWindowVO by GridWindowVO - * - * Contributors: Carlos Ruiz - globalqss - * Add model oriented method modelSetDocAction - * Some Polish messages translated to english using google translate - */ - - -/** - * - * @author kolec - * - */ -@WebService(endpointInterface="com._3e.ADInterface.ADService", serviceName="ADService", targetNamespace="http://3e.pl/ADInterface") -public class ADServiceImpl implements ADService { - - private static CLogger log = CLogger.getCLogger(ADServiceImpl.class); - - private static String webServiceName = new String("ADService"); - - private CompiereService m_cs; - - private static final int MAX_ROWS = 200; - - public ADServiceImpl() - { - m_cs = new CompiereService(); - m_cs.connect(); - - log.info("Creating session object ADService"); - } - - public String getVersion() { - return "0.7.0"; - } - - public boolean isLoggedIn() { - - return m_cs.isLoggedIn(); - } - - - private void fillField( Field f, GridFieldVO fo ) { ////(griddieldvo) adempiere specific - f.setADColumnID( fo.AD_Column_ID ); - f.setADProcessID( fo.AD_Process_ID ); - f.setADReferenceValueID( fo.AD_Reference_Value_ID ); - f.setADWindowID( fo.AD_Window_ID ); - f.setCallout( fo.Callout ); - f.setColumnName( fo.ColumnName ); - f.setDefaultValue( fo.DefaultValue ); - f.setDefaultValue2( fo.DefaultValue2 ); - f.setDescription( fo.Description ); - f.setDisplayLength( fo.DisplayLength ); - f.setDisplayLogic( fo.DisplayLogic ); - f.setDisplayType( fo.displayType ); - f.setFieldGroup( fo.FieldGroup ); - f.setFieldLength( fo.FieldLength ); - f.setHeader( fo.Header ); - f.setHelp( fo.Help); - f.setIsAlwaysUpdateable( fo.IsAlwaysUpdateable ); - f.setIsDisplayed( fo.IsDisplayed ); - f.setIsEncryptedColumn( fo.IsEncryptedColumn ); - f.setIsEncryptedField( fo.IsEncryptedField ); - f.setIsFieldOnly( fo.IsFieldOnly ); - f.setIsHeading( fo.IsHeading ); - f.setIsKey( fo.IsKey); - f.setIsMandatory( fo.IsMandatory ); - f.setIsParent( fo.IsParent ); - f.setIsProcess( fo.isProcess ); - f.setIsRange( fo.isRange ); - f.setIsReadOnly( fo.IsReadOnly ); - f.setIsSameLine( fo.IsSameLine ); - f.setIsSelectionColumn( fo.IsSelectionColumn ); - f.setIsUpdateable( fo.IsUpdateable ); - - if (DisplayType.isLookup( fo.displayType )) { - GridField ff = new GridField( fo ); - @SuppressWarnings("unused") - ArrayList deps = ff.getDependentOn(); - Lookup lookup = ff.getLookup(); - - LookupInfo li = f.addNewLookupInfo(); - if (fo.lookupInfo!=null) { - li.setZoomWindow( fo.lookupInfo.ZoomWindow ); - li.setZoomWindow( fo.lookupInfo.ZoomWindow ); - } - - //if (deps.size()==0) - if (lookup!=null && (fo.ValidationCode==null || (fo.ValidationCode!=null && fo.ValidationCode.length()==0))) { - LookupValues lvs = f.addNewLookup(); - //System.out.println( "lookup "+fo.ColumnName+" "+lookup.getSize() ); - - //if(lookup.size() == 0) - nie robic tego - // System.out.println("lookup refresh ["+fo.ColumnName+"]= "+lookup.refresh()); - /*if(lookup.getSize() > 0)*/ - ArrayList ar = lookup.getData(ff.isMandatory(false), true, !ff.isReadOnly(), true); // the last was false, 2007-05-11 - if (ar != null && ar.size()>0) { - Object[] list = ar.toArray(); - - for (int i=0; iFields = to.getFields(); // adempiere - //ArrayListFields = to.Fields; // compiere - - if (Fields !=null) { - FieldList fl = t.addNewFields(); - for (int i=0; i WindowVOCache =new HashMap(); - private HashMap WindowCache =new HashMap(); - - - private GridWindowVO getWindowVO( int WindowNo, int AD_Window_ID, int AD_Menu_ID) - { - GridWindowVO w = WindowVOCache.get(""+AD_Window_ID+"_"+AD_Menu_ID+"_"+WindowNo); - if (w != null) - return w; - w = GridWindowVO.create(m_cs.getM_ctx(), WindowNo, AD_Window_ID, AD_Menu_ID); - //create(m_cs.getM_ctx(), WindowNo, AD_Window_ID); - if (w!=null) - WindowVOCache.put(""+AD_Window_ID+"_"+AD_Menu_ID+"_"+WindowNo, w); - return w; - } - - public WindowDocument getADWindow(int WindowNo, int AD_Window_ID, int AD_Menu_ID) { - authenticate(webServiceName, "getADWindow"); - - //WindowDocument wc = WindowCache.get(new String(""+AD_Window_ID+"_"+AD_Menu_ID)); - //if (wc != null) return wc; - - WindowDocument res = WindowDocument.Factory.newInstance(); - Window w = res.addNewWindow(); - GridWindowVO wo = getWindowVO( WindowNo, AD_Window_ID, AD_Menu_ID); - - if (wo!=null) - { - fillWindow(w, wo); - - WindowCache.put( new String(""+AD_Window_ID+"_"+AD_Menu_ID), res); - } - - return res; - } - - - - /* - 1000000 - - - 1000000 - */ - -// method to convert Document to String - public String getStringFromDocument(Document doc) - { - try - { - DOMSource domSource = new DOMSource(doc); - StringWriter writer = new StringWriter(); - StreamResult result = new StreamResult(writer); - TransformerFactory tf = TransformerFactory.newInstance(); - Transformer transformer = tf.newTransformer(); - transformer.transform(domSource, result); - return writer.toString(); - } - catch(TransformerException ex) - { - ex.printStackTrace(); - return null; - } - } - - - private Map WindowStatusMap = new HashMap(); - - /* - public WindowTabDataDocument getWindowTabData(int WindowNo, int AD_Window_ID, int AD_Menu_ID, int TabNo, int PrevTabNo, int PrevRecNo, boolean getData) { - return getWindowTabData(WindowNo, AD_Window_ID, AD_Menu_ID, TabNo, PrevTabNo, PrevRecNo, getData, 0, -1); - } - - public WindowTabDataDocument getWindowTabData(int WindowNo, int AD_Window_ID, int AD_Menu_ID, int TabNo, int PrevTabNo, int PrevRecNo, boolean getData, int RowStart, int RowCount) - { - return null; //TODO - - }*/ - - private MQuery createQuery( String table_name, DataRow dr ) { - MQuery q = new MQuery(table_name); - DataField df[] = dr.getFieldArray(); - for (int i=0; i0 ) - { - q.addRestriction("UPPER("+df[i].getColumn()+")", MQuery.LIKE, df[i].getVal().toUpperCase(), df[i].getColumn(), df[i].getVal().toUpperCase()); - } - } - return q; - } - - - void authenticate(String webServiceName, String method) { - if (!m_cs.isLoggedIn()) - throw new IdempiereServiceFault( new Exception( "You need to login" ) ); - // TODO: Authenticate webservice and method - // TODO: Search for a service type for client and role access with the same value as the method - - // TODO: Increase security! - } - - public WindowTabDataDocument getWindowTabData(WindowTabDataReqDocument reqd) { - authenticate(webServiceName, "getWindowTabData"); - - WindowTabDataReq req = reqd.getWindowTabDataReq(); - WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); - WindowTabData wd = ret.addNewWindowTabData(); - DataSet ds = wd.addNewDataSet(); - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, req.getWindowNo(), false, 0, false, 0); - if (ws == null) - { - GridWindowVO wo = getWindowVO( req.getWindowNo(), req.getADWindowID(), req.getADMenuID() ); - ws = new WWindowStatus(wo); - WindowStatusMap.put(new Integer(req.getWindowNo()), ws); - - ws.curTab.query(ws.mWindow.isTransaction()); //!!!!!!!!!! - ws.curTab.navigate(0); - ws.curTab.setSingleRow(true); - } - - if (ws.curTab.getTabNo() != req.getPrevTabNo()) - { - ws.curTab.removeDataStatusListener(ws.ads); - ws.curTab = ws.mWindow.getTab(req.getPrevTabNo()); - ws.curTab.query(ws.mWindow.isTransaction()); // false - ws.curTab.navigate(0); - ws.updateRecIDMap(); - } - /* - if (ws.curTab.getCurrentRow() != req.getPrevRecNo()) - { - if (req.getPrevRecNo() >=0) - ws.curTab.navigate( req.getPrevRecNo() ); - } - */ - int prevRecNo = ws.getRowNoFromRecordID( req.getPrevRecNo()); // we assume that it RecordID - if (ws.curTab.getCurrentRow() != prevRecNo) - { - if (prevRecNo >=0) - ws.curTab.navigate( prevRecNo ); - } - - - WWindowStatus.changeTabIfNeeded( ws, req.getTabNo() ); - - if (req.getGetData()) - { - if (req.getFromZoom()) { - WWindowStatus ws2 = WWindowStatus.get(WindowStatusMap, req.getFromZoomWindowID(), true, req.getFromZoomTabID(), true, req.getFromZoomRowID()); - System.out.println(ws2.curTab.getTableName()); - GridField field = ws2.curTab.getField(req.getFromZoomColumnName()); - ws2 = null; - if (field == null) return null; - MLookup lookup = (MLookup)field.getLookup(); - if (lookup == null) - return null; - // - MQuery zoomQuery = lookup.getZoomQuery(); - Object value = field.getValue(); - if (value == null) - { - value = req.getFromZoomColumnValue(); - } - // If not already exist or exact value - if (zoomQuery == null || value != null) - { - zoomQuery = new MQuery(); // ColumnName might be changed in GridTab.validateQuery - zoomQuery.addRestriction( req.getFromZoomColumnName(), MQuery.EQUAL, value); - } - ws.curTab.setQuery(zoomQuery); - //ws.curTab.query(ws.mWindow.isTransaction()); - - // ADEMPIERE/COMPIERE - ws.curTab.query(false, 0, 0); // adempiere - //ws.curTab.query(false, 0); // compiere - - } else - { - DataRow findDR = req.getFindCriteria(); - //MQuery currentQuery = ws.curTab.getQuery(); - MQuery newQuery = createQuery( ws.curTab.getTableName(), findDR ); - if (findDR.getFieldArray().length>0) { //(!currentQuery.getWhereClause().equals( newQuery.getWhereClause() )) { // change the query for zak�adki - ws.curTab.setQuery(newQuery); - //ws.curTab.query(ws.mWindow.isTransaction()); - - //ADEMPIERE/COMPIERE - ws.curTab.query(false, 0, 0); // adempiere - //ws.curTab.query(false, 0); // compiere - } - } - - - - int rc = 0; - if (req.getRowCount()>0) - rc = req.getRowCount(); else rc = ws.curTab.getRowCount(); - int initRowNo = 0; - if (req.getRowStart() > 0) initRowNo = req.getRowStart(); - - int lastRow = Math.min(rc, initRowNo + MAX_ROWS); //ok - //initRowNo + 5; // only for testing - - wd.setNumRows( lastRow ); - //lastRow += initRowNo; - - wd.setTotalRows( ws.curTab.getRowCount() ); // ok - //wd.setTotalRows( 5 ); // only for testing - - wd.setStartRow(initRowNo); - - Map RecordIDMap = ws.getRecordIDMap(); - try { - RecordIDMap.clear(); - for (int lineNo = initRowNo; lineNo < lastRow; lineNo++) - { - ws.curTab.navigate(lineNo); - - int recID = ws.curTab.getRecord_ID(); - RecordIDMap.put( recID, lineNo ); - - DataRow dr = ds.addNewDataRow(); - //System.out.println("row "+lineNo); - fillDataRow( dr, ws, false, false ); - - } - } catch (Exception ex) { ex.printStackTrace(); }; - - - if ( lastRow <= ws.curTab.getRowCount() ) { //last row - ws.updateRecIDMap(); - } - } - - - return ret; - - } - - - - public WindowTabDataDocument getDataRow(int WindowNo, int TabNo, int RowNo ) { - authenticate(webServiceName, "getDataRow"); - - WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); - WindowTabData wd = ret.addNewWindowTabData(); - DataSet ds = wd.addNewDataSet(); - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, WindowNo, true, TabNo, true, RowNo); - if (ws != null) - { - DataRow dr = ds.addNewDataRow(); - fillDataRow( dr, ws, true, false ); - - if (ws.ads.m_is_error) - { - wd.setError(ws.ads.m_error_message ); - wd.setErrorInfo(ws.ads.m_error_info ); - } - wd.setStatus(ws.ads.m_status_data); - wd.setStatusError(ws.ads.m_is_status_error); - } - - return ret; - } - - public WindowTabDataDocument updateDataRow(int WindowNo, int TabNo, int RowNo, WindowTabDataDocument data ) { - authenticate(webServiceName, "updateDataRow"); - - WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); - WindowTabData wd = ret.addNewWindowTabData(); - DataSet ds = wd.addNewDataSet(); - DataRow ret_dr = ds.addNewDataRow(); - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, WindowNo, true, TabNo, true, RowNo); - if (ws != null) - { - DataRow[] dr = data.getWindowTabData().getDataSet().getDataRowArray(); - if (dr.length == 1) - { - DataRow dr0 = dr[0]; - @SuppressWarnings("unused") - //variable set to ease debugging (return value ignored) in case you want to check the return of the method - boolean err = updateFields( ws, dr0 ); - - if (ws.ads.m_is_error) - { - wd.setError(ws.ads.m_error_message ); - wd.setErrorInfo(ws.ads.m_error_info ); - } - wd.setStatus(ws.ads.m_status_data); - wd.setStatusError(ws.ads.m_is_status_error); - - //ws.curTab.dataRefresh(); - fillDataRow( ret_dr, ws, true, false ); - - } - - } - - return ret; - } - - private final String recordIDfield = "_rowNo"; - - - private void fillDataRow( DataRow dr, WWindowStatus ws, boolean handleLookups, boolean onlyUpdated ) { - authenticate(webServiceName, "fillDataRow"); - - int noFields = ws.curTab.getFieldCount(); - - //m_cs.dateFormat = new SimpleDateFormat( m_cs.datePattern ); - //m_cs.dateTimeFormat = new SimpleDateFormat( m_cs.datePattern ); - - String column = ""; - boolean isEditable = false; - // for all columns - - if (onlyUpdated) { - java.util.Date clientUpdated = new java.util.Date(); - java.util.Date updated = (java.util.Date)ws.curTab.getValue("Updated"); - if (!updated.after(clientUpdated)) { - DataField df = dr.addNewField(); - df.setColumn( recordIDfield ); - df.setDisp(false); - df.setVal( Integer.toString( ws.curTab.getRecord_ID() )); - return; - } - } - - for (int colNo = 0; colNo < noFields; colNo++) - { - GridField field = ws.curTab.getField(colNo); - column = field.getColumnName(); - - - if (!field.isDisplayed(true)) - { - DataField df = dr.addNewField(); - df.setColumn( column ); - df.setDisp(false); - df.setVal("" ); - //System.out.println(" *** not displayed: "+field.getColumnName()+" | "+field.getDisplayLogic()); - continue; - } - - if (field.getDisplayType() == DisplayType.Button) - continue; - - DataField df = dr.addNewField(); - - isEditable = field.isEditable(true); - df.setEdit(isEditable); - - // Get Data - turn to string - Object data = ws.curTab.getValue( column ); - String info = null; - //System.out.println( " displaytype = "+field.getDisplayType()); - // - if (data == null && !DisplayType.isLookup( field.getDisplayType())) - info = ""; - else - { - int dt = field.getDisplayType(); - switch (dt) - { - - case DisplayType.Date: - info = m_cs.dateFormat.format(data); - //System.out.println( "Date: "+info ); - break; - case DisplayType.DateTime: - // TODO - info = m_cs.dateFormat.format(data); //m_cs.dateTimeFormat.format(data); - //System.out.println( "DateTime: "+info ); - break; - case DisplayType.Amount: - info = m_cs.amountFormat.format(data); - break; - case DisplayType.Number: - case DisplayType.CostPrice: - info = m_cs.numberFormat.format(data); - break; - case DisplayType.Quantity: - info = m_cs.quantityFormat.format(data); - break; - case DisplayType.Integer: - info = m_cs.integerFormat.format(data); - break; - case DisplayType.YesNo: - info = data.toString(); - if ("Y".equals(info)) info="true"; - if ("N".equals(info)) info="false"; - //info = Msg.getMsg(ws.ctx, data.toString()); - break; - case DisplayType.Location: - info = data.toString(); - if (handleLookups) { - String x = DB.getSQLValueString(null, "select l.address1||', '||l.postal||', '||l.city from c_location l where c_location_id=?", Integer.parseInt(info)); - df.setLval( x ); - System.out.println( " location = "+x ); - } - break; - - default: - if (DisplayType.isLookup(dt)) - { - Lookup lookup = field.getLookup(); - //ArrayList deps = field.getDependentOn(); - - String lookupValue = null; - if (field.getValue()!=null) - { - lookupValue = lookup.getDisplay( field.getValue() ); - } - //lookup.refresh(); - if (data!=null) - { - info = lookup.getDisplay(data); - if (info==null) - { - lookup.refresh(); - info = lookup.getDisplay(data); - } - } - df.setLval(lookupValue); - - //System.out.println(field.getVO().ValidationCode); - - if (handleLookups /*&& isEditable*/ && lookup!=null - && (field.getVO().ValidationCode!=null && field.getVO().ValidationCode.length()>0))//deps.size()>0) - { - if (data!=null) - info = lookup.getDisplay(data); - - - LookupValues lvs = df.addNewLookup(); - - ADLookup.fillLookupValues( lvs, lookup, field ); - - } - if (data!=null) - info = data.toString(); - - } - else - { - info = data.toString(); - //System.out.println(">>>>>>>> UNKNOWN > "+field.getColumnName() +" = "+info); - } - } - } - //System.out.println(" "+column+" = "+info); - if ("M_Product_ID".equals(field.getColumnName())) - System.out.println("--- "+info); - - df.setDisp(true); - df.setVal( info ); - df.setColumn(field.getColumnName()); - if (field.isError()) - { - df.setError(true); - df.setErrorVal(field.getErrorValue()); - } - } - DataField df = dr.addNewField(); - df.setColumn( recordIDfield ); - df.setVal(Integer.toString( ws.curTab.getRecord_ID() )); - } - - - - public WindowTabDataDocument saveDataRow(int WindowNo, int TabNo, int RowNo, WindowTabDataDocument data ) { - authenticate(webServiceName, "saveDataRow"); - - WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); - WindowTabData wd = ret.addNewWindowTabData(); - DataSet ds = wd.addNewDataSet(); - DataRow ret_dr = ds.addNewDataRow(); - - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, WindowNo, false, 0, true, RowNo); - if (ws != null) - { - DataRow[] dr = data.getWindowTabData().getDataSet().getDataRowArray(); - if (dr.length == 1) - { - DataRow dr0 = dr[0]; - boolean error = updateFields( ws, dr0 ); - - DataField f[] = dr0.getFieldArray(); - HashMap fmap = new HashMap(); - for (int i=0; i en = null; //request.getParameterNames(); - DataField[] df = dr.getFieldArray(); - DataField f; - for (int i=0; i " + (value==null ? "null" : value.toString())); - // same = both null - * - */ - - if (dbValue == null && value == null) - continue; - // new value null - else if (dbValue != null && value == null) - ws.curTab.setValue (GridField, null); - // from null to new value - else if (dbValue == null && value != null) - { - fieldError = !setFieldValue (ws, GridField, value); - } - // same - - else if (dbValue.equals(value)) - continue; - else - fieldError = !setFieldValue (ws, GridField, value); - - // - if (!error && fieldError) - { - //log.info("Error: " + GridField.getColumnName()); - error = true; - } - } - } // for all parameteres - - // Re-Do Changed Column to overwrite - /* - String columnName = f.getColumn(); //WebUtil.getParameter (request, P_ChangedColumn); - if (columnName != null && columnName.length() > 0) - { - ws.m_needSave = true; - GridField GridField = ws.curTab.getField(columnName); - if (GridField != null) - { - String value = "";//WebUtil.getParameter(request, columnName); - Object newValue = getFieldValue (GridField, value); - if (!ERROR.equals(newValue)) - { - // De-Selected Check Boxes are null - if (newValue == null && GridField.getDisplayType() == DisplayType.YesNo) - newValue = "N"; - //log.fine("ChangedColumn: " + columnName + "=" + newValue); - ws.curTab.setValue(GridField, newValue); - } - } - } - */ - - return error; - } // updateFields - - - /************************************************************************** - * Set Field Value - * @param wsc web session - * @param ws window status - * @param GridField field - * @param value as String - * @return true if correct - */ - private boolean setFieldValue ( WWindowStatus ws, - GridField GridField, String value) - { - Object newValue = getFieldValue (GridField, value); - if (ERROR.equals(newValue)) - { - GridField.setErrorValue(value); - return false; - } - Object dbValue = GridField.getValue(); - if ((newValue == null && dbValue != null) - || (newValue != null && !newValue.equals(dbValue))) - { - //GridField.setValue(newValue,true); - ws.curTab.setValue(GridField, newValue); - - } - return true; - } // setFieldValue - - - /** - * Get Field value (convert value to datatype of GridField) - * @param wsc session context - * @param GridField field - * @param value String Value - * @return converted Field Value - */ - private Object getFieldValue ( GridField GridField, String value) - { - if (value == null || value.length() == 0) - return null; - - int dt = GridField.getDisplayType(); - //String columnName = GridField.getColumnName(); - - // BigDecimal - if (DisplayType.isNumeric(dt)) - { - BigDecimal bd = null; - try - { - Number nn = null; - if (dt == DisplayType.Amount) - nn = m_cs.amountFormat.parse(value); - else if (dt == DisplayType.Quantity) - nn = m_cs.quantityFormat.parse(value); - else // DisplayType.CostPrice - nn = m_cs.numberFormat.parse(value); - if (nn instanceof BigDecimal) - bd = (BigDecimal)nn; - else - bd = new BigDecimal(nn.toString()); - } - catch (Exception e) - { - //log.warning("BigDecimal: " + columnName + "=" + value + ERROR); - return ERROR; - } - //log.fine("BigDecimal: " + columnName + "=" + value + " -> " + bd); - return bd; - } - - // ID - else if (DisplayType.isID(dt)) - { - Integer ii = null; - try - { - ii = new Integer (value); - } - catch (Exception e) - { - //log.log(Level.WARNING, "ID: " + columnName + "=" + value, e); - ii = null; - } - // -1 indicates NULL - if (ii != null && ii.intValue() == -1) - ii = null; - //log.fine("ID: " + columnName + "=" + value + " -> " + ii); - return ii; - } - - - // Date/DateTime - else if (DisplayType.isDate(dt)) - { - Timestamp ts = null; - try - { - java.util.Date d = null; - - if (DisplayType.Date == dt) - d = m_cs.dateFormat.parse(value); - else if (DisplayType.DateTime == dt) - d = m_cs.dateTimeFormat.parse(value); - else if (DisplayType.Time == dt) - { - value = "2000/01/01 "+ value; - d = m_cs.dateTimeFormat.parse(value); - } - if (d!=null) - ts = new Timestamp(d.getTime()); - } - catch (Exception e) - { - //log.warning("Date: " + columnName + "=" + value + ERROR); - return ERROR; - } - //log.fine("Date: " + columnName + "=" + value + " -> " + ts); - return ts; - } - - // Checkbox - else if (dt == DisplayType.YesNo) - { - Boolean retValue = Boolean.FALSE; - if (value.equals("true")) - retValue = Boolean.TRUE; - //log.fine("YesNo: " + columnName + "=" + value + " -> " + retValue); - return retValue; - } - - // treat as string - //log.fine(columnName + "=" + value); - return value; - } // getFieldValue - - - public WindowTabDataDocument addNewDataRow(int WindowNo, int TabNo ) { - authenticate(webServiceName, "addNewDataRow"); - - WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); - WindowTabData wd = ret.addNewWindowTabData(); - DataSet ds = wd.addNewDataSet(); - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, WindowNo, true, TabNo, false, 0); - if (ws != null) - { - if (ws.curTab.dataNew(false)) - { - //ws.curTab.setSingleRow(true); - wd.setSuccess(true); - DataRow dr = ds.addNewDataRow(); - fillDataRow( dr, ws, true, false ); - updateRecIDMap( ws ); - System.out.println("New Row no = "+ws.curTab.getCurrentRow()); - } else - { - ws.curTab.dataIgnore(); - wd.setSuccess(false); - } - } - - return ret; - } - - public WindowTabDataDocument deleteDataRow(int WindowNo, int TabNo, int RowNo ) { - authenticate(webServiceName, "deleteDataRow"); - - WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); - WindowTabData wd = ret.addNewWindowTabData(); - DataSet ds = wd.addNewDataSet(); - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, WindowNo, false, 0, true, RowNo); - if (ws != null) - { - wd.setSuccess( - ws.curTab.dataDelete() - ); - - DataRow ret_dr = ds.addNewDataRow(); - fillDataRow( ret_dr, ws, true, false ); - - if (ws.ads.m_is_error) - { - wd.setError(ws.ads.m_error_message ); - wd.setErrorInfo(ws.ads.m_error_info ); - } - wd.setStatus(ws.ads.m_status_data); - wd.setStatusError(ws.ads.m_is_status_error); - - updateRecIDMap( ws ); - } - return ret; - } - - public WindowTabDataDocument ignoreDataRow(int WindowNo, int TabNo, int RowNo ) { - authenticate(webServiceName, "ignoreDataRow"); - - WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); - WindowTabData wd = ret.addNewWindowTabData(); - DataSet ds = wd.addNewDataSet(); - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, WindowNo, false, 0, true, RowNo); - if (ws != null) - { - ws.curTab.dataIgnore(); - - wd.setSuccess(true); - - DataRow ret_dr = ds.addNewDataRow(); - fillDataRow( ret_dr, ws, true, false ); - - if (ws.ads.m_is_error) - { - wd.setError(ws.ads.m_error_message ); - wd.setErrorInfo(ws.ads.m_error_info ); - } - wd.setStatus(ws.ads.m_status_data); - wd.setStatusError(ws.ads.m_is_status_error); - - updateRecIDMap( ws ); - - } - return ret; - } - - public WindowTabDataDocument refreshDataRow(int WindowNo, int TabNo, int RowNo ) { - authenticate(webServiceName, "refreshDataRow"); - - WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); - WindowTabData wd = ret.addNewWindowTabData(); - DataSet ds = wd.addNewDataSet(); - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, WindowNo, false, 0, true, RowNo); - if (ws != null) - { - ws.curTab.dataRefresh(); - - wd.setSuccess(true); - - DataRow ret_dr = ds.addNewDataRow(); - fillDataRow( ret_dr, ws, true, false ); - - if (ws.ads.m_is_error) - { - wd.setError(ws.ads.m_error_message ); - wd.setErrorInfo(ws.ads.m_error_info ); - } - wd.setStatus(ws.ads.m_status_data); - wd.setStatusError(ws.ads.m_is_status_error); - - } - return ret; - - } - - public WindowTabDataDocument getLookupSearchData(GetLookupSearchDataReqDocument req) - { //int WindowNo, int TabNo, int RowNo, DataRow dr - authenticate(webServiceName, "getLookupSearchData"); - - GetLookupSearchDataReq reqt = req.getGetLookupSearchDataReq(); - - DataField[] df = reqt.getParams().getFieldArray(); - for (int i=0; i0 ) - log.info("LookUp COlumn: "+ df[i].getColumn()+ " " + df[i].getVal()); - } - - WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); - WindowTabData wd = ret.addNewWindowTabData(); - DataSet ds = wd.addNewDataSet(); - - int WindowNo = reqt.getWindowNo(); - int TabNo = reqt.getTabNo(); - int RowNo = reqt.getTabNo(); - - WWindowStatus ws = null; - if (WindowNo>0) - ws = WWindowStatus.get(WindowStatusMap, WindowNo, true, TabNo, true, RowNo); //<-- Note changes to the active record (bledne action), probably are not properly communicated parameters - if (ws != null) { - - ADLookup lk = new ADLookup( df[0].getVal()); - lk.getLookupSearchValues( reqt.getParams(), ds, ws.ctx, WindowNo ); - } else { - ADLookup lk = new ADLookup( df[0].getVal()); - lk.getLookupSearchValues( reqt.getParams(), ds, this.m_cs.getM_ctx(), 0 ); - } - return ret; - } - - public WindowTabDataDocument getLookupData(int WindowNo, int TabNo, int RowNo, String columnName ) - { - authenticate(webServiceName, "getLookupData"); - - WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); - WindowTabData wd = ret.addNewWindowTabData(); - DataSet ds = wd.addNewDataSet(); - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, WindowNo, true, TabNo, true, RowNo); - if (ws != null) - { - DataRow dr = ds.addNewDataRow(); - DataField df = dr.addNewField(); - GridField field = ws.curTab.getField(columnName); - Lookup lookup = field.getLookup(); - - df.setColumn(field.getColumnName()); - - String lookupValue = null; - if (field.getValue()!=null) - lookupValue = lookup.getDisplay( field.getValue() ); - df.setLval(lookupValue); - if (field.getValue()!=null) - df.setVal(field.getValue().toString()); - - LookupValues lvs = df.addNewLookup(); - - ADLookup.fillLookupValues(lvs, lookup, field); - } - return ret; - } - - - public ADMenuDocument getADMenu(int AD_Role_ID) - { - authenticate(webServiceName, "getADMenu"); - - ADMenuDocument res = ADMenuDocument.Factory.newInstance(); - ADMenuItem menu = res.addNewADMenu(); - menu.setName("Menu"); - menu.setType("Summary"); - - AD_Role_ID = Integer.parseInt( m_cs.getM_ctx().getProperty("#AD_Role_ID") ); - - // Load Menu Structure ---------------------- - int AD_Tree_ID = DB.getSQLValue(null, - "SELECT COALESCE(r.AD_Tree_Menu_ID, ci.AD_Tree_Menu_ID)" - + "FROM AD_ClientInfo ci" - + " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) " - + "WHERE AD_Role_ID=?", AD_Role_ID); - if (AD_Tree_ID <= 0) - AD_Tree_ID = 10; // Menu - - //log.fine("doPost - AD_Tree_ID=" + AD_Tree_ID + " - " + Env.getAD_Language(wsc.ctx)); - - MTree tree = new MTree (m_cs.getM_ctx(), AD_Tree_ID, false, false, null); // Language set in WLogin - // Trim tree - MTreeNode root = tree.getRoot(); - Enumeration en = root.preorderEnumeration(); - - - ADMenuItemList itl = null;// menu.addNewItems(); - ADMenuItem it = menu;//, it_last = null; - - Stack stack = new Stack(); - //stack.push( itl ); - - while (en.hasMoreElements()) - { - MTreeNode nd = (MTreeNode)en.nextElement(); - if (nd.isTask() - || nd.isWorkbench() - || nd.isWorkFlow() - || nd.getNode_ID() == 383 // Reset Cache - kills the server - ) - { - MTreeNode parent = (MTreeNode)nd.getParent(); - parent.remove(nd); - } - } - tree.trimTree(); - - // Print tree - //StringBuilder barbuf = new StringBuilder(); - en = root.preorderEnumeration(); - int oldLevel = 0; - while (en.hasMoreElements()) - { - MTreeNode nd = (MTreeNode)en.nextElement(); - - // Level - int level = nd.getLevel(); // 0 == root - if (level == 0) - continue; - // - while (oldLevel < level) - { - if (itl != null) stack.push( itl ); - itl = it.addNewItems(); - oldLevel++; - } - while (oldLevel > level) - { - oldLevel--; - itl = (ADMenuItemList)stack.pop(); - } - - // Print Node - ADMenuItem it_last = printNode(nd, m_cs.getM_ctx(), itl ); - if (nd.isSummary()) - it = it_last; - //if(nd.isOnBar() && !nd.isSummary()) - //barbuf.append(printNode(nd, m_cs.getM_ctx() )); - } - // Final - - return res; - } - - private ADMenuItem printNode (MTreeNode node, Properties ctx, ADMenuItemList itl) - { - ADMenuItem i = itl.addNewItem(); - i.setName( node.getName() ); - i.setDescription(node.getDescription() ); - i.setADMenuID( node.getNode_ID()); - String type = ""; - if(node.isWindow())type="Window";else - if(node.isForm())type="Form";else - if(node.isReport())type="Report";else - if(node.isProcess())type="Process";else - if(node.isSummary())type="Summary";else - if(node.isTask())type="Task";else - if(node.isWorkbench())type="Workbench";else - if(node.isWorkFlow())type="Workbench"; - i.setType( type ); - return i; - } - - - - public ADLoginResponseDocument login( ADLoginRequestDocument req ) - { - authenticate(webServiceName, "login"); - - // TODO: Implement security layer - log.log(Level.SEVERE, "Warning: Security layer not implemented yet - opening web service " + webServiceName + " implies a security risk for server"); - - ADLoginResponseDocument res = ADLoginResponseDocument.Factory.newInstance(); - ADLoginResponse lr = res.addNewADLoginResponse(); - - ADLoginRequest r = req.getADLoginRequest(); - - if (r.getStage()==0) // initial phase - return possible translations - { - LookupValues langs = lr.addNewLangs(); - for (int i = 0; i < Language.getLanguageCount(); i++) - { - Language language = Language.getLanguage(i); - LookupValue lv = langs.addNewLv(); - lv.setKey( language.getAD_Language() ); - lv.setVal( language.getName() ); - } - } else - if (r.getStage()==1) // Verify user and pass - { - KeyNamePair[] roles = null; - KeyNamePair[] clients = null; - KeyNamePair[] orgs = null; - KeyNamePair[] warehouses = null; - - Login login = new Login(m_cs.getM_ctx()); - - roles = login.getRoles(r.getUser(), r.getPass()); - if (roles == null) - { - lr.setStatus(-1); - return res; - } else - { - if (r.getRoleID()==-1 && roles != null && roles.length>0) - r.setRoleID( Integer.parseInt( roles[0].getID() ) ); - if (r.getRoleID()>-1) clients = login.getClients( new KeyNamePair(r.getRoleID(), "" ) ); - - if (r.getClientID()==-1 && clients != null && clients.length>0) - r.setClientID( Integer.parseInt( clients[0].getID() ) ); - if (r.getClientID()>-1) orgs = login.getOrgs( new KeyNamePair(r.getClientID(), "" ) ); - - if (r.getOrgID()==-1 && orgs != null && orgs.length>0) - r.setOrgID( Integer.parseInt( orgs[0].getID() ) ); - if (r.getOrgID()>-1) warehouses = login.getWarehouses( new KeyNamePair(r.getOrgID(), "" ) ); - - ADLookup.fillLookupValues( lr.addNewRoles(), roles ); - ADLookup.fillLookupValues( lr.addNewClients(), clients ); - ADLookup.fillLookupValues( lr.addNewOrgs(), orgs ); - ADLookup.fillLookupValues( lr.addNewWarehouses(), warehouses ); - } - } else - if (r.getStage()==2) // Verify user and pass - { - Login login = new Login(m_cs.getM_ctx()); - KeyNamePair[] roles = login.getRoles(r.getUser(), r.getPass()); - if (roles != null) - { - KeyNamePair org = new KeyNamePair(r.getRoleID(), Integer.toString(r.getRoleID())); - String error = login.validateLogin(org); - if (error != null && error.length() > 0) - { - lr.setStatus(-1); - return res; - } - - int AD_User_ID = Env.getAD_User_ID(m_cs.getM_ctx()); - - if ( !m_cs.login( AD_User_ID, r.getRoleID(), r.getClientID(), r.getOrgID(), r.getWarehouseID(), r.getLang() ) ) { - lr.setStatus(-1); - return res; - } - } - else - { - lr.setStatus(-1); - return res; - } - } - - return res; - } - - - - - public ProcessParamsDocument getProcessParams( GetProcessParamsDocument req ) - { - authenticate(webServiceName, "getProcessParams"); - return Process.getProcessParams(m_cs, req ); - } - - public RunProcessResponseDocument runProcess( RunProcessDocument req ) - { - authenticate(webServiceName, "runProcess"); - return Process.runProcess(m_cs, req); - } - - public StandardResponseDocument saveLocation( LocationDocument req ) - { - authenticate(webServiceName, "saveLocation"); - StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance(); - StandardResponse resp = ret.addNewStandardResponse(); - - Location rloc = req.getLocation(); - - MLocation location = new MLocation(m_cs.getM_ctx(), rloc.getCLocationID(), null); - //log.fine("doPost updating C_Location_ID=" + C_Location_ID + " - " + targetBase); - - location.setAddress1 (rloc.getAddress1()); - location.setAddress2 (rloc.getAddress2()); - location.setCity ( rloc.getCity() ); - location.setPostal ( rloc.getPostalCode() ); - location.setC_Country_ID ( rloc.getCCountryID() ); - location.setC_Region_ID ( rloc.getCRegionID() ); - - // Save Location - location.save(); - resp.setRecordID( location.getC_Location_ID() ); - - return ret; - - } - - - public LocationDocument getLocation(@WebParam(name="req", targetNamespace="http://3e.pl/ADInterface") LocationDocument req ) - { - authenticate(webServiceName, "getLocation"); - LocationDocument ret = LocationDocument.Factory.newInstance(); - Location loc = ret.addNewLocation(); - - MLocation location = new MLocation(m_cs.getM_ctx(), req.getLocation().getCLocationID(), null); - loc.setAddress1( location.getAddress1() ); - loc.setAddress2( location.getAddress2() ); - loc.setCity( location.getCity() ); - loc.setPostalCode( location.getPostal() ); - loc.setCCountryID( location.getC_Country_ID() ); - loc.setCRegionID( location.getC_Region_ID()); - - loc.setCountries( this.getCountry( location )); - - return ret; - } - - private LookupValues getCountry (MLocation location) - { - MCountry[] countries = MCountry.getCountries (location.getCtx()); - int comp = location.getC_Country_ID(); - if (comp == 0) - comp = Env.getContextAsInt(m_cs.getM_ctx(), "C_Country_ID"); - - LookupValues lvs = LookupValues.Factory.newInstance(); - for (int i = 0; i < countries.length; i++) - { - LookupValue lv = lvs.addNewLv(); - lv.setKey(String.valueOf(countries[i].getC_Country_ID())); - lv.setVal( countries[i].getName() ); - } - - - return lvs; - } - - /*private LookupValues getRegion (MLocation location) - { - MRegion[] regions = MRegion.getRegions (location.getCtx(), location.getC_Country_ID()); - int comp = location.getC_Region_ID(); - if (comp == 0) - comp = Env.getContextAsInt(m_cs.getM_ctx(), "C_Region_ID"); - - LookupValues lvs = LookupValues.Factory.newInstance(); - for (int i = 0; i < regions.length; i++) - { - LookupValue lv = lvs.addNewLv(); - lv.setKey(String.valueOf(regions[i].getC_Region_ID())); - lv.setVal( regions[i].getName() ); - } - - return lvs; - } */ - - public DocActionDocument getDocAction(int WindowNo, int TabNo, int RowNo, String ColName ) - { - authenticate(webServiceName, "getDocAction"); - DocActionDocument ret = DocActionDocument.Factory.newInstance(); - DocAction da = ret.addNewDocAction(); - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, WindowNo, true, TabNo, true, RowNo); - if (ws != null) - { - LookupValues lvs = da.addNewAction(); - Process.renderDocActionOptions(lvs, ws.curTab); - } - - return ret; - } - - public StandardResponseDocument setDocAction(int WindowNo, int TabNo, int RowNo, String ColName, String docAction ) - { - authenticate(webServiceName, "setDocAction"); - StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance(); - StandardResponse sr = ret.addNewStandardResponse(); - - WWindowStatus ws = WWindowStatus.get(WindowStatusMap, WindowNo, true, TabNo, true, RowNo); - if (ws != null) - { - ws.curTab.setValue("DocAction", docAction); - boolean result = false; - if (ws.curTab.needSave(true, false)) //slain - do not dispose of error, if not write musiales - { - if (! (result = ws.curTab.dataSave(true))) - ws.curTab.dataIgnore(); - - } - sr.setIsError(!result); - - } else - sr.setIsError( true ); - - return ret; - } - - - private void updateRecIDMap(WWindowStatus ws) { - ws.updateRecIDMap(); - /* - int rc = ws.curTab.getRowCount(); - int initRowNo = 0; - - Map RecordIDMap = ws.getRecordIDMap(); - - RecordIDMap.clear(); - - for (int lineNo = initRowNo; lineNo < rc; lineNo++) - { - int recID = ws.curTab.getKeyID( lineNo ); - //System.out.println(""+lineNo+" - "+recID); - RecordIDMap.put( recID, lineNo ); - - } */ - } - -} \ No newline at end of file diff --git a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/InfoBPartner.java b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/InfoBPartner.java index 64b65939c4..bf9c5f00bd 100644 --- a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/InfoBPartner.java +++ b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/InfoBPartner.java @@ -9,8 +9,8 @@ import org.compiere.util.CLogger; import org.compiere.util.Env; import org.compiere.util.Msg; -import pl.x3E.adInterface.DataField; -import pl.x3E.adInterface.DataRow; +import org.idempiere.adInterface.x10.DataField; +import org.idempiere.adInterface.x10.DataRow; public class InfoBPartner implements ADInfo { diff --git a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/InfoProduct.java b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/InfoProduct.java index f4dfa944eb..69ac22ff7b 100644 --- a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/InfoProduct.java +++ b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/InfoProduct.java @@ -16,8 +16,8 @@ import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; -import pl.x3E.adInterface.DataField; -import pl.x3E.adInterface.DataRow; +import org.idempiere.adInterface.x10.DataField; +import org.idempiere.adInterface.x10.DataRow; public class InfoProduct implements ADInfo { diff --git a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ModelADService.java b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ModelADService.java index 2a46a1c6ce..2098759695 100644 --- a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ModelADService.java +++ b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ModelADService.java @@ -36,13 +36,13 @@ import javax.jws.soap.SOAPBinding.ParameterStyle; import javax.jws.soap.SOAPBinding.Style; import javax.jws.soap.SOAPBinding.Use; -import pl.x3E.adInterface.ModelCRUDRequestDocument; -import pl.x3E.adInterface.ModelGetListRequestDocument; -import pl.x3E.adInterface.ModelRunProcessRequestDocument; -import pl.x3E.adInterface.ModelSetDocActionRequestDocument; -import pl.x3E.adInterface.RunProcessResponseDocument; -import pl.x3E.adInterface.StandardResponseDocument; -import pl.x3E.adInterface.WindowTabDataDocument; +import org.idempiere.adInterface.x10.ModelCRUDRequestDocument; +import org.idempiere.adInterface.x10.ModelGetListRequestDocument; +import org.idempiere.adInterface.x10.ModelRunProcessRequestDocument; +import org.idempiere.adInterface.x10.ModelSetDocActionRequestDocument; +import org.idempiere.adInterface.x10.RunProcessResponseDocument; +import org.idempiere.adInterface.x10.StandardResponseDocument; +import org.idempiere.adInterface.x10.WindowTabDataDocument; @WebService(targetNamespace="http://3e.pl/ADInterface") @SOAPBinding(style=Style.RPC,use=Use.LITERAL,parameterStyle=ParameterStyle.WRAPPED) @@ -65,5 +65,7 @@ public interface ModelADService { public WindowTabDataDocument readData(ModelCRUDRequestDocument req); public WindowTabDataDocument queryData(ModelCRUDRequestDocument req); + + public StandardResponseDocument createUpdateData(ModelCRUDRequestDocument req); } diff --git a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ModelADServiceImpl.java b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ModelADServiceImpl.java index 908bd55308..192d2b7bf4 100644 --- a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ModelADServiceImpl.java +++ b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/ModelADServiceImpl.java @@ -29,60 +29,62 @@ package com._3e.ADInterface; -import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; import java.util.ArrayList; +import java.util.Map; import java.util.Properties; import java.util.logging.Level; import javax.jws.WebService; import javax.xml.namespace.QName; +import javax.xml.ws.WebServiceContext; import org.apache.xmlbeans.StringEnumAbstractBase.Table; +import org.compiere.model.Lookup; import org.compiere.model.MColumn; import org.compiere.model.MRefTable; import org.compiere.model.MRole; import org.compiere.model.MTable; -import org.compiere.model.MWebService; import org.compiere.model.MWebServiceType; import org.compiere.model.PO; import org.compiere.model.POInfo; import org.compiere.model.X_AD_Reference; -import org.compiere.model.X_WS_WebServiceMethod; +import org.compiere.model.X_WS_WebServiceFieldInput; import org.compiere.model.X_WS_WebService_Para; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.KeyNamePair; -import org.compiere.util.Login; import org.compiere.util.Trx; +import org.compiere.util.ValueNamePair; +import org.idempiere.adInterface.x10.ADLoginRequest; +import org.idempiere.adInterface.x10.DataField; +import org.idempiere.adInterface.x10.DataRow; +import org.idempiere.adInterface.x10.DataSet; +import org.idempiere.adInterface.x10.ModelCRUD; +import org.idempiere.adInterface.x10.ModelCRUD.Action.Enum; +import org.idempiere.adInterface.x10.ModelCRUDRequestDocument; +import org.idempiere.adInterface.x10.ModelGetList; +import org.idempiere.adInterface.x10.ModelGetListRequestDocument; +import org.idempiere.adInterface.x10.ModelRunProcess; +import org.idempiere.adInterface.x10.ModelRunProcessRequestDocument; +import org.idempiere.adInterface.x10.ModelSetDocAction; +import org.idempiere.adInterface.x10.ModelSetDocActionRequestDocument; +import org.idempiere.adInterface.x10.RunProcess; +import org.idempiere.adInterface.x10.RunProcessDocument; +import org.idempiere.adInterface.x10.RunProcessResponse; +import org.idempiere.adInterface.x10.RunProcessResponseDocument; +import org.idempiere.adInterface.x10.StandardResponse; +import org.idempiere.adInterface.x10.StandardResponseDocument; +import org.idempiere.adInterface.x10.WindowTabData; +import org.idempiere.adInterface.x10.WindowTabDataDocument; +import org.idempiere.webservices.AbstractService; +import org.idempiere.webservices.IWSValidator; import org.idempiere.webservices.fault.IdempiereServiceFault; -import pl.x3E.adInterface.ADLoginRequest; -import pl.x3E.adInterface.DataField; -import pl.x3E.adInterface.DataRow; -import pl.x3E.adInterface.DataSet; -import pl.x3E.adInterface.ModelCRUD; -import pl.x3E.adInterface.ModelCRUDRequestDocument; -import pl.x3E.adInterface.ModelGetList; -import pl.x3E.adInterface.ModelGetListRequestDocument; -import pl.x3E.adInterface.ModelRunProcess; -import pl.x3E.adInterface.ModelRunProcessRequestDocument; -import pl.x3E.adInterface.ModelSetDocAction; -import pl.x3E.adInterface.ModelSetDocActionRequestDocument; -import pl.x3E.adInterface.RunProcess; -import pl.x3E.adInterface.RunProcessDocument; -import pl.x3E.adInterface.RunProcessResponse; -import pl.x3E.adInterface.RunProcessResponseDocument; -import pl.x3E.adInterface.StandardResponse; -import pl.x3E.adInterface.StandardResponseDocument; -import pl.x3E.adInterface.WindowTabData; -import pl.x3E.adInterface.WindowTabDataDocument; -import pl.x3E.adInterface.ModelCRUD.Action.Enum; - /* * ADEMPIERE/COMPIERE * @@ -94,6 +96,12 @@ import pl.x3E.adInterface.ModelCRUD.Action.Enum; * Contributors: Carlos Ruiz - globalqss * Add model oriented method modelSetDocAction * Some Polish messages translated to english using google translate + * Deepak Pansheriya + * Abstracting out Authenticate and login method + * Re factored to add support for composite web service + * Added CreateUpdate end point + * Added Support for Ctx Variable and ability to pass ctx variable in request + * Added configurable output fields */ @@ -103,103 +111,186 @@ import pl.x3E.adInterface.ModelCRUD.Action.Enum; * */ @WebService(endpointInterface="com._3e.ADInterface.ModelADService", serviceName="ModelADService",targetNamespace="http://3e.pl/ADInterface") -public class ModelADServiceImpl implements ModelADService { +public class ModelADServiceImpl extends AbstractService implements ModelADService { private static CLogger log = CLogger.getCLogger(ModelADServiceImpl.class); private static String webServiceName = new String("ModelADService"); - private CompiereService m_cs; + private boolean manageTrx = true; - private MWebService m_webservice = null; - private X_WS_WebServiceMethod m_webservicemethod; - private MWebServiceType m_webservicetype; + private String localTrxName = null; + + public boolean isManageTrx() { + return manageTrx; + } + + public void setManageTrx(boolean manageTrx) { + this.manageTrx = manageTrx; + } + + public String getLocalTrxName() { + return localTrxName; + } + + public void setLocalTrxName(String locatTrxName) { + this.localTrxName = locatTrxName; + } public ModelADServiceImpl() { - m_cs = new CompiereService(); - m_cs.connect(); log.info("Creating session object ADService"); } - public String getVersion() { - return "0.7.0"; + public ModelADServiceImpl(WebServiceContext ctx) + { + this.ctx =ctx; + + log.info("Creating session object ADService"); } - + public String getVersion() { + return "0.8.0"; + } + /* - * Model oriented web service to change DocAction for documents, i.e. Complete a Material Receipt - * WARNING!!! This web service complete documents not via workflow, so it jump over any approval step considered in document workflow - * To complete documents using workflow it's better to use the runProcess web service + * Model oriented web service to change DocAction for documents, i.e. + * Complete a Material Receipt WARNING!!! This web service complete + * documents not via workflow, so it jump over any approval step considered + * in document workflow To complete documents using workflow it's better to + * use the runProcess web service */ - public StandardResponseDocument setDocAction( - ModelSetDocActionRequestDocument req) { - StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance(); - StandardResponse resp = ret.addNewStandardResponse(); - ModelSetDocAction modelSetDocAction = req.getModelSetDocActionRequest().getModelSetDocAction(); + public StandardResponseDocument setDocAction(ModelSetDocActionRequestDocument req) { + + StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance(); + StandardResponse resp = ret.addNewStandardResponse(); + ModelSetDocAction modelSetDocAction = req.getModelSetDocActionRequest().getModelSetDocAction(); String serviceType = modelSetDocAction.getServiceType(); - ADLoginRequest reqlogin = req.getModelSetDocActionRequest().getADLoginRequest(); + ADLoginRequest reqlogin = req.getModelSetDocActionRequest().getADLoginRequest(); - String err = modelLogin(reqlogin, webServiceName, "setDocAction", serviceType); - if (err != null && err.length() > 0) { - resp.setError(err); - resp.setIsError(true); - return ret; - } - - Properties ctx = m_cs.getM_ctx(); + CompiereService m_cs = getCompiereService(); - // Validate parameters - modelSetDocAction.setTableName(validateParameter("tableName", modelSetDocAction.getTableName())); - modelSetDocAction.setRecordID(validateParameter("recordID", modelSetDocAction.getRecordID())); - modelSetDocAction.setDocAction(validateParameter("docAction", modelSetDocAction.getDocAction())); - - String tableName = modelSetDocAction.getTableName(); - int recordID = modelSetDocAction.getRecordID(); - String docAction = modelSetDocAction.getDocAction(); - resp.setRecordID (recordID); - - // start a trx - String trxName = Trx.createTrxName("ws_modelSetDocAction"); - Trx trx = Trx.get(trxName, false); - - // get the PO for the tablename and record ID - MTable table = MTable.get(ctx, tableName); - if (table == null) - return rollbackAndSetError(trx, resp, ret, true, "No table " + tableName); - PO po = table.getPO(recordID, trxName); - if (po == null) - return rollbackAndSetError(trx, resp, ret, true, "No Record " + recordID + " in " + tableName); + String err = login(reqlogin, webServiceName, "setDocAction", serviceType); + if (err != null && err.length() > 0) { + resp.setError(err); + resp.setIsError(true); + return ret; + } - // set explicitly the column DocAction to avoid automatic process of default option - po.set_ValueOfColumn("DocAction", docAction); + + try { + // Validate parameters + modelSetDocAction.setTableName(validateParameter("tableName", modelSetDocAction.getTableName())); + modelSetDocAction.setRecordID(validateParameter("recordID", modelSetDocAction.getRecordID())); + modelSetDocAction.setDocAction(validateParameter("docAction", modelSetDocAction.getDocAction())); + } catch (IdempiereServiceFault e) { + resp.setError(e.getMessage()); + resp.setIsError(true); + return ret; + } + + Properties ctx = m_cs.getM_ctx(); + + // start a trx + String trxName = localTrxName; + if (trxName == null) { + trxName = Trx.createTrxName("ws_modelSetDocAction"); + manageTrx = true; + } + + Trx trx = Trx.get(trxName, true); + + Map requestCtx = getRequestCtx(); + + String tableName = modelSetDocAction.getTableName(); + + String recordIDVar = modelSetDocAction.getRecordIDVariable(); + int recordID = modelSetDocAction.getRecordID(); + + if (recordIDVar != null && recordIDVar.startsWith("@")) { + Integer retVal = (Integer) parseVariable(recordIDVar, null, null, requestCtx); + if (retVal == null) { + return rollbackAndSetError(trx, resp, ret, true, "Cannot resolve variable: " + recordIDVar); + } + recordID=retVal; + } + + String docAction = modelSetDocAction.getDocAction(); + resp.setRecordID(recordID); + + // get the PO for the tablename and record ID + MTable table = MTable.get(ctx, tableName); + if (table == null) + return rollbackAndSetError(trx, resp, ret, true, "No table " + tableName); + + PO po = table.getPO(recordID, trxName); + if (po == null) + return rollbackAndSetError(trx, resp, ret, true, "No Record " + recordID + " in " + tableName); + + // set explicitly the column DocAction to avoid automatic process of + // default option + po.set_ValueOfColumn("DocAction", docAction); if (!po.save()) - return rollbackAndSetError(trx, resp, ret, true, "Cannot save before set docAction: " + CLogger.retrieveErrorString("no log message")); - - // call process it - try { - if (! ((org.compiere.process.DocAction) po).processIt(docAction)) - return rollbackAndSetError(trx, resp, ret, true, "Couldn't set docAction: " + ((org.compiere.process.DocAction) po).getProcessMsg()); + return rollbackAndSetError(trx, resp, ret, true, + "Cannot save before set docAction: " + CLogger.retrieveErrorString("no log message")); + + MWebServiceType m_webservicetype = getWebServiceType(); + + // For passing action to validators + requestCtx.put("DocAction", docAction); + + // Fire Event + StandardResponseDocument retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIME_BEFORE_PARSE, po, null, trx, requestCtx, + resp, ret); + if (retResp != null) + return retResp; + + // call process it + try { + if (!((org.compiere.process.DocAction) po).processIt(docAction)) + return rollbackAndSetError(trx, resp, ret, true, + "Couldn't set docAction: " + ((org.compiere.process.DocAction) po).getProcessMsg()); } catch (Exception e) { return rollbackAndSetError(trx, resp, ret, true, e.toString()); } - // close the trx + // Fire Event + retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIME_BEFORE_SAVE, po, null, trx, requestCtx, resp, ret); + if (retResp != null) + return retResp; + + // close the trx if (!po.save()) - return rollbackAndSetError(trx, resp, ret, true, "Cannot save after set docAction: " + CLogger.retrieveErrorString("no log message")); - - if (!trx.commit()) + return rollbackAndSetError(trx, resp, ret, true, + "Cannot save after set docAction: " + CLogger.retrieveErrorString("no log message")); + + // Fire Event + retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIME_AFTER_SAVE, po, null, trx, requestCtx, resp, ret); + if (retResp != null) + return retResp; + + if (manageTrx && !trx.commit()) return rollbackAndSetError(trx, resp, ret, true, "Cannot commit after docAction"); - - trx.close(); - - // resp.setError(""); - resp.setIsError(false); + + if (manageTrx) + trx.close(); + + // resp.setError(""); + resp.setIsError(false); + + POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID()); + setOuputFields(resp, m_webservicetype, po, poinfo); + + + return ret; } private String validateParameter(String parameterName, String string) { + + MWebServiceType m_webservicetype= getWebServiceType(); + X_WS_WebService_Para para = m_webservicetype.getParameter(parameterName); if (para == null && (string == null || string.length() == 0)) // if parameter not configured but didn't receive value (optional param) @@ -254,175 +345,37 @@ public class ModelADServiceImpl implements ModelADService { return (Enum) table.forString(string); } - private StandardResponseDocument rollbackAndSetError(Trx trx, - StandardResponse resp, StandardResponseDocument ret, boolean isError, - String string) { - resp.setError(string); - resp.setIsError(isError); - trx.rollback(); - trx.close(); - return ret; - } - - private String modelLogin(ADLoginRequest r, String webService, String method, String serviceType) { - - // TODO: Share login between different sessions - if ( m_cs.isLoggedIn() - && m_cs.getM_AD_Client_ID() == r.getClientID() - && m_cs.getM_AD_Org_ID() == r.getOrgID() - && m_cs.getM_AD_Role_ID() == r.getRoleID() - && m_cs.getM_AD_Warehouse_ID() == r.getWarehouseID() - && r.getUser().equals(m_cs.getUser()) - ) - return authenticate(webService, method, serviceType); // already logged with same data - - Login login = new Login(m_cs.getM_ctx()); - KeyNamePair[] roles = login.getRoles(r.getUser(), r.getPass()); - if (roles != null) - { - boolean okrole = false; - for (KeyNamePair role : roles) { - if (role.getKey() == r.getRoleID()) { - okrole = true; - break; - } - } - if (!okrole) - return "Error logging in - role not allowed for this user"; - - KeyNamePair[] clients = login.getClients( new KeyNamePair(r.getRoleID(), "" ) ); - boolean okclient = false; - for (KeyNamePair client : clients) { - if (client.getKey() == r.getClientID()) { - okclient = true; - break; - } - } - if (!okclient) - return "Error logging in - client not allowed for this role"; - - m_cs.getM_ctx().setProperty("#AD_Client_ID", "" + r.getClientID()); - - KeyNamePair[] orgs = login.getOrgs( new KeyNamePair(r.getRoleID(), "" )); - - if (orgs == null) - return "Error logging in - no organizations for this role"; - - KeyNamePair orglogin = null; - boolean okorg = false; - for (KeyNamePair org : orgs) { - if (org.getKey() == r.getOrgID()) { - okorg = true; - orglogin = org; - break; - } - } - if (!okorg) - return "Error logging in - org not allowed for this role"; - - KeyNamePair[] warehouses = login.getWarehouses( new KeyNamePair(r.getOrgID(), "" ) ); - boolean okwh = false; - for (KeyNamePair warehouse : warehouses) { - if (warehouse.getKey() == r.getWarehouseID()) { - okwh = true; - break; - } - } - if (!okwh) - return "Error logging in - warehouse not allowed for this org"; - - String error = login.validateLogin(orglogin); - if (error != null && error.length() > 0) - return error; - - int AD_User_ID = Env.getAD_User_ID(m_cs.getM_ctx()); - - if ( !m_cs.login( AD_User_ID, r.getRoleID(), r.getClientID(), r.getOrgID(), r.getWarehouseID(), r.getLang() ) ) - return "Error logging in"; - } - else - { - return "Error logging in - no roles or user/pwd invalid for user " + r.getUser(); - } - - return authenticate(webService, method, serviceType); - } - - private String authenticate(String webServiceValue, String methodValue, String serviceTypeValue) { - m_webservice = MWebService.get(m_cs.getM_ctx(), webServiceValue); - if (m_webservice == null || ! m_webservice.isActive()) - return "Web Service " + webServiceValue + " not registered"; - - m_webservicemethod = m_webservice.getMethod(methodValue); - if (m_webservicemethod == null || ! m_webservicemethod.isActive()) - return "Method " + methodValue + " not registered"; - - m_webservicetype = null; - final String sql = "SELECT * FROM WS_WebServiceType " + - "WHERE AD_Client_ID=? " + - "AND WS_WebService_ID=? " + - "AND WS_WebServiceMethod_ID=? " + - "AND Value=? " + - "AND IsActive='Y'"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement (sql, null); - pstmt.setInt(1, m_cs.getM_AD_Client_ID()); - pstmt.setInt(2, m_webservice.getWS_WebService_ID()); - pstmt.setInt(3, m_webservicemethod.getWS_WebServiceMethod_ID()); - pstmt.setString(4, serviceTypeValue); - rs = pstmt.executeQuery (); - if (rs.next ()) - m_webservicetype = new MWebServiceType (m_cs.getM_ctx(), rs, null); - } - catch (Exception e) - { - throw new IdempiereServiceFault(e.getClass().toString() + " " + e.getMessage() + " sql=" + sql, e.getCause(), new QName("authenticate")); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - if (m_webservicetype == null) - return "Service type " + serviceTypeValue + " not configured"; - - return null; - } + public RunProcessResponseDocument runProcess(ModelRunProcessRequestDocument req) { RunProcessResponseDocument resbadlogin = RunProcessResponseDocument.Factory.newInstance(); RunProcessResponse rbadlogin = resbadlogin.addNewRunProcessResponse(); - ModelRunProcess modelRunProcess = req.getModelRunProcessRequest().getModelRunProcess(); + ModelRunProcess modelRunProcess = req.getModelRunProcessRequest().getModelRunProcess(); String serviceType = modelRunProcess.getServiceType(); ADLoginRequest reqlogin = req.getModelRunProcessRequest().getADLoginRequest(); - String err = modelLogin(reqlogin, webServiceName, "runProcess", serviceType); - if (err != null && err.length() > 0) { - rbadlogin.setError(err); - rbadlogin.setIsError( true ); - return resbadlogin; - } + String err = login(reqlogin, webServiceName, "runProcess", serviceType); + if (err != null && err.length() > 0) { + rbadlogin.setError(err); + rbadlogin.setIsError(true); + return resbadlogin; + } - // Validate parameters - modelRunProcess.setADMenuID(validateParameter("AD_Menu_ID", modelRunProcess.getADMenuID())); - modelRunProcess.setADProcessID(validateParameter("AD_Process_ID", modelRunProcess.getADProcessID())); - modelRunProcess.setADRecordID(validateParameter("AD_Record_ID", modelRunProcess.getADRecordID())); - modelRunProcess.setDocAction(validateParameter("DocAction", modelRunProcess.getDocAction())); + // Validate parameters + modelRunProcess.setADMenuID(validateParameter("AD_Menu_ID", modelRunProcess.getADMenuID())); + modelRunProcess.setADProcessID(validateParameter("AD_Process_ID", modelRunProcess.getADProcessID())); + modelRunProcess.setADRecordID(validateParameter("AD_Record_ID", modelRunProcess.getADRecordID())); + modelRunProcess.setDocAction(validateParameter("DocAction", modelRunProcess.getDocAction())); RunProcessDocument docprocess = RunProcessDocument.Factory.newInstance(); - RunProcess reqprocess = docprocess.addNewRunProcess(); - reqprocess.setParamValues(modelRunProcess.getParamValues()); - reqprocess.setADProcessID(modelRunProcess.getADProcessID()); - reqprocess.setADMenuID(modelRunProcess.getADMenuID()); - reqprocess.setADRecordID(modelRunProcess.getADRecordID()); - reqprocess.setDocAction(modelRunProcess.getDocAction()); - return Process.runProcess(m_cs, docprocess); + RunProcess reqprocess = docprocess.addNewRunProcess(); + reqprocess.setParamValues(modelRunProcess.getParamValues()); + reqprocess.setADProcessID(modelRunProcess.getADProcessID()); + reqprocess.setADMenuID(modelRunProcess.getADMenuID()); + reqprocess.setADRecordID(modelRunProcess.getADRecordID()); + reqprocess.setDocAction(modelRunProcess.getDocAction()); + return Process.runProcess(getCompiereService(), docprocess); } public WindowTabDataDocument getList(ModelGetListRequestDocument req) { @@ -435,7 +388,7 @@ public class ModelADServiceImpl implements ModelADService { ADLoginRequest reqlogin = req.getModelGetListRequest().getADLoginRequest(); - String err = modelLogin(reqlogin, webServiceName, "getList", serviceType); + String err = login(reqlogin, webServiceName, "getList", serviceType); if (err != null && err.length() > 0) { res.setError(err); res.setErrorInfo(err); @@ -455,6 +408,8 @@ public class ModelADServiceImpl implements ModelADService { else filter = " AND " + filter; + CompiereService m_cs = getCompiereService(); + Properties ctx = m_cs.getM_ctx(); X_AD_Reference ref = new X_AD_Reference(ctx, ref_id, null); @@ -463,6 +418,7 @@ public class ModelADServiceImpl implements ModelADService { ArrayList listColumnNames = new ArrayList(); PreparedStatement pstmt = null; ResultSet rs = null; + MWebServiceType m_webservicetype= getWebServiceType(); if (X_AD_Reference.VALIDATIONTYPE_ListValidation.equals(ref.getValidationType())) { // Fill List Reference String ad_language = Env.getAD_Language(ctx); @@ -632,49 +588,65 @@ public class ModelADServiceImpl implements ModelADService { } // getList public StandardResponseDocument deleteData(ModelCRUDRequestDocument req) { - StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance(); - StandardResponse resp = ret.addNewStandardResponse(); - ModelCRUD modelCRUD = req.getModelCRUDRequest().getModelCRUD(); + StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance(); + StandardResponse resp = ret.addNewStandardResponse(); + ModelCRUD modelCRUD = req.getModelCRUDRequest().getModelCRUD(); String serviceType = modelCRUD.getServiceType(); - - ADLoginRequest reqlogin = req.getModelCRUDRequest().getADLoginRequest(); - String err = modelLogin(reqlogin, webServiceName, "deleteData", serviceType); - if (err != null && err.length() > 0) { - resp.setError(err); - resp.setIsError(true); - return ret; - } - // Validate parameters vs service type - validateCRUD(modelCRUD); + ADLoginRequest reqlogin = req.getModelCRUDRequest().getADLoginRequest(); + String err = login(reqlogin, webServiceName, "deleteData", serviceType); + if (err != null && err.length() > 0) { + resp.setError(err); + resp.setIsError(true); + return ret; + } - String tableName = modelCRUD.getTableName(); - int recordID = modelCRUD.getRecordID(); - resp.setRecordID (recordID); + // Validate parameters vs service type + try{ + validateCRUD(modelCRUD); + } catch (IdempiereServiceFault e) { + resp.setError(e.getMessage()); + resp.setIsError(true); + return ret; + } - Properties ctx = m_cs.getM_ctx(); - - // start a trx - String trxName = Trx.createTrxName("ws_modelDeleteData"); - Trx trx = Trx.get(trxName, false); - - // get the PO for the tablename and record ID - MTable table = MTable.get(ctx, tableName); - if (table == null) - return rollbackAndSetError(trx, resp, ret, true, "No table " + tableName); - PO po = table.getPO(recordID, trxName); - if (po == null) - return rollbackAndSetError(trx, resp, ret, true, "No Record " + recordID + " in " + tableName); + String tableName = modelCRUD.getTableName(); + int recordID = modelCRUD.getRecordID(); + resp.setRecordID(recordID); - if (!po.delete(false)) - return rollbackAndSetError(trx, resp, ret, true, "Cannot delete record " + recordID + " in " + tableName + ": " + CLogger.retrieveErrorString("no log message")); + CompiereService m_cs = getCompiereService(); + Properties ctx = m_cs.getM_ctx(); - // close the trx - if (!trx.commit()) - return rollbackAndSetError(trx, resp, ret, true, "Cannot commit transaction after delete record " + recordID + " in " + tableName); + // start a trx + String trxName = localTrxName; + Trx trx = null; + if (trxName == null) { + trxName = Trx.createTrxName("ws_modelCreateData"); + manageTrx = true; + } + + trx = Trx.get(trxName, true); + + // get the PO for the tablename and record ID + MTable table = MTable.get(ctx, tableName); + if (table == null) + return rollbackAndSetError(trx, resp, ret, true, "No table " + tableName); + PO po = table.getPO(recordID, trxName); + if (po == null) + return rollbackAndSetError(trx, resp, ret, true, "No Record " + recordID + " in " + tableName); + + if (!po.delete(false)) + return rollbackAndSetError(trx, resp, ret, true, + "Cannot delete record " + recordID + " in " + tableName + ": " + CLogger.retrieveErrorString("no log message")); + + // close the trx + if (manageTrx && !trx.commit()) + return rollbackAndSetError(trx, resp, ret, true, "Cannot commit transaction after delete record " + recordID + " in " + + tableName); + + if (manageTrx) + trx.close(); - trx.close(); - return ret; } @@ -686,13 +658,14 @@ public class ModelADServiceImpl implements ModelADService { } public StandardResponseDocument createData(ModelCRUDRequestDocument req){ + StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance(); StandardResponse resp = ret.addNewStandardResponse(); ModelCRUD modelCRUD = req.getModelCRUDRequest().getModelCRUD(); String serviceType = modelCRUD.getServiceType(); ADLoginRequest reqlogin = req.getModelCRUDRequest().getADLoginRequest(); - String err = modelLogin(reqlogin, webServiceName, "createData", serviceType); + String err = login(reqlogin, webServiceName, "createData", serviceType); if (err != null && err.length() > 0) { resp.setError(err); resp.setIsError(true); @@ -700,15 +673,29 @@ public class ModelADServiceImpl implements ModelADService { } // Validate parameters vs service type - validateCRUD(modelCRUD); + try{ + validateCRUD(modelCRUD); + } catch (IdempiereServiceFault e) { + resp.setError(e.getMessage()); + resp.setIsError(true); + return ret; + } String tableName = modelCRUD.getTableName(); + CompiereService m_cs= getCompiereService(); Properties ctx = m_cs.getM_ctx(); // start a trx - String trxName = Trx.createTrxName("ws_modelCreateData"); - Trx trx = Trx.get(trxName, false); + String trxName = localTrxName; + Trx trx = null; + if(trxName==null){ + trxName = Trx.createTrxName("ws_modelCreateData"); + manageTrx = true; + } + + trx = Trx.get(trxName, true); + // get the PO for the tablename and record ID MTable table = MTable.get(ctx, tableName); @@ -721,99 +708,377 @@ public class ModelADServiceImpl implements ModelADService { POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID()); DataRow dr = modelCRUD.getDataRow(); - - for (DataField field : dr.getFieldArray()) { - // TODO: Implement lookup - if (m_webservicetype.isInputColumnNameAllowed(field.getColumn())) { - int idxcol = po.get_ColumnIndex(field.getColumn()); - if (idxcol < 0) { - // The column doesn't exist - it must exist as it's defined in security - return rollbackAndSetError(trx, resp, ret, true, "Web service type " - + m_webservicetype.getValue() + ": input column " - + field.getColumn() + " does not exist"); - } else { - try { - setValueAccordingToClass(po, poinfo, field, idxcol); - } - catch (IdempiereServiceFault e) { - log.log(Level.WARNING, "Error setting value", e); - return rollbackAndSetError(trx, resp, ret, true, "Web service type " - + m_webservicetype.getValue() + ": input column " - + field.getColumn() + " value could not be set: " + e.getLocalizedMessage()); - } - } - } else { - - return rollbackAndSetError(trx, resp, ret, true, "Web service type " - + m_webservicetype.getValue() + ": input column " - + field.getColumn() + " not allowed"); - } - } + MWebServiceType m_webservicetype= getWebServiceType(); + Map requestCtx = getRequestCtx(); + + DataField[] fields = dr.getFieldArray(); + StandardResponseDocument retResp =invokeWSValidator(m_webservicetype, IWSValidator.TIME_BEFORE_PARSE, po, fields,trx,requestCtx, resp, ret); + if (retResp != null) + return retResp; + + retResp= scanFields(fields, m_webservicetype, po, poinfo, trx,resp,ret); + if(retResp!=null) + return retResp; + + retResp =invokeWSValidator(m_webservicetype, IWSValidator.TIME_AFTER_PARSE, po, fields,trx,requestCtx, resp, ret); + if (retResp != null) + return retResp; + + + retResp =invokeWSValidator(m_webservicetype, IWSValidator.TIME_BEFORE_SAVE, po, fields,trx,requestCtx, resp, ret); + if (retResp != null) + return retResp; + if (!po.save()) return rollbackAndSetError(trx, resp, ret, true, "Cannot save record in " + tableName + ": " + CLogger.retrieveErrorString("no log message")); + retResp =invokeWSValidator(m_webservicetype, IWSValidator.TIME_AFTER_SAVE, po, fields,trx,requestCtx, resp, ret); + if (retResp != null) + return retResp; + int recordID = po.get_ID(); resp.setRecordID (recordID); + + //Update ctx variable for consecutive calls + if(requestCtx!=null){ + requestCtx.put(po.get_TableName(), po); + } // close the trx - if (!trx.commit()) + if (manageTrx && !trx.commit()) return rollbackAndSetError(trx, resp, ret, true, "Cannot commit transaction after create record " + recordID + " in " + tableName); - trx.close(); + if (manageTrx) + trx.close(); + setOuputFields(resp, m_webservicetype,po,poinfo); + return ret; } // createData - private void setValueAccordingToClass(PO po, POInfo poinfo, - DataField field, int idxcol) { + public StandardResponseDocument createUpdateData(ModelCRUDRequestDocument req) { + StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance(); + StandardResponse resp = ret.addNewStandardResponse(); + ModelCRUD modelCRUD = req.getModelCRUDRequest().getModelCRUD(); + String serviceType = modelCRUD.getServiceType(); + + ADLoginRequest reqlogin = req.getModelCRUDRequest().getADLoginRequest(); + String err = login(reqlogin, webServiceName, "createData", serviceType); + if (err != null && err.length() > 0) { + resp.setError(err); + resp.setIsError(true); + return ret; + } + + // Validate parameters vs service type + try{ + validateCRUD(modelCRUD); + } catch (IdempiereServiceFault e) { + resp.setError(e.getMessage()); + resp.setIsError(true); + return ret; + } + + String tableName = modelCRUD.getTableName(); + + CompiereService m_cs = getCompiereService(); + Properties ctx = m_cs.getM_ctx(); + + // start a trx + String trxName = localTrxName; + Trx trx = null; + if (trxName == null) { + trxName = Trx.createTrxName("ws_modelCreateData"); + manageTrx = true; + } + trx = Trx.get(trxName, true); + + // get the PO for the tablename and record ID + MTable table = MTable.get(ctx, tableName); + if (table == null) + return rollbackAndSetError(trx, resp, ret, true, "No table " + tableName); + + DataRow dr = modelCRUD.getDataRow(); + DataField fields[] = dr.getFieldArray(); + + PO holderPo = table.getPO(0, trxName); + POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID()); + + MWebServiceType m_webservicetype = getWebServiceType(); + Map requestCtx = getRequestCtx(); + + StandardResponseDocument retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIME_BEFORE_PARSE, holderPo, fields, trx, + requestCtx, resp, ret); + if (retResp != null) + return retResp; + + retResp = scanFields(fields, m_webservicetype, holderPo, poinfo, trx, resp, ret); + if (retResp != null) + return retResp; + + retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIME_AFTER_PARSE, holderPo, fields, trx, requestCtx, resp, ret); + if (retResp != null) + return retResp; + + boolean isCreate = false; + boolean isUpdate = false; + + String action = modelCRUD.getAction().toString(); + if (action.equals("Create")) + isCreate = true; + if (action.equals("Update")) + isUpdate = true; + if (action.equals("CreateUpdate")) { + isCreate = true; + isUpdate = true; + } + + ArrayList identifierList = m_webservicetype.getKeyColumns(); + + // For update it is mandatory to pass key column + if (isUpdate && identifierList.size() == 0) { + return rollbackAndSetError(trx, resp, ret, true, "Web service type " + m_webservicetype.getValue() + + ": There is no key column found "); + } + + // Check for existing element + int record_id = 0; + ArrayList resovedValue = new ArrayList(); + if (identifierList.size() > 0) { + StringBuilder sqlBuilder = new StringBuilder("Select "); + sqlBuilder.append(table.getTableName()).append("_ID from ").append(table.getTableName()).append(" ot Where "); + ArrayList sqlParaList = new ArrayList(); + for (String colName : identifierList) { + X_WS_WebServiceFieldInput fieldInput = m_webservicetype.getFieldInput(colName); + if (fieldInput.getIdentifierLogic() == null) { + if (holderPo.get_Value(colName) == null && fieldInput.isNullIdentifier()) { + sqlBuilder.append(" ot.").append(colName).append(" Is Null AND "); + } else if (holderPo.get_Value(colName) == null) { + return rollbackAndSetError(trx, resp, ret, true, "Web service type " + m_webservicetype.getValue() + + ": Record Identifiier column " + colName + " must be set"); + } else { + sqlBuilder.append(" ot.").append(colName).append("=? AND "); + sqlParaList.add(holderPo.get_Value(colName)); + resovedValue.add(holderPo.get_Value(colName)); + } + } else { + // SQL + String sql = parseSQL(fieldInput.getIdentifierLogic(), sqlParaList, holderPo, poinfo, requestCtx); + sqlBuilder.append(" ot.").append(colName).append(" = (").append(sql).append(") AND "); + resovedValue.add("DYN SQL"); + } + } + sqlBuilder.append(" ot.AD_Client_ID= ?"); + sqlParaList.add(Env.getAD_Client_ID(Env.getCtx())); + + String sql = sqlBuilder.toString(); + log.info("Web service type " + m_webservicetype.getValue() + "SQL to check existing record " + sql); + try { + record_id = DB.getSQLValueEx(trxName, sql, sqlParaList); + } catch (Exception e) { + log.log(Level.SEVERE, "ExistingRecordCheck: Exception while executing SQL :" + sql); + return rollbackAndSetError(trx, resp, ret, true, "Web service type " + m_webservicetype.getValue() + + " Exception while executing sql :" + sql); + } + } + if (record_id == -1) + record_id = 0; + + if (!isCreate && record_id == 0) { + resp.setError("No Record to update for " + table.getTableName() + " with (" + identifierList.toString() + ") = (" + + resovedValue.toString() + ")"); + resp.setIsError(true); + return ret; + } + + if (record_id > 0 && !isUpdate) { + resp.setError("Record already presents with " + table.getTableName() + "_ID = " + record_id); + resp.setIsError(true); + return ret; + } + + PO po = table.getPO(record_id, trxName); + + if (po == null) + return rollbackAndSetError(trx, resp, ret, true, "Cannot create PO for " + tableName); + + if (po.get_ColumnIndex("Processed") >= 0 && po.get_ValueAsBoolean("Processed")) { + resp.setError("Record not updatable for " + table.getTableName() + "_ID = " + record_id); + resp.setIsError(true); + return ret; + } + + // Setting value back from holder to new persistent po + for (DataField field : fields) { + int indx = poinfo.getColumnIndex(field.getColumn()); + if (indx != -1) { + po.set_ValueNoCheck(field.getColumn(), holderPo.get_Value(field.getColumn())); + } + } + + retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIME_BEFORE_SAVE, holderPo, fields, trx, requestCtx, resp, ret); + if (retResp != null) + return retResp; + + if (!po.save()) + return rollbackAndSetError(trx, resp, ret, true, + "Cannot save record in " + tableName + ": " + CLogger.retrieveErrorString("no log message")); + + retResp = invokeWSValidator(m_webservicetype, IWSValidator.TIME_AFTER_SAVE, holderPo, fields, trx, requestCtx, resp, ret); + if (retResp != null) + return retResp; + + int recordID = po.get_ID(); + resp.setRecordID(recordID); + + // Update ctx variable for consecutive calls + if (requestCtx != null) { + requestCtx.put(po.get_TableName(), po); + } + + // close the trx + if (manageTrx && !trx.commit()) + return rollbackAndSetError(trx, resp, ret, true, "Cannot commit transaction after create record " + recordID + " in " + + tableName); + + if (manageTrx) + trx.close(); + + setOuputFields(resp, m_webservicetype, po, poinfo); + + return ret; + } // createUpdateData + + private void setValueAccordingToClass(PO po, POInfo poinfo, DataField field, int idxcol) { + CompiereService m_cs = getCompiereService(); // Evaluate the type of the column and assign a proper variable - Class columnClass = poinfo.getColumnClass(idxcol); + Class columnClass = poinfo.getColumnClass(idxcol); Object value = null; - if (field.getVal() == null || field.getVal().length() == 0) { + String strValue = field.getVal(); + String lookupValue = field.getLval(); + if (lookupValue != null && !"".equals(lookupValue)) { + + Lookup lookup = poinfo.getColumnLookup(idxcol); + if (lookup == null) { + throw new IdempiereServiceFault(field.getColumn() + " is not lookup column. Pass Value in val element ", new QName( + "LookupResolutionFailed")); + } + if (lookup.getSize() == 0) + lookup.refresh(); + Object[] list = lookup.getData(true, true, true, false).toArray(); + + for (Object pair : list) { + if (pair instanceof KeyNamePair) { + KeyNamePair p = (KeyNamePair) pair; + if (p.getName().equals(lookupValue)) { + value = p.getID(); + break; + } + } else { + ValueNamePair p = (ValueNamePair) pair; + if (p.getName().equals(lookupValue)) { + value = p.getValue(); + break; + } + } + } + + if (value == null) { + throw new IdempiereServiceFault(" Invalid Lookup value:" + lookupValue, new QName("LookupResolutionFailed")); + } + + } else if (strValue == null || strValue.length() == 0) { value = null; - } else if (columnClass == Boolean.class) { - if ("Y".equalsIgnoreCase(field.getVal()) || "true".equalsIgnoreCase(field.getVal())) - value = new Boolean(true); - else if ("N".equalsIgnoreCase(field.getVal()) || "false".equalsIgnoreCase(field.getVal())) - value = new Boolean(false); - else - throw new IdempiereServiceFault("Web service type " - + m_webservicetype.getValue() + ": input column " - + field.getColumn() + " wrong value " + field.getVal(), - new QName("setValueAccordingToClass")); - } else if (columnClass == Integer.class) { - try { - value = Integer.parseInt(field.getVal()); - } catch (NumberFormatException e) { - throw new IdempiereServiceFault(e.getClass().toString() + " " + e.getMessage() + " for " + field.getColumn(), e.getCause(), new QName("setValueAccordingToClass")); + } else { + Map requestCtx = getRequestCtx(); + if (requestCtx != null && strValue.charAt(0) == '@') { + String varName = strValue.substring(1); + if (varName.charAt(0) == '#') { + varName = varName.substring(1); + strValue = m_cs.getM_ctx().getProperty(varName); + } else { + int indDot = varName.indexOf("."); + if (indDot == -1) { + // If there is no table name, then it should be + // premitive data type + value = requestCtx.get(varName); + } else { + String tblName = varName.substring(0, indDot); + String colName = varName.substring(indDot + 1); + if (colName.indexOf(".") >= 0) { + throw new IdempiereServiceFault(field.getVal() + " contains un supported multi level object resolution", + new QName("resolveCtxVariable")); + } + Object obj = requestCtx.get(tblName); + if (obj == null || !(obj instanceof PO)) { + throw new IdempiereServiceFault(" input column " + field.getColumn() + " can not found object of " + tblName + + ". Request variable " + field.getVal() + " can not resolved", new QName("resolveCtxVariable")); + } + + PO refPO = (PO) obj; + value = refPO.get_Value(colName); + + } + + if (value == null) { + throw new IdempiereServiceFault( + " input column " + field.getColumn() + " can not be resolved for value " + strValue, new QName( + "resolveCtxVariable")); + } + } } - } else if (columnClass == BigDecimal.class) { - try { - value = new BigDecimal(field.getVal()); - } catch (Exception e) { - throw new IdempiereServiceFault(e.getClass().toString() + " " + e.getMessage() + " for " + field.getColumn(), e.getCause(), new QName("setValueAccordingToClass")); + if (value == null) { + + value = convertToObj(strValue, columnClass, field.getColumn()); } - } else if (columnClass == Timestamp.class) { - try { - value = Timestamp.valueOf(field.getVal()); - } catch (Exception e) { - throw new IdempiereServiceFault(e.getClass().toString() + " " + e.getMessage() + " for " + field.getColumn(), e.getCause(), new QName("setValueAccordingToClass")); - } - } else if (columnClass == byte[].class) { - throw new IdempiereServiceFault("Web service type " - + m_webservicetype.getValue() + ": input column " - + field.getColumn() + " LOB not supported", - new QName("setValueAccordingToClass")); - } else { - value = field.getVal(); } if (!po.set_ValueOfColumnReturningBoolean(field.getColumn(), value)) - throw new IdempiereServiceFault("Cannot set value of column " - + field.getColumn(), - new QName("setValueAccordingToClass")); + throw new IdempiereServiceFault("Cannot set value of column " + field.getColumn(), new QName("setValueAccordingToClass")); } + public StandardResponseDocument scanFields(DataField[] fields,MWebServiceType m_webservicetype,PO po,POInfo poinfo,Trx trx,StandardResponse resp, StandardResponseDocument ret){ + Map requestCtx = getRequestCtx(); + + for (DataField field : fields) { + // Implement lookup + X_WS_WebServiceFieldInput fieldInput = m_webservicetype.getFieldInput(field.getColumn()); + if (fieldInput != null) { + //Is ctx variable + if (fieldInput.getAD_Column_ID() == 0 && fieldInput.getColumnName() != null) { + String varName = fieldInput.getColumnName(); + Class columnClass = getVariableType(varName, fieldInput.getAD_Reference_ID()); + Object objVal = convertToObj(field.getVal(),columnClass,varName); + requestCtx.put(varName, objVal); + + } else{ + + int idxcol = po.get_ColumnIndex(field.getColumn()); + if (idxcol < 0) { + // The column doesn't exist - it must exist as it's + // defined in security + return rollbackAndSetError(trx, resp, ret, true, "Web service type " + m_webservicetype.getValue() + + ": input column " + field.getColumn() + " does not exist"); + } else { + try { + setValueAccordingToClass(po, poinfo, field, idxcol); + } catch (IdempiereServiceFault e) { + log.log(Level.WARNING, "Error setting value", e); + return rollbackAndSetError(trx, resp, ret, true, "Web service type " + m_webservicetype.getValue() + + ": input column " + field.getColumn() + " value could not be set: " + e.getLocalizedMessage()); + } + } + } + } else { + + return rollbackAndSetError(trx, resp, ret, true, "Web service type " + m_webservicetype.getValue() + ": input column " + + field.getColumn() + " not allowed"); + } + } + + return null; + } + public StandardResponseDocument updateData(ModelCRUDRequestDocument req){ StandardResponseDocument ret = StandardResponseDocument.Factory.newInstance(); StandardResponse resp = ret.addNewStandardResponse(); @@ -821,7 +1086,7 @@ public class ModelADServiceImpl implements ModelADService { String serviceType = modelCRUD.getServiceType(); ADLoginRequest reqlogin = req.getModelCRUDRequest().getADLoginRequest(); - String err = modelLogin(reqlogin, webServiceName, "updateData", serviceType); + String err = login(reqlogin, webServiceName, "updateData", serviceType); if (err != null && err.length() > 0) { resp.setError(err); resp.setIsError(true); @@ -829,17 +1094,33 @@ public class ModelADServiceImpl implements ModelADService { } // Validate parameters vs service type - validateCRUD(modelCRUD); + try{ + validateCRUD(modelCRUD); + } catch (IdempiereServiceFault e) { + resp.setError(e.getMessage()); + resp.setIsError(true); + return ret; + } String tableName = modelCRUD.getTableName(); int recordID = modelCRUD.getRecordID(); resp.setRecordID (recordID); + CompiereService m_cs = getCompiereService(); + MWebServiceType m_webservicetype= getWebServiceType(); Properties ctx = m_cs.getM_ctx(); // start a trx - String trxName = Trx.createTrxName("ws_modelUpdateData"); - Trx trx = Trx.get(trxName, false); + String trxName = localTrxName; + Trx trx = null; + if(trxName==null){ + trxName = Trx.createTrxName("ws_modelCreateData"); + manageTrx = true; + } + + trx = Trx.get(trxName, true); + + // get the PO for the tablename and record ID MTable table = MTable.get(ctx, tableName); @@ -851,43 +1132,30 @@ public class ModelADServiceImpl implements ModelADService { POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID()); DataRow dr = modelCRUD.getDataRow(); - for (DataField field : dr.getFieldArray()) { - // TODO: Implement lookup - if (m_webservicetype.isInputColumnNameAllowed(field.getColumn())) { - int idxcol = po.get_ColumnIndex(field.getColumn()); - if (idxcol < 0) { - // The column doesn't exist - it must exist as it's defined in security - return rollbackAndSetError(trx, resp, ret, true, "Web service type " - + m_webservicetype.getValue() + ": input column " - + field.getColumn() + " does not exist"); - } else { - try { - setValueAccordingToClass(po, poinfo, field, idxcol); - } - catch (IdempiereServiceFault e) { - log.log(Level.WARNING, "Error setting value", e); - return rollbackAndSetError(trx, resp, ret, true, "Web service type " - + m_webservicetype.getValue() + ": input column " - + field.getColumn() + " value could not be set: " + e.getLocalizedMessage()); - } - } - } else { - - return rollbackAndSetError(trx, resp, ret, true, "Web service type " - + m_webservicetype.getValue() + ": input column " - + field.getColumn() + " not allowed"); - } - } + + StandardResponseDocument retResp = scanFields(dr.getFieldArray(), m_webservicetype, po, poinfo, trx, resp, ret); + if (retResp != null) + return retResp; + if(po.get_ColumnIndex("Processed")>=0 && po.get_ValueAsBoolean("Processed")){ + resp.setError("Record is processed and can not be updated"); + resp.setIsError(true); + return ret; + } + if (!po.save()) return rollbackAndSetError(trx, resp, ret, true, "Cannot save record in " + tableName + ": " + CLogger.retrieveErrorString("no log message")); - // close the trx - if (!trx.commit()) - return rollbackAndSetError(trx, resp, ret, true, "Cannot commit transaction after delete record " + recordID + " in " + tableName); + // close the trx + if (manageTrx && !trx.commit()) + return rollbackAndSetError(trx, resp, ret, true, "Cannot commit transaction after create record " + recordID + " in " + + tableName); + + if (manageTrx) + trx.close(); + + setOuputFields(resp, m_webservicetype, po, poinfo); - trx.close(); - return ret; } // updateData @@ -899,18 +1167,41 @@ public class ModelADServiceImpl implements ModelADService { int cnt = 0; ADLoginRequest reqlogin = req.getModelCRUDRequest().getADLoginRequest(); - String err = modelLogin(reqlogin, webServiceName, "readData", serviceType); + String err = login(reqlogin, webServiceName, "readData", serviceType); if (err != null && err.length() > 0) { resp.setError(err); return ret; } // Validate parameters vs service type - validateCRUD(modelCRUD); + try{ + validateCRUD(modelCRUD); + } catch (IdempiereServiceFault e) { + resp.setError(e.getMessage()); + return ret; + } + CompiereService m_cs = getCompiereService(); + MWebServiceType m_webservicetype= getWebServiceType(); + + // start a trx + String trxName = localTrxName; + + Properties ctx = m_cs.getM_ctx(); String tableName = modelCRUD.getTableName(); - int recordID = modelCRUD.getRecordID(); + + String recordIDVar = modelCRUD.getRecordIDVariable(); + int recordID = modelCRUD.getRecordID(); + + if (recordIDVar != null && recordIDVar.startsWith("@")) { + Integer retVal = (Integer) parseVariable(recordIDVar, null, null, getRequestCtx()); + if (retVal == null) { + resp.setError("Cannot resolve variable: " + recordIDVar); + return ret; + } + recordID=retVal; + } // get the PO for the tablename and record ID MTable table = MTable.get(ctx, tableName); @@ -919,7 +1210,7 @@ public class ModelADServiceImpl implements ModelADService { + m_webservicetype.getValue() + ": table " + tableName + " not found", new QName("readData")); - PO po = table.getPO(recordID, null); + PO po = table.getPO(recordID, trxName); if (po == null) { resp.setSuccess(false); resp.setRowCount(cnt); @@ -956,13 +1247,14 @@ public class ModelADServiceImpl implements ModelADService { } public WindowTabDataDocument queryData(ModelCRUDRequestDocument req) { + CompiereService m_cs = getCompiereService(); WindowTabDataDocument ret = WindowTabDataDocument.Factory.newInstance(); WindowTabData resp = ret.addNewWindowTabData(); ModelCRUD modelCRUD = req.getModelCRUDRequest().getModelCRUD(); String serviceType = modelCRUD.getServiceType(); ADLoginRequest reqlogin = req.getModelCRUDRequest().getADLoginRequest(); - String err = modelLogin(reqlogin, webServiceName, "queryData", serviceType); + String err = login(reqlogin, webServiceName, "queryData", serviceType); if (err != null && err.length() > 0) { resp.setError(err); return ret; @@ -973,7 +1265,8 @@ public class ModelADServiceImpl implements ModelADService { Properties ctx = m_cs.getM_ctx(); String tableName = modelCRUD.getTableName(); - + + MWebServiceType m_webservicetype = getWebServiceType(); // get the PO for the tablename and record ID MTable table = MTable.get(ctx, tableName); if (table == null) diff --git a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/Process.java b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/Process.java index a76b5a49c9..e02e0714fe 100644 --- a/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/Process.java +++ b/org.idempiere.webservices/WEB-INF/src/com/_3e/ADInterface/Process.java @@ -2,6 +2,8 @@ package com._3e.ADInterface; import java.io.ByteArrayOutputStream; import java.io.CharArrayWriter; +import java.io.File; +import java.io.IOException; import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -14,6 +16,7 @@ import java.util.logging.Level; import net.sf.compilo.report.ReportProcessor; import net.sf.jasperreports.engine.JasperPrint; +import org.compiere.model.GridField; import org.compiere.model.GridTab; import org.compiere.model.Lookup; import org.compiere.model.MAllocationHdr; @@ -46,19 +49,19 @@ import org.compiere.util.Trx; import org.compiere.wf.MWFProcess; import org.compiere.wf.MWorkflow; -import pl.x3E.adInterface.DataField; -import pl.x3E.adInterface.DataRow; -import pl.x3E.adInterface.GetProcessParamsDocument; -import pl.x3E.adInterface.LookupValue; -import pl.x3E.adInterface.LookupValues; -import pl.x3E.adInterface.ProcessParam; -import pl.x3E.adInterface.ProcessParamList; -import pl.x3E.adInterface.ProcessParams; -import pl.x3E.adInterface.ProcessParamsDocument; -import pl.x3E.adInterface.RunProcess; -import pl.x3E.adInterface.RunProcessDocument; -import pl.x3E.adInterface.RunProcessResponse; -import pl.x3E.adInterface.RunProcessResponseDocument; +import org.idempiere.adInterface.x10.DataField; +import org.idempiere.adInterface.x10.DataRow; +import org.idempiere.adInterface.x10.GetProcessParamsDocument; +import org.idempiere.adInterface.x10.LookupValue; +import org.idempiere.adInterface.x10.LookupValues; +import org.idempiere.adInterface.x10.ProcessParam; +import org.idempiere.adInterface.x10.ProcessParamList; +import org.idempiere.adInterface.x10.ProcessParams; +import org.idempiere.adInterface.x10.ProcessParamsDocument; +import org.idempiere.adInterface.x10.RunProcess; +import org.idempiere.adInterface.x10.RunProcessDocument; +import org.idempiere.adInterface.x10.RunProcessResponse; +import org.idempiere.adInterface.x10.RunProcessResponseDocument; /* * ADEMPIERE/COMPIERE @@ -341,7 +344,7 @@ public class Process { try { boolean ok = false; - //File file; + File file; String file_type = "pdf"; if (!jasperreport) { @@ -667,7 +670,7 @@ public class Process { private static JasperPrint getJasperReportPrint(Properties ctx, ProcessInfo pi) { - // boolean local = true; // lokalnie czy zdalnie + boolean local = true; // lokalnie czy zdalnie try { @@ -815,7 +818,6 @@ public class Process { */ static public ReportEngine startFinReport (ProcessInfo pi) { - @SuppressWarnings("unused") int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); // Create Query from Parameters @@ -889,7 +891,6 @@ public class Process { } Object Processing = tab.getValue("Processing"); String DocStatus = (String)tab.getValue("DocStatus"); - @SuppressWarnings("unused") String DocAction = (String)tab.getValue("DocAction"); String OrderType = Env.getContext(Env.getCtx(), tab.getWindowNo(), "OrderType"); String IsSOTrx = Env.getContext(Env.getCtx(), tab.getWindowNo(), "IsSOTrx"); @@ -1053,9 +1054,9 @@ public class Process { }*/ - /*public void doPost() throws IOException { + public void doPost() throws IOException { String column_name = "";//WebUtil.getParameter(request, "ColumnName"); - //String action = "";//WebUtil.getParameter(request, "action"); + String action = "";//WebUtil.getParameter(request, "action"); WWindowStatus ws = null; //WWindowStatus.get(request); @@ -1071,9 +1072,9 @@ public class Process { //return; } - //GridField f = ws.curTab.getField( column_name ); - //int process_id = f.getAD_Process_ID(); - //int record_id = ws.curTab.getRecord_ID(); + GridField f = ws.curTab.getField( column_name ); + int process_id = f.getAD_Process_ID(); + int record_id = ws.curTab.getRecord_ID(); String qs = "AD_Process_ID="+Integer.toString(process_id) +"&"+ "AD_Record_ID="+Integer.toString(record_id); @@ -1082,7 +1083,7 @@ public class Process { //disp.forward(request, response); return; - } // doPost*/ + } // doPost diff --git a/org.idempiere.webservices/WEB-INF/src/com/adaxa/ws/WebstoreService.java b/org.idempiere.webservices/WEB-INF/src/com/adaxa/ws/WebstoreService.java deleted file mode 100644 index e9c0ecb39b..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/com/adaxa/ws/WebstoreService.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * - */ -package com.adaxa.ws; - -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.jws.soap.SOAPBinding.ParameterStyle; -import javax.jws.soap.SOAPBinding.Style; -import javax.jws.soap.SOAPBinding.Use; - - -/** - * @author ashley - * - */ -@WebService(targetNamespace="http://3e.pl/ADInterface") -@SOAPBinding(style=Style.RPC,use=Use.LITERAL,parameterStyle=ParameterStyle.WRAPPED) -public interface WebstoreService -{ - public ProcessResponseDocument runProcess(ProcessRequestDocument requestDoc); -} diff --git a/org.idempiere.webservices/WEB-INF/src/com/adaxa/ws/WebstoreServiceImpl.java b/org.idempiere.webservices/WEB-INF/src/com/adaxa/ws/WebstoreServiceImpl.java deleted file mode 100644 index 07cd49dc47..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/com/adaxa/ws/WebstoreServiceImpl.java +++ /dev/null @@ -1,579 +0,0 @@ -/** - * - */ -package com.adaxa.ws; - -import java.math.BigDecimal; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.Timestamp; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.logging.Level; - -import javax.jws.WebService; - -import org.adempiere.exceptions.AdempiereException; -import org.compiere.model.Lookup; -import org.compiere.model.MPInstance; -import org.compiere.model.MPInstancePara; -import org.compiere.model.MProcess; -import org.compiere.model.MProcessPara; -import org.compiere.model.MWebService; -import org.compiere.model.MWebServiceType; -import org.compiere.model.X_WS_WebServiceMethod; -import org.compiere.model.X_WS_WebService_Para; -import org.compiere.process.ProcessInfo; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.DisplayType; -import org.compiere.util.Env; -import org.compiere.util.KeyNamePair; -import org.compiere.util.Login; -import org.compiere.util.NamePair; -import org.compiere.util.Trx; -import org.compiere.util.ValueNamePair; - -import com._3e.ADInterface.CompiereService; - -/** - * @author ashley - */ -@WebService(endpointInterface="com.adaxa.ws.WebstoreService", serviceName="WebstoreService", targetNamespace="http://3e.pl/ADInterface") -public class WebstoreServiceImpl implements WebstoreService -{ - - protected static final CLogger logger = CLogger - .getCLogger(WebstoreService.class); - public static final String WEB_SERVICE_NAME = "WebstoreService"; - private CompiereService compiereService; - private MWebService webService; - private X_WS_WebServiceMethod webServiceMethod; - private MWebServiceType webServiceType; - - public WebstoreServiceImpl() - { - compiereService = new CompiereService(); - compiereService.connect(); - } - - protected void login(LoginRequest loginRequest) throws Exception - { - Login login = new Login(compiereService.getM_ctx()); - - // Validate user credentials - KeyNamePair[] roles = login.getRoles(loginRequest.getUser(), - loginRequest.getPass()); - - if (roles == null) - { - throw new Exception("Login Error: Invalid user credentials"); - } - - // Validate role - KeyNamePair loginRole = null; - for (KeyNamePair role : roles) - { - if (role.getKey() == loginRequest.getRoleID()) - { - loginRole = role; - break; - } - } - - if (loginRole == null) - { - throw new Exception( - "Login Error: Role is not allowed for this user"); - } - - // Validate client - KeyNamePair[] clients = login.getClients(loginRole); - - if (clients == null) - { - throw new Exception( - "Login Error: Client is not allowed for this user with the defined role"); - } - - KeyNamePair loginClient = null; - for (KeyNamePair client : clients) - { - if (client.getKey() == loginRequest.getClientID()) - { - loginClient = client; - break; - } - } - - if (loginClient == null) - { - throw new Exception( - "Login Error: Client is not allowed for this user with the defined role"); - } - - compiereService.getM_ctx().setProperty("#AD_Client_ID", "" + loginRequest.getClientID()); - - // Validate org - KeyNamePair[] orgs = login.getOrgs(loginRole); - if (orgs == null) - { - throw new Exception( - "Login Error: Organization is not allowed for this user"); - } - - KeyNamePair loginOrg = null; - for (KeyNamePair org : orgs) - { - if (org.getKey() == loginRequest.getOrgID()) - { - loginOrg = org; - break; - } - } - - if (loginOrg == null) - { - throw new Exception( - "Login Error: Organization is not allowed for this user"); - } - - // Validate Warehouse - KeyNamePair[] warehouses = login.getWarehouses(loginOrg); - - if (warehouses == null) - { - throw new Exception( - "Login Error: Warehouse is not allowed for this user"); - } - - KeyNamePair loginWarehouse = null; - for (KeyNamePair warehouse : warehouses) - { - if (warehouse.getKey() == loginRequest.getWarehouseID()) - { - loginWarehouse = warehouse; - break; - } - } - - if (loginWarehouse == null) - { - throw new Exception( - "Login Error: Warehouse is not allowed for this user"); - } - - String error = login.validateLogin(loginOrg); - - if (error != null && error.length() > 0) - { - throw new Exception("Login Error: " + error); - } - - int AD_User_ID = Env.getAD_User_ID(compiereService.getM_ctx()); - - if (!compiereService.login(AD_User_ID, loginRequest.getRoleID(), - loginRequest.getClientID(), loginRequest.getOrgID(), - loginRequest.getWarehouseID(), loginRequest.getLang())) - { - throw new Exception( - "Login Error: Could not initialize login details"); - } - } - - private void initWebServiceType(String webserviceValue, String methodValue, - String serviceTypeValue) throws Exception - { - webService = MWebService.get(compiereService.getM_ctx(), - webserviceValue); - if (webService == null || !webService.isActive()) - { - throw new Exception("Web Service Configuration Error: Web Service " - + webserviceValue + " not registered"); - } - - webServiceMethod = webService.getMethod(methodValue); - if (webServiceMethod == null || !webServiceMethod.isActive()) - { - throw new Exception("Web Service Configuration Error: Method " - + methodValue + " not registered"); - } - - String sql = "SELECT * FROM WS_WebServiceType " - + "WHERE AD_Client_ID=? " + "AND WS_WebService_ID=? " - + "AND WS_WebServiceMethod_ID=? " + "AND Value=? " - + "AND IsActive='Y'"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, compiereService.getM_AD_Client_ID()); - pstmt.setInt(2, webService.getWS_WebService_ID()); - pstmt.setInt(3, webServiceMethod.getWS_WebServiceMethod_ID()); - pstmt.setString(4, serviceTypeValue); - rs = pstmt.executeQuery(); - if (rs.next()) - { - webServiceType = new MWebServiceType( - compiereService.getM_ctx(), rs, null); - } - } - catch (Exception ex) - { - logger.log(Level.SEVERE, "Could not get web service type", ex); - throw new Exception( - "Web Service Error: Could not get web service with type '" - + serviceTypeValue + "'"); - } - finally - { - DB.close(rs, pstmt); - } - - if (webServiceType == null) - { - throw new Exception("Web Service Error: Web service type '" - + serviceTypeValue + "' is not configured"); - } - - String accessSql = "SELECT IsReadWrite FROM WS_WebServiceTypeAccess WHERE AD_Role_ID=? " - + "AND WS_WebServiceType_ID=? AND IsActive='Y'"; - - String hasAccess = DB.getSQLValueString(null, accessSql, - Env.getAD_Role_ID(compiereService.getM_ctx()), - webServiceType.get_ID()); - - if (!"Y".equals(hasAccess)) - { - throw new Exception( - "Web Service Error: Login role does not have access to the service type"); - } - } - - @SuppressWarnings("unchecked") - private T formatValue(String value, Class type) throws Exception - { - try - { - if (value == null) - { - return null; - } - else if (String.class == type) - { - return (T) value; - } - else if (value.trim().length() == 0) - { - return null; - } - else if (Integer.class == type) - { - return (T) Integer.valueOf(value); - } - else if (BigDecimal.class == type) - { - return (T) new BigDecimal(value); - } - else if (Boolean.class == type) - { - if ("Y".equalsIgnoreCase(value)) - { - return (T) Boolean.TRUE; - } - else if ("N".equalsIgnoreCase(value)) - { - return (T) Boolean.FALSE; - } - - return (T) Boolean.valueOf(value); - } - else if (Timestamp.class == type) - { - Date date = compiereService.dateFormat.parse(value); - return (T) new Timestamp(date.getTime()); - } - else - { - - throw new Exception("Casting to type '" - + type.getClass().getName() + "' is not defined"); - } - } - catch (Exception ex) - { - throw new Exception("Cannot cast parameter to type: " - + type.getClass().getName() + ", cause: " + ex.getMessage()); - } - } - - public String formatValue(Object value) - { - if (value == null) - { - return ""; - } - else if (value instanceof Timestamp) - { - Date date = new Date(((Timestamp) value).getTime()); - return compiereService.dateFormat.format(date); - } - - return String.valueOf(value); - } - - private T getConstantParameterValue(MWebServiceType serviceType, - String parameterName, Class type) throws Exception - { - X_WS_WebService_Para processIdParameter = webServiceType - .getParameter(parameterName); - - if (processIdParameter == null - || !X_WS_WebService_Para.PARAMETERTYPE_Constant - .equals(processIdParameter.getParameterType())) - { - logger.severe("Invalid configuration for '" + parameterName - + "' parameter in the web service type: " - + serviceType.getName()); - throw new Exception("Web Service Error: Invalid configuraiton"); - } - - String parameterValue = processIdParameter.getConstantValue(); - - try - { - return formatValue(parameterValue, type); - } - catch (Exception ex) - { - logger.severe("Error in formatting value, cause: " - + ex.getMessage()); - throw new Exception( - "Web Service Error: Invalid configuration for parameter '" - + parameterName + "' and service type '" - + serviceType.getName() + "'"); - } - } - - private MPInstance fillParameters(MProcess process, - Parameter parameters[], int recordId) throws Exception - { - MPInstance processInstance = new MPInstance(process, recordId); - MPInstancePara[] instanceParameters = processInstance.getParameters(); - HashMap parametersMap = new HashMap(); - for (Parameter parameter : parameters) - { - parametersMap.put(parameter.getName(), parameter.getValue()); - } - - for (int i = 0; i < instanceParameters.length; i++) - { - MPInstancePara instanceParameter = instanceParameters[i]; - String parameterName = instanceParameter.getParameterName(); - MProcessPara processParameter = process.getParameter(parameterName); - - if (processParameter == null) - { - logger.severe("Parameter '" + parameterName - + "' not found for process with value '" - + process.getValue() + "'"); - continue; - } - - int displayType = processParameter.getAD_Reference_ID(); - - String value = parametersMap.get(parameterName); - String valueTo = null; - - if (value != null) - { - value = value.trim(); - } - - if (processParameter.isRange()) - { - valueTo = parametersMap.get(parameterName + "_2"); - - if (valueTo != null) - { - valueTo = valueTo.trim(); - } - } - - if (value != null && value.length() == 0) - value = null; - - if (value != null - && (DisplayType.List == displayType - || DisplayType.TableDir == displayType || DisplayType.Table == displayType) - && value.equals("-1")) - { - value = null; - } - - if (value == null && processParameter.isMandatory()) - { - throw new Exception("Parameter '" + parameterName - + "' is mandatory"); - } - - if (DisplayType.isNumeric(displayType) - || DisplayType.isID(displayType)) - { - instanceParameter.setP_Number(formatValue(value, - BigDecimal.class)); - if (processParameter.isRange()) - { - instanceParameter.setP_Number_To(formatValue(valueTo, - BigDecimal.class)); - } - } - else if (DisplayType.isDate(displayType)) - { - instanceParameter - .setP_Date(formatValue(value, Timestamp.class)); - if (processParameter.isRange()) - { - instanceParameter.setP_Date_To(formatValue(valueTo, - Timestamp.class)); - } - } - else if (DisplayType.YesNo == processParameter.getAD_Reference_ID()) - { - boolean booleanValue = formatValue(value, Boolean.class); - instanceParameter.setP_String((booleanValue ? "Y" : "N")); - } - if (processParameter.isLookup()) - { - Lookup lookup = processParameter.getLookup(); - if (lookup != null) - { - NamePair namePair = lookup.getDirect(value, false, false); - if (namePair != null) - { - instanceParameter.setInfo(namePair.getName()); - } - } - } - else - { - instanceParameter.setP_String(value); - instanceParameter.setP_String_To(valueTo); - } - - instanceParameter.saveEx(); - } - - processInstance.saveEx(); - - return processInstance; - } - - private void fillOutputValues(MProcess process, ProcessInfo processInfo, - ProcessResponse processResponse) - { - if (processInfo.getSerializableObject() != null - && processInfo.getSerializableObject() instanceof List) - { - List outputValues = (List) processInfo - .getSerializableObject(); - for (Object obj : outputValues) - { - if (obj instanceof ValueNamePair) - { - ValueNamePair outputValueNamePair = (ValueNamePair)obj; - OutputData outputData = processResponse.addNewOuptutData(); - outputData.setName(outputValueNamePair.getName()); - outputData.setValue(formatValue(outputValueNamePair.getValueObject())); - } - } - } - } - - public ProcessResponseDocument runProcess(ProcessRequestDocument requestDoc) - { - ProcessResponseDocument responseDoc = ProcessResponseDocument.Factory.newInstance(); - ProcessResponse response = responseDoc.addNewProcessResponse(); - - LoginRequest loginRequest = requestDoc.getProcessRequest() - .getLoginRequest(); - - String serviceType = requestDoc.getProcessRequest().getServiceType(); - - try - { - login(loginRequest); - initWebServiceType(WEB_SERVICE_NAME, "runProcess", serviceType); - String processValue = getConstantParameterValue(webServiceType, - "PROCESS", String.class); - - int processId = MProcess.getProcess_ID(processValue, null); - - if (processId <= 0) - { - logger.severe("Process with value '" + processValue + "' not found"); - throw new Exception("Configuration error - Process not found"); - } - - MProcess process = MProcess.get(compiereService.getM_ctx(), - processId); - - String accessSql = "SELECT IsReadWrite FROM AD_Process_Access " - + "WHERE AD_Role_ID=? AND AD_Process_ID=? AND IsActive='Y'"; - String hasAccess = DB.getSQLValueString(null, accessSql, - Env.getAD_Role_ID(compiereService.getM_ctx()), processId); - - if (!"Y".equals(hasAccess)) - { - throw new Exception("Configuration Error: Login role doesn not have access to the process"); - } - - Parameter[] parameters = requestDoc.getProcessRequest().getProcessData().getParameterArray(); - MPInstance processInstance = fillParameters(process, parameters, 0); - - ProcessInfo processInfo = new ProcessInfo (process.getName(), process.getAD_Process_ID()); - processInfo.setAD_User_ID(Env.getAD_User_ID(compiereService.getM_ctx())); - processInfo.setAD_Client_ID(Env.getAD_Client_ID(compiereService.getM_ctx())); - processInfo.setAD_PInstance_ID(processInstance.getAD_PInstance_ID()); - - boolean success = false; - - Trx trx = Trx.get(Trx.createTrxName("WSProcess"), true); - try - { - success = process.processIt(processInfo, trx); - fillOutputValues(process, processInfo, response); - trx.commit(); - } - finally - { - trx.rollback(); - trx.close(); - } - - if (success && !processInfo.isError()) - { - response.setIsError(false); - } - else - { - response.setIsError(true); - response.setError(processInfo.getSummary()); - } - } - catch (AdempiereException ex) - { - response.setIsError(true); - response.setError(ex.getMessage()); - } - catch (Exception ex) - { - response.setIsError(true); - response.setError(ex.getMessage()); - } - - return responseDoc; - } -} diff --git a/org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeService.java b/org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeService.java new file mode 100644 index 0000000000..29ade1552c --- /dev/null +++ b/org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeService.java @@ -0,0 +1,17 @@ +package com.bizidium.ws; + +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; +import javax.jws.soap.SOAPBinding.ParameterStyle; +import javax.jws.soap.SOAPBinding.Style; +import javax.jws.soap.SOAPBinding.Use; + +import org.idempiere.adInterface.x10.CompositeModelRequestDocument; +import org.idempiere.adInterface.x10.CompositeResponsesDocument; + +@WebService(targetNamespace="http://idempiere.org/ADInterface/1_0") +@SOAPBinding(style=Style.RPC,use=Use.LITERAL,parameterStyle=ParameterStyle.WRAPPED) +public interface CompositeService { + + public CompositeResponsesDocument compositeCRUD(CompositeModelRequestDocument reqs); +} diff --git a/org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeServiceImpl.java b/org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeServiceImpl.java new file mode 100644 index 0000000000..55ee817f48 --- /dev/null +++ b/org.idempiere.webservices/WEB-INF/src/com/bizidium/ws/CompositeServiceImpl.java @@ -0,0 +1,350 @@ +/****************************************************************************** + * Copyright (C) 2012 Trek Global * + * Product: iDempiere ERP & CRM Smart Business Solution * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ +package com.bizidium.ws; + +import java.util.ArrayList; +import java.util.Properties; + +import javax.jws.WebService; + +import org.compiere.util.CLogger; +import org.compiere.util.Trx; +import org.idempiere.adInterface.x10.ADLoginRequest; +import org.idempiere.adInterface.x10.CompositeModelRequest; +import org.idempiere.adInterface.x10.CompositeModelRequestDocument; +import org.idempiere.adInterface.x10.CompositeResponse; +import org.idempiere.adInterface.x10.CompositeResponses; +import org.idempiere.adInterface.x10.CompositeResponsesDocument; +import org.idempiere.adInterface.x10.DataField; +import org.idempiere.adInterface.x10.ModelCRUD; +import org.idempiere.adInterface.x10.ModelCRUDRequest; +import org.idempiere.adInterface.x10.ModelCRUDRequestDocument; +import org.idempiere.adInterface.x10.ModelRunProcessRequest; +import org.idempiere.adInterface.x10.ModelRunProcessRequestDocument; +import org.idempiere.adInterface.x10.ModelSetDocActionRequest; +import org.idempiere.adInterface.x10.ModelSetDocActionRequestDocument; +import org.idempiere.adInterface.x10.Operation; +import org.idempiere.adInterface.x10.Operation.TargetPort; +import org.idempiere.adInterface.x10.Operations; +import org.idempiere.adInterface.x10.RunProcessResponseDocument; +import org.idempiere.adInterface.x10.StandardResponse; +import org.idempiere.adInterface.x10.StandardResponseDocument; +import org.idempiere.adInterface.x10.WindowTabDataDocument; +import org.idempiere.webservices.AbstractService; + +import com._3e.ADInterface.CompiereService; +import com._3e.ADInterface.ModelADServiceImpl; + +/** + * Composite service interface for combining request and transaction management + * + * @author Deepak Pansheriya + * + */ +@WebService(endpointInterface = "com.bizidium.ws.CompositeService", serviceName = "compositeInterface") +public class CompositeServiceImpl extends AbstractService implements CompositeService { + private static CLogger log = CLogger.getCLogger(CompositeServiceImpl.class); + + private static String webServiceName = new String("biziInterface"); + + public CompositeServiceImpl() { + + log.info("Creating session object BiziInterface"); + } + + + public CompositeResponsesDocument compositeCRUD(CompositeModelRequestDocument reqs) { + + CompiereService m_cs = getCompiereService(); + + CompositeResponsesDocument ret = CompositeResponsesDocument.Factory.newInstance(); + CompositeResponses resps = ret.addNewCompositeResponses(); + + CompositeModelRequest req = reqs.getCompositeModelRequest(); + String serviceType = req.getServiceType(); + + ADLoginRequest reqlogin = req.getADLoginRequest(); + String err = login(reqlogin, webServiceName, "composite", serviceType); + if (err != null && err.length() > 0) { + CompositeResponse resp = resps.addNewCompositeResponse(); + StandardResponse stdResp = resp.addNewStandardResponse(); + stdResp.setError(err); + stdResp.setIsError(true); + return ret; + } + + ModelADServiceImpl modelADService = new ModelADServiceImpl(ctx); + + String trxName = m_cs.getM_trx_name(); + trxName = Trx.createTrxName("ws_biziInterface"); + + Trx trx = Trx.get(trxName, true); + + modelADService.setLocalTrxName(trxName); + + Operations operationsArr[] = req.getOperationsArray(); + + for (Operations operations : operationsArr) { + Operation operationArr[] = operations.getOperationArray(); + if (operationArr.length > 0) { + CompositeResponse compResp = resps.addNewCompositeResponse(); + ArrayList respAggregator = new ArrayList(); + boolean isSuccess = performOperations(trx, operationArr, modelADService, compResp, respAggregator, reqlogin); + + // Committing after each operation set + if (isSuccess) { + commitTrx(trx, compResp, respAggregator, "Cannot commit at end of process", false); + } + + } + } + + trx.close(); + + return ret; + } + + /** + * Perform operation + * @param trx + * @param ops + * @param modelADService + * @param compResp + * @param respAggregator + * @param reqlogin + * @return isError + */ + private boolean performOperations(Trx trx, Operation ops[], ModelADServiceImpl modelADService, CompositeResponse compResp, + ArrayList respAggregator, ADLoginRequest reqlogin) { + for (Operation operation : ops) { + + if (operation.getPreCommit()) { + if (!commitTrx(trx, compResp, respAggregator, "Cannot commit before Operation", true)) { + return false; + } + } + + modelADService.setManageTrx(false); + + TargetPort.Enum portEnum = operation.getTargetPort(); + + StandardResponseDocument respDoc = null; + if (portEnum == TargetPort.CREATE_DATA) { + ModelCRUDRequestDocument wrapperDoc = getWrappedCRUD(operation, reqlogin); + if (wrapperDoc == null) { + rollbackAndSetError(trx, compResp, respAggregator, "Operation createData must required ModelCRUD"); + return false; + } else { + respDoc = modelADService.createData(wrapperDoc); + } + } else if (portEnum == TargetPort.DELETE_DATA) { + ModelCRUDRequestDocument wrapperDoc = getWrappedCRUD(operation, reqlogin); + if (wrapperDoc == null) { + rollbackAndSetError(trx, compResp, respAggregator, "Operation deleteData must required ModelCRUD"); + return false; + } else { + respDoc = modelADService.deleteData(wrapperDoc); + } + } else if (portEnum == TargetPort.CREATE_UPDATE_DATA) { + ModelCRUDRequestDocument wrapperDoc = getWrappedCRUD(operation, reqlogin); + if (wrapperDoc == null) { + rollbackAndSetError(trx, compResp, respAggregator, "Operation createUpdateData must required ModelCRUD"); + return false; + } else { + respDoc = modelADService.createUpdateData(wrapperDoc); + } + } else if (portEnum == TargetPort.READ_DATA) { + ModelCRUDRequestDocument wrapperDoc = getWrappedCRUD(operation, reqlogin); + if (wrapperDoc == null) { + // Do not rollback, Continue with consecutive operations + respDoc = StandardResponseDocument.Factory.newInstance(); + StandardResponse resp = respDoc.addNewStandardResponse(); + resp.setIsError(false); + resp.setError("Operation readData must required ModelCRUD"); + } else { + WindowTabDataDocument dataResponse = modelADService.readData(wrapperDoc); + if (dataResponse != null) { + respDoc = StandardResponseDocument.Factory.newInstance(); + StandardResponse resp = respDoc.addNewStandardResponse(); + // Do not fail though read is failed + resp.setIsError(false); + resp.setWindowTabData(dataResponse.getWindowTabData()); + } + } + } else if (portEnum == TargetPort.RUN_PROCESS) { + if (operation.getModelRunProcess() == null) { + rollbackAndSetError(trx, compResp, respAggregator, "Operation runProcess must required ModelRunProcess"); + return false; + } + + ModelRunProcessRequestDocument wrapperDoc = ModelRunProcessRequestDocument.Factory.newInstance(); + ModelRunProcessRequest runProcessReq = wrapperDoc.addNewModelRunProcessRequest(); + runProcessReq.setADLoginRequest(reqlogin); + runProcessReq.setModelRunProcess(operation.getModelRunProcess()); + + RunProcessResponseDocument runResponse = modelADService.runProcess(wrapperDoc); + if (runResponse != null) { + respDoc = StandardResponseDocument.Factory.newInstance(); + StandardResponse resp = respDoc.addNewStandardResponse(); + resp.setIsError(runResponse.getRunProcessResponse().getIsError()); + resp.setRunProcessResponse(runResponse.getRunProcessResponse()); + } + } else if (portEnum == TargetPort.SET_DOC_ACTION) { + if (operation.getModelSetDocAction() == null) { + rollbackAndSetError(trx, compResp, respAggregator, "Operation updateData must required ModelSetDocAction"); + return false; + } + + ModelSetDocActionRequestDocument wrapperDoc = ModelSetDocActionRequestDocument.Factory.newInstance(); + ModelSetDocActionRequest actionReq = wrapperDoc.addNewModelSetDocActionRequest(); + actionReq.setADLoginRequest(reqlogin); + actionReq.setModelSetDocAction(operation.getModelSetDocAction()); + + respDoc = modelADService.setDocAction(wrapperDoc); + + } else if (portEnum == TargetPort.UPDATE_DATA) { + ModelCRUDRequestDocument wrapperDoc = getWrappedCRUD(operation, reqlogin); + if (wrapperDoc == null) { + rollbackAndSetError(trx, compResp, respAggregator, "Operation updateData must required ModelCRUD"); + return false; + } else { + respDoc = modelADService.updateData(wrapperDoc); + } + } + + if (respDoc != null) + respAggregator.add(respDoc.getStandardResponse()); + + if (respDoc != null && respDoc.getStandardResponse().getIsError()) { + rollbackAndSetError(trx, compResp, respAggregator, null); + return false; + } + + if (operation.getPostCommit()) { + + if (!commitTrx(trx, compResp, respAggregator, "Cannot commit after operation", false)) { + return false; + } + } + + } + return true; + } + + /** + * create ModelCRUDRequestDocument for operation element + * @param operation + * @param reqlogin + * @return + */ + private ModelCRUDRequestDocument getWrappedCRUD(Operation operation, ADLoginRequest reqlogin) { + if (operation.getModelCRUD() == null) + return null; + + ModelCRUDRequestDocument wrapperDoc = ModelCRUDRequestDocument.Factory.newInstance(); + ModelCRUDRequest wrapperCRUD = wrapperDoc.addNewModelCRUDRequest(); + wrapperCRUD.setModelCRUD(operation.getModelCRUD()); + wrapperCRUD.setADLoginRequest(reqlogin); + + return wrapperDoc; + } + + public void resolveContextCRUD(Properties ctx, ModelCRUD crud) { + DataField fields[] = crud.getDataRow().getFieldArray(); + for (DataField field : fields) { + String val = field.getVal(); + if (val != null && val.startsWith("#")) { + // Replace value from context variables + String key = val.substring(1); + val = (String) ctx.get(key); + field.setVal(val); + } + } + } + + /** + * Rollback and set error on response + * @param trx + * @param compResp + * @param respAggregator + * @param string + */ + protected void rollbackAndSetError(Trx trx, CompositeResponse compResp, ArrayList respAggregator, String string) { + if (respAggregator == null) { + StandardResponse resp = compResp.addNewStandardResponse(); + resp.setError(string); + resp.setIsError(true); + } else { + int ind = 0; + StandardResponse orgArr[] = compResp.getStandardResponseArray(); + StandardResponse respArr[] = new StandardResponse[orgArr.length + respAggregator.size()]; + + for (StandardResponse resp : orgArr) { + respArr[ind++] = resp; + } + // Set all response as Failed + for (StandardResponse resp : respAggregator) { + resp.setIsRolledBack(true); + respArr[ind++] = resp; + } + if (string != null && respAggregator.size() > 0) { + StandardResponse resp = respAggregator.get(respAggregator.size() - 1); + resp.setError(string); + resp.setIsError(true); + } + compResp.setStandardResponseArray(respArr); + respAggregator.clear(); + } + trx.rollback(); + trx.close(); + } + + /** + * Commit transaction and prepare response document + * @param trx + * @param compResp + * @param respAggregator + * @param string + * @param addNewResp + * @return + */ + protected boolean commitTrx(Trx trx, CompositeResponse compResp, ArrayList respAggregator, String string, + boolean addNewResp) { + + if (trx.isActive() && !trx.commit()) { + if (addNewResp) + respAggregator.add(StandardResponse.Factory.newInstance()); + + rollbackAndSetError(trx, compResp, respAggregator, string); + return false; + } + + int ind = 0; + StandardResponse orgArr[] = compResp.getStandardResponseArray(); + StandardResponse respArr[] = new StandardResponse[orgArr.length + respAggregator.size()]; + + for (StandardResponse resp : orgArr) { + respArr[ind++] = resp; + } + // Set all committed response + for (StandardResponse resp : respAggregator) { + respArr[ind++] = resp; + } + + compResp.setStandardResponseArray(respArr); + respAggregator.clear(); + + return true; + } +} diff --git a/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/ExternalSales.java b/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/ExternalSales.java deleted file mode 100644 index dd2b9625ce..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/ExternalSales.java +++ /dev/null @@ -1,56 +0,0 @@ -/********************************************************************** -* This file is part of Adempiere ERP Bazaar * -* http://www.adempiere.org * -* * -* Copyright (C) Carlos Ruiz - globalqss * -* Copyright (C) Contributors * -* * -* This program is free software; you can redistribute it and/or * -* modify it under the terms of the GNU General Public License * -* as published by the Free Software Foundation; either version 2 * -* of the License, or (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the Free Software * -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * -* MA 02110-1301, USA. * -* * -* Contributors: * -* - Carlos Ruiz (globalqss@users.sourceforge.net) * -* * -* Sponsors: * -* - GlobalQSS (http://www.globalqss.com) * -***********************************************************************/ - -package com.globalqss.ObPOSInterface; - -import javax.jws.WebService; - -import org.openbravo.erpCommon.ws.externalSales.ArrayOfTns1Order; -import org.openbravo.erpCommon.ws.externalSales.ProductsCatalogResponseDocument; -import org.openbravo.erpCommon.ws.externalSales.ProductsPlusCatalogResponseDocument; -import org.openbravo.erpCommon.ws.externalSales.UploadOrdersResponseDocument; - -@WebService -public interface ExternalSales { - - public ProductsPlusCatalogResponseDocument getProductsPlusCatalog(int entityId, int organizationId, int salesChannel, String username, String password); - - public UploadOrdersResponseDocument uploadOrders(int entityId, int organizationId, int salesChannel, ArrayOfTns1Order newOrders, String username, String password); - - public ProductsCatalogResponseDocument getProductsCatalog(int entityId, int organizationId, int salesChannel, String username, String password); - - /* methods to implement */ - - /* - - public GetOrdersResponseDocument getOrders(GetOrdersRequestDocument req) throws XFireFault; - - */ - -} diff --git a/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/ExternalSalesImpl.java b/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/ExternalSalesImpl.java deleted file mode 100644 index 69b38a45f8..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/ExternalSalesImpl.java +++ /dev/null @@ -1,174 +0,0 @@ -/********************************************************************** -* This file is part of Adempiere ERP Bazaar * -* http://www.adempiere.org * -* * -* Copyright (C) Carlos Ruiz - globalqss * -* Copyright (C) Contributors * -* * -* This program is free software; you can redistribute it and/or * -* modify it under the terms of the GNU General Public License * -* as published by the Free Software Foundation; either version 2 * -* of the License, or (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the Free Software * -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * -* MA 02110-1301, USA. * -* * -* Contributors: * -* - Carlos Ruiz (globalqss@users.sourceforge.net) * -* * -* Sponsors: * -* - GlobalQSS (http://www.globalqss.com) * -***********************************************************************/ - -package com.globalqss.ObPOSInterface; - -import java.io.UnsupportedEncodingException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; - -import javax.xml.namespace.QName; - -import org.apache.commons.codec.binary.Base64; -import org.compiere.util.CLogger; -import org.compiere.util.DB; -import org.compiere.util.SecureEngine; -import org.idempiere.webservices.fault.IdempiereServiceFault; -import org.openbravo.erpCommon.ws.externalSales.ArrayOfTns1Order; -import org.openbravo.erpCommon.ws.externalSales.ProductsCatalogResponse; -import org.openbravo.erpCommon.ws.externalSales.ProductsCatalogResponseDocument; -import org.openbravo.erpCommon.ws.externalSales.ProductsPlusCatalogResponse; -import org.openbravo.erpCommon.ws.externalSales.ProductsPlusCatalogResponseDocument; -import org.openbravo.erpCommon.ws.externalSales.UploadOrdersResponse; -import org.openbravo.erpCommon.ws.externalSales.UploadOrdersResponseDocument; - -/* - * ADEMPIERE/COMPIERE - * - * Web Service interface for openbravo pos - * - * Contributors: Carlos Ruiz - globalqss - */ - - -/** - * - * @author Carlos Ruiz - globalqss - * - */ -public class ExternalSalesImpl implements ExternalSales { - - private static CLogger log = CLogger.getCLogger(ExternalSalesImpl.class); - - private static String webServiceName = new String("ExternalSales"); - - public ExternalSalesImpl() - { - log.info("Creating session object ExternalSales"); - } - - public String getVersion() { - return "0.1.0"; - } - - public UploadOrdersResponseDocument uploadOrders(int entityId, - int organizationId, int salesChannel, ArrayOfTns1Order newOrders, - String username, String password) { - // TODO Auto-generated method stub - UploadOrdersResponseDocument resdoc = UploadOrdersResponseDocument.Factory.newInstance(); - @SuppressWarnings("unused") - UploadOrdersResponse res = resdoc.addNewUploadOrdersResponse(); - - authenticate(username, password, webServiceName, "uploadOrders"); - - return resdoc; - } - - public ProductsCatalogResponseDocument getProductsCatalog(int entityId, - int organizationId, int salesChannel, String username, - String password) { - // TODO Auto-generated method stub - - ProductsCatalogResponseDocument resdoc = ProductsCatalogResponseDocument.Factory.newInstance(); - @SuppressWarnings("unused") - ProductsCatalogResponse res = resdoc.addNewProductsCatalogResponse(); - - authenticate(username, password, webServiceName, "getProductsCatalog"); - - return resdoc; - } - - public ProductsPlusCatalogResponseDocument getProductsPlusCatalog( - int entityId, int organizationId, int salesChannel, - String username, String password) { - // TODO Auto-generated method stub - ProductsPlusCatalogResponseDocument resdoc = ProductsPlusCatalogResponseDocument.Factory.newInstance(); - @SuppressWarnings("unused") - ProductsPlusCatalogResponse res = resdoc.addNewProductsPlusCatalogResponse(); - - authenticate(username, password, webServiceName, "getProductsPlusCatalog"); - - /* - * Sample of needed work - * - ArrayOfTns1ProductPlus app = res.addNewArrayOfTns1ProductPlus(); - // Iterate in M_Product for the organization / warehouse? - - for (MProduct product : products) ... - - ProductPlus prds = app.addNewProducts(); - Category cat = prds.addNewCategory(); - cat.setDescription(product.getM_Category().getDescription()); - cat.setId(product.getM_Category_ID()); - cat.setName(product.getM_Category().getName()); - Tax tax = prds.addNewTax(); - tax.setName(product.getC_Tax().getName()); - tax.setId(product.getC_Tax_ID()); - tax.setPercentage(product.getC_Tax().getRate()); - prds.setDescription(product.getDescription()); - prds.setEan(product.getEAN()); - prds.setId(product.getM_Product_ID()); - prds.setListPrice(product.getPriceList()); // we would need a price list related to the POS - prds.setName(product.getName()); - prds.setNumber(product.getNumber()); // number? - prds.setPurchasePrice(product.getPurchasePrice()); // we would need a purchase price list related to the POS - prds.setQtyonhand(product.getQtyOnHand()); // we would need a warehouse or locator related to the POS - */ - - return resdoc; - } - - public static void authenticate(String username, String password, String webServiceName, String method) { - String dbpwd = DB.getSQLValueString(null, "SELECT Password FROM AD_User WHERE Name=? AND Password IS NOT NULL", username); // and ad_client_id in (0,?) - if (dbpwd == null || dbpwd.length() <= 0) - throw new IdempiereServiceFault("Invalid user/password", new QName("username")); - - String isencr = DB.getSQLValueString(null, "SELECT IsEncrypted FROM AD_Column WHERE AD_Column_ID=417"); - if ("Y".equals(isencr)) - dbpwd = SecureEngine.decrypt(dbpwd); - - String hashPassword = null; - try { - hashPassword = new String(Base64.encodeBase64(MessageDigest.getInstance("SHA-1").digest(dbpwd.getBytes("UTF-8"))), "ASCII"); - } catch (UnsupportedEncodingException e1) { - throw new IdempiereServiceFault("Error hashing db password", e1, new QName("username")); - } catch (NoSuchAlgorithmException e1) { - throw new IdempiereServiceFault("Error hashing db password", e1, new QName("username")); - } - - if (! hashPassword.equals(password)) - /* Invalid password */ - throw new IdempiereServiceFault("Invalid user/password", new QName("password")); - - throw new IdempiereServiceFault("Security not implemented yet", new QName("webServiceName")); - // TODO: authenticate web service and method - // TODO: Search for a service type for client and role access with the same value as the method - } - -} \ No newline at end of file diff --git a/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/WebService.java b/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/WebService.java deleted file mode 100644 index 41221a8d7e..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/WebService.java +++ /dev/null @@ -1,60 +0,0 @@ -/********************************************************************** -* This file is part of Adempiere ERP Bazaar * -* http://www.adempiere.org * -* * -* Copyright (C) Carlos Ruiz - globalqss * -* Copyright (C) Contributors * -* * -* This program is free software; you can redistribute it and/or * -* modify it under the terms of the GNU General Public License * -* as published by the Free Software Foundation; either version 2 * -* of the License, or (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the Free Software * -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * -* MA 02110-1301, USA. * -* * -* Contributors: * -* - Carlos Ruiz (globalqss@users.sourceforge.net) * -* * -* Sponsors: * -* - GlobalQSS (http://www.globalqss.com) * -***********************************************************************/ - -package com.globalqss.ObPOSInterface; - -import org.openbravo.erpCommon.ws.externalSales.GetCustomersResponseDocument; - -@javax.jws.WebService -public interface WebService { - - /* methods to implement */ - - public GetCustomersResponseDocument getCustomers(int clientId, String username, String password); - - /* - public GetCustomerResponseDocument getCustomer(GetCustomerRequestDocument req) throws XFireFault; - - public GetCustomerResponse1Document getCustomer(GetCustomerRequest1Document req) throws XFireFault; - - public UpdateCustomerResponseDocument updateCustomer(UpdateCustomerRequestDocument req) throws XFireFault; - - public GetCustomerAddressesResponseDocument getCustomerAddresses(GetCustomerAddressesRequestDocument req) throws XFireFault; - - public GetCustomerLocationResponseDocument getCustomerLocation(GetCustomerLocationRequestDocument req) throws XFireFault; - - public UpdateAddressResponseDocument updateAddress(UpdateAddressRequestDocument req) throws XFireFault; - - public GetCustomerContactResponseDocument getCustomerContact(GetCustomerContactRequestDocument req) throws XFireFault; - - public UpdateContactResponseDocument updateContact(UpdateContactRequestDocument req) throws XFireFault; - - */ - -} diff --git a/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/WebServiceImpl.java b/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/WebServiceImpl.java deleted file mode 100644 index 592947b885..0000000000 --- a/org.idempiere.webservices/WEB-INF/src/com/globalqss/ObPOSInterface/WebServiceImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/********************************************************************** -* This file is part of Adempiere ERP Bazaar * -* http://www.adempiere.org * -* * -* Copyright (C) Carlos Ruiz - globalqss * -* Copyright (C) Contributors * -* * -* This program is free software; you can redistribute it and/or * -* modify it under the terms of the GNU General Public License * -* as published by the Free Software Foundation; either version 2 * -* of the License, or (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the Free Software * -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * -* MA 02110-1301, USA. * -* * -* Contributors: * -* - Carlos Ruiz (globalqss@users.sourceforge.net) * -* * -* Sponsors: * -* - GlobalQSS (http://www.globalqss.com) * -***********************************************************************/ - -package com.globalqss.ObPOSInterface; - -import org.compiere.util.CLogger; -import org.openbravo.erpCommon.ws.externalSales.GetCustomersResponse; -import org.openbravo.erpCommon.ws.externalSales.GetCustomersResponseDocument; - -/* - * ADEMPIERE/COMPIERE - * - * Web Service interface for openbravo pos - * - * Contributors: Carlos Ruiz - globalqss - */ - - -/** - * - * @author Carlos Ruiz - globalqss - * - */ -public class WebServiceImpl implements WebService { - - private static CLogger log = CLogger.getCLogger(WebServiceImpl.class); - - private static String webServiceName = new String("WebService"); - - public WebServiceImpl() - { - log.info("Creating session object ExternalSales"); - } - - public String getVersion() { - return "0.1.0"; - } - - public GetCustomersResponseDocument getCustomers(int clientId, String username, String password) - { - // TODO Auto-generated method stub - GetCustomersResponseDocument resdoc = GetCustomersResponseDocument.Factory.newInstance(); - @SuppressWarnings("unused") - GetCustomersResponse res = resdoc.addNewGetCustomersResponse(); - - ExternalSalesImpl.authenticate(username, password, webServiceName, "getCustomers"); - - // TODO Auto-generated method stub - - return resdoc; - } - -} \ No newline at end of file diff --git a/org.idempiere.webservices/WEB-INF/src/org/compiere/model/I_WS_WebServiceFieldInput.java b/org.idempiere.webservices/WEB-INF/src/org/compiere/model/I_WS_WebServiceFieldInput.java index a3d3746a36..149e55effb 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/compiere/model/I_WS_WebServiceFieldInput.java +++ b/org.idempiere.webservices/WEB-INF/src/org/compiere/model/I_WS_WebServiceFieldInput.java @@ -77,6 +77,34 @@ public interface I_WS_WebServiceFieldInput */ public int getAD_Org_ID(); + /** Column name AD_Reference_ID */ + public static final String COLUMNNAME_AD_Reference_ID = "AD_Reference_ID"; + + /** Set Reference. + * System Reference and Validation + */ + public void setAD_Reference_ID (int AD_Reference_ID); + + /** Get Reference. + * System Reference and Validation + */ + public int getAD_Reference_ID(); + + public org.compiere.model.I_AD_Reference getAD_Reference() throws RuntimeException; + + /** Column name ColumnName */ + public static final String COLUMNNAME_ColumnName = "ColumnName"; + + /** Set DB Column Name. + * Name of the column in the database + */ + public void setColumnName (String ColumnName); + + /** Get DB Column Name. + * Name of the column in the database + */ + public String getColumnName(); + /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; @@ -93,6 +121,15 @@ public interface I_WS_WebServiceFieldInput */ public int getCreatedBy(); + /** Column name IdentifierLogic */ + public static final String COLUMNNAME_IdentifierLogic = "IdentifierLogic"; + + /** Set Identifier Logic */ + public void setIdentifierLogic (String IdentifierLogic); + + /** Get Identifier Logic */ + public String getIdentifierLogic(); + /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; @@ -106,6 +143,32 @@ public interface I_WS_WebServiceFieldInput */ public boolean isActive(); + /** Column name IsIdentifier */ + public static final String COLUMNNAME_IsIdentifier = "IsIdentifier"; + + /** Set Identifier. + * This column is part of the record identifier + */ + public void setIsIdentifier (boolean IsIdentifier); + + /** Get Identifier. + * This column is part of the record identifier + */ + public boolean isIdentifier(); + + /** Column name IsNullIdentifier */ + public static final String COLUMNNAME_IsNullIdentifier = "IsNullIdentifier"; + + /** Set Allow Null Value. + * Should allow null value for identifiere field + */ + public void setIsNullIdentifier (boolean IsNullIdentifier); + + /** Get Allow Null Value. + * Should allow null value for identifiere field + */ + public boolean isNullIdentifier(); + /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; diff --git a/org.idempiere.webservices/WEB-INF/src/org/compiere/model/MWebServiceType.java b/org.idempiere.webservices/WEB-INF/src/org/compiere/model/MWebServiceType.java index a066fbfd97..6a9fba8863 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/compiere/model/MWebServiceType.java +++ b/org.idempiere.webservices/WEB-INF/src/org/compiere/model/MWebServiceType.java @@ -32,6 +32,8 @@ package org.compiere.model; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; import java.util.Properties; import java.util.logging.Level; @@ -42,6 +44,7 @@ import org.compiere.util.DB; * Web Services Type Model * * @author Carlos Ruiz + * @author Deepak Pansheriya - Updated to support CreateUpdate service */ public class MWebServiceType extends X_WS_WebServiceType { @@ -58,7 +61,15 @@ public class MWebServiceType extends X_WS_WebServiceType /** Allowed output columns */ private String[] m_outputcolumnnames = null; + private Map m_inputFieldMap = null; + private ArrayList m_keyColumns = null; + + public ArrayList getKeyColumns() { + getInputFieldMap(false); + return m_keyColumns; + } + /** * Get Parameters * @param requery requery @@ -238,7 +249,6 @@ public class MWebServiceType extends X_WS_WebServiceType } // isOutputColumnNameAllowed /** Static Logger */ - @SuppressWarnings("unused") private static CLogger s_log = CLogger.getCLogger (MWebServiceType.class); /************************************************************************** @@ -271,4 +281,64 @@ public class MWebServiceType extends X_WS_WebServiceType super(ctx, rs, trxName); } // MWebServiceType + /** + * + * @param requery + */ + public void getInputFieldMap(boolean requery){ + if(!requery && m_inputFieldMap!=null) + return; + + if(m_inputFieldMap!=null) + m_inputFieldMap.clear(); + else + m_inputFieldMap = new HashMap(); + + if(m_keyColumns==null) + m_keyColumns = new ArrayList(); + else + m_keyColumns.clear(); + + + String sql = "SELECT coalesce(c.ColumnName,f.ColumnName),f.* FROM WS_WebServiceFieldInput f left join AD_Column c on c.AD_Column_ID=f.AD_Column_ID " + + "WHERE f.WS_WebServiceType_ID=? " + + "AND (c.IsActive='Y' OR c.IsActive is null)" + + "AND f.IsActive='Y' " + + "ORDER BY c.ColumnName"; + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt.setInt (1, getWS_WebServiceType_ID()); + rs = pstmt.executeQuery (); + while (rs.next ()) + { + String colName = rs.getString(1); + X_WS_WebServiceFieldInput inputField = new X_WS_WebServiceFieldInput(getCtx(), rs, null); + if(inputField.isIdentifier()) + m_keyColumns.add(colName); + + m_inputFieldMap.put(colName,inputField ); + } + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + } + + public X_WS_WebServiceFieldInput getFieldInput(String colName){ + getInputFieldMap(false); + + return m_inputFieldMap.get(colName); + } + } // MWebServiceType diff --git a/org.idempiere.webservices/WEB-INF/src/org/compiere/model/X_WS_WebServiceFieldInput.java b/org.idempiere.webservices/WEB-INF/src/org/compiere/model/X_WS_WebServiceFieldInput.java index c7a0ba6901..6336cbac3c 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/compiere/model/X_WS_WebServiceFieldInput.java +++ b/org.idempiere.webservices/WEB-INF/src/org/compiere/model/X_WS_WebServiceFieldInput.java @@ -30,7 +30,7 @@ public class X_WS_WebServiceFieldInput extends PO implements I_WS_WebServiceFiel /** * */ - private static final long serialVersionUID = 20100713L; + private static final long serialVersionUID = 20121118L; /** Standard Constructor */ public X_WS_WebServiceFieldInput (Properties ctx, int WS_WebServiceFieldInput_ID, String trxName) @@ -99,6 +99,113 @@ public class X_WS_WebServiceFieldInput extends PO implements I_WS_WebServiceFiel return ii.intValue(); } + public org.compiere.model.I_AD_Reference getAD_Reference() throws RuntimeException + { + return (org.compiere.model.I_AD_Reference)MTable.get(getCtx(), org.compiere.model.I_AD_Reference.Table_Name) + .getPO(getAD_Reference_ID(), get_TrxName()); } + + /** Set Reference. + @param AD_Reference_ID + System Reference and Validation + */ + public void setAD_Reference_ID (int AD_Reference_ID) + { + if (AD_Reference_ID < 1) + set_Value (COLUMNNAME_AD_Reference_ID, null); + else + set_Value (COLUMNNAME_AD_Reference_ID, Integer.valueOf(AD_Reference_ID)); + } + + /** Get Reference. + @return System Reference and Validation + */ + public int getAD_Reference_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_AD_Reference_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + + /** Set DB Column Name. + @param ColumnName + Name of the column in the database + */ + public void setColumnName (String ColumnName) + { + set_Value (COLUMNNAME_ColumnName, ColumnName); + } + + /** Get DB Column Name. + @return Name of the column in the database + */ + public String getColumnName () + { + return (String)get_Value(COLUMNNAME_ColumnName); + } + + /** Set Identifier Logic. + @param IdentifierLogic Identifier Logic */ + public void setIdentifierLogic (String IdentifierLogic) + { + set_Value (COLUMNNAME_IdentifierLogic, IdentifierLogic); + } + + /** Get Identifier Logic. + @return Identifier Logic */ + public String getIdentifierLogic () + { + return (String)get_Value(COLUMNNAME_IdentifierLogic); + } + + /** Set Identifier. + @param IsIdentifier + This column is part of the record identifier + */ + public void setIsIdentifier (boolean IsIdentifier) + { + set_Value (COLUMNNAME_IsIdentifier, Boolean.valueOf(IsIdentifier)); + } + + /** Get Identifier. + @return This column is part of the record identifier + */ + public boolean isIdentifier () + { + Object oo = get_Value(COLUMNNAME_IsIdentifier); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + + /** Set Allow Null Value. + @param IsNullIdentifier + Should allow null value for identifiere field + */ + public void setIsNullIdentifier (boolean IsNullIdentifier) + { + set_Value (COLUMNNAME_IsNullIdentifier, Boolean.valueOf(IsNullIdentifier)); + } + + /** Get Allow Null Value. + @return Should allow null value for identifiere field + */ + public boolean isNullIdentifier () + { + Object oo = get_Value(COLUMNNAME_IsNullIdentifier); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + /** Set Web Service Field Input. @param WS_WebServiceFieldInput_ID Web Service Field Input */ public void setWS_WebServiceFieldInput_ID (int WS_WebServiceFieldInput_ID) diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/AbstractService.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/AbstractService.java new file mode 100644 index 0000000000..7223b187e2 --- /dev/null +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/AbstractService.java @@ -0,0 +1,603 @@ +/****************************************************************************** + * Copyright (C) 2012 Trek Global * + * Product: iDempiere ERP & CRM Smart Business Solution * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ +package org.idempiere.webservices; + +import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import javax.xml.namespace.QName; +import javax.xml.ws.WebServiceContext; +import javax.xml.ws.handler.MessageContext; + +import org.adempiere.base.Service; +import org.adempiere.base.ServiceQuery; +import org.adempiere.exceptions.AdempiereException; +import org.compiere.model.Lookup; +import org.compiere.model.MWebService; +import org.compiere.model.MWebServiceType; +import org.compiere.model.PO; +import org.compiere.model.POInfo; +import org.compiere.model.X_WS_WebServiceMethod; +import org.compiere.util.DB; +import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; +import org.compiere.util.Login; +import org.compiere.util.NamePair; +import org.compiere.util.Trx; +import org.idempiere.webservices.fault.IdempiereServiceFault; + +import org.idempiere.adInterface.x10.ADLoginRequest; +import org.idempiere.adInterface.x10.DataField; +import org.idempiere.adInterface.x10.OutputField; +import org.idempiere.adInterface.x10.OutputFields; +import org.idempiere.adInterface.x10.StandardResponse; +import org.idempiere.adInterface.x10.StandardResponseDocument; + +import com._3e.ADInterface.CompiereService; + + +/** + * + * @author Deepak Pansheriya + * + */ +public class AbstractService { + + @Resource + protected WebServiceContext ctx; + + /** + * Login to web Services + * @param loginRequest + * @param webService + * @param method + * @param serviceType + * @return + */ + protected String login(ADLoginRequest loginRequest, String webService, String method, String serviceType) { + + CompiereService m_cs = getCompiereService(); + + if (m_cs.isLoggedIn() && m_cs.getM_AD_Client_ID() == loginRequest.getClientID() && loginRequest.getClientID() == Env.getAD_Client_ID(Env.getCtx()) + && m_cs.getM_AD_Org_ID() == loginRequest.getOrgID() && m_cs.getM_AD_Role_ID() == loginRequest.getRoleID() + && m_cs.getM_AD_Warehouse_ID() == loginRequest.getWarehouseID() && loginRequest.getUser().equals(m_cs.getUser())) + return authenticate(webService, method, serviceType, m_cs); // already logged with same data + + String ret =invokeLoginValidator(loginRequest, m_cs.getM_ctx(), null, IWSValidator.TIME_BEFORE_LOGIN); + if(ret!=null && ret.length()>0) + return ret; + + Login login = new Login(m_cs.getM_ctx()); + KeyNamePair[] roles = login.getRoles(loginRequest.getUser(), loginRequest.getPass()); + if (roles != null) { + boolean okrole = false; + for (KeyNamePair role : roles) { + if (role.getKey() == loginRequest.getRoleID()) { + okrole = true; + break; + } + } + if (!okrole) + return "Error logging in - role not allowed for this user"; + + KeyNamePair[] clients = login.getClients(new KeyNamePair(loginRequest.getRoleID(), "")); + boolean okclient = false; + for (KeyNamePair client : clients) { + if (client.getKey() == loginRequest.getClientID()) { + okclient = true; + break; + } + } + if (!okclient) + return "Error logging in - client not allowed for this role"; + + m_cs.getM_ctx().setProperty("#AD_Client_ID", "" + loginRequest.getClientID()); + + KeyNamePair[] orgs = login.getOrgs(new KeyNamePair(loginRequest.getRoleID(), "")); + + if (orgs == null) + return "Error logging in - no organizations for this role"; + + KeyNamePair orglogin = null; + boolean okorg = false; + for (KeyNamePair org : orgs) { + if (org.getKey() == loginRequest.getOrgID()) { + okorg = true; + orglogin = org; + break; + } + } + if (!okorg) + return "Error logging in - org not allowed for this role"; + + KeyNamePair[] warehouses = login.getWarehouses(new KeyNamePair(loginRequest.getOrgID(), "")); + boolean okwh = false; + for (KeyNamePair warehouse : warehouses) { + if (warehouse.getKey() == loginRequest.getWarehouseID()) { + okwh = true; + break; + } + } + if (!okwh) + return "Error logging in - warehouse not allowed for this org"; + + String error = login.validateLogin(orglogin); + if (error != null && error.length() > 0) + return error; + + int AD_User_ID = Env.getAD_User_ID(m_cs.getM_ctx()); + + + if (!m_cs.login(AD_User_ID, loginRequest.getRoleID(), loginRequest.getClientID(), loginRequest.getOrgID(), loginRequest.getWarehouseID(), loginRequest.getLang())) + return "Error logging in"; + + + + } else { + return "Error logging in - no roles or user/pwd invalid for user " + loginRequest.getUser(); + } + + ret =invokeLoginValidator(loginRequest, m_cs.getM_ctx(), null, IWSValidator.TIME_AFTER_LOGIN); + if(ret!=null && ret.length()>0) + return ret; + + return authenticate(webService, method, serviceType, m_cs); + } + + /** + * Authenticate user for requested service type + * @param webServiceValue + * @param methodValue + * @param serviceTypeValue + * @param m_cs + * @return + */ + protected String authenticate(String webServiceValue, String methodValue, String serviceTypeValue, CompiereService m_cs) { + + HttpServletRequest req = (HttpServletRequest) ctx.getMessageContext().get(MessageContext.SERVLET_REQUEST); + + MWebService m_webservice = MWebService.get(m_cs.getM_ctx(), webServiceValue); + if (m_webservice == null || !m_webservice.isActive()) + return "Web Service " + webServiceValue + " not registered"; + + X_WS_WebServiceMethod m_webservicemethod = m_webservice.getMethod(methodValue); + if (m_webservicemethod == null || !m_webservicemethod.isActive()) + return "Method " + methodValue + " not registered"; + + MWebServiceType m_webservicetype = null; + final String sql = "SELECT * FROM WS_WebServiceType " + "WHERE AD_Client_ID=? " + "AND WS_WebService_ID=? " + + "AND WS_WebServiceMethod_ID=? " + "AND Value=? " + "AND IsActive='Y'"; + PreparedStatement pstmt = null; + ResultSet rs = null; + try { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, m_cs.getM_AD_Client_ID()); + pstmt.setInt(2, m_webservice.getWS_WebService_ID()); + pstmt.setInt(3, m_webservicemethod.getWS_WebServiceMethod_ID()); + pstmt.setString(4, serviceTypeValue); + rs = pstmt.executeQuery(); + if (rs.next()) + m_webservicetype = new MWebServiceType(m_cs.getM_ctx(), rs, null); + } catch (Exception e) { + throw new IdempiereServiceFault(e.getClass().toString() + " " + e.getMessage() + " sql=" + sql, e.getCause(), new QName( + "authenticate")); + } finally { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + if (m_webservicetype == null) + return "Service type " + serviceTypeValue + " not configured"; + + req.setAttribute("MWebServiceType", m_webservicetype); + + String ret=invokeLoginValidator(null, m_cs.getM_ctx(), m_webservicetype, IWSValidator.TIME_ON_AUTHENTICATION); + if(ret!=null && ret.length()>0) + return ret; + + return null; + } + + /** + * Rollback and set error on standard response + * @param trx + * @param resp + * @param ret + * @param isError + * @param string + * @return + */ + protected static StandardResponseDocument rollbackAndSetError(Trx trx, StandardResponse resp, StandardResponseDocument ret, boolean isError, + String string) { + resp.setError(string); + resp.setIsError(isError); + trx.rollback(); + trx.close(); + return ret; + } + + /** + * + * @return Compiere Service object for current session + */ + protected CompiereService getCompiereService() { + HttpServletRequest req = (HttpServletRequest) ctx.getMessageContext().get(MessageContext.SERVLET_REQUEST); + HttpSession session = req.getSession(); + CompiereService m_cs = (CompiereService) session.getAttribute("CompiereServiceBean"); + if (m_cs == null) { + m_cs = new CompiereService(); + m_cs.connect(); + session.setAttribute("CompiereServiceBean", m_cs); + } + return m_cs; + } + + /** + * + * @return + */ + protected MWebServiceType getWebServiceType() { + HttpServletRequest req = (HttpServletRequest) ctx.getMessageContext().get(MessageContext.SERVLET_REQUEST); + + return (MWebServiceType) req.getAttribute("MWebServiceType"); + + } + + /** + * Get request Ctx + * @return + */ + protected Map getRequestCtx() { + HttpServletRequest req = (HttpServletRequest) ctx.getMessageContext().get(MessageContext.SERVLET_REQUEST); + + Map reqCtx= (Map)req.getAttribute("RequestCtx"); + if(reqCtx==null){ + reqCtx = new HashMap(); + req.setAttribute("RequestCtx", reqCtx); + } + + return reqCtx; + } + + /** + * + * @param resp + * @param m_webservicetype + */ + protected void setOuputFields(StandardResponse resp,MWebServiceType m_webservicetype,PO po,POInfo poInfo){ + String[] outCols = m_webservicetype.getOutputColumnNames(false); + if(outCols.length>0){ + OutputFields outputFields = resp.getOutputFields(); + if(outputFields==null) + outputFields=resp.addNewOutputFields(); + + for(String colName:outCols){ + int indCol = poInfo.getColumnIndex(colName); + if(indCol<0) + continue; + + OutputField outField= outputFields.addNewOutputField(); + outField.setColumn(colName); + if(po.get_Value(indCol)!=null){ + outField.setValue(po.get_Value(indCol).toString()); + Lookup lookup = poInfo.getColumnLookup(indCol); + if(lookup != null){ + //Setting text + if(lookup.getSize()==0) + lookup.refresh(); + + NamePair pair = lookup.getDirect(po.get_Value(indCol), false, false); + outField.setText(pair.getName()); + } + } + } + } + } + + /** + * Parse variables inside SQL + * @param sql + * @param sqlParas + * @param po + * @param requestCtx + * @return + * @throws AdempiereException + */ + protected String parseSQL(String sql, ArrayList sqlParas, PO po,POInfo poInfo, Map requestCtx) throws AdempiereException { + if (sql.startsWith("@SQL=")) + sql = sql.substring(5); + + if (sql.toLowerCase().indexOf(" where ") == -1) + throw new AdempiereException("Invalid SQL: Query do not have any filetering criteria"); + + StringBuilder sqlBuilder = new StringBuilder(); + + if (sql.indexOf('@') == -1) { + sqlBuilder.append(sql); + } else { + int firstInd = sql.indexOf('@'); + while (firstInd >= 0) { + + sqlBuilder.append(sql.substring(0, firstInd)); + + sql = sql.substring(firstInd + 1); + + firstInd = sql.indexOf('@'); + if (firstInd == -1) { + throw new AdempiereException("Missing closing '@' in SQL"); + } + + String token = sql.substring(0, firstInd); + boolean isNullable = false; + if(token.charAt(0)=='!'){ + isNullable = true; + token = token.substring(1); + } + + sql = sql.substring(firstInd + 1); + + Object val = parseVariable(token, po,poInfo, requestCtx); + if(val == null && isNullable){ + int ind = sqlBuilder.lastIndexOf("="); + sqlBuilder.replace(ind, sqlBuilder.length(), " Is Null "); + }else if (val == null) + throw new AdempiereException("Can not resolve varialbe '" + token + "' in sql"); + else{ + sqlBuilder.append(" ? "); + sqlParas.add(val); + } + + firstInd = sql.indexOf('@'); + } + } + + + return sqlBuilder.toString(); + } + + /** + * Resolving context variable into object + * @param varName + * @param po + * @param requestCtx + * @return + */ + protected Object parseVariable(String varName, PO po,POInfo poInfo, Map requestCtx) { + Object val = null; + if (varName.charAt(0) == '@') + varName = varName.substring(1); + + int indDot = varName.indexOf("."); + if (indDot == -1) { + if (varName.charAt(0) == '#') { + varName = varName.substring(1); + val = getCompiereService().getM_ctx().getProperty(varName); + } else { + // If there is no table name, then it should be + // premitive data type + if (po != null && poInfo.getColumnIndex(varName)!=-1) + val = po.get_Value(varName); + + if (val == null) + val = requestCtx.get(varName); + } + } else { + + + String tblName = varName.substring(0, indDot); + String colName = varName.substring(indDot + 1); + if (colName.indexOf(".") >= 0) { + throw new IdempiereServiceFault(" can not resolve " + varName + ". contains un supported multi level object resolution", + new QName("resolveCtxVariable")); + } + + Object obj = requestCtx.get(tblName); + if (obj == null || !(obj instanceof PO)) { + throw new IdempiereServiceFault(" can not found object of " + tblName + ". Request variable " + varName + + " can not resolved", new QName("resolveCtxVariable")); + } + + PO refPO = (PO) obj; + val = refPO.get_Value(colName); + + } + + return val; + } + + /** + * + * @param strValue + * @param columnClass + * @param colName + * @param m_webservicetype + * @return + */ + protected Object convertToObj(String strValue,Class columnClass,String colName){ + + Object value = null; + + if (columnClass == Boolean.class) { + if ("Y".equalsIgnoreCase(strValue) + || "true".equalsIgnoreCase(strValue)) + value = new Boolean(true); + else if ("N".equalsIgnoreCase(strValue) + || "false".equalsIgnoreCase(strValue)) + value = new Boolean(false); + else + throw new IdempiereServiceFault(" input column " + colName + + " wrong value " + strValue, new QName( + "setValueAccordingToClass")); + } else if (columnClass == Integer.class) { + try { + value = Integer.parseInt(strValue); + } catch (NumberFormatException e) { + throw new IdempiereServiceFault(e.getClass().toString() + + " " + e.getMessage() + " for " + + colName , e.getCause(), new QName( + "setValueAccordingToClass")); + } + } else if (columnClass == BigDecimal.class) { + try { + value = new BigDecimal(strValue); + } catch (Exception e) { + throw new IdempiereServiceFault(e.getClass().toString() + + " " + e.getMessage() + " for " + + colName, e.getCause(), new QName( + "setValueAccordingToClass")); + } + } else if (columnClass == Timestamp.class) { + try { + value = Timestamp.valueOf(strValue); + } catch (Exception e) { + throw new IdempiereServiceFault(e.getClass().toString() + + " " + e.getMessage() + " for " + + colName, e.getCause(), new QName( + "setValueAccordingToClass")); + } + } else if (columnClass == byte[].class) { + throw new IdempiereServiceFault(" input column " + + colName + " LOB not supported", + new QName("setValueAccordingToClass")); + } else { + value = strValue; + } + + return value; + } + + /** + * Retrieve variable data type + * @param columnName + * @param displayType + * @return + */ + protected Class getVariableType(String columnName,int displayType){ + Class ColumnClass= null; + if (columnName.equals("AD_Language") || columnName.equals("EntityType")) + { + ColumnClass = String.class; + } + else if (columnName.equals("Posted") + || columnName.equals("Processed") + || columnName.equals("Processing")) + { + ColumnClass = Boolean.class; + } + else if (columnName.equals("Record_ID")) + { + ColumnClass = Integer.class; + } + else + ColumnClass = org.compiere.util.DisplayType.getClass(displayType, true); + + return ColumnClass; + } + + /** + * retrieve web service Validators + * @param serviceType + * @return + */ + public static List getValidators(String serviceType){ + ServiceQuery query = new ServiceQuery(); + query.put("WSType",serviceType); + + return Service.locator().list(IWSValidator.class, query).getServices(); + } + + /** + * Invoke webservice Validator + * @param m_WebServiceType + * @param time + * @param po + * @param fields + * @param trx + * @param requestCtx + * @param resp + * @param ret + * @return + */ + public static StandardResponseDocument invokeWSValidator(MWebServiceType m_WebServiceType, int time,PO po, DataField fields[], Trx trx,Map requestCtx,StandardResponse resp,StandardResponseDocument ret){ + + List validators = getValidators(m_WebServiceType.getValue()); + List globalValidators = getValidators("GLOBAL"); + //Call global validator + for(IWSValidator validator:globalValidators){ + try{ + validator.validate(po, m_WebServiceType, fields, time,trx.getTrxName(),requestCtx); + }catch (IdempiereServiceFault e) { + return rollbackAndSetError(trx, resp, ret, true, e.getMessage()); + } + } + + for(IWSValidator validator:validators){ + try{ + validator.validate(po, m_WebServiceType, fields, time,trx.getTrxName(),requestCtx); + }catch (IdempiereServiceFault e) { + return rollbackAndSetError(trx, resp, ret, true, e.getMessage()); + } + } + return null; + } + + /** + * Invoke web Service Login Validator + * @param loginRequest + * @param ctx + * @param m_webserviceType + * @param time + * @return + */ + public static String invokeLoginValidator(ADLoginRequest loginRequest, Properties ctx, MWebServiceType m_webserviceType, int time) { + + List validators = null; + if (m_webserviceType != null) { + validators = getValidators(m_webserviceType.getValue()); + } + List globalValidators = getValidators("GLOBAL"); + // Call global validator + for (IWSValidator validator : globalValidators) { + try { + validator.login(loginRequest, ctx, m_webserviceType, time); + } catch (IdempiereServiceFault e) { + return e.getMessage(); + } + } + + if (validators != null) { + for (IWSValidator validator : validators) { + try { + validator.login(loginRequest, ctx, m_webserviceType, time); + } catch (IdempiereServiceFault e) { + return e.getMessage(); + } + } + } + return null; + } + + +} diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/IWSValidator.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/IWSValidator.java new file mode 100644 index 0000000000..fb48ffae60 --- /dev/null +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/IWSValidator.java @@ -0,0 +1,28 @@ +package org.idempiere.webservices; + +import java.util.Map; +import java.util.Properties; + +import org.compiere.model.MWebServiceType; +import org.compiere.model.PO; +import org.idempiere.webservices.fault.IdempiereServiceFault; + +import org.idempiere.adInterface.x10.ADLoginRequest; +import org.idempiere.adInterface.x10.DataField; + +public interface IWSValidator { + public static final int TIME_BEFORE_PARSE=1; + public static final int TIME_AFTER_PARSE=2; + public static final int TIME_BEFORE_SAVE=3; + public static final int TIME_AFTER_SAVE=4; + + public static final int TIME_BEFORE_LOGIN=5; + public static final int TIME_AFTER_LOGIN=6; + public static final int TIME_ON_AUTHENTICATION=7; + + public static final int TIME_BEFORE_PROCESS=8; + public static final int TIME_AFTER_PROCESS=9; + + public void validate(PO po,MWebServiceType m_webserviceType,DataField[] fields,int time,String trxName,Map requestCtx) throws IdempiereServiceFault; + public void login(ADLoginRequest loginRequest,Properties ctx,MWebServiceType m_webserviceType,int time) throws IdempiereServiceFault; +} diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/fault/IdempiereServiceFault.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/fault/IdempiereServiceFault.java index 0c882cddf2..a178cc6163 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/fault/IdempiereServiceFault.java +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/webservices/fault/IdempiereServiceFault.java @@ -7,15 +7,15 @@ import javax.xml.ws.WebFault; public class IdempiereServiceFault extends RuntimeException{ public IdempiereServiceFault(String string, QName qName) { - // TODO Auto-generated constructor stub + super(string); } public IdempiereServiceFault(String string, Throwable cause, QName qName) { - // TODO Auto-generated constructor stub + super(string, cause); } public IdempiereServiceFault(Exception exception) { - // TODO Auto-generated constructor stub + super(exception); } /** diff --git a/org.idempiere.webservices/WEB-INF/xsd/WebstoreSchema.xsd b/org.idempiere.webservices/WEB-INF/xsd/WebstoreSchema.xsd deleted file mode 100644 index c0a5100754..0000000000 --- a/org.idempiere.webservices/WEB-INF/xsd/WebstoreSchema.xsd +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.idempiere.webservices/WEB-INF/xsd/schema.xsd b/org.idempiere.webservices/WEB-INF/xsd/idempiere-schema.xsd similarity index 81% rename from org.idempiere.webservices/WEB-INF/xsd/schema.xsd rename to org.idempiere.webservices/WEB-INF/xsd/idempiere-schema.xsd index 200a0caa40..e199e2969a 100644 --- a/org.idempiere.webservices/WEB-INF/xsd/schema.xsd +++ b/org.idempiere.webservices/WEB-INF/xsd/idempiere-schema.xsd @@ -1,7 +1,7 @@ @@ -356,13 +356,32 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -400,6 +419,7 @@ + @@ -457,7 +477,8 @@ - + + @@ -465,6 +486,7 @@ + @@ -477,6 +499,62 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.idempiere.webservices/WEB-INF/xsd/obschema.xsd b/org.idempiere.webservices/WEB-INF/xsd/obschema.xsd deleted file mode 100644 index 6a7a15dc6b..0000000000 --- a/org.idempiere.webservices/WEB-INF/xsd/obschema.xsd +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.idempiere.webservices/build.properties b/org.idempiere.webservices/build.properties index 9312434dee..9fd1f75988 100644 --- a/org.idempiere.webservices/build.properties +++ b/org.idempiere.webservices/build.properties @@ -17,11 +17,13 @@ bin.includes = META-INF/,\ WEB-INF/lib/neethi-3.0.2.jar,\ WEB-INF/lib/xmlschema-core-2.0.3.jar,\ WEB-INF/lib/stax2-api-3.1.1.jar,\ - WEB-INF/lib/spring-aop-3.0.7.RELEASE.jar,\ WEB-INF/lib/cxf-rt-frontend-jaxws-2.6.1.jar,\ - WEB-INF/lib/generated_xbeans.jar,\ WEB-INF/lib/xmlbeans-2.5.0.jar,\ - WEB-INF/lib/composite_XMLSBean.jar + WEB-INF/lib/aopalliance-1.0.jar,\ + WEB-INF/lib/commons-logging-1.1.1.jar,\ + WEB-INF/lib/spring-aop-3.0.7.RELEASE.jar,\ + WEB-INF/lib/spring-osgi-extender-1.2.1.jar,\ + WEB-INF/lib/Idempiere-XMLSBean-1.0.jar src.includes = WEB-INF/classes/,\ WEB-INF/lib/,\ WEB-INF/web.xml,\ diff --git a/org.idempiere.webservices/migration/oracle/WS002_WebServicesDefinition.sql b/org.idempiere.webservices/migration/oracle/WS002_WebServicesDefinition.sql index 86c5e0818b..fbe5111aa7 100644 --- a/org.idempiere.webservices/migration/oracle/WS002_WebServicesDefinition.sql +++ b/org.idempiere.webservices/migration/oracle/WS002_WebServicesDefinition.sql @@ -1,73 +1,5 @@ -- Jan 30, 2009 7:13:26 PM COT -- Web Service Definition and Security -INSERT INTO WS_WebService (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,Help,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID) VALUES (0,0,TO_DATE('2009-01-30 19:13:25','YYYY-MM-DD HH24:MI:SS'),100,'Contributed by http://www.3e.pl/ - intended to enable work of clients like ADClient.exe','WARNING! This is disabled by default as security is not implemented yet','Y','UI Oriented Adempiere Web Services',TO_DATE('2009-01-30 19:13:25','YYYY-MM-DD HH24:MI:SS'),100,'ADService',50000) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:13:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','getADWindow',TO_DATE('2009-01-30 19:13:41','YYYY-MM-DD HH24:MI:SS'),100,'getADWindow',50000,50000) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:13:54','YYYY-MM-DD HH24:MI:SS'),100,'Y','getWindowTabData',TO_DATE('2009-01-30 19:13:54','YYYY-MM-DD HH24:MI:SS'),100,'getWindowTabData',50000,50001) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:14:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','getDataRow',TO_DATE('2009-01-30 19:14:02','YYYY-MM-DD HH24:MI:SS'),100,'getDataRow',50000,50002) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:14:08','YYYY-MM-DD HH24:MI:SS'),100,'Y','updateDataRow',TO_DATE('2009-01-30 19:14:08','YYYY-MM-DD HH24:MI:SS'),100,'updateDataRow',50000,50003) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:14:13','YYYY-MM-DD HH24:MI:SS'),100,'Y','saveDataRow',TO_DATE('2009-01-30 19:14:13','YYYY-MM-DD HH24:MI:SS'),100,'saveDataRow',50000,50004) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:14:19','YYYY-MM-DD HH24:MI:SS'),100,'Y','addNewDataRow',TO_DATE('2009-01-30 19:14:19','YYYY-MM-DD HH24:MI:SS'),100,'addNewDataRow',50000,50005) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:14:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','deleteDataRow',TO_DATE('2009-01-30 19:14:24','YYYY-MM-DD HH24:MI:SS'),100,'deleteDataRow',50000,50006) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:14:43','YYYY-MM-DD HH24:MI:SS'),100,'Y','ignoreDataRow',TO_DATE('2009-01-30 19:14:43','YYYY-MM-DD HH24:MI:SS'),100,'ignoreDataRow',50000,50007) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:14:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','refreshDataRow',TO_DATE('2009-01-30 19:14:51','YYYY-MM-DD HH24:MI:SS'),100,'refreshDataRow',50000,50008) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:14:57','YYYY-MM-DD HH24:MI:SS'),100,'Y','getLookupSearchData',TO_DATE('2009-01-30 19:14:57','YYYY-MM-DD HH24:MI:SS'),100,'getLookupSearchData',50000,50009) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','getLookupData',TO_DATE('2009-01-30 19:15:02','YYYY-MM-DD HH24:MI:SS'),100,'getLookupData',50000,50010) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','getADMenu',TO_DATE('2009-01-30 19:15:07','YYYY-MM-DD HH24:MI:SS'),100,'getADMenu',50000,50011) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:12','YYYY-MM-DD HH24:MI:SS'),100,'Y','login',TO_DATE('2009-01-30 19:15:12','YYYY-MM-DD HH24:MI:SS'),100,'login',50000,50012) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:17','YYYY-MM-DD HH24:MI:SS'),100,'Y','getProcessParams',TO_DATE('2009-01-30 19:15:17','YYYY-MM-DD HH24:MI:SS'),100,'getProcessParams',50000,50013) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:22','YYYY-MM-DD HH24:MI:SS'),100,'Y','runProcess',TO_DATE('2009-01-30 19:15:22','YYYY-MM-DD HH24:MI:SS'),100,'runProcess',50000,50014) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','saveLocation',TO_DATE('2009-01-30 19:15:30','YYYY-MM-DD HH24:MI:SS'),100,'saveLocation',50000,50015) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:36','YYYY-MM-DD HH24:MI:SS'),100,'Y','getLocation',TO_DATE('2009-01-30 19:15:36','YYYY-MM-DD HH24:MI:SS'),100,'getLocation',50000,50016) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','getDocAction',TO_DATE('2009-01-30 19:15:41','YYYY-MM-DD HH24:MI:SS'),100,'getDocAction',50000,50017) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','setDocAction',TO_DATE('2009-01-30 19:15:46','YYYY-MM-DD HH24:MI:SS'),100,'setDocAction',50000,50018) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','getVersion',TO_DATE('2009-01-30 19:15:51','YYYY-MM-DD HH24:MI:SS'),100,'getVersion',50000,50019) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:15:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','isLoggedIn',TO_DATE('2009-01-30 19:15:56','YYYY-MM-DD HH24:MI:SS'),100,'isLoggedIn',50000,50020) -; - -UPDATE WS_WebService SET IsActive='N',Updated=TO_DATE('2009-01-30 19:16:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE WS_WebService_ID=50000 -; INSERT INTO WS_WebService (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,Help,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID) VALUES (0,0,TO_DATE('2009-01-30 19:17:43','YYYY-MM-DD HH24:MI:SS'),100,'Contributed by http://www.globalqss.com - implemented security','This web services are very generic - so it''s necessary to configure the security layer in the web services security window to make them work. You can take a look to GardenWorld samples.','Y','Model Oriented Web Services',TO_DATE('2009-01-30 19:17:43','YYYY-MM-DD HH24:MI:SS'),100,'ModelADService',50001) ; @@ -98,48 +30,3 @@ INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Descri INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:22:50','YYYY-MM-DD HH24:MI:SS'),100,'Access records via conditions on columns - return data rows','Y','Query Data',TO_DATE('2009-01-30 19:22:50','YYYY-MM-DD HH24:MI:SS'),100,'queryData',50001,50028) ; -INSERT INTO WS_WebService (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID) VALUES (0,0,TO_DATE('2009-01-30 19:24:05','YYYY-MM-DD HH24:MI:SS'),100,'Web services needed for integration with Openbravo POS','Y','External Sales - web service',TO_DATE('2009-01-30 19:24:05','YYYY-MM-DD HH24:MI:SS'),100,'ExternalSales',50002) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:24:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','getProductsPlusCatalog',TO_DATE('2009-01-30 19:24:27','YYYY-MM-DD HH24:MI:SS'),100,'getProductsPlusCatalog',50002,50029) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:24:34','YYYY-MM-DD HH24:MI:SS'),100,'Y','uploadOrders',TO_DATE('2009-01-30 19:24:34','YYYY-MM-DD HH24:MI:SS'),100,'uploadOrders',50002,50030) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:24:39','YYYY-MM-DD HH24:MI:SS'),100,'Y','getProductsCatalog',TO_DATE('2009-01-30 19:24:39','YYYY-MM-DD HH24:MI:SS'),100,'getProductsCatalog',50002,50031) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:24:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','getOrders',TO_DATE('2009-01-30 19:24:46','YYYY-MM-DD HH24:MI:SS'),100,'getOrders',50002,50032) -; - -UPDATE WS_WebServiceMethod SET IsActive='N',Updated=TO_DATE('2009-01-30 19:24:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE WS_WebServiceMethod_ID=50032 -; - -INSERT INTO WS_WebService (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID) VALUES (0,0,TO_DATE('2009-01-30 19:25:04','YYYY-MM-DD HH24:MI:SS'),100,'Web services needed for integration with Openbravo POS','Y','WebService - web service',TO_DATE('2009-01-30 19:25:04','YYYY-MM-DD HH24:MI:SS'),100,'WebService',50003) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:25:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','getCustomers',TO_DATE('2009-01-30 19:25:14','YYYY-MM-DD HH24:MI:SS'),100,'getCustomers',50003,50033) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:25:21','YYYY-MM-DD HH24:MI:SS'),100,'N','getCustomer',TO_DATE('2009-01-30 19:25:21','YYYY-MM-DD HH24:MI:SS'),100,'getCustomer',50003,50034) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:25:31','YYYY-MM-DD HH24:MI:SS'),100,'N','updateCustomer',TO_DATE('2009-01-30 19:25:31','YYYY-MM-DD HH24:MI:SS'),100,'updateCustomer',50003,50035) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:25:38','YYYY-MM-DD HH24:MI:SS'),100,'N','getCustomerAddresses',TO_DATE('2009-01-30 19:25:38','YYYY-MM-DD HH24:MI:SS'),100,'getCustomerAddresses',50003,50036) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:25:44','YYYY-MM-DD HH24:MI:SS'),100,'N','getCustomerLocation',TO_DATE('2009-01-30 19:25:44','YYYY-MM-DD HH24:MI:SS'),100,'getCustomerLocation',50003,50037) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:25:51','YYYY-MM-DD HH24:MI:SS'),100,'N','updateAddress',TO_DATE('2009-01-30 19:25:51','YYYY-MM-DD HH24:MI:SS'),100,'updateAddress',50003,50038) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:25:58','YYYY-MM-DD HH24:MI:SS'),100,'N','getCustomerContact',TO_DATE('2009-01-30 19:25:58','YYYY-MM-DD HH24:MI:SS'),100,'getCustomerContact',50003,50039) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_DATE('2009-01-30 19:26:07','YYYY-MM-DD HH24:MI:SS'),100,'N','updateContact',TO_DATE('2009-01-30 19:26:07','YYYY-MM-DD HH24:MI:SS'),100,'updateContact',50003,50040) -; - diff --git a/org.idempiere.webservices/migration/oracle/WS005_IdempiereWebservice.sql b/org.idempiere.webservices/migration/oracle/WS005_IdempiereWebservice.sql new file mode 100644 index 0000000000..e41d741353 --- /dev/null +++ b/org.idempiere.webservices/migration/oracle/WS005_IdempiereWebservice.sql @@ -0,0 +1,608 @@ + +-- Dec 12, 2012 8:54:30 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Column SET SeqNoSelection=2, IsSelectionColumn='Y', IsToolbarButton='N',Updated=TO_DATE('2012-12-12 20:54:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56727 +; + +-- Dec 12, 2012 8:54:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Column SET SeqNoSelection=1, IsSelectionColumn='Y', IsToolbarButton='N',Updated=TO_DATE('2012-12-12 20:54:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56730 +; + +-- Dec 12, 2012 9:27:55 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202041,'D',1,'N','N','N',0,'N',10,'N',18,'N',120,'N','Y','c3d437e8-e10d-4d1b-87e6-68eb5ab4c9ea','Y','AD_Reference_ID','System Reference and Validation','The Reference could be a display type, list or table validation.','Reference','Y',100,TO_DATE('2012-12-12 21:27:54','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-12-12 21:27:54','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 9:27:55 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202041 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 9:28:03 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD AD_Reference_ID NUMBER(10) DEFAULT NULL +; + +-- Dec 12, 2012 9:29:30 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202042,'D','N','N','N',0,'N',30,'Y',10,'N',228,'N','Y','30db973a-b039-437e-b55a-c9ca1e9d7378','Y','ColumnName','Name of the column in the database','The Column Name indicates the name of a column on a table as defined in the database.','DB Column Name','Y',100,TO_DATE('2012-12-12 21:29:30','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-12-12 21:29:30','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 9:29:30 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202042 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 9:29:38 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD ColumnName NVARCHAR2(30) DEFAULT NULL +; + +-- Dec 12, 2012 9:31:07 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IdentifierLogic',200592,'D','Identifier Logic','Identifier Logic','d5470526-d7b3-41fb-9ee7-35190020169c',0,TO_DATE('2012-12-12 21:31:06','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-12-12 21:31:06','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 9:31:08 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200592 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 9:32:26 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202043,'D','N','N','N',0,'N',2000,'N',14,'N',200592,'N','Y','bdf425b5-7c59-42d4-bb59-56c9800e8325','Y','IdentifierLogic','Identifier Logic','Y',100,TO_DATE('2012-12-12 21:32:25','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-12-12 21:32:25','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 9:32:26 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202043 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 9:32:51 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD IdentifierLogic NVARCHAR2(2000) DEFAULT NULL +; + +-- Dec 12, 2012 9:36:10 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202044,'D','N','N','N',0,'N',1,'N',20,'N',382,'N','Y','f0baaca8-7437-4a9d-a02d-26827b0b54b2','Y','IsIdentifier','This column is part of the record identifier','N','The Identifier checkbox indicates that this column is part of the identifier or key for this table. ','Identifier','Y',100,TO_DATE('2012-12-12 21:36:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-12-12 21:36:09','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 9:36:10 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202044 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 9:36:22 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD IsIdentifier CHAR(1) DEFAULT 'N' CHECK (IsIdentifier IN ('Y','N')) +; + +-- Dec 12, 2012 9:36:34 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput MODIFY IdentifierLogic NVARCHAR2(2000) DEFAULT NULL +; + +-- Dec 12, 2012 9:37:50 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Description,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsNullIdentifier',200593,'D','Should allow null value for identifiere field','Allow Null Value','Allow Null Value','a704f515-b9a7-4e90-8d44-d7e16e0f5d8c',0,TO_DATE('2012-12-12 21:37:49','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-12-12 21:37:49','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 9:37:50 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200593 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 9:39:48 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202045,'D','N','N','N',0,'N',1,'N',20,'N',200593,'N','Y','9cc0e2b6-8bc2-4541-86ad-63513f027011','Y','IsNullIdentifier','Should allow null value for identifiere field','N','Allow Null Value','Y',100,TO_DATE('2012-12-12 21:39:47','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-12-12 21:39:47','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 9:39:48 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202045 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 9:39:53 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD IsNullIdentifier CHAR(1) DEFAULT 'N' CHECK (IsNullIdentifier IN ('Y','N')) +; + +-- Dec 12, 2012 9:40:15 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput MODIFY IsIdentifier CHAR(1) DEFAULT 'N' +; + + + + +-- Dec 12, 2012 10:36:44 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('WS_WebServiceType_UU',200594,'D','WS_WebServiceType_UU','WS_WebServiceType_UU','1be8e032-ddc3-489c-8c3d-9a4416968d32',0,TO_DATE('2012-12-12 22:36:43','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-12-12 22:36:43','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 10:36:44 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200594 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 10:37:11 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53164,202046,'D','N','N','N',0,'N',36,'N',10,'N',200594,'N','Y','0d88f8d9-25c1-4507-a495-b7ba84378e86','Y','WS_WebServiceType_UU','WS_WebServiceType_UU','N',100,TO_DATE('2012-12-12 22:37:11','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-12-12 22:37:11','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 10:37:11 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202046 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 10:37:33 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceType ADD WS_WebServiceType_UU NVARCHAR2(36) DEFAULT NULL +; + +-- Dec 12, 2012 10:38:46 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('WS_WebService_Para_UU',200595,'D','WS_WebService_Para_UU','WS_WebService_Para_UU','2f690372-900f-457e-8ef7-d1b04496fa5c',0,TO_DATE('2012-12-12 22:38:45','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-12-12 22:38:45','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 10:38:46 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200595 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 10:39:14 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53165,202047,'D','N','N','N',0,'N',36,'N',10,'N',200595,'N','Y','90cb04b7-7f82-4866-97f6-c8ff0da18c8b','Y','WS_WebService_Para_UU','WS_WebService_Para_UU','N',100,TO_DATE('2012-12-12 22:39:13','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-12-12 22:39:13','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 10:39:14 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202047 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 10:39:21 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebService_Para ADD WS_WebService_Para_UU NVARCHAR2(36) DEFAULT NULL +; + +-- Dec 12, 2012 10:40:21 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('WS_WebServiceFieldInput_UU',200596,'D','WS_WebServiceFieldInput_UU','WS_WebServiceFieldInput_UU','b835e570-ab79-4d64-8b4c-2d1ee688e783',0,TO_DATE('2012-12-12 22:40:21','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-12-12 22:40:21','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 10:40:21 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200596 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 10:40:43 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202048,'D','N','N','N',0,'N',36,'N',10,'N',200596,'N','Y','2f2437aa-cd9c-4fcb-972b-ed1e3393d108','Y','WS_WebServiceFieldInput_UU','WS_WebServiceFieldInput_UU','N',100,TO_DATE('2012-12-12 22:40:42','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-12-12 22:40:42','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 10:40:43 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202048 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 10:40:47 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD WS_WebServiceFieldInput_UU NVARCHAR2(36) DEFAULT NULL +; + +-- Dec 12, 2012 10:41:43 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('WS_WebServiceFieldOutput_UU',200597,'D','WS_WebServiceFieldOutput_UU','WS_WebServiceFieldOutput_UU','bcdfaa22-d87c-4df5-935b-d8f5339d4f51',0,TO_DATE('2012-12-12 22:41:42','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-12-12 22:41:42','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 10:41:43 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200597 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 10:42:01 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53167,202049,'D','N','N','N',0,'N',36,'N',10,'N',200597,'N','Y','0617cbde-f858-4138-aaa4-fca99bc30988','Y','WS_WebServiceFieldOutput_UU','WS_WebServiceFieldOutput_UU','N',100,TO_DATE('2012-12-12 22:42:01','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-12-12 22:42:01','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 10:42:01 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202049 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 10:42:06 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldOutput ADD WS_WebServiceFieldOutput_UU NVARCHAR2(36) DEFAULT NULL +; + +-- Dec 12, 2012 10:43:48 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('WS_WebServiceTypeAccess_UU',200598,'D','WS_WebServiceTypeAccess_UU','WS_WebServiceTypeAccess_UU','32df84f5-c650-425a-b9a8-eca3ed2a6209',0,TO_DATE('2012-12-12 22:43:47','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-12-12 22:43:47','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 10:43:48 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200598 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 10:44:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53168,202050,'D','N','N','N',0,'N',36,'N',10,'N',200598,'N','Y','43bdb652-1a55-4bd5-affd-b55841f1a1ec','Y','WS_WebServiceTypeAccess_UU','WS_WebServiceTypeAccess_UU','N',100,TO_DATE('2012-12-12 22:44:37','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-12-12 22:44:37','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 10:44:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202050 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 10:44:46 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceTypeAccess ADD WS_WebServiceTypeAccess_UU NVARCHAR2(36) DEFAULT NULL +; + + + + + + +-- Dec 12, 2012 11:49:01 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Column SET MandatoryLogic='@AD_Column_ID@=0',Updated=TO_DATE('2012-12-12 23:49:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202041 +; + +-- Dec 12, 2012 11:54:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,1,'N','N',202045,'Y',201365,'N','D','Should allow null value for identifiere field','Allow Null Value','N','Y','678c6e86-9e5f-49d6-819b-bd08b0946f17',100,0,TO_DATE('2012-12-12 23:54:36','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-12-12 23:54:36','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201365 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:54:38 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,30,'N','N',202042,'Y',201366,'N','The Column Name indicates the name of a column on a table as defined in the database.','D','Name of the column in the database','DB Column Name','N','Y','24b12b95-27eb-4303-a550-46402b4a44cb',100,0,TO_DATE('2012-12-12 23:54:37','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-12-12 23:54:37','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:38 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201366 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:54:39 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,1,'N','N',202044,'Y',201367,'N','The Identifier checkbox indicates that this column is part of the identifier or key for this table. ','D','This column is part of the record identifier','Identifier','N','Y','5551bd5f-7bde-42f0-88ac-4ccd099ace7a',100,0,TO_DATE('2012-12-12 23:54:38','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-12-12 23:54:38','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:39 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201367 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:54:40 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,2000,'N','N',202043,'Y',201368,'N','D','Identifier Logic','N','Y','67a1f8e7-44d4-4254-94b8-950a64f331f4',100,0,TO_DATE('2012-12-12 23:54:39','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-12-12 23:54:39','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:40 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201368 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:54:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,10,'N','N',202041,'Y',201369,'N','The Reference could be a display type, list or table validation.','D','System Reference and Validation','Reference','N','Y','837295cd-2ecc-429d-ad18-dba6dadd7c91',100,0,TO_DATE('2012-12-12 23:54:40','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-12-12 23:54:40','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201369 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:54:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,36,'N','N',202048,'Y',201370,'N','D','WS_WebServiceFieldInput_UU','N','Y','3ae46bba-2a92-4c9e-849c-98a716ec16fe',100,0,TO_DATE('2012-12-12 23:54:41','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2012-12-12 23:54:41','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201370 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:55:36 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=201370 +; + +-- Dec 12, 2012 11:55:36 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=201366 +; + +-- Dec 12, 2012 11:55:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=201367 +; + +-- Dec 12, 2012 11:55:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=201365 +; + +-- Dec 12, 2012 11:55:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=201368 +; + +-- Dec 12, 2012 11:55:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=201369 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=201370 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=56668 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=10,IsDisplayedGrid='Y' WHERE AD_Field_ID=56669 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=20,IsDisplayedGrid='Y' WHERE AD_Field_ID=56666 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=30,IsDisplayedGrid='Y' WHERE AD_Field_ID=201366 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=40,IsDisplayedGrid='Y' WHERE AD_Field_ID=201365 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=50,IsDisplayedGrid='Y' WHERE AD_Field_ID=201367 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=60,IsDisplayedGrid='Y' WHERE AD_Field_ID=201368 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=70,IsDisplayedGrid='Y' WHERE AD_Field_ID=201369 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y' WHERE AD_Field_ID=56667 +; + +-- Dec 12, 2012 11:57:03 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-12 23:57:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56665 +; + +-- Dec 12, 2012 11:57:16 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_DATE('2012-12-12 23:57:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56667 +; + +-- Dec 12, 2012 11:57:38 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-12 23:57:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56669 +; + +-- Dec 12, 2012 11:58:06 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-12 23:58:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56666 +; + +-- Dec 12, 2012 11:58:49 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, DisplayLogic='@AD_Column_ID@=0', XPosition=4,Updated=TO_DATE('2012-12-12 23:58:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201366 +; + +-- Dec 12, 2012 11:59:28 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_DATE('2012-12-12 23:59:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201367 +; + +-- Dec 12, 2012 11:59:52 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=5,Updated=TO_DATE('2012-12-12 23:59:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201365 +; + +-- Dec 13, 2012 12:00:14 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=5, NumLines=4,Updated=TO_DATE('2012-12-13 00:00:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201368 +; + +-- Dec 13, 2012 12:00:43 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET DisplayLogic='@AD_Column_ID@>0',Updated=TO_DATE('2012-12-13 00:00:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201368 +; + +-- Dec 13, 2012 12:01:30 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET DisplayLogic='@AD_Column_ID@>0',Updated=TO_DATE('2012-12-13 00:01:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201367 +; + +-- Dec 13, 2012 12:02:02 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET DisplayLogic='@IsIdentifier@=''Y"',Updated=TO_DATE('2012-12-13 00:02:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201365 +; + +-- Dec 13, 2012 12:02:24 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET DisplayLogic='@IsIdentifier@=''Y"',Updated=TO_DATE('2012-12-13 00:02:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201368 +; + +-- Dec 13, 2012 12:03:37 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET DisplayLogic='@AD_Column_ID@=0',Updated=TO_DATE('2012-12-13 00:03:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201369 +; + +-- Dec 13, 2012 12:06:07 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_DATE('2012-12-13 00:06:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56664 +; + +-- Dec 13, 2012 12:06:51 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:06:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56646 +; + +-- Dec 13, 2012 12:07:06 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_DATE('2012-12-13 00:07:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56650 +; + +-- Dec 13, 2012 12:07:37 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:07:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56651 +; + +-- Dec 13, 2012 12:07:57 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:07:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56649 +; + +-- Dec 13, 2012 12:08:15 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:08:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56653 +; + +-- Dec 13, 2012 12:08:59 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_DATE('2012-12-13 00:08:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56654 +; + +-- Dec 13, 2012 12:09:30 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=4, XPosition=1,Updated=TO_DATE('2012-12-13 00:09:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56654 +; + +-- Dec 13, 2012 12:09:41 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56652 +; + +-- Dec 13, 2012 12:10:01 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=5,Updated=TO_DATE('2012-12-13 00:10:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56648 +; + +-- Dec 13, 2012 12:10:15 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET NumLines=3,Updated=TO_DATE('2012-12-13 00:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56648 +; + +-- Dec 13, 2012 12:10:30 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=5, NumLines=3,Updated=TO_DATE('2012-12-13 00:10:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56647 +; + +-- Dec 13, 2012 12:10:43 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_DATE('2012-12-13 00:10:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56645 +; + +-- Dec 13, 2012 12:11:51 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:11:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56657 +; + +-- Dec 13, 2012 12:12:01 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_DATE('2012-12-13 00:12:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56659 +; + +-- Dec 13, 2012 12:12:14 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:12:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56663 +; + +-- Dec 13, 2012 12:12:27 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:12:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56660 +; + +-- Dec 13, 2012 12:12:36 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:12:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56661 +; + +-- Dec 13, 2012 12:12:55 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:12:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56658 +; + +-- Dec 13, 2012 12:13:09 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_DATE('2012-12-13 00:13:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56656 +; + +-- Dec 13, 2012 12:14:18 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:14:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56671 +; + +-- Dec 13, 2012 12:14:32 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_DATE('2012-12-13 00:14:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56673 +; + +-- Dec 13, 2012 12:14:42 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:14:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56675 +; + +-- Dec 13, 2012 12:14:50 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:14:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56672 +; + +-- Dec 13, 2012 12:14:58 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_DATE('2012-12-13 00:14:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56670 +; + +-- Dec 13, 2012 12:15:33 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:15:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56677 +; + +-- Dec 13, 2012 12:15:43 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_DATE('2012-12-13 00:15:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56678 +; + +-- Dec 13, 2012 12:15:54 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:15:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56681 +; + +-- Dec 13, 2012 12:16:01 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_DATE('2012-12-13 00:16:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56680 +; + +-- Dec 13, 2012 12:16:09 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_DATE('2012-12-13 00:16:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56676 +; diff --git a/org.idempiere.webservices/migration/postgresql/WS002_WebServicesDefinition.sql b/org.idempiere.webservices/migration/postgresql/WS002_WebServicesDefinition.sql index 87a7999bd0..5f91072a1f 100644 --- a/org.idempiere.webservices/migration/postgresql/WS002_WebServicesDefinition.sql +++ b/org.idempiere.webservices/migration/postgresql/WS002_WebServicesDefinition.sql @@ -1,71 +1,3 @@ -INSERT INTO WS_WebService (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,Help,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:13:25','YYYY-MM-DD HH24:MI:SS'),100,'Contributed by http://www.3e.pl/ - intended to enable work of clients like ADClient.exe','WARNING! This is disabled by default as security is not implemented yet','Y','UI Oriented Adempiere Web Services',TO_TIMESTAMP('2009-01-30 19:13:25','YYYY-MM-DD HH24:MI:SS'),100,'ADService',50000) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:13:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','getADWindow',TO_TIMESTAMP('2009-01-30 19:13:41','YYYY-MM-DD HH24:MI:SS'),100,'getADWindow',50000,50000) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:13:54','YYYY-MM-DD HH24:MI:SS'),100,'Y','getWindowTabData',TO_TIMESTAMP('2009-01-30 19:13:54','YYYY-MM-DD HH24:MI:SS'),100,'getWindowTabData',50000,50001) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:14:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','getDataRow',TO_TIMESTAMP('2009-01-30 19:14:02','YYYY-MM-DD HH24:MI:SS'),100,'getDataRow',50000,50002) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:14:08','YYYY-MM-DD HH24:MI:SS'),100,'Y','updateDataRow',TO_TIMESTAMP('2009-01-30 19:14:08','YYYY-MM-DD HH24:MI:SS'),100,'updateDataRow',50000,50003) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:14:13','YYYY-MM-DD HH24:MI:SS'),100,'Y','saveDataRow',TO_TIMESTAMP('2009-01-30 19:14:13','YYYY-MM-DD HH24:MI:SS'),100,'saveDataRow',50000,50004) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:14:19','YYYY-MM-DD HH24:MI:SS'),100,'Y','addNewDataRow',TO_TIMESTAMP('2009-01-30 19:14:19','YYYY-MM-DD HH24:MI:SS'),100,'addNewDataRow',50000,50005) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:14:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','deleteDataRow',TO_TIMESTAMP('2009-01-30 19:14:24','YYYY-MM-DD HH24:MI:SS'),100,'deleteDataRow',50000,50006) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:14:43','YYYY-MM-DD HH24:MI:SS'),100,'Y','ignoreDataRow',TO_TIMESTAMP('2009-01-30 19:14:43','YYYY-MM-DD HH24:MI:SS'),100,'ignoreDataRow',50000,50007) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:14:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','refreshDataRow',TO_TIMESTAMP('2009-01-30 19:14:51','YYYY-MM-DD HH24:MI:SS'),100,'refreshDataRow',50000,50008) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:14:57','YYYY-MM-DD HH24:MI:SS'),100,'Y','getLookupSearchData',TO_TIMESTAMP('2009-01-30 19:14:57','YYYY-MM-DD HH24:MI:SS'),100,'getLookupSearchData',50000,50009) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','getLookupData',TO_TIMESTAMP('2009-01-30 19:15:02','YYYY-MM-DD HH24:MI:SS'),100,'getLookupData',50000,50010) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','getADMenu',TO_TIMESTAMP('2009-01-30 19:15:07','YYYY-MM-DD HH24:MI:SS'),100,'getADMenu',50000,50011) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:12','YYYY-MM-DD HH24:MI:SS'),100,'Y','login',TO_TIMESTAMP('2009-01-30 19:15:12','YYYY-MM-DD HH24:MI:SS'),100,'login',50000,50012) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:17','YYYY-MM-DD HH24:MI:SS'),100,'Y','getProcessParams',TO_TIMESTAMP('2009-01-30 19:15:17','YYYY-MM-DD HH24:MI:SS'),100,'getProcessParams',50000,50013) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:22','YYYY-MM-DD HH24:MI:SS'),100,'Y','runProcess',TO_TIMESTAMP('2009-01-30 19:15:22','YYYY-MM-DD HH24:MI:SS'),100,'runProcess',50000,50014) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','saveLocation',TO_TIMESTAMP('2009-01-30 19:15:30','YYYY-MM-DD HH24:MI:SS'),100,'saveLocation',50000,50015) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:36','YYYY-MM-DD HH24:MI:SS'),100,'Y','getLocation',TO_TIMESTAMP('2009-01-30 19:15:36','YYYY-MM-DD HH24:MI:SS'),100,'getLocation',50000,50016) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','getDocAction',TO_TIMESTAMP('2009-01-30 19:15:41','YYYY-MM-DD HH24:MI:SS'),100,'getDocAction',50000,50017) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','setDocAction',TO_TIMESTAMP('2009-01-30 19:15:46','YYYY-MM-DD HH24:MI:SS'),100,'setDocAction',50000,50018) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','getVersion',TO_TIMESTAMP('2009-01-30 19:15:51','YYYY-MM-DD HH24:MI:SS'),100,'getVersion',50000,50019) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:15:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','isLoggedIn',TO_TIMESTAMP('2009-01-30 19:15:56','YYYY-MM-DD HH24:MI:SS'),100,'isLoggedIn',50000,50020) -; - -UPDATE WS_WebService SET IsActive='N',Updated=TO_TIMESTAMP('2009-01-30 19:16:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE WS_WebService_ID=50000 -; INSERT INTO WS_WebService (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,Help,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:17:43','YYYY-MM-DD HH24:MI:SS'),100,'Contributed by http://www.globalqss.com - implemented security','This web services are very generic - so it''s necessary to configure the security layer in the web services security window to make them work. You can take a look to GardenWorld samples.','Y','Model Oriented Web Services',TO_TIMESTAMP('2009-01-30 19:17:43','YYYY-MM-DD HH24:MI:SS'),100,'ModelADService',50001) ; @@ -95,49 +27,3 @@ INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Descri INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:22:50','YYYY-MM-DD HH24:MI:SS'),100,'Access records via conditions on columns - return data rows','Y','Query Data',TO_TIMESTAMP('2009-01-30 19:22:50','YYYY-MM-DD HH24:MI:SS'),100,'queryData',50001,50028) ; - -INSERT INTO WS_WebService (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:24:05','YYYY-MM-DD HH24:MI:SS'),100,'Web services needed for integration with Openbravo POS','Y','External Sales - web service',TO_TIMESTAMP('2009-01-30 19:24:05','YYYY-MM-DD HH24:MI:SS'),100,'ExternalSales',50002) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:24:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','getProductsPlusCatalog',TO_TIMESTAMP('2009-01-30 19:24:27','YYYY-MM-DD HH24:MI:SS'),100,'getProductsPlusCatalog',50002,50029) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:24:34','YYYY-MM-DD HH24:MI:SS'),100,'Y','uploadOrders',TO_TIMESTAMP('2009-01-30 19:24:34','YYYY-MM-DD HH24:MI:SS'),100,'uploadOrders',50002,50030) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:24:39','YYYY-MM-DD HH24:MI:SS'),100,'Y','getProductsCatalog',TO_TIMESTAMP('2009-01-30 19:24:39','YYYY-MM-DD HH24:MI:SS'),100,'getProductsCatalog',50002,50031) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:24:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','getOrders',TO_TIMESTAMP('2009-01-30 19:24:46','YYYY-MM-DD HH24:MI:SS'),100,'getOrders',50002,50032) -; - -UPDATE WS_WebServiceMethod SET IsActive='N',Updated=TO_TIMESTAMP('2009-01-30 19:24:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE WS_WebServiceMethod_ID=50032 -; - -INSERT INTO WS_WebService (AD_Client_ID,AD_Org_ID,Created,CreatedBy,Description,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:25:04','YYYY-MM-DD HH24:MI:SS'),100,'Web services needed for integration with Openbravo POS','Y','WebService - web service',TO_TIMESTAMP('2009-01-30 19:25:04','YYYY-MM-DD HH24:MI:SS'),100,'WebService',50003) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:25:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','getCustomers',TO_TIMESTAMP('2009-01-30 19:25:14','YYYY-MM-DD HH24:MI:SS'),100,'getCustomers',50003,50033) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:25:21','YYYY-MM-DD HH24:MI:SS'),100,'N','getCustomer',TO_TIMESTAMP('2009-01-30 19:25:21','YYYY-MM-DD HH24:MI:SS'),100,'getCustomer',50003,50034) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:25:31','YYYY-MM-DD HH24:MI:SS'),100,'N','updateCustomer',TO_TIMESTAMP('2009-01-30 19:25:31','YYYY-MM-DD HH24:MI:SS'),100,'updateCustomer',50003,50035) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:25:38','YYYY-MM-DD HH24:MI:SS'),100,'N','getCustomerAddresses',TO_TIMESTAMP('2009-01-30 19:25:38','YYYY-MM-DD HH24:MI:SS'),100,'getCustomerAddresses',50003,50036) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:25:44','YYYY-MM-DD HH24:MI:SS'),100,'N','getCustomerLocation',TO_TIMESTAMP('2009-01-30 19:25:44','YYYY-MM-DD HH24:MI:SS'),100,'getCustomerLocation',50003,50037) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:25:51','YYYY-MM-DD HH24:MI:SS'),100,'N','updateAddress',TO_TIMESTAMP('2009-01-30 19:25:51','YYYY-MM-DD HH24:MI:SS'),100,'updateAddress',50003,50038) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:25:58','YYYY-MM-DD HH24:MI:SS'),100,'N','getCustomerContact',TO_TIMESTAMP('2009-01-30 19:25:58','YYYY-MM-DD HH24:MI:SS'),100,'getCustomerContact',50003,50039) -; - -INSERT INTO WS_WebServiceMethod (AD_Client_ID,AD_Org_ID,Created,CreatedBy,IsActive,Name,Updated,UpdatedBy,Value,WS_WebService_ID,WS_WebServiceMethod_ID) VALUES (0,0,TO_TIMESTAMP('2009-01-30 19:26:07','YYYY-MM-DD HH24:MI:SS'),100,'N','updateContact',TO_TIMESTAMP('2009-01-30 19:26:07','YYYY-MM-DD HH24:MI:SS'),100,'updateContact',50003,50040) -; - diff --git a/org.idempiere.webservices/migration/postgresql/WS005_IdempiereWebservice.sql b/org.idempiere.webservices/migration/postgresql/WS005_IdempiereWebservice.sql new file mode 100644 index 0000000000..41b0cc3792 --- /dev/null +++ b/org.idempiere.webservices/migration/postgresql/WS005_IdempiereWebservice.sql @@ -0,0 +1,617 @@ + +-- Dec 12, 2012 8:54:30 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Column SET SeqNoSelection=2, IsSelectionColumn='Y', IsToolbarButton='N',Updated=TO_TIMESTAMP('2012-12-12 20:54:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56727 +; + +-- Dec 12, 2012 8:54:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Column SET SeqNoSelection=1, IsSelectionColumn='Y', IsToolbarButton='N',Updated=TO_TIMESTAMP('2012-12-12 20:54:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56730 +; + +-- Dec 12, 2012 9:27:55 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,AD_Reference_Value_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202041,'D',1,'N','N','N',0,'N',10,'N',18,'N',120,'N','Y','c3d437e8-e10d-4d1b-87e6-68eb5ab4c9ea','Y','AD_Reference_ID','System Reference and Validation','The Reference could be a display type, list or table validation.','Reference','Y',100,TO_TIMESTAMP('2012-12-12 21:27:54','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-12-12 21:27:54','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 9:27:55 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202041 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 9:28:03 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD COLUMN AD_Reference_ID NUMERIC(10) DEFAULT NULL +; + +-- Dec 12, 2012 9:29:30 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202042,'D','N','N','N',0,'N',30,'Y',10,'N',228,'N','Y','30db973a-b039-437e-b55a-c9ca1e9d7378','Y','ColumnName','Name of the column in the database','The Column Name indicates the name of a column on a table as defined in the database.','DB Column Name','Y',100,TO_TIMESTAMP('2012-12-12 21:29:30','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-12-12 21:29:30','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 9:29:30 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202042 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 9:29:38 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD COLUMN ColumnName VARCHAR(30) DEFAULT NULL +; + +-- Dec 12, 2012 9:31:07 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IdentifierLogic',200592,'D','Identifier Logic','Identifier Logic','d5470526-d7b3-41fb-9ee7-35190020169c',0,TO_TIMESTAMP('2012-12-12 21:31:06','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-12-12 21:31:06','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 9:31:08 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200592 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 9:32:26 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202043,'D','N','N','N',0,'N',2000,'N',14,'N',200592,'N','Y','bdf425b5-7c59-42d4-bb59-56c9800e8325','Y','IdentifierLogic','Identifier Logic','Y',100,TO_TIMESTAMP('2012-12-12 21:32:25','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-12-12 21:32:25','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 9:32:26 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202043 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 9:32:51 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD COLUMN IdentifierLogic VARCHAR(2000) DEFAULT NULL +; + +-- Dec 12, 2012 9:33:11 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2012-12-12 21:33:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202042 +; + +-- Dec 12, 2012 9:33:22 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2012-12-12 21:33:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202041 +; + +-- Dec 12, 2012 9:36:10 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Help,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202044,'D','N','N','N',0,'N',1,'N',20,'N',382,'N','Y','f0baaca8-7437-4a9d-a02d-26827b0b54b2','Y','IsIdentifier','This column is part of the record identifier','N','The Identifier checkbox indicates that this column is part of the identifier or key for this table. ','Identifier','Y',100,TO_TIMESTAMP('2012-12-12 21:36:09','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-12-12 21:36:09','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 9:36:10 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202044 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 9:36:22 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD COLUMN IsIdentifier CHAR(1) DEFAULT 'N' CHECK (IsIdentifier IN ('Y','N')) +; + +-- Dec 12, 2012 9:36:34 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO t_alter_column values('ws_webservicefieldinput','IdentifierLogic','VARCHAR(2000)',null,'NULL') +; + +-- Dec 12, 2012 9:37:50 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Description,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsNullIdentifier',200593,'D','Should allow null value for identifiere field','Allow Null Value','Allow Null Value','a704f515-b9a7-4e90-8d44-d7e16e0f5d8c',0,TO_TIMESTAMP('2012-12-12 21:37:49','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-12-12 21:37:49','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 9:37:50 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200593 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 9:39:48 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202045,'D','N','N','N',0,'N',1,'N',20,'N',200593,'N','Y','9cc0e2b6-8bc2-4541-86ad-63513f027011','Y','IsNullIdentifier','Should allow null value for identifiere field','N','Allow Null Value','Y',100,TO_TIMESTAMP('2012-12-12 21:39:47','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-12-12 21:39:47','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 9:39:48 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202045 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 9:39:53 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD COLUMN IsNullIdentifier CHAR(1) DEFAULT 'N' CHECK (IsNullIdentifier IN ('Y','N')) +; + +-- Dec 12, 2012 9:40:15 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO t_alter_column values('ws_webservicefieldinput','IsIdentifier','CHAR(1)',null,'N') +; + + + +-- Dec 12, 2012 10:36:44 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('WS_WebServiceType_UU',200594,'D','WS_WebServiceType_UU','WS_WebServiceType_UU','1be8e032-ddc3-489c-8c3d-9a4416968d32',0,TO_TIMESTAMP('2012-12-12 22:36:43','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-12-12 22:36:43','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 10:36:44 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200594 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 10:37:11 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53164,202046,'D','N','N','N',0,'N',36,'N',10,'N',200594,'N','Y','0d88f8d9-25c1-4507-a495-b7ba84378e86','Y','WS_WebServiceType_UU','WS_WebServiceType_UU','N',100,TO_TIMESTAMP('2012-12-12 22:37:11','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-12-12 22:37:11','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 10:37:11 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202046 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 10:37:33 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceType ADD COLUMN WS_WebServiceType_UU VARCHAR(36) DEFAULT NULL +; + +-- Dec 12, 2012 10:38:46 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('WS_WebService_Para_UU',200595,'D','WS_WebService_Para_UU','WS_WebService_Para_UU','2f690372-900f-457e-8ef7-d1b04496fa5c',0,TO_TIMESTAMP('2012-12-12 22:38:45','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-12-12 22:38:45','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 10:38:46 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200595 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 10:39:14 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53165,202047,'D','N','N','N',0,'N',36,'N',10,'N',200595,'N','Y','90cb04b7-7f82-4866-97f6-c8ff0da18c8b','Y','WS_WebService_Para_UU','WS_WebService_Para_UU','N',100,TO_TIMESTAMP('2012-12-12 22:39:13','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-12-12 22:39:13','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 10:39:14 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202047 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 10:39:21 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebService_Para ADD COLUMN WS_WebService_Para_UU VARCHAR(36) DEFAULT NULL +; + +-- Dec 12, 2012 10:40:21 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('WS_WebServiceFieldInput_UU',200596,'D','WS_WebServiceFieldInput_UU','WS_WebServiceFieldInput_UU','b835e570-ab79-4d64-8b4c-2d1ee688e783',0,TO_TIMESTAMP('2012-12-12 22:40:21','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-12-12 22:40:21','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 10:40:21 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200596 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 10:40:43 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53166,202048,'D','N','N','N',0,'N',36,'N',10,'N',200596,'N','Y','2f2437aa-cd9c-4fcb-972b-ed1e3393d108','Y','WS_WebServiceFieldInput_UU','WS_WebServiceFieldInput_UU','N',100,TO_TIMESTAMP('2012-12-12 22:40:42','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-12-12 22:40:42','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 10:40:43 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202048 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 10:40:47 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldInput ADD COLUMN WS_WebServiceFieldInput_UU VARCHAR(36) DEFAULT NULL +; + +-- Dec 12, 2012 10:41:43 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('WS_WebServiceFieldOutput_UU',200597,'D','WS_WebServiceFieldOutput_UU','WS_WebServiceFieldOutput_UU','bcdfaa22-d87c-4df5-935b-d8f5339d4f51',0,TO_TIMESTAMP('2012-12-12 22:41:42','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-12-12 22:41:42','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 10:41:43 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200597 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 10:42:01 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53167,202049,'D','N','N','N',0,'N',36,'N',10,'N',200597,'N','Y','0617cbde-f858-4138-aaa4-fca99bc30988','Y','WS_WebServiceFieldOutput_UU','WS_WebServiceFieldOutput_UU','N',100,TO_TIMESTAMP('2012-12-12 22:42:01','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-12-12 22:42:01','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 10:42:01 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202049 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 10:42:06 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceFieldOutput ADD COLUMN WS_WebServiceFieldOutput_UU VARCHAR(36) DEFAULT NULL +; + +-- Dec 12, 2012 10:43:48 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('WS_WebServiceTypeAccess_UU',200598,'D','WS_WebServiceTypeAccess_UU','WS_WebServiceTypeAccess_UU','32df84f5-c650-425a-b9a8-eca3ed2a6209',0,TO_TIMESTAMP('2012-12-12 22:43:47','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-12-12 22:43:47','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Dec 12, 2012 10:43:48 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Description,Name,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Description,t.Name,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200598 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 12, 2012 10:44:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,IsEncrypted,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable) VALUES (0,'N','N',0,53168,202050,'D','N','N','N',0,'N',36,'N',10,'N',200598,'N','Y','43bdb652-1a55-4bd5-affd-b55841f1a1ec','Y','WS_WebServiceTypeAccess_UU','WS_WebServiceTypeAccess_UU','N',100,TO_TIMESTAMP('2012-12-12 22:44:37','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-12-12 22:44:37','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N') +; + +-- Dec 12, 2012 10:44:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=202050 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Dec 12, 2012 10:44:46 PM IST +-- IDEMPIERE-460 Adding support for composite service +ALTER TABLE WS_WebServiceTypeAccess ADD COLUMN WS_WebServiceTypeAccess_UU VARCHAR(36) DEFAULT NULL +; + + + + + +-- Dec 12, 2012 11:49:01 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Column SET MandatoryLogic='@AD_Column_ID@=0',Updated=TO_TIMESTAMP('2012-12-12 23:49:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202041 +; + +-- Dec 12, 2012 11:54:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,1,'N','N',202045,'Y',201365,'N','D','Should allow null value for identifiere field','Allow Null Value','N','Y','678c6e86-9e5f-49d6-819b-bd08b0946f17',100,0,TO_TIMESTAMP('2012-12-12 23:54:36','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-12-12 23:54:36','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201365 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:54:38 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,30,'N','N',202042,'Y',201366,'N','The Column Name indicates the name of a column on a table as defined in the database.','D','Name of the column in the database','DB Column Name','N','Y','24b12b95-27eb-4303-a550-46402b4a44cb',100,0,TO_TIMESTAMP('2012-12-12 23:54:37','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-12-12 23:54:37','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:38 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201366 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:54:39 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,1,'N','N',202044,'Y',201367,'N','The Identifier checkbox indicates that this column is part of the identifier or key for this table. ','D','This column is part of the record identifier','Identifier','N','Y','5551bd5f-7bde-42f0-88ac-4ccd099ace7a',100,0,TO_TIMESTAMP('2012-12-12 23:54:38','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-12-12 23:54:38','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:39 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201367 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:54:40 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,2000,'N','N',202043,'Y',201368,'N','D','Identifier Logic','N','Y','67a1f8e7-44d4-4254-94b8-950a64f331f4',100,0,TO_TIMESTAMP('2012-12-12 23:54:39','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-12-12 23:54:39','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:40 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201368 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:54:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,Help,EntityType,Description,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,10,'N','N',202041,'Y',201369,'N','The Reference could be a display type, list or table validation.','D','System Reference and Validation','Reference','N','Y','837295cd-2ecc-429d-ad18-dba6dadd7c91',100,0,TO_TIMESTAMP('2012-12-12 23:54:40','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-12-12 23:54:40','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201369 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:54:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field (IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Name,IsFieldOnly,IsDisplayed,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive) VALUES ('N',53189,36,'N','N',202048,'Y',201370,'N','D','WS_WebServiceFieldInput_UU','N','Y','3ae46bba-2a92-4c9e-849c-98a716ec16fe',100,0,TO_TIMESTAMP('2012-12-12 23:54:41','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2012-12-12 23:54:41','YYYY-MM-DD HH24:MI:SS'),'Y') +; + +-- Dec 12, 2012 11:54:41 PM IST +-- IDEMPIERE-460 Adding support for composite service +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201370 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) +; + +-- Dec 12, 2012 11:55:36 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=201370 +; + +-- Dec 12, 2012 11:55:36 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=201366 +; + +-- Dec 12, 2012 11:55:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=201367 +; + +-- Dec 12, 2012 11:55:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=201365 +; + +-- Dec 12, 2012 11:55:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=201368 +; + +-- Dec 12, 2012 11:55:37 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=201369 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=201370 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=0,IsDisplayedGrid='N' WHERE AD_Field_ID=56668 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=10,IsDisplayedGrid='Y' WHERE AD_Field_ID=56669 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=20,IsDisplayedGrid='Y' WHERE AD_Field_ID=56666 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=30,IsDisplayedGrid='Y' WHERE AD_Field_ID=201366 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=40,IsDisplayedGrid='Y' WHERE AD_Field_ID=201365 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=50,IsDisplayedGrid='Y' WHERE AD_Field_ID=201367 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=60,IsDisplayedGrid='Y' WHERE AD_Field_ID=201368 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=70,IsDisplayedGrid='Y' WHERE AD_Field_ID=201369 +; + +-- Dec 12, 2012 11:56:27 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET SeqNoGrid=80,IsDisplayedGrid='Y' WHERE AD_Field_ID=56667 +; + +-- Dec 12, 2012 11:57:03 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-12 23:57:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56665 +; + +-- Dec 12, 2012 11:57:16 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_TIMESTAMP('2012-12-12 23:57:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56667 +; + +-- Dec 12, 2012 11:57:38 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-12 23:57:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56669 +; + +-- Dec 12, 2012 11:58:06 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-12 23:58:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56666 +; + +-- Dec 12, 2012 11:58:49 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, DisplayLogic='@AD_Column_ID@=0', XPosition=4,Updated=TO_TIMESTAMP('2012-12-12 23:58:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201366 +; + +-- Dec 12, 2012 11:59:28 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_TIMESTAMP('2012-12-12 23:59:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201367 +; + +-- Dec 12, 2012 11:59:52 PM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=5,Updated=TO_TIMESTAMP('2012-12-12 23:59:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201365 +; + +-- Dec 13, 2012 12:00:14 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=5, NumLines=4,Updated=TO_TIMESTAMP('2012-12-13 00:00:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201368 +; + +-- Dec 13, 2012 12:00:43 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET DisplayLogic='@AD_Column_ID@>0',Updated=TO_TIMESTAMP('2012-12-13 00:00:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201368 +; + +-- Dec 13, 2012 12:01:30 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET DisplayLogic='@AD_Column_ID@>0',Updated=TO_TIMESTAMP('2012-12-13 00:01:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201367 +; + +-- Dec 13, 2012 12:02:02 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET DisplayLogic='@IsIdentifier@=''Y"',Updated=TO_TIMESTAMP('2012-12-13 00:02:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201365 +; + +-- Dec 13, 2012 12:02:24 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET DisplayLogic='@IsIdentifier@=''Y"',Updated=TO_TIMESTAMP('2012-12-13 00:02:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201368 +; + +-- Dec 13, 2012 12:03:37 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET DisplayLogic='@AD_Column_ID@=0',Updated=TO_TIMESTAMP('2012-12-13 00:03:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201369 +; + +-- Dec 13, 2012 12:06:07 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_TIMESTAMP('2012-12-13 00:06:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56664 +; + +-- Dec 13, 2012 12:06:51 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:06:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56646 +; + +-- Dec 13, 2012 12:07:06 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_TIMESTAMP('2012-12-13 00:07:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56650 +; + +-- Dec 13, 2012 12:07:37 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:07:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56651 +; + +-- Dec 13, 2012 12:07:57 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:07:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56649 +; + +-- Dec 13, 2012 12:08:15 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:08:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56653 +; + +-- Dec 13, 2012 12:08:59 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_TIMESTAMP('2012-12-13 00:08:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56654 +; + +-- Dec 13, 2012 12:09:30 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=4, XPosition=1,Updated=TO_TIMESTAMP('2012-12-13 00:09:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56654 +; + +-- Dec 13, 2012 12:09:41 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56652 +; + +-- Dec 13, 2012 12:10:01 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=5,Updated=TO_TIMESTAMP('2012-12-13 00:10:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56648 +; + +-- Dec 13, 2012 12:10:15 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET NumLines=3,Updated=TO_TIMESTAMP('2012-12-13 00:10:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56648 +; + +-- Dec 13, 2012 12:10:30 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=5, NumLines=3,Updated=TO_TIMESTAMP('2012-12-13 00:10:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56647 +; + +-- Dec 13, 2012 12:10:43 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_TIMESTAMP('2012-12-13 00:10:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56645 +; + +-- Dec 13, 2012 12:11:51 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:11:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56657 +; + +-- Dec 13, 2012 12:12:01 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_TIMESTAMP('2012-12-13 00:12:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56659 +; + +-- Dec 13, 2012 12:12:14 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:12:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56663 +; + +-- Dec 13, 2012 12:12:27 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:12:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56660 +; + +-- Dec 13, 2012 12:12:36 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:12:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56661 +; + +-- Dec 13, 2012 12:12:55 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:12:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56658 +; + +-- Dec 13, 2012 12:13:09 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_TIMESTAMP('2012-12-13 00:13:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56656 +; + +-- Dec 13, 2012 12:14:18 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:14:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56671 +; + +-- Dec 13, 2012 12:14:32 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_TIMESTAMP('2012-12-13 00:14:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56673 +; + +-- Dec 13, 2012 12:14:42 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:14:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56675 +; + +-- Dec 13, 2012 12:14:50 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:14:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56672 +; + +-- Dec 13, 2012 12:14:58 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_TIMESTAMP('2012-12-13 00:14:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56670 +; + +-- Dec 13, 2012 12:15:33 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:15:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56677 +; + +-- Dec 13, 2012 12:15:43 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2, XPosition=4,Updated=TO_TIMESTAMP('2012-12-13 00:15:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56678 +; + +-- Dec 13, 2012 12:15:54 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:15:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56681 +; + +-- Dec 13, 2012 12:16:01 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET ColumnSpan=2,Updated=TO_TIMESTAMP('2012-12-13 00:16:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56680 +; + +-- Dec 13, 2012 12:16:09 AM IST +-- IDEMPIERE-460 Adding support for composite service +UPDATE AD_Field SET XPosition=2,Updated=TO_TIMESTAMP('2012-12-13 00:16:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56676 +; + diff --git a/org.idempiere.webservices/plugin.xml b/org.idempiere.webservices/plugin.xml new file mode 100644 index 0000000000..7f3a855af1 --- /dev/null +++ b/org.idempiere.webservices/plugin.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/org.idempiere.webservices/schema/IWSValidator.exsd b/org.idempiere.webservices/schema/IWSValidator.exsd new file mode 100644 index 0000000000..b0b2b31fd5 --- /dev/null +++ b/org.idempiere.webservices/schema/IWSValidator.exsd @@ -0,0 +1,116 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + +