[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/axis IdrsHandler.java,1.1,1.2 IdrsResourceMgr.j
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2004-08-29 04:50:40
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11199/src/net/sourceforge/idrs/axis Modified Files: IdrsHandler.java IdrsResourceMgr.java DOMElement.java IdrsProvider.java Log Message: * Removed "proprietary" xml binding * Added support for JAXB * Added "fields" tag, so that if the fields are not known ahead of time, they may be iterated over * updated some copyrights Index: IdrsHandler.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis/IdrsHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IdrsHandler.java 22 Aug 2004 05:17:41 -0000 1.1 --- IdrsHandler.java 29 Aug 2004 04:50:30 -0000 1.2 *************** *** 1,8 **** /* ! * Created on Aug 6, 2004 ! * ! * TODO To change the template for this generated file go to ! * Window - Preferences - Java - Code Style - Code Templates ! */ package net.sourceforge.idrs.axis; --- 1,14 ---- /* ! IdrsHandler.java ! Copyright (C) 2002 Marc Boorshtein ! ! The contents of this file are subject to the Mozilla Public License Version 1.0 (the License); ! you may not use this file except in compliance with the License. You may obtain a copy of the ! License at http://www.mozilla.org/MPL/ ! ! Software distributed under the License is distributed on an "AS IS" basis, ! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific ! language governing rights and limitations under the License. ! */ package net.sourceforge.idrs.axis; Index: IdrsResourceMgr.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis/IdrsResourceMgr.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IdrsResourceMgr.java 22 Aug 2004 05:17:41 -0000 1.1 --- IdrsResourceMgr.java 29 Aug 2004 04:50:30 -0000 1.2 *************** *** 1,8 **** /* ! * Created on Aug 7, 2004 ! * ! * TODO To change the template for this generated file go to ! * Window - Preferences - Java - Code Style - Code Templates ! */ package net.sourceforge.idrs.axis; --- 1,14 ---- /* ! IdrsResourceMgr.java ! Copyright (C) 2002 Marc Boorshtein ! ! The contents of this file are subject to the Mozilla Public License Version 1.0 (the License); ! you may not use this file except in compliance with the License. You may obtain a copy of the ! License at http://www.mozilla.org/MPL/ ! ! Software distributed under the License is distributed on an "AS IS" basis, ! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific ! language governing rights and limitations under the License. ! */ package net.sourceforge.idrs.axis; Index: DOMElement.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis/DOMElement.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DOMElement.java 22 Aug 2004 05:17:41 -0000 1.1 --- DOMElement.java 29 Aug 2004 04:50:30 -0000 1.2 *************** *** 1,8 **** /* ! * Created on Aug 1, 2004 ! * ! * TODO To change the template for this generated file go to ! * Window - Preferences - Java - Code Style - Code Templates ! */ package net.sourceforge.idrs.axis; --- 1,14 ---- /* ! DOMElement.java ! Copyright (C) 2002 Marc Boorshtein ! ! The contents of this file are subject to the Mozilla Public License Version 1.0 (the License); ! you may not use this file except in compliance with the License. You may obtain a copy of the ! License at http://www.mozilla.org/MPL/ ! ! Software distributed under the License is distributed on an "AS IS" basis, ! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific ! language governing rights and limitations under the License. ! */ package net.sourceforge.idrs.axis; Index: IdrsProvider.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis/IdrsProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IdrsProvider.java 22 Aug 2004 23:52:32 -0000 1.2 --- IdrsProvider.java 29 Aug 2004 04:50:30 -0000 1.3 *************** *** 1,8 **** /* ! * Created on Aug 7, 2004 ! * ! * TODO To change the template for this generated file go to ! * Window - Preferences - Java - Code Style - Code Templates ! */ package net.sourceforge.idrs.axis; --- 1,14 ---- /* ! IdrsProvider.java ! Copyright (C) 2002 Marc Boorshtein ! ! The contents of this file are subject to the Mozilla Public License Version 1.0 (the License); ! you may not use this file except in compliance with the License. You may obtain a copy of the ! License at http://www.mozilla.org/MPL/ ! ! Software distributed under the License is distributed on an "AS IS" basis, ! WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific ! language governing rights and limitations under the License. ! */ package net.sourceforge.idrs.axis; *************** *** 19,24 **** import java.sql.Connection; import java.util.HashMap; import java.util.Iterator; ! import java.util.List; import javax.servlet.http.HttpServletRequest; --- 25,31 ---- import java.sql.Connection; import java.util.HashMap; + import java.util.Hashtable; import java.util.Iterator; ! import java.util.*; import javax.servlet.http.HttpServletRequest; *************** *** 45,48 **** --- 52,58 ---- import org.w3c.dom.Document; import org.w3c.dom.Element; + import javax.xml.bind.JAXBContext; + import javax.xml.bind.JAXBException; + import javax.xml.bind.Unmarshaller; /** *************** *** 63,66 **** --- 73,77 ---- static int count; private boolean doneinit; + HashMap nameSpaces; /* (non-Javadoc) *************** *** 100,116 **** script = mgr.scriptPool.getContext(); ! SOAPBodyElement bodypart = (SOAPBodyElement) msgContext.getRequestMessage().getSOAPEnvelope().getBodyElements().get(0); - Document bodyDoc = null; ! try { ! bodyDoc = bodypart.getAsDocument(); ! } catch (Exception e) { - e.printStackTrace(System.out); - throw AxisFault.makeFault(e); } System.out.println("Base Package : " + basePackage); this.report.getHead().init(dbs, --- 111,142 ---- script = mgr.scriptPool.getContext(); ! Vector bodyparts = msgContext.getRequestMessage().getSOAPEnvelope().getBodyElements(); ! ArrayList parts = new ArrayList(bodyparts.size()); ! it = bodyparts.iterator(); ! while (it.hasNext()) { ! SOAPBodyElement bodypart = (SOAPBodyElement) it.next(); ! Document bodyDoc = null; ! try { ! bodyDoc = bodypart.getAsDocument(); ! String ns = bodyDoc.getDocumentElement().getNamespaceURI(); ! System.out.println("namespace : " + ns); ! String packageName = (String) this.nameSpaces.get(ns); ! JAXBContext jc = JAXBContext.newInstance(packageName); ! ! Unmarshaller u = jc.createUnmarshaller(); ! parts.add(u.unmarshal(bodyDoc)); ! } catch (Exception e) { ! ! e.printStackTrace(System.out); ! throw AxisFault.makeFault(e); ! } } + + System.out.println("Base Package : " + basePackage); this.report.getHead().init(dbs, *************** *** 126,131 **** "NONE", servlet.getServletContext(), ! bodyDoc.getDocumentElement(), ! basePackage); report.getHead().setSendToClient(true); --- 152,156 ---- "NONE", servlet.getServletContext(), ! parts); report.getHead().setSendToClient(true); *************** *** 245,248 **** --- 270,287 ---- this.basePackage = (String) ctx.getService().getOption(IdrsProvider.CONFIG_IDRS_BASE_PACKAGE); + Hashtable options = ctx.getService().getOptions(); + + this.nameSpaces = new HashMap(); + Iterator it = options.keySet().iterator(); + while (it.hasNext()) { + String name = (String) it.next(); + if (name.substring(0,3).equals("ns:")) { + String ns = name.substring(name.indexOf(':') + 1); + nameSpaces.put(ns,options.get(name)); + } + } + + + StringBuffer buf = new StringBuffer(); BufferedReader in = new BufferedReader(new FileReader(rmlSrcPath)); |