added resource list type
authorMichal Voců <michal@ruk.cuni.cz>
Thu, 8 Dec 2011 16:32:51 +0000 (16:32 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Thu, 8 Dec 2011 16:32:51 +0000 (16:32 +0000)
org.glite.lb.server/src/lb_xml_parse.c.T
org.glite.lb.server/src/lb_xml_parse_V21.c.T
org.glite.lb.server/src/ws_typeref.c.T
org.glite.lb.ws-interface/src/LBTypes.xml.T

index 773ee2a..afde05d 100644 (file)
@@ -1838,7 +1838,7 @@ int edg_wll_JobStatusToXML(edg_wll_Context ctx, edg_wll_JobStat stat, char **mes
        if (stat.children) edg_wll_add_strlist_to_XMLBody(&pomB, stat.children, "children", "jobId", "\t\t\t", NULL);
        if (stat.children_hist) edg_wll_add_intlist_to_XMLBody(&pomB, stat.children_hist, "children_hist", edg_wll_StatToString, "\t\t\t", 1, stat.children_hist[0]);
        if (stat.children_states) edg_wll_add_stslist_to_XMLBody(ctx, &pomB, stat.children_states, "children_states", "", EDG_WLL_JOB_UNDEF);
-       if (stat.user_tags) edg_wll_add_taglist_to_XMLBody(&pomB, stat.user_tags, "user_tags", "tag", "name", "\t\t\t", NULL);
+       if (stat.user_tags) edg_wll_add_usertag_to_XMLBody(&pomB, stat.user_tags, "user_tags", "tag", "name", "\t\t\t", NULL);
        if (stat.stateEnterTimes) edg_wll_add_intlist_to_XMLBody(&pomB, stat.stateEnterTimes, "stateEnterTimes", edg_wll_StatToString, "\t\t\t",1, stat.stateEnterTimes[0]);
 
        pomC = edg_wll_StatToString(stat.state);
index 540302a..111be9c 100644 (file)
@@ -1184,7 +1184,7 @@ int edg_wll_JobStatusToXMLV21(edg_wll_Context ctx, edg_wll_JobStat stat, char **
        if (stat.children) edg_wll_add_strlist_to_XMLBody(&pomB, stat.children, "children", "jobId", "\t\t\t", NULL);
        if (stat.children_hist) edg_wll_add_intlist_to_XMLBody(&pomB, stat.children_hist, "children_hist", return_string_el, "\t\t\t", 1, stat.children_hist[0]);
        if (stat.children_states) edg_wll_add_stslist_to_XMLBodyV21(ctx, &pomB, stat.children_states, "children_states", "", EDG_WLL_JOB_UNDEF);
-       if (stat.user_tags) edg_wll_add_taglist_to_XMLBody(&pomB, stat.user_tags, "user_tags", "tag", "name", "\t\t\t", NULL);
+       if (stat.user_tags) edg_wll_add_usertag_to_XMLBody(&pomB, stat.user_tags, "user_tags", "tag", "name", "\t\t\t", NULL);
        if (stat.stateEnterTimes) edg_wll_add_intlist_to_XMLBody(&pomB, stat.stateEnterTimes, "stateEnterTimes", return_string_el, "\t\t\t",1, stat.stateEnterTimes[0]);
 
        pomC = edg_wll_StatToString(stat.state);
index 069400c..63b7ec1 100644 (file)
@@ -64,7 +64,7 @@ sub eventFieldAssign {
        };
        $source = "$src->$native_en.$native_fn";
        $dest = "VALUEEV_GET($dst, $soap_en)->$soap_fn";
-#      print STDERR "$src, $dst, $soap_en, $soap_fn, $native_fn, $tn, $usuc\n";
+       print STDERR "$src, $dst, $soap_en, $soap_fn, $native_fn, $tn, $usuc\n";
 
        if ($tn eq 'int') {
                if ($f->{codes}) {
@@ -103,6 +103,23 @@ sub eventFieldAssign {
                        gen $indent."$dest = soap_malloc(soap, sizeof(*$dst->$soap_fn));\n";
                        gen $indent."$dest->tag = soap_strdup(soap, $source.tag);\n";
                        gen $indent."$dest->value = soap_strdup(soap, $source.value);\n";
+       } elsif ($tn eq 'taglist') {
+                       gen qq{
+!      {
+!              struct lbt__tagValue    *t;
+!               int i;
+!
+!              for (i=0; $source && $source\[i].tag; i++);
+!              /* GLITE_SECURITY_GSOAP_LIST_CREATE(soap, $dst, $soap_en.$soap_fn, struct lbt__tagValue, i); */
+!              GLITE_SECURITY_GSOAP_LIST_CREATE0(soap, $dest, VALUEEV_GET($dst,$soap_en)->__size$soap_fn, struct lbt__tagValue, i);
+!              for (i=0; $source && $source\[i].tag; i++) {
+!                      t = GLITE_SECURITY_GSOAP_LIST_GET($dest, i);
+!                      t->tag = soap_strdup(soap,$source\[i].tag);
+!                      t->value = soap_strdup(soap,$source\[i].value);
+!              }
+!      }
+};
+
        } else {
                die "Unknown type $tn";
        }
@@ -136,6 +153,20 @@ sub eventFieldFree {
                gen $indent."   if ($dest->value) soap_dealloc(soap, $dest->value);\n";
                gen $indent."   soap_dealloc(soap, $dest);\n";
                gen $indent."}\n";
+       } elsif ($tn eq 'taglist') {
+               gen qq{
+!               if($dest) {
+!                      struct lbt__tagValue *t;
+!                      int i;
+!
+!                      for(i=0; i < VALUEEV_GET($dst, $soap_en)->__size$soap_fn; i++) {
+!                              t = GLITE_SECURITY_GSOAP_LIST_GET($dest, i);
+!                              if(t->tag) soap_dealloc(soap, t->tag);
+!                              if(t->value) soap_dealloc(soap, t->value);
+!                      }
+!                      GLITE_SECURITY_GSOAP_LIST_DESTROY0(soap, $dest, VALUEEV_GET($dst, $soap_en)->__size$soap_fn);
+!              }
+               };
        } else {
                die "Unknown type $tn";
        }
index 610e123..7df25c7 100644 (file)
                        my $f = selectField $event $_;
                        my $fn = $f->{name};
                        my $ftn = $f->getType;
+                       my $type = $f->{type};
+                       my $list = 'no';
 
+                       if ($main::baseTypes{$type}) {
+                               $ftn = eval $main::types{wsdl}->{$main::baseTypes{$type}};
+                               $list = 'yes'
+                       }               
 
                        $fn = $1.ucfirst $2 while $fn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/;
                        $ftn = $tn . '_' . $fn if ($f->{codes});
 
                        my $comment = getComment $f;
                        my $opt = $f->{optional} ? 'yes' : 'no';
-                       gen qq{\t\t\t\t<elem name="$fn" type="$ftn" optional="$opt">$comment</elem>
+                       gen qq{\t\t\t\t<elem name="$fn" type="$ftn" list="$list" optional="$opt">$comment</elem>
 };
                }
                gen "</struct>\n\n";