This commit was manufactured by cvs2svn to create branch 'glite-jp-ws-
authorcvs2svn <admin@example.com>
Tue, 28 Mar 2006 18:05:23 +0000 (18:05 +0000)
committercvs2svn <admin@example.com>
Tue, 28 Mar 2006 18:05:23 +0000 (18:05 +0000)
interface_branch_1_2_0_RC31'.

Sprout from glite-jp-ws-interface_branch_1_1_0_RC15 2005-10-15 14:01:44 UTC cvs2svn <admin@example.com> 'This commit was manufactured by cvs2svn to create branch 'glite-jp-ws-'
Cherrypick from master 2006-03-28 18:05:22 UTC Aleš Křenek <ljocha@ics.muni.cz> '- --nonet for xsltproc and xmllint':
    org.glite.jp.ws-interface/Makefile
    org.glite.jp.ws-interface/project/glite-jp-ws-interface.spec
    org.glite.jp.ws-interface/project/version.properties
    org.glite.jp.ws-interface/src/puke-schema.xsl
    org.glite.jp.ws-interface/src/puke-ug.xsl

org.glite.jp.ws-interface/Makefile
org.glite.jp.ws-interface/project/glite-jp-ws-interface.spec
org.glite.jp.ws-interface/project/version.properties
org.glite.jp.ws-interface/src/puke-schema.xsl [new file with mode: 0644]
org.glite.jp.ws-interface/src/puke-ug.xsl

index f762daa..bbd4c5b 100644 (file)
@@ -14,13 +14,14 @@ PREFIX=/opt/glite
 VPATH=${top_srcdir}/interface:${top_srcdir}/src
 STAGETO=interface
 
-XSLTPROC=xsltproc
-XMLLINT:=xmllint
+XSLTPROC=xsltproc --nonet
+XMLLINT:=xmllint --nonet
 docbookxls:=http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
 
 WSDL=JobProvenancePS.wsdl JobProvenanceIS.wsdl JobProvenanceTypes.wsdl 
+XSD=JobProvenanceTypes.xsd
 
-all compile: ${WSDL} JobProvenance.html
+all compile: ${WSDL} ${XSD} JobProvenance.html
 
 check: 
        @echo No unit test required for interface-only module.
@@ -47,14 +48,17 @@ install:
        install -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version}
        install -m 644 JobProvenance.html ${PREFIX}/share/doc/${package}-${version}
 #      cd ${top_srcdir}/interface && install -m 644 ${WSDL} ${PREFIX}/${STAGETO}
-       install -m 644 ${WSDL} ${PREFIX}/${STAGETO}
+       install -m 644 ${WSDL} ${XSD} ${PREFIX}/${STAGETO}
 
 clean:
        rm -f *.h
        
-%.wsdl: %.xml
+%.wsdl: %.xml puke-wsdl.xsl
        ${XSLTPROC} ../src/puke-wsdl.xsl $< >$@
 
+%.xsd: %.xml puke-schema.xsl
+       ${XSLTPROC} ../src/puke-schema.xsl $< >$@
+
 JobProvenance.html: doc.xml JobProvenancePS.xml JobProvenanceIS.xml JobProvenanceTypes.xml puke-ug.xsl
        ${XSLTPROC} --novalid ../src/puke-ug.xsl $< >doc-html.xml
        ${XMLLINT} --valid --noout doc-html.xml
index 930f7e7..c49cbee 100644 (file)
@@ -1,12 +1,12 @@
 Summary:Change me !!!
 Name:glite-jp-ws-interface
 Version:1.1.0
-Release:0_U200510151557
+Release:0_U200512201442
 Copyright:Open Source EGEE License
 Vendor:EU EGEE project
 Group:System/Application
 Prefix:/opt/glite
-BuildArch:i386
+BuildArch:x86_64
 BuildRoot:%{_builddir}/%{name}-%{version}
 Source:glite-jp-ws-interface-1.1.0_bin.tar.gz
 
