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 291826 Details for
Bug 427892
replace XMLRPC function editComponent with Component.update()
[?]
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.
new WebService Module Component.pm with xmlrpc function edit()
Component.pm (text/plain), 4.62 KB, created by
Noura El hawary
on 2008-01-16 07:27:36 UTC
(
hide
)
Description:
new WebService Module Component.pm with xmlrpc function edit()
Filename:
MIME Type:
Creator:
Noura El hawary
Created:
2008-01-16 07:27:36 UTC
Size:
4.62 KB
patch
obsolete
># -*- 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. ># > >package Bugzilla::WebService::Component; > >use strict; >use base qw(Bugzilla::WebService); >use Bugzilla::Product; >use Bugzilla::Component; >use Bugzilla::User; >use Bugzilla::Constants; >import SOAP::Data qw(type); > ># Get Components by list of component ids ># Example of how to call the function: ># $call = $rpc->call( 'Component.get', { ids => [1,2]} ); >sub get { > my ( $self, $params ) = @_; > > # get component objects for components that the user wants > my @components_objs = map new Bugzilla::Component($_), > @{ $params->{ids} }; > > # Now create a result entry for each. > my @components = > map { > { id => type('int')->value( $_->id ), > name => type('string')->value( $_->name ), > description => type('string')->value( $_->description ), > product_id => type('int')->value( $_->product_id ), > product_name => type('string')->value( $_->product->name ), > default_assignee => > type('string')->value( $_->default_assignee->{login_name} ), > default_qa_contact => > type('string')->value( $_->default_qa_contact->{login_name} ), > initial_cc => [ map $_->{login_name}, @{ $_->initial_cc } ], > > } > } @components_objs; > > return { components => \@components }; > >} > ># Get Component by component and product names ># Example of how to call the function: ># $call = $rpc->call( 'Component.get_by_name', {name => 'testComponent22', product => 'TestProduct'}); >sub get_by_name { > my ( $self, $params ) = @_; > > my $product_obj = new Bugzilla::Product( { name => $params->{product} } ); > > # get component objects for components that the user wants > my $component_obj = new Bugzilla::Component( > { name => $params->{name}, product => $product_obj } ); > > # Now create a result entry for each. > my $component = { > id => type('int')->value( $component_obj->id ), > name => type('string')->value( $component_obj->name ), > description => type('string')->value( $component_obj->description ), > product_id => type('int')->value( $component_obj->product_id ), > product_name => > type('string')->value( $component_obj->product->name ), > default_assignee => type('string') > ->value( $component_obj->default_assignee->{login_name} ), > default_qa_contact => type('string') > ->value( $component_obj->default_qa_contact->{login_name} ), > initial_cc => > [ map $_->{login_name}, @{ $component_obj->initial_cc } ], > > }; > > return $component; > >} > >sub edit { > > 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 = $params->{productname}; > my $comp_name = $params->{componentname} || ''; > my $comp_new_name = $params->{newcomponentname} || ''; > my $default_assignee = $params->{initialowner} || ''; > my $default_qa_contact = $params->{initialqacontact} || ''; > my $description = $params->{description} || ''; > my $initial_cc = $params->{initialcc}; > > my $product = $user->check_can_admin_product($product_name); > my $component = Bugzilla::Component->check({ product => $product, name => $comp_name }); > > > $component->set_name($comp_new_name) if $comp_new_name; > $component->set_description($description) if $description; > $component->set_default_assignee($default_assignee) if $default_assignee; > $component->set_default_qa_contact($default_qa_contact) if $default_qa_contact; > $component->set_cc_list($initial_cc) if $initial_cc; > my $changes = $component->update(); > > my %comp_changes; > > $comp_changes{'comp'} = $component->name; > $comp_changes{'product'} = $product->name; > $comp_changes{'changes'} = $changes; > > return \%comp_changes; >} > > >1; > >
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 Raw
Actions:
View
Attachments on
bug 427892
: 291826