ARS-Simple

 view release on metacpan or  search on metacpan

Config.PL  view on Meta::CPAN


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";
    }

META.json  view on Meta::CPAN

   },
   "name" : "ARS-Simple",
   "no_index" : {
      "directory" : [
         "t",
         "inc"
      ]
   },
   "prereqs" : {
      "build" : {
         "requires" : {
            "Test::More" : "0"
         }
      },
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "ARS" : "1.68",
            "perl" : "5.006"
         }
      }
   },
   "release_status" : "stable",
   "version" : "0.01"
}

META.yml  view on Meta::CPAN

---
abstract: 'A simplified interface to Remedy ARSystem'
author:
  - 'Greg George <gng@cpan.org>'
build_requires:
  Test::More: 0
configure_requires:
  ExtUtils::MakeMaker: 0
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 6.78, CPAN::Meta::Converter version 2.130880'
license: unknown
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: 1.4
name: ARS-Simple
no_index:
  directory:
    - t
    - inc
requires:
  ARS: 1.68
  perl: 5.006
version: 0.01

Makefile.PL  view on Meta::CPAN


If you want to skip the 'make test' step, just hit ENTER
three times. You can configure it later by either re-running
'perl Makefile.PL' or by editting ./t/config.cache

Fair warning: you probably don't want to run 'make test' against a
production Remedy ARS server.

";

    $server = prompt("The Remedy server hostname (or IP Address)", $i);
    if ($server eq '') { $server = $i if ($i ne ''); }

    $user = prompt("Remedy user with admin", $u);
    if($user eq '') { $user = $u if ($u ne ''); }

    $password = prompt("Password", $p);;
    if($password eq '') { $password = $p if ($p ne ''); }

    open (FD, '>', './t/config.cache') || die "open of './t/config.cache' failed: $!";
    print FD "package CCACHE;\n";

README  view on Meta::CPAN


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.

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-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY

examples/generate_fid_hash.pl  view on Meta::CPAN

# [ 'FullName'                 , 8,            'Required', 'AR_DATA_TYPE_CHAR', 254 ],
# [ 'FullTextLicenseType'      , 110,          'Required', 'AR_DATA_TYPE_ENUM', undef ],
# [ 'LicenseType'              , 109,          'Required', 'AR_DATA_TYPE_ENUM', undef ],
# [ 'LoginName'                , 101,          'Required', 'AR_DATA_TYPE_CHAR', 254 ],
# [ 'Status'                   , 7,            'Required', 'AR_DATA_TYPE_ENUM', undef ],
# [ 'ApplicationLicense'       , 122,          'Optional', 'AR_DATA_TYPE_CHAR', 0 ],
# [ 'ApplicationLicenseType'   , 115,          'Optional', 'AR_DATA_TYPE_CHAR', 254 ],
# [ 'AssignedTo'               , 4,            'Optional', 'AR_DATA_TYPE_CHAR', 254 ],
# [ 'ComputedGrpList'          , 119,          'Optional', 'AR_DATA_TYPE_CHAR', 255 ],
# [ 'DefaultNotifyMechanism'   , 108,          'Optional', 'AR_DATA_TYPE_ENUM', undef ],
# [ 'EmailAddress'             , 103,          'Optional', 'AR_DATA_TYPE_CHAR', 255 ],
# [ 'FlashboardsLicenseType'   , 111,          'Optional', 'AR_DATA_TYPE_ENUM', undef ],
# [ 'FromConfig'               , 250000003,    'Optional', 'AR_DATA_TYPE_CHAR', 3 ],
# [ 'GroupList'                , 104,          'Optional', 'AR_DATA_TYPE_CHAR', 255 ],
# [ 'GrouplistIT'              , 536870913,    'Optional', 'AR_DATA_TYPE_CHAR', 200 ],
# [ 'InstanceID'               , 490000000,    'Optional', 'AR_DATA_TYPE_CHAR', 38 ],
# [ 'ModifyAll'                , 536870914,    'Optional', 'AR_DATA_TYPE_ENUM', undef ],
# [ 'ObjectID'                 , 490000100,    'Optional', 'AR_DATA_TYPE_CHAR', 38 ],
# [ 'Password'                 , 102,          'Optional', 'AR_DATA_TYPE_CHAR', 30 ],
# [ 'UniqueIdentifier'         , 179,          'Optional', 'AR_DATA_TYPE_CHAR', 38 ],
# [ 'AssetLicenseUsed'         , 220000002,    '*Unknown*', 'AR_DATA_TYPE_INTEGER', undef ],

examples/get_data_by_label.pl  view on Meta::CPAN

        'FullName'                 => 8,            # Required  type=AR_DATA_TYPE_CHAR 254
        'FullTextLicenseType'      => 110,          # Required  type=AR_DATA_TYPE_ENUM
        'LicenseType'              => 109,          # Required  type=AR_DATA_TYPE_ENUM
        'LoginName'                => 101,          # Required  type=AR_DATA_TYPE_CHAR 254
        'Status'                   => 7,            # Required  type=AR_DATA_TYPE_ENUM
        'ApplicationLicense'       => 122,          # Optional  type=AR_DATA_TYPE_CHAR 0
        'ApplicationLicenseType'   => 115,          # Optional  type=AR_DATA_TYPE_CHAR 254
        'AssignedTo'               => 4,            # Optional  type=AR_DATA_TYPE_CHAR 254
        'ComputedGrpList'          => 119,          # Optional  type=AR_DATA_TYPE_CHAR 255
        'DefaultNotifyMechanism'   => 108,          # Optional  type=AR_DATA_TYPE_ENUM
        'EmailAddress'             => 103,          # Optional  type=AR_DATA_TYPE_CHAR 255
        'FlashboardsLicenseType'   => 111,          # Optional  type=AR_DATA_TYPE_ENUM
        'FromConfig'               => 250000003,    # Optional  type=AR_DATA_TYPE_CHAR 3
        'GroupList'                => 104,          # Optional  type=AR_DATA_TYPE_CHAR 255
        'UniqueIdentifier'         => 179,          # Optional  type=AR_DATA_TYPE_CHAR 38
        'AssetLicenseUsed'         => 220000002,    # *Unknown* type=AR_DATA_TYPE_INTEGER
        'ChangeLicenseUsed'        => 220000003,    # *Unknown* type=AR_DATA_TYPE_INTEGER
        'HelpDeskLicenseUsed'      => 220000004,    # *Unknown* type=AR_DATA_TYPE_INTEGER
        'NumberofLicenseAvailable' => 220000000,    # *Unknown* type=AR_DATA_TYPE_INTEGER
        'SLALicenseUsed'           => 220000001,    # *Unknown* type=AR_DATA_TYPE_INTEGER
        );

html/Simple.html  view on Meta::CPAN

      <li><a href="#get_fields">get_fields</a></li>
      <li><a href="#set_max_entries">set_max_entries</a></li>
    </ul>
  </li>
  <li><a href="#PRIVATE-METHODS">PRIVATE METHODS</a>
    <ul>
      <li><a href="#init">_init</a></li>
      <li><a href="#load_qualifier">_load_qualifier</a></li>
      <li><a href="#DESTROY">DESTROY</a></li>
      <li><a href="#check_initialised">_check_initialised</a></li>
      <li><a href="#reset_max_entries">_reset_max_entries</a></li>
    </ul>
  </li>
  <li><a href="#TODO">TODO</a></li>
  <li><a href="#TOOLS">TOOLS</a></li>
  <li><a href="#AUTHOR">AUTHOR</a></li>
  <li><a href="#BUGS">BUGS</a></li>
  <li><a href="#SUPPORT">SUPPORT</a></li>
  <li><a href="#ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</a></li>
  <li><a href="#LICENSE-AND-COPYRIGHT">LICENSE AND COPYRIGHT</a></li>
</ul>

html/Simple.html  view on Meta::CPAN


<h2 id="new">new</h2>

<p>Constructor for ARS::Simple. There are three required arguments:</p>

<dl>

<dt id="server">server</dt>
<dd>

<p>The name (or possibly IP Address) of the Remedy ARSystem server you wish to connect to.</p>

</dd>
<dt id="user">user</dt>
<dd>

<p>The user you wish to connect as (this is often a user with administrator privilages). Note that while this is a required argument, it may be supplied via the configuration file to avoid lots of scripts with the user (and password) in them (less to...

</dd>
<dt id="password">password</dt>
<dd>

html/Simple.html  view on Meta::CPAN

</dd>
</dl>

<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 =&gt; 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>

<p>Example usage:</p>

<pre><code> reset_limit =&gt; 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>

html/Simple.html  view on Meta::CPAN


<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">-&gt;</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">-&gt;</span><span class="variable">new</span><span class="operator">(</span><span clas...
     <span class="string">server</span>      <span class="operator">=&gt;</span> <span class="string">'my_server'</span><span class="operator">,</span>
     <span class="string">user</span>        <span class="operator">=&gt;</span> <span class="string">'some_admin'</span><span class="operator">,</span>
     <span class="string">password</span>    <span class="operator">=&gt;</span> <span class="string">'password_for_some_admin'</span><span class="operator">,</span>
     <span class="string">log</span>         <span class="operator">=&gt;</span> <span class="variable">$log</span><span class="operator">,</span>
     <span class="string">max_returns</span> <span class="operator">=&gt;</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">=&gt;</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">=&gt;</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>

<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">-&gt;</span><span class="variable">get_list</span><span class="operator">(</span><span class...

html/Simple.html  view on Meta::CPAN

 
 <span class="variable">$data</span> <span class="operator">=</span> <span class="operator">{</span>
     <span class="variable">eID1</span><span class="operator">,</span> <span class="operator">{</span><span class="string">Label1</span> <span class="operator">=&gt;</span> <span class="variable">value1</span><span class="operator">,</span> <span cla...
     <span class="variable">eID2</span><span class="operator">,</span> <span class="operator">{</span><span class="string">Label1</span> <span class="operator">=&gt;</span> <span class="variable">value1</span><span class="operator">,</span> <span cla...
     <span class="operator">...</span>
     <span class="operator">}</span><span class="operator">;</span>
</code></pre>

<h2 id="get_fields">get_fields</h2>

<p>get_fields has a required argument, the form you require the field details for. The returned hash reference is the result of a call to ars_GetFieldTable, the keys are the field names and the values are the field ids (fid).</p>

<h2 id="set_max_entries">set_max_entries</h2>

<p>This requires that the &#39;user&#39; has administrator access. This allows the overriding of the <b>system wide</b> maximum rows returned setting AR_SERVER_INFO_MAX_ENTRIES, setting this to zero (0) will allow unlimited returns.</p>

<p><b>Beware of setting this to a small value, it is system wide and could have a major impact on your system</b></p>

<h1 id="PRIVATE-METHODS">PRIVATE METHODS</h1>

<h2 id="init">_init</h2>

<p>Initialisation for new</p>

<h2 id="load_qualifier">_load_qualifier</h2>

<h2 id="DESTROY">DESTROY</h2>

<p>Log out from ARSystem</p>

<h2 id="check_initialised">_check_initialised</h2>

<p>Check to insure that there is a connection to Remedy ARSystem. Returns true if connected.</p>

<h2 id="reset_max_entries">_reset_max_entries</h2>

<p>If set, returns the the system wide AR_SERVER_INFO_MAX_ENTRIES back to a suitable value (eg 3000). This required the &#39;user&#39; has administrator access</p>

<h1 id="TODO">TODO</h1>

<p>Add in the tools below.</p>

<p>Add in further methods to make life easier and your code more readable</p>

<h1 id="TOOLS">TOOLS</h1>

html/Simple.html  view on Meta::CPAN

<p>The lfid array used by the get_data_by_label() method required that a hash is defined which describes the field lables (names) you want to use mapped to the field ID (FID). The encluded script will construct such a hash for all relavent fields. Yo...

<p>There is a win32 version of this which copies the data to your clipboard, to make your life easier.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Greg George, <code>&lt;gng at cpan.org&gt;</code></p>

<h1 id="BUGS">BUGS</h1>

<p>Please report any bugs or feature requests to <code>bug-ars-simple at rt.cpan.org</code>, or through the web interface at <a href="http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ARS-Simple">http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ARS-Simple...

<h1 id="SUPPORT">SUPPORT</h1>

<p>You can find documentation for this module with the perldoc command.</p>

<pre><code>    perldoc ARS::Simple</code></pre>

<p>You can also look for information at:</p>

<ul>

html/Simple.html  view on Meta::CPAN

<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 &quot;AS IS&#39; 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

sub get_list
{
    my ($self, $args) = @_;  # Expect args keys of 'form', 'query', optionally 'max_returns'

    # Check ARSystem initailised
    return unless $self->_check_initialised();

    # Check required args
    unless ($args->{form} && $args->{query})
    {
        $self->_carp("get_list() requires 'form' and 'query' arguments\n");
        return;
    }


    # Create a qualifier struct
    my $qual = $self->_load_qualifier($args);
    return unless $qual;

    # Set the limit
    $self->set_max_entries($args->{max_returns});

    # Get the entryId
    my @entries = ars_GetListEntry($self->{ctl}, $args->{form}, $qual, 0, 0,
        [{columnWidth => 1, separator => ' ', fieldId => 1 }]  # Minimise the amount of data returned
        );

    # Reset the limit
    $self->_reset_max_entries();


    my @entryIds;
    # Speed hack for large retuns
    $#entryIds = $#entries;
    @entryIds = ();

    for (my $x = 0; $x < $#entries; $x += 2)
    {
        #Assign the entryId's to the array, stripping the query list values
        push @entryIds, $entries[$x];
    }
    my %results = ( numMatches => scalar(@entryIds), eids => \@entryIds );
    return \%results;
}

sub _load_qualifier
{

    my ($self, $args) = @_;

    my $qual = ars_LoadQualifier($self->{ctl}, $args->{form}, $args->{query});
    unless ($qual)
    {

lib/ARS/Simple.pm  view on Meta::CPAN

    my $query   = $args->{query};
    my $lfid_hr = $args->{lfid};
    my @fid     = values %$lfid_hr;

    # Check ARSystem initailised
    return unless $self->_check_initialised();

    # Check required args
    unless ($args->{form} && $args->{query})
    {
        $self->_carp("get_data_by_label() requires 'form' and 'query' arguments\n");
        return;
    }

    #-- Create a qualifier struct
    my $qual = $self->_load_qualifier($args);
    return unless $qual;

    # Set the limit
    $self->set_max_entries($args->{max_returns});

lib/ARS/Simple.pm  view on Meta::CPAN

    if ($ARS::VERSION >= 1.8)
    {
        %entryList = ars_GetListEntryWithFields($self->{ctl}, $form, $qual, 0, 0, \@fid);
    }
    else
    {
        %entryList = ars_GetListEntryWithFields($self->{ctl}, $form, $qual, 0, \@fid);
    }

    # Reset the limit
    $self->_reset_max_entries();

    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
        {

lib/ARS/Simple.pm  view on Meta::CPAN

{
    my ($self, $args) = @_;

    # Set the limit
    $self->set_max_entries($args->{max_returns});

    # Run the SQL through the ARSystem API
    my $m = ars_GetListSQL($self->{ctl}, $self->{sql});

    # Reset the limit
    $self->_reset_max_entries();

    #    $m = {
    #            "numMatches"   => integer,
    #            "rows"         => [ [r1col1, r1col2], [r2col1, r2col2] ... ],
    #         }
    if ($ars_errstr && $ars_errstr ne '')
    {
        $self->_carp('get_SQL() - ars_GetListSQL error, sql=', $self->{sql}, "\nars_errstr=$ars_errstr\n");
    }

lib/ARS/Simple.pm  view on Meta::CPAN

    my ($self, $max) = @_;

    if (defined $max)
    {
        # Just use the value given
    }
    elsif ($self->{max_returns})
    {
        $max = $self->{max_returns};
    }
    elsif (defined $self->{reset_limit})
    {
        $max = 0;  # Set for unlimited returns if we have a reset limit defined
    }

    if (defined $max)
    {
        unless(ars_SetServerInfo($self->{ctl}, &ARS::AR_SERVER_INFO_MAX_ENTRIES, $max))
        {
            $self->_carp("set_max_entries() - Could not set the AR_SERVER_INFO_MAX_ENTRIES to $max:\n$ars_errstr\n");
        }
    }
}

sub _reset_max_entries
{
    my $self = shift;

    if (defined $self->{reset_limit})
    {
        $self->set_max_entries($self->{reset_limit});
    }
}

sub get_fields
{
    my ($self, $form) = @_;

    # Check required args
    unless ($form)
    {
        $self->_carp("get_fields() requires the 'form' as a argument\n");
        return;
    }

    my %fids = ars_GetFieldTable($self->{ctl}, $form);
    $self->_carp("get_fields() error: $ars_errstr\n") unless (%fids);

    return \%fids;
}

sub update_record

lib/ARS/Simple.pm  view on Meta::CPAN

            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)
    {

lib/ARS/Simple.pm  view on Meta::CPAN

        }
    }
    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
    #           so we can set reset_limit if not defined
    #my %s = ars_GetServerInfo($self->{ctl});
    #print  Dumper(\%s);


1; # End of ARS::Simple


__END__

=head1 NAME

lib/ARS/Simple.pm  view on Meta::CPAN

=head1 METHODS

=head2 new

Constructor for ARS::Simple.  There are three required arguments:

=over 4

=item server

The name (or possibly IP Address) of the Remedy ARSystem server you
wish to connect to.

=item user

The user you wish to connect as (this is often a user with administrator
privilages).  Note that while this is a required argument, it may be supplied
via the configuration file to avoid lots of scripts with the user (and password)
in them (less to change, not on display so safer).

=item password

lib/ARS/Simple.pm  view on Meta::CPAN


There are a number of optional arguments, they are:

=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
impact on the system of having max_returns set to a high value (eg 0).

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>

lib/ARS/Simple.pm  view on Meta::CPAN


 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:

 # Get theEntry-Id's for all records in the 'User' form.
 my $eids = $ars->get_list({ form => 'User', query => '1 = 1' });

lib/ARS/Simple.pm  view on Meta::CPAN

 };

=head2 get_ctl

Returns the ARSystem control structure, so you can use it in other
ARSperl calls.

=head2 get_fields

get_fields has a required argument, the form you require the
field details for.  The returned hash reference is the result
of a call to ars_GetFieldTable, the keys are the field names
and the values are the field ids (fid).

=head2 set_max_entries

This requires that the 'user' has administrator access.  This
allows the overriding of the B<system wide> maximum rows returned
setting AR_SERVER_INFO_MAX_ENTRIES, setting this to zero (0) will
allow unlimited returns.

B<Beware of setting this to a small value, it is system wide and
could have a major impact on your system>

=head1 PRIVATE METHODS

=head2 _init

lib/ARS/Simple.pm  view on Meta::CPAN


=head2 _load_qualifier

Convert a query to a qualifier structure

=head2 _check_initialised

Check to insure that there is a connection to Remedy ARSystem.
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

lib/ARS/Simple.pm  view on Meta::CPAN

to your clipboard, to make your life easier.

=head1 AUTHOR

Greg George, C<< <gng at cpan.org> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-ars-simple at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ARS-Simple>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc ARS::Simple

You can also look for information at:

=over 4

lib/ARS/Simple.pm  view on Meta::CPAN


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.

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-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY



( run in 1.845 second using v1.01-cache-2.11-cpan-49f99fa48dc )