view release on metacpan or search on metacpan
ars_DecodeAlertMessage ars_CreateAlertEvent ars_VerifyUser
ars_GetListImage ars_GetImage ars_CreateImage ars_SetImage ars_DeleteImage
ars_GetListEntryWithMultiSchemaFields
ars_GetSessionConfiguration
ars_SetOverlayGroup ars_SwitchToBestPracticeMode ars_SwitchToBaseMode
);
$ARS::VERSION = '2.00';
$ARS::DEBUGGING = 0;
$ARS::logging_file_ptr = 0;
# definitions required for backwards compatibility
if (!defined &ARS::AR_IMPORT_OPT_CREATE) {
eval 'sub AR_IMPORT_OPT_CREATE { 0; }';
}
if (!defined &ARS::AR_IMPORT_OPT_OVERWRITE) {
eval 'sub AR_IMPORT_OPT_OVERWRITE { 1; }';
int i;
HV *h;
if( (items - staticParams) % 2 ){
(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
#ifdef PROFILE
AP_FREE(ctrl); /* invalid, cleanup */
#else
safefree(ctrl);
#endif
goto ar_login_end;
}
h = newHV();
for( i = staticParams; i < items; i+=2 ){
hv_store_ent( h, newSVsv(ST(i)), newSVsv(ST(i+1)), 0 );
}
if( hv_exists(h,"charSet",7) ){
strncpy( ctrl->localeInfo.charSet, SvPV_nolen( *(hv_fetch(h,"charSet",7,0)) ), AR_MAX_LANG_SIZE );
}
if(ARError(ret, status)) {
DBG( ("ARInitialization failed %d\n", ret) );
ARTermination(ctrl, &status);
ARError(ret, status);
#ifdef PROFILE
AP_FREE(ctrl);
#else
safefree(ctrl);
#endif
goto ar_login_end;
}
/*
printf( "ctrl->localeInfo.customDateFormat <%s>\n", ctrl->localeInfo.customDateFormat );
printf( "ctrl->localeInfo.separators <%s>\n", ctrl->localeInfo.separators );
*/
#endif
if (!server || !*server) {
DBG( ("no server given. picking one.\n") );
if (ARError( ret, status)) {
ARTermination(ctrl, &status);
ARError(ret, status);
#ifdef PROFILE
AP_FREE(ctrl); /* invalid, cleanup */
#else
safefree(ctrl);
#endif
DBG( ("ARGetListServer failed %d\n", ret) );
goto ar_login_end;
}
status.numItems = 0;
if (serverList.numItems == 0) {
DBG( ("serverList is empty.\n") );
(void) ARError_add( AR_RETURN_ERROR, AP_ERR_NO_SERVERS);
ARTermination(ctrl, &status);
ARError(ret, status);
#ifdef PROFILE
AP_FREE(ctrl); /* invalid, cleanup */
#else
safefree(ctrl);
#endif
goto ar_login_end;
}
server = serverList.nameList[0];
DBG( ("changing s_ok to 0, picked server %s\n",
SAFEPRT(server)) );
s_ok = 0;
}
strncpy(ctrl->server, server, sizeof(ctrl->server));
ctrl->server[sizeof(ctrl->server)-1] = 0;
/* set the tcp/rpc port if given */
if (ARError(ret, status)) {
DBG( ("ARSetServerPort failed %d\n", ret) );
ARTermination(ctrl, &status);
ARError(ret, status);
#ifdef PROFILE
AP_FREE(ctrl);
#else
safefree(ctrl);
#endif
RETVAL = NULL;
goto ar_login_end;
}
/* finally, check to see if the user id is valid */
ret = ARVerifyUser(ctrl, NULL, NULL, NULL, &status);
if(ARError( ret, status)) {
DBG( ("ARVerifyUser failed %d\n", ret) );
ARTermination(ctrl, &status);
ARError(ret, status);
#ifdef PROFILE
#endif
RETVAL = NULL;
} else {
RETVAL = ctrl; /* valid, return ctrl struct */
}
if(s_ok == 0) {
DBG( ("s_ok == 0, cleaning ServerNameList\n") );
FreeARServerNameList(&serverList, FALSE);
}
ar_login_end:;
DBG( ("finished.\n") );
}
OUTPUT:
RETVAL
HV*
ars_VerifyUser(ctrl)
ARControlStruct * ctrl
CODE:
{
(void) ARError_reset();
Zero(&status, 1, ARStatusList);
(void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED,
"ars_GetListEntryWithMultiSchemaFields() is only available in ARS >= 7.5");
#endif
}
void
ars_SetLogging( ctrl, logTypeMask_arg, ...)
ARControlStruct * ctrl
unsigned long logTypeMask_arg
PPCODE:
{
#if AR_EXPORT_VERSION >= 5
ARStatusList status;
#if AR_CURRENT_API_VERSION >= 14
ARULong32 whereToWriteMask = AR_WRITE_TO_STATUS_LIST;
ARULong32 logTypeMask = logTypeMask_arg;
#else
unsigned long whereToWriteMask = AR_WRITE_TO_STATUS_LIST;
unsigned long logTypeMask = logTypeMask_arg;
#endif
int ret;
FILE *logFilePtr = NULL;
(void) ARError_reset();
Zero(&status, 1, ARStatusList);
logFilePtr = get_logging_file_ptr();
/* printf( "GET logging_file_ptr = %p\n", logFilePtr ); */
if( items > 2 && logTypeMask != 0 ){
char *fileName;
STRLEN len;
fileName = SvPV(ST(2),len);
if( logFilePtr != NULL ){
fclose( logFilePtr );
logFilePtr = NULL;
}
whereToWriteMask = AR_WRITE_TO_FILE;
logFilePtr = fopen( fileName, "a" );
if( logFilePtr == NULL ){
char buf[2048];
sprintf( buf, "Cannot open file: %s", fileName );
(void) ARError_add( AR_RETURN_ERROR, AP_ERR_INV_ARGS, buf);
XPUSHs(sv_2mortal(newSViv(0))); /* ERR */
goto SetLogging_fail;
}
set_logging_file_ptr( logFilePtr );
/* printf( "SET logging_file_ptr = %p\n", logFilePtr ); */
}
ret = ARSetLogging( ctrl, logTypeMask, whereToWriteMask, logFilePtr, &status );
if( logTypeMask == 0 && logFilePtr != NULL ){
fclose( logFilePtr );
set_logging_file_ptr( NULL );
}
if(ARError(ret, status)) {
XPUSHs(sv_2mortal(newSViv(0))); /* ERR */
} else {
XPUSHs(sv_2mortal(newSViv(1))); /* OK */
}
SetLogging_fail:;
#else /* < 4.5 */
XPUSHs(sv_2mortal(newSViv(0))); /* ERR */
ARS/OOsup.pm view on Meta::CPAN
print "new connection object: reusing existing ctrl struct.\n"
if $self->{'.debug'};
if(ref($ctrl) ne "ARControlStructPtr") {
$self->pushMessage(&ARS::AR_RETURN_ERROR,
81000,
"ctrl parameter should be an ARControlStructPtr reference. you passed a ".ref($ctrl)." reference."
);
}
$self->{'ctrl'} = $ctrl;
$self->{'.nologoff'} = 1;
} else {
print "new connection object: ($server, $username, $password)\n"
if $self->{'.debug'};
$self->{'ctrl'} = ars_Login($server, $username, $password, "","", $tcpport);
$self->{'.nologoff'} = 0;
$self->tryCatch();
}
return $blessed;
}
sub DESTROY {
my ($self) = shift;
print "destroying connection object: " if $self->{'.debug'};
if(defined($self->{'.nologoff'}) && $self->{'.nologoff'} == 0) {
print "ars_Logoff called.\n" if $self->{'.debug'};
ars_Logoff($self->{'ctrl'}) if defined($self->{'ctrl'});
} else {
print "ars_Logoff suppressed.\n" if $self->{'.debug'};
}
}
sub ctrl {
my $this = shift;
return $this->{'ctrl'};
compilation problems on Solaris
(TS) added ars_BeginBulkEntryTransaction, ars_EndBulkEntryTransaction
(TS) added AR_FIELD_OFFSET handling in perl_ARFieldValueOrArithStruct (support.c)
(TS) added ars_SetSessionConfiguration
(TS) completed sv_to_ARCurrencyStruct (support.c)
(TS) ARS.pm: set $ARS::logging_file_ptr = 0 to avoid "uninitialized" warning
(TS) changed t/01import.t to import form "ARSperl Test3"
(TS) added ars_CreateContainer, ars_SetContainer
(TS) added ars_CreateFilter, ars_SetFilter, ars_CreateEscalation, ars_SetEscalation,
ars_SetActiveLink
(TS) added declaration of boolcpyHVal(...) to supportrev.h
Released: 09/20/2005 Version: 1.85
(TS) added binmode-statements in t/10entry.t (test failed on win32)
(TS) warning cleanup in test files (t/02export.t, t/13join.t)
(TS) added ars_SetLogging (changes to ARS.xs, ARS.pm, support.c, support-h.template,
html/manual/toc.html; new files: html/manual/ars_SetLogging.html, t/21setlogging.t)
(TS) fixed pointer dereferencing error in supportrev.c:strmakHval
(TS) fixed supportrev.c:strcasecmp, strncasecmp; failure to differentiate between
string and substring (e.g. "page_holder" and "page")
(TS) fixed support.c:perl_ARByteList (Bug ID 1213180)
(David Lindes {lindes at users.sourceforge.net})
(TS) added support for DATA_TYPE_CURRENCY to perl_ARFieldLimitStruct
(BM) Changed many of the allocations to use perl's memory manager,
except where the structure or element is grown further internally
by ARS, or where the structure is non-trivial to free(). I still
have concerns about some of the un-freed allocations in
supportrev.c, but at least ALL of the demo scripts,
including ARSDoc-1.11 (with small patch submitted to list) now
run, and produce the right results.
(BM) Removed all references to ZEROMEM in favor of perl's Zero, which
is guaranteed to work everywhere, and doesn't need additional logic.
(BM) fixed a couple of small typos, including one in a elliptical
declaration (...) which didn't have a comma separator.
(BM) Changed the logic of CVLD in one place that was attempting to free()
null pointers.
Released: 03/31/98 Version: 1.56
(JCM) fixed a problem caused by some debugging code that
was left in 1.55 accidentally.
(JCM) modified GetListEntry(), GetEntry(), SetEntry() and
DeleteEntry() to make operations on join schemas
transparent.
(JCM) added a ARVerifyUser call to ars_Login so that
ars_Login() || die() will work as one would expect it to.
(JCM) added $VERSION to the perl module file.
(JCM) added "log to file" action to GetFilter action hash
(requested by {D.J.Adams at soton.ac.uk})
(JCM) added updated doc tree to main distribution (contributed by
{D.J.Adams at soton.ac.uk})
(JCM) new functions and doc on new functions and new examples for some
of these new functions.
(JCM) ! altered return value of perl_ARStatusStruct so that it
returns a hash of the various StatusStruct members so that
html/WhoUsesIt.html
html/DelUsersFromGroup.html
html/index.html
html/AddUsersToGroup.html
html/copying.html
html/arsperl-logo.gif
html/install.html
html/manual/ds_getvui_hash.html
html/manual/ars_encodeStatusHistory.html
html/manual/ars_GetListCharMenu.html
html/manual/ds_charmenu_file_hash.html
html/manual/OO/index.html
html/manual/OO/form.html
html/manual/OO/connection.html
html/manual/skel.html
html/manual/ars_SetImpersonatedUser.html
html/DumpSetup.html
Makefile
t/33setcontainer.t
t/40createcharmenu.t
t/01import.t
t/20merge.t
t/31createschema.t
t/35setactlink.t
t/aptest.def
t/10getescalation.t
t/21setlogging.t
t/34createactlink.t
t/00connect.t
t/aptest45.def
t/02export.t
t/38createescalation.t
t/32createcontainer.t
t/aptest51.def
t/41setcharmenu.t
t/09qualifier.t
t/37setfilter.t
Makefile.PL view on Meta::CPAN
close $ar_fh;
return $api_version;
}
#
# given an API version from above, return the minimum server version
# that supports it.
# That is, if an API version is supported by multiple releases of the
# AR System Server, we return the chronologically first version
# since compiling against that version will have been the first
# time we have arsperl will have to change to support the API change.
#
# this whole strategy of deriving the server version from the api version
# presumes that we won't have to distinguish between releases of the
# same api version, which may or may not be correct.
#
# the api version can be the main variable arsperl uses to adjust
# itself however.
#
1.3 Notes
---------
We've added some features for performance analysis. In particular,
we've added the "profiling" feature to ARSperl. Now, when you call
ars_Login() it initializes a profiling variable that will track
the number of queries your script makes against the server. You
can then access this information using the ars_GetProfileInfo() call.
We send this information to syslog() automatically at the end of
each script and then process the syslog file later on to keep stats
on our API scripts. In this fashion, we can quickly determine which
scripts are triggered the most, and which make the most queries. We
can then concentrate out optimization efforts on those particular
API scripts.
In addition, a few new functions were added (GetFilter, GetCharMenu and
GetServerStatistics, ars_Export). The first two are used by the WhoUsesIt.pl
utility. This utility (found in the "examples" directory) is handy for
locating which filter or menu is referencing a particular file, or
seeing exactly what filters a particular schema uses.. etc. This
StructDef.pl view on Meta::CPAN
_num => 'p->numItems',
_list => 'p->compoundSchema',
_type => 'ARCompoundSchema',
},
ARCompoundSchema => {
_switch => 'p->schemaType',
_map => [ 'schemaType', {
AR_SCHEMA_REGULAR => 'regular',
AR_SCHEMA_JOIN => 'join',
AR_SCHEMA_VIEW => 'view',
AR_SCHEMA_DIALOG => 'dialog',
AR_SCHEMA_VENDOR => 'vendor',
} ],
_case => {
AR_SCHEMA_REGULAR => {
_nodata => 1,
},
AR_SCHEMA_DIALOG => {
_nodata => 1,
},
AR_SCHEMA_JOIN => {
StructDef.pl view on Meta::CPAN
_num => 'p->numItems',
_list => 'p->actionList',
_type => 'ARFilterActionStruct',
},
ARFilterActionStruct => {
_switch => 'p->action',
_map => {
AR_FILTER_ACTION_NONE => 'none',
AR_FILTER_ACTION_NOTIFY => 'notify',
AR_FILTER_ACTION_MESSAGE => 'message',
AR_FILTER_ACTION_LOG => 'log',
AR_FILTER_ACTION_FIELDS => 'assign_fields',
AR_FILTER_ACTION_PROCESS => 'process',
AR_FILTER_ACTION_FIELDP => 'fieldp',
AR_FILTER_ACTION_SQL => 'sqlCommand',
AR_FILTER_ACTION_GOTOACTION => 'gotoAction',
AR_FILTER_ACTION_CALLGUIDE => 'callGuide',
AR_FILTER_ACTION_EXITGUIDE => 'exitGuide',
AR_FILTER_ACTION_GOTOGUIDELABEL => 'gotoGuide',
},
_case => {
StructDef.pl view on Meta::CPAN
_data => 'p->u.notify',
},
},
AR_FILTER_ACTION_MESSAGE => {
message => {
_type => 'ARFilterStatusStruct',
_data => 'p->u.message',
},
},
AR_FILTER_ACTION_LOG => {
log => {
_type => 'char*',
_data => 'p->u.logFile',
},
},
AR_FILTER_ACTION_FIELDS => {
_min_version => '6.0.0',
assign_fields => {
_type => 'ARSetFieldsActionStruct',
_data => 'p->u.setFields',
},
},
'AR_FILTER_ACTION_FIELDS+' => {
changes.dat view on Meta::CPAN
TS corrected function signature for ars_SetField, ars_CreateContainer
TS bugfix in ars_GetCharMenu (incorrect array length for "labelFields", "labelIndex")
TS added ars_SetImpersonatedUser
TS bugfix in ARError (support.c, memory violation if appendedText == NULL)
TS ars_SetLogging: changed declaration "int len" to "STRLEN len" because of
compilation problems on Solaris
TS added ars_BeginBulkEntryTransaction, ars_EndBulkEntryTransaction
TS added AR_FIELD_OFFSET handling in perl_ARFieldValueOrArithStruct (support.c)
TS added ars_SetSessionConfiguration
TS completed sv_to_ARCurrencyStruct (support.c)
TS ARS.pm: set $ARS::logging_file_ptr = 0 to avoid "uninitialized" warning
TS changed t/01import.t to import form "ARSperl Test3"
TS added ars_CreateContainer, ars_SetContainer
TS added ars_CreateFilter, ars_SetFilter, ars_CreateEscalation, ars_SetEscalation,
ars_SetActiveLink
TS added declaration of boolcpyHVal(...) to supportrev.h
TS added declaration of revTypeName(...) to supportrev.h
TS added "rev_ARReferenceStruct" to supportrev.c
TS changed perl_ARReferenceStruct (added "value_dataType" key, necessary for
ars_CreateContainer)
TS changed ars_CreateActiveLink to read "schemaList" from alDef struct
changes.dat view on Meta::CPAN
TS minor fix in in rev_ARValueStructKW2KN (*keyword == '\0')
TS minor fix in rev_ARCoordList_helper ( if (hv_exists("x"... )
TS changed handling of keyword values in rev_ARValueStruct
(assume "keyword" if first character == '\0' and length > 0)
JCM minor update to example scripts Dump_User*.pl
released=09/20/2005 version=1.85
TS added binmode-statements in t/10entry.t (test failed on win32)
TS warning cleanup in test files (t/02export.t, t/13join.t)
TS added ars_SetLogging (changes to ARS.xs, ARS.pm, support.c, support-h.template,
html/manual/toc.html; new files: html/manual/ars_SetLogging.html, t/21setlogging.t)
TS fixed pointer dereferencing error in supportrev.c:strmakHval
TS fixed supportrev.c:strcasecmp, strncasecmp; failure to differentiate between
string and substring (e.g. "page_holder" and "page")
TS fixed support.c:perl_ARByteList (Bug ID 1213180)
(David Lindes {lindes at users.sourceforge.net})
TS added support for DATA_TYPE_CURRENCY to perl_ARFieldLimitStruct
TS added function perl_ARCurrencyDetailList
TS fixed support.c:my_strtok, perl_BuildEntryList
(ars_GetEntry crashed when retrieving join form entries)
TS added preprocessor directives (ARS.xs, support.c, support-h.template)
changes.dat view on Meta::CPAN
BM removed most of the PPERLC and AWP stuff that was intended
to help the port to ActiveState perl. Use the One True Perl.
BM Changed many of the allocations to use perl's memory manager,
except where the structure or element is grown further internally
by ARS, or where the structure is non-trivial to free(). I still
have concerns about some of the un-freed allocations in
supportrev.c, but at least ALL of the demo scripts,
including ARSDoc-1.11 (with small patch submitted to list) now
run, and produce the right results.
BM Removed all references to ZEROMEM in favor of perl's Zero, which
is guaranteed to work everywhere, and doesn't need additional logic.
BM fixed a couple of small typos, including one in a elliptical
declaration (...) which didn't have a comma separator.
BM Changed the logic of CVLD in one place that was attempting to free()
null pointers.
released=03/31/98 version=1.56
JCM fixed a problem caused by some debugging code that
was left in 1.55 accidentally.
released=03/30/98 version=1.55
JCM added ars_GetListEntry.pl example to show how to use
custom query-list fields.
JCM numerous documentation updates by {D.J.Adams at soton.ac.uk}
changes.dat view on Meta::CPAN
JCM bug fix (Sid Van den Heede) "affecting getting of
displayInstanceList"
JCM bug fix (James LewisMoss) for ars_GetCharMenu()
JCM bug fix (Ian Flanigan) for perl_ARIndexStruct()
JCM modified GetListEntry(), GetEntry(), SetEntry() and
DeleteEntry() to make operations on join schemas
transparent.
JCM added a ARVerifyUser call to ars_Login so that
ars_Login() || die() will work as one would expect it to.
JCM added $VERSION to the perl module file.
JCM added "log to file" action to GetFilter action hash
(requested by {D.J.Adams at soton.ac.uk})
JCM added updated doc tree to main distribution (contributed by
{D.J.Adams at soton.ac.uk})
JCM new functions and doc on new functions and new examples for some
of these new functions.
!JCM altered return value of perl_ARStatusStruct so that it
returns a hash of the various StatusStruct members so that
reversing the operation is simpler. scripts that, for example,
retrieve active link definitions and print them out that previous
expected the {message} key to point to a string will need to
example/AddUsersToGroup.pl view on Meta::CPAN
print "\tnew group list : $newgrouplist\n";
# write the entry back using SetEntry
ars_SetEntry( $ctrl, "User", $userentry[0], 0, $userfields{'Group List'},
$newgrouplist )
|| die "ars_SetEntry(User): $ars_errstr";
}
# and of course log off nicely.
ars_Logoff($ctrl);
exit 0;
example/Dump_Setup.pl view on Meta::CPAN
#
# $Header: /cvsroot/arsperl/ARSperl/example/Dump_Setup.pl,v 1.3 1999/06/14 17:07:39 jcmurphy Exp $
#
# EXAMPLE
# Dump_Setup.pl [username] [password] [path]
#
# DESCRIPTION
# Log onto the server and export all schemas, filters, etc.
#
# NOTES
# This might require special permission for the username you login as
#
# AUTHOR
# joel murphy
#
# 03/14/96
#
# $Log: Dump_Setup.pl,v $
# Revision 1.3 1999/06/14 17:07:39 jcmurphy
# added some login error checking
#
# Revision 1.2 1998/12/11 15:24:38 jcmurphy
# adjustments to GetListSchema for >=3.0 systesm
#
# Revision 1.1 1996/11/21 20:13:50 jcmurphy
# Initial revision
#
#
use ARS;
$rcs = "/usr/local/bin";
$ci = "$rcs/ci";
$perm = 0755;
($ACCOUNT, $PASSWORD, $path) = @ARGV;
chomp($path = `pwd`) if (!$path);
$c = ars_Login("localhost",$ACCOUNT,$PASSWORD);
die "login error: $ars_errstr\n" unless defined($c);
@schema = ars_GetListSchema($c, 0, 1024);
@active = ars_GetListActiveLink($c);
@filter = ars_GetListFilter($c);
@escal = ars_GetListEscalation($c);
@menu = ars_GetListCharMenu($c);
@admin_ext = ars_GetListAdminExtension($c);
# Warning! this might make several names map to the same file
sub name_to_path {
example/Dump_Users.pl view on Meta::CPAN
#
# $Header: /cvsroot/arsperl/ARSperl/example/Dump_Users.pl,v 1.8 2009/03/31 13:34:32 mbeijen Exp $
#
# EXAMPLE
# Dump_Users.pl
#
# DESCRIPTION
# Log onto the server and dump all users in the "User" schema.
#
# NOTES
# This might require special permission for the username you login
# as, depending upon how the ar admininstrator has the User schema
# configured.
#
# AUTHOR
# jeff murphy
#
# 01/12/96
#
# $Log: Dump_Users.pl,v $
# Revision 1.8 2009/03/31 13:34:32 mbeijen
example/Dump_Users.pl view on Meta::CPAN
my ( $server, $username, $password ) = @ARGV;
if ( !defined($password) ) {
print "usage: $0 [server] [username] [password]\n";
exit 1;
}
# Log onto the ars server specified
( my $ctrl = ars_Login( $server, $username, $password ) )
|| die "can't login to the server: $ars_errstr";
# Load the qualifier structure with a dummy qualifier.
( my $qual = ars_LoadQualifier( $ctrl, $SCHEMA, "(1 = 1)" ) )
|| die "error in ars_LoadQualifier: $ars_errstr";
# Retrieve the fieldid's for the "Login name" and "Full name" fields.
# As of ARS4.0, "name" has become "Name", so we'll check for both fields
# and use whatever we find.
my $loginname_fid = ars_GetFieldByName( $ctrl, $SCHEMA, "Login name" );
if ( !defined($loginname_fid) ) {
( $loginname_fid = ars_GetFieldByName( $ctrl, $SCHEMA, "Login Name" ) )
|| die "no such field in this schema: 'Login name'";
}
# Retrieve all of the entry-id's for the schema.
my @entries =
ars_GetListEntry( $ctrl, $SCHEMA, $qual, 0, 0, [], $loginname_fid,
&ARS::AR_SORT_ASCENDING );
die "No entries found in User schema? [$ars_errstr]"
if $#entries == -1;
( my $fullname_fid = ars_GetFieldByName( $ctrl, $SCHEMA, "Full Name" ) )
|| die "no such field in this schema: 'Full Name'";
# Loop over all of the entries (in ascending order)
example/Dump_Users.pl view on Meta::CPAN
for ( my $i = 0 ; $i <= $#entries ; $i += 2 ) {
#foreach $entry_id (sort keys %entries) {
# Retrieve the (fieldid, value) pairs for this entry
my %e_vals = ars_GetEntry( $ctrl, $SCHEMA, $entries[$i] );
# Print out the Login name and Full name for each record
printf( "%-30s %-45s\n", $e_vals{$loginname_fid}, $e_vals{$fullname_fid} );
}
# Log out of the server.
ars_Logoff($ctrl);
example/Dump_Users_OO.pl view on Meta::CPAN
print "Opening \"User\" form ..\n";
my ($u) = $connection->openForm(-form => "User");
$u->setSort($LoginNameField, &ARS::AR_SORT_ASCENDING);
my @entries = $u->query(); # empty query means "get everything"
printf("%-30s %-45s\n", $LoginNameField, "Full name");
foreach my $id (@entries) {
my($fullname, $loginname) = $u->get($id, ['Full Name', $LoginNameField] );
printf("%-30s %-45s\n", $loginname, $fullname);
}
exit 0;
example/GetField.pl view on Meta::CPAN
# jeff murphy
#
# 02/19/97
#
# $Log: GetField.pl,v $
# Revision 1.5 2009/03/31 13:34:32 mbeijen
# Verified and updated examples.
# Removed ars_GetFullTextInfo.pl because ars_GetFullTextInfo is obsolete since ARS > 6.01
#
# Revision 1.4 1998/09/11 14:46:18 jcmurphy
# altered script logic so that it figures out whether it
# should decode a hash or array on the fly.
# fixed typo that was causing arrays not to be printed.
#
# Revision 1.3 1997/11/26 20:05:54 jcmurphy
# nada
#
# Revision 1.2 1997/05/07 15:38:19 jcmurphy
# fixed incorrect hash usage
#
# Revision 1.1 1997/02/19 22:41:16 jcmurphy
example/GetField.pl view on Meta::CPAN
if ( !defined($fieldname) ) {
print "usage: $0 [server] [username] [password] [schema] [fieldname]\n";
exit 1;
}
# Log onto the ars server specified
print "Logging in ..\n";
( my $ctrl = ars_Login( $server, $username, $password ) )
|| die "can't login to the server";
# Fetch all of the fieldnames/ids for the specified schema
print "Fetching field table ..\n";
( my %fids = ars_GetFieldTable( $ctrl, $schema ) )
|| die "GetFieldTable: $ars_errstr";
# See if the specified field exists.
example/GetFilter.pl view on Meta::CPAN
#
# AUTHOR
# Jeff Murphy
# jcmurphy@acsu.buffalo.edu
#
# $Log: GetFilter.pl,v $
# Revision 1.9 2003/04/02 01:43:35 jcmurphy
# mem mgmt cleanup
#
# Revision 1.8 2000/06/01 16:54:03 jcmurphy
# *** empty log message ***
#
# Revision 1.7 1998/10/14 15:06:10 jcmurphy
# added some extra decoding for set fields actions.
#
# Revision 1.6 1998/10/14 13:54:53 jcmurphy
# fixed syntax error
#
# Revision 1.5 1998/09/16 14:38:31 jcmurphy
# updated changeDiary code
#
# Revision 1.4 1998/04/22 17:25:46 jcmurphy
# added example code to show decoding of SQL/SetFields actions.
#
# Revision 1.3 1998/03/12 20:44:57 jcmurphy
# minor changes to allow specification of a server
#
# Revision 1.2 1997/02/20 19:33:15 jcmurphy
# *** empty log message ***
#
# Revision 1.1 1996/11/21 20:13:52 jcmurphy
# Initial revision
#
#
use ARS;
@MessageTypes = ( "Note", "Warn", "Error" );
example/GetServerStatistics.pl view on Meta::CPAN
use strict;
my ($server, $username, $password) = @ARGV;
if(!defined($password)) {
print "Usage: $0 [server] [username] [password]\n";
exit 0;
}
my $c = ars_Login($server, $username, $password);
die "login failed: $ars_errstr" unless defined($c);
my @rev_ServerStats;
foreach my $stype (keys %ARServerStats) {
$rev_ServerStats[$ARServerStats{$stype}] = $stype;
}
print "requesting: START_TIME($ARServerStats{'START_TIME'}) CPU($ARServerStats{'CPU'})\n";
my %stats = ars_GetServerStatistics($c,
$ARServerStats{'START_TIME'},
example/Get_Diary.pl view on Meta::CPAN
exit 1;
}
# Log onto the ars server specified
print "schema=$schema
qualifier=$qualifier
diaryfield=$diaryfield\n";
( my $ctrl = ars_Login( $server, $username, $password ) )
|| die "can't login to the server";
# Load the qualifier structure with a dummy qualifier.
( my $qual = ars_LoadQualifier( $ctrl, $schema, $qualifier ) )
|| die "error in ars_LoadQualifier:\n$ars_errstr";
# Retrieve all of the entry-id's for the qualification.
my %entries = ars_GetListEntry( $ctrl, $schema, $qual, 0, 0 );
example/List_Entries.pl view on Meta::CPAN
my ( $server, $username, $password, $schema ) = @ARGV;
if ( !defined($schema) ) {
print "usage: $0 [server] [username] [password] [schema]\n";
exit 1;
}
# Log onto the ars server specified
( my $ctrl = ars_Login( $server, $username, $password ) )
|| die "can't login to the server";
# Load the qualifier structure with a dummy qualifier.
( my $qual = ars_LoadQualifier( $ctrl, $schema, "(1 = 1)" ) )
|| die "error in ars_LoadQualifier";
# Retrieve all of the entry-id's for the schema.
my %entries = ars_GetListEntry( $ctrl, $schema, $qual, 0, 0 );
example/PrintQual.pl view on Meta::CPAN
($server, $username, $password, $schema, $qual) = @ARGV;
if(!defined($password)) {
print "usage: $0 [server] [username] [password] [schema] [qualification]\n";
exit 1;
}
# Log onto the ars server specified
($ctrl = ars_Login($server, $username, $password)) ||
die "can't login to the server";
# Load the qualifier structure
($q = ars_LoadQualifier($ctrl,$schema, $qual)) ||
die "error in ars_LoadQualifier:\n$ars_errstr\n";
# Decode the encoded structure
($dq = ars_perl_qualifier($ctrl, $q)) ||
die "ars_perl_qualifier failed: $ars_errstr\n";
example/Show_ALink.pl view on Meta::CPAN
# This example file parse most (but not all) of the active links
# fields.
#
# AUTHOR
# jeff murphy
#
# 01/12/96
#
# $Log: Show_ALink.pl,v $
# Revision 1.6 2000/06/01 16:54:03 jcmurphy
# *** empty log message ***
#
# Revision 1.5 1998/09/14 17:41:05 jcmurphy
# added ChangeDiary decoding lines
#
# Revision 1.4 1998/09/11 17:49:47 jcmurphy
# updated EXECUTE_ON definitions
#
# Revision 1.3 1998/09/11 17:22:13 jcmurphy
# changed macroParms from array to hash since it is
# a hashref.
example/Show_ALink.pl view on Meta::CPAN
$act_num++;
}
print "\n";
} else {
print "No actions to process!\n";
}
}
# Log onto the ars server specified
($ctrl = ars_Login($server, $username, $password)) ||
die "can't login to the server";
# Retrieve info about active link.
($a = ars_GetActiveLink($ctrl, $alink_name)) ||
die "can't fetch info about that active link";
print "Active Link Attributes:\n\n";
print "Name: ".$a->{name}."\n";
example/Show_Menu.pl view on Meta::CPAN
($server, $username, $password, $menu_name) = @ARGV;
if(!defined($menu_name)) {
print "usage: $0 [server] [username] [password] [menu name]\n";
exit 1;
}
# Log onto the ars server specified
($ctrl = ars_Login($server, $username, $password)) ||
die "can't login to the server";
# SUBROUTINE
# IndPrint(indentation, string)
#
# DESCRIP
# This subroutine will print a string with [indentation] number
# of preceding TABS.
sub IndPrint {
my $ind = shift;
example/ars_CopyActiveLink.pl view on Meta::CPAN
# changed #!perl path
#
# Revision 1.1 1997/09/04 00:16:00 jcmurphy
# Initial revision
#
#
use ARS;
($c = ars_Login(shift, shift, shift)) ||
die "login: $ars_errstr";
($a = ars_GetActiveLink($c, shift)) ||
die "GetActiveLink: $ars_errstr";
$a->{name} .= "Copy of ";
ars_CreateActiveLink($c, $a) ||
die "$0: ERROR in CreateActiveLink:\n\n$ars_errstr";
example/ars_GetControlStructFields.pl view on Meta::CPAN
# Revision 1.1 1997/10/29 21:56:43 jcmurphy
# Initial revision
#
#
#
#
use ARS;
($c = ars_Login(shift, shift, shift))
|| die "login: $ars_errstr";
($cacheId, $operationTime, $user, $password, $lang,
$server) = ars_GetControlStructFields($c);
print "Control Struct Fields:
cacheId = $cacheId
operationTime = $operationTime
username = $user
password = $password
language = $lang
example/ars_GetListEntry.pl view on Meta::CPAN
#
# AUTHOR
# Jeff Murphy
# jcmurphy@buffalo.edu
#
# $Log: ars_GetListEntry.pl,v $
# Revision 1.3 2009/04/14 12:28:07 mbeijen
# Updated to work with v5 and higher API
#
# Revision 1.2 2000/06/01 13:45:20 jcmurphy
# *** empty log message ***
#
# Revision 1.1 1998/03/25 22:52:51 jcmurphy
# Initial revision
#
#
#
use ARS;
use strict;
die "usage: $0 server username password \n"
unless ( $#ARGV >= 2 );
my ( $server, $user, $password ) = ( shift, shift, shift );
#Logging in to the server
( my $ctrl = ars_Login( $server, $user, $password ) )
|| die "ars_Login: $ars_errstr";
# Define form and fields - these may have different names on your server
my $schema = "User";
my $login_name = "Login Name";
my $lic_type = "License Type";
my $full_name = "Full Name";
( my %fids = ars_GetFieldTable( $ctrl, $schema ) )
|| die "ars_GetFieldTable: $ars_errstr";
( my $qual = ars_LoadQualifier( $ctrl, $schema, "(1 = 1)" ) )
|| die "ars_LoadQualifier: $ars_errstr";
# basic format: allow the server to provide sorting order
example/ars_GetListEntry.pl view on Meta::CPAN
for ( my $i = 0 ; $i < $#entries ; $i += 2 ) {
printf( "%s %s\n", $entries[$i], $entries[ $i + 1 ] );
}
# another format: specify a sorting order.
# sort by license type, ascending.
print "Testing: basic + sorting format.\n";
( my @sorted_entries =
ars_GetListEntry( $ctrl, $schema, $qual, 0, 0, $fids{$login_name}, 1 ) )
|| # sort on Login Name, ascending
die "ars_GetListEntry: $ars_errstr";
for ( my $i = 0 ; $i < $#sorted_entries ; $i += 2 ) {
printf( "%s %s\n", $sorted_entries[$i], $sorted_entries[ $i + 1 ] );
}
# another format: specify a custom query list field-list.
print "Testing: basic + sorting + custom field-list format.\n";
if ( !defined( $fids{$login_name} ) || !defined( $fids{$full_name} ) ) {
print
"Sorry. Either i can't find the field-id for \"$login_name\" or \"$full_name\"\n on your \"$schema\" form. I'm skipping this test.\n";
}
else {
(
my @basic_sorted_entries = ars_GetListEntry(
$ctrl, $schema, $qual, 0, 0,
[
{
columnWidth => 10,
separator => ' ',
fieldId => $fids{$login_name}
}, # first field: login name
{
columnWidth => 15,
separator => ' ',
fieldId => $fids{$full_name}
}, # second field: full name
],
$fids{$full_name},
2
)
) || die "ars_GetListEntry: $ars_errstr";
example/ars_GetListGroup.pl view on Meta::CPAN
# arsystem 7.1 port completed, new functions
#
# Revision 1.1 1997/07/23 18:21:29 jcmurphy
# Initial revision
#
#
#
use ARS;
($c = ars_Login(shift, shift, shift)) || die "login: $ars_errstr";
print "Calling GetListGroup..\n";
(@groups = ars_GetListGroup($c)) || die "ERR: $ars_errstr\n";
print "errstr=$ars_errstr\n";
print "GetListGroup returned the following groups:\n";
$num = scalar(@groups);
example/ars_QualDecode.pl view on Meta::CPAN
# this module is designed to be "required" by another
# perl script (your script). it includes a routine
# and some helpers. the only only you need to
# be concerned with is Decode_QualHash.
#
# AUTHOR
# jeff murphy
#
# $Log: ars_QualDecode.pl,v $
# Revision 1.7 2000/06/01 16:54:03 jcmurphy
# *** empty log message ***
#
# Revision 1.6 1998/04/20 17:13:25 jcmurphy
# patch by jkeener@utsi.com for
# "case where value = undef (NULL)."
# /
#
# Revision 1.5 1998/02/25 19:21:14 jcmurphy
# minor corrections
#
# Revision 1.4 1998/01/07 15:07:00 jcmurphy
# modifications by dave adams to arith printing stuff
#
# Revision 1.3 1997/02/20 20:17:27 jcmurphy
# added more descriptive comments and also handled keywords correctly.
#
# Revision 1.2 1997/02/20 19:35:29 jcmurphy
# *** empty log message ***
#
#
#
# ROUTINE
# Decode_QualHash($ctrl, $schema, $qualhash)
#
# DESCRIPTION
# Takes that hash that is returned by
# ars_perl_qualifier() and converts it
example/ars_decodeStatusHistory.pl view on Meta::CPAN
#
use ARS;
use warnings;
use strict;
die "usage: ars_decodeStatusHistory.pl [server] [username] [password] [form] [entry]\n" unless ($#ARGV == 4);
# Log in to the server
(my $ctrl = ars_Login(shift, shift, shift)) ||
die "login: $ars_errstr";
(my $form, my $entry) = (shift, shift);
# get the information for this entry. ars_GetEntry returns a hash of field ID's and its values.
# in fact, we only are interested in this example in field 15 which contains the Status History.
(my %entry = ars_GetEntry($ctrl, $form, $entry, 15)) ||
die "GetEntry: $ars_errstr (no entry $entry in form $form ?)";
# load the field information for field 7 (Status) so we can determine what the names are for
# the different statuses.
example/ars_decodeStatusHistory.pl view on Meta::CPAN
# we'll print the Status name with it, which we retrieved earlier using ars_GetField.
foreach (@status_values) {
print $enum_vals[$i++].": \n";
if ($_->{USER}) {
print "\tUSER: ".$_->{USER}."\n";
print "\tTIME: ".localtime($_->{TIME})."\n"; # with localtime we convert Epoch to human-readable
} else {
print "\tNo Status History entry\n";
}
}
# log off nicely.
ars_Logoff($ctrl);
exit 0;
html/DumpSetup.html view on Meta::CPAN
<PRE>
EXAMPLE
Dump_Setup.pl [username] [password] [path]
DESCRIPTION
Log onto the server and export all schemas, filters, etc. Check them
into RCS to maintain revision history.
NOTES
This might require special permission for the username you login as
</PRE>
<HR>
<A HREF="mailto:arsperl@arsperl.org">arsperl@arsperl.org</A>
</BODY>
</HTML>
html/changes.html view on Meta::CPAN
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>ars_SetLogging: changed declaration "int len" to "STRLEN len" because of
compilation problems on Solaris </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_BeginBulkEntryTransaction, ars_EndBulkEntryTransaction
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added AR_FIELD_OFFSET handling in perl_ARFieldValueOrArithStruct (support.c)
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_SetSessionConfiguration
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>completed sv_to_ARCurrencyStruct (support.c)
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>ARS.pm: set $ARS::logging_file_ptr = 0 to avoid "uninitialized" warning
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>changed t/01import.t to import form "ARSperl Test3"
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_CreateContainer, ars_SetContainer
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_CreateFilter, ars_SetFilter, ars_CreateEscalation, ars_SetEscalation,
ars_SetActiveLink </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added declaration of boolcpyHVal(...) to supportrev.h
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added declaration of revTypeName(...) to supportrev.h
html/changes.html view on Meta::CPAN
<tr><td colspan='2'>
<table width='100%' border='0'><tr>
<td width='50%'>Released: <B>09/20/2005</B></td>
<td width='50%'>Version: <B>1.85
</B></td>
</tr></table></td>
</tr><tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added binmode-statements in t/10entry.t (test failed on win32)
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>warning cleanup in test files (t/02export.t, t/13join.t)
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added ars_SetLogging (changes to ARS.xs, ARS.pm, support.c, support-h.template,
html/manual/toc.html; new files: html/manual/ars_SetLogging.html, t/21setlogging.t) </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>fixed pointer dereferencing error in supportrev.c:strmakHval
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>fixed supportrev.c:strcasecmp, strncasecmp; failure to differentiate between
string and substring (e.g. "page_holder" and "page") </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>fixed support.c:perl_ARByteList (Bug ID 1213180)
(David Lindes {lindes at users.sourceforge.net}) </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added support for DATA_TYPE_CURRENCY to perl_ARFieldLimitStruct
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(TS)</td><td width='90%'><font color='black'>added function perl_ARCurrencyDetailList
</font></td></tr>
html/changes.html view on Meta::CPAN
<tr><td colspan='2'>
<table width='100%' border='0'><tr>
<td width='50%'>Released: <B>03/31/98</B></td>
<td width='50%'>Version: <B>1.6000 BETA
</B></td>
</tr></table></td>
</tr><tr bgcolor='#eeeeee'><td width='10%'>(BM)</td><td width='90%'><font color='black'>removed most of the PPERLC and AWP stuff that was intended
to help the port to ActiveState perl. Use the One True Perl. </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(BM)</td><td width='90%'><font color='black'>Changed many of the allocations to use perl's memory manager,
except where the structure or element is grown further internally by ARS, or where the structure is non-trivial to free(). I still have concerns about some of the un-freed allocations in supportrev.c, but at least ALL of the demo scripts, includin...
<tr bgcolor='#eeeeee'><td width='10%'>(BM)</td><td width='90%'><font color='black'>Removed all references to ZEROMEM in favor of perl's Zero, which
is guaranteed to work everywhere, and doesn't need additional logic. </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(BM)</td><td width='90%'><font color='black'>fixed a couple of small typos, including one in a elliptical
declaration (...) which didn't have a comma separator. </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(BM)</td><td width='90%'><font color='black'>Changed the logic of CVLD in one place that was attempting to free()
null pointers. </table></td></tr></table>
<P>
<TABLE CELLSPACING='0'
CELLPADDING='2'
WIDTH='100%'
BORDER='0'
BGCOLOR='black'>
html/changes.html view on Meta::CPAN
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>bug fix (James LewisMoss) for ars_GetCharMenu()
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>bug fix (Ian Flanigan) for perl_ARIndexStruct()
</font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>modified GetListEntry(), GetEntry(), SetEntry() and
DeleteEntry() to make operations on join schemas transparent. </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>added a ARVerifyUser call to ars_Login so that
ars_Login() || die() will work as one would expect it to. </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>added $VERSION to the perl module file.
</font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>added "log to file" action to GetFilter action hash
(requested by {D.J.Adams at soton.ac.uk}) </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>added updated doc tree to main distribution (contributed by
{D.J.Adams at soton.ac.uk}) </font></td></tr>
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>new functions and doc on new functions and new examples for some
of these new functions. </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='red'>altered return value of perl_ARStatusStruct so that it
returns a hash of the various StatusStruct members so that reversing the operation is simpler. scripts that, for example, retrieve active link definitions and print them out that previous expected the {message} key to point to a string will need to b...
<tr bgcolor='#dddddd'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>added valueType to the assign structure to assist in
reversing the operation (converting perl to C API assign structure). </font></td></tr>
<tr bgcolor='#eeeeee'><td width='10%'>(JCM)</td><td width='90%'><font color='black'>added displayTag as an optional parameter to ars_LoadQualifier()
html/debug.html view on Meta::CPAN
Enter h or `h h' for help.
main::(GetField.pl:31): ($server, $username, $password, $schema, $fieldname) = @ARGV;
DB<1> n
main::(GetField.pl:32): if(!defined($password)) {
DB<1> n
main::(GetField.pl:39): print "Logging in ..\n";
DB<1> n
Logging in ..
main::(GetField.pl:41): ($ctrl = ars_Login($server, $username, $password)) ||
main::(GetField.pl:42): die "can't login to the server";
DB<1> ^C
Program received signal SIGINT, Interrupt.
0xef638848 in _read ()
(gdb) break XS_ARS_ars_Login
Breakpoint 1 at 0xef4f90a8: file ARS.c, line 1801.
(gdb) c
Continuing.
1
DB<1> c