ARS-Simple
view release on metacpan or search on metacpan
Any use, modification, and distribution of the Standard or Modified
Versions is governed by this Artistic License. By using, modifying or
distributing the Package, you accept this license. Do not use, modify,
or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made
by someone other than you, you are nevertheless required to ensure that
your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service
mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge
patent license to make, have made, use, offer to sell, sell, import and
otherwise transfer the Package with respect to any patent claims
licensable by the Copyright Holder that are necessarily infringed by the
Package. If you institute patent litigation (including a cross-claim or
counterclaim) against any party alleging that the Package constitutes
direct or contributory patent infringement, then this Artistic License
to you shall terminate on the date that such litigation is filed.
html/Simple.html view on Meta::CPAN
<pre><code> reset_limit => 3000, # max returns back to a suitable maximum of 3000</code></pre>
</dd>
<dt id="ars_debug">ars_debug</dt>
<dd>
<p>Turn on, if true (1), the ARSperl debugging output. Not something you would normally use.</p>
</dd>
<dt id="log">log</dt>
<dd>
<p>Pass a object to use to log erros/information to a log file. The log object is expected to have methods <i>exp</i> and <i>msg</i> as per the File::Log object.</p>
</dd>
</dl>
<p>Sample invocation with ALL parameters:</p>
<pre><code> <span class="keyword">use</span> <span class="variable">ARS::Simple</span><span class="operator">;</span>
<span class="keyword">use</span> <span class="variable">File::Log</span><span class="operator">;</span>
<span class="keyword">my</span> <span class="variable">$log</span> <span class="operator">=</span> <span class="variable">File::Log</span><span class="operator">-></span><span class="variable">new</span><span class="operator">();</span>
<span class="keyword">my</span> <span class="variable">$ars</span> <span class="operator">=</span> <span class="variable">ARS::Simple</span><span class="operator">-></span><span class="variable">new</span><span class="operator">(</span><span clas...
<span class="string">server</span> <span class="operator">=></span> <span class="string">'my_server'</span><span class="operator">,</span>
<span class="string">user</span> <span class="operator">=></span> <span class="string">'some_admin'</span><span class="operator">,</span>
<span class="string">password</span> <span class="operator">=></span> <span class="string">'password_for_some_admin'</span><span class="operator">,</span>
<span class="string">log</span> <span class="operator">=></span> <span class="variable">$log</span><span class="operator">,</span>
<span class="string">max_returns</span> <span class="operator">=></span> <span class="number">0</span><span class="operator">,</span> <span class="comment"># allow unlimited returns</span>
<span class="string">reset_limit</span> <span class="operator">=></span> <span class="number">3000</span><span class="operator">,</span> <span class="comment"># reset to a suitable limit after each call using max_returns</span>
<span class="string">ars_debug</span> <span class="operator">=></span> <span class="number">1</span><span class="operator">,</span> <span class="comment"># get a whole lot of debugging information (you real should not need)</span>
<span class="operator">}</span><span class="operator">);</span>
</code></pre>
<h2 id="get_list">get_list</h2>
<p>Method to return an array reference of Entry-Id values for a form. Arguments are passed as an hash reference, with two required parameters, eg:</p>
html/Simple.html view on Meta::CPAN
<p>Copyright 2013 Greg George.</p>
<p>This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:</p>
<p><a href="http://www.perlfoundation.org/artistic_license_2_0">http://www.perlfoundation.org/artistic_license_2_0</a></p>
<p>Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do n...
<p>If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.</p>
<p>This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.</p>
<p>This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are...
<p>Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEME...
</body>
</html>
lib/ARS/Simple.pm view on Meta::CPAN
unless (%entryList)
{
no warnings qw(uninitialized);
if ($ars_errstr)
{
$self->_carp("get_data_by_label() failed.\nError=$ars_errstr\nForm=$form\nQuery=$query\n");
}
else
{
if ($self->{log})
{
$self->{log}->msg(3, "get_data_by_label() no records found.\n");
}
}
return;
}
# Map the FID's to Labels in the hashs
my %fid2label = reverse %$lfid_hr;
foreach my $eID (keys %entryList)
{
foreach my $fid (keys %{$entryList{$eID}})
lib/ARS/Simple.pm view on Meta::CPAN
return $self->{ctl};
}
sub _carp
{
my $self = shift;
my $msg = join('', @_);
carp $msg;
$self->{log}->exp($msg) if ($self->{log});
}
sub _init
{
my ($self, $args) = @_;
# Did we have any of the persistant variables passed
my $k = '5Jv@sI9^bl@D*j5H3@:7g4H[2]d%Ks314aNuGeX;';
if ($args->{user})
{
lib/ARS/Simple.pm view on Meta::CPAN
else
{
croak "No password defined, quitting\n";
}
}
$user = $self->{persistant}{user};
$pword = $self->{persistant}{password};
# Handle the other passed arguments
$self->{server} = $args->{server} if $args->{server};
$self->{log} = $args->{log} if $args->{log};
$self->{max_returns} = $args->{max_returns} if defined $args->{max_returns};
$self->{reset_limit} = $args->{reset_limit} if defined $args->{reset_limit};
if ($args->{ars_debug})
{
$ARS::DEBUGGING = 1;
}
$self->{debug} = $args->{debug} ? 1 : 0;
## Now connect to Remedy
if ($self->{server} && $user && $pword)
{
my $ctl = ars_Login($self->{server}, $user, $pword);
if ($ctl)
{
$self->{ctl} = $ctl;
}
else
{
croak(__PACKAGE__ . " object initialisation failed.\nFailed to log into Remedy server=" . $self->{server} . " as user '$user' with supplied password: $ars_errstr\n");
}
}
else
{
croak(__PACKAGE__ . " object initialisation failed, server, user and password are required\n");
}
}
# GG test - need to find and store the current value of AR_SERVER_INFO_MAX_ENTRIES
lib/ARS/Simple.pm view on Meta::CPAN
Example usage:
reset_limit => 3000, # max returns back to a suitable maximum of 3000
=item ars_debug
Turn on, if true (1), the ARSperl debugging output.
Not something you would normally use.
=item log
Pass a object to use to log erros/information to a log file.
The log object is expected to have methods I<exp> and I<msg>
as per the File::Log object.
=back
Sample invocation with ALL parameters:
use ARS::Simple;
use File::Log;
my $log = File::Log->new();
my $ars = ARS::Simple->new({
server => 'my_server',
user => 'some_admin',
password => 'password_for_some_admin',
log => $log,
max_returns => 0, # allow unlimited returns
reset_limit => 3000, # reset to a suitable limit after each call using max_returns
ars_debug => 1, # get a whole lot of debugging information (you real should not need)
});
=head2 get_list
Method to return an array reference of Entry-Id values for a form.
Arguments are passed as an hash reference, with two required parameters, eg:
lib/ARS/Simple.pm view on Meta::CPAN
Returns true if connected.
=head2 _reset_max_entries
If set, returns the the system wide AR_SERVER_INFO_MAX_ENTRIES back
to a suitable value (eg 3000). This required the 'user' has administrator
access
=head2 _carp
Complain if something went wrong & possible add to the log file
=head2 DESTROY
Log out from ARSystem
=head1 ARSperl Programer's Manual
see http://arsperl.sourceforge.net/manual/toc.html
=head1 Default User/Password
lib/ARS/Simple.pm view on Meta::CPAN
Any use, modification, and distribution of the Standard or Modified
Versions is governed by this Artistic License. By using, modifying or
distributing the Package, you accept this license. Do not use, modify,
or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made
by someone other than you, you are nevertheless required to ensure that
your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service
mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge
patent license to make, have made, use, offer to sell, sell, import and
otherwise transfer the Package with respect to any patent claims
licensable by the Copyright Holder that are necessarily infringed by the
Package. If you institute patent litigation (including a cross-claim or
counterclaim) against any party alleging that the Package constitutes
direct or contributory patent infringement, then this Artistic License
to you shall terminate on the date that such litigation is filed.
( run in 1.194 second using v1.01-cache-2.11-cpan-49f99fa48dc )