2002/ws/desc/tools setup-namespaces,1.18,1.19

Update of /sources/public/2002/ws/desc/tools
In directory homer:/tmp/cvs-serv22009

Modified Files:
	setup-namespaces 
Log Message:
Added RDDL generation


Index: setup-namespaces
===================================================================
RCS file: /sources/public/2002/ws/desc/tools/setup-namespaces,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** setup-namespaces	3 May 2005 11:45:26 -0000	1.18
--- setup-namespaces	3 May 2005 19:25:10 -0000	1.19
***************
*** 6,9 ****
--- 6,10 ----
  use XML::DOM;
  use File::Copy;
+ use URI;
  
  if ($#ARGV != 4) {
***************
*** 81,84 ****
--- 82,86 ----
      $c =~ s|\@Y\@|$Y|g;
      $c =~ s|\@M\@|$M|g;
+     $c =~ s|\@D\@|$D|g;
      my $signatureTemplate = &readFromDoc("templates/signature");
      $c =~ s|\@SIG\@|$signatureTemplate|g;
***************
*** 135,153 ****
  ###########################################################################
  
  sub moveSchema() {
!     my $src = "$PUBDIR/$_[0]";
!     my $dst = "$TARGET/$_[1]";
      move($src, $dst) || die "mv $src $dst: $!";
!     print "Installed $_[1]\n";
  }
  
  if ($ID eq 'PART1') {
!     &moveSchema("wsdl20.xsd", "wsdl20.xsd");
!     &moveSchema("wsdl20-instance.xsd", "../wsdl-instance.xsd");
  }
  elsif ($ID eq 'PART2') {
!     &moveSchema("wsdl20-soap.xsd", "soap.xsd");
!     &moveSchema("wsdl20-http.xsd", "http.xsd");
!     &moveSchema("wsdl20-rpc.xsd", "rpc.xsd");
  }
  
--- 137,178 ----
  ###########################################################################
  
+ sub genRDDLDoc() {
+     &genRDDLFromTemplate(@_, "xhtml");
+     &genRDDLFromTemplate(@_, "html");
+ }
+ 
+ sub genRDDLFromTemplate() {
+     my ($t, $d, $ns, $latest, $ext) = @_;
+     my $c = &readFromTemplate("rddl.$ext");
+     $c =~ s|\@NS\@|$ns|g;
+     $c =~ s|\@LATEST\@|http://www.w3.org/2002/ws/desc/ns/$latest.xsd|g;
+     my $target = $t;
+     $target =~ s|$WWW|http://www.w3.org|;
+     my $normal = URI->new_abs("$d.xsd", "$target/")->canonical;
+     $c =~ s|\@THIS\@|$normal|g;
+     my @a = split('/', $d);
+     my $n = $a[$#a];
+     $c =~ s|\@ALT\@|$n|g;
+     &writeInDoc("$t/$d.$ext", $c);
+     print "Generated $d.$ext\n";
+ }
+ 
  sub moveSchema() {
!     my ($s, $d, $ns, $latest) = @_;
!     my $src = "$PUBDIR/$s";
!     my $dst = "$TARGET/$d.xsd";
      move($src, $dst) || die "mv $src $dst: $!";
!     print "Installed $d.xsd\n";
!     &genRDDLDoc($TARGET, $d, $ns, $latest);
  }
  
  if ($ID eq 'PART1') {
!     &moveSchema("wsdl20.xsd", "wsdl20", "WSDL 2.0", "wsdl20");
!     &moveSchema("wsdl20-instance.xsd", "../wsdl-instance", "WSDL Instance", "wsdl-instance");
  }
  elsif ($ID eq 'PART2') {
!     &moveSchema("wsdl20-soap.xsd", "soap", "WSDL 2.0 SOAP Binding", "soap");
!     &moveSchema("wsdl20-http.xsd", "http", "WSDL 2.0 HTTP Binding", "http");
!     &moveSchema("wsdl20-rpc.xsd", "rpc", "WSDL 2.0 RPC Style", "rpc");
  }
  

Received on Tuesday, 3 May 2005 19:25:19 UTC