The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Siebel::COM::App::DataControl - Perl extension for access Siebel COM Data Control

SYNOPSIS

  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();

  }

DESCRIPTION

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.

ATTRIBUTES

host

A string that holds the host part of the connection string of Siebel COM Data Control.

The definition of this attribute during object creation is obligatory.

enterprise

A string that holds the enterprise part of the connection string of Siebel COM Data Control.

The definition of this attribute during object creation is obligatory.

lang

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.

aom

A string that holds the AOM part of the connection string of Siebel COM Data Control.

The definition of this attribute during object creation is obligatory.

transport

A string that holds the transport part of the connection string of Siebel COM Data Control.

The definition of this attribute during object creation is optional, but defaults to "TCPIP".

encryption

A string that holds the encryption part of the connection string of Siebel COM Data Control.

The definition of this attribute during object creation is optional, but defaults to "none".

compression

A string that holds the compression part of the connection string of Siebel COM Data Control.

The definition of this attribute during object creation is optional, but defaults to "none".

connected

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.

ole_class

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.

This attribute is read-only.

METHODS

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.

Additionally by those defined by the superclass, this class have the following methods:

BUILD

Additionally by the superclass BUILD, this methods automatically enables exceptions for errors during usage of Data Control.

get_conn_str

Returns a formatted string of the connection string used by Siebel COM Data Control to connect to a Siebel Enterprise through COM.

logoff

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.

EXPORT

None by default.

SEE ALSO

AUTHOR

Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>

COPYRIGHT AND LICENSE

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/>.