From 17d2d25a3ac09bf173e87cbdd20dbc7e41f6caaf Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Wed, 8 Feb 2012 13:38:02 -0500 Subject: [PATCH] - Update to 0.5.2. - Remove xmldb-api due to deprecation. - Fix ws-jaxme-ant-scripts.patch to apply cleanly. --- .gitignore | 1 + sources | 2 +- ws-jaxme-ant-scripts.patch | 13 +- ws-jaxme-remove-xmldb.patch | 388 ++++++++++++++++++++++++++++++++++++ ws-jaxme.spec | 27 ++- 5 files changed, 413 insertions(+), 18 deletions(-) create mode 100644 ws-jaxme-remove-xmldb.patch diff --git a/.gitignore b/.gitignore index 37d9f2d..4c553d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ ws-jaxme-0.5-docs.tar.gz ws-jaxme-0.5.1-src.tar.gz +ws-jaxme-0.5.2-src.tar.gz diff --git a/sources b/sources index 1298d22..6e3a9b2 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ +04ee281492891c26d8f4ddc808ff6c8e ws-jaxme-0.5.2-src.tar.gz c22a1c7267520c7dfab916825a63218b ws-jaxme-0.5-docs.tar.gz -9709c7fb68880d494c3c347c3faa74c8 ws-jaxme-0.5.1-src.tar.gz diff --git a/ws-jaxme-ant-scripts.patch b/ws-jaxme-ant-scripts.patch index 4086bef..9d82a71 100644 --- a/ws-jaxme-ant-scripts.patch +++ b/ws-jaxme-ant-scripts.patch @@ -1,6 +1,6 @@ --- ./ant/js.xml.sav 2005-08-12 03:39:29.000000000 -0400 +++ ./ant/js.xml 2007-02-12 12:31:25.000000000 -0500 -@@ -34,15 +34,15 @@ +@@ -35,16 +35,16 @@ @@ -10,6 +10,7 @@ + + @@ -19,7 +20,7 @@ -@@ -129,6 +129,7 @@ +@@ -132,6 +132,7 @@ @@ -36,7 +37,7 @@ - + -- +- - - + @@ -51,7 +52,7 @@ -- +- + @@ -65,7 +66,7 @@ -- +- + @@ -85,7 +86,7 @@ -- +- + diff --git a/ws-jaxme-remove-xmldb.patch b/ws-jaxme-remove-xmldb.patch new file mode 100644 index 0000000..5e98a02 --- /dev/null +++ b/ws-jaxme-remove-xmldb.patch @@ -0,0 +1,388 @@ +diff -rauN ws-jaxme-0.5.2.old/build.xml ws-jaxme-0.5.2/build.xml +--- ws-jaxme-0.5.2.old/build.xml 2006-10-24 17:38:01.000000000 -0400 ++++ ws-jaxme-0.5.2/build.xml 2012-02-08 10:29:55.000000000 -0500 +@@ -35,7 +35,6 @@ + + + +- + + + +diff -rauN ws-jaxme-0.5.2.old/src/pm/org/apache/ws/jaxme/pm/xmldb/package.html ws-jaxme-0.5.2/src/pm/org/apache/ws/jaxme/pm/xmldb/package.html +--- ws-jaxme-0.5.2.old/src/pm/org/apache/ws/jaxme/pm/xmldb/package.html 2004-07-23 03:18:09.000000000 -0400 ++++ ws-jaxme-0.5.2/src/pm/org/apache/ws/jaxme/pm/xmldb/package.html 1969-12-31 19:00:00.000000000 -0500 +@@ -1,31 +0,0 @@ +- +- +- +- +-Package Documentation for org.apache.ws.jaxme.pm.xmldb Package +- +- +- +-

+-Contains an implementation of +-the JaxMe persistence management framework +-targeting the XML::DB API. +-

