JBossWS SVN: r2305 - trunk/build/etc.
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-02-08 20:29:07 -0500 (Thu, 08 Feb 2007)
New Revision: 2305
Modified:
trunk/build/etc/wsgen.sh
trunk/build/etc/wsimport.sh
Log:
Add api jars
Modified: trunk/build/etc/wsgen.sh
===================================================================
--- trunk/build/etc/wsgen.sh 2007-02-09 00:39:19 UTC (rev 2304)
+++ trunk/build/etc/wsgen.sh 2007-02-09 01:29:07 UTC (rev 2305)
@@ -55,6 +55,9 @@
WSGEN_CLASSPATH="$WSGEN_CLASSPATH:$JBOSS_HOME/client/jaxb-impl.jar"
WSGEN_CLASSPATH="$WSGEN_CLASSPATH:$JBOSS_HOME/client/jbossall-client.jar"
WSGEN_CLASSPATH="$WSGEN_CLASSPATH:$JBOSS_HOME/client/jbossws-client.jar"
+WSGEN_CLASSPATH="$WSGEN_CLASSPATH:$JBOSS_HOME/client/jboss-jaxws.jar"
+WSGEN_CLASSPATH="$WSGEN_CLASSPATH:$JBOSS_HOME/client/jboss-jaxrpc.jar"
+WSGEN_CLASSPATH="$WSGEN_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar"
WSGEN_CLASSPATH="$WSGEN_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSGEN_CLASSPATH="$WSGEN_CLASSPATH:$JBOSS_HOME/client/mail.jar"
Modified: trunk/build/etc/wsimport.sh
===================================================================
--- trunk/build/etc/wsimport.sh 2007-02-09 00:39:19 UTC (rev 2304)
+++ trunk/build/etc/wsimport.sh 2007-02-09 01:29:07 UTC (rev 2305)
@@ -59,6 +59,9 @@
WSIMPORT_CLASSPATH="$WSIMPORT_CLASSPATH:$JBOSS_HOME/client/jaxb-xjc.jar"
WSIMPORT_CLASSPATH="$WSIMPORT_CLASSPATH:$JBOSS_HOME/client/jbossall-client.jar"
WSIMPORT_CLASSPATH="$WSIMPORT_CLASSPATH:$JBOSS_HOME/client/jbossws-client.jar"
+WSIMPORT_CLASSPATH="$WSIMPORT_CLASSPATH:$JBOSS_HOME/client/jboss-jaxws.jar"
+WSIMPORT_CLASSPATH="$WSIMPORT_CLASSPATH:$JBOSS_HOME/client/jboss-jaxrpc.jar"
+WSIMPORT_CLASSPATH="$WSIMPORT_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar"
WSIMPORT_CLASSPATH="$WSIMPORT_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSIMPORT_CLASSPATH="$WSIMPORT_CLASSPATH:$JBOSS_HOME/client/mail.jar"
17 years, 4 months
JBossWS SVN: r2304 - in trunk/jbossws-core/src/main/java/org/jboss/ws: tools/jaxws/ant and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-02-08 19:39:19 -0500 (Thu, 08 Feb 2007)
New Revision: 2304
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSGenerate.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSImport.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
Log:
Add support for VM args to ant task
Properly write binding sections for empty doc bare services
Uppercase WSDL files always
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-02-08 11:44:40 UTC (rev 2303)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-02-09 00:39:19 UTC (rev 2304)
@@ -50,6 +50,7 @@
import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
+import org.jboss.ws.tools.ToolsUtils;
import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLWriter;
@@ -263,7 +264,8 @@
{
try
{
- String serviceName = serviceMetaData.getServiceName().getLocalPart();
+ // The RI uses upper case, and the TCK expects it, so we just mimic this even though we don't really have to
+ String wsdlName = ToolsUtils.firstLetterUpperCase(serviceMetaData.getServiceName().getLocalPart());
WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
@@ -276,12 +278,12 @@
if (wsdlDirectory != null)
{
dir = wsdlDirectory;
- wsdlFile = new File(dir, serviceName + ".wsdl");
+ wsdlFile = new File(dir, wsdlName + ".wsdl");
}
else
{
dir = IOUtils.createTempDirectory();
- wsdlFile = File.createTempFile(serviceName, ".wsdl", dir);
+ wsdlFile = File.createTempFile(wsdlName, ".wsdl", dir);
wsdlFile.deleteOnExit();
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSGenerate.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSGenerate.java 2007-02-08 11:44:40 UTC (rev 2303)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSGenerate.java 2007-02-09 00:39:19 UTC (rev 2304)
@@ -30,6 +30,7 @@
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.ExecuteJava;
import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.CommandlineJava;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;
@@ -81,6 +82,7 @@
public class WSGenerate extends Task
{
private Path classpath = new Path(getProject());
+ private CommandlineJava command = new CommandlineJava();
private String sei = null;
private File destdir = null;
private File resourcedestdir = null;
@@ -97,6 +99,11 @@
this.debug = debug;
}
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
public void setClasspath(Path classpath)
{
this.classpath = classpath;
@@ -212,7 +219,6 @@
private void executeForked() throws BuildException
{
- CommandlineJava command = new CommandlineJava();
command.setClassname(org.jboss.ws.tools.jaxws.WSGenerate.class.getName());
Path path = command.createClasspath(getProject());
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSImport.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSImport.java 2007-02-08 11:44:40 UTC (rev 2303)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSImport.java 2007-02-09 00:39:19 UTC (rev 2304)
@@ -34,6 +34,7 @@
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.ExecuteJava;
import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.CommandlineJava;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Path;
@@ -77,6 +78,7 @@
*/
public class WSImport extends Task
{
+ private CommandlineJava command = new CommandlineJava();
private String wsdl = null;
private File destdir = null;
private File sourcedestdir = null;
@@ -94,6 +96,11 @@
{
this.debug = debug;
}
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
public void setBinding(File bindingFile)
{
@@ -238,7 +245,6 @@
private void executeForked() throws BuildException
{
- CommandlineJava command = new CommandlineJava();
command.setClassname(org.jboss.ws.tools.jaxws.WSImport.class.getName());
Path path = command.createClasspath(getProject());
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2007-02-08 11:44:40 UTC (rev 2303)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2007-02-09 00:39:19 UTC (rev 2304)
@@ -459,7 +459,9 @@
StringBuilder bodyParts = new StringBuilder();
if (Constants.DOCUMENT_LITERAL == wsdlStyle)
{
- bodyParts.append(reference.getPartName());
+ // Empty bare body
+ if (reference.getPartName() != null)
+ bodyParts.append(reference.getPartName());
}
else
{
17 years, 4 months
JBossWS SVN: r2303 - branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-02-08 06:44:40 -0500 (Thu, 08 Feb 2007)
New Revision: 2303
Modified:
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
Log:
FIXME: [JBWS-1511] MessageFactory does not preserve comments
Modified: branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
===================================================================
--- branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2007-02-08 09:40:29 UTC (rev 2302)
+++ branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2007-02-08 11:44:40 UTC (rev 2303)
@@ -81,8 +81,7 @@
assertEquals("urn:uddi-org:api_v2", soapBodyElement.getNamespaceURI());
}
- // http://jira.jboss.org/jira/browse/JBWS-745
- // SAAJ:SOAPBodyElement.addNamespaceDeclaration should allow empty prefix
+ // [JBWS-745] SAAJ:SOAPBodyElement.addNamespaceDeclaration should allow empty prefix
public void testAddNamespaceDeclaration() throws Exception
{
MessageFactory factory = new MessageFactoryImpl();
@@ -108,8 +107,7 @@
assertEquals(expEnv, env);
}
- // http://jira.jboss.org/jira/browse/JBWS-1407
- // Premature end of File exception on createMessage
+ // [JBWS-1407] Premature end of File exception on createMessage
public void testPrematureEndOfFile() throws Exception
{
File envFile = new File("resources/common/soap/MessageFactory/jbws1407.xml");
@@ -150,4 +148,33 @@
assertEquals(DOMUtils.parse(expMsg), DOMUtils.parse(wasMsg));
}
-}
+
+ // [JBWS-1511] MessageFactory does not preserve comments
+ public void testPreserveComments() throws Exception
+ {
+ String expMsg =
+ "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <!-- header -->" +
+ " <soapenv:Header>" +
+ " <!-- header element -->" +
+ " <header>kermit</header>" +
+ " </soapenv:Header>" +
+ " <!-- body -->" +
+ " <soapenv:Body>" +
+ " <!-- body element -->" +
+ " <Hello>" +
+ " <!-- element -->" +
+ " <argument>kermit</argument>" +
+ " </Hello>" +
+ " </soapenv:Body>" +
+ "</soapenv:Envelope>";
+
+ MessageFactory factory = new MessageFactoryImpl();
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(expMsg.getBytes());
+ SOAPMessage soapMsg = factory.createMessage(null, inputStream);
+ SOAPEnvelope env = soapMsg.getSOAPPart().getEnvelope();
+
+ System.out.println("FIXME: [JBWS-1511] MessageFactory does not preserve comments");
+ //assertEquals(DOMUtils.parse(expMsg), (Element)env);
+ }
+}
\ No newline at end of file
17 years, 4 months
JBossWS SVN: r2302 - branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/simple.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-02-08 04:40:29 -0500 (Thu, 08 Feb 2007)
New Revision: 2302
Modified:
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
Log:
[JBWS-800] ClassCastException when trying to marshal a SybaseTimestamp
Modified: branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java
===================================================================
--- branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2007-02-08 09:30:56 UTC (rev 2301)
+++ branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/simple/SimpleUserTypeMarshallerTestCase.java 2007-02-08 09:40:29 UTC (rev 2302)
@@ -107,6 +107,11 @@
}
}
+ /**
+ * [JBWS-800] ClassCastException when trying to marshal a SybaseTimestamp
+ *
+ * http://jira.jboss.org/jira/browse/JBWS-800
+ */
public void testMarshallSimpleUserTypeWithUserDate() throws Exception
{
class UserDate extends Date
@@ -116,6 +121,7 @@
super(date);
}
}
+
TimeZone tz = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
try
@@ -131,9 +137,8 @@
" <d>1968-12-16T00:00:00.000Z</d>" +
"</ns1:SimpleUser>";
- System.out.println("FIXME: [JBWS-800] ClassCastException when trying to marshal a SybaseTimestamp");
- //String was = marshalSimpleType(obj);
- //assertEquals(DOMUtils.parse(exp), DOMUtils.parse(was));
+ String was = marshalSimpleType(obj);
+ assertEquals(DOMUtils.parse(exp), DOMUtils.parse(was));
}
finally
{
17 years, 4 months
JBossWS SVN: r2301 - in branches/jbossws-1.2.0/integration-jboss40: src/main/resources and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-02-08 04:30:56 -0500 (Thu, 08 Feb 2007)
New Revision: 2301
Added:
branches/jbossws-1.2.0/integration-jboss40/src/main/resources/jbossws.beans/
Modified:
branches/jbossws-1.2.0/integration-jboss40/build.xml
branches/jbossws-1.2.0/integration-jboss40/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
Log:
Exclude @WebServiceRef handling from jboss40-jdk14
Modified: branches/jbossws-1.2.0/integration-jboss40/build.xml
===================================================================
--- branches/jbossws-1.2.0/integration-jboss40/build.xml 2007-02-07 20:52:04 UTC (rev 2300)
+++ branches/jbossws-1.2.0/integration-jboss40/build.xml 2007-02-08 09:30:56 UTC (rev 2301)
@@ -206,8 +206,6 @@
<jar jarfile="${jboss40.output.lib.dir}/jbossws14-core.jar" manifest="${etc.dir}/default.mf">
<fileset dir="${jboss40.output.classes14.dir}">
<include name="org/jboss/ws/**"/>
- <include name="javax/jws/**"/>
- <include name="javax/xml/ws/**"/>
</fileset>
<fileset dir="${core.dir}/src/main/resources">
<include name="schema/**"/>
@@ -215,6 +213,15 @@
</fileset>
</jar>
+ <!-- Build jboss-jaxws14.jar -->
+ <mkdir dir="${jboss40.output.lib.dir}"/>
+ <jar jarfile="${jboss40.output.lib.dir}/jboss-jaxws14.jar" manifest="${etc.dir}/default.mf">
+ <fileset dir="${jboss40.output.classes14.dir}">
+ <include name="javax/jws/**"/>
+ <include name="javax/xml/ws/**"/>
+ </fileset>
+ </jar>
+
<!-- Build jbossws14-jboss40-integration.jar -->
<jar jarfile="${jboss40.output.lib.dir}/jbossws14-jboss40-integration.jar" manifest="${etc.dir}/default.mf">
<fileset dir="${jboss40.output.classes14.dir}">
@@ -270,14 +277,12 @@
<include name="wstx-lgpl-2.9.3.jar"/>
<include name="xmlsec.jar"/>
</fileset>
- <fileset dir="${jboss42.resources.dir}">
+ <fileset dir="${jboss40.resources.dir}">
<include name="jbossws.beans/META-INF/jboss-beans.xml"/>
</fileset>
<metainf dir="${core.resources.dir}/jbossws.sar/META-INF">
<include name="standard-jaxrpc-client-config.xml"/>
<include name="standard-jaxrpc-endpoint-config.xml"/>
- <include name="standard-jaxws-client-config.xml"/>
- <include name="standard-jaxws-endpoint-config.xml"/>
</metainf>
<metainf dir="${jboss40.output.dir}/resources/jbossws40-jdk14.sar/META-INF">
<include name="jboss-service.xml"/>
@@ -338,6 +343,7 @@
<!-- Deploy jbossws to jboss40 jdk1.4 -->
<target name="deploy-jboss40-jdk14" depends="jboss40-jars14" description="Deploy jbossws">
<delete file="${jboss40.home}/client/jbossws-client.jar"/>
+ <delete file="${jboss40.home}/server/${jboss.server.instance}/lib/jboss-jaxws.jar"/>
<copy todir="${jboss40.home}/client" overwrite="true">
<fileset dir="${core.output.lib.dir}">
<include name="jboss-jaxrpc.jar"/>
@@ -356,6 +362,9 @@
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-saaj.jar"/>
</fileset>
+ <fileset dir="${jboss40.output.lib.dir}">
+ <include name="jboss-jaxws14.jar"/>
+ </fileset>
</copy>
<delete dir="${jboss40.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<delete dir="${jboss40.home}/server/${jboss.server.instance}/deploy/jbossws14.sar"/>
Copied: branches/jbossws-1.2.0/integration-jboss40/src/main/resources/jbossws.beans (from rev 2300, branches/jbossws-1.2.0/integration-jboss42/src/main/resources/jbossws.beans)
Modified: branches/jbossws-1.2.0/integration-jboss40/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- branches/jbossws-1.2.0/integration-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-02-07 20:52:04 UTC (rev 2300)
+++ branches/jbossws-1.2.0/integration-jboss40/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-02-08 09:30:56 UTC (rev 2301)
@@ -7,13 +7,13 @@
<bean name="ServiceEndpointManager" class="org.jboss.ws.core.server.ServiceEndpointManager">
<!--
- The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address>
- element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
+ The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address>
+ element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
+
+ If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless 'alwaysModifySOAPAddress' is true.
+ If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
- If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless 'alwaysModifySOAPAddress' is true.
- If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
-
- If next line (webServiceHost) is commented, JBossWS uses requesters protocolo, host and port when rewriting the <soap:address>.
+ If next line (webServiceHost) is commented, JBossWS uses requesters protocolo, host and port when rewriting the <soap:address>.
-->
<property name="webServiceHost">${jboss.bind.address}</property>
<property name="webServiceSecurePort">8443</property>
@@ -36,8 +36,11 @@
<property name="serviceEndpointServlet">org.jboss.ws.integration.jboss42.JBossServiceEndpointServlet</property>
</bean>
- <!-- Bind JAXWS Service objects in client environment context -->
+ <!--
+ Bind JAXWS Service objects in client environment context
+ JAX-WS functionality is not available with jdk-1.4
<bean name="WebServiceRefHandler" class="org.jboss.ws.integration.jboss42.WebServiceRefHandler"/>
+ -->
<!-- A subscription manager for WS-Eventing -->
<bean name="SubscriptionManager" class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
17 years, 4 months
JBossWS SVN: r2300 - branches/jbossws-1.2.0/jbossws-docs.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-02-07 15:52:04 -0500 (Wed, 07 Feb 2007)
New Revision: 2300
Modified:
branches/jbossws-1.2.0/jbossws-docs/db2wiki.py
Log:
fname from cmd line
Modified: branches/jbossws-1.2.0/jbossws-docs/db2wiki.py
===================================================================
--- branches/jbossws-1.2.0/jbossws-docs/db2wiki.py 2007-02-07 20:27:36 UTC (rev 2299)
+++ branches/jbossws-1.2.0/jbossws-docs/db2wiki.py 2007-02-07 20:52:04 UTC (rev 2300)
@@ -215,5 +215,7 @@
fout.close
fin.close
-fname = raw_input("Filename: ")
+# fname = raw_input("Filename: ")
+fname = sys.argv[1]
+print fname
xml2wiki(fname)
17 years, 4 months
JBossWS SVN: r2299 - branches/jbossws-1.2.0/jbossws-docs.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-02-07 15:27:36 -0500 (Wed, 07 Feb 2007)
New Revision: 2299
Added:
branches/jbossws-1.2.0/jbossws-docs/db2wiki.py
Log:
Add db2wiki.py -r2298
Copied: branches/jbossws-1.2.0/jbossws-docs/db2wiki.py (from rev 2298, trunk/jbossws-docs/db2wiki.py)
===================================================================
--- branches/jbossws-1.2.0/jbossws-docs/db2wiki.py (rev 0)
+++ branches/jbossws-1.2.0/jbossws-docs/db2wiki.py 2007-02-07 20:27:36 UTC (rev 2299)
@@ -0,0 +1,219 @@
+#!/usr/bin/python
+
+###################################################################
+# #
+# Script: DOCBOOK TO WIKI #
+# Author: Pep Ribal - pepribal(a)pepribal.com #
+# Version: 1.0 #
+# #
+####################################################################
+# #
+# IMPORTANT #
+# ========= #
+# LOOK FOR '%%%%%' INDICATIONS IN THE OUTPUT FILE #
+# Set titleNote as desired (translation of "Note") #
+# Double quotes assumed in tags (atrib="val" style) #
+# #
+####################################################################
+
+#
+# Recognized tags so far:
+#
+# chapter, section, bridgehead, orderedlist, itemizedlist,
+# emphasis, literal, xref, figure, informalequation, link,
+# inlinegraphic, command, tip, note, para, keycap
+#
+
+import sys
+
+# set titleNote to the desired value in doble quotes (in English, "Note")
+titleNote="Text"
+
+# Advances until next '<' char; 0 - No output, 1- Output; returns tag name
+def nextag(out):
+ global buffer,lastChar,fout
+ while len(buffer)>0 and buffer[0]!="<":
+ if out==1:
+ # No TABS, NLs or CRs will be written:
+ if buffer[0]=="\t" or buffer[0]=="\n" or buffer[0]=="\r":
+ presentChar=" "
+ else:
+ presentChar=buffer[0]
+ if (lastChar==" " or lastChar=="\n" or lastChar=="(") and presentChar==" ":
+ presentChar="" # Avoid these combinations
+ fout.write(presentChar)
+ if presentChar!="":
+ lastChar=presentChar
+ buffer=buffer[1:]
+ if buffer=="":
+ return # EOF
+ tag=""
+ while buffer[0]!=" " and buffer[0]!="\t" and buffer[0]!="\n" and buffer[0]!="\r" and buffer[0]!=">":
+ tag=tag+buffer[0]
+ buffer=buffer[1:]
+ buffer=buffer[1:]
+ return tag[1:]
+
+# Returns string until string found (removes all from buffer)
+def contentUntil(until):
+ global buffer
+ straux=""
+ lastChar="*" # This is not the global variable; just an internal control var
+
+ while buffer[:len(until)]!=until:
+
+ # No TABS, NLs or CRs will be written:
+ #if buffer[0]=="\t" or buffer[0]=="\n" or buffer[0]=="\r":
+ # presentChar=" "
+ #else:
+ # presentChar=buffer[0]
+
+ presentChar=buffer[0]
+
+ # replace tabs with spaces
+ if (lastChar=="\t" and presentChar=="\t"):
+ straux=straux+" "
+ elif(presentChar=="\t"):
+ straux=straux+""
+ else:
+ straux=straux+presentChar
+
+ buffer=buffer[1:]
+ if presentChar!="":
+ lastChar=presentChar
+ buffer=buffer[len(until):]
+ return straux
+
+def fileSel(filename):
+ xml2wiki(filename)
+
+def xml2wiki(fname):
+ global buffer,lastChar,fout,escape
+ listType="?"
+ lastChar="*"
+ fin=open(fname,"r")
+ fout=open(fname[:len(fname)-4]+".txt","w")
+ buffer=fin.read()
+ outp=0
+ while len(buffer)>0:
+ aux=nextag(outp)
+ if aux=="chapter":
+ contentUntil("<title>")
+ fout.write("\n='''"+contentUntil("</title>")+"'''=\n")
+ lastChar="\n"
+ elif aux=="sect1":
+ contentUntil("<title>")
+ fout.write("\n="+contentUntil("</title>")+"=\n")
+ lastChar="\n"
+ elif aux=="sect2":
+ contentUntil("<title>")
+ fout.write("\n=="+contentUntil("</title>")+"==\n")
+ lastChar="\n"
+ elif aux=="bridgehead":
+ contentUntil(">")
+ fout.write("\n==="+contentUntil("</bridgehead>")+"===\n")
+ lastChar="\n"
+ elif aux=="para":
+ fout.write("\n")
+ lastChar="\n"
+ outp=1
+ elif aux=="emphasis":
+ fout.write("'''")
+ contentUntil('>') # this only works when a role attribute is set
+ fout.write(contentUntil('</emphasis>'))
+ fout.write("'''")
+ elif aux=="/para":
+ fout.write("\n")
+ lastChar="\n"
+ outp=0
+ elif aux=="itemizedlist":
+ fout.write("\n")
+ lastChar="\n"
+ listType="* "
+ elif aux=="orderedlist":
+ fout.write("\n")
+ lastChar="\n"
+ listType="# "
+ elif aux=="listitem":
+ contentUntil("<para>")
+ outp=1
+ fout.write(listType)
+ lastChar=" "
+ elif aux=="keycap":
+ fout.write("{{KEY|"+contentUntil("</keycap>")+"}}")
+ lastChar="}"
+ elif aux=="literal":
+ fout.write("{{Literal|"+contentUntil("</literal>")+"}}")
+ lastChar="}"
+ elif aux=="xref":
+ contentUntil('="')
+ fout.write("''%%%%%XREF:"+contentUntil('"/>')+"''")
+ lastChar="'"
+ elif aux=="figure":
+ contentUntil("<title>")
+ aux=contentUntil("</title>")
+ contentUntil('fileref="')
+ fout.write("\n[[Image:"+contentUntil('"')+"|frame|none|"+aux+"]]\n")
+ lastChar="\n"
+ contentUntil("</figure>")
+ elif aux=="inlinegraphic":
+ contentUntil('="')
+ fout.write("[[Image:"+contentUntil('"')+"]]")
+ lastChar="]"
+ contentUntil(">")
+ elif aux=="command":
+ fout.write("====")
+ fout.write(contentUntil('</command>'))
+ fout.write("====")
+ elif aux=="programlisting":
+ contentUntil("<![CDATA[")
+ fout.write("<pre>")
+ code=contentUntil("]]>")
+ fout.write(code)
+ fout.write("</pre>")
+ elif aux=="tip" or aux=="note":
+ while buffer[0]!="<": # We might want to keep the '<' char in buffer
+ buffer=buffer[1:]
+ if buffer[:7]=="<title>":
+ buffer=buffer[7:]
+ fout.write("\n{{Tip|"+contentUntil("</title>")+"|")
+ else:
+ fout.write("\n{{Tip|"+titleNote+"=")
+ lastChar="|"
+ elif aux=="/tip" or aux=="/note":
+ fout.write("}}\n")
+ lastChar="\n"
+ elif aux=="informalequation":
+ fout.write("\n%%%%%INFORMALEQUATION:")
+ fout.write(contentUntil("</informalequation>"))
+ fout.write(":INFORMALEQUATION%%%%%\n")
+ lastChar="\n"
+ elif aux=="link":
+ contentUntil('linkend="')
+ target=contentUntil('">')
+ fout.write("[[#"+contentUntil("</link>")+"]]")
+ lastChar="]]"
+ elif aux=="ulink":
+ contentUntil('url="')
+ href=contentUntil('">')
+ name=contentUntil('</ulink>')
+ fout.write("["+href+" "+name+"]")
+ elif aux=="table":
+ fout.write('{| border="1" cellpadding="5" cellspacing="0"\n')
+ outp=0
+ elif aux=="entry":
+ lastChar=('>')
+ entry=contentUntil('</entry>')
+ fout.write("|"+entry+"\n")
+ elif aux=="/row":
+ fout.write("|-"+"\n")
+ elif aux=="/table":
+ fout.write("|}\n")
+ outp=1
+
+
+ fout.close
+ fin.close
+
+fname = raw_input("Filename: ")
+xml2wiki(fname)
17 years, 4 months
JBossWS SVN: r2298 - trunk/jbossws-docs.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-02-07 12:02:04 -0500 (Wed, 07 Feb 2007)
New Revision: 2298
Modified:
trunk/jbossws-docs/db2wiki.py
Log:
Fix sect1 and sect2 handling
Modified: trunk/jbossws-docs/db2wiki.py
===================================================================
--- trunk/jbossws-docs/db2wiki.py 2007-02-07 16:42:03 UTC (rev 2297)
+++ trunk/jbossws-docs/db2wiki.py 2007-02-07 17:02:04 UTC (rev 2298)
@@ -100,11 +100,15 @@
if aux=="chapter":
contentUntil("<title>")
fout.write("\n='''"+contentUntil("</title>")+"'''=\n")
- lastChar="\n"
- elif aux=="section":
+ lastChar="\n"
+ elif aux=="sect1":
contentUntil("<title>")
fout.write("\n="+contentUntil("</title>")+"=\n")
lastChar="\n"
+ elif aux=="sect2":
+ contentUntil("<title>")
+ fout.write("\n=="+contentUntil("</title>")+"==\n")
+ lastChar="\n"
elif aux=="bridgehead":
contentUntil(">")
fout.write("\n==="+contentUntil("</bridgehead>")+"===\n")
17 years, 4 months
JBossWS SVN: r2297 - trunk/jbossws-docs.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-02-07 11:42:03 -0500 (Wed, 07 Feb 2007)
New Revision: 2297
Modified:
trunk/jbossws-docs/db2wiki.py
Log:
Fixed <link> tags
Modified: trunk/jbossws-docs/db2wiki.py
===================================================================
--- trunk/jbossws-docs/db2wiki.py 2007-02-07 16:27:03 UTC (rev 2296)
+++ trunk/jbossws-docs/db2wiki.py 2007-02-07 16:42:03 UTC (rev 2297)
@@ -185,9 +185,10 @@
fout.write(":INFORMALEQUATION%%%%%\n")
lastChar="\n"
elif aux=="link":
- contentUntil('="')
- fout.write("%%%%%LINK:"+contentUntil('">')+"==>"+contentUntil("</link>")+":LINK%%%%%")
- lastChar="%"
+ contentUntil('linkend="')
+ target=contentUntil('">')
+ fout.write("[[#"+contentUntil("</link>")+"]]")
+ lastChar="]]"
elif aux=="ulink":
contentUntil('url="')
href=contentUntil('">')
17 years, 4 months
JBossWS SVN: r2296 - trunk/jbossws-docs.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-02-07 11:27:03 -0500 (Wed, 07 Feb 2007)
New Revision: 2296
Added:
trunk/jbossws-docs/db2wiki.py
Log:
import
Added: trunk/jbossws-docs/db2wiki.py
===================================================================
--- trunk/jbossws-docs/db2wiki.py (rev 0)
+++ trunk/jbossws-docs/db2wiki.py 2007-02-07 16:27:03 UTC (rev 2296)
@@ -0,0 +1,214 @@
+#!/usr/bin/python
+
+###################################################################
+# #
+# Script: DOCBOOK TO WIKI #
+# Author: Pep Ribal - pepribal(a)pepribal.com #
+# Version: 1.0 #
+# #
+####################################################################
+# #
+# IMPORTANT #
+# ========= #
+# LOOK FOR '%%%%%' INDICATIONS IN THE OUTPUT FILE #
+# Set titleNote as desired (translation of "Note") #
+# Double quotes assumed in tags (atrib="val" style) #
+# #
+####################################################################
+
+#
+# Recognized tags so far:
+#
+# chapter, section, bridgehead, orderedlist, itemizedlist,
+# emphasis, literal, xref, figure, informalequation, link,
+# inlinegraphic, command, tip, note, para, keycap
+#
+
+import sys
+
+# set titleNote to the desired value in doble quotes (in English, "Note")
+titleNote="Text"
+
+# Advances until next '<' char; 0 - No output, 1- Output; returns tag name
+def nextag(out):
+ global buffer,lastChar,fout
+ while len(buffer)>0 and buffer[0]!="<":
+ if out==1:
+ # No TABS, NLs or CRs will be written:
+ if buffer[0]=="\t" or buffer[0]=="\n" or buffer[0]=="\r":
+ presentChar=" "
+ else:
+ presentChar=buffer[0]
+ if (lastChar==" " or lastChar=="\n" or lastChar=="(") and presentChar==" ":
+ presentChar="" # Avoid these combinations
+ fout.write(presentChar)
+ if presentChar!="":
+ lastChar=presentChar
+ buffer=buffer[1:]
+ if buffer=="":
+ return # EOF
+ tag=""
+ while buffer[0]!=" " and buffer[0]!="\t" and buffer[0]!="\n" and buffer[0]!="\r" and buffer[0]!=">":
+ tag=tag+buffer[0]
+ buffer=buffer[1:]
+ buffer=buffer[1:]
+ return tag[1:]
+
+# Returns string until string found (removes all from buffer)
+def contentUntil(until):
+ global buffer
+ straux=""
+ lastChar="*" # This is not the global variable; just an internal control var
+
+ while buffer[:len(until)]!=until:
+
+ # No TABS, NLs or CRs will be written:
+ #if buffer[0]=="\t" or buffer[0]=="\n" or buffer[0]=="\r":
+ # presentChar=" "
+ #else:
+ # presentChar=buffer[0]
+
+ presentChar=buffer[0]
+
+ # replace tabs with spaces
+ if (lastChar=="\t" and presentChar=="\t"):
+ straux=straux+" "
+ elif(presentChar=="\t"):
+ straux=straux+""
+ else:
+ straux=straux+presentChar
+
+ buffer=buffer[1:]
+ if presentChar!="":
+ lastChar=presentChar
+ buffer=buffer[len(until):]
+ return straux
+
+def fileSel(filename):
+ xml2wiki(filename)
+
+def xml2wiki(fname):
+ global buffer,lastChar,fout,escape
+ listType="?"
+ lastChar="*"
+ fin=open(fname,"r")
+ fout=open(fname[:len(fname)-4]+".txt","w")
+ buffer=fin.read()
+ outp=0
+ while len(buffer)>0:
+ aux=nextag(outp)
+ if aux=="chapter":
+ contentUntil("<title>")
+ fout.write("\n='''"+contentUntil("</title>")+"'''=\n")
+ lastChar="\n"
+ elif aux=="section":
+ contentUntil("<title>")
+ fout.write("\n="+contentUntil("</title>")+"=\n")
+ lastChar="\n"
+ elif aux=="bridgehead":
+ contentUntil(">")
+ fout.write("\n==="+contentUntil("</bridgehead>")+"===\n")
+ lastChar="\n"
+ elif aux=="para":
+ fout.write("\n")
+ lastChar="\n"
+ outp=1
+ elif aux=="emphasis":
+ fout.write("'''")
+ contentUntil('>') # this only works when a role attribute is set
+ fout.write(contentUntil('</emphasis>'))
+ fout.write("'''")
+ elif aux=="/para":
+ fout.write("\n")
+ lastChar="\n"
+ outp=0
+ elif aux=="itemizedlist":
+ fout.write("\n")
+ lastChar="\n"
+ listType="* "
+ elif aux=="orderedlist":
+ fout.write("\n")
+ lastChar="\n"
+ listType="# "
+ elif aux=="listitem":
+ contentUntil("<para>")
+ outp=1
+ fout.write(listType)
+ lastChar=" "
+ elif aux=="keycap":
+ fout.write("{{KEY|"+contentUntil("</keycap>")+"}}")
+ lastChar="}"
+ elif aux=="literal":
+ fout.write("{{Literal|"+contentUntil("</literal>")+"}}")
+ lastChar="}"
+ elif aux=="xref":
+ contentUntil('="')
+ fout.write("''%%%%%XREF:"+contentUntil('"/>')+"''")
+ lastChar="'"
+ elif aux=="figure":
+ contentUntil("<title>")
+ aux=contentUntil("</title>")
+ contentUntil('fileref="')
+ fout.write("\n[[Image:"+contentUntil('"')+"|frame|none|"+aux+"]]\n")
+ lastChar="\n"
+ contentUntil("</figure>")
+ elif aux=="inlinegraphic":
+ contentUntil('="')
+ fout.write("[[Image:"+contentUntil('"')+"]]")
+ lastChar="]"
+ contentUntil(">")
+ elif aux=="command":
+ fout.write("====")
+ fout.write(contentUntil('</command>'))
+ fout.write("====")
+ elif aux=="programlisting":
+ contentUntil("<![CDATA[")
+ fout.write("<pre>")
+ code=contentUntil("]]>")
+ fout.write(code)
+ fout.write("</pre>")
+ elif aux=="tip" or aux=="note":
+ while buffer[0]!="<": # We might want to keep the '<' char in buffer
+ buffer=buffer[1:]
+ if buffer[:7]=="<title>":
+ buffer=buffer[7:]
+ fout.write("\n{{Tip|"+contentUntil("</title>")+"|")
+ else:
+ fout.write("\n{{Tip|"+titleNote+"=")
+ lastChar="|"
+ elif aux=="/tip" or aux=="/note":
+ fout.write("}}\n")
+ lastChar="\n"
+ elif aux=="informalequation":
+ fout.write("\n%%%%%INFORMALEQUATION:")
+ fout.write(contentUntil("</informalequation>"))
+ fout.write(":INFORMALEQUATION%%%%%\n")
+ lastChar="\n"
+ elif aux=="link":
+ contentUntil('="')
+ fout.write("%%%%%LINK:"+contentUntil('">')+"==>"+contentUntil("</link>")+":LINK%%%%%")
+ lastChar="%"
+ elif aux=="ulink":
+ contentUntil('url="')
+ href=contentUntil('">')
+ name=contentUntil('</ulink>')
+ fout.write("["+href+" "+name+"]")
+ elif aux=="table":
+ fout.write('{| border="1" cellpadding="5" cellspacing="0"\n')
+ outp=0
+ elif aux=="entry":
+ lastChar=('>')
+ entry=contentUntil('</entry>')
+ fout.write("|"+entry+"\n")
+ elif aux=="/row":
+ fout.write("|-"+"\n")
+ elif aux=="/table":
+ fout.write("|}\n")
+ outp=1
+
+
+ fout.close
+ fin.close
+
+fname = raw_input("Filename: ")
+xml2wiki(fname)
Property changes on: trunk/jbossws-docs/db2wiki.py
___________________________________________________________________
Name: svn:executable
+ *
17 years, 4 months