diff --git a/org.glite.jp.ws-interface/src/puke-schema.xsl b/org.glite.jp.ws-interface/src/puke-schema.xsl
new file mode 100644 (file)
index 0000000..fdbe9fb
--- /dev/null
@@ -0,0 +1,161 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0"
+       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
+       xmlns:jp="http://glite.org/wsdl/services/jp"
+       xmlns:jpe="http://glite.org/wsdl/elements/jp"
+       xmlns:jpt="http://glite.org/wsdl/types/jp">
+
+<xsl:output indent="yes"/>
+
+<xsl:template match="/service">
+
+               <xsl:apply-templates select="types"/>
+               
+</xsl:template>
+
+<xsl:template match="types">
+               <xsd:schema targetNamespace="{@ns}"
+                       elementFormDefault="unqualified"
+                       attributeFormDefault="unqualified">
+
+                       <xsl:apply-templates/>
+               </xsd:schema>
+</xsl:template>
+
+<xsl:template match="enum">
+       <xsd:simpleType name="{@name}">
+               <xsd:restriction base="xsd:string">
+                       <xsl:for-each select="val"><xsd:enumeration value="{@name}"/></xsl:for-each>
+               </xsd:restriction>
+       </xsd:simpleType>
+</xsl:template>
+
+<xsl:template match="flags">
+       <xsd:simpleType name="{@name}Value">
+               <xsd:restriction base="xsd:string">
+                       <xsl:for-each select="val"><xsd:enumeration value="{@name}"/></xsl:for-each>
+               </xsd:restriction>
+       </xsd:simpleType>
+       <xsd:complexType name="{@name}">
+               <xsd:sequence>
+                       <xsd:element name="flag" type="{/service/@typePrefix}:{@name}Value" minOccurs="0" maxOccurs="unbounded"/>
+               </xsd:sequence>
+       </xsd:complexType>
+</xsl:template>
+
+<xsl:template match="struct">
+       <xsd:complexType name="{@name}">
+               <xsd:sequence>
+                       <xsl:call-template name="inner-struct"/>
+               </xsd:sequence>
+       </xsd:complexType>
+</xsl:template>
+
+<xsl:template match="choice">
+       <xsd:complexType name="{@name}">
+               <xsd:choice>
+                       <xsl:call-template name="inner-struct"/>
+               </xsd:choice>
+       </xsd:complexType>
+</xsl:template>
+
+
+<xsl:template name="inner-struct">
+       <xsl:variable name="nillable">
+               <xsl:choose>
+                       <xsl:when test="local-name(.)='choice'">true</xsl:when>
+                       <xsl:otherwise>false</xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+                       <xsl:for-each select="elem">
+                               <xsl:variable name="type">
+                                       <xsl:choose>
+                                               <xsl:when test="contains(@type,':')">
+                                                       <xsl:value-of select="@type"/>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       <xsl:value-of select="/service/@typePrefix"/>:<xsl:value-of select="@type"/>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:variable>
+                               <xsl:variable name="min">
+                                       <xsl:choose>
+                                               <xsl:when test="@optional='yes'">0</xsl:when>
+                                               <xsl:otherwise>1</xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:variable>
+                               <xsl:variable name="max">
+                                       <xsl:choose>
+                                               <xsl:when test="@list='yes'">unbounded</xsl:when>
+                                               <xsl:otherwise>1</xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:variable>
+                               <xsd:element name="{@name}" type="{$type}" minOccurs="{$min}" maxOccurs="{$max}" nillable="{$nillable}"/>
+                       </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="op" mode="element">
+       <xsd:element name="{@name}">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsl:for-each select="input">
+                                       <xsl:variable name="prefix">
+                                               <xsl:choose>
+                                                       <xsl:when test="starts-with(@type,'xsd:')"/>
+                                                       <xsl:otherwise><xsl:value-of select="/service/@typePrefix"/>:</xsl:otherwise>
+                                               </xsl:choose>
+                                       </xsl:variable>
+                                       <xsl:variable name="max">
+                                               <xsl:choose>
+                                                       <xsl:when test="@list='yes'">unbounded</xsl:when>
+                                                       <xsl:otherwise>1</xsl:otherwise>
+                                               </xsl:choose>
+                                       </xsl:variable>
+                                       <xsd:element name="{@name}" type="{$prefix}{@type}" minOccurs="1" maxOccurs="{$max}"/>
+                               </xsl:for-each>
+                       </xsd:sequence>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="{@name}Response">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsl:for-each select="output">
+                                       <xsl:variable name="prefix">
+                                               <xsl:choose>
+                                                       <xsl:when test="starts-with(@type,'xsd:')"/>
+                                                       <xsl:otherwise><xsl:value-of select="/service/@typePrefix"/>:</xsl:otherwise>
+                                               </xsl:choose>
+                                       </xsl:variable>
+                                       <xsl:variable name="max">
+                                               <xsl:choose>
+                                                       <xsl:when test="@list='yes'">unbounded</xsl:when>
+                                                       <xsl:otherwise>1</xsl:otherwise>
+                                               </xsl:choose>
+                                       </xsl:variable>
+                                       <xsd:element name="{@name}" type="{$prefix}{@type}" minOccurs="1" maxOccurs="{$max}"/>
+                               </xsl:for-each>
+                       </xsd:sequence>
+               </xsd:complexType>
+       </xsd:element>
+</xsl:template>
+
+
+<xsl:template match="operations">
+               <xsd:schema targetNamespace="{/service/@elemNs}"
+                       elementFormDefault="unqualified"
+                       attributeFormDefault="unqualified">
+
+                       <xsl:apply-templates select="op" mode="element"/>
+
+                       <xsl:for-each select="/service/fault">
+                               <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}"/>
+                       </xsl:for-each>
+               </xsd:schema>
+
+</xsl:template>
+
+</xsl:stylesheet>
+
index 3d34891..8ce605b 100644 (file)
@@ -6,7 +6,7 @@
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
 <xsl:output indent="yes" doctype-public="-//OASIS//DTD DocBook XML V4.4//EN"
-      doctype-system="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"/>
+      doctype-system="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"/>
 
 <xsl:template match="book">
        <chapter>