+- +- +diff -rauN ws-jaxme-0.5.2.old/src/pm/org/apache/ws/jaxme/pm/xmldb/XmlDbPM.java ws-jaxme-0.5.2/src/pm/org/apache/ws/jaxme/pm/xmldb/XmlDbPM.java +--- ws-jaxme-0.5.2.old/src/pm/org/apache/ws/jaxme/pm/xmldb/XmlDbPM.java 2005-03-04 05:41:53.000000000 -0500 ++++ ws-jaxme-0.5.2/src/pm/org/apache/ws/jaxme/pm/xmldb/XmlDbPM.java 1969-12-31 19:00:00.000000000 -0500 +@@ -1,338 +0,0 @@ +-/* +- * Copyright 2003, 2004 The Apache Software Foundation +- * +- * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- +- */ +-package org.apache.ws.jaxme.pm.xmldb; +- +-import java.lang.reflect.InvocationTargetException; +-import java.util.HashMap; +-import java.util.Iterator; +-import java.util.Map; +- +-import javax.xml.bind.Element; +-import javax.xml.bind.JAXBException; +-import javax.xml.bind.Marshaller; +- +-import org.apache.ws.jaxme.JMManager; +-import org.apache.ws.jaxme.JMUnmarshallerHandler; +-import org.apache.ws.jaxme.Observer; +-import org.apache.ws.jaxme.PMException; +-import org.apache.ws.jaxme.PMParams; +-import org.apache.ws.jaxme.pm.impl.PMIdImpl; +-import org.xml.sax.ContentHandler; +-import org.xmldb.api.DatabaseManager; +-import org.xmldb.api.base.Collection; +-import org.xmldb.api.base.Database; +-import org.xmldb.api.base.ResourceIterator; +-import org.xmldb.api.base.ResourceSet; +-import org.xmldb.api.base.XMLDBException; +-import org.xmldb.api.modules.XMLResource; +-import org.xmldb.api.modules.XPathQueryService; +- +- +-/** This is a persistence manager for the XML::DB interface. In other +- * words, using this persistence manager you may read documents from a +- * database via the XML::DB API or write them into the database using the +- * same API.
+- * This persistence manager is generic: The same manager works fine for +- * any JAXB element. +- */ +-public class XmlDbPM extends PMIdImpl { +- private Class driverClass; +- private String collection; +- private String user; +- private String password; +- private Map databaseProperties; +- private String xPathQueryService = "XPathQueryService"; +- private String xPathQueryServiceVersion = "1.0"; +- +- /** Creates a new instance of XmlDbPM. +- */ +- public XmlDbPM() { +- } +- +- public void init(JMManager pManager) throws JAXBException { +- super.init(pManager); +- +- String driverClassName = pManager.getProperty("xmldb.driver"); +- if (driverClassName == null || driverClassName.length() == 0) { +- throw new JAXBException("Missing property: 'xmldb.driver' (driver class name)"); +- } +- +- String coll = pManager.getProperty("xmldb.collection"); +- if (coll == null || coll.length() == 0) { +- throw new JAXBException("Missing property: 'xmldb.collection' (collection name)"); +- } +- setCollection(coll); +- setUser(pManager.getProperty("xmldb.user")); +- setPassword(pManager.getProperty("xmldb.password")); +- +- for (int i = 0; ; i++) { +- String p = "xmldb.property." + i; +- String v = pManager.getProperty(p); +- if (v == null) { +- break; +- } +- int offset = v.indexOf('='); +- if (offset == -1) { +- throw new JAXBException("Invalid database property value " + p + ": Expected name=value, got " + v); +- } +- String name = v.substring(0, offset); +- String value = v.substring(offset+1); +- if (databaseProperties != null) { +- databaseProperties = new HashMap(); +- } +- databaseProperties.put(name, value); +- } +- +- Class c; +- try { +- c = Class.forName(driverClassName); +- } catch (ClassNotFoundException e) { +- try { +- ClassLoader cl = Thread.currentThread().getContextClassLoader(); +- if (cl == null) { +- cl = getClass().getClassLoader(); +- } +- c = cl.loadClass(driverClassName); +- } catch (ClassNotFoundException f) { +- throw new JAXBException("Failed to load driver class " + driverClassName, e); +- } +- } +- setDriverClass(c); +- } +- +- /** Returns the collection name. +- */ +- public String getCollection() { +- return collection; +- } +- +- /** Sets the collection name. +- */ +- public void setCollection(String pCollection) { +- collection = pCollection; +- } +- +- /** Returns the driver class. +- */ +- public Class getDriverClass() { +- return driverClass; +- } +- +- /** Sets the driver class. +- */ +- public void setDriverClass(Class pDriverClass) { +- driverClass = pDriverClass; +- } +- +- /** Returns the password. +- */ +- public String getPassword() { +- return password; +- } +- +- /** Sets the password. +- */ +- public void setPassword(String pPassword) { +- password = pPassword; +- } +- +- /** Returns the users name. +- */ +- public String getUser() { +- return user; +- } +- +- /** Sets the users name. +- */ +- public void setUser(String pUser) { +- user = pUser; +- } +- +- /** Returns the name of the XPathQueryService. Defaults to +- * "XPathQueryService". +- */ +- public String getXPathQueryService() { +- return xPathQueryService; +- } +- +- /** Sets the name of the XPathQueryService. Defaults to +- * "XPathQueryService". +- */ +- public void setXPathQueryService(String pXpathQueryService) { +- xPathQueryService = pXpathQueryService; +- } +- +- /** Returns the version of the XPathQueryService. Defaults to +- * "1.0". +- */ +- public String getXPathQueryServiceVersion() { +- return xPathQueryServiceVersion; +- } +- +- /** Sets the version of the XPathQueryService. Defaults to +- * "1.0". +- */ +- public void setXPathQueryServiceVersion(String pXpathQueryServiceVersion) { +- xPathQueryServiceVersion = pXpathQueryServiceVersion; +- } +- +- /** Returns the database collection by invoking +- * {@link DatabaseManager#getCollection(String)}. +- */ +- protected Collection getXmlDbCollection() +- throws XMLDBException, IllegalAccessException, InstantiationException { +- Database database = (Database) getDriverClass().newInstance(); +- if (databaseProperties != null) { +- for (Iterator iter = databaseProperties.entrySet().iterator(); iter.hasNext(); ) { +- Map.Entry entry = (Map.Entry) iter.next(); +- database.setProperty((String) entry.getKey(), (String) entry.getValue()); +- } +- } +- DatabaseManager.registerDatabase(database); +- return DatabaseManager.getCollection(getCollection()); +- } +- +- +- /* (non-Javadoc) +- * @see org.apache.ws.jaxme.PM#select(org.apache.ws.jaxme.Observer, java.lang.String, org.apache.ws.jaxme.PMParams) +- */ +- public void select(Observer pObserver, String pQuery, PMParams pPlaceHolderArgs) throws JAXBException { +- if (pPlaceHolderArgs != null) { +- pQuery = super.parseQuery(pQuery, pPlaceHolderArgs); +- } +- +- if (pQuery == null) { +- throw new IllegalArgumentException("A query must be specified"); +- } +- +- Collection col; +- try { +- col = getXmlDbCollection(); +- XPathQueryService service = (XPathQueryService) col.getService(getXPathQueryService(), +- getXPathQueryServiceVersion()); +- ResourceSet result = service.query(pQuery); +- if (result != null) { +- ResourceIterator i = result.getIterator(); +- if (i.hasMoreResources()) { +- JMUnmarshallerHandler handler = (JMUnmarshallerHandler) getManager().getFactory().createUnmarshaller().getUnmarshallerHandler(); +- handler.setObserver(pObserver); +- while(i.hasMoreResources()) { +- XMLResource r = (XMLResource) i.nextResource(); +- r.getContentAsSAX(handler); +- } +- } +- } +- } catch (XMLDBException e) { +- throw new PMException(e); +- } catch (IllegalAccessException e) { +- throw new PMException(e); +- } catch (InstantiationException e) { +- throw new PMException(e); +- } +- } +- +- /* (non-Javadoc) +- * @see org.apache.ws.jaxme.PM#insert(javax.xml.bind.Element) +- */ +- public void insert(Element pElement) throws PMException { +- try { +- Collection col = getXmlDbCollection(); +- String id = getId(pElement); +- XMLResource resource = (XMLResource) col.createResource(id, XMLResource.RESOURCE_TYPE); +- ContentHandler ch = resource.setContentAsSAX(); +- Marshaller marshaller = getManager().getFactory().createMarshaller(); +- marshaller.marshal(pElement, ch); +- col.storeResource(resource); +- } catch (XMLDBException e) { +- throw new PMException(e); +- } catch (IllegalAccessException e) { +- throw new PMException(e); +- } catch (InstantiationException e) { +- throw new PMException(e); +- } catch (NoSuchMethodException e) { +- throw new PMException(e); +- } catch (InvocationTargetException e) { +- throw new PMException(e.getTargetException()); +- } catch (JAXBException e) { +- if (e instanceof PMException) { +- throw (PMException) e; +- } else { +- throw new PMException(e); +- } +- } +- } +- +- /* (non-Javadoc) +- * @see org.apache.ws.jaxme.PM#update(javax.xml.bind.Element) +- */ +- public void update(Element pElement) throws PMException { +- try { +- Collection col = getXmlDbCollection(); +- String id = getId(pElement); +- XMLResource resource = (XMLResource) col.getResource(id); +- ContentHandler ch = resource.setContentAsSAX(); +- Marshaller marshaller = getManager().getFactory().createMarshaller(); +- marshaller.marshal(pElement, ch); +- col.storeResource(resource); +- } catch (XMLDBException e) { +- throw new PMException(e); +- } catch (IllegalAccessException e) { +- throw new PMException(e); +- } catch (InstantiationException e) { +- throw new PMException(e); +- } catch (NoSuchMethodException e) { +- throw new PMException(e); +- } catch (InvocationTargetException e) { +- throw new PMException(e.getTargetException()); +- } catch (JAXBException e) { +- if (e instanceof PMException) { +- throw (PMException) e; +- } else { +- throw new PMException(e); +- } +- } +- } +- +- /* (non-Javadoc) +- * @see org.apache.ws.jaxme.PM#delete(javax.xml.bind.Element) +- */ +- public void delete(Element pElement) throws PMException { +- try { +- Collection col = getXmlDbCollection(); +- String id = getId(pElement); +- XMLResource resource = (XMLResource) col.createResource(id, XMLResource.RESOURCE_TYPE); +- col.removeResource(resource); +- } catch (XMLDBException e) { +- throw new PMException(e); +- } catch (IllegalAccessException e) { +- throw new PMException(e); +- } catch (InstantiationException e) { +- throw new PMException(e); +- } catch (InvocationTargetException e) { +- throw new PMException(e.getTargetException()); +- } catch (NoSuchMethodException e) { +- throw new PMException(e); +- } catch (JAXBException e) { +- if (e instanceof PMException) { +- throw (PMException) e; +- } else { +- throw new PMException(e); +- } +- } +- } +- +-} diff --git a/ws-jaxme.spec b/ws-jaxme.spec index dbddc98..1996c9f 100644 --- a/ws-jaxme.spec +++ b/ws-jaxme.spec @@ -31,17 +31,17 @@ %global base_name jaxme Name: ws-jaxme -Version: 0.5.1 -Release: 8%{?dist} +Version: 0.5.2 +Release: 1%{?dist} Epoch: 0 Summary: Open source implementation of JAXB Group: Development/Libraries/Java License: ASL 2.0 URL: http://ws.apache.org/jaxme/ -# svn export http://svn.apache.org/repos/asf/webservices/jaxme/tags/R0_5_1/ ws-jaxme-0.5.1 -# tar czf ws-jaxme-0.5.1-src.tar.gz ws-jaxme -Source0: ws-jaxme-0.5.1-src.tar.gz +# svn export http://svn.apache.org/repos/asf/webservices/archive/jaxme/tags/R0_5_2/ ws-jaxme-0.5.2 +# tar czf ws-jaxme-0.5.2-src.tar.gz ws-jaxme-0.5.2 +Source0: ws-jaxme-0.5.2-src.tar.gz Source1: ws-jaxme-bind-MANIFEST.MF # generated docs with forrest-0.5.1 Patch0: ws-jaxme-docs_xml.patch @@ -50,6 +50,8 @@ Patch2: ws-jaxme-system-dtd.patch Patch3: ws-jaxme-jdk16.patch Patch4: ws-jaxme-ant-scripts.patch Patch5: ws-jaxme-use-commons-codec.patch +# Remove xmldb-api, deprecated since f17 +Patch6: ws-jaxme-remove-xmldb.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: jpackage-utils >= 0:1.6 @@ -64,13 +66,12 @@ BuildRequires: junit BuildRequires: hsqldb BuildRequires: log4j BuildRequires: xalan-j2 -BuildRequires: xmldb-api -BuildRequires: xmldb-api-sdk BuildRequires: xerces-j2 BuildRequires: xml-commons-apis BuildRequires: xml-commons-resolver BuildRequires: docbook-style-xsl BuildRequires: docbook-dtds +BuildRequires: zip Requires: antlr Requires: jaxp_transform_impl Requires: jakarta-commons-codec @@ -78,8 +79,6 @@ Requires: junit Requires: hsqldb Requires: log4j Requires: xalan-j2 -Requires: xmldb-api -Requires: xmldb-api-sdk Requires: xerces-j2 Requires: xml-commons-apis Requires: jpackage-utils @@ -116,7 +115,7 @@ Group: Documentation %{summary}. %prep -%setup -q -n %{name} +%setup -q for j in $(find . -name "*.jar"); do mv $j $j.no done @@ -129,10 +128,11 @@ DOCBOOKX_DTD=`%{_bindir}/xmlcatalog %{_datadir}/sgml/docbook/xmlcatalog "-//OASI %patch3 -p1 %patch4 -b .sav %patch5 -b .sav +%patch6 -p1 %build export OPT_JAR_LIST="xalan-j2 ant/ant-nodeps xalan-j2-serializer xml-commons-resolver ant/ant-apache-resolver" -export CLASSPATH=$(build-classpath antlr hsqldb commons-codec junit log4j xmldb-api xerces-j2 xml-commons-jaxp-1.3-apis) +export CLASSPATH=$(build-classpath antlr hsqldb commons-codec junit log4j xerces-j2 xml-commons-jaxp-1.3-apis) ant all Docs.all \ -Dbuild.sysclasspath=first \ -Ddocbook.home=%{_datadir}/sgml/docbook \ @@ -191,6 +191,11 @@ rm -rf $RPM_BUILD_ROOT %doc %{_docdir}/%{name}-%{version} %changelog +* Wed Feb 8 2012 Roland Grunberg 0:0.5.2-1 +- Update to 0.5.2. +- Remove xmldb-api due to deprecation. +- Fix ws-jaxme-ant-scripts.patch to apply cleanly. + * Sat Jan 14 2012 Fedora Release Engineering - 0:0.5.1-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild