Version 2.0 of http://egee.cesnet.cz/en/Schema/LB/Attributes
authorAleš Křenek <ljocha@ics.muni.cz>
Wed, 19 Mar 2008 14:09:32 +0000 (14:09 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Wed, 19 Mar 2008 14:09:32 +0000 (14:09 +0000)
generated from .T rather than hand-written, follow the naming

org.glite.lb.state-machine/Makefile
org.glite.lb.state-machine/interface/lb-job-attrs.xsd
org.glite.lb.state-machine/interface/lb-job-attrs2.xsd.T [new file with mode: 0644]
org.glite.lb.state-machine/interface/lb-job-record.xsd

index 7803ade..a94a3b8 100644 (file)
@@ -47,9 +47,11 @@ MACHINE_OBJS:=seqcode_aux.o process_event.o process_event_pbs.o process_event_co
 PLUGIN_LIB=glite_lb_plugin.la
 MACHINE_LIB=libglite_lb_statemachine.a
 
+XSD=lb-job-attrs2.xsd
+
 default all: compile
 
-compile: ${MACHINE_LIB} ${PLUGIN_LIB}
+compile: ${MACHINE_LIB} ${PLUGIN_LIB} ${XSD}
 
 ${PLUGIN_LIB}: ${PLUGIN_LOBJS}
        ${SOLINK} -o $@ ${PLUGIN_LOBJS} ${PLUGIN_LIBS}
@@ -69,6 +71,7 @@ install:
        install -m 644 ${MACHINE_LIB} ${PREFIX}/lib 
        ${INSTALL} -m 755 ${PLUGIN_LIB} ${PREFIX}/lib
        install -m 644 ${top_srcdir}/interface/lb-job-attrs.xsd ${PREFIX}/interface
+       install -m 644 lb-job-attrs2.xsd ${PREFIX}/interface
        install -m 644 ${top_srcdir}/interface/lb-job-record.xsd ${PREFIX}/interface
        install -m 644 ${top_srcdir}/interface/intjobstat.h ${PREFIX}/include/glite/lb
        install -m 644 ${top_srcdir}/interface/seqcode_aux.h ${PREFIX}/include/glite/lb
@@ -88,6 +91,11 @@ clean:
        ${AT3} $< >$@ || rm -f $@
        chmod -w $@ >/dev/null
 
+%.xsd: %.xsd.T
+       rm -f $@
+       ${AT3} $< >$@ || rm -f $@
+       chmod -w $@ >/dev/null
+
 %.o %.lo: %.c
        ${COMPILE} -c $<
 
@@ -100,3 +108,6 @@ lb_plugin.lo: lb_plugin.c job_attrs.h
 job_attrs.h: lb-job-attrs.xsd job_attrs.xsl
        ${XSLTPROC} ../src/job_attrs.xsl $< >$@
 
+job_attrs2.h: lb-job-attrs2.xsd job_attrs.xsl
+       ${XSLTPROC} ../src/job_attrs.xsl $< >$@
+
index a2a68bb..6bfb5eb 100644 (file)
@@ -3,6 +3,12 @@
 
 <!-- $Header$ -->
 
+<!-- 
+
+  ** This schema definition is deprecated, use version 2.0 in lb-job-attrs2.xsd at the same location **
+
+-->
+
 <xs:schema 
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:a="http://egee.cesnet.cz/en/Schema/LB/Attributes"
diff --git a/org.glite.lb.state-machine/interface/lb-job-attrs2.xsd.T b/org.glite.lb.state-machine/interface/lb-job-attrs2.xsd.T
new file mode 100644 (file)
index 0000000..fe4dcb2
--- /dev/null
@@ -0,0 +1,133 @@
+<?xml version="1.0"?>
+<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd">
+
+<!-- $Header$ -->
+
+<!--
+@@@AUTO
+-->
+
+@@@LANG: wsdl
+
+<xsd:schema
+       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+       xmlns:a="http://egee.cesnet.cz/en/Schema/LB/Attributes"
+       xmlns:a2="http://egee.cesnet.cz/en/Schema/LB/Attributes"
+       targetNamespace="http://egee.cesnet.cz/en/Schema/LB/Attributes"
+       version="2.0"
+       elementFormDefault="qualified"
+       attributeFormDefault="unqualified"
+>
+
+       <xsd:simpleType name="statusType">
+               <xsd:restriction base="xsd:string">
+@@@{
+       for my $s ($status->getTypesOrdered) {
+               my $u = uc $s;
+               gen qq{                 <xsd:enumeration value="$u"/>\n};
+       }
+@@@}
+               </xsd:restriction>
+       </xsd:simpleType>
+
+@@@{
+# _code_ -> ...Type
+       for my $n ($status->getAllFieldsOrdered) {
+               my $f = selectField $status $n;
+               if ($f->{codes}) {
+                       my $ln = getName $f;
+                       @ln = split /_/,$ln;
+                       my $un = shift @ln; $un .= ucfirst shift @ln while (@ln);
+                       gen qq{
+       <xsd:simpleType name="${un}Type">
+               <xsd:restriction base="xsd:string">
+};
+
+                       for (@{$f->{codes}}) {
+                               my $uc = uc $_->{name};
+                               gen qq{                 <xsd:enumeration value="$uc"/> \n};
+                       }
+                       gen qq{
+               </xsd:restriction>
+       </xsd:simpleType>
+};
+               }
+       }
+
+@@@}
+
+
+       <xsd:complexType name="historyStatusType">
+               <xsd:complexContent>
+                       <xsd:restriction base="xsd:anyType">
+                               <xsd:attribute name="name" type="a:statusType" use="required"/>
+                               <xsd:attribute name="timestamp" type="xsd:dateTime" use="required"/>
+                               <xsd:attribute name="reason" type="xsd:string" use="optional"/>
+                       </xsd:restriction>
+               </xsd:complexContent>
+       </xsd:complexType>
+
+       <xsd:complexType name="statusSequenceType">
+               <xsd:sequence>
+                       <xsd:element name="status" type="a:historyStatusType" minOccurs="0" maxOccurs="unbounded"/>
+               </xsd:sequence>
+       </xsd:complexType>
+
+       <xsd:complexType name="jobIdSequenceType">
+               <xsd:sequence>
+                       <xsd:element name="jobId" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+               </xsd:sequence>
+       </xsd:complexType>
+
+       <xsd:complexType name="stringSequenceType">
+               <xsd:sequence>
+                       <xsd:element name="item" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+               </xsd:sequence>
+       </xsd:complexType>
+
+       <xsd:complexType name="intSequenceType">
+               <xsd:sequence>
+                       <xsd:element name="item" type="xsd:int" minOccurs="0" maxOccurs="unbounded"/>
+               </xsd:sequence>
+       </xsd:complexType>
+
+       <xsd:complexType name="tagValue">
+               <xsd:sequence>
+                       <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
+                       <xsd:element name="value" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+               </xsd:sequence>
+       </xsd:complexType>
+
+       <xsd:complexType name="tagSequenceType">
+               <xsd:sequence>
+                       <xsd:element name="tag" type="a:TagValue" minOccurs="0" maxOccurs="unbounded"/>
+               </xsd:sequence>
+       </xsd:complexType>
+
+       <xsd:complexType name="timeval">
+               <xsd:sequence>
+                       <xsd:element name="tvSec" type="xsd:long"/>
+                       <xsd:element name="tvUsec" type="xsd:long"/>
+               </xsd:sequence>
+       </xsd:complexType>
+
+
+@@@{
+# elems
+       for my $n ($status->getAllFieldsOrdered) {
+               my $f = selectField $status $n;
+               my $type = getType $f;
+               my $name = getName $f;
+
+               $type = 'jobtypeType' if $name eq 'jobtype';
+
+               @ln = split /_/,$name;
+               my $un = shift @ln; $un .= ucfirst shift @ln while (@ln);
+
+               gen qq{ <xsd:element name="$un" type="$type"/>\n};
+
+       }
+@@@}
+
+</xsd:schema>
+
index 2ad2683..069a42e 100644 (file)
@@ -3,6 +3,11 @@
 
 <!-- $Header$ -->
 
+<!--
+       This schema reflects JRA2 statistics record which seems not to be used anynmore.
+       It is supported on the best effort basis only.
+-->
+
 <xs:schema 
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:jr="http://egee.cesnet.cz/en/Schema/LB/JobRecord"