origin has to be specified
authorAleš Křenek <ljocha@ics.muni.cz>
Wed, 6 Jun 2007 16:29:10 +0000 (16:29 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Wed, 6 Jun 2007 16:29:10 +0000 (16:29 +0000)
org.glite.jp.index/examples/pch06/pch.pm

index 9183f62..cbfd5af 100644 (file)
@@ -49,7 +49,7 @@ my @jobs;
 # query to Job Provenance Index Server
 #
 sub isquery {
-       my ($server, $queries, $attributes) = @_;
+       my ($server, $queries, $attributes, $origin) = @_;
        my ($s, @jobs);
        my $args = '';
        my @attributes;
@@ -59,6 +59,8 @@ sub isquery {
        if ($attributes) { @attributes = @$attributes; }
        else { @attributes = @default_is_attributes; }
 
+       $origin = 'USER' unless $origin;
+
        $s = $isquery[0];
        foreach my $query (@$queries) {
                my @query = @$query;
@@ -67,7 +69,7 @@ sub isquery {
                $s .= "\t<attr>$query[0]</attr>\n";
                while ($i <= $#query) {
                        my @record = @{$query[$i]};
-                       $s .= "\t<origin>USER</origin>\n";
+                       $s .= "\t<origin>$origin</origin>\n";
                        $s .= "\t<record>\n";
                        $s .= "\t\t<op>$record[0]</op>\n";
                        $s .= "\t\t<value>$record[1]</value>\n";