ASNMTAP

 view release on metacpan or  search on metacpan

applications/custom/sde-supportRequest.pm-orig  view on Meta::CPAN

# ----------------------------------------------------------------------------------------------------------
# © Copyright 2003-2011 Alex Peeters [alex.peeters@citap.be]
# ----------------------------------------------------------------------------------------------------------
# 2011/mm/dd, v3.002.003, module sde-supportRequest.pm for ASNMTAP::Asnmtap::Applications::CGI
# ----------------------------------------------------------------------------------------------------------

use strict;
use warnings;           # Must be used in test mode only. This reduces a little process speed
#use diagnostics;       # Must be used in test mode only. This reduces a lot of process speed

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

BEGIN { if ( $ENV{ASNMTAP_PERL5LIB} ) { eval 'use lib ( "$ENV{ASNMTAP_PERL5LIB}" )'; } }

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

use ASNMTAP::Time qw(&get_datetimeSignal);

use ASNMTAP::Asnmtap::Plugins v3.002.003;
use ASNMTAP::Asnmtap::Plugins qw(:PLUGINS);

use ASNMTAP::Asnmtap::Plugins::SOAP qw(&get_soap_request);

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

use ASNMTAP::Asnmtap::Applications::CGI v3.002.003;
use ASNMTAP::Asnmtap::Applications::CGI qw(:APPLICATIONS :CGI :DBREADONLY :DBTABLES);

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

use SOAP::Lite;

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

sub webserviceSupportRequest {
  my ($catalogID, $uKey, $method, $whereClause, $fieldlist, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID, $debug) = @_;

  # DATABASE  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  my $CARTO_SERVER   = 'crinaeadtbs01';
  my $CARTO_DATABASE = 'carto';
  my $CARTO_TABLE    = 'TestRelationships';

  # SOAP  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  my $tool           = 'ASNMTAP';
  my $cluster        = 'http://itiltest1.smals-mvm.be/ivwse';
  my $namespace      = 'http://itiltest1.smals-mvm.be/ivwse/';

  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  my ($UserID, $customer, $source) = ('MonitoringOffice', "$tool MONITORING", 'Alarm');

  my %soapService_NS = ('http://schemas.xmlsoap.org/wsdl/mime/'        => 'mime',
                        'http://schemas.xmlsoap.org/wsdl/soap/'        => 'soap',
                        'http://schemas.xmlsoap.org/wsdl/soap11/'      => 'soap11',
                        'http://schemas.xmlsoap.org/soap/encoding/'    => 'soapenc',
                        'http://www.w3.org/2001/XMLSchema'             => 's',
                        'http://schemas.xmlsoap.org/wsdl/'             => 'wsdl',
                        'http://schemas.xmlsoap.org/wsdl/http/'        => 'http',

                        'http://microsoft.com/wsdl/mime/textMatching/' => 'tm',
                        'http://infravision.com/ivwse'                 => 's1'
                       );

  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	sub _getEventsData {
    my ($catalogID, $uKey, $hash_valueEventsData, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID, $debug) = @_;

    my $rv  = 1;
    my $dbh = DBI->connect("DBI:mysql:$DATABASE:$SERVERNAMEREADONLY:$SERVERPORTREADONLY", "$SERVERUSERREADONLY", "$SERVERPASSREADONLY") or $rv = error_trap_DBI(*STDOUT, "Cannot connect to the database", $debug, $pagedir, $pageset, $htmlTitle, $subTit...

    if ($dbh and $rv) {
      my $sql = "select SQL_NO_CACHE title, duration, timeslot, endDate, endTime, status, statusMessage, filename from $SERVERTABLEVENTSDISPLAYDT where catalogID = '$catalogID' and uKey = '$uKey' and step <> '0' order by timeslot desc limit 1";
      my $sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $sessionID);



( run in 1.041 second using v1.01-cache-2.11-cpan-39bf76dae61 )