ARS-Simple
view release on metacpan or search on metacpan
}
}
if (($configfile && -f $configfile) || -f 'blib/lib/ARS/Simple.cfg') { exit; }
my $user = '';
my $password = '';
my $proxy = '';
unless ($ENV{PERL_MM_USE_DEFAULT} || $ENV{AUTOMATED_TESTING} || !-t STDIN)
{
print "\n================ Set the defaults for module ARS::Simple ================\n";
print "\nSpecify defaults for ARS::Simple? (y/N) ";
$res = <STDIN>;
exit unless $res =~ /^y$/i;
if (! $configfile)
{
print "\n\t... will be saved to .../lib/ARS/Simple.cfg\n";
$configfile = 'blib/lib/ARS/Simple.cfg';
}
else
{
print "\n\t... will be saved to $configfile\n";
}
#exit if -f $configfile;
# Gather the defaults
print "\nDefault user to use for Remedy: ";
$user = <STDIN>;
$user =~ s/^\s+//;
$user =~ s/\s+$//;
print "Password for user '$user': ";
$password = <STDIN>;
$password =~ s/^\s+//;
$password =~ s/\s+$//;
html/Simple.html view on Meta::CPAN
<p>There are a number of optional arguments, they are:</p>
<dl>
<dt id="max_returns">max_returns</dt>
<dd>
<p>Set a limit on how many items may be returned from certain calls. Setting this value to 0 sets unlimited returns. This parameter can also be set on individual calls. <b>Note:</b> This is a system wide configuration change and requires administrato...
<p><b>Note: You should not use a value less than the default system value for this field or you may impact normal operation of your system</b></p>
<p>Example usage:</p>
<pre><code> reset_limit => 0, # unlimited returns</code></pre>
</dd>
<dt id="reset_limit">reset_limit</dt>
<dd>
<p>Once max_returns is used, reset_limit, if set will return the server to nominated max_returns limit (eg 3000), thereby limiting the possible impact on the system of having max_returns set to a high value (eg 0).</p>
html/Simple.html view on Meta::CPAN
</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>
<pre><code> <span class="comment"># Get theEntry-Id's for all records in the 'User' form.</span>
<span class="keyword">my</span> <span class="variable">$eids</span> <span class="operator">=</span> <span class="variable">$ars</span><span class="operator">-></span><span class="variable">get_list</span><span class="operator">(</span><span class...
</code></pre>
<p>The query parameter can be the same format as you would use in the 'User Tool' to query a form, however we recommend the use of field ID's (FID) rather than the default field name as they may change. I prefer to define a hash of the fo...
<pre><code> <span class="keyword">my</span> <span class="variable">%user</span> <span class="operator">=</span> <span class="operator">(</span> <span class="string">UserID</span> <span class="operator">=></span> <span class="number">101</span><spa...
</code></pre>
<p>the a query could be something like</p>
<pre><code> <span class="keyword">my</span> <span class="variable">$query</span> <span class="operator">=</span> <span class="string">qq{ '</span><span class="variable">$user</span><span class="string">{UserID}' LIKE "g%" }</span><span class="operato...
<span class="keyword">my</span> <span class="variable">$eids</span> <span class="operator">=</span> <span class="variable">$ars</span><span class="operator">-></span><span class="variable">get_list</span><span class="operator">(</span><span class...
</code></pre>
lib/ARS/Simple.pm view on Meta::CPAN
=head1 VERSION
Version 0.01
=head2 FEATURES
=over 4
=item *
Provides obfuscated storage for default user and password so they are
not scattered throuhout all your scripts
=item *
Provide a perlish interface to ARSperl which makes your code
more readable
=back
=head1 METHODS
lib/ARS/Simple.pm view on Meta::CPAN
=over 4
=item max_returns
Set a limit on how many items may be returned from certain calls.
Setting this value to 0 sets unlimited returns. This parameter
can also be set on individual calls. B<Note:> This is a system wide
configuration change and requires administrator privilages on user.
B<Note: You should not use a value less than the default system value
for this field or you may impact normal operation of your system>
Example usage:
reset_limit => 0, # unlimited returns
=item reset_limit
Once max_returns is used, reset_limit, if set will return the server
to nominated max_returns limit (eg 3000), thereby limiting the possible
lib/ARS/Simple.pm view on Meta::CPAN
=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:
# Get theEntry-Id's for all records in the 'User' form.
my $eids = $ars->get_list({ form => 'User', query => '1 = 1' });
The query parameter can be the same format as you would use in the 'User Tool'
to query a form, however we recommend the use of field ID's (FID) rather than the
default field name as they may change. I prefer to define a hash of the
forms lables and FID's so that can be used to better document your code, eg
my %user = ( UserID => 101, UserName => 102 );
the a query could be something like
my $query = qq{ '$user{UserID}' LIKE "g%" };
my $eids = $ars->get_list({ form => 'User', query => $query });
=head2 get_data_by_label
lib/ARS/Simple.pm view on Meta::CPAN
=head2 DESTROY
Log out from ARSystem
=head1 ARSperl Programer's Manual
see http://arsperl.sourceforge.net/manual/toc.html
=head1 Default User/Password
The default user and password to use can be configured during install
by the Config.PL script. This creates a configuration file Simple.cfg
which is stored with Simple.pm. Unless specified in the call to the
new method, the use and password from Simple.cfg will be used. This
has the advantage of a single place of change and removes the user and
password from scripts.
Note that the use and password are obfuscated and B<not> encrypted in
the Simple.cfg file.
=head1 TODO
( run in 0.433 second using v1.01-cache-2.11-cpan-0a6323c29d9 )