From b730192c225da3342776b07e455cd98a9d6068e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Fri, 27 May 2005 12:13:19 +0000 Subject: [PATCH] LB WSDL generated from pukeable xml - WS-I compliant - compiles with gsoap - pretty printing added in Makefile --- org.glite.lb.ws-interface/Makefile | 29 ++- .../project/version.properties | 4 +- org.glite.lb.ws-interface/src/LB.xml | 68 ++++++ org.glite.lb.ws-interface/src/LB.xml.T | 127 ----------- org.glite.lb.ws-interface/src/LBTypes.xml.T | 249 +++++++++++++++++++++ org.glite.lb.ws-interface/src/puke-wsdl.xsl | 212 ++++++++++++++---- 6 files changed, 504 insertions(+), 185 deletions(-) create mode 100644 org.glite.lb.ws-interface/src/LB.xml delete mode 100644 org.glite.lb.ws-interface/src/LB.xml.T create mode 100644 org.glite.lb.ws-interface/src/LBTypes.xml.T diff --git a/org.glite.lb.ws-interface/Makefile b/org.glite.lb.ws-interface/Makefile index aacc67c..d498bd7 100644 --- a/org.glite.lb.ws-interface/Makefile +++ b/org.glite.lb.ws-interface/Makefile @@ -17,18 +17,19 @@ SUFFIXES = .T VPATH=${top_srcdir}/src AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3 XSLTPROC=xsltproc +TIDY=tidy STAGETO=interface -WSDL=LB.wsdl +WSDL=LB.wsdl LBTypes.wsdl -all compile: +all compile: ${WSDL} check: @echo No unit test required for interface-only module. -stage: - $(MAKE) install PREFIX=${stagedir} +stage: compile + $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes dist: distsrc distbin @@ -47,8 +48,15 @@ install: -mkdir -p ${PREFIX}/${STAGETO} -mkdir -p ${PREFIX}/share/doc/${package}-${version} install -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version} - cd ${top_srcdir}/interface && install -m 644 ${WSDL} ${PREFIX}/${STAGETO} -# install -m 644 ${WSDL} ${PREFIX}/${STAGETO} +# install the generated stuff instead +# cd ${top_srcdir}/interface && install -m 644 ${WSDL} ${PREFIX}/${STAGETO} + install -m 644 ${WSDL} ${PREFIX}/${STAGETO} + +# JP has its own version anyway +# if [ x${DOSTAGE} = xyes ]; then \ +# mkdir -p ${PREFIX}/share/lb; \ +# install -m 644 ${top_srcdir}/src/puke-wsdl.xsl ${top_srcdir}/src/puke-ug.xsl ${PREFIX}/share/lb; \ +# fi clean: rm -f *.h @@ -59,5 +67,10 @@ clean: ${AT3} $< >$@ || rm -f $@ chmod -w $@ >/dev/null -${WSDL}: LB.xml - ${XSLTPROC} ../src/puke-wsdl.xsl LB.xml >$@ +${WSDL}: %.wsdl: %.xml puke-wsdl.xsl + ${XSLTPROC} ../src/puke-wsdl.xsl $< >$@ + -${TIDY} -wrap 10000 -xml -m -i -q $@ + -perl -i -n -e 'if (/^\s*$$/) { $$empty .= "\n"; } elsif (/^\s*<(xsd:)?(enumeration|element|input|output|fault)/) { print $$_; $$empty = "";} else { print "$$empty$$_"; $$empty=""; }; ' $@ + +LB-ug.xml: LB.xml puke-ug.xsl + ${XSLTPROC} ../src/puke-ug.xsl $< >$@ diff --git a/org.glite.lb.ws-interface/project/version.properties b/org.glite.lb.ws-interface/project/version.properties index 88e0674..0866603 100755 --- a/org.glite.lb.ws-interface/project/version.properties +++ b/org.glite.lb.ws-interface/project/version.properties @@ -1,4 +1,4 @@ #Thu May 19 13:15:14 CEST 2005 -module.version=1.2.0 -module.build=2 +module.version=2.0.0 +module.build=1 module.age=1 diff --git a/org.glite.lb.ws-interface/src/LB.xml b/org.glite.lb.ws-interface/src/LB.xml new file mode 100644 index 0000000..9f94f8a --- /dev/null +++ b/org.glite.lb.ws-interface/src/LB.xml @@ -0,0 +1,68 @@ + + + + + Keeping track of state of grid jobs. + + + + + + + + Return version of the service. + Returned version. + Any error. + + + Query state of a single job. + Id of the queried job. + Which data fields to retrieve. + Current state of the job. + Any error. + + + Simplified query, return all jobs of the authenticated user. + JobId's of jobs matching the query. + States of jobs matching the query. + Any error. + + + Retrieve a list of jobs, including their states, based on query conditions. + The conditions take the form of a list of lists. + Elements of the inner lists refer to a single job attribute, the conditions are or-ed. + Elements of the outer list may refer to different job attributes, they are and-ed. + + The query conditions. + Which data fields to retrieve. + JobId's of jobs matching the query. + States of jobs matching the query. + Any error. + + + + Retrieve events matching a query. + There are two sets of conditions, on jobs and on individual events, both have to be satisfied. + Both query conditions have the same format as in QueryJobs. + + + Conditions on jobs. + + + Conditions on individual events. + + All matchin events. + Any error. + + + + + + + diff --git a/org.glite.lb.ws-interface/src/LB.xml.T b/org.glite.lb.ws-interface/src/LB.xml.T deleted file mode 100644 index a96551b..0000000 --- a/org.glite.lb.ws-interface/src/LB.xml.T +++ /dev/null @@ -1,127 +0,0 @@ - - -@@@LANG: wsdl - - - - - Keeping track of state of grid jobs. - - - - Flags determining which fields of job status should be retrieved. - Can be combined arbitrarily. - Include also long job descriptions (JDL). - Return list of subjobs of a DAG. - Return state of the subjobs, i.e. apply other flags recursively - - - -@@@{ - for my $stat ($status->getTypesOrdered) { - my $u = uc $stat; - my $c = getTypeComment $status $stat; - gen qq{ -! $c -}; - } -@@@} - - -@@@{ - for my $n ($status->getAllFieldsOrdered) { - my $f = selectField $status $n; - if ($f->{codes}) { - my $n = getName $f; - $n = $1.ucfirst $2 while $n =~ /([[:alpha:]]*)_([[:alpha:]]*)/; - gen qq{ -! -}; - for (@{$f->{codes}}) { - my $uc = uc $_->{name}; - gen qq{ -! $_->{comment} -}; - } - gen qq{ -! -}; - } - } -@@@} - - - - - Status of a job, possibly including subjobs. - Status name. -@@@{ - for my $n (getAllFieldsOrdered $status) { - selectField $status $n; - my $f = getField $status; - my $name = getName $f; - $name = $1.ucfirst $2 while $name =~ /([[:alpha:]]*)_([[:alpha:]]*)/; - my $type = $f->{type}; - my $list = 'no'; - - if ($main::baseTypes{$type}) { - $type = eval $main::types{wsdl}->{$main::baseTypes{$type}}; - $list = 'yes' - } - elsif ($f->{codes}) { - $type = $name; - } - else { - $type = getType $f; - } - - my $comment = getComment $f; -# XXX: currently nothing is "optional" as we don't know from status.T - gen qq{ -! $comment -}; - } -@@@} - - - - - - - - - - - - - - - Generic SOAP fault, used to deliver any LB errors. - Source component (module) of the error. - Numeric error code. - Error text corresponding to the code. - Additional description of the error (e.g. filename) - Reason of the error, coming from lower levels. - - - - - - - - - - - Query state of a single job. - Id of the queried job. - Which data fields to retrieve. - Current state of the job. - Any error. - - - diff --git a/org.glite.lb.ws-interface/src/LBTypes.xml.T b/org.glite.lb.ws-interface/src/LBTypes.xml.T new file mode 100644 index 0000000..69b55a7 --- /dev/null +++ b/org.glite.lb.ws-interface/src/LBTypes.xml.T @@ -0,0 +1,249 @@ + + +@@@LANG: wsdl + + + + + + + Flags determining which fields of job status should be retrieved. + Can be combined arbitrarily. + Include also long job descriptions (JDL). + Return list of subjobs of a DAG. + Return state of the subjobs, i.e. apply other flags recursively + + + +@@@{ + for my $stat ($status->getTypesOrdered) { + my $u = uc $stat; + my $c = getTypeComment $status $stat; + gen qq{ +! $c +}; + } +@@@} + + +@@@{ + for my $n ($status->getAllFieldsOrdered) { + my $f = selectField $status $n; + if ($f->{codes}) { + my $n = getName $f; + $n = $1.ucfirst $2 while $n =~ /([[:alpha:]]*)_([[:alpha:]_]*)/; + gen qq{ +! +}; + for (@{$f->{codes}}) { + my $uc = uc $_->{name}; + gen qq{ +! $_->{comment} +}; + } + gen qq{ +! +}; + } + } +@@@} + + + Status of a job, possibly including subjobs. + Status name. +@@@{ + for my $n (getAllFieldsOrdered $status) { + selectField $status $n; + my $f = getField $status; + my $name = getName $f; + $name = $1.ucfirst $2 while $name =~ /([[:alpha:]]*)_([[:alpha:]_]*)/; + my $type = $f->{type}; + my $list = 'no'; + + if ($main::baseTypes{$type}) { + $type = eval $main::types{wsdl}->{$main::baseTypes{$type}}; + $list = 'yes' + } + elsif ($f->{codes}) { + $type = $name; + } + else { + $type = getType $f; + } + + my $comment = getComment $f; + if ($name eq 'stateEnterTimes' || $name eq 'childrenHist') { +# XXX: stateEnterTimes and childrenHist are the only case of enum-indexed array + gen qq{ +! $comment +}; + } + else { +# XXX: currently nothing is "optional" as we don't know from status.T + gen qq{ +! $comment +}; + } + } +@@@} + + + +@@@{ + for my $name (sort { $event->{order}->{$a} <=> $event->{order}->{$b} } getTypes $event) { + my $comment = getTypeComment $event $name; + $name = $1.ucfirst $2 while $name =~ /([[:alpha:]]*)_([[:alpha:]_]*)/; + gen qq{ +! $comment +}; + } +@@@} + + +@@@{ + for my $type (sort { $event->{order}->{$a} <=> $event->{order}->{$b} } getTypes $event) { + my $tn = $type; + $tn = $1.ucfirst $2 while $tn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/; + + gen qq{ +! +}; + selectType $event '_common_'; + for ($event->getFieldsOrdered) { + my $f = selectField $event $_; + my $fn = $f->{name}; + my $ftn = $f->getType; + + $fn = $1.ucfirst $2 while $fn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/; + $ftn = $1.ucfirst $2 while $ftn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/; + + my $comment = getComment $f; + my $opt = $f->{optional} ? 'yes' : 'no'; + gen qq{ + $comment + }; + } + + selectType $event $type; + for ($event->getFieldsOrdered) { + my $f = selectField $event $_; + my $fn = $f->{name}; + my $ftn = $f->getType; + + $fn = $1.ucfirst $2 while $fn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/; + $ftn = $1.ucfirst $2 while $ftn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/; + + my $comment = getComment $f; + my $opt = $f->{optional} ? 'yes' : 'no'; + gen qq{ + $comment + }; + } + gen "\n\n"; + } +@@@} + + + Possible sources of LB events. + + + + + + + + + + + + The job state. + When the state was entered last time. + + + + The job state of the children. + How many children are in this state. + + + + + + + + + + + + + + + Generic SOAP fault, used to deliver any LB errors. + Source component (module) of the error. + Numeric error code. + Error text corresponding to the code. + Additional description of the error (e.g. filename) + Reason of the error, coming from lower levels. + + + + An element of outer list of query conditions in job queries. + It expresses possibly several conditions (records) on a single job attribute. + These conditions are logically OR-ed. + The job attribute to which the query conditions apply. + Name of the queried user tag if attr is USERTAG. + Name of the job state to which "attr = TIME" condition refers. + The conditions. + + + + Specification of a job attribute in query. + A concrete JobId + Owner of the job (X509 certificate subject). + Status of the job (see statName type). + Where the job is currently handled (hostname). + Where the job is or was scheduled to be executed. + How the job terminated (see doneCode type) + Value of particular user tag. The tag name has to be specified in queryConditions.tagName. + When the job entered a particular state. The state has to be specified in queryCondition.statName. + The job was resubmitted. + JobId of the job parend (DAG). + UNIX exit code of the job. + Where the event was generated. + Source component. + Instance of the source component. + Event type. + Checkpoint tag. + + + + A single query condition. + Relational operator of the condition. + Value to compare the attribute with. + Another value to compare the attribute with (op = WITHIN only). + + + + Relational operator of query conditions. + Attribute is equal to the specified value + Attribute is less than the specified value or equal + Attribute is greater than the specified value or equal + Attribute is withing a range (queryRecord.value2 must be specified) + Attribute is not equal to the specified value. + + + + A value to compare an attribute with in queries. + Exactly one of the elements must be specified. + Integer. + String. + Timestamp. + + + + + + diff --git a/org.glite.lb.ws-interface/src/puke-wsdl.xsl b/org.glite.lb.ws-interface/src/puke-wsdl.xsl index 9342e89..1ca4379 100644 --- a/org.glite.lb.ws-interface/src/puke-wsdl.xsl +++ b/org.glite.lb.ws-interface/src/puke-wsdl.xsl @@ -1,12 +1,14 @@ @@ -17,47 +19,49 @@ name="{@name}" targetNamespace="{@ns}"> - - - - - - - - - - - - - - - - - - - - - + - + + + + + - + + - - + + + + + @@ -65,7 +69,7 @@ - + @@ -76,15 +80,30 @@ - + - + + + + + + + + + + + + + + + + @@ -92,7 +111,7 @@ - : + : @@ -110,31 +129,79 @@ + - - - - - + + + - - - - - + + + + + + + + + + + + : + + + + + unbounded + 1 + + + + + + + + + + + + + + + : + + + + + unbounded + 1 + + + + + + + + + + - + @@ -151,17 +218,66 @@ - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.8.2.3