aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authormozilla%colinogilvie.co.uk <>2008-05-19 23:38:23 +0000
committermozilla%colinogilvie.co.uk <>2008-05-19 23:38:23 +0000
commitfbb30d2c53cbbd71c80d58b30d2ec77f3c14d403 (patch)
treef67aae4192aaa70bad3e0820aace08b79c11b752 /contrib
parent6d44fe8ec23aa8136347f6510606ac2a1eb12d6f (diff)
downloadbugs-fbb30d2c53cbbd71c80d58b30d2ec77f3c14d403.tar
bugs-fbb30d2c53cbbd71c80d58b30d2ec77f3c14d403.tar.gz
bugs-fbb30d2c53cbbd71c80d58b30d2ec77f3c14d403.tar.bz2
bugs-fbb30d2c53cbbd71c80d58b30d2ec77f3c14d403.tar.xz
bugs-fbb30d2c53cbbd71c80d58b30d2ec77f3c14d403.zip
Bug 415278: Make the WebService's plugin discovery method more extendable
Patch by: Colin Ogilvie <colin.ogilvie@gmail.com>; r=mkanat; a=LpSolit
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/bz_webservice_demo.pl27
1 files changed, 26 insertions, 1 deletions
diff --git a/contrib/bz_webservice_demo.pl b/contrib/bz_webservice_demo.pl
index a5e6af9f9..32c8561a0 100755
--- a/contrib/bz_webservice_demo.pl
+++ b/contrib/bz_webservice_demo.pl
@@ -54,6 +54,7 @@ my $legal_field_values;
my $add_comment;
my $private;
my $work_time;
+my $fetch_extension_info = 0;
GetOptions('help|h|?' => \$help,
'uri=s' => \$Bugzilla_uri,
@@ -66,7 +67,8 @@ GetOptions('help|h|?' => \$help,
'field:s' => \$legal_field_values,
'comment:s' => \$add_comment,
'private:i' => \$private,
- 'worktime:f' => \$work_time
+ 'worktime:f' => \$work_time,
+ 'extension_info' => \$fetch_extension_info
) or pod2usage({'-verbose' => 0, '-exitval' => 1});
=head1 OPTIONS
@@ -133,6 +135,10 @@ An optional non-zero value to specify B<--comment> as private.
An optional double precision number specifying the work time for B<--comment>.
+=item --extension_info
+
+If specified on the command line, the script returns the information about the
+extensions that are installed.
=back
@@ -193,6 +199,25 @@ $soapresult = $proxy->call('Bugzilla.timezone');
_die_on_fault($soapresult);
print 'Bugzilla\'s timezone is ' . $soapresult->result()->{timezone} . ".\n";
+=head2 Getting Extension Information
+
+Returns all the information any extensions have decided to provide to the webservice.
+
+=cut
+
+if ($fetch_extension_info) {
+ $soapresult = $proxy->call('Bugzilla.extensions');
+ _die_on_fault($soapresult);
+ my $extensions = $soapresult->result()->{extensions};
+ foreach my $extensionname (keys(%$extensions)) {
+ print "Extensionn '$extensionname' information\n";
+ my $extension = $extensions->{$extensionname};
+ foreach my $data (keys(%$extension)) {
+ print ' ' . $data . ' => ' . $extension->{$data} . "\n";
+ }
+ }
+}
+
=head2 Logging In and Out
=head3 Using Bugzilla's Environment Authentication