You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by jo...@apache.org on 2004/01/29 22:35:02 UTC

cvs commit: ws-jaxme/src/pm/org/apache/ws/jaxme/pm/generator/jdbc JaxMeJdbcSG.java

jochen      2004/01/29 13:35:02

  Modified:    src/documentation/content/xdocs/pm book.xml
               src/jaxme/org/apache/ws/jaxme/generator/sg/impl
                        JAXBGroupSG.java JAXBObjectSG.java
                        JAXBComplexTypeSG.java JaxMeSchemaReader.java
               src/documentation/content/xdocs site.xml
               src/xs/org/apache/ws/jaxme/xs/jaxb/impl
                        JAXBGlobalBindingsImpl.java
               .        .classpath buildpm.xml
               src/pm/org/apache/ws/jaxme/pm/generator/jdbc
                        JaxMeJdbcSG.java
  Added:       src/pm/org/apache/ws/jaxme/pm/ino/api4j
                        ElementDefaultHandler.java TaminoAPI4JPm.java
                        DocumentDefaultHandler.java TJMElement.java
               src/documentation/content/xdocs/pm ino.xml
               src/jaxme/org/apache/ws/jaxme/generator/sg/impl
                        XjcSerializable.java SerializableSG.java
               src/pm/org/apache/ws/jaxme/generator/ino/api4j
                        TaminoAPI4JSG.java TaminoAPI4JSchemaSG.java
               src/pm/org/apache/ws/jaxme/pm/ino InoObject.java
  Log:
  Added support for the TaminoAPI4J to JaxMePM.
  Added support for xjc:serializable.
  
  Revision  Changes    Path
  1.1                  ws-jaxme/src/pm/org/apache/ws/jaxme/pm/ino/api4j/ElementDefaultHandler.java
  
  Index: ElementDefaultHandler.java
  ===================================================================
  package org.apache.ws.jaxme.pm.ino.api4j;
  
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  import javax.xml.bind.JAXBException;
  
  import org.apache.ws.jaxme.pm.ino.InoObject;
  import org.xml.sax.Attributes;
  import org.xml.sax.Locator;
  import org.xml.sax.SAXException;
  
  import com.softwareag.tamino.db.api.objectModel.sax.TSAXElement;
  import com.softwareag.tamino.db.api.objectModel.sax.TSAXElementDefaultHandler;
  
  
  /**
   * @author <a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
   */
  public class ElementDefaultHandler extends TSAXElementDefaultHandler {
      static class Data {
          int level = 0;
          boolean inDocument = false;
          boolean iHaveCreatedStartDocument = false;
          final List result = new ArrayList();
      }
      static ThreadLocal data = new ThreadLocal();
      static void initData() {
          data.set(new Data());
      }
      static void resetData() {
          data.set(null);
      }
  
      private Data getData() {
          return (Data) data.get();
      }
  
      public ElementDefaultHandler() {
      }
  
      public TSAXElement getFirstElement() {
          List result = getData().result;
          if (result.size() > 0) {
              return new TJMElement((InoObject) result.get(0));
          } else {
              return null;
          }
      }
  
      public Iterator getElementIterator() {
          return new Iterator(){
              Iterator inner = getData().result.iterator();
              public void remove() {
                  inner.remove();
              }
              public boolean hasNext() {
                  return inner.hasNext();
              }
              public Object next() {
                  return new TJMElement((InoObject) inner.next());
              }
          };
      }
  
      public void startDocument() throws SAXException {
          Data d = getData();
          d.iHaveCreatedStartDocument = false;
          d.inDocument = true;
          DocumentDefaultHandler.getUnmarshallerHandler().startDocument();
      }
  
      public void endDocument() throws SAXException {
          Data d = getData();
          if (d.inDocument) {
              DocumentDefaultHandler.getUnmarshallerHandler().endDocument();
  	        try {
  	            d.result.add(DocumentDefaultHandler.getUnmarshallerHandler().getResult());
  	        } catch (JAXBException e) {
  	            throw new SAXException(e);
  	        }
  	        d.inDocument = false;
  	        d.iHaveCreatedStartDocument = false;
          }
      }
  
      public void startElement(String pNamespaceURI, String pLocalName, String pQName,
  							 Attributes pAttr) throws SAXException {
          Data d = getData();
          if (d.level++ == 0  &&  !d.inDocument) {
              startDocument();
              d.iHaveCreatedStartDocument = true;
          }
          DocumentDefaultHandler.getUnmarshallerHandler().startElement(pNamespaceURI, pLocalName, pQName, pAttr);
      }
  
      public void endElement(String pNamespaceURI, String pLocalName, String pQName)
      		throws SAXException {
          Data d = getData();
          DocumentDefaultHandler.getUnmarshallerHandler().endElement(pNamespaceURI, pLocalName, pQName);
          if (--d.level == 0  &&  d.iHaveCreatedStartDocument) {
              endDocument();
          }
      }
  
      public void characters(char[] pBuffer, int pOffset, int pLen) throws SAXException {
          Data d = getData();
          if (d.inDocument) {
              DocumentDefaultHandler.getUnmarshallerHandler().characters(pBuffer, pOffset, pLen);
          }
      }
  
      public void ignorableWhitespace(char[] pBuffer, int pOffset, int pLen) throws SAXException {
          Data d = getData();
          if (d.inDocument) {
              DocumentDefaultHandler.getUnmarshallerHandler().ignorableWhitespace(pBuffer, pOffset, pLen);
          }
      }
  
      public void processingInstruction(String pTarget, String pData) throws SAXException {
          Data d = getData();
          if (d.inDocument) {
              DocumentDefaultHandler.getUnmarshallerHandler().processingInstruction(pTarget, pData);
          }
      }
  
      public void skippedEntity(String pEntity) throws SAXException {
          Data d = getData();
          if (d.inDocument) {
              DocumentDefaultHandler.getUnmarshallerHandler().skippedEntity(pEntity);
          }
      }
  
      public void endPrefixMapping(String pPrefix) throws SAXException {
          Data d = getData();
          if (d.inDocument) {
              DocumentDefaultHandler.getUnmarshallerHandler().endPrefixMapping(pPrefix);
          }
      }
  
      public void startPrefixMapping(String pPrefix, String pNamespaceURI) throws SAXException {
          Data d = getData();
          if (d.inDocument) {
              DocumentDefaultHandler.getUnmarshallerHandler().startPrefixMapping(pPrefix, pNamespaceURI);
          }
      }
  
      public void setDocumentLocator(Locator pLocator) {
          Data d = getData();
          if (d.inDocument) {
              DocumentDefaultHandler.getUnmarshallerHandler().setDocumentLocator(pLocator);
          }
      }
  }
  
  
  
  1.1                  ws-jaxme/src/pm/org/apache/ws/jaxme/pm/ino/api4j/TaminoAPI4JPm.java
  
  Index: TaminoAPI4JPm.java
  ===================================================================
  package org.apache.ws.jaxme.pm.ino.api4j;
  
  import javax.naming.InitialContext;
  import javax.naming.NamingException;
  import javax.xml.bind.Element;
  import javax.xml.bind.JAXBException;
  
  import org.apache.ws.jaxme.JMManager;
  import org.apache.ws.jaxme.Observer;
  import org.apache.ws.jaxme.PMException;
  import org.apache.ws.jaxme.PMParams;
  import org.apache.ws.jaxme.impl.JAXBContextImpl;
  import org.apache.ws.jaxme.impl.JMUnmarshallerHandlerImpl;
  import org.apache.ws.jaxme.pm.impl.PMImpl;
  import org.apache.ws.jaxme.pm.ino.InoObject;
  
  import com.softwareag.tamino.db.api.accessor.TAccessLocation;
  import com.softwareag.tamino.db.api.accessor.TDeleteException;
  import com.softwareag.tamino.db.api.accessor.TInsertException;
  import com.softwareag.tamino.db.api.accessor.TQuery;
  import com.softwareag.tamino.db.api.accessor.TQueryException;
  import com.softwareag.tamino.db.api.accessor.TUpdateException;
  import com.softwareag.tamino.db.api.accessor.TXMLObjectAccessor;
  import com.softwareag.tamino.db.api.connection.TConnection;
  import com.softwareag.tamino.db.api.connection.TServerNotAvailableException;
  import com.softwareag.tamino.db.api.connector.TaminoDataSource;
  import com.softwareag.tamino.db.api.objectModel.TIteratorException;
  import com.softwareag.tamino.db.api.objectModel.TNoSuchXMLObjectException;
  import com.softwareag.tamino.db.api.objectModel.TXMLObject;
  import com.softwareag.tamino.db.api.objectModel.TXMLObjectIterator;
  import com.softwareag.tamino.db.api.objectModel.TXMLObjectModel;
  import com.softwareag.tamino.db.api.objectModel.sax.TSAXObjectModel;
  import com.softwareag.tamino.db.api.response.TResponse;
  
  /**
   * @author <a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
   */
  public class TaminoAPI4JPm extends PMImpl {
      private static final ThreadLocal context = new ThreadLocal();
      private static TSAXObjectModel model;
      private static boolean isInitialized;
  
      static JAXBContextImpl getJAXBContext() {
          return (JAXBContextImpl) context.get();
      }
  
      static void setJAXBContext(JAXBContextImpl pContext) {
          context.set(pContext);
      }
  
      private String collection;
      private String jndiReference;
  
      public void init(JMManager pManager) throws JAXBException {
          super.init(pManager);
          if (!isInitialized) {
              synchronized(TaminoAPI4JPm.class) {
                  if (!isInitialized) {
                      System.err.println("Registering object model in class " + TXMLObjectModel.class + " with class loader " + TXMLObjectModel.class.getClassLoader());
                      TSAXObjectModel m = new TSAXObjectModel(TaminoAPI4JPm.class.getName(),
                              								TJMElement.class, TJMElement.class,
                              								new DocumentDefaultHandler(),
  															new ElementDefaultHandler());
                      TXMLObjectModel.register(m);
                      model = m;
                      isInitialized = true;
                  }
              }
          }
          collection = pManager.getProperty("collection");
          if (collection == null  ||  collection.length() == 0) {
              throw new JAXBException("The property 'collection' must be set.");
          }
          jndiReference = pManager.getProperty("jndiReference");
          if (jndiReference == null  ||  jndiReference.length() == 0) {
              throw new JAXBException("The property 'jndiReference' must be set.");
          }
      }
      
      protected TXMLObject getTXMLObject(InoObject pElement) {
          return TXMLObject.newInstance(new TJMElement(pElement));
      }
  
      protected TSAXObjectModel getTSAXObjectModel() throws JAXBException {
          return model;
      }
  
      protected TConnection getTConnection() throws NamingException, TServerNotAvailableException {
          InitialContext ic = new InitialContext();
          TaminoDataSource tds = (TaminoDataSource) ic.lookup(jndiReference);
          TConnection con =  tds.getConnection();
          return con;
      }
  
      public void select(Observer pObserver, String pQuery, PMParams pParams) throws PMException {
          TConnection conn = null;
          try {
              JAXBContextImpl c = getManager().getFactory();
              setJAXBContext(c);
              JMUnmarshallerHandlerImpl h = (JMUnmarshallerHandlerImpl) c.createUnmarshaller().getUnmarshallerHandler();
              DocumentDefaultHandler.setUnmarshallerHandler(h);
              ElementDefaultHandler.initData();
              conn = getTConnection();
              TXMLObjectAccessor accessor = conn.newXMLObjectAccessor(TAccessLocation.newInstance(collection), model);
              TResponse response = accessor.query(TQuery.newInstance(pQuery));
              for (TXMLObjectIterator iter = response.getXMLObjectIterator();
                   iter.hasNext();  ) {
                  TXMLObject object = iter.next();
                  pObserver.notify(((TJMElement) object.getElement()).getJMElement());
              }
          } catch (TServerNotAvailableException e) {
              throw new PMException(e);
          } catch (NamingException e) {
              throw new PMException(e);
          } catch (TQueryException e) {
              throw new PMException(e);
          } catch (TNoSuchXMLObjectException e) {
              throw new PMException(e);
          } catch (TIteratorException e) {
              throw new PMException(e);
          } catch (JAXBException e) {
              throw new PMException(e);
          } finally {
              if (conn != null) { try { conn.close(); } catch (Throwable ignore) {} }
              setJAXBContext(null);
              DocumentDefaultHandler.setUnmarshallerHandler(null);
              ElementDefaultHandler.initData();
          }
      }
  
      public void insert(Element pElement) throws PMException {
          TConnection conn = null;
          try {
              setJAXBContext(getManager().getFactory());
              conn = getTConnection();
              TXMLObjectAccessor accessor = conn.newXMLObjectAccessor(TAccessLocation.newInstance(collection), model);
              accessor.insert(getTXMLObject((InoObject) pElement));
          } catch (TServerNotAvailableException e) {
              throw new PMException(e);
          } catch (NamingException e) {
              throw new PMException(e);
          } catch (TInsertException e) {
              throw new PMException(e);
          } finally {
              if (conn != null) { try { conn.close(); } catch (Throwable ignore) {} }
              setJAXBContext(null);
          }
      }
  
      public void update(Element pElement) throws PMException {
          TConnection conn = null;
          try {
              setJAXBContext(getManager().getFactory());
              conn = getTConnection();
              TXMLObjectAccessor accessor = conn.newXMLObjectAccessor(TAccessLocation.newInstance(collection), model);
              accessor.update(getTXMLObject((InoObject) pElement));
          } catch (TServerNotAvailableException e) {
              throw new PMException(e);
          } catch (NamingException e) {
              throw new PMException(e);
          } catch (TUpdateException e) {
              throw new PMException(e);
          } finally {
              if (conn != null) { try { conn.close(); } catch (Throwable ignore) {} }
              setJAXBContext(null);
          }
      }
  
      public void delete(Element pElement) throws PMException {
          TConnection conn = null;
          try {
              setJAXBContext(getManager().getFactory());
              conn = getTConnection();
              TXMLObjectAccessor accessor = conn.newXMLObjectAccessor(TAccessLocation.newInstance(collection), model);
              accessor.delete(getTXMLObject((InoObject) pElement));
          } catch (TServerNotAvailableException e) {
              throw new PMException(e);
          } catch (NamingException e) {
              throw new PMException(e);
          } catch (TDeleteException e) {
              throw new PMException(e);
          } finally {
              if (conn != null) { try { conn.close(); } catch (Throwable ignore) {} }
              setJAXBContext(null);
          }
      }
  }
  
  
  
  1.1                  ws-jaxme/src/pm/org/apache/ws/jaxme/pm/ino/api4j/DocumentDefaultHandler.java
  
  Index: DocumentDefaultHandler.java
  ===================================================================
  package org.apache.ws.jaxme.pm.ino.api4j;
  
  import java.lang.reflect.UndeclaredThrowableException;
  
  import javax.xml.bind.JAXBException;
  
  import org.apache.ws.jaxme.impl.JMUnmarshallerHandlerImpl;
  import org.apache.ws.jaxme.pm.ino.InoObject;
  import org.xml.sax.Attributes;
  import org.xml.sax.Locator;
  import org.xml.sax.SAXException;
  
  import com.softwareag.tamino.db.api.objectModel.sax.TSAXDocument;
  import com.softwareag.tamino.db.api.objectModel.sax.TSAXDocumentDefaultHandler;
  
  
  /**
   * @author <a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
   */
  public class DocumentDefaultHandler extends TSAXDocumentDefaultHandler {
      private static final ThreadLocal handler = new ThreadLocal();
  
      static JMUnmarshallerHandlerImpl getUnmarshallerHandler() {
          return (JMUnmarshallerHandlerImpl) handler.get();
      }
  
      static void setUnmarshallerHandler(JMUnmarshallerHandlerImpl pHandler) {
          handler.set(pHandler);
      }
      
      public DocumentDefaultHandler() {
      }
  
      public void startDocument() throws SAXException {
          getUnmarshallerHandler().startDocument();
      }
  
      public void endDocument() throws SAXException {
          getUnmarshallerHandler().endDocument();
      }
  
      public void startElement(String pNamespaceURI, String pLocalName, String pQName,
  							 Attributes pAttr) throws SAXException {
          getUnmarshallerHandler().startElement(pNamespaceURI, pLocalName, pQName, pAttr);
      }
  
      public void endElement(String pNamespaceURI, String pLocalName, String pQName)
      		throws SAXException {
          getUnmarshallerHandler().endElement(pNamespaceURI, pLocalName, pQName);
      }
  
      public void characters(char[] pBuffer, int pOffset, int pLen) throws SAXException {
          getUnmarshallerHandler().characters(pBuffer, pOffset, pLen);
      }
  
      public void ignorableWhitespace(char[] pBuffer, int pOffset, int pLen) throws SAXException {
          getUnmarshallerHandler().ignorableWhitespace(pBuffer, pOffset, pLen);
      }
  
      public void processingInstruction(String pTarget, String pData) throws SAXException {
          getUnmarshallerHandler().processingInstruction(pTarget, pData);
      }
  
      public void skippedEntity(String pEntity) throws SAXException {
          getUnmarshallerHandler().skippedEntity(pEntity);
      }
  
      public void endPrefixMapping(String pPrefix) throws SAXException {
          getUnmarshallerHandler().endPrefixMapping(pPrefix);
      }
  
      public void startPrefixMapping(String pPrefix, String pNamespaceURI) throws SAXException {
          getUnmarshallerHandler().startPrefixMapping(pPrefix, pNamespaceURI);
      }
  
      public void setDocumentLocator(Locator pLocator) {
          getUnmarshallerHandler().setDocumentLocator(pLocator);
      }
  
      public TSAXDocument getDocument() {
          try {
  	        return new TJMElement((InoObject) getUnmarshallerHandler().getResult());
          } catch (JAXBException e) {
              throw new UndeclaredThrowableException(e);
          }
      }
  }
  
  
  
  1.1                  ws-jaxme/src/pm/org/apache/ws/jaxme/pm/ino/api4j/TJMElement.java
  
  Index: TJMElement.java
  ===================================================================
  package org.apache.ws.jaxme.pm.ino.api4j;
  
  import java.io.Writer;
  import java.lang.reflect.UndeclaredThrowableException;
  
  import javax.xml.bind.JAXBException;
  import javax.xml.namespace.QName;
  
  import org.apache.ws.jaxme.pm.ino.InoObject;
  
  import com.softwareag.tamino.db.api.objectModel.sax.TSAXDocument;
  import com.softwareag.tamino.db.api.objectModel.sax.TSAXElement;
  
  
  /**
   * @author <a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
   */
  public class TJMElement implements TSAXDocument, TSAXElement {
      private final InoObject element;
  
      public TJMElement(InoObject pElement) {
          element = pElement;
      }
  
      public InoObject getJMElement() {
          return element;
      }
  
      public TSAXElement getRootElement() {
          return this;
      }
  
      public void writeTo(Writer pWriter) {
          try {
              TaminoAPI4JPm.getJAXBContext().createMarshaller().marshal(getJMElement(), pWriter);
          } catch (JAXBException e) {
              throw new UndeclaredThrowableException(e);
          }
      }
  
      public void setDocname(String pDocname) {
          element.setInoDocname(pDocname);
      }
  
      public void setId(String pId) {
          element.setInoId(pId);
      }
  
      public String getDoctype() {
          QName qName = element.getQName();
          String prefix = qName.getPrefix();
          if (prefix == null  ||  prefix.length() == 0) {
              return qName.getLocalPart();
          } else {
              return prefix + ':' + qName.getLocalPart();
          }
      }
  
      public String getDocname() {
          String result = element.getInoDocname();
          return result == null ? "" : result;
      }
  
      public String getId() {
          String result = element.getInoId();
          return result == null ? "" : result;
      }
  }
  
  
  
  1.2       +1 -0      ws-jaxme/src/documentation/content/xdocs/pm/book.xml
  
  Index: book.xml
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/documentation/content/xdocs/pm/book.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- book.xml	24 Oct 2003 20:41:36 -0000	1.1
  +++ book.xml	29 Jan 2004 21:35:01 -0000	1.2
  @@ -12,5 +12,6 @@
     <menu label="JaxMePM">
   	<menu-item label="Introduction" href="index.html"/>
   	<menu-item label="JDBC" href="jdbc.html"/>
  +	<menu-item label="Tamino" href="ino.html"/>
     </menu>
   </book>
  
  
  
  1.1                  ws-jaxme/src/documentation/content/xdocs/pm/ino.xml
  
  Index: ino.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.2//EN" "document-v12.dtd">
  <document>
    <header><title>Accessing a Tamino database</title></header>
    <body>
    	<p><link href="ext:tamino">Tamino</link> is a native XML database by
        <link href="ext:sag">Software AG</link>. Compared to a relational
    	  database, it has the disadvantage of being not very popular.
    	  However, if your data is structured (more structured than
    	  conveniently expressible by relational data structures, that is)
    	  you will soon find a lot of advantages and possibly prefer it
    	  over a traditional SQL database engine. From within JaxMe, Tamino
    	  may be accessed in either of three ways:</p>
    	<ul>
    	  <li>Via the XML:DB API, implemented by the
    	  	<link href="../apidocs/org/apache/ws/jaxme/pm/xmldb/XmlDbPM.html">XmlDbPM</link>.
    	  	This is the recommended way if you want your application to be
    	  	portable amongst various XML databases. The XML:DB API is
    	  	being described in a separate document. (To be done.)</li>
    	  <li>Via native HTTP, implemented by the
    	  	<link href="../apidocs/org/apache/ws/jaxme/pm/ino/InoManager.html">InoManager</link>.
    	    This solution is recommended, if you need a very low memory
    	    profile, even for processing a large result set. In particular
    	    it offers a true streaming mode.</li>
    	  <li>Via the official Tamino Java API, called TaminoAPI4J.
    	  	This is recommended for enterprise applications, as it
    	  	allows to embed Tamino into the transactional context of
    	  	an EJB container.</li>
    	</ul>
  
  	<section><title>Preparations</title>
  		<p>Tamino is accessible via two different query languages.
  		  The elder variant is called <em>X-Query</em> and is best
  		  compared with <em>XPath</em>. The newer language is based
  		  on <em>XQuery</em>.
  		</p>
  		<p>XPath and X-Query share an important problem when using
  		  namespaces: They have no mapping between namespace prefixes
  		  and namespace URIs. In other words, if you perform a query
  		  like</p>
  		<source>
  			_xql=ad:Address
  		</source>
  		<p>then the database <em>must know</em>, that the prefix
  		  <code>ad</code> is mapped to the namespace URI
  		  <code>http://ws.apache.org/jaxme/test/misc/address</code>.
  		  </p>
  		<p>Tamino and the JaxMe managers overcome the absence of a
  		  mapping in the query by storing the mapping from the
  		  schema and using that. In other words, if you are
  		  using namespaces, then you should:</p>
  		<ol>
  			<li>Specify a prefix for the namespace in the schema.</li>
  			<li>Use the same schema (and thus the same prefix) for
  				the database schema as well as the JaxMe generator.
  				(Obviously this is recommended anyways.)</li>
  			<li>Use the same prefix for specifying queries.</li>
  		</ol>
  	</section>
  
  	<section><title>Preparing the Tamino Resource Adapter</title>
  		<p>Adding the Tamino Resource Adapter is covered in the
  		  documentation of the TaminoAPI4J. However, we'll provide
  		  specific details for JBoss 3.2 here, because the docs
  		  are for JBoss 3.0 only and because we disagree with
  		  the recommendation to add the Tamino jar files to the
  		  JBoss lib directory. So here's what we've done, step
  		  by step:
  		</p>
  		<ul>
  		  <li>Add the jar file <code>TaminoAPI4J.jar</code>
  		  	to the rar file, for example
  		  	<code>TaminoJCA_localTx.rar</code>. Copy the
  		  	RAR file to the JBoss deploy directory.
  		  </li>
  		  <li>Create a deployment descriptor file <code>tamino-service.xml</code>
  		  	with the following contents and copy it to the
  		  	JBoss deploy directory. (Of course you should adapt
  		  	the database URL, user and password to your local
  		  	settings. Most probably you would also want to change
  		  	the JNDI name <code>MyTaminoLocalTxConnector</code>.
  		  </li>
  		</ul>
  		<source><![CDATA[
  <?xml version="1.0" encoding="UTF-8"?>
  <server>
    <!-- ==================================================================== -->
    <!-- New ConnectionManager setup for Tamino -->
    <!-- ==================================================================== -->
    <mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager"
           name="jboss.jca:service=LocalTxCM,name=MyTaminoLocalTxConnector">
      <attribute name="JndiName">MyTaminoLocalTxConnector</attribute>
  
      <depends optional-attribute-name="ManagedConnectionPool">
        <!--embedded mbean-->
        <mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool"
               name="jboss.jca:service=LocalTxPool,name=MyTaminoLocalTxConnector">
  	    <attribute name="MinSize">0</attribute>
          <attribute name="MaxSize">50</attribute>
  	    <attribute name="BlockingTimeoutMillis">5000</attribute>
  	    <attribute name="IdleTimeoutMinutes">15</attribute>
  	    <!-- criteria indicates if Subject (from security domain) or app supplied
  		     parameters (such as from getConnection(user, pw)) are used to distinguish
  		     connections in the pool. Choices are
  		     ByContainerAndApplication (use both),
  		     ByContainer (use Subject),
  		     ByApplication (use app supplied params only),
  		     ByNothing (all connections are equivalent, usually if adapter supports
  		     reauthentication)-->
  	    <attribute name="Criteria">ByContainer</attribute>
  
  	    <depends optional-attribute-name="ManagedConnectionFactoryName">
  	      <!--embedded mbean-->
  		  <mbean code="org.jboss.resource.connectionmanager.RARDeployment"
  			     name="jboss.jca:service=LocalTxDS,name=MyTaminoLocalTxConnector">
  		    <attribute name="ManagedConnectionFactoryProperties">
  		      <properties>
  			    <config-property name="TaminoURL" type="java.lang.String">http://localhost/tamino/test</config-property>
  			    <config-property name="UserName" type="java.lang.String">ejb</config-property>
  			    <config-property name="Password" type="java.lang.String">xxx</config-property>
  		      </properties>
  		    </attribute>
  
  		    <!--Below here are advanced properties -->
  		    <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=Tamino Resource Adapter for local transactions</depends>
  		  </mbean>
  	    </depends>
  	  </mbean>
      </depends>
      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depends>
      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager</depends>
      <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
  
      <!--make the rar deploy! hack till better deployment-->
      <depends>jboss.jca:service=RARDeployer</depends>
    </mbean>
  </server>
  ]]>   	</source>
  		<ul>
  			<li>The Tamino driver is internally using the method
  			  <code>XMLReaderFactory.createXMLReader()</code>. Unfortunately
  			  this method is using <code>Class.forName(String)</code>
  			  internally to load the SAX driver class. This won't work
  			  in an environment with complex class loaders. In order to
  			  make sure, that the latest SAX version is used, I did the
  			  following:
  			  <ol>
  			  	<li>Downloaded the jar file <code>sax2r2.jar</code> and
  			  	  extracted the jar file <code>sax.jar</code> from it.</li>
  			  	<li>Moved that file to the directory
  			  	  <code>jre/lib/endorsed</code> in my Java SDK directory.</li>
  			  </ol>
  			</li>
  		</ul>
  	</section>
  
  	<section><title>An example schema for TaminoAPI4J</title>
  	  <p>As an example, we'll reuse the schema from the marshaller
  		examples, <code>Address.xsd</code>:</p>
  	  <source><![CDATA[
  <?xml version="1.0" encoding="UTF-8"?>
  
  <xs:schema
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
      xmlns:ad="http://ws.apache.org/jaxme/test/misc/address"
      xmlns:inoapi="http://ws.apache.org/jaxme/namespaces/jaxme2/TaminoAPI4J"
      jaxb:extensionBindingPrefixes="xjc inoapi"
      xml:lang="EN"
      targetNamespace="http://ws.apache.org/jaxme/test/misc/address"
      elementFormDefault="qualified"
      attributeFormDefault="unqualified">
    <xs:annotation>
      <xs:documentation>
        A simple JaxMe example: Personal address collection.
      </xs:documentation>
      <xs:appinfo>
        <jaxb:globalBindings>
          <xjc:serializable/>
          <inoapi:raDetails collection="adr" jndiReference="java:MyTaminoLocalTxConnector"/>
        </jaxb:globalBindings>
        <tsd:schemaInfo name="Address">
          <tsd:collection name="adr"></tsd:collection>
        </tsd:schemaInfo>
      </xs:appinfo>
    </xs:annotation>
  
    <xs:element name="Address">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="Name">
  		  ...
  		</xs:element>
  	  </xs:sequence>
  	</xs:complexType>
    </xs:element>
  </xs:schema>
  ]]>   	</source>
  	    <p>Ignoring the details of the actual <code>Address</code> type,
  	      we only note the differences in the schema header:
  	    </p>
  	    <ul>
  	      <li>A namespace prefix <code>ad</code> is specified for the
  	      	target namespace. In the previous section we have discussed,
  	      	that this is a precondition.</li>
  	      <li>The element <code>xjc:serializable</code> element requests,
  	      	that the generated classes implement the interface
  	      	<code>java.io.Serializable</code>. This is required for
  	      	use within an EJB container, as the objects wouldn't be
  	      	serializable otherwise. The <code>xjc:serializable</code>
  	      	is a vendor extension from the JAXB RI and supported
  	      	by JaxMe too.</li>
  	      <li>The element <code>tsd:schemaInfo</code> fixes the
  	      	schema and collection name. This element is read by
  	      	Tamino when creating the schema. It is ignored by
  	      	JaxMe.</li>
  	      <li>The element <code>inoapi:raDetails</code> specifies
  	      	the same collection name and a JNDI name. The latter
  	      	name is used to lookup the Tamino resource adapter.</li>
  	      <li>The JAXB specification requires, that the element
  	      	<code>jaxb:globalBindings</code> contains no elements
  	      	from other namespace than <code>jaxb</code>. To add
  	      	vendor extensions like <code>xjc:serializable</code>
  	      	and <code>inoapi:raDetails</code>, we need to add
  	      	the attribute
  	      	<code>jaxb:extensionBindingPrefixes="jaxb inoapi"</code>
  	      	to <code>xs:schema</code>.</li>
  	    </ul>
  	</section>
  
  	<section><title>Build your own JaxMe distribution</title>
  		<p>For licensing reasons, we cannot add the files
  		  <code>TaminoAPI4J.jar</code> and
  		  <code>TaminoJCA.jar</code> to the JaxMe CVS repository.
  		  In particular we cannot offer compiled classes based
  		  on these files in the JaxMe distribution. Unfortunately
  		  that means, that you have to build your own distribution.
  		  Fortunately, this is quite simple:</p>
  		<ul>
  		  <li>Download the JaxMe source distribution (to be
  		  	distinguished from the JaxMe binary distributon)
  		  	and extract it.</li>
  		  <li>Download the TaminoAPI4J distribution and install
  		  	it. Copy the files <code>TaminoAPI4J.jar</code>
  		  	and <code>TaminoJCA.jar</code> to the subdirectory
  		  	<code>prerequisites</code> in the JaxMe directory.</li>
  		  <li>Change to the JaxMe directory and run <code>ant</code>.
  		  	The build script will automatically detect the presence
  		  	of the Tamino API files.</li>
  		</ul>
  		<note>
  		  As of this writing, there is no official JaxMe distribution
  		  available, which includes the Tamino support. In other words,
  		  rather than downloading the sources you have to extract them
  		  from the JaxMe CVS repository.
  		</note>
  	</section>
  
  	<section><title>Creating an Ant task</title>
  		<p>To invoke the JaxMe generator, use an Ant task like
  		  the following:</p>
  		<source><![CDATA[
  	<target name="generate">
        <taskdef name="xjc" classname="org.apache.ws.jaxme.generator.XJCTask">
          <classpath>
  		  <fileset dir="lib" includes="jaxme*.jar"/>
  		  <fileset dir="lib" includes="log4j-1.2.8.jar"/>
          </classpath>
        </taskdef>
  	  <mkdir dir="${build.src}"/>
        <xjc target="${build.src}">
          <schema dir="${etc}" includes="*.xsd"/>
          <produces dir="${build.src}" includes="org/apache/ws/jaxme/test/misc/address/**/*"/>
          <sgFactoryChain className="org.apache.ws.jaxme.generator.ino.api4j.TaminoAPI4JSG"/>
          <schemaReader className="org.apache.ws.jaxme.generator.sg.impl.JaxMeSchemaReader"/>
        </xjc>
  	</target>
  ]]>   	</source>
  	</section>
  
  	<section><title>Using the native HTTP API</title>
  		<p>Not yet documented. (To be done.)</p>
  	</section>
    </body>
  </document>
  
  
  
  1.7       +1 -0      ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBGroupSG.java
  
  Index: JAXBGroupSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBGroupSG.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JAXBGroupSG.java	24 Jan 2004 22:16:46 -0000	1.6
  +++ JAXBGroupSG.java	29 Jan 2004 21:35:01 -0000	1.7
  @@ -170,6 +170,7 @@
       JavaSourceFactory jsf = getSchema().getJavaSourceFactory();
       JavaSource js = jsf.newJavaSource(qName, JavaSource.PUBLIC);
       js.addImplements(pController.getClassContext().getXMLInterfaceName());
  +    SerializableSG.makeSerializable(pController.getSchema(), js);
       pController.generateProperties(js);
       return js;
     }
  
  
  
  1.4       +10 -2     ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java
  
  Index: JAXBObjectSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBObjectSG.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JAXBObjectSG.java	24 Jan 2004 22:16:46 -0000	1.3
  +++ JAXBObjectSG.java	29 Jan 2004 21:35:01 -0000	1.4
  @@ -252,6 +252,7 @@
       JavaQName xmlImplementationName = pController.getClassContext().getXMLImplementationName();
       JavaSourceFactory jsf = getSchema().getJavaSourceFactory();
       JavaSource js = jsf.newJavaSource(xmlImplementationName, JavaSource.PUBLIC);
  +    SerializableSG.makeSerializable(pController.getSchema(), js);
       js.addImplements(pController.getClassContext().getXMLInterfaceName());
       js.addImplements(JMElement.class);
   
  @@ -268,8 +269,15 @@
       myName.setStatic(true);
       myName.setFinal(true);
       XsQName qName = pController.getName();
  -    myName.addLine("new ", QName.class, "(", JavaSource.getQuoted(qName.getNamespaceURI()),
  -                   ", ", JavaSource.getQuoted(qName.getLocalName()), ")");
  +    String prefix = qName.getPrefix();
  +    if (prefix == null) {
  +	    myName.addLine("new ", QName.class, "(", JavaSource.getQuoted(qName.getNamespaceURI()),
  +	                   ", ", JavaSource.getQuoted(qName.getLocalName()), ")");
  +    } else {
  +        myName.addLine("new ", QName.class, "(", JavaSource.getQuoted(qName.getNamespaceURI()),
  +                	   ", ", JavaSource.getQuoted(qName.getLocalName()), ", ",
  +					   JavaSource.getQuoted(prefix), ")");
  +    }
   
       JavaMethod getQName = js.newJavaMethod("getQName", QName.class, JavaSource.PUBLIC);
       getQName.addLine("return ", myName, ";");
  
  
  
  1.9       +4 -2      ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBComplexTypeSG.java
  
  Index: JAXBComplexTypeSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JAXBComplexTypeSG.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JAXBComplexTypeSG.java	8 Jan 2004 09:37:49 -0000	1.8
  +++ JAXBComplexTypeSG.java	29 Jan 2004 21:35:01 -0000	1.9
  @@ -242,7 +242,7 @@
   		JavaSourceFactory jsf = pController.getTypeSG().getSchema().getJavaSourceFactory();
   		JavaSource js = jsf.newJavaSource(qName, JavaSource.PUBLIC);
   		js.setType(JavaSource.INTERFACE);
  -		
  +
   		generateProperties(pController, js);
   		if (!pController.hasSimpleContent()) {
   			GroupSG groupSG = pController.getComplexContentSG().getGroupSG();
  @@ -278,7 +278,8 @@
   		JavaSourceFactory jsf = pController.getTypeSG().getSchema().getJavaSourceFactory();
   		JavaSource js = jsf.newJavaSource(pController.getClassContext().getXMLImplementationName(), JavaSource.PUBLIC);
   		js.addImplements(pController.getClassContext().getXMLInterfaceName());
  -		
  +		SerializableSG.makeSerializable(pController.getTypeSG().getSchema(), js);
  +
   		generateProperties(pController, js);
   		if (!pController.hasSimpleContent()) {
   			GroupSG groupSG = pController.getComplexContentSG().getGroupSG();
  @@ -296,6 +297,7 @@
   		JavaSource js = pSource.newJavaInnerClass(pController.getClassContext().getXMLImplementationName().getInnerClassName(), JavaSource.PUBLIC);
   		js.setStatic(true);
   		js.addImplements(pController.getClassContext().getXMLInterfaceName());
  +		SerializableSG.makeSerializable(pController.getTypeSG().getSchema(), js);
   		
   		generateProperties(pController, js);
   		if (!pController.hasSimpleContent()) {
  
  
  
  1.4       +103 -52   ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JaxMeSchemaReader.java
  
  Index: JaxMeSchemaReader.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/JaxMeSchemaReader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JaxMeSchemaReader.java	7 Jan 2004 02:07:19 -0000	1.3
  +++ JaxMeSchemaReader.java	29 Jan 2004 21:35:01 -0000	1.4
  @@ -55,69 +55,120 @@
   import org.apache.ws.jaxme.generator.Generator;
   import org.apache.ws.jaxme.generator.sg.SGFactory;
   import org.apache.ws.jaxme.generator.sg.SGFactoryChain;
  +import org.apache.ws.jaxme.xs.jaxb.JAXBGlobalBindings;
   import org.apache.ws.jaxme.xs.jaxb.impl.JAXBAppinfoImpl;
  +import org.apache.ws.jaxme.xs.jaxb.impl.JAXBGlobalBindingsImpl;
   import org.apache.ws.jaxme.xs.jaxb.impl.JAXBXsObjectFactoryImpl;
   import org.apache.ws.jaxme.xs.parser.XsObjectCreator;
  +import org.apache.ws.jaxme.xs.parser.impl.LocSAXException;
   import org.apache.ws.jaxme.xs.xml.XsEAppinfo;
   import org.apache.ws.jaxme.xs.xml.XsObject;
   import org.apache.ws.jaxme.xs.xml.XsObjectFactory;
  +import org.apache.ws.jaxme.xs.xml.XsQName;
  +import org.xml.sax.Locator;
  +import org.xml.sax.SAXException;
   
   
   /**
    * @author <a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
    */
   public class JaxMeSchemaReader extends JAXBSchemaReader {
  -  public static final String JAXME_SCHEMA_URI = "http://ws.apache.org/jaxme/namespaces/jaxme2";
  +    public static final String JAXME_SCHEMA_URI = "http://ws.apache.org/jaxme/namespaces/jaxme2";
  +    public static final String XJC_SCHEMA_URI = "http://java.sun.com/xml/ns/jaxb/xjc";
   
  -  public JaxMeSchemaReader() {
  -  	super.setSupportingExtensions(true);
  -  }
  -
  -  public class JaxMeAppinfoImpl extends JAXBAppinfoImpl {
  -    JaxMeAppinfoImpl(XsObject pParent) {
  -      super(pParent);
  -    }
  -
  -    protected XsObjectCreator[] getXsObjectCreators() {
  -      XsObjectCreator[] baseResult = super.getXsObjectCreators();
  -      List myXsObjectCreators = JaxMeSchemaReader.this.getXsObjectCreators();
  -      List result;
  -      if (baseResult == null  ||  baseResult.length == 0) {
  -        result = myXsObjectCreators;
  -      } else {
  -        result = new ArrayList(baseResult.length + myXsObjectCreators.size());
  -        result.addAll(Arrays.asList(baseResult));
  -        result.addAll(myXsObjectCreators);
  -      }
  -      return (XsObjectCreator[]) myXsObjectCreators.toArray(new XsObjectCreator[myXsObjectCreators.size()]);
  -    }
  -  }
  -
  -  public class JaxMeXsObjectFactory extends JAXBXsObjectFactoryImpl {
  -    public XsEAppinfo newXsEAppinfo(XsObject pParent) {
  -      return new JaxMeAppinfoImpl(pParent);
  -    }
  -  }
  -
  -  private List xsObjectCreators = new ArrayList();
  -  protected List getXsObjectCreators() {
  -    return xsObjectCreators;
  -  }
  -
  -  public void addXsObjectCreator(XsObjectCreator pCreator) {
  -    if (pCreator == null) {
  -      throw new NullPointerException("The object creator must not be null.");
  -    }
  -    xsObjectCreators.add(pCreator);
  -  }
  -
  -  public SGFactoryChain newSGFactoryChain(Generator pGenerator) {
  -    SGFactoryChain result = super.newSGFactoryChain(pGenerator);
  -    result = new SGFactoryChainImpl(result){
  -      public XsObjectFactory newXsObjectFactory(SGFactory pFactory) {
  -        return new JaxMeXsObjectFactory();
  -      }
  -    };
  -    return result;
  -  }
  +    public JaxMeSchemaReader() {
  +        super.setSupportingExtensions(true);
  +    }
  +
  +    private XsObjectCreator[] append(XsObjectCreator[] pBase) {
  +        XsObjectCreator[] baseResult = pBase;
  +        List myXsObjectCreators = JaxMeSchemaReader.this.getXsObjectCreators();
  +        List result;
  +        if (baseResult == null  ||  baseResult.length == 0) {
  +            result = myXsObjectCreators;
  +        } else {
  +            result = new ArrayList(baseResult.length + myXsObjectCreators.size());
  +            result.addAll(Arrays.asList(baseResult));
  +            result.addAll(myXsObjectCreators);
  +        }
  +        return (XsObjectCreator[]) myXsObjectCreators.toArray(new XsObjectCreator[myXsObjectCreators.size()]);
  +    }
  +
  +    public class JaxMeAppinfoImpl extends JAXBAppinfoImpl {
  +        JaxMeAppinfoImpl(XsObject pParent) {
  +            super(pParent);
  +        }
  +
  +        protected XsObjectCreator[] getXsObjectCreators() {
  +            return append(super.getXsObjectCreators());
  +        }
  +    }
  +
  +    public class JaxMeGlobalBindingsImpl extends JAXBGlobalBindingsImpl {
  +        protected JaxMeGlobalBindingsImpl(XsObject pParent) {
  +            super(pParent);
  +        }
  +
  +        protected XsObjectCreator[] getXsObjectCreators() {
  +            return append(super.getXsObjectCreators());
  +        }
  +
  +
  +        protected XsObject getBeanByParent(XsObject pParent, Locator pLocator, XsQName pQName)
  +        		throws SAXException {
  +            if (XJC_SCHEMA_URI.equals(pQName.getNamespaceURI())) {
  +                if ("serializable".equals(pQName.getLocalName())) {
  +                    if (getXjcSerializable() != null) {
  +                        throw new LocSAXException("The element xjc:serializable was already specified.", pLocator);
  +                    }
  +                    XjcSerializable s = new XjcSerializable(pParent);
  +                    setXjcSerializable(s);
  +                    return s;
  +                }
  +            }
  +            XsObject result = super.getBeanByParent(pParent, pLocator, pQName);
  +            return result;
  +        }
  +    }
  +
  +    public class JaxMeXsObjectFactory extends JAXBXsObjectFactoryImpl {
  +        public XsEAppinfo newXsEAppinfo(XsObject pParent) {
  +            return new JaxMeAppinfoImpl(pParent);
  +        }
  +        public JAXBGlobalBindings newJAXBGlobalBindings(XsObject pParent) {
  +            return new JaxMeGlobalBindingsImpl(pParent);
  +        }
  +    }
  +
  +    private XjcSerializable xjcSerializable;
  +    private List xsObjectCreators = new ArrayList();
  +    protected List getXsObjectCreators() {
  +        return xsObjectCreators;
  +    }
  +
  +    public void addXsObjectCreator(XsObjectCreator pCreator) {
  +        if (pCreator == null) {
  +            throw new NullPointerException("The object creator must not be null.");
  +        }
  +        xsObjectCreators.add(pCreator);
  +    }
  +
  +    public SGFactoryChain newSGFactoryChain(Generator pGenerator) {
  +        SGFactoryChain result = super.newSGFactoryChain(pGenerator);
  +        result = new SGFactoryChainImpl(result){
  +            public XsObjectFactory newXsObjectFactory(SGFactory pFactory) {
  +                return new JaxMeXsObjectFactory();
  +            }
  +        };
  +        
  +        return result;
  +    }
  +
  +    public XjcSerializable getXjcSerializable() {
  +        return xjcSerializable;
  +    }
  +
  +    public void setXjcSerializable(XjcSerializable pXjcSerializable) {
  +        xjcSerializable = pXjcSerializable;
  +    }
   }
  
  
  
  1.1                  ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/XjcSerializable.java
  
  Index: XjcSerializable.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above 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 the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The name "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``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 THE APACHE SOFTWARE FOUNDATION 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.apache.ws.jaxme.generator.sg.impl;
  
  import org.apache.ws.jaxme.xs.xml.XsObject;
  import org.apache.ws.jaxme.xs.xml.impl.XsObjectImpl;
  
  
  /** <p>An instance of this class may be used to specify that the
   * generated classes should be serializable. The instance will
   * also customize the serialization.</p>
   *
   * @author <a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
   */
  public class XjcSerializable extends XsObjectImpl {
      protected XjcSerializable(XsObject pParent) {
          super(pParent);
      }
  
      private String uid;
  
      public String getUid() {
          return uid;
      }
  
      public void setUid(String pUid) {
          uid = pUid;
      }
  }
  
  
  
  1.1                  ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/SerializableSG.java
  
  Index: SerializableSG.java
  ===================================================================
  package org.apache.ws.jaxme.generator.sg.impl;
  
  import java.io.Serializable;
  
  import org.apache.ws.jaxme.generator.SchemaReader;
  import org.apache.ws.jaxme.generator.sg.SchemaSG;
  import org.apache.ws.jaxme.js.JavaQName;
  import org.apache.ws.jaxme.js.JavaQNameImpl;
  import org.apache.ws.jaxme.js.JavaSource;
  
  /**
   * @author <a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
   */
  public class SerializableSG {
      private static final JavaQName SERIALIZABLE_TYPE = JavaQNameImpl.getInstance(Serializable.class);
  
      public static void makeSerializable(SchemaSG pSchema, JavaSource pSource) {
          SchemaReader sr = pSchema.getFactory().getGenerator().getSchemaReader();
          if (sr instanceof JaxMeSchemaReader) {
              JaxMeSchemaReader jsr = (JaxMeSchemaReader) sr;
              XjcSerializable xjcSerializable = jsr.getXjcSerializable();
              if (xjcSerializable != null) {
                  if (!pSource.isImplementing(SERIALIZABLE_TYPE)) {
                      pSource.addImplements(SERIALIZABLE_TYPE);
                  }
                  if (xjcSerializable.getUid() != null) {
                      throw new IllegalStateException("The attribute xjc:serializable/@uid is not yet supported.");
                  }
              }
          }
      }
  }
  
  
  
  1.1                  ws-jaxme/src/pm/org/apache/ws/jaxme/generator/ino/api4j/TaminoAPI4JSG.java
  
  Index: TaminoAPI4JSG.java
  ===================================================================
  package org.apache.ws.jaxme.generator.ino.api4j;
  
  import java.util.HashSet;
  import java.util.Set;
  
  import org.apache.ws.jaxme.JMElement;
  import org.apache.ws.jaxme.generator.SchemaReader;
  import org.apache.ws.jaxme.generator.sg.AttributeSG;
  import org.apache.ws.jaxme.generator.sg.AttributeSGChain;
  import org.apache.ws.jaxme.generator.sg.ObjectSG;
  import org.apache.ws.jaxme.generator.sg.ObjectSGChain;
  import org.apache.ws.jaxme.generator.sg.SGFactory;
  import org.apache.ws.jaxme.generator.sg.SGFactoryChain;
  import org.apache.ws.jaxme.generator.sg.SchemaSGChain;
  import org.apache.ws.jaxme.generator.sg.TypeSG;
  import org.apache.ws.jaxme.generator.sg.impl.AttributeSGImpl;
  import org.apache.ws.jaxme.generator.sg.impl.JaxMeSchemaReader;
  import org.apache.ws.jaxme.generator.sg.impl.ObjectSGChainImpl;
  import org.apache.ws.jaxme.generator.sg.impl.SGFactoryChainImpl;
  import org.apache.ws.jaxme.js.JavaQName;
  import org.apache.ws.jaxme.js.JavaQNameImpl;
  import org.apache.ws.jaxme.js.JavaSource;
  import org.apache.ws.jaxme.pm.ino.InoObject;
  import org.apache.ws.jaxme.pm.ino.InoResponseHandler;
  import org.apache.ws.jaxme.xs.XSAnnotation;
  import org.apache.ws.jaxme.xs.XSAttribute;
  import org.apache.ws.jaxme.xs.XSElement;
  import org.apache.ws.jaxme.xs.XSObject;
  import org.apache.ws.jaxme.xs.XSSchema;
  import org.apache.ws.jaxme.xs.XSType;
  import org.apache.ws.jaxme.xs.jaxb.JAXBAttribute;
  import org.apache.ws.jaxme.xs.jaxb.JAXBGlobalBindings;
  import org.apache.ws.jaxme.xs.jaxb.JAXBJavadoc;
  import org.apache.ws.jaxme.xs.jaxb.JAXBProperty;
  import org.apache.ws.jaxme.xs.jaxb.JAXBSchemaBindings;
  import org.apache.ws.jaxme.xs.jaxb.JAXBType;
  import org.apache.ws.jaxme.xs.parser.XsObjectCreator;
  import org.apache.ws.jaxme.xs.parser.impl.LocSAXException;
  import org.apache.ws.jaxme.xs.types.XSString;
  import org.apache.ws.jaxme.xs.xml.XsESchema;
  import org.apache.ws.jaxme.xs.xml.XsObject;
  import org.apache.ws.jaxme.xs.xml.XsObjectFactory;
  import org.apache.ws.jaxme.xs.xml.XsQName;
  import org.apache.ws.jaxme.xs.xml.impl.XsObjectImpl;
  import org.xml.sax.Attributes;
  import org.xml.sax.Locator;
  import org.xml.sax.SAXException;
  import org.xml.sax.helpers.AttributesImpl;
  
  /**
   * @author <a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
   */
  public class TaminoAPI4JSG extends SGFactoryChainImpl {
      public static final String TAMINOAPI4J_SCHEMA_URI = "http://ws.apache.org/jaxme/namespaces/jaxme2/TaminoAPI4J";
      private static final JavaQName INO_OBJECT_TYPE = JavaQNameImpl.getInstance(InoObject.class);
      private static final JavaQName JMELEMENT_TYPE = JavaQNameImpl.getInstance(JMElement.class);
  
      public class RaDetails extends XsObjectImpl {
          private String collection, jndiReference;
          RaDetails(XsObject pParent) {
              super(pParent);
          }
          public void setCollection(String pCollection) {
              collection = pCollection;
          }
          public String getCollection() {
              String p = "taminoapi4j.collection";
              return sgFactory.getGenerator().getProperty(p, collection);
          }
          public void setJndiReference(String pReference) {
              jndiReference = pReference;
          }
          public String getJndiReference() {
              String p = "taminoapi4j.jndiReference";
              return sgFactory.getGenerator().getProperty(p, jndiReference);
          }
      }
  
      private RaDetails raDetails;
      private SGFactory sgFactory;
  
      public TaminoAPI4JSG(SGFactoryChain o) {
          super(o);
      }
  
      public void setRaDetails(RaDetails pDetails) {
          raDetails = pDetails;
      }
      public RaDetails getRaDetails() {
          return raDetails;
      }
      
      public void init(SGFactory pFactory) {
          super.init(pFactory);
          sgFactory = pFactory;
          SchemaReader schemaReader = pFactory.getGenerator().getSchemaReader();
          if (schemaReader instanceof JaxMeSchemaReader) {
              JaxMeSchemaReader jaxmeSchemaReader = (JaxMeSchemaReader) schemaReader;
              jaxmeSchemaReader.addXsObjectCreator(new XsObjectCreator(){
                  public XsObject newBean(XsObject pParent, Locator pLocator, XsQName pQName) throws SAXException {
                      if (pParent instanceof JAXBGlobalBindings) {
                          if (TAMINOAPI4J_SCHEMA_URI.equals(pQName.getNamespaceURI())) {
                              if ("raDetails".equals(pQName.getLocalName())) {
                                  if (getRaDetails() != null) {
                                      throw new LocSAXException("An element named " + pQName + " has already been specified.",
                                              				  pLocator);
                                  }
                                  RaDetails details = new RaDetails(pParent);
                                  setRaDetails(details);
                                  return details;
                              } else {
                                  throw new LocSAXException("Invalid element name: " + pQName, pLocator);
                              }
                          }
                      }
                      return null;
                  }
              });
          } else {
              throw new IllegalStateException("The schema reader " + schemaReader.getClass().getName() +
                      " is not an instance of " + JaxMeSchemaReader.class.getName());
          }
      }
  
      public Object newSchemaSG(SGFactory pController, XSSchema pSchema) throws SAXException {
          SchemaSGChain chain = (SchemaSGChain) super.newSchemaSG(pController, pSchema);
          chain = new TaminoAPI4JSchemaSG(chain, this);
          return chain;
      }
  
      private class InoJAXBProperty implements JAXBProperty {
          private final String name;
          public InoJAXBProperty(String pName) {
              name = pName;
          }
          public String getName() { return name; }
          public String getCollectionType() { return null; }
          public Boolean isFixedAttributeAsConstantProperty() { return null; }
          public Boolean isGenerateIsSetMethod() { return null; }
          public Boolean isEnableFailFastCheck() { return null; }
          public JAXBJavadoc getJavadoc() { return null; }
          public BaseType getBaseType() { return null; }
          public XsESchema getXsESchema() { return null; }
          public boolean isTopLevelObject() { return false; }
          public XsObject getParentObject() { return null; }
          public XsObjectFactory getObjectFactory() { return null; }
          public Locator getLocator() { return null; }
          public void validate() throws SAXException {
          }
      }
  
      private class InoAttribute implements JAXBAttribute {
          private final XsQName qName;
          private final XSType type;
          private final XSType parent;
          private final JAXBProperty jaxbProperty;
  
          public InoAttribute(XSType pParent, XsQName pName, XSType pType, String pPropertyName) {
              qName = pName;
              type = pType;
              parent = pParent;
              jaxbProperty = new InoJAXBProperty(pPropertyName);
          }
          public boolean isGlobal() { return true; }
          public XsQName getName() { return qName; }
          public XSType getType() { return type; }
          public boolean isOptional() { return true; }
          public XSAnnotation[] getAnnotations() { return new XSAnnotation[0]; }
          public String getDefault() { return null; }
          public String getFixed() { return null; }
          public Attributes getOpenAttributes() { return new AttributesImpl(); }
          public XSSchema getXSSchema() { return parent.getXSSchema(); }
          public boolean isTopLevelObject() { return true; }
          public XSObject getParentObject() { return null; }
          public Locator getLocator() { return parent.getLocator(); }
          public void validate() throws SAXException {
          }
          public JAXBSchemaBindings getJAXBSchemaBindings() {
              return ((JAXBType) parent).getJAXBSchemaBindings();
          }
          public JAXBProperty getJAXBProperty() {
              return jaxbProperty;
          }
      }
  
      protected void addAttribute(TypeSG pComplexTypeSG, XSType pParent,
  								XsQName pName, XSType pType, String pPropertyName)
      		throws SAXException {
          AttributeSG[] attrs = pComplexTypeSG.getComplexTypeSG().getAttributes();
          for (int i = 0;  i < attrs.length;  i++) {
              AttributeSG attr = attrs[i];
              if (attr.isWildcard()) {
                  continue;
              }
  			XsQName qName = attr.getName();
  			if (qName.equals(pName)) {
  			    return;
              }
          }
  
          XSAttribute attribute = new InoAttribute(pParent, pName, pType, pPropertyName);
          AttributeSGChain chain = (AttributeSGChain) pComplexTypeSG.getComplexTypeSG().newAttributeSG(attribute);
          AttributeSG attributeSG = new AttributeSGImpl(chain);
          pComplexTypeSG.getComplexTypeSG().addAttributeSG(attributeSG);
      }
  
      public Object newObjectSG(SGFactory pFactory, XSElement pElement) throws SAXException {
          ObjectSGChain chain = (ObjectSGChain) super.newObjectSG(pFactory, pElement);
          chain = new ObjectSGChainImpl(chain){
              public JavaSource getXMLImplementation(ObjectSG pController) throws SAXException {
                  JavaSource result = super.getXMLImplementation(pController);
                  JavaQName[] interfaces = result.getImplements();
                  boolean done = false;
                  result.clearImplements();
                  for (int i = 0;  i < interfaces.length;  i++) {
                      JavaQName interfaceName = interfaces[i];
                      if (interfaceName.equals(JMELEMENT_TYPE)  ||
                          interfaceName.equals(INO_OBJECT_TYPE)) {
                          if (!done) {
                              result.addImplements(INO_OBJECT_TYPE);
                              done = true;
                          } 
                      } else {
                          result.addImplements(interfaceName);
                      }
                  }
                  if (!done) {
                      result.addImplements(INO_OBJECT_TYPE);
                  } 
                  return result;
              }
          };
          return chain;
      }
  
      private Set elementNames = new HashSet();
      public ObjectSG getObjectSG(SGFactory pFactory, XSElement pElement) throws SAXException {
          ObjectSG result = super.getObjectSG(pFactory, pElement);
          XsQName elementName = pElement.getName();
          if (!elementNames.contains(elementName)) {
              elementNames.add(elementName);
  	        // Does the element have an ino:id attribute? If not, create it
  	        XsQName qName = new XsQName(InoResponseHandler.INO_RESPONSE2_URI, "id", "ino");
  	        XSType stringType = XSString.getInstance();
  	        addAttribute(result.getTypeSG(), pElement.getType(), qName, stringType, "inoId");
  	        // Does the element have an ino:docname attribute? If not, create it
  	        qName = new XsQName(InoResponseHandler.INO_RESPONSE2_URI, "docname", "ino");
  	        addAttribute(result.getTypeSG(), pElement.getType(), qName, stringType, "inoDocname");
          }
          return result;
      }
  }
  
  
  
  1.1                  ws-jaxme/src/pm/org/apache/ws/jaxme/generator/ino/api4j/TaminoAPI4JSchemaSG.java
  
  Index: TaminoAPI4JSchemaSG.java
  ===================================================================
  package org.apache.ws.jaxme.generator.ino.api4j;
  
  import java.util.Iterator;
  import java.util.List;
  
  import org.apache.ws.jaxme.generator.sg.ObjectSG;
  import org.apache.ws.jaxme.generator.sg.SchemaSG;
  import org.apache.ws.jaxme.generator.sg.SchemaSGChain;
  import org.apache.ws.jaxme.generator.sg.TypeSG;
  import org.apache.ws.jaxme.generator.sg.impl.SchemaSGChainImpl;
  import org.apache.ws.jaxme.impl.JAXBContextImpl;
  import org.apache.ws.jaxme.pm.ino.api4j.TaminoAPI4JPm;
  import org.w3c.dom.Document;
  import org.w3c.dom.Element;
  import org.w3c.dom.Node;
  import org.xml.sax.SAXException;
  
  /**
   * @author <a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
   */
  public class TaminoAPI4JSchemaSG extends SchemaSGChainImpl {
      private final TaminoAPI4JSG baseSG;
  
      public TaminoAPI4JSchemaSG(SchemaSGChain pChain, TaminoAPI4JSG pBaseSG) {
          super(pChain);
          baseSG = pBaseSG;
      }
  
      protected TaminoAPI4JSG getBaseSG() {
          return baseSG;
      }
  
      private Element createProperty(Element pParent, String pName, String pValue) {
          Element element = pParent.getOwnerDocument().createElementNS(JAXBContextImpl.CONFIGURATION_URI, "Property");
          pParent.appendChild(element);
          element.setAttributeNS(null, "name", pName);
          element.setAttributeNS(null, "value", pValue);
          return element;
      }
  
      public Document getConfigFile(SchemaSG pController, String pPackageName,
  								  List pContextList) throws SAXException {
          final String uri = JAXBContextImpl.CONFIGURATION_URI;
          final Document doc = super.getConfigFile(pController, pPackageName, pContextList);
          final Element root = doc.getDocumentElement();
          final Iterator iter = pContextList.iterator();
          TaminoAPI4JSG.RaDetails details = baseSG.getRaDetails();
          for (Node node = root.getFirstChild();  node != null;  node = node.getNextSibling()) {
              if (node.getNodeType() == Node.ELEMENT_NODE
                      &&  JAXBContextImpl.CONFIGURATION_URI.equals(node.getNamespaceURI())
                      &&  "Manager".equals(node.getLocalName())) {
                  Element manager = (Element) node;
                  final ObjectSG objectSG = (ObjectSG) iter.next();
                  final TypeSG typeSG = objectSG.getTypeSG();
                  if (typeSG.isComplex()) {
                      manager.setAttributeNS(uri, "pmClass", TaminoAPI4JPm.class.getName());
                  }
  
                  if (details != null) {
                      String collection = details.getCollection();
                      if (collection != null  &&  collection.length() > 0) {
                          createProperty(manager, "collection", collection);
                      }
                      String jndiRef = details.getJndiReference();
                      if (jndiRef != null  &&  jndiRef.length() > 0) {
                          createProperty(manager, "jndiReference", jndiRef);
                      }
                  }
              }
          }
          if (iter.hasNext()) {
              throw new IllegalStateException("More managers expected than found");
          }
          return doc;
      }
  }
  
  
  
  1.9       +1 -0      ws-jaxme/src/documentation/content/xdocs/site.xml
  
  Index: site.xml
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/documentation/content/xdocs/site.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- site.xml	1 Jan 2004 17:51:00 -0000	1.8
  +++ site.xml	29 Jan 2004 21:35:01 -0000	1.9
  @@ -95,6 +95,7 @@
         <mysql href=""/>
       </www.mysql.com>
       <www.softwareag.com href="http://www.softwareag.com/">
  +      <sag href=""/>
         <tamino href="tamino/"/>
       </www.softwareag.com>
       <www.thecortex.net href="http://www.thecortex.net/">
  
  
  
  1.1                  ws-jaxme/src/pm/org/apache/ws/jaxme/pm/ino/InoObject.java
  
  Index: InoObject.java
  ===================================================================
  package org.apache.ws.jaxme.pm.ino;
  
  import org.apache.ws.jaxme.JMElement;
  
  /** <p>Interface of a document stored in Tamino.</p>
   *
   * @author <a href="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
   */
  public interface InoObject extends JMElement {
      public void setInoDocname(String pDocname);
  
      public void setInoId(String pId);
  
      public String getInoDocname();
  
      public String getInoId();
  }
  
  
  
  1.3       +49 -16    ws-jaxme/src/xs/org/apache/ws/jaxme/xs/jaxb/impl/JAXBGlobalBindingsImpl.java
  
  Index: JAXBGlobalBindingsImpl.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/xs/org/apache/ws/jaxme/xs/jaxb/impl/JAXBGlobalBindingsImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JAXBGlobalBindingsImpl.java	2 Nov 2003 17:01:53 -0000	1.2
  +++ JAXBGlobalBindingsImpl.java	29 Jan 2004 21:35:01 -0000	1.3
  @@ -60,6 +60,7 @@
   import org.apache.ws.jaxme.xs.jaxb.JAXBJavaType;
   import org.apache.ws.jaxme.xs.jaxb.JAXBXsObjectFactory;
   import org.apache.ws.jaxme.xs.jaxb.JAXBXsSchema;
  +import org.apache.ws.jaxme.xs.parser.XsObjectCreator;
   import org.apache.ws.jaxme.xs.parser.impl.LocSAXException;
   import org.apache.ws.jaxme.xs.types.XSBase64Binary;
   import org.apache.ws.jaxme.xs.types.XSDate;
  @@ -78,6 +79,7 @@
   import org.apache.ws.jaxme.xs.xml.XsQName;
   import org.apache.ws.jaxme.xs.xml.impl.XsObjectImpl;
   import org.xml.sax.ContentHandler;
  +import org.xml.sax.Locator;
   import org.xml.sax.SAXException;
   import org.xml.sax.helpers.DefaultHandler;
   
  @@ -241,31 +243,62 @@
       }
     }
   
  -  public ContentHandler getChildHandler(String pQName, String pNamespaceURI,
  -                                         String pLocalName) throws SAXException {
  -    if (JAXBParser.JAXB_SCHEMA_URI.equals(pNamespaceURI)  ||
  -        XSParser.XML_SCHEMA_URI.equals(pNamespaceURI)  ||
  -        XMLConstants.XML_NS_URI.equals(pNamespaceURI)) {
  +  protected XsObjectCreator[] getXsObjectCreators() {
         return null;
  -    }
  -    int offset = pQName.indexOf(':');
  -    if (offset > 0) {
  -      String prefix = pQName.substring(0, offset);
  +  }
  +
  +  protected boolean isPrefixEnabled(String pPrefix) {
         // The list of extension prefixes is in the outermost schema.
         String[] prefixes;
         XSLogicalParser xsParser = getContext().getXSLogicalParser();
         if (xsParser == null) {
  -        // Just syntax parsing, take this schema as outermost instance.
  -        JAXBXsSchema jaxbXsSchema = (JAXBXsSchema) getXsESchema();
  -        prefixes = jaxbXsSchema.getJaxbExtensionBindingPrefixes();
  +          // Just syntax parsing, take this schema as outermost instance.
  +          JAXBXsSchema jaxbXsSchema = (JAXBXsSchema) getXsESchema();
  +          prefixes = jaxbXsSchema.getJaxbExtensionBindingPrefixes();
         } else {
  -        prefixes = ((JAXBXsSchema) xsParser.getSyntaxSchemas()[0]).getJaxbExtensionBindingPrefixes();
  +          prefixes = ((JAXBXsSchema) xsParser.getSyntaxSchemas()[0]).getJaxbExtensionBindingPrefixes();
         }
   
         for (int i = 0;  i < prefixes.length;  i++) {
  -        if (prefixes[i].equals(prefix)) {
  -          return new DefaultHandler();
  -        }
  +          if (prefixes[i].equals(pPrefix)) {
  +              return true;
  +          }
  +      }
  +      return false;
  +  }
  +
  +  protected XsObject getBeanByParent(XsObject pParent, Locator pLocator, XsQName pQName) throws SAXException {
  +      XsObjectCreator[] creators = getXsObjectCreators();
  +      if (creators != null) {
  +          for (int i = 0;  i < creators.length;  i++) {
  +              XsObject result = creators[i].newBean(pParent, pLocator, pQName);
  +              if (result != null) {
  +                  return result;
  +              }
  +          }
  +      }
  +      return null;
  +  }
  +
  +  public ContentHandler getChildHandler(String pQName, String pNamespaceURI,
  +                                        String pLocalName) throws SAXException {
  +    if (JAXBParser.JAXB_SCHEMA_URI.equals(pNamespaceURI)  ||
  +        XSParser.XML_SCHEMA_URI.equals(pNamespaceURI)  ||
  +        XMLConstants.XML_NS_URI.equals(pNamespaceURI)) {
  +      return null;
  +    }
  +
  +    int offset = pQName.indexOf(':');
  +    if (offset > 0) {
  +      String prefix = pQName.substring(0, offset);
  +      if (isPrefixEnabled(prefix)) {
  +          XsQName qName = new XsQName(pNamespaceURI, pLocalName, XsQName.prefixOf(pQName));
  +          XsObject result = getBeanByParent(this, getObjectFactory().getLocator(), qName);
  +          if (result != null) {
  +              return getObjectFactory().newXsSAXParser(result);
  +          } else {
  +              return new DefaultHandler();
  +          }
         }
       }
       throw new LocSAXException("Unknown child element " + pQName + ", use the schemas jaxb:extensionBindingPrefixes attribute to ignore it.",
  
  
  
  1.6       +1 -1      ws-jaxme/.classpath
  
  Index: .classpath
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/.classpath,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- .classpath	27 Dec 2003 22:09:02 -0000	1.5
  +++ .classpath	29 Jan 2004 21:35:01 -0000	1.6
  @@ -4,7 +4,7 @@
   	<classpathentry kind="src" path="src/js"/>
   	<classpathentry kind="src" path="src/xs"/>
   	<classpathentry kind="src" path="src/jaxme"/>
  -	<classpathentry kind="src" path="src/pm"/>
  +	<classpathentry excluding="org/apache/ws/jaxme/generator/ino/api4j/|org/apache/ws/jaxme/pm/ino/api4j/" kind="src" path="src/pm"/>
   	<classpathentry kind="src" path="build/js/src"/>
   	<classpathentry kind="src" path="build/jm/src"/>
   	<classpathentry kind="src" path="build/jm/test/jaxme/src"/>
  
  
  
  1.6       +11 -1     ws-jaxme/buildpm.xml
  
  Index: buildpm.xml
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/buildpm.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- buildpm.xml	1 Jan 2004 17:51:00 -0000	1.5
  +++ buildpm.xml	29 Jan 2004 21:35:01 -0000	1.6
  @@ -41,12 +41,19 @@
         <pathelement location="${preqs}/xml-apis.jar"/>
         <pathelement location="${preqs}/xercesImpl.jar"/>
         <pathelement location="${preqs}/xmldb-api-20021118.jar"/>
  +      <!-- These aren't in the CVS and aren't necessary for the build -->
  +      <pathelement location="${preqs}/TaminoAPI4J.jar"/>
  +      <pathelement location="${preqs}/TaminoJCA.jar"/>
       </path>
   
       <path id="jaxmepm.runtime.path">
         <path refid="jaxmepm.class.path"/>
         <pathelement location="${dist}/jaxmepm.jar"/>
       </path>
  +
  +	<available classname="com.softwareag.tamino.db.api.objectModel.sax.TSAXDocument"
  +		        property="have.inoapi4j"
  +		    classpathref="jaxmepm.class.path"/>
     </target>
   
     <target name="init.clover" if="build.clover.db">
  @@ -70,7 +77,10 @@
       <mkdir dir="${dist}"/>
       <javac classpathref="jaxmepm.class.path" debug="${debug}"
           optimize="${optimize}" destdir="${build}/classes"
  -        failonerror="true" srcdir="${src}" excludes="org/apache/ws/jaxme/pm/junit/**/*"/>
  +        failonerror="true" srcdir="${src}">
  +      <exclude name="org/apache/ws/jaxme/pm/junit/**/*"/>
  +      <exclude name="org/apache/ws/jaxme/**/api4j/*" unless="have.inoapi4j"/>
  +    </javac>
       <jar jarfile="${dist}/jaxmepm.jar" basedir="${build}/classes"/>
       <zip zipfile="${dist}/jaxmepm-src.zip" basedir="${src}"/>
     </target>
  
  
  
  1.3       +11 -9     ws-jaxme/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java
  
  Index: JaxMeJdbcSG.java
  ===================================================================
  RCS file: /home/cvs/ws-jaxme/src/pm/org/apache/ws/jaxme/pm/generator/jdbc/JaxMeJdbcSG.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JaxMeJdbcSG.java	26 Oct 2003 04:17:29 -0000	1.2
  +++ JaxMeJdbcSG.java	29 Jan 2004 21:35:01 -0000	1.3
  @@ -101,6 +101,7 @@
   import org.apache.ws.jaxme.xs.types.XSShort;
   import org.apache.ws.jaxme.xs.types.XSString;
   import org.apache.ws.jaxme.xs.types.XSTime;
  +import org.apache.ws.jaxme.xs.xml.XsEAppinfo;
   import org.apache.ws.jaxme.xs.xml.XsObject;
   import org.apache.ws.jaxme.xs.xml.XsQName;
   import org.xml.sax.Attributes;
  @@ -213,18 +214,19 @@
         JaxMeSchemaReader jaxmeSchemaReader = (JaxMeSchemaReader) schemaReader;
         jaxmeSchemaReader.addXsObjectCreator(new XsObjectCreator(){
           public XsObject newBean(XsObject pParent, Locator pLocator, XsQName pQName) throws SAXException {
  -          if (JAXME_JDBC_SCHEMA_URI.equals(pQName.getNamespaceURI())) {
  -            if ("table".equals(pQName.getLocalName())) {
  -              return new TableDetails(JaxMeJdbcSG.this, pParent);
  -            } else if ("connection".equals(pQName.getLocalName())) {
  -              return new ConnectionDetails(JaxMeJdbcSG.this, pParent);
  -            } else {
  -              throw new LocSAXException("Invalid element name: " + pQName, pLocator);
  +            if (pParent instanceof XsEAppinfo) {
  +	          if (JAXME_JDBC_SCHEMA_URI.equals(pQName.getNamespaceURI())) {
  +	            if ("table".equals(pQName.getLocalName())) {
  +	              return new TableDetails(JaxMeJdbcSG.this, pParent);
  +	            } else if ("connection".equals(pQName.getLocalName())) {
  +	              return new ConnectionDetails(JaxMeJdbcSG.this, pParent);
  +	            } else {
  +	              throw new LocSAXException("Invalid element name: " + pQName, pLocator);
  +	            }
  +	          }
               }
  -          } else {
               return null;
             }
  -        }
         });
       } else {
         throw new IllegalStateException("The schema reader " + schemaReader.getClass().getName() +
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org