Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 295905 Details for
Bug 427905
replace XMLRPC function addComponent with Component.create()
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
v1 for function Bugzilla::WebService::Component::create()
patch.diff (text/plain), 7.47 KB, created by
Noura El hawary
on 2008-02-26 13:40:41 UTC
(
hide
)
Description:
v1 for function Bugzilla::WebService::Component::create()
Filename:
MIME Type:
Creator:
Noura El hawary
Created:
2008-02-26 13:40:41 UTC
Size:
7.47 KB
patch
obsolete
>Index: Bugzilla/WebService/Component.pm >=================================================================== >RCS file: Bugzilla/WebService/Component.pm >diff -N Bugzilla/WebService/Component.pm >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Bugzilla/WebService/Component.pm 26 Feb 2008 04:27:59 -0000 >@@ -0,0 +1,183 @@ >+# -*- Mode: perl; indent-tabs-mode: nil -*- >+# >+# The contents of this file are subject to the Mozilla Public >+# License Version 1.1 (the "License"); you may not use this file >+# except in compliance with the License. You may obtain a copy of >+# the License at http://www.mozilla.org/MPL/ >+# >+# Software distributed under the License is distributed on an "AS >+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or >+# implied. See the License for the specific language governing >+# rights and limitations under the License. >+# >+# The Original Code is the Bugzilla Bug Tracking System. >+# >+# Contributor(s): Noura Elhawary <nelhawar@redhat.com> >+# >+ >+package Bugzilla::WebService::Component; >+ >+use strict; >+use base qw(Bugzilla::WebService); >+use Bugzilla::Product; >+use Bugzilla::Component; >+use Bugzilla::User; >+use Bugzilla::Constants; >+use Bugzilla::Error; >+use Bugzilla::Util qw(trim); >+import SOAP::Data qw(type); >+ >+ >+# function to create a component >+# the function can be called like this with the >+# component, product, initialowner and description as required arguments >+# $call = $rpc->call('Component.create', { component=> 'TestingComponent', >+# product => 'TestProduct', description => 'testing component', >+# default_assignee => 'testuser@redhat.com', >+# default_qa_contact => 'admin@redhat.com', >+# default_cc => ['testuserb@redhat.com, 'testuserc@redhat.com'] }); >+# >+sub create { >+ my ($self, $params) = @_; >+ >+ my $user = Bugzilla->login(LOGIN_REQUIRED); >+ >+ $user->in_group('editcomponents') >+ || scalar(@{$user->get_products_by_permission('editcomponents')}) >+ || ThrowUserError("auth_failure", {group => "editcomponents", >+ action => "edit", >+ object => "components"}); >+ >+ my $product_name = trim($params->{product}); >+ my $component_name = trim($params->{component}); >+ my $default_assignee = trim($params->{default_assignee}); >+ my $default_qa_contact = trim($params->{default_qa_contact}); >+ my $description = trim($params->{description}); >+ my $default_cc = $params->{default_cc}; >+ >+ my $product = $user->check_can_admin_product($product_name); >+ >+ my $component = >+ Bugzilla::Component->create({ name => $component_name, >+ product => $product, >+ description => $description, >+ initialowner => $default_assignee, >+ initialqacontact => $default_qa_contact, >+ initial_cc => $default_cc }); >+ >+ >+ return { id => type('int')->value($component->id) }; >+ >+} >+ >+1; >+ >+__END__ >+ >+=head1 NAME >+ >+Bugzilla::WebService::Component - The Component API >+ >+=head1 DESCRIPTION >+ >+This part of the Bugzilla API allows you to list accessible components and >+get information about them. >+ >+=head1 METHODS >+ >+See L<Bugzilla::WebService> for a description of what B<STABLE>, B<UNSTABLE>, >+and B<EXPERIMENTAL> mean, and for more information about error codes. >+ >+=head2 Create Component >+ >+=over >+ >+=item C<create> B<EXPERIMENTAL> >+ >+=over >+ >+=item B<Description> >+ >+Creates new component for an existing product. >+ >+=item B<Params> >+ >+A hash containing the following component fields: >+ >+=over >+ >+=item product >+ >+C<string> B<Required> The name of the product that the component >+will be added to. >+ >+=item component >+ >+C<string> B<Required> The name of the new component. >+ >+=item description >+ >+C<string> B<Required> The description of the new component. >+ >+=item default_assignee >+ >+C<string> B<Required> The initial owner of the new component. >+ >+=item default_qa_contact >+ >+C<string> B<Optional> The initial qa contact for the new component. >+ >+=item default_cc >+ >+C<array> B<Optional> Array of the initial cclist for the new component. >+ >+=back >+ >+=item B<Returns> >+ >+A hash containing one item, C<id>, which is the id of the newly >+created component >+ >+=item B<Errors> >+ >+=over >+ >+=item 304 (Authorization Required) >+Logged-in user not authorized to create components. >+ >+=item 106 (Product Access Denied) >+Logged-in user doesn't have access to the specified product to create >+components for it. >+ >+=item 106 (Product Not Specified) >+Logged-in user didn't specify any product names for the component they want >+to create. >+ >+=item 106 (Product Doesn't Exist) >+The specified product doesn't exist. >+ >+=item 105 (Component Name Is Too Long) >+The name of the component is longer than 64 characters. >+ >+=item 105 (Component Requires Default Assignee) >+User didn't specify a default assignee for the new component. >+ >+=item 105 (Blank Component Description Not Allowed) >+User didn't specify a description for the new component. >+ >+=item 105 (Blank Component Name Not Allowed) >+User didn't specifiy name for the new component. >+ >+=item 105 (Component Already Exists) >+Trying to create a component which has similar name to an existing component. >+ >+=item 504 (Invalid Username) >+Invalid login name was provided for the component's default assignee, >+default qa contact or one of the default cc. >+ >+=back >+ >+=back >+ >+=back >+ >Index: Bugzilla/WebService/Constants.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Constants.pm,v >retrieving revision 1.5 >diff -3 -p -u -r1.5 Constants.pm >--- Bugzilla/WebService/Constants.pm 12 Feb 2008 19:45:14 -0000 1.5 >+++ Bugzilla/WebService/Constants.pm 26 Feb 2008 04:28:04 -0000 >@@ -71,11 +71,17 @@ use constant WS_ERROR_CODE => { > # Component errors > require_component => 105, > component_name_too_long => 105, >+ component_need_initialowner => 105, >+ component_blank_description => 105, >+ component_blank_name => 105, >+ component_already_exists => 105, > # Invalid Product > no_products => 106, > entry_access_denied => 106, > product_access_denied => 106, > product_disabled => 106, >+ product_not_specified => 106, >+ product_doesnt_exist => 106, > # Invalid Summary > require_summary => 107, > # Not authorized to edit the bug >@@ -86,6 +92,7 @@ use constant WS_ERROR_CODE => { > account_disabled => 301, > auth_invalid_email => 302, > extern_id_conflict => -303, >+ auth_failure => 304, > > # User errors are 500-600. > account_exists => 500, >Index: xmlrpc.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/xmlrpc.cgi,v >retrieving revision 1.1.1.1 >diff -3 -p -u -r1.1.1.1 xmlrpc.cgi >--- xmlrpc.cgi 19 Nov 2007 22:11:21 -0000 1.1.1.1 >+++ xmlrpc.cgi 26 Feb 2008 04:28:09 -0000 >@@ -39,6 +39,7 @@ my $response = Bugzilla::WebService::XML > 'Bug' => 'Bugzilla::WebService::Bug', > 'User' => 'Bugzilla::WebService::User', > 'Product' => 'Bugzilla::WebService::Product', >+ 'Component' => 'Bugzilla::WebService::Component', > %hook_dispatch > }) > ->on_action(\&Bugzilla::WebService::handle_login)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 427905
:
295904
| 295905