User: jung    
  Date: 00/12/04 04:36:18

  Modified:    src/org/zoap/soap/meta/string RequestType.java
                        ResponseType.java string.dfPackage
  Log:
  adopted to latest jboss container,
  
  added decimal and date
  
  removed some problems due to forward-referencing in meta-data
  
  added serialisation policy
  
  Revision  Changes    Path
  1.2       +207 -203  zoap/src/org/zoap/soap/meta/string/RequestType.java
  
  Index: RequestType.java
  ===================================================================
  RCS file: /products/cvs/ejboss/zoap/src/org/zoap/soap/meta/string/RequestType.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RequestType.java  2000/08/10 21:07:21     1.1
  +++ RequestType.java  2000/12/04 12:36:18     1.2
  @@ -1,206 +1,216 @@
  -/*
  - *   $Id: RequestType.java,v 1.1 2000/08/10 21:07:21 jung Exp $
  - *   Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
  - *   D-66299 Friedrichsthal, Germany. All Rights Reserved.
  - *
  - *   License Statement
  - *
  - *   Redistribution and use of this software and associated documentation 
("Software"), with or without
  - *   modification, are permitted provided that the following conditions are met:
  - *
  - *   1.      Redistributions of source code must retain copyright statements and 
notices.
  - *           Redistributions must also contain a copy of this document.
  - *
  - *   2.      Redistributions in binary form must reproduce the attached copyright 
notice, this list of
  - *           conditions and the following disclaimer in the documentation and/or 
other materials provided
  - *           with the distribution.
  - *
  - *   3.      The end-user documentation included with the redistribution, if any, 
must include the following
  - *           acknowledgment: "This product includes software developed by infor: 
business solutions AG
  - *           (http://www.infor.de/)." Alternately, this acknowledgment may appear 
in the software itself,
  - *           if and wherever such third-party acknowledgments normally appear.
  - *
  - *   4.      The name "infor" must not be used to endorse or promote products 
derived from this
  - *           Software without prior written permission of infor: business solutions 
AG.
  - *           For written permission, please contact [EMAIL PROTECTED]
  - *
  - *   5.      Products derived from this Software may not be called "infor" nor may 
"infor" appear
  - *           in their names without prior written permission of infor: business 
solutions AG. infor
  - *           is a registered trademark of infor:business solutions AG.
  - *
  - *   Disclaimer
  - *
  - *   THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS 
IS" AND ANY
  - *   EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF
  - *   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  - *
  - *   IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE 
FOR ANY DIRECT,
  - *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO,
  - *   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
BUSINESS INTERRUPTION)
  - *   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
LIABILITY, OR TORT
  - *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE,
  - *   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  - */
  -
  -package org.zoap.soap.meta.string;
  -
  -import org.zoap.soap.Environment;
  -
  -import org.zoap.soap.MethodRequest;
  -import org.zoap.soap.MethodResponse;
  -
  -import org.zoap.xml.ComplexType;
  -import org.zoap.xml.Type;
  -import org.zoap.xml.TypeException;
  -import org.zoap.xml.Element;
  -import org.zoap.xml.ElementException;
  -import org.zoap.xml.Schema;
  -import org.zoap.xml.Attribute;
  -import org.zoap.xml.Appearance;
  -import org.zoap.xml.AppearanceException;
  -
  -import de.infor.ce.util.ObjectFactory;
  -
  -import java.util.Map;
  -import java.util.HashMap;
  -import java.util.Collection;
  -import java.util.Properties;
  -import java.util.Iterator;
  -import java.util.ArrayList;
  -
  -import java.lang.reflect.Method;
  -import org.zoap.xml.meta.builtin.DefaultBinding;
  -
  -/**
  - * RequestType is an element type that wraps java method requests to a particular
  - * method of a remote interface. This is dedicated to string-based access, i.e., we
  - * expect ready-made XML-structures in the arguments of the MethodRequest.
  - */
  -
  -public class RequestType extends ComplexType {
  -
  -    /** the method associated to this request */
  -    Method associatedMethod;
  -
  -    /** the schemas where the argument elements are located */
  -    Schema[] argumentSchemas;
  -
  -    /** the elementnames of the arguments */
  -    String[] argumentNames;
  -
  -    /** public constructor is responsible for initialising the meta-data */
  -    public RequestType() {
  -
  -      if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
  -        Environment.out.println(toString()+"()\n");
  -
  -      setAssociatedClass(MethodRequest.class);
  -    }
  -
  -    public void setArgumentSchemas(Schema[] argumentSchemas) {
  -        this.argumentSchemas=argumentSchemas;
  -    }
  -
  -    public void setArgumentNames(String[] argumentNames) {
  -        this.argumentNames=argumentNames;
  -    }
  -
  -    public Method getAssociatedMethod() {
  -      return associatedMethod;
  -    }
  -
  -    public void setAssociatedMethod(Method method) {
  -      associatedMethod=method;
  -    }
  -
  -
  -    /**
  -     * we have to overwrite the isCompatibleTo thing? This is a case where one
  -     * Java class is mapped to several XML elements/types. Hmmm, I dont think
  -     * its really used ... but lets try
  -     */
  -
  -    public boolean isCompatibleTo(Object object, Class clazz) {
  -
  -      if(object instanceof MethodRequest &&
  -        (associatedMethod.equals(((MethodRequest) object).getMethod())))
  -          return true;
  -
  -      return false;
  -    }
  -
  -    /**
  -     * this is to produce the arguments inside this request directly from
  -     * the string-based request structure
  -     */
  -
  -    public String getVerboseElements(Object target) throws TypeException {
  -      try{
  -        MethodRequest methodRequest=(MethodRequest) target;
  -        String result="";
  -
  -        for(int count=0;count<methodRequest.getArguments().length;count++)
  -          result+=Environment.replaceTag((String) 
methodRequest.getArguments()[count],
  -           argumentNames[count],argumentSchemas[count]);
  -
  -        return result;
  -      } catch(NullPointerException e) {
  -        throw new TypeException();
  -      } catch(ClassCastException e) {
  -        throw new TypeException();
  -      }
  -    }
  -
  -    /** setting the content establishes the method inside the request structure */
  -
  -    public Object setContent(Object object, String body,String verboseElements,Map 
references,Map nameSpaces) {
  -
  -      if(object instanceof MethodRequest) {
  -        MethodRequest request=(MethodRequest) object;
  -
  -        request.setMethod(associatedMethod);
  -
  -        request.setArguments(Environment.seperateTags(verboseElements));
  -      }
  -
  -      return object;
  -    }
  -
  -}
  -
  -/*
  +/*
  + *   $Id: RequestType.java,v 1.2 2000/12/04 12:36:18 jung Exp $
  + *   Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
  + *   D-66299 Friedrichsthal, Germany. All Rights Reserved.
  + *
  + *   License Statement
  + *
  + *   Redistribution and use of this software and associated documentation 
("Software"), with or without
  + *   modification, are permitted provided that the following conditions are met:
  + *
  + *   1.      Redistributions of source code must retain copyright statements and 
notices.
  + *           Redistributions must also contain a copy of this document.
  + *
  + *   2.      Redistributions in binary form must reproduce the attached copyright 
notice, this list of
  + *           conditions and the following disclaimer in the documentation and/or 
other materials provided
  + *           with the distribution.
  + *
  + *   3.      The end-user documentation included with the redistribution, if any, 
must include the following
  + *           acknowledgment: "This product includes software developed by infor: 
business solutions AG
  + *           (http://www.infor.de/)." Alternately, this acknowledgment may appear 
in the software itself,
  + *           if and wherever such third-party acknowledgments normally appear.
  + *
  + *   4.      The name "infor" must not be used to endorse or promote products 
derived from this
  + *           Software without prior written permission of infor: business solutions 
AG.
  + *           For written permission, please contact [EMAIL PROTECTED]
  + *
  + *   5.      Products derived from this Software may not be called "infor" nor may 
"infor" appear
  + *           in their names without prior written permission of infor: business 
solutions AG. infor
  + *           is a registered trademark of infor:business solutions AG.
  + *
  + *   Disclaimer
  + *
  + *   THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS 
IS" AND ANY
  + *   EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF
  + *   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  + *
  + *   IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE 
FOR ANY DIRECT,
  + *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO,
  + *   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
BUSINESS INTERRUPTION)
  + *   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
LIABILITY, OR TORT
  + *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE,
  + *   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + */
  +
  +package org.zoap.soap.meta.string;
  +
  +import org.zoap.soap.Environment;
  +
  +import org.zoap.soap.MethodRequest;
  +import org.zoap.soap.MethodResponse;
  +
  +import org.zoap.xml.ComplexType;
  +import org.zoap.xml.Type;
  +import org.zoap.xml.TypeException;
  +import org.zoap.xml.Element;
  +import org.zoap.xml.ElementException;
  +import org.zoap.xml.Schema;
  +import org.zoap.xml.Attribute;
  +import org.zoap.xml.Appearance;
  +import org.zoap.xml.AppearanceException;
  +
  +import de.infor.ce.util.ObjectFactory;
  +
  +import java.util.Map;
  +import java.util.HashMap;
  +import java.util.Collection;
  +import java.util.Properties;
  +import java.util.Iterator;
  +import java.util.ArrayList;
  +
  +import java.lang.reflect.Method;
  +import org.zoap.xml.meta.builtin.DefaultBinding;
  +
  +/**
  + * RequestType is an element type that wraps java method requests to a particular
  + * method of a remote interface. This is dedicated to string-based access, i.e., we
  + * expect ready-made XML-structures in the arguments of the MethodRequest.
  + */
  +
  +public class RequestType extends ComplexType {
  +
  +    /** the method associated to this request */
  +    Method associatedMethod;
  +
  +    /** the schemas where the argument elements are located */
  +    Schema[] argumentSchemas;
  +
  +    /** the elementnames of the arguments */
  +    String[] argumentNames;
  +
  +    /** public constructor is responsible for initialising the meta-data */
  +    public RequestType() {
  +
  +      if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
  +        Environment.out.println(toString()+"()\n");
  +
  +      setAssociatedClass(MethodRequest.class);
  +    }
  +
  +    public void setArgumentSchemas(Schema[] argumentSchemas) {
  +        this.argumentSchemas=argumentSchemas;
  +    }
  +
  +    public void setArgumentNames(String[] argumentNames) {
  +        this.argumentNames=argumentNames;
  +    }
  +
  +    public Method getAssociatedMethod() {
  +      return associatedMethod;
  +    }
  +
  +    public void setAssociatedMethod(Method method) {
  +      associatedMethod=method;
  +    }
  +
  +
  +    /**
  +     * we have to overwrite the isCompatibleTo thing? This is a case where one
  +     * Java class is mapped to several XML elements/types. Hmmm, I dont think
  +     * its really used ... but lets try
  +     */
  +
  +    public boolean isCompatibleTo(Object object, Class clazz) {
  +
  +      if(object instanceof MethodRequest &&
  +        (associatedMethod.equals(((MethodRequest) object).getMethod())))
  +          return true;
  +
  +      return false;
  +    }
  +
  +    /**
  +     * this is to produce the arguments inside this request directly from
  +     * the string-based request structure
  +     */
  +
  +    public String getVerboseElements(Object target) throws TypeException {
  +      try{
  +        MethodRequest methodRequest=(MethodRequest) target;
  +        String result="";
  +
  +        for(int count=0;count<methodRequest.getArguments().length;count++)
  +          result+=Environment.replaceTag((String) 
methodRequest.getArguments()[count],
  +           argumentNames[count],argumentSchemas[count]);
  +
  +        return result;
  +      } catch(NullPointerException e) {
  +        throw new TypeException();
  +      } catch(ClassCastException e) {
  +        throw new TypeException();
  +      }
  +    }
  +
  +    /** setting the content establishes the method inside the request structure */
  +
  +    public Object setContent(Object object, String body,String verboseElements,Map 
references,Map nameSpaces) {
  +
  +      if(object instanceof MethodRequest) {
  +        MethodRequest request=(MethodRequest) object;
  +
  +        request.setMethod(associatedMethod);
  +
  +        request.setArguments(Environment.seperateTags(verboseElements));
  +      }
  +
  +      return object;
  +    }
  +
  +}
  +
  +/*
    *   $Log: RequestType.java,v $
  - *   Revision 1.1  2000/08/10 21:07:21  jung
  - *   Initial revision
  - *   
  - *   Revision 1.1.2.1  2000/08/04 17:20:19  jung
  - *   close to beta stadium. Meta-Data import now works.
  - *   
  - *   Revision 1.1.2.2  2000/07/20 14:35:26  jung
  - *   some refactoring inside infor:xml
  - *
  - *   Revision 1.1.2.1  2000/07/17 12:46:17  jung
  - *   refactored package and meta-model
  - *
  - *   Revision 1.1.2.1  2000/07/13 12:46:19  jung
  - *   package renaming, most of the zoap stuff now under org.zoap
  - *   util and http stay infor.ce, containerInvoker etc move to org.jboss
  - *
  - *   changed the makefile, adopted most of the licenses
  - *
  - *   Revision 1.1.2.3  2000/07/11 08:08:34  jung
  - *   added functionality to store retrieve a part of a types elements
  - *   within "ignored" strings. Useful for writing generic handlers that
  - *   just process a part of the XML and transfer the rest.
  - *
  - *   Revision 1.1.2.2  2000/07/07 15:50:02  jung
  - *   Request-Response Structure close to MS-SOAP
  - *
  - *   removed a mega-bug in return element
  - *
  - *   Revision 1.1.2.1  2000/07/07 12:45:21  jung
  - *   changed the method-request and response structure to be more
  - *   explicit instead of just serializable (such that MS-SOAP gets the
  - *   chance ot do something with that stuff).
  - *
  - */
  + *   Revision 1.2  2000/12/04 12:36:18  jung
  + *   adopted to latest jboss container,
  + *   
  + *   added decimal and date
  + *   
  + *   removed some problems due to forward-referencing in meta-data
  + *   
  + *   added serialisation policy
  + *   
  + *   Revision 1.1.1.1  2000/08/10 21:07:21  jung
  + *   Initial import.
  + *   
  + *   
  + *   Revision 1.1.2.1  2000/08/04 17:20:19  jung
  + *   close to beta stadium. Meta-Data import now works.
  + *   
  + *   Revision 1.1.2.2  2000/07/20 14:35:26  jung
  + *   some refactoring inside infor:xml
  + *
  + *   Revision 1.1.2.1  2000/07/17 12:46:17  jung
  + *   refactored package and meta-model
  + *
  + *   Revision 1.1.2.1  2000/07/13 12:46:19  jung
  + *   package renaming, most of the zoap stuff now under org.zoap
  + *   util and http stay infor.ce, containerInvoker etc move to org.jboss
  + *
  + *   changed the makefile, adopted most of the licenses
  + *
  + *   Revision 1.1.2.3  2000/07/11 08:08:34  jung
  + *   added functionality to store retrieve a part of a types elements
  + *   within "ignored" strings. Useful for writing generic handlers that
  + *   just process a part of the XML and transfer the rest.
  + *
  + *   Revision 1.1.2.2  2000/07/07 15:50:02  jung
  + *   Request-Response Structure close to MS-SOAP
  + *
  + *   removed a mega-bug in return element
  + *
  + *   Revision 1.1.2.1  2000/07/07 12:45:21  jung
  + *   changed the method-request and response structure to be more
  + *   explicit instead of just serializable (such that MS-SOAP gets the
  + *   chance ot do something with that stuff).
  + *
  + */
  
  
  
  1.2       +186 -182  zoap/src/org/zoap/soap/meta/string/ResponseType.java
  
  Index: ResponseType.java
  ===================================================================
  RCS file: /products/cvs/ejboss/zoap/src/org/zoap/soap/meta/string/ResponseType.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResponseType.java 2000/08/10 21:07:22     1.1
  +++ ResponseType.java 2000/12/04 12:36:18     1.2
  @@ -1,185 +1,195 @@
  -/*
  - *   $Id: ResponseType.java,v 1.1 2000/08/10 21:07:22 jung Exp $
  - *   Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
  - *   D-66299 Friedrichsthal, Germany. All Rights Reserved.
  - *
  - *   License Statement
  - *
  - *   Redistribution and use of this software and associated documentation 
("Software"), with or without
  - *   modification, are permitted provided that the following conditions are met:
  - *
  - *   1.      Redistributions of source code must retain copyright statements and 
notices.
  - *           Redistributions must also contain a copy of this document.
  - *
  - *   2.      Redistributions in binary form must reproduce the attached copyright 
notice, this list of
  - *           conditions and the following disclaimer in the documentation and/or 
other materials provided
  - *           with the distribution.
  - *
  - *   3.      The end-user documentation included with the redistribution, if any, 
must include the following
  - *           acknowledgment: "This product includes software developed by infor: 
business solutions AG
  - *           (http://www.infor.de/)." Alternately, this acknowledgment may appear 
in the software itself,
  - *           if and wherever such third-party acknowledgments normally appear.
  - *
  - *   4.      The name "infor" must not be used to endorse or promote products 
derived from this
  - *           Software without prior written permission of infor: business solutions 
AG.
  - *           For written permission, please contact [EMAIL PROTECTED]
  - *
  - *   5.      Products derived from this Software may not be called "infor" nor may 
"infor" appear
  - *           in their names without prior written permission of infor: business 
solutions AG. infor
  - *           is a registered trademark of infor:business solutions AG.
  - *
  - *   Disclaimer
  - *
  - *   THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS 
IS" AND ANY
  - *   EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF
  - *   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  - *
  - *   IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE 
FOR ANY DIRECT,
  - *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO,
  - *   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
BUSINESS INTERRUPTION)
  - *   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
LIABILITY, OR TORT
  - *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE,
  - *   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  - */
  -
  -package org.zoap.soap.meta.string;
  -
  -import org.zoap.soap.Environment;
  -import org.zoap.soap.MethodResponse;
  -
  -import org.zoap.xml.ComplexType;
  -import org.zoap.xml.Type;
  -import org.zoap.xml.Element;
  -import org.zoap.xml.ElementException;
  -import org.zoap.xml.Schema;
  -import org.zoap.xml.Attribute;
  -import org.zoap.xml.Appearance;
  -import org.zoap.xml.AppearanceException;
  -
  -import de.infor.ce.util.ObjectFactory;
  -
  -import java.util.Map;
  -import java.util.HashMap;
  -import java.util.Collection;
  -import java.util.Properties;
  -import java.util.Iterator;
  -import java.util.ArrayList;
  -
  -import java.lang.reflect.Method;
  -import org.zoap.xml.meta.builtin.DefaultBinding;
  -
  -/**
  - * ResponseType is an element type that wraps java method returns from a particular
  - * method of a remote interface. This case is dedicated to string-based access, 
i.e., we expect
  - * already usable XML-structures inside the method request.
  - */
  -
  -public class ResponseType extends ComplexType {
  -
  -    /** the real method that this response comes from */
  -    Method associatedMethod;
  -
  -    /** the schema that the return element is defined in*/
  -    Schema returnSchema;
  -
  -    /** the name of the return schema*/
  -    String returnName;
  -
  -    /** public constructor is empty */
  -    public ResponseType() {
  -
  -      if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
  -        Environment.out.print(toString()+"()\n");
  -
  -      setAssociatedClass(MethodResponse.class);
  -    }
  -
  -    public void setReturnName(String returnName) {
  -        this.returnName=returnName;
  -    }
  -
  -    public void setReturnSchema(Schema returnSchema) {
  -        this.returnSchema=returnSchema;
  -    }
  -
  -    public Method getAssociatedMethod() {
  -      return associatedMethod;
  -    }
  -
  -    public void setAssociatedMethod(Method method) {
  -      associatedMethod=method;
  -    }
  -
  -    /**
  -     * we have to overwrite the isCompatibleTo thing? This is a case where one
  -     * Java class is mapped to several XML elements/types. Hmmm, I dont think
  -     * its really used ... but lets try
  -     */
  -
  -    public boolean isCompatibleTo(Object object, Class clazz) {
  -
  -      if(object instanceof MethodResponse &&
  -        (associatedMethod.equals(((MethodResponse) object).getMethod())))
  -          return true;
  -
  -      return false;
  -    }
  -
  -    public String getVerboseElements(Object object) {
  -      if(object instanceof MethodResponse) {
  -        return Environment.replaceTag((String) ((MethodResponse) 
object).getValue(),returnName,
  -            returnSchema);
  -      } else
  -        return null;
  -    }
  -
  -    /** setting the content establishes the method inside the request structure */
  -
  -    public Object setContent(Object object, String body, String verboseElements,Map 
references,Map nameSpaces) {
  -
  -      if(object instanceof MethodResponse) {
  -        ((MethodResponse) object).setMethod(associatedMethod);
  -        ((MethodResponse) object).setValue(verboseElements);
  -      }
  -
  -      return object;
  -    }
  -
  -}
  -
  -/*
  +/*
  + *   $Id: ResponseType.java,v 1.2 2000/12/04 12:36:18 jung Exp $
  + *   Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
  + *   D-66299 Friedrichsthal, Germany. All Rights Reserved.
  + *
  + *   License Statement
  + *
  + *   Redistribution and use of this software and associated documentation 
("Software"), with or without
  + *   modification, are permitted provided that the following conditions are met:
  + *
  + *   1.      Redistributions of source code must retain copyright statements and 
notices.
  + *           Redistributions must also contain a copy of this document.
  + *
  + *   2.      Redistributions in binary form must reproduce the attached copyright 
notice, this list of
  + *           conditions and the following disclaimer in the documentation and/or 
other materials provided
  + *           with the distribution.
  + *
  + *   3.      The end-user documentation included with the redistribution, if any, 
must include the following
  + *           acknowledgment: "This product includes software developed by infor: 
business solutions AG
  + *           (http://www.infor.de/)." Alternately, this acknowledgment may appear 
in the software itself,
  + *           if and wherever such third-party acknowledgments normally appear.
  + *
  + *   4.      The name "infor" must not be used to endorse or promote products 
derived from this
  + *           Software without prior written permission of infor: business solutions 
AG.
  + *           For written permission, please contact [EMAIL PROTECTED]
  + *
  + *   5.      Products derived from this Software may not be called "infor" nor may 
"infor" appear
  + *           in their names without prior written permission of infor: business 
solutions AG. infor
  + *           is a registered trademark of infor:business solutions AG.
  + *
  + *   Disclaimer
  + *
  + *   THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS 
IS" AND ANY
  + *   EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF
  + *   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  + *
  + *   IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE 
FOR ANY DIRECT,
  + *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO,
  + *   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
BUSINESS INTERRUPTION)
  + *   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
LIABILITY, OR TORT
  + *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE,
  + *   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + */
  +
  +package org.zoap.soap.meta.string;
  +
  +import org.zoap.soap.Environment;
  +import org.zoap.soap.MethodResponse;
  +
  +import org.zoap.xml.ComplexType;
  +import org.zoap.xml.Type;
  +import org.zoap.xml.Element;
  +import org.zoap.xml.ElementException;
  +import org.zoap.xml.Schema;
  +import org.zoap.xml.Attribute;
  +import org.zoap.xml.Appearance;
  +import org.zoap.xml.AppearanceException;
  +
  +import de.infor.ce.util.ObjectFactory;
  +
  +import java.util.Map;
  +import java.util.HashMap;
  +import java.util.Collection;
  +import java.util.Properties;
  +import java.util.Iterator;
  +import java.util.ArrayList;
  +
  +import java.lang.reflect.Method;
  +import org.zoap.xml.meta.builtin.DefaultBinding;
  +
  +/**
  + * ResponseType is an element type that wraps java method returns from a particular
  + * method of a remote interface. This case is dedicated to string-based access, 
i.e., we expect
  + * already usable XML-structures inside the method request.
  + */
  +
  +public class ResponseType extends ComplexType {
  +
  +    /** the real method that this response comes from */
  +    Method associatedMethod;
  +
  +    /** the schema that the return element is defined in*/
  +    Schema returnSchema;
  +
  +    /** the name of the return schema*/
  +    String returnName;
  +
  +    /** public constructor is empty */
  +    public ResponseType() {
  +
  +      if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
  +        Environment.out.print(toString()+"()\n");
  +
  +      setAssociatedClass(MethodResponse.class);
  +    }
  +
  +    public void setReturnName(String returnName) {
  +        this.returnName=returnName;
  +    }
  +
  +    public void setReturnSchema(Schema returnSchema) {
  +        this.returnSchema=returnSchema;
  +    }
  +
  +    public Method getAssociatedMethod() {
  +      return associatedMethod;
  +    }
  +
  +    public void setAssociatedMethod(Method method) {
  +      associatedMethod=method;
  +    }
  +
  +    /**
  +     * we have to overwrite the isCompatibleTo thing? This is a case where one
  +     * Java class is mapped to several XML elements/types. Hmmm, I dont think
  +     * its really used ... but lets try
  +     */
  +
  +    public boolean isCompatibleTo(Object object, Class clazz) {
  +
  +      if(object instanceof MethodResponse &&
  +        (associatedMethod.equals(((MethodResponse) object).getMethod())))
  +          return true;
  +
  +      return false;
  +    }
  +
  +    public String getVerboseElements(Object object) {
  +      if(object instanceof MethodResponse) {
  +        return Environment.replaceTag((String) ((MethodResponse) 
object).getValue(),returnName,
  +            returnSchema);
  +      } else
  +        return null;
  +    }
  +
  +    /** setting the content establishes the method inside the request structure */
  +
  +    public Object setContent(Object object, String body, String verboseElements,Map 
references,Map nameSpaces) {
  +
  +      if(object instanceof MethodResponse) {
  +        ((MethodResponse) object).setMethod(associatedMethod);
  +        ((MethodResponse) object).setValue(verboseElements);
  +      }
  +
  +      return object;
  +    }
  +
  +}
  +
  +/*
    *   $Log: ResponseType.java,v $
  - *   Revision 1.1  2000/08/10 21:07:22  jung
  - *   Initial revision
  - *   
  - *   Revision 1.1.2.1  2000/08/04 17:20:19  jung
  - *   close to beta stadium. Meta-Data import now works.
  - *   
  - *   Revision 1.1.2.2  2000/07/20 14:35:26  jung
  - *   some refactoring inside infor:xml
  - *
  - *   Revision 1.1.2.1  2000/07/17 12:46:17  jung
  - *   refactored package and meta-model
  - *
  - *   Revision 1.1.2.1  2000/07/13 12:46:19  jung
  - *   package renaming, most of the zoap stuff now under org.zoap
  - *   util and http stay infor.ce, containerInvoker etc move to org.jboss
  - *
  - *   changed the makefile, adopted most of the licenses
  - *
  - *   Revision 1.1.2.2  2000/07/11 08:08:34  jung
  - *   added functionality to store retrieve a part of a types elements
  - *   within "ignored" strings. Useful for writing generic handlers that
  - *   just process a part of the XML and transfer the rest.
  - *
  - *   Revision 1.1.2.1  2000/07/07 15:50:54  jung
  - *   Request-Response Structure close to MS-SOAP
  - *
  - *   removed a mega-bug in return element
  - *
  - *   Revision 1.1.2.1  2000/07/07 12:45:21  jung
  - *   changed the method-request and response structure to be more
  - *   explicit instead of just serializable (such that MS-SOAP gets the
  - *   chance ot do something with that stuff).
  - *
  - */
  + *   Revision 1.2  2000/12/04 12:36:18  jung
  + *   adopted to latest jboss container,
  + *   
  + *   added decimal and date
  + *   
  + *   removed some problems due to forward-referencing in meta-data
  + *   
  + *   added serialisation policy
  + *   
  + *   Revision 1.1.1.1  2000/08/10 21:07:22  jung
  + *   Initial import.
  + *   
  + *   
  + *   Revision 1.1.2.1  2000/08/04 17:20:19  jung
  + *   close to beta stadium. Meta-Data import now works.
  + *   
  + *   Revision 1.1.2.2  2000/07/20 14:35:26  jung
  + *   some refactoring inside infor:xml
  + *
  + *   Revision 1.1.2.1  2000/07/17 12:46:17  jung
  + *   refactored package and meta-model
  + *
  + *   Revision 1.1.2.1  2000/07/13 12:46:19  jung
  + *   package renaming, most of the zoap stuff now under org.zoap
  + *   util and http stay infor.ce, containerInvoker etc move to org.jboss
  + *
  + *   changed the makefile, adopted most of the licenses
  + *
  + *   Revision 1.1.2.2  2000/07/11 08:08:34  jung
  + *   added functionality to store retrieve a part of a types elements
  + *   within "ignored" strings. Useful for writing generic handlers that
  + *   just process a part of the XML and transfer the rest.
  + *
  + *   Revision 1.1.2.1  2000/07/07 15:50:54  jung
  + *   Request-Response Structure close to MS-SOAP
  + *
  + *   removed a mega-bug in return element
  + *
  + *   Revision 1.1.2.1  2000/07/07 12:45:21  jung
  + *   changed the method-request and response structure to be more
  + *   explicit instead of just serializable (such that MS-SOAP gets the
  + *   chance ot do something with that stuff).
  + *
  + */
  
  
  
  1.2       +32 -32    zoap/src/org/zoap/soap/meta/string/string.dfPackage
  
  Index: string.dfPackage
  ===================================================================
  RCS file: /products/cvs/ejboss/zoap/src/org/zoap/soap/meta/string/string.dfPackage,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- string.dfPackage  2000/08/10 21:07:22     1.1
  +++ string.dfPackage  2000/12/04 12:36:18     1.2
  @@ -1,32 +1,32 @@
  -package id2ksducbhi562acbhkttg6;
  -
  -/**
  -@version 2.0
  -@physicalPackage
  -@__modelType diagram 
  -*/
  -class diagram {
  -/**
  -@__ref <oiref:java#Class#org.zoap.soap.meta.string.RequestType:oiref><oihard>
  -@__modelType reference 
  -*/
  -class reference {
  -}/**
  -@__ref <oiref:java#Class#org.zoap.soap.meta.string.ResponseType:oiref><oihard>
  -@__modelType reference 
  -*/
  -class reference2 {
  -}}/**
  -@__tags
  -@shapeType ClassDiagram 
  -*/
  -class __tags {
  -}/**
  -@__options 
  -*/
  -class __options {
  -}/**
  -@__positions 
  -*/
  -class __positions {
  -}
  \ No newline at end of file
  +package id2ksducbhi562acbhkttg6;
  +
  +/**
  +@version 2.0
  +@physicalPackage
  +@__modelType diagram 
  +*/
  +class diagram {
  +/**
  +@__ref <oiref:java#Class#org.zoap.soap.meta.string.RequestType:oiref><oihard>
  +@__modelType reference 
  +*/
  +class reference {
  +}/**
  +@__ref <oiref:java#Class#org.zoap.soap.meta.string.ResponseType:oiref><oihard>
  +@__modelType reference 
  +*/
  +class reference2 {
  +}}/**
  +@__tags
  +@shapeType ClassDiagram 
  +*/
  +class __tags {
  +}/**
  +@__options 
  +*/
  +class __options {
  +}/**
  +@__positions 
  +*/
  +class __positions {
  +}
  
  
  

Reply via email to