Siebel::COM::App::DataControl - Perl extension for access Siebel COM Data Control
use feature 'say'; use Siebel::COM::App::DataControl; use TryCatch; my $input_file = shift; chomp($input_file); open( my $input, '<', $input_file ) or die "Cannot read $input_file: $!\n"; my @lines = <$input>; close($input); my $app = Siebel::COM::App::DataControl->new( { user => 'sadmin', password => 'sadmin', host => 'foobar', enterprise => 'SIEBEL', lang => 'ENU', aom => 'eCommunicationsObjMgr_enu' } ); try { $app->login(); my $bo = $app->get_bus_object('Account'); my $bc = $bo->get_bus_comp('Account'); $bc->activate_field('Location'); $bc->activate_field('Extension Phone Number'); foreach my $loc (@lines) { chomp($loc); $bc->clear_query(); $bc->set_view_mode(); $bc->set_search_spec( 'Location', "='$loc'" ); $bc->query(); if ( $bc->first_record() ) { do { my $val = $bc->get_field_value('Location'); if ( defined($val) ) { $bc->set_field_value( 'Extension Phone Number', '' ); $bc->write_record(); } say 'updated'; } while ( $bc->next_record() ) } else { say 'Could not find the account'; } } } catch { die 'Exception: ' . $app->get_last_error(); }
Siebel::COM::App::DataControl is a subclass of Siebel::COM::App, providing access to the Siebel COM Data Control environment as well as additional functionality.
Usually using Data Control is the preferable way to access Siebel with COM, but Siebel COM Data Server has it's advantages. Please check Siebel::COM::App::DataServer for more details on that.
This class extends Siebel::COM::App superclass, adding more attributees and methods or overriding the inherited ones as necessary.
A string that holds the host part of the connection string of Siebel COM Data Control.
host
The definition of this attribute during object creation is obligatory.
A string that holds the enterprise part of the connection string of Siebel COM Data Control.
enterprise
A string that holds the language code to be used as part of the connection string of Siebel COM Data Control. This parameter is optional.
A string that holds the AOM part of the connection string of Siebel COM Data Control.
AOM
A string that holds the transport part of the connection string of Siebel COM Data Control.
transport
The definition of this attribute during object creation is optional, but defaults to "TCPIP".
A string that holds the encryption part of the connection string of Siebel COM Data Control.
encryption
The definition of this attribute during object creation is optional, but defaults to "none".
A string that holds the compression part of the connection string of Siebel COM Data Control.
compression
A boolean to indicate if the object instance is connected or not to a Siebel Enterprise.
It is not required during object creation and defaults to false (0). For obvious reasons, one should not use it to instantiate a new object.
This attribute is read-only.
A string represeting the class name to be instantied by Win32::OLE. It defaults to "SiebelDataControl.SiebelDataControl.1" and most probably you don't want to change that.
All attributes defaults to have their getters/setters methods as the same name of the attribute, with some exceptions:
ole_class is read-only
connected is read-only. The getter for it is is_connected.
is_connected
Additionally by those defined by the superclass, this class have the following methods:
Additionally by the superclass BUILD, this methods automatically enables exceptions for errors during usage of Data Control.
BUILD
Returns a formatted string of the connection string used by Siebel COM Data Control to connect to a Siebel Enterprise through COM.
Executes the logoff of a Siebel Enterprise. Can be invoked anytime, but it will be invoked by default during object destruction if is_connected method returns true.
None by default.
Siebel::COM::App
Siebel::COM::App::DataServer
Win32::OLE
Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
This software is copyright (c) 2012 of Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org<>
This file is part of Siebel COM project.
Siebel COM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Siebel COM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Siebel COM. If not, see <http://www.gnu.org/licenses/>.
To install Siebel::COM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Siebel::COM
CPAN shell
perl -MCPAN -e shell install Siebel::COM
For more information on module installation, please visit the detailed CPAN module installation guide.