From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../camelprototypewsclient/.classpath | 23 +++ .../camelprototypewsclient/.project | 30 ++++ .../.settings/org.eclipse.core.resources.prefs | 9 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../.settings/org.eclipse.wst.common.component | 6 + .../org.eclipse.wst.common.project.facet.core.xml | 8 + .../camelprototypewsclient/lib/forms-1.1.0.jar | Bin 0 -> 88620 bytes .../src/META-INF/MANIFEST.MF | 3 + .../dsi/ws0910/camelprototype/InputNewOrder.java | 172 +++++++++++++++++++ .../dsi/ws0910/camelprototype/OrderEndpoint.java | 12 ++ .../ws0910/camelprototype/OrderEndpointProxy.java | 54 ++++++ .../camelprototype/OrderEndpointService.java | 16 ++ .../OrderEndpointServiceLocator.java | 142 ++++++++++++++++ .../dsi/ws0910/camelprototype/OrderPosition.java | 187 ++++++++++++++++++++ .../camelprototype/OrderServiceBindingStub.java | 189 +++++++++++++++++++++ .../dsi/ws0910/camelprototype/OutputNewOrder.java | 155 +++++++++++++++++ .../src/main/CamelPrototypeWsClient.java | 30 ++++ .../src/main/OrderPosAmountEditor.java | 33 ++++ .../src/main/OrderPosEditor.java | 27 +++ .../src/main/OrderPosInputVerifier.java | 23 +++ .../src/main/OrderPosTableModel.java | 110 ++++++++++++ .../src/main/WsClientMainFrame.java | 187 ++++++++++++++++++++ 22 files changed, 1423 insertions(+) create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/.classpath create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/.project create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.core.resources.prefs create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.jdt.core.prefs create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.wst.common.component create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/lib/forms-1.1.0.jar create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/META-INF/MANIFEST.MF create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/InputNewOrder.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpoint.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointProxy.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointService.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointServiceLocator.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderPosition.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderServiceBindingStub.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OutputNewOrder.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/main/CamelPrototypeWsClient.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosAmountEditor.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosEditor.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosInputVerifier.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosTableModel.java create mode 100644 Master/Daten- und Systemintegration/camelprototypewsclient/src/main/WsClientMainFrame.java (limited to 'Master/Daten- und Systemintegration/camelprototypewsclient') diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/.classpath b/Master/Daten- und Systemintegration/camelprototypewsclient/.classpath new file mode 100644 index 0000000..7fccba7 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/.classpath @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/.project b/Master/Daten- und Systemintegration/camelprototypewsclient/.project new file mode 100644 index 0000000..35c61b5 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/.project @@ -0,0 +1,30 @@ + + + camelprototypewsclient + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + + diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.core.resources.prefs b/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..22679b8 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,9 @@ +#Wed Dec 16 12:16:03 CET 2009 +eclipse.preferences.version=1 +encoding//src/de/h_da/fbi/dsi/ws0910/camelprototype/InputNewOrder.java=UTF-8 +encoding//src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpoint.java=UTF-8 +encoding//src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointService.java=UTF-8 +encoding//src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointServiceLocator.java=UTF-8 +encoding//src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderPosition.java=UTF-8 +encoding//src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderServiceBindingStub.java=UTF-8 +encoding//src/de/h_da/fbi/dsi/ws0910/camelprototype/OutputNewOrder.java=UTF-8 diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.jdt.core.prefs b/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..ed5e434 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +#Wed Dec 16 12:15:56 CET 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.wst.common.component b/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..e4b1db6 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.wst.common.component @@ -0,0 +1,6 @@ + + + + + + diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.wst.common.project.facet.core.xml b/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..93eab18 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/lib/forms-1.1.0.jar b/Master/Daten- und Systemintegration/camelprototypewsclient/lib/forms-1.1.0.jar new file mode 100644 index 0000000..50c1eb8 Binary files /dev/null and b/Master/Daten- und Systemintegration/camelprototypewsclient/lib/forms-1.1.0.jar differ diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/META-INF/MANIFEST.MF b/Master/Daten- und Systemintegration/camelprototypewsclient/src/META-INF/MANIFEST.MF new file mode 100644 index 0000000..5e94951 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/InputNewOrder.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/InputNewOrder.java new file mode 100644 index 0000000..339e9e8 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/InputNewOrder.java @@ -0,0 +1,172 @@ +/** + * InputNewOrder.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package de.h_da.fbi.dsi.ws0910.camelprototype; + +public class InputNewOrder implements java.io.Serializable { + private java.lang.String customerNo; + + private de.h_da.fbi.dsi.ws0910.camelprototype.OrderPosition[] orderpositions; + + public InputNewOrder() { + } + + public InputNewOrder( + java.lang.String customerNo, + de.h_da.fbi.dsi.ws0910.camelprototype.OrderPosition[] orderpositions) { + this.customerNo = customerNo; + this.orderpositions = orderpositions; + } + + + /** + * Gets the customerNo value for this InputNewOrder. + * + * @return customerNo + */ + public java.lang.String getCustomerNo() { + return customerNo; + } + + + /** + * Sets the customerNo value for this InputNewOrder. + * + * @param customerNo + */ + public void setCustomerNo(java.lang.String customerNo) { + this.customerNo = customerNo; + } + + + /** + * Gets the orderpositions value for this InputNewOrder. + * + * @return orderpositions + */ + public de.h_da.fbi.dsi.ws0910.camelprototype.OrderPosition[] getOrderpositions() { + return orderpositions; + } + + + /** + * Sets the orderpositions value for this InputNewOrder. + * + * @param orderpositions + */ + public void setOrderpositions(de.h_da.fbi.dsi.ws0910.camelprototype.OrderPosition[] orderpositions) { + this.orderpositions = orderpositions; + } + + public de.h_da.fbi.dsi.ws0910.camelprototype.OrderPosition getOrderpositions(int i) { + return this.orderpositions[i]; + } + + public void setOrderpositions(int i, de.h_da.fbi.dsi.ws0910.camelprototype.OrderPosition _value) { + this.orderpositions[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof InputNewOrder)) return false; + InputNewOrder other = (InputNewOrder) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.customerNo==null && other.getCustomerNo()==null) || + (this.customerNo!=null && + this.customerNo.equals(other.getCustomerNo()))) && + ((this.orderpositions==null && other.getOrderpositions()==null) || + (this.orderpositions!=null && + java.util.Arrays.equals(this.orderpositions, other.getOrderpositions()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getCustomerNo() != null) { + _hashCode += getCustomerNo().hashCode(); + } + if (getOrderpositions() != null) { + for (int i=0; + iinputNewOrder")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("customerNo"); + elemField.setXmlName(new javax.xml.namespace.QName("", "customerNo")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("orderpositions"); + elemField.setXmlName(new javax.xml.namespace.QName("", "orderpositions")); + elemField.setXmlType(new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", "orderPosition")); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpoint.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpoint.java new file mode 100644 index 0000000..38998d0 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpoint.java @@ -0,0 +1,12 @@ +/** + * OrderEndpoint.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package de.h_da.fbi.dsi.ws0910.camelprototype; + +public interface OrderEndpoint extends java.rmi.Remote { + public de.h_da.fbi.dsi.ws0910.camelprototype.OutputNewOrder createOrder(de.h_da.fbi.dsi.ws0910.camelprototype.InputNewOrder in) throws java.rmi.RemoteException; +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointProxy.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointProxy.java new file mode 100644 index 0000000..730f044 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointProxy.java @@ -0,0 +1,54 @@ +package de.h_da.fbi.dsi.ws0910.camelprototype; + +public class OrderEndpointProxy implements de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint { + private String _endpoint = null; + private de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint orderEndpoint = null; + + public OrderEndpointProxy() { + _initOrderEndpointProxy(); + } + + public OrderEndpointProxy(String endpoint) { + _endpoint = endpoint; + _initOrderEndpointProxy(); + } + + private void _initOrderEndpointProxy() { + try { + orderEndpoint = (new de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpointServiceLocator()).getOrderService(); + if (orderEndpoint != null) { + if (_endpoint != null) + ((javax.xml.rpc.Stub)orderEndpoint)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); + else + _endpoint = (String)((javax.xml.rpc.Stub)orderEndpoint)._getProperty("javax.xml.rpc.service.endpoint.address"); + } + + } + catch (javax.xml.rpc.ServiceException serviceException) {} + } + + public String getEndpoint() { + return _endpoint; + } + + public void setEndpoint(String endpoint) { + _endpoint = endpoint; + if (orderEndpoint != null) + ((javax.xml.rpc.Stub)orderEndpoint)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); + + } + + public de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint getOrderEndpoint() { + if (orderEndpoint == null) + _initOrderEndpointProxy(); + return orderEndpoint; + } + + public de.h_da.fbi.dsi.ws0910.camelprototype.OutputNewOrder createOrder(de.h_da.fbi.dsi.ws0910.camelprototype.InputNewOrder in) throws java.rmi.RemoteException{ + if (orderEndpoint == null) + _initOrderEndpointProxy(); + return orderEndpoint.createOrder(in); + } + + +} \ No newline at end of file diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointService.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointService.java new file mode 100644 index 0000000..e18dcf8 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointService.java @@ -0,0 +1,16 @@ +/** + * OrderEndpointService.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package de.h_da.fbi.dsi.ws0910.camelprototype; + +public interface OrderEndpointService extends javax.xml.rpc.Service { + public java.lang.String getOrderServiceAddress(); + + public de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint getOrderService() throws javax.xml.rpc.ServiceException; + + public de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint getOrderService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointServiceLocator.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointServiceLocator.java new file mode 100644 index 0000000..f1f6810 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderEndpointServiceLocator.java @@ -0,0 +1,142 @@ +/** + * OrderEndpointServiceLocator.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package de.h_da.fbi.dsi.ws0910.camelprototype; + +public class OrderEndpointServiceLocator extends org.apache.axis.client.Service implements de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpointService { + + public OrderEndpointServiceLocator() { + } + + + public OrderEndpointServiceLocator(org.apache.axis.EngineConfiguration config) { + super(config); + } + + public OrderEndpointServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { + super(wsdlLoc, sName); + } + + // Use to get a proxy class for OrderService + private java.lang.String OrderService_address = "http://localhost:8080/camelprototype/webservices/order"; + + public java.lang.String getOrderServiceAddress() { + return OrderService_address; + } + + // The WSDD service name defaults to the port name. + private java.lang.String OrderServiceWSDDServiceName = "OrderService"; + + public java.lang.String getOrderServiceWSDDServiceName() { + return OrderServiceWSDDServiceName; + } + + public void setOrderServiceWSDDServiceName(java.lang.String name) { + OrderServiceWSDDServiceName = name; + } + + public de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint getOrderService() throws javax.xml.rpc.ServiceException { + java.net.URL endpoint; + try { + endpoint = new java.net.URL(OrderService_address); + } + catch (java.net.MalformedURLException e) { + throw new javax.xml.rpc.ServiceException(e); + } + return getOrderService(endpoint); + } + + public de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint getOrderService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { + try { + de.h_da.fbi.dsi.ws0910.camelprototype.OrderServiceBindingStub _stub = new de.h_da.fbi.dsi.ws0910.camelprototype.OrderServiceBindingStub(portAddress, this); + _stub.setPortName(getOrderServiceWSDDServiceName()); + return _stub; + } + catch (org.apache.axis.AxisFault e) { + return null; + } + } + + public void setOrderServiceEndpointAddress(java.lang.String address) { + OrderService_address = address; + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + try { + if (de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint.class.isAssignableFrom(serviceEndpointInterface)) { + de.h_da.fbi.dsi.ws0910.camelprototype.OrderServiceBindingStub _stub = new de.h_da.fbi.dsi.ws0910.camelprototype.OrderServiceBindingStub(new java.net.URL(OrderService_address), this); + _stub.setPortName(getOrderServiceWSDDServiceName()); + return _stub; + } + } + catch (java.lang.Throwable t) { + throw new javax.xml.rpc.ServiceException(t); + } + throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + if (portName == null) { + return getPort(serviceEndpointInterface); + } + java.lang.String inputPortName = portName.getLocalPart(); + if ("OrderService".equals(inputPortName)) { + return getOrderService(); + } + else { + java.rmi.Remote _stub = getPort(serviceEndpointInterface); + ((org.apache.axis.client.Stub) _stub).setPortName(portName); + return _stub; + } + } + + public javax.xml.namespace.QName getServiceName() { + return new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", "OrderEndpointService"); + } + + private java.util.HashSet ports = null; + + public java.util.Iterator getPorts() { + if (ports == null) { + ports = new java.util.HashSet(); + ports.add(new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", "OrderService")); + } + return ports.iterator(); + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + +if ("OrderService".equals(portName)) { + setOrderServiceEndpointAddress(address); + } + else +{ // Unknown Port Name + throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); + } + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + setEndpointAddress(portName.getLocalPart(), address); + } + +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderPosition.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderPosition.java new file mode 100644 index 0000000..bb71d1e --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderPosition.java @@ -0,0 +1,187 @@ +/** + * OrderPosition.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package de.h_da.fbi.dsi.ws0910.camelprototype; + +public class OrderPosition implements java.io.Serializable { + private java.lang.String article; + + private int amount; + + private java.lang.String articleNo; + + public OrderPosition() { + } + + public OrderPosition( + java.lang.String article, + int amount, + java.lang.String articleNo) { + this.article = article; + this.amount = amount; + this.articleNo = articleNo; + } + + + /** + * Gets the article value for this OrderPosition. + * + * @return article + */ + public java.lang.String getArticle() { + return article; + } + + + /** + * Sets the article value for this OrderPosition. + * + * @param article + */ + public void setArticle(java.lang.String article) { + this.article = article; + } + + + /** + * Gets the amount value for this OrderPosition. + * + * @return amount + */ + public int getAmount() { + return amount; + } + + + /** + * Sets the amount value for this OrderPosition. + * + * @param amount + */ + public void setAmount(int amount) { + this.amount = amount; + } + + + /** + * Gets the articleNo value for this OrderPosition. + * + * @return articleNo + */ + public java.lang.String getArticleNo() { + return articleNo; + } + + + /** + * Sets the articleNo value for this OrderPosition. + * + * @param articleNo + */ + public void setArticleNo(java.lang.String articleNo) { + this.articleNo = articleNo; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof OrderPosition)) return false; + OrderPosition other = (OrderPosition) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.article==null && other.getArticle()==null) || + (this.article!=null && + this.article.equals(other.getArticle()))) && + this.amount == other.getAmount() && + ((this.articleNo==null && other.getArticleNo()==null) || + (this.articleNo!=null && + this.articleNo.equals(other.getArticleNo()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getArticle() != null) { + _hashCode += getArticle().hashCode(); + } + _hashCode += getAmount(); + if (getArticleNo() != null) { + _hashCode += getArticleNo().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(OrderPosition.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", "orderPosition")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("article"); + elemField.setXmlName(new javax.xml.namespace.QName("", "article")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("amount"); + elemField.setXmlName(new javax.xml.namespace.QName("", "amount")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("articleNo"); + elemField.setXmlName(new javax.xml.namespace.QName("", "articleNo")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderServiceBindingStub.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderServiceBindingStub.java new file mode 100644 index 0000000..561dfa7 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OrderServiceBindingStub.java @@ -0,0 +1,189 @@ +/** + * OrderServiceBindingStub.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package de.h_da.fbi.dsi.ws0910.camelprototype; + +public class OrderServiceBindingStub extends org.apache.axis.client.Stub implements de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint { + private java.util.Vector cachedSerClasses = new java.util.Vector(); + private java.util.Vector cachedSerQNames = new java.util.Vector(); + private java.util.Vector cachedSerFactories = new java.util.Vector(); + private java.util.Vector cachedDeserFactories = new java.util.Vector(); + + static org.apache.axis.description.OperationDesc [] _operations; + + static { + _operations = new org.apache.axis.description.OperationDesc[1]; + _initOperationDesc1(); + } + + private static void _initOperationDesc1(){ + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("CreateOrder"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", "inputNewOrder"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", ">inputNewOrder"), de.h_da.fbi.dsi.ws0910.camelprototype.InputNewOrder.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", ">outputNewOrder")); + oper.setReturnClass(de.h_da.fbi.dsi.ws0910.camelprototype.OutputNewOrder.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", "outputNewOrder")); + oper.setStyle(org.apache.axis.constants.Style.DOCUMENT); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + _operations[0] = oper; + + } + + public OrderServiceBindingStub() throws org.apache.axis.AxisFault { + this(null); + } + + public OrderServiceBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + this(service); + super.cachedEndpoint = endpointURL; + } + + public OrderServiceBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + if (service == null) { + super.service = new org.apache.axis.client.Service(); + } else { + super.service = service; + } + ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); + java.lang.Class cls; + javax.xml.namespace.QName qName; + javax.xml.namespace.QName qName2; + java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; + java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; + java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; + java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; + java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; + java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; + java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; + java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; + java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; + java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; + qName = new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", ">inputNewOrder"); + cachedSerQNames.add(qName); + cls = de.h_da.fbi.dsi.ws0910.camelprototype.InputNewOrder.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", ">outputNewOrder"); + cachedSerQNames.add(qName); + cls = de.h_da.fbi.dsi.ws0910.camelprototype.OutputNewOrder.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", "orderPosition"); + cachedSerQNames.add(qName); + cls = de.h_da.fbi.dsi.ws0910.camelprototype.OrderPosition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + } + + protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Object x = cachedSerFactories.get(i); + if (x instanceof Class) { + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { + org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) + cachedSerFactories.get(i); + org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } + catch (java.lang.Throwable _t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); + } + } + + public de.h_da.fbi.dsi.ws0910.camelprototype.OutputNewOrder createOrder(de.h_da.fbi.dsi.ws0910.camelprototype.InputNewOrder in) throws java.rmi.RemoteException { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://camelprototype.ws0910.dsi.fbi.h_da.de/PlaceNewOrder"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("", "CreateOrder")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {in}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (de.h_da.fbi.dsi.ws0910.camelprototype.OutputNewOrder) _resp; + } catch (java.lang.Exception _exception) { + return (de.h_da.fbi.dsi.ws0910.camelprototype.OutputNewOrder) org.apache.axis.utils.JavaUtils.convert(_resp, de.h_da.fbi.dsi.ws0910.camelprototype.OutputNewOrder.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + throw axisFaultException; +} + } + +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OutputNewOrder.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OutputNewOrder.java new file mode 100644 index 0000000..5089553 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/de/h_da/fbi/dsi/ws0910/camelprototype/OutputNewOrder.java @@ -0,0 +1,155 @@ +/** + * OutputNewOrder.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package de.h_da.fbi.dsi.ws0910.camelprototype; + +public class OutputNewOrder implements java.io.Serializable { + private java.lang.String status; + + private java.lang.String message; + + public OutputNewOrder() { + } + + public OutputNewOrder( + java.lang.String status, + java.lang.String message) { + this.status = status; + this.message = message; + } + + + /** + * Gets the status value for this OutputNewOrder. + * + * @return status + */ + public java.lang.String getStatus() { + return status; + } + + + /** + * Sets the status value for this OutputNewOrder. + * + * @param status + */ + public void setStatus(java.lang.String status) { + this.status = status; + } + + + /** + * Gets the message value for this OutputNewOrder. + * + * @return message + */ + public java.lang.String getMessage() { + return message; + } + + + /** + * Sets the message value for this OutputNewOrder. + * + * @param message + */ + public void setMessage(java.lang.String message) { + this.message = message; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof OutputNewOrder)) return false; + OutputNewOrder other = (OutputNewOrder) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.status==null && other.getStatus()==null) || + (this.status!=null && + this.status.equals(other.getStatus()))) && + ((this.message==null && other.getMessage()==null) || + (this.message!=null && + this.message.equals(other.getMessage()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getStatus() != null) { + _hashCode += getStatus().hashCode(); + } + if (getMessage() != null) { + _hashCode += getMessage().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(OutputNewOrder.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://camelprototype.ws0910.dsi.fbi.h_da.de", ">outputNewOrder")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("status"); + elemField.setXmlName(new javax.xml.namespace.QName("", "status")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("message"); + elemField.setXmlName(new javax.xml.namespace.QName("", "message")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/CamelPrototypeWsClient.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/CamelPrototypeWsClient.java new file mode 100644 index 0000000..70f922a --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/CamelPrototypeWsClient.java @@ -0,0 +1,30 @@ +package main; + +import java.rmi.RemoteException; + +import javax.xml.rpc.ServiceException; + +import de.h_da.fbi.dsi.ws0910.camelprototype.InputNewOrder; +import de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint; +import de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpointServiceLocator; +import de.h_da.fbi.dsi.ws0910.camelprototype.OrderPosition; +import de.h_da.fbi.dsi.ws0910.camelprototype.OutputNewOrder; + +public class CamelPrototypeWsClient { + + public static void main(String[] args) throws ServiceException, RemoteException { + OrderEndpointServiceLocator loc = new OrderEndpointServiceLocator(); + OrderEndpoint client = loc.getOrderService(); + InputNewOrder in = new InputNewOrder(); + in.setCustomerNo("Cust0815"); + OrderPosition pos1 = new OrderPosition(); + pos1.setArticleNo("A123"); + pos1.setArticle("Article One"); + pos1.setAmount(23); + in.setOrderpositions(new OrderPosition[]{pos1}); + OutputNewOrder out = client.createOrder(in); + System.out.println("Orderstatus: "+out.getStatus()); + System.out.println("Order number: "+out.getMessage()); + } + +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosAmountEditor.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosAmountEditor.java new file mode 100644 index 0000000..ee7b52a --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosAmountEditor.java @@ -0,0 +1,33 @@ +package main; + +import java.awt.Component; + +import javax.swing.DefaultCellEditor; +import javax.swing.InputVerifier; +import javax.swing.JTable; +import javax.swing.JTextField; + +public class OrderPosAmountEditor extends DefaultCellEditor { + + private static final long serialVersionUID = 1L; + private InputVerifier verifier; + + public OrderPosAmountEditor(JTextField jtf, InputVerifier verifier) { + super(jtf); + editorComponent.setInputVerifier(verifier); + this.verifier = verifier; + } + @Override + public Component getTableCellEditorComponent(JTable table, Object value, + boolean isSelected, int row, int column) { + ((JTextField) editorComponent).setText(((Integer) value).toString()); + return editorComponent; + } + @Override + public boolean stopCellEditing() { + if(verifier.verify(editorComponent)) { + return super.stopCellEditing(); + } + return false; + } +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosEditor.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosEditor.java new file mode 100644 index 0000000..501f1db --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosEditor.java @@ -0,0 +1,27 @@ +package main; + +import java.awt.Component; + +import javax.swing.AbstractCellEditor; +import javax.swing.JComponent; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.table.TableCellEditor; + +public class OrderPosEditor extends AbstractCellEditor implements TableCellEditor{ + private JComponent cellEditComponent = new JTextField(); + private static final long serialVersionUID = 1L; + + @Override + public Object getCellEditorValue() { + return ( (JTextField) cellEditComponent).getText(); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, + boolean isSelected, int row, int column) { + System.out.println("Column: "+column); + return cellEditComponent; + } + +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosInputVerifier.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosInputVerifier.java new file mode 100644 index 0000000..4e77979 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosInputVerifier.java @@ -0,0 +1,23 @@ +package main; + +import javax.swing.InputVerifier; +import javax.swing.JComponent; +import javax.swing.JTextField; + +public class OrderPosInputVerifier extends InputVerifier { + + @Override + public boolean verify(JComponent input) { + boolean isInputValid = false; + String inTxt = ((JTextField) input).getText(); + + String pattern = "\\d*"; + if(inTxt.matches(pattern)) { + isInputValid = true; + } else { + isInputValid = false; + } + return isInputValid; + } + +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosTableModel.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosTableModel.java new file mode 100644 index 0000000..ca084c0 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/OrderPosTableModel.java @@ -0,0 +1,110 @@ +package main; + +import java.util.ArrayList; +import java.util.List; + +import javax.swing.table.AbstractTableModel; + +import de.h_da.fbi.dsi.ws0910.camelprototype.OrderPosition; + +public class OrderPosTableModel extends AbstractTableModel { + private static final long serialVersionUID = 1L; + + private List posList; + + public OrderPosTableModel() { + super(); + posList = new ArrayList(); + addPosition(); + } + + @Override + public int getColumnCount() { + return 3; + } + + @Override + public int getRowCount() { + return posList.size(); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + OrderPosition actOrderPosition = posList.get(rowIndex); + Object res = null; + switch(columnIndex) { + case 0: res = actOrderPosition.getArticleNo(); break; + case 1: res = actOrderPosition.getArticle(); break; + case 2: res = actOrderPosition.getAmount(); break; + default: res = null; + } + return res; + } + + @Override + public String getColumnName(int column) { + switch(column) { + case 0: return "Article No."; + case 1: return "Article"; + case 2: return "Amount"; + default: return ""; + } + } + + @Override + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + OrderPosition actOrderPosition = posList.get(rowIndex); + String val = (String) aValue; + switch(columnIndex) { + case 0: actOrderPosition.setArticleNo(val); break; + case 1: actOrderPosition.setArticle(val); break; + case 2: { + int intVal = Integer.parseInt(val); + actOrderPosition.setAmount(intVal); + break; + } + } + if(validate(actOrderPosition) && (rowIndex == posList.size()-1 )) { + addPosition(); + } + fireTableDataChanged(); + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return true; + } + public void addPosition() { + posList.add(new OrderPosition("", 0, "")); + fireTableDataChanged(); + } + public void clear() { + posList.clear(); + fireTableDataChanged(); + } + public OrderPosition[] getOrderPositions() { + List res = new ArrayList(); + for(OrderPosition pos : posList) { + if(validate(pos)) { + res.add(pos); + } + } + return res.toArray(new OrderPosition[res.size()]); + } + private boolean validate(OrderPosition pos) { + if(!pos.getArticleNo().isEmpty() + && !pos.getArticle().isEmpty() + && (pos.getAmount() > 0) ) { + return true; + } + return false; + } + public boolean isValid() { + for(OrderPosition pos: posList) { + if(!validate(pos)) { + return false; + } + } + return true; + } +} diff --git a/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/WsClientMainFrame.java b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/WsClientMainFrame.java new file mode 100644 index 0000000..31ca1c2 --- /dev/null +++ b/Master/Daten- und Systemintegration/camelprototypewsclient/src/main/WsClientMainFrame.java @@ -0,0 +1,187 @@ +package main; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import javax.swing.WindowConstants; + +import com.jgoodies.forms.layout.CellConstraints; +import com.jgoodies.forms.layout.FormLayout; + +import de.h_da.fbi.dsi.ws0910.camelprototype.InputNewOrder; +import de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint; +import de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpointServiceLocator; +import de.h_da.fbi.dsi.ws0910.camelprototype.OrderPosition; +import de.h_da.fbi.dsi.ws0910.camelprototype.OutputNewOrder; + + +/** +* This code was edited or generated using CloudGarden's Jigloo +* SWT/Swing GUI Builder, which is free for non-commercial +* use. If Jigloo is being used commercially (ie, by a corporation, +* company or business for any purpose whatever) then you +* should purchase a license for each developer using Jigloo. +* Please visit www.cloudgarden.com for details. +* Use of Jigloo implies acceptance of these licensing terms. +* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR +* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED +* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE. +*/ +public class WsClientMainFrame extends javax.swing.JFrame { + private static final long serialVersionUID = 1L; + private OrderPosTableModel orderPosTableModel; + private OrderPosEditor orderPosCellEditor; + private JButton submitBtn; + private JButton cancelButton; + private JTable orderPosTable; + private JScrollPane jScrollPane1; + private JLabel posLabel; + private JTextField custNoField; + private JLabel custNoLabel; + private JTextField msgField; + private JTextField statusField; + private JLabel msgLabel; + private JLabel statusLabel; + + /** + * Auto-generated main method to display this JFrame + */ + public static void main(String[] args) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + WsClientMainFrame inst = new WsClientMainFrame(); + inst.setLocationRelativeTo(null); + inst.setVisible(true); + } + }); + } + + public WsClientMainFrame() { + super(); + initGUI(); + } + + private void initGUI() { + try { + orderPosTableModel = new OrderPosTableModel(); + orderPosCellEditor = new OrderPosEditor(); + FormLayout thisLayout = new FormLayout( + "5dlu, 54dlu, 5dlu, 64dlu, 64dlu, 64dlu", + "5dlu, max(p;5dlu), 5dlu, 48dlu, 5dlu, max(p;15dlu), 5dlu, 14dlu, 5dlu, max(p;15dlu), 5dlu, max(p;5dlu)"); + getContentPane().setLayout(thisLayout); + setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + this.setTitle("DSI WS09/10 CamelPrototype WS Client"); + this.setPreferredSize(new java.awt.Dimension(520, 300)); + { + submitBtn = new JButton(); + getContentPane().add(submitBtn, new CellConstraints("4, 12, 1, 1, default, default")); + submitBtn.setText("Submit"); + submitBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if(orderPosTable.isEditing()) { + if(!orderPosTable.getCellEditor().stopCellEditing()) { + return; + } + } + if(custNoField.getText().isEmpty()) { + statusField.setText("Not OK!"); + msgField.setText("Customer No. empty!"); + return; + } + OrderPosition[] orderPos = orderPosTableModel.getOrderPositions(); + if(orderPos.length == 0) { + statusField.setText("Not OK!"); + msgField.setText("No valid order positions!"); + return; + } + InputNewOrder in = new InputNewOrder(); + in.setCustomerNo(custNoField.getText()); + in.setOrderpositions(orderPos); + OrderEndpointServiceLocator loc = new OrderEndpointServiceLocator(); + try { + OrderEndpoint client = loc.getOrderService(); + OutputNewOrder out = client.createOrder(in); + String status = "0".equals(out.getStatus())?"OK":"Not OK"; + statusField.setText(status); + msgField.setText("Received Order No.: "+out.getMessage()); + } catch (Exception e1) { + e1.printStackTrace(); + } + + } + }); + } + { + cancelButton = new JButton(); + getContentPane().add(cancelButton, new CellConstraints("6, 12, 1, 1, default, default")); + cancelButton.setText("Cancel"); + cancelButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + orderPosTableModel.clear(); + custNoField.setText(""); + statusField.setText(""); + msgField.setText(""); + } + }); + } + { + jScrollPane1 = new JScrollPane(); + getContentPane().add(jScrollPane1, new CellConstraints("4, 4, 3, 3, default, default")); + { + orderPosTable = new JTable(); + jScrollPane1.setViewportView(orderPosTable); + orderPosTable.setModel(orderPosTableModel); + orderPosTable.setColumnSelectionAllowed(true); + orderPosTable.setCellEditor(orderPosCellEditor); + orderPosTable.getColumnModel().getColumn(2).setCellEditor(new OrderPosAmountEditor(new JTextField(), new OrderPosInputVerifier())); + orderPosTable.getTableHeader().setLocale(new java.util.Locale("de")); + } + } + { + statusLabel = new JLabel(); + getContentPane().add(statusLabel, new CellConstraints("2, 8, 1, 1, default, default")); + statusLabel.setText("Status"); + } + { + msgLabel = new JLabel(); + getContentPane().add(msgLabel, new CellConstraints("2, 10, 1, 1, default, default")); + msgLabel.setText("Message"); + } + { + statusField = new JTextField(); + getContentPane().add(statusField, new CellConstraints("4, 8, 3, 1, default, default")); + statusField.setEditable(false); + } + { + msgField = new JTextField(); + getContentPane().add(msgField, new CellConstraints("4, 10, 3, 1, default, default")); + msgField.setEditable(false); + } + { + custNoLabel = new JLabel(); + getContentPane().add(custNoLabel, new CellConstraints("2, 2, 1, 1, default, default")); + custNoLabel.setText("Customer No."); + } + { + custNoField = new JTextField(); + getContentPane().add(custNoField, new CellConstraints("4, 2, 1, 1, default, default")); + } + { + posLabel = new JLabel(); + getContentPane().add(posLabel, new CellConstraints("2, 4, 1, 1, default, top")); + posLabel.setText("Order Positions"); + } + pack(); + this.setSize(540, 300); + } catch (Exception e) { + e.printStackTrace(); + } + } +} -- cgit v1.2.3