view release on metacpan or search on metacpan
MYMETA.json
MYMETA.yml
Makefile
blib/
ARSperl-*/
ARS.c
ARS.o
ARS/_h2ph_pre.ph
ARS/ar-h.pm
ARS/arerrno-h.pm
serverTypeInfoHints.h
support.h
support.o
supportrev.o
supportrev_generated.o
t/config.cache
pm_to_blib
# of ARSperl (or the one that accompanies the source distribution of Perl
# itself) for a full description.
#
# Official Home Page:
# http://www.arsperl.org
#
# Mailing List (must be subscribed to post):
# arsperl@arsperl.org
#
# Routines for grabbing the current error message "stack"
# by simply referring to the $ars_errstr scalar.
package ARS::ERRORSTR;
sub TIESCALAR {
bless {};
}
sub FETCH {
my($s, $i) = (undef, undef);
my(%mTypes) = ( 0 => "OK", 1 => "WARNING", 2 => "ERROR", 3 => "FATAL",
4 => "INTERNAL ERROR",
-1 => "TRACEBACK");
for($i = 0; $i < $ARS::ars_errhash{numItems}; $i++) {
# If debugging is not enabled, don't show traceback messages
if($ARS::DEBUGGING == 1) {
$s .= sprintf("[%s] %s (ARERR \#%d)",
$mTypes{@{$ARS::ars_errhash{messageType}}[$i]},
@{$ARS::ars_errhash{messageText}}[$i],
@{$ARS::ars_errhash{messageNum}}[$i]);
$s .= "\n" if($i < $ARS::ars_errhash{numItems}-1);
} else {
if(@{$ARS::ars_errhash{messageType}}[$i] != -1) {
$s .= sprintf("[%s] %s (ARERR \#%d)",
$mTypes{@{$ARS::ars_errhash{messageType}}[$i]},
@{$ARS::ars_errhash{messageText}}[$i],
@{$ARS::ars_errhash{messageNum}}[$i]);
$s .= "\n" if($i < $ARS::ars_errhash{numItems}-1);
}
}
}
return $s;
}
package ARS;
require 5.005;
use strict "vars";
require Exporter;
require DynaLoader;
require Carp unless $^S;
use AutoLoader 'AUTOLOAD';
use Config;
require 'ARS/ar-h.pm';
require 'ARS/arerrno-h.pm';
require 'ARS/nparm.pm';
@ARS::ISA = qw(Exporter DynaLoader);
@ARS::EXPORT = qw(isa_int isa_float isa_string ars_LoadQualifier ars_Login
ars_Logoff ars_GetListField ars_GetFieldByName ars_GetFieldTable
ars_DeleteEntry ars_GetEntry ars_GetListEntry ars_GetListSchema
ars_GetListServer ars_GetActiveLink ars_GetCharMenuItems ars_GetSchema
ars_ExpandCharMenu
ars_GetField ars_simpleMenu ars_GetListActiveLink ars_SetEntry
ars_perl_qualifier ars_qualifier_ptr ars_Export ars_GetListFilter ars_GetListEscalation
ars_GetListVUI
ars_GetServerInfo ars_SetServerInfo
ars_GetEntryBLOB
ars_CreateActiveLink
ars_GetControlStructFields ars_GetVUI
ars_GetListContainer ars_GetContainer ars_DeleteContainer ars_SetServerPort
ars_SetLogging ars_SetSessionConfiguration ars_SetImpersonatedUser
ars_CreateField ars_SetField ars_CreateSchema ars_SetSchema ars_CreateVUI ars_SetVUI
ars_CreateContainer ars_SetContainer ars_CreateCharMenu ars_SetCharMenu
ars_SetActiveLink ars_CreateFilter ars_CreateEscalation ars_SetEscalation
$ars_errstr %ARServerStats %ars_errhash
ars_decodeStatusHistory ars_APIVersion ars_encodeStatusHistory
ars_BeginBulkEntryTransaction ars_EndBulkEntryTransaction
ars_Signal ars_GetTextForErrorMessage ars_DateToJulianDate
ars_GetListLicense ars_ValidateMultipleLicenses
ars_GetServerCharSet ars_GetClientCharSet
ars_GetAlertCount ars_RegisterForAlerts ars_DeregisterForAlerts ars_GetListAlertUser
ars_DecodeAlertMessage ars_CreateAlertEvent ars_VerifyUser
ars_GetListImage ars_GetImage ars_CreateImage ars_SetImage ars_DeleteImage
ars_GetListEntryWithMultiSchemaFields
ars_GetSessionConfiguration
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; }';
}
bootstrap ARS $ARS::VERSION;
tie $ARS::ars_errstr, ARS::ERRORSTR;
# This HASH is used by the ars_GetServerStatistics call.
# Refer to your ARS API Programmer's Manual or the "ar.h"
# file for an explaination of what each of these stats are.
#
# Usage of this hash would be something like:
#
# %stats = ars_GetServerStatistics($ctrl,
# $ARServerStats{'START_TIME'},
# $ARServerStats{'CPU'});
# ars_padEntryid(control, schema, entry-id)
#
# DESCRIPTION
# this routine will left-pad the entry-id with
# zeros out to the appropriate number of place (15 max)
# depending upon if your prefix your entry-id's with
# anything
#
# RETURNS
# a new scalar on success
# undef on error
sub ars_padEntryid {
my($c) = shift;
my($schema) = shift;
my($entry_id) = shift;
my($field);
# entry id field is field id #1
($field = ars_GetField($c, $schema, 1)) ||
return undef;
# look up field
# if field = text then wrap value in double quotes
# if field = numeric then no quotes
# search thru qual and change field ref to value
#}
# compile new qual
# pass to Expand2
if(ref($q) eq "ARQualifierStructPtr") {
$q = ars_perl_qualifier($c, $q);
die Carp::longmess("ars_perl_qualifier failed: $ARS::ars_errstr")
unless defined($q);
}
if(0) {
while($#_) {
my ($f, $v) = (shift @_, shift @_);
my $fh = ars_GetField($c, $s, $f);
if(($fh->{'dataType'} eq "char") ||
($fh->{'dataType'} eq "diary")) {
$v = "\"$v\"";
}
# if it's specified:
# menuType must be "query"
# qualifier must compile against the form that the menu
# is written for.
sub ars_GetCharMenuItems {
my ($ctrl, $menuName, $qual) = (shift, shift, shift);
if(defined($qual)) {
my $menu = ars_GetCharMenu($ctrl, $menuName);
die "ars_GetCharMenuItems failed: $ARS::ars_errstr"
unless defined($menu);
die "ars_GetCharMenuItems failed: qualifier was specified, but menu is not a 'query' menu"
if($menu->{'menuType'} ne "query");
if(ref($qual) ne "ARQualifierStruct") {
$qual = ars_LoadQualifier($ctrl, $menu->{'menuQuery'}{'schema'}, $qual);
}
return ars_ExpandCharMenu2($ctrl, $menuName, $qual);
}
return ars_ExpandCharMenu2($ctrl, $menuName);
DBG( ("safemalloc ARControlStruct\n") );
ctrl = (ARControlStruct *)safemalloc(sizeof(ARControlStruct));
/* DBG( ("malloc ARControlStruct\n") );
ctrl = (ARControlStruct *)MALLOCNN(sizeof(ARControlStruct)); */
Zero(ctrl, 1, ARControlStruct);
#endif
#ifdef PROFILE
if (gettimeofday(&tv, 0) != -1)
((ars_ctrl *)ctrl)->startTime = tv.tv_sec;
else
perror("gettimeofday");
#endif
ctrl->cacheId = 0;
#if AR_EXPORT_VERSION >= 4
ctrl->sessionId = 0;
#endif
ctrl->operationTime = 0;
strncpy(ctrl->user, username, sizeof(ctrl->user));
ctrl->user[sizeof(ctrl->user)-1] = 0;
strncpy(ctrl->password, password, sizeof(ctrl->password));
ctrl->password[sizeof(ctrl->password)-1] = 0;
while(fieldId != fieldList.fieldValueList[i].fieldId) ++i;
a = i*2+2;
dataType = fieldcache_get_data_type( cacheFields, fieldId );
if (dataType <= AR_DATA_TYPE_MAX_TYPE) {
/* printf( "%s [%d] freshly loaded\n", schema, fieldId ); fflush(stdout); */ /* _DEBUG_ */
if (sv_to_ARValue(ctrl, ST(a+1), dataType, &fieldList.fieldValueList[i].value) < 0) {
goto create_entry_end;
}
}else{
char errTxt[256];
sprintf( errTxt, "Failed to fetch field %d from hash", fieldId );
ARError_add(AR_RETURN_ERROR, AP_ERR_FIELD_TYPE);
ARError_add(AR_RETURN_ERROR, AP_ERR_CONTINUE, errTxt );
goto create_entry_end;
}
}
/* printf( "--------------------\n" ); fflush(stdout); */ /* _DEBUG_ */
ret = ARCreateEntry(ctrl, schema, &fieldList, entryId, &status);
#ifdef PROFILE
((ars_ctrl *)ctrl)->queries++;
#endif
if (! ARError( ret, status)) rv = 1;
ARControlStruct * ctrl
char * schema
char * entry_id
CODE:
{
int ret = 0;
ARStatusList status;
#if AR_EXPORT_VERSION >= 3
AREntryIdList entryList;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(&status, 1, ARStatusList);
if(perl_BuildEntryList(ctrl, &entryList, entry_id) != 0)
goto delete_fail;
ret = ARDeleteEntry(ctrl, schema, &entryList, 0, &status);
if (entryList.entryIdList) AP_FREE(entryList.entryIdList);
#else /* ARS 2 */
RETVAL = 0; /* assume error */
if(!entry_id || !*entry_id) {
ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_EID);
goto delete_fail;
}
ret = ARDeleteEntry(ctrl, schema, entry_id, &status);
#endif
#ifdef PROFILE
((ars_ctrl *)ctrl)->queries++;
#endif
if (ARError(ret, status))
&schemaList, /* new in 4.5 */
#if AR_CURRENT_API_VERSION >= 17
&assignedGroupList,
#endif
&groupList,
&executeMask, &controlField, &focusField,
&enable, query, &actionList, &elseList, &helpText,
×tamp, owner, lastChanged, &changeDiary,
&objPropList, /* new in 4.5 */
#if AR_CURRENT_API_VERSION >= 14
NULL, /* errorActlinkOptions, reserved for future use */
NULL, /* errorActlinkName, reserved for future use */
#endif
&status);
#ifdef PROFILE
((ars_ctrl *)ctrl)->queries++;
#endif
if (!ARError( ret,status)) {
RETVAL = newHV();
sv_2mortal( (SV*) RETVAL );
hv_store(RETVAL, "name", strlen("name") , newSVpv(name, 0), 0);
ARTimestamp timestamp;
ARAccessNameType owner;
ARAccessNameType lastChanged;
ARStatusList status;
SV *ref;
ARQualifierStruct *query;
ARDiaryList diaryList;
ARWorkflowConnectStruct schemaList;
ARPropList objPropList;
#if AR_CURRENT_API_VERSION >= 13
unsigned int errorFilterOptions;
ARNameType errorFilterName;
#endif
AMALLOCNN(query,1,ARQualifierStruct);
(void) ARError_reset();
Zero(&actionList, 1, ARFilterActionList);
Zero(&elseList, 1, ARFilterActionList);
Zero(×tamp, 1, ARTimestamp);
Zero(owner, 1, ARAccessNameType);
Zero(lastChanged, 1, ARAccessNameType);
Zero(&diaryList, 1, ARDiaryList);
Zero(&status, 1,ARStatusList);
Zero(&schemaList, 1, ARWorkflowConnectStruct);
Zero(&objPropList, 1, ARPropList);
#if AR_CURRENT_API_VERSION >= 13
Zero(&errorFilterName, 1,ARNameType);
#endif
ret = ARGetFilter(ctrl, name, &order,
&schemaList,
&opSet, &enable,
query, &actionList, &elseList, &helpText,
×tamp, owner, lastChanged, &changeDiary,
&objPropList,
#if AR_CURRENT_API_VERSION >= 13
&errorFilterOptions,
errorFilterName,
#endif
&status);
#ifdef PROFILE
((ars_ctrl *)ctrl)->queries++;
#endif
if (!ARError( ret,status)) {
RETVAL = newHV();
sv_2mortal( (SV*) RETVAL );
hv_store(RETVAL, "name", strlen("name") , newSVpv(name, 0), 0);
hv_store(RETVAL, "order", strlen("order") , newSViv(order), 0);
ret = ARDecodeDiary(ctrl, changeDiary, &diaryList, &status);
if (!ARError(ret, status)) {
hv_store(RETVAL, "changeDiary", strlen("changeDiary") ,
perl_ARList(ctrl, (ARList *)&diaryList,
(ARS_fn)perl_diary,
sizeof(ARDiaryStruct)), 0);
FreeARDiaryList(&diaryList, FALSE);
}
}
#if AR_CURRENT_API_VERSION >= 13
hv_store(RETVAL, "errorFilterOptions", strlen("errorFilterOptions") , newSViv(errorFilterOptions), 0);
hv_store(RETVAL, "errorFilterName", strlen("errorFilterName") , newSVpv(errorFilterName, 0), 0);
#endif
FreeARFilterActionList(&actionList,FALSE);
FreeARFilterActionList(&elseList,FALSE);
FreeARWorkflowConnectStruct(&schemaList, FALSE);
FreeARPropList(&objPropList, FALSE);
if(helpText) {
AP_FREE(helpText);
}
if(changeDiary) {
AP_FREE(changeDiary);
hv_store(RETVAL, "changeDiary", strlen("changeDiary") ,
perl_ARList(ctrl, (ARList *)&diaryList,
(ARS_fn)perl_diary,
sizeof(ARDiaryStruct)), 0);
FreeARDiaryList(&diaryList, FALSE);
}
}
FreeARFieldLimitStruct(&limit,FALSE);
FreeARDisplayInstanceList(&displayList,FALSE);
if(helpText) {
/* AP_FREE(helpText); */ /* TS 20060207 disabled bc of memory errors with 5.8.8 */
}
if(changeDiary) {
AP_FREE(changeDiary);
}
}else{
XSRETURN_UNDEF;
}
}
OUTPUT:
RETVAL
unsigned int dataType = 0, j = 0;
unsigned int option = AR_JOIN_SETOPTION_NONE;
AREntryIdList entryList;
HV *cacheFields;
(void) ARError_reset();
Zero(&status, 1,ARStatusList);
Zero(&fieldList, 1, ARFieldValueList);
Zero(&getFieldIds, 1, ARInternalIdList);
Zero(&entryList, 1,AREntryIdList);
RETVAL = 0; /* assume error */
if ((items - 4) % 2) {
option = SvIV(ST(offset));
offset ++;
}
if (c < 1) {
(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
goto set_entry_exit;
}
cacheFields = fieldcache_get_schema_fields( ctrl, schema, FALSE );
while(fieldId != fieldList.fieldValueList[i].fieldId) ++i;
a = i*2+offset;
dataType = fieldcache_get_data_type( cacheFields, fieldId );
if (dataType <= AR_DATA_TYPE_MAX_TYPE) {
/* printf( "%s [%d] freshly loaded\n", schema, fieldId ); fflush(stdout); */ /* _DEBUG_ */
if (sv_to_ARValue(ctrl, ST(a+1), dataType, &fieldList.fieldValueList[i].value) < 0) {
goto set_entry_end;
}
}else{
char errTxt[256];
sprintf( errTxt, "Failed to fetch field %d from hash", fieldId );
ARError_add(AR_RETURN_ERROR, AP_ERR_FIELD_TYPE);
ARError_add(AR_RETURN_ERROR, AP_ERR_CONTINUE, errTxt );
goto set_entry_end;
}
}
/* printf( "--------------------\n" ); fflush(stdout); */ /* _DEBUG_ */
/* build entryList */
if(perl_BuildEntryList(ctrl, &entryList, entry_id) != 0){
goto set_entry_end;
}
ars_DeleteMultipleFields(ctrl, schema, deleteOption, ...)
ARControlStruct * ctrl
char * schema
unsigned int deleteOption
CODE:
{
int i = 0, ret = 0, c = (items - 3);
ARStatusList status;
ARInternalIdList fieldList;
RETVAL = 0; /* assume error */
Zero(&status, 1,ARStatusList);
Zero(&fieldList, 1, ARInternalIdList);
(void) ARError_reset();
#if AR_EXPORT_VERSION >= 3
if(items < 4)
(void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_ARGS);
else {
/* slurp in each fieldId and put it in a list */
fieldList.numItems = c;
fieldList.internalIdList = MALLOCNN(sizeof(ARInternalId) * c);
unsigned int ui = 0, count = 0;
unsigned int rlist[AR_MAX_SERVER_INFO_USED];
(void) ARError_reset();
Zero(&status, 1,ARStatusList);
Zero(&requestList, 1, ARServerInfoRequestList);
Zero(&serverInfo, 1, ARServerInfoList);
count = 0;
if(items == 1) { /* none specified.. fetch all */
for(i = 0; i < AR_MAX_SERVER_INFO_USED ; i++) {
/* we'll exclude ones that can't be retrieved to avoid errors */
switch(i+1) {
case AR_SERVER_INFO_DB_PASSWORD:
#if AR_CURRENT_API_VERSION < 17
case 332:
case 331:
case 330:
case 329:
case 328:
case 327:
case 326:
ARCharMenuStruct arMenuDef;
char *helpText = NULL;
ARAccessNameType owner;
char *changeDiary = NULL;
ARPropList objPropList;
char *objectModificationLogLabel = NULL;
ARStatusList status;
HV *menuDef = NULL;
SV **pSvTemp;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(&arMenuDef, 1,ARCharMenuStruct);
Zero(owner, 1,ARAccessNameType);
Zero(&objPropList, 1,ARPropList);
Zero(&status, 1,ARStatusList);
if( SvROK(menuDefRef) && SvTYPE(SvRV(menuDefRef)) == SVt_PVHV ){
menuDef = (HV*) SvRV(menuDefRef);
}else{
croak("usage: ars_CreateCharMenu(...)");
ARCharMenuStruct *arMenuDef = NULL;
char *helpText = NULL;
ARAccessNameType owner;
char *changeDiary = NULL;
ARPropList *objPropList = NULL;
char *objectModificationLogLabel = NULL;
ARStatusList status;
HV *menuDef = NULL;
SV **pSvTemp;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(owner, 1,ARAccessNameType);
Zero(&status, 1,ARStatusList);
if( SvROK(menuDefRef) && SvTYPE(SvRV(menuDefRef)) == SVt_PVHV ){
menuDef = (HV*) SvRV(menuDefRef);
}else{
croak("usage: ars_SetCharMenu(...)");
}
ARDisplayInstanceList dInstanceList;
char *helpText = NULL;
ARAccessNameType owner;
char *changeDiary = NULL;
ARPropList *objPropList = NULL;
ARStatusList status;
HV *fieldDef = NULL;
SV **pSvTemp;
char strTemp[STR_TEMP_SIZE+1];
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(owner, 1,ARAccessNameType);
Zero(fieldName, 1,ARNameType);
Zero(&status, 1,ARStatusList);
Zero(&fieldMap, 1,ARFieldMappingStruct);
Zero(&permissions, 1,ARPermissionList);
Zero(&dInstanceList, 1, ARDisplayInstanceList);
if( SvROK(fieldDefRef) && SvTYPE(SvRV(fieldDefRef)) == SVt_PVHV ){
fieldDef = (HV*) SvRV(fieldDefRef);
#if AR_EXPORT_VERSION >= 9L
unsigned int setFieldOptions = 0;
#endif
char *changeDiary = NULL;
ARPropList *objPropList = NULL;
ARStatusList status;
HV *fieldDef = NULL;
SV **pSvTemp;
char strTemp[STR_TEMP_SIZE+1];
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(fieldName, 1,ARNameType);
Zero(owner, 1,ARAccessNameType);
Zero(&status, 1,ARStatusList);
if( SvROK(fieldDefRef) && SvTYPE(SvRV(fieldDefRef)) == SVt_PVHV ){
fieldDef = (HV*) SvRV(fieldDefRef);
}else{
croak("usage: ars_SetField(...)");
}
char *helpText = NULL;
ARAccessNameType owner;
char *changeDiary = NULL;
ARPropList *objPropList = NULL;
char *objectModificationLogLabel = NULL;
ARStatusList status;
HV *schemaDef = NULL;
SV **pSvTemp;
/* char strTemp[STR_TEMP_SIZE+1]; */
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(name, 1,ARNameType);
Zero(&compoundSchema, 1,ARCompoundSchema);
Zero(&groupList, 1,ARPermissionList);
Zero(&admingrpList, 1,ARInternalIdList);
Zero(&getListFields, 1,AREntryListFieldList);
Zero(&sortList, 1,ARSortList);
Zero(&indexList, 1,ARIndexList);
Zero(defaultVui, 1,ARNameType);
Zero(owner, 1,ARAccessNameType);
ARAccessNameType owner;
char *ownerPtr = NULL;
char *changeDiary = NULL;
ARPropList *objPropList = NULL;
char *objectModificationLogLabel = NULL;
ARStatusList status;
HV *schemaDef = NULL;
SV **pSvTemp;
/* char strTemp[STR_TEMP_SIZE+1]; */
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(newName, 1,ARNameType);
Zero(defaultVui, 1,ARNameType);
Zero(owner, 1,ARAccessNameType);
Zero(&status, 1,ARStatusList);
if( SvROK(schemaDefRef) && SvTYPE(SvRV(schemaDefRef)) == SVt_PVHV ){
schemaDef = (HV*) SvRV(schemaDefRef);
}else{
croak("usage: ars_SetSchema(...)");
unsigned int vuiType;
ARPropList dPropList;
char *helpText = NULL;
ARAccessNameType owner;
char *changeDiary = NULL;
ARPropList objPropList;
ARStatusList status;
HV *vuiDef = NULL;
SV **pSvTemp;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(vuiName, 1,ARNameType);
Zero(locale, 1,ARLocaleType);
Zero(&dPropList, 1,ARPropList);
Zero(&objPropList, 1,ARPropList);
Zero(owner, 1,ARAccessNameType);
Zero(&status, 1,ARStatusList);
if( SvROK(vuiDefRef) && SvTYPE(SvRV(vuiDefRef)) == SVt_PVHV ){
vuiDef = (HV*) SvRV(vuiDefRef);
ARPropList *dPropList = NULL;
char *helpText = NULL;
ARAccessNameType owner;
char *ownerPtr = NULL;
char *changeDiary = NULL;
ARPropList *objPropList = NULL;
ARStatusList status;
HV *vuiDef = NULL;
SV **pSvTemp;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(vuiName, 1,ARNameType);
Zero(locale, 1,ARLocaleType);
Zero(owner, 1,ARAccessNameType);
Zero(&status, 1,ARStatusList);
if( SvROK(vuiDefRef) && SvTYPE(SvRV(vuiDefRef)) == SVt_PVHV ){
vuiDef = (HV*) SvRV(vuiDefRef);
}else{
char *helpText = NULL;
ARAccessNameType owner;
char *changeDiary = NULL;
ARPropList objPropList;
char *objectModificationLogLabel = NULL;
ARStatusList status;
HV *containerDef = NULL;
SV **pSvTemp;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(name, 1,ARNameType);
Zero(&groupList, 1,ARPermissionList);
Zero(&admingrpList, 1,ARInternalIdList);
Zero(&ownerObjList, 1,ARContainerOwnerObjList);
Zero(&references, 1,ARReferenceList);
Zero(owner, 1,ARAccessNameType);
Zero(&objPropList, 1,ARPropList);
Zero(&status, 1,ARStatusList);
char *helpText = NULL;
ARAccessNameType owner;
char *changeDiary = NULL;
ARPropList *objPropList = NULL;
char *objectModificationLogLabel = NULL;
ARStatusList status;
HV *containerDef = NULL;
SV **pSvTemp;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(newName, 1,ARNameType);
Zero(owner, 1,ARAccessNameType);
Zero(&status, 1,ARStatusList);
if( SvROK(containerDefRef) && SvTYPE(SvRV(containerDefRef)) == SVt_PVHV ){
containerDef = (HV*) SvRV(containerDefRef);
}else{
croak("usage: ars_SetContainer(...)");
}
ARAccessNameType owner;
char *changeDiary = CPNULL;
char *objectModificationLogLabel = NULL;
ARStatusList status;
#if AR_EXPORT_VERSION >= 5
ARNameList schemaNameList;
ARWorkflowConnectStruct schemaList;
ARPropList objPropList;
#endif
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(&status, 1,ARStatusList);
Zero(schema, 1, ARNameType);
Zero(name, 1, ARNameType);
Zero(&groupList, 1,ARInternalIdList);
Zero(&actionList, 1,ARActiveLinkActionList);
Zero(owner, 1, ARAccessNameType);
#if AR_EXPORT_VERSION >= 3
Zero(&elseList, 1,ARActiveLinkActionList);
#else
if(rv == 0) {
#if AR_EXPORT_VERSION >= 5
ret = ARCreateActiveLink(ctrl, name, order, &schemaList,
&groupList, executeMask,
&controlField, &focusField,
enable, query,
&actionList, &elseList,
helpText, owner, changeDiary,
&objPropList,
#if AR_CURRENT_API_VERSION >= 14
0, /* errorActlinkOptions, reserved for future use */
NULL, /* errorActlinkName, reserved for future use */
#endif
#if AR_CURRENT_API_VERSION >= 17
objectModificationLogLabel,
#endif
&status);
#elif AR_EXPORT_VERSION >= 3
ret = ARCreateActiveLink(ctrl, name, order, schema,
&groupList, executeMask,
&controlField, &focusField,
enable, query,
ARActiveLinkActionList *elseList = NULL;
char *helpText = CPNULL;
ARAccessNameType owner;
char *ownerPtr = NULL;
char *changeDiary = CPNULL;
char *objectModificationLogLabel = NULL;
ARStatusList status;
ARWorkflowConnectStruct *schemaList = NULL;
ARPropList *objPropList = NULL;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(&status, 1,ARStatusList);
Zero(newName, 1, ARNameType);
Zero(owner, 1, ARAccessNameType);
if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
} else {
HV *objDef = (HV *)SvRV(objDefRef);
SV **qhv = hv_fetch(objDef, "query", strlen("query") , 0);
*/
if(rv == 0) {
ret = ARSetActiveLink(ctrl, name, newNamePtr, order, schemaList,
groupList, executeMask,
controlField, focusField,
enable, query,
actionList, elseList,
helpText, ownerPtr, changeDiary,
objPropList,
#if AR_CURRENT_API_VERSION >= 14
NULL, /* errorActlinkOptions, reserved for future use */
NULL, /* errorActlinkName, reserved for future use */
#endif
#if AR_CURRENT_API_VERSION >= 17
objectModificationLogLabel,
#endif
&status);
if(!ARError( ret, status))
RETVAL = 1;
} else
ARError_add( AR_RETURN_ERROR, AP_ERR_PREREVFAIL);
}
ARFilterActionList elseList;
char *helpText = CPNULL;
ARAccessNameType owner;
char *changeDiary = CPNULL;
char *objectModificationLogLabel = NULL;
ARStatusList status;
ARNameList schemaNameList;
ARWorkflowConnectStruct schemaList;
ARPropList objPropList;
#if AR_CURRENT_API_VERSION >= 13
unsigned int errorFilterOptions = 0;
ARNameType errorFilterName;
#endif
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(&status, 1,ARStatusList);
Zero(schema, 1, ARNameType);
Zero(name, 1, ARNameType);
Zero(&actionList, 1,ARFilterActionList);
Zero(&elseList, 1,ARFilterActionList);
Zero(owner, 1, ARAccessNameType);
Zero(&objPropList, 1, ARPropList);
Zero(&schemaList, 1, ARWorkflowConnectStruct);
Zero(&schemaNameList, 1, ARNameList);
#if AR_CURRENT_API_VERSION >= 13
Zero(errorFilterName, 1, ARNameType);
#endif
schemaList.type = AR_WORKFLOW_CONN_SCHEMA_LIST;
schemaList.u.schemaList = &schemaNameList;
if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
} else {
HV *objDef = (HV *)SvRV(objDefRef);
SV **qhv = hv_fetch(objDef, "query", strlen("query") , 0);
rv += rev_ARFilterActionList(ctrl, objDef, "actionList",
&actionList);
rv += rev_ARFilterActionList(ctrl, objDef, "elseList",
&elseList);
if(hv_exists(objDef, "objPropList", strlen("objPropList") ))
rv += rev_ARPropList(ctrl, objDef, "objPropList",
&objPropList);
#if AR_CURRENT_API_VERSION >= 13
if( hv_exists(objDef, "errorFilterOptions", strlen("errorFilterOptions")) )
rv += uintcpyHVal( objDef, "errorFilterOptions", &errorFilterOptions );
if( hv_exists(objDef, "errorFilterName", strlen("errorFilterName")) )
rv += strcpyHVal( objDef, "errorFilterName", errorFilterName, AR_MAX_NAME_SIZE );
#endif
/* at this point all datastructures (hopefully) are
* built. we can call the api routine to create the
* filter.
*/
if(rv == 0) {
ret = ARCreateFilter(ctrl, name, order, &schemaList,
opSet,
enable, query,
&actionList, &elseList,
helpText, owner, changeDiary,
&objPropList,
#if AR_CURRENT_API_VERSION >= 13
errorFilterOptions,
errorFilterName,
#endif
#if AR_CURRENT_API_VERSION >= 17
objectModificationLogLabel,
#endif
&status);
if(!ARError( ret, status))
RETVAL = 1;
} else
ARError_add( AR_RETURN_ERROR, AP_ERR_PREREVFAIL);
}
ARFilterActionList *elseList = NULL;
char *helpText = CPNULL;
ARAccessNameType owner;
char *ownerPtr = NULL;
char *changeDiary = CPNULL;
char *objectModificationLogLabel = NULL;
ARStatusList status;
ARWorkflowConnectStruct *schemaList = NULL;
ARPropList *objPropList = NULL;
#if AR_CURRENT_API_VERSION >= 13
unsigned int *errorFilterOptions = NULL;
ARNameType errorFilterName;
char *errorFilterNamePtr = NULL;
#endif
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(&status, 1,ARStatusList);
Zero(newName, 1, ARNameType);
Zero(owner, 1, ARAccessNameType);
#if AR_CURRENT_API_VERSION >= 13
Zero(errorFilterName, 1, ARNameType);
#endif
if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
} else {
HV *objDef = (HV *)SvRV(objDefRef);
SV **qhv = hv_fetch(objDef, "query", strlen("query") , 0);
/* dereference the qual pointer */
if(hv_exists(objDef, "elseList", strlen("elseList") )){
elseList = (ARFilterActionList*) MALLOCNN(sizeof(ARFilterActionList));
rv += rev_ARFilterActionList(ctrl, objDef, "elseList", elseList);
}
if(hv_exists(objDef, "objPropList", strlen("objPropList") )){
objPropList = (ARPropList*) MALLOCNN(sizeof(ARPropList));
rv += rev_ARPropList(ctrl, objDef, "objPropList", objPropList);
}
#if AR_CURRENT_API_VERSION >= 13
if( hv_exists(objDef,"errorFilterOptions",18) ){
errorFilterOptions = (unsigned int*) MALLOCNN(sizeof(unsigned int));
rv += uintcpyHVal( objDef, "errorFilterOptions", errorFilterOptions);
}
if(hv_exists(objDef, "errorFilterName", strlen("errorFilterName") )){
rv += strcpyHVal( objDef, "errorFilterName", errorFilterName, AR_MAX_NAME_SIZE);
errorFilterNamePtr = errorFilterName;
}
#endif
/* at this point all datastructures (hopefully) are
* built. we can call the api routine to modify the workflow object
*/
if(rv == 0) {
ret = ARSetFilter(ctrl, name, newNamePtr, order, schemaList,
opSet,
enable, query,
actionList, elseList,
helpText, ownerPtr, changeDiary,
objPropList,
#if AR_CURRENT_API_VERSION >= 13
errorFilterOptions,
errorFilterNamePtr,
#endif
#if AR_CURRENT_API_VERSION >= 17
objectModificationLogLabel,
#endif
&status);
if(!ARError( ret, status))
RETVAL = 1;
} else
ARError_add( AR_RETURN_ERROR, AP_ERR_PREREVFAIL);
}
ARFilterActionList elseList;
char *helpText = CPNULL;
ARAccessNameType owner;
char *changeDiary = CPNULL;
char *objectModificationLogLabel = NULL;
ARStatusList status;
ARNameList schemaNameList;
ARWorkflowConnectStruct schemaList;
ARPropList objPropList;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(&status, 1,ARStatusList);
Zero(name, 1, ARNameType);
Zero(&actionList, 1,ARFilterActionList);
Zero(&elseList, 1,ARFilterActionList);
Zero(owner, 1, ARAccessNameType);
Zero(&objPropList, 1, ARPropList);
Zero(&schemaList, 1, ARWorkflowConnectStruct);
Zero(&schemaNameList, 1, ARNameList);
Zero(&escalationTm, 1, AREscalationTmStruct);
ARFilterActionList *elseList = NULL;
char *helpText = CPNULL;
ARAccessNameType owner;
char *ownerPtr = NULL;
char *changeDiary = CPNULL;
char *objectModificationLogLabel = NULL;
ARStatusList status;
ARWorkflowConnectStruct *schemaList = NULL;
ARPropList *objPropList = NULL;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(&status, 1,ARStatusList);
Zero(newName, 1, ARNameType);
Zero(owner, 1, ARAccessNameType);
if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
} else {
HV *objDef = (HV *)SvRV(objDefRef);
SV **qhv = hv_fetch(objDef, "query", strlen("query") , 0);
ARNameType name;
ARImageDataStruct imageBuf;
char *imageType = CPNULL;
char *description = CPNULL;
char *helpText = CPNULL;
ARAccessNameType owner;
char *changeDiary = CPNULL;
ARPropList objPropList;
char *objectModificationLogLabel = NULL;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(&status, 1,ARStatusList);
Zero(name, 1, ARNameType);
Zero(&imageBuf, 1,ARImageDataStruct);
Zero(owner, 1, ARAccessNameType);
Zero(&objPropList, 1, ARPropList);
if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
} else {
ARImageDataStruct *imageBuf = NULL;
char *imageType = CPNULL;
char *description = CPNULL;
char *helpText = CPNULL;
ARAccessNameType owner;
char *ownerPtr = NULL;
char *changeDiary = CPNULL;
ARPropList *objPropList = NULL;
char *objectModificationLogLabel = NULL;
RETVAL = 0; /* assume error */
(void) ARError_reset();
Zero(&status, 1,ARStatusList);
Zero(newName, 1, ARNameType);
Zero(owner, 1, ARAccessNameType);
if(SvTYPE((SV *)SvRV(objDefRef)) != SVt_PVHV) {
ARError_add( AR_RETURN_ERROR, AP_ERR_EXPECT_PVHV);
} else {
HV *objDef = (HV *)SvRV(objDefRef);
ARS/CodeTemplate.pm view on Meta::CPAN
my $line;
foreach $line ( @input ){
if( $line =~ /^@@\s+(\S+)\s+(.*)$/ ){
my( $openMode, $outFile ) = ( $1, $2 );
if( $outFile =~ /^<@(.*)@>\s*$/ ){
eval( 'package '.caller()."; \$outFile = $1; package ARS::CodeTemplate;" );
# print "OUTFILE: $outFile\n";
}
# print "OM($openMode) FILE($outFile)\n";
die "Syntax error in \"$line\"\n" unless $openMode =~ /^[>|]+$/;
if( defined $opt{debug} ){
print "#------------------------------------------------------------\n";
print "# OUTPUT: $line\n";
print $pCode;
print "#------------------------------------------------------------\n\n";
}else{
eval( 'package '.caller()."; $pCode; package ARWT::Template;" );
if( $@ ){
warn $@, "\n";
exit 1;
ARS/OOmsgs.pm view on Meta::CPAN
my $stackTrace = Carp::longmess("exception generated");
&{$this->{'.catch'}->{$_}}($_, $this->messages(),
$stackTrace);
}
}
}
}
sub pushMessage {
my ($this, $type, $num, $text) = (shift, shift, shift, shift);
$ARS::ars_errhash{numItems}++;
push @{$ARS::ars_errhash{messageType}}, $type;
push @{$ARS::ars_errhash{messageNum}}, $num;
push @{$ARS::ars_errhash{messageText}}, $text;
$this->tryCatch();
}
sub messages {
my(%mTypes) = ( 0 => "OK", 1 => "WARNING", 2 => "ERROR", 3 => "FATAL",
4 => "INTERNAL ERROR",
-1 => "TRACEBACK");
my ($this, $type, $str) = (shift, shift, undef);
return $ars_errstr if(!defined($type));
for(my $i = 0; $i < $ARS::ars_errhash{numItems}; $i++) {
if(@{$ARS::ars_errhash{'messageType'}}[$i] == $type) {
$s .= sprintf("[%s] %s (ARERR \#%d)",
$mTypes{@{$ARS::ars_errhash{messageType}}[$i]},
@{$ARS::ars_errhash{messageText}}[$i],
@{$ARS::ars_errhash{messageNum}}[$i]);
$s .= "\n" if($i < $ARS::ars_errhash{numItems}-1);
}
}
return $s;
}
sub errors {
my $this = shift;
return $this->messages(&ARS::AR_RETURN_ERROR);
}
sub warnings {
my $this = shift;
return $this->messages(&ARS::AR_RETURN_WARNING);
}
sub fatals {
my $this = shift;
return $this->messages(&ARS::AR_RETURN_FATAL);
}
sub hasMessageType {
my ($this, $t) = (shift, shift);
return $t if !defined($t);
for(my $i = 0; $i < $ARS::ars_errhash{numItems}; $i++) {
return 1
if(@{$ARS::ars_errhash{'messageType'}}[$i] == $t);
}
return 0;
}
sub hasFatals {
my $this = shift;
return $this->hasMessageType(&ARS::AR_RETURN_FATAL);
}
sub hasErrors {
ARS/OOsup.pm view on Meta::CPAN
my ($blessed) = bless($self, $class);
my ($server, $username, $password, $catch, $ctrl, $dbg, $tcpport) =
rearrange([SERVER,USERNAME,PASSWORD,CATCH,CTRL,DEBUG,TCPPORT],@p);
# should the OO layer emit debugging information?
$self->{'.debug'} = 0;
$self->{'.debug'} = 1 if(defined($dbg));
$self->initCatch();
# what error handlers should be called automatically by the OO layer?
# if a handler is 'undef' then the OO layer will ignore that type of
# exception (warning, error or fatal). it is then upto the user to
# check ->hasErrors(), etc.
# this should be a hash ref.
if(defined($catch) && ref($catch) ne "HASH") {
$self->pushMessage(&ARS::AR_RETURN_ERROR,
81000,
"catch parameter should be a HASH reference. (you gave me ".ref($catch)." reference)"
);
}
(TS) fixed exsi.pl enumeration gap problem
(TS) added lengthUnits,storageOptionForCLOB attributes to ARCharLimitsStruct,ARDisplayLimits
(TS) fixed ars_GetServerInfo() keys 325-332 problem
(TS) modifications for AR 7.6.3 API
(TS) ars_GetEntryBLOB bugfix by Conny Martin
(TS) fixed "hv_fetch error" problem in case of undefined ARValueStruct
(TS) fixed SignalTypeMap problem
(TS) package directory reorganization/cleanup
(TS) additional ars_Login parameters by Conny Martin
(TS) implemented ars_GetList/Get/Create/Set/DeleteImage
(TS) fixed incorrect AR_ARITH_OP_NEGATE handling in rev_ARArithOpStruct
(TS) fixed IVLD macro in support-h.template
Released: 05/06/2008 Version: 1.91
(TS) fixed ars_padEntryid to work correctly if entry ID prefix is defined
(TS) replaced malloc-on-windows patch by UNDEF_PERL_MALLOC compilation option in Makefile.PL
(TS) fixed pointer initialization error in ars_SetVUI
(TS) modified ars_Create/Get/SetFilter for API 7.1
(TS) fixed ars_GetAlertCount
(MB) removed legacy ars_NT Notifier and ars_AdminExtension calls
(MB) ! added ars_VerifyUser implementation by Thilo Stapff
(MB) ! changed ars_APIVersion to use AR_CURRENT_API_VERSION rather than AR_EXPORT_VERSION
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
(JCM) fixed 'autosplit' issue in Makefile.PL
(IT) Updates by Ian Trimnell for ars_GetListContainer and ars_GetContainer
Released: 03/14/2005 Version: 1.83
(JCM) fixed "lang" compilation error for API 6.3
(JCM) variable initialization
(JG) doc updates
Released: 09/20/2004 Version: 1.82
(QGM) AR 6.x compatibility, AR encryption compatibility
(JMc) Makefile.PL changes, code cleanup for Windows build
Released: 08/09/2003 Version: 1.81
(JCM) memory/multithreaded issue with errhash fixed { steve.drew at hp.com }
(JCM) uninitialized variable issue fixed { steve.drew at hp.com }
(JCM) memory free'ing on win32 issues fixed { steve.drew at hp.com }
(JCM) minor fix to OO->query (forgot the new firstretrieve param)
Released: 04/16/2003 Version: 1.8001
(JCM) added new params to ars_Login: lang, authString, tcpport, rpcnumber
(JCM) added new rv's to ars_GetControlStructFields: lang, authString
(JCM) updated example and test scripts
(JCM) added Alert functions (replaces NT/Notifier functions)
(JCM) ! 5.x (5.0.1, 5.1, 5.1.1) integration
functions that no longer are available or always
return errors indicating they are no longer implemented:
ars_NT*() [notifier functions]
functions whose parameters have changed:
ars_GetListEntry()
ars_GetListEntryWithFields()
functions whose return values have changed:
(GDF) added ars_GetMultipleEntries, ars_GetListEntryWithFields
(GDF) remove unused num_entries parameter from ARGetListEntry
(JCM) added ARTermination calls to ars_Login
Released: 11/13/2001 Version: 1.73
(JCM) fixed windows cpp error in support.c
(JCM) fixed a leftover fprintf warning in support.c that was causing
compilation warnings on windows
(JCM) disabled t/11entry.t
(JCM) minor Makefile.PL tweak
(JCM) bug fix in perl_ARStatusStruct that caused segv with api >= 4.0
(JCM) OO: now checks named params to ensure you don't
mis-spell them.
(JCM) attachment allows specify a 'name' hash key so you can
customize the name that appears in the attachment field
in the usertool. (Nick Stoughton {NickS at ISRWORLD.com})
(JCM) OO: form->setSort method added
(JCM) OO: better error handling/catching
(JCM) OO: fixed bug in value2internal
(JCM) fixed NTRegisterServer(), fixed example/3.x/Notifier.pl
(JCM) OO: fixed ARS::AR_RETURN_* bugs { erik.dorfman at intelsat.int }
(JCM) fixed bug in ars_GetListServer() for api >= 4.0
at the request of activestate
(JCM) added MANIFEST file to distribution
Released: 12/28/98 Version: 1.62
(JCM) added extra decoding code to GetFilter.pl example script
(JCM) syntax errors fixed in some example scripts
(JCM) added bug fix to NTRegisterServer from G David Frye {gdf at uiuc.edu}
(JCM) ! ars4.0 integration (see RELNOTES for important compatibility
information)
(JCM) ! perl_qualifier() now takes a control struct
(JCM) if compiled against API >= 4.0 then __ars_init __ars_term
no longer do anything (but are still there). the functionality
(JCM) fixed bug in ars_EncodeDiary()
(JCM) added ars_MergeEntry.pl example script
Released: 12/15/97 Version: 1.53
(JCM) fixed some minor errors in doc
Released: 11/19/97 Version: 1.5206
(JCM) added ars_GetVUI to the ARS.pm exports line.
(JCM) added refreshCode to GetCharMenu hash
(JCM) fixed bug in groupList value change in 1.5205
Released: 10/08/97 Version: 1.52
(JCM) fixed core dump problem due to uninitialized variable(s)
Released: 10/07/97 Version: 1.51
(JCM) fixed some typos/symbol errors. added a missing routine.
Released: 10/06/97 Version: 1.50
(JCM) removed ars_errstr from C code. replaced with ars_errhash.
modified ARS.pm to refer to hash when $ars_errstr is
accessed. $ars_errstr no longer tie'd to main:: package.
(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
(JCM) added valueType to the assign structure to assist in
reversing the operation (converting perl to C API assign
structure).
(JCM) added displayTag as an optional parameter to ars_LoadQualifier()
so that you can build queries against customized views (that
are stored on the server).
(JCM) altered ARError() so that return codes of OK or WARNING don't
signal an error. For example, GetListEntries would return
nothing if you matched more than the max allowed, now it returns
the max allowable number of records and places a warning message
into the error hash.
Released: 05/22/97 Version: 1.46
(JWM) bug fixes
(JWM) new function: ars_MergeEntry(), ars_EncodeDiary()
INSTALLATION view on Meta::CPAN
The third command might require special (i.e. root) access if your
perl distribution is not owned by your userid.
BUILDING ON WINDOWS WITH STRAWBERRY PERL
(Note to Windows Developers: While this is the correct procedure, it will not
yet provide a stable 64-bit module)
1) Download ARSPerl source and unpack
2) Download and install 32 or 64-bit Strawberry perl from strawberryperl.com
3) Download desired ARS API files from RRR and unpack
(https://rrr.se/cgi/index?pg=arapi)
4) Edit Makefile.PL, and update $ARSAPI to indicate where ARS API files have
been unpacked
5) If compiling for 64-bit, the following lines need updating in Makefile.PL
as well:
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/manual/ars_GetControlStructFields.html
html/manual/ds_al.html
html/manual/ars_GetListEscalation.html
html/manual/ars_MergeEntry.html
html/manual/ars_CreateFilter.html
html/manual/ds_ars_err_hash.html
html/manual/ds_getfilter_hash.html
html/manual/ars_GetFieldByName.html
html/manual/ars_GetContainer.html
html/manual/ars_DeleteImage.html
html/manual/ars_GetServerCharSet.html
html/manual/ars_GetListGroup.html
html/manual/ars_CreateCharMenu.html
html/manual/ars_DecodeAlertMessage.html
html/manual/ds_enumitemstruct.html
html/manual/ars_GetCharMenu.html
README
changes.dat
META.yml
RELNOTES
typemap
Makefile.PL
support.h
ARS/ar-h.pm
ARS/_h2ph_pre.ph
ARS/CodeTemplate.pm
ARS/arerrno-h.pm
ARS/OOform.pm
ARS/nparm.pm
ARS/OOmsgs.pm
ARS/OOsup.pm
blib/script/.exists
blib/man3/.exists
blib/man1/.exists
blib/arch/.exists
blib/arch/auto/ARS/.exists
blib/bin/.exists
blib/lib/.exists
blib/lib/ARS.pm
blib/lib/auto/ARS/.exists
blib/lib/auto/ARS/autosplit.ix
blib/lib/ARS/ar-h.pm
blib/lib/ARS/arerrno-h.pm
blib/lib/ARS/OOform.pm
blib/lib/ARS/nparm.pm
blib/lib/ARS/OOmsgs.pm
blib/lib/ARS/OOsup.pm
MANIFEST
Makefile.PL view on Meta::CPAN
$AUTODEFINES .= " -DARSPERL_UNDEF_MALLOC " if $ADVANCED_CONFIG{UNDEF_PERL_MALLOC};
$AUTODEFINES .= " -DGETLISTGROUP_OLD_STYLE " if $ADVANCED_CONFIG{GETLISTGROUP_OLD_STYLE};
$AUTODEFINES .= " -DARSPERL_DEBUG " if $debug;
$ARS_STATIC_LIB = "";
$PM = { 'ARS.pm' => '$(INST_LIBDIR)/ARS.pm' };
foreach my $pm2install (qw{arerrno-h.pm ar-h.pm nparm.pm OOform.pm OOmsgs.pm OOsup.pm}) {
$PM->{'ARS/'.$pm2install} = '$(INST_LIBDIR)/ARS/'.$pm2install;
}
$LARCH = $ARCHITECTURE ? "_".$ARCHITECTURE : "";
if ($ARAPIVERSION >= ARS_VERSION_63) {
$ARS_STATIC_LIB = "$ARSAPI/lib/libar$LARCH.a";
$ARS_LIBS = "-larencrypt$LARCH -lcrypto_BMC_FIPS$LARCH " if $ENCRYPT;
$ARS_LIBS .= " -lnsl ";
Makefile.PL view on Meta::CPAN
die "whoops. no file at ".$Config{'perlpath'} unless ( -f $Config{'perlpath'} );
$cmd = qq("$Config{'perlpath'}" infra/exsi.pl < "${ARSAPI}/include/ar.h" > serverTypeInfoHints.h);
$rv = system($cmd);
die "something went wrong when i ran \"$cmd\" (rv = $rv, expected 0)" unless ($rv == 0);
print "Converting C header files to perl modules ..\n";
foreach ("ar", "arerrno") {
my $headerFile = "${ARSAPI}/include/${_}.h";
# # arsystem >= 5.0 doesnt have nt libs/hdrs anymore
# if( ($ARSVERSION >= 5.0) && /^nt/ ) {
# open(FD, "> ARS/${_}-h.pm") || die "open: $!";
# print FD "\# as of ARSystem 5.0, the NT (notifier) routines
## are retired. so this file is just stubbed.
#1;\n";
# close(FD);
# open (FD, "> ARS/artypes.ph") || die "open: $!";
Makefile.PL view on Meta::CPAN
# because AdminExtension API routines were removed in as of
# the 3.2 release.
#
# -D_WIN32
#
# If you are compiling ARSperl under windows, define this
# and /don't/ define PROFILE.
#
# -DSKIP_SV_ISA (not automatically set)
#
# If you get errors during compilation/runtime similar to
# "undefined symbol: sv_isa" then add this define.
'DEFINE' => ${AUTODEFINES},
# 'DEFINE' => '-D_WIN32 ', # note: win32 -> no -DPROFILE
# if you have trouble under solaris when linking (bfd assertion
# failures) try uncommenting the following:
#
# 'LD' => "/usr/ccs/bin/ld",
# don't fiddle with this
'realclean' => {
'FILES' => 'support.h ARS/ar-h.pm ARS/arerrno-h.pm ARS/_h2ph_pre.ph t/config.cache serverTypeInfoHints.h *~ .purify '
}
);
makeTestConfig();
print "
Type 'make' (windows: 'nmake') to build ARSperl.
Type 'make test' to test ARSperl before installing.
Type 'make install' to install ARSperl.
StructDef.pl view on Meta::CPAN
_data => 'p->qualifier',
},
valueField => {
_type => 'ARInternalId',
_data => 'p->valueField',
},
multi => {
_type => 'unsigned int',
_data => 'p->multiMatchCode',
_map => {
AR_QUERY_VALUE_MULTI_ERROR => 'error',
AR_QUERY_VALUE_MULTI_FIRST => 'first',
AR_QUERY_VALUE_MULTI_SET => 'set',
},
},
},
ARValueList => {
_num => 'p->numItems',
_list => 'p->valueList',
_type => 'ARValueStruct',
},
constants).
-----------------------------------------------
o add additional OO support.
o add sort order option to OO
o obey vui name
o pad out entry id where applicable.
o allow for field id's to be specified if user chooses.
o status history conversion?
o allow for either/or enumer text or enum value in set/create
o if unknown param, error
-----------------------------------------------
Howdy everyone:
Please forgive me if this question is a bit naive, I'm still new to the
universe of Remedy and such ...
I'm looking for a perl library which could take standard ARS/Remedy style
query and return the query in Sybase Transact SQL format. Something like
changes.dat view on Meta::CPAN
JL automatic API-Version detection in Makefile.PL
JL dropped support to compile ARSperl using ARAPI below version 4.5
JL small bugfixes
released=08/01/2011 version=1.93
TS fixed exsi.pl enumeration gap problem
TS added lengthUnits,storageOptionForCLOB attributes to ARCharLimitsStruct,ARDisplayLimits
TS fixed ars_GetServerInfo() keys 325-332 problem
TS modifications for AR 7.6.3 API
TS ars_GetEntryBLOB bugfix by Conny Martin
TS fixed "hv_fetch error" problem in case of undefined ARValueStruct
TS fixed SignalTypeMap problem
TS package directory reorganization/cleanup
TS additional ars_Login parameters by Conny Martin
TS implemented ars_GetList/Get/Create/Set/DeleteImage
TS fixed incorrect AR_ARITH_OP_NEGATE handling in rev_ARArithOpStruct
TS fixed wrong operand evaluation for AR_ARITH_OP_NEGATE in perl_ARArithOpStruct
TS fixed ars_SetServerInfo() memory violation in case of more than one key/value pair
TS ars_GetFieldTable performance improvement by using ARGetMultipleFields
TS removed unnecessary second invocation of ARGetField in ars_GetField
TS code cleanup (#ifdef statements) in ARGetFieldCached, ars_GetField, ars_GetFieldByName
changes.dat view on Meta::CPAN
TS fixed actionList/elseList bug in ars_SetActiveLink
TS added AR_DATA_TYPE_VIEW handling to perl_ARValueStruct_Assign,rev_ARActiveLinkActionList
TS modified Makefile.PL for easier automated testing (handling of ARSPERLTEST_PARAM)
TS added ars_GetListRole, ars_Signal, ars_GetTextForErrorMessage
!TS changed return struct of ars_GetListGroup
TS fixed IVLD macro in support-h.template
released=05/06/2008 version=1.91
TS fixed ars_padEntryid to work correctly if entry ID prefix is defined
TS replaced malloc-on-windows patch by UNDEF_PERL_MALLOC compilation option in Makefile.PL
TS fixed pointer initialization error in ars_SetVUI
TS modified ars_Create/Get/SetFilter for API 7.1
TS fixed ars_GetAlertCount
MB removed legacy ars_NT Notifier and ars_AdminExtension calls
!MB added ars_VerifyUser implementation by Thilo Stapff
!MB changed ars_APIVersion to use AR_CURRENT_API_VERSION rather than AR_EXPORT_VERSION
MB fixed ars_GetActiveLink, ars_GetFilter, ars_GetEscalation, ars_GetField so they
return undef on failure.
JCM buffer overflow in perl_BuildEntryList
JCM malloc-on-windows patch by John Unsworth
TS fixed memory leak in ars_Get... functions (added "sv_2mortal( (SV*) RETVAL )")
changes.dat view on Meta::CPAN
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)
for conditional compilation depending on API version
(compiles now against version 4.5.1 to 6.3.0)
JCM added ars_encodeStatusHistory() routine
released=06/24/2005 version=1.84
JCM fixed 'autosplit' issue in Makefile.PL
IT Updates by Ian Trimnell for ars_GetListContainer and ars_GetContainer
released=03/14/2005 version=1.83
JCM fixed "lang" compilation error for API 6.3
JCM variable initialization
JG doc updates
released=09/20/2004 version=1.82
QGM AR 6.x compatibility, AR encryption compatibility
JMc Makefile.PL changes, code cleanup for Windows build
released=08/09/2003 version=1.81
JCM memory/multithreaded issue with errhash fixed { steve.drew at hp.com }
JCM uninitialized variable issue fixed { steve.drew at hp.com }
JCM memory free'ing on win32 issues fixed { steve.drew at hp.com }
JCM minor fix to OO->query (forgot the new firstretrieve param)
released=04/16/2003 version=1.8001
JCM memory leak fixed in ars_CreateEntry
JCM memory leak fixed in ars_SetEntry
JCM memory leak fixed in ars_MergeEntry
JCM memory leak fixed in ars_Export
JCM memory leak fixed in ars_GetListEntry wrt to join forms
JCM memory leak fixed in QualifierStructPtr destructor
JCM memory leak fixed in ControlStruct destructor
JCM various other memory related cleanups
JCM bad/NULL ref fixed in ExpandCharMenu
JCM added new params to ars_Login: lang, authString, tcpport, rpcnumber
JCM added new rv's to ars_GetControlStructFields: lang, authString
JCM updated example and test scripts
JCM added Alert functions (replaces NT/Notifier functions)
!JCM 5.x (5.0.1, 5.1, 5.1.1) integration<BR>
functions that no longer are available or always
return errors indicating they are no longer implemented:
<blockquote>
ars_NT*() [notifier functions]
</blockquote>
functions whose parameters have changed:
<blockquote>
ars_GetListEntry()<BR>
ars_GetListEntryWithFields()
</blockquote>
functions whose return values have changed:
<blockquote>
ars_GetCharMenu()
</blockquote>
released=11/13/2002 version=1.74
GDF added ars_GetMultipleEntries, ars_GetListEntryWithFields
GDF remove unused num_entries parameter from ARGetListEntry
JCM added ARTermination calls to ars_Login
released=11/13/2001 version=1.73
JCM fixed windows cpp error in support.c
JCM fixed a leftover fprintf warning in support.c that was causing
compilation warnings on windows
JCM disabled t/11entry.t
JCM minor Makefile.PL tweak
JCM bug fix in perl_ARStatusStruct that caused segv with api >= 4.0
released=10/24/2001 version=1.72
JCM modified Makefile.PL to handle changes to _SERVER_INFO definitions
in 4.5.x
JCM memory leak fixes
changes.dat view on Meta::CPAN
(Set|Create)Entry
released=04/7/99 version=1.6403 BETA
JCM tested/fixed compiling against pre-4.0 apis.
JCM OO: now checks named params to ensure you don't
mis-spell them.
JCM attachment allows specify a 'name' hash key so you can
customize the name that appears in the attachment field
in the usertool. (Nick Stoughton {NickS at ISRWORLD.com})
JCM OO: form->setSort method added
JCM OO: better error handling/catching
JCM OO: fixed bug in value2internal
JCM fixed NTRegisterServer(), fixed example/3.x/Notifier.pl
JCM OO: fixed ARS::AR_RETURN_* bugs { erik.dorfman at intelsat.int }
JCM fixed bug in ars_GetListServer() for api >= 4.0
released=03/12/99 version=1.6400 BETA
JCM added new LIBS line to Makefile.PL to cover NCR Unix
("Hill, David K" {david.k.hill at intel.com})
JCM added ars_GetEntryBLOB (attachment field handling)
thanks to "Kaelin Colclasure" {kaelin at talarian.com}
changes.dat view on Meta::CPAN
available.
released=01/04/99 version=1.63
JCM fixed some missing conditional compilation #if's in code
JCM changes "require Config" to "use Config" in Makefile.PL
at the request of activestate
JCM added MANIFEST file to distribution
released=12/28/98 version=1.62
JCM added extra decoding code to GetFilter.pl example script
JCM syntax errors fixed in some example scripts
JCM added bug fix to NTRegisterServer from G David Frye {gdf at uiuc.edu}
!JCM ars4.0 integration (see RELNOTES for important compatibility
information)
!JCM perl_qualifier() now takes a control struct
JCM if compiled against API >= 4.0 then __ars_init __ars_term
no longer do anything (but are still there). the functionality
of each of these have been rolled into ars_Login and ars_Logoff
respectively.
JCM added ars_APIVersion()
JCM GetActiveLink, when compiled against 4.0 returns ARMessageStruct
changes.dat view on Meta::CPAN
JCM patched ars_GetCharMenu for bug "GetCharMenu doesn't
return a qualifier for query menus" {D.J.Adams at soton.ac.uk}
JCM fixed dup_FieldValueOrArith to support decoding of
query style menus.
released=02/09/98 version=1.54
JCM fixed bug in ars_EncodeDiary()
JCM added ars_MergeEntry.pl example script
released=12/15/97 version=1.53
JCM fixed some minor errors in doc
released=11/19/97 version=1.5206
JCM added ars_GetVUI to the ARS.pm exports line.
JCM added refreshCode to GetCharMenu hash
JCM fixed bug in groupList value change in 1.5205
released=11/04/97 version=1.5205
JCM updated the groupList value returned by GetSchema()
so that it contains the correct key words.
changes.dat view on Meta::CPAN
released=10/13/97 version=1.5202
JCM removed a superfluous debugging statement
released=10/09/97 version=1.5201
JCM fixed problem in GetEscalation
released=10/08/97 version=1.52
JCM fixed core dump problem due to uninitialized variable(s)
released=10/07/97 version=1.51
JCM fixed some typos/symbol errors. added a missing routine.
released=10/06/97 version=1.50
JCM removed ars_errstr from C code. replaced with ars_errhash.
modified ARS.pm to refer to hash when $ars_errstr is
accessed. $ars_errstr no longer tie'd to main:: package.
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.
changes.dat view on Meta::CPAN
retrieve active link definitions and print them out that previous
expected the {message} key to point to a string will need to
be updated.
JCM added valueType to the assign structure to assist in
reversing the operation (converting perl to C API assign
structure).
JCM added displayTag as an optional parameter to ars_LoadQualifier()
so that you can build queries against customized views (that
are stored on the server).
JCM altered ARError() so that return codes of OK or WARNING don't
signal an error. For example, GetListEntries would return
nothing if you matched more than the max allowed, now it returns
the max allowable number of records and places a warning message
into the error hash.
released=05/22/97 version=1.46
JWM bug fixes
JWM new function: ars_MergeEntry(), ars_EncodeDiary()
released=04/25/97 version=1.45
JCM bug fix to GetListSchema routine
released=02/20/97 version=1.44
JCM added some minor code to aid in decoding qualifier
example/AddUsersToGroup.pl view on Meta::CPAN
use warnings;
die "usage: AddUserToGroup server username password group user1 [user2] ...\n"
if ( $#ARGV < 4 );
my ( $server, $user, $pass, $group, @users ) =
( shift, shift, shift, shift, @ARGV );
#Logging in to the server
( my $ctrl = ars_Login( $server, $user, $pass ) )
|| die "ars_Login: $ars_errstr";
# Retrieve a list of fieds in a hash for the User and Group forms, otherwise we have to use
# field ID's if we want to extract the values from the return strings.
( my %userfields = ars_GetFieldTable( $ctrl, "User" ) )
|| die "ars_GetFieldTable(User): $ars_errstr";
( my %groupfields = ars_GetFieldTable( $ctrl, "Group" ) )
|| die "ars_GetFieldTable(Group): $ars_errstr";
# we will retrieve the Group ID for the group specified in $group
# first create a qualifier using ars_LoadQualifier
( my $groupqualifier =
ars_LoadQualifier( $ctrl, "Group", "'105' = \"$group\"" ) )
|| die "ars_LoadQualifier(Group): $ars_errstr";
# fetch the Entry ID for this group by using GetListEntry with the group we just specified, if there is none, die.
my @groupentry = ars_GetListEntry( $ctrl, "Group", $groupqualifier, 0, 0 )
|| die "No such group \"$group\" ($ars_errstr)\n";
# Fetch the values for this record:
( my %groupvalues = ars_GetEntry( $ctrl, "Group", $groupentry[0] ) )
|| die "ars_GetEntry(Group): $ars_errstr";
# We are only interested in the field marked Group ID:
my $group_id = $groupvalues{ $groupfields{'Group ID'} };
# This loop will process all users one by one, see if they are already a member of the group specified,
# if neccesary we add them to the group by changing the Group List and writing it back.
foreach (@users) {
print "Adding $_ to $group .. \n";
# Create a qualifier to retrieve the Entry ID for this user
( my $userqualifier =
ars_LoadQualifier( $ctrl, "User", "'Login Name' = \"$_\"" ) )
|| die "ars_LoadQualifier: $ars_errstr";
# Fetch the EID for this user; if there is no such user, say so and continue with next user
# ars_GetListEntry provides a list with Entry-Id, Short description pairs
# In this case only one pair. That means $userentry[0] will contain the actual Entry ID.
my @userentry = ars_GetListEntry( $ctrl, "User", $userqualifier, 0, 0, );
# If there is no record for this user, say so and conitue with the next one
if ( !@userentry ) { print "No user $_\n"; next; }
# Get the value of the Group List field. Syntax = ars_GetEntry(ctrl, schema, eid [field ID...n])
example/AddUsersToGroup.pl view on Meta::CPAN
else {
print "\tno groups were assigned to this user.\n";
$newgrouplist = "$group_id;";
}
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/ChangePassword.pl view on Meta::CPAN
use ARS;
use strict;
die "usage: ChangePassword.pl server username password newpassword\n"
unless ( $#ARGV >= 3 );
my ( $server, $user, $password, $newpassword ) = ( shift, shift, shift, shift );
#Logging in to the server
( my $ctrl = ars_Login( $server, $user, $password ) )
|| die "ars_Login: $ars_errstr";
# Creating qualifier to look up the entry ID of the username; Login Name field is 101.
( my $userqualifier = ars_LoadQualifier( $ctrl, "User", "'101' = \"$user\"" ) )
|| die "ars_LoadQualifier(User): $ars_errstr";
# fetch the Entry ID for this user by using GetListEntry with the qualifier we
# just specified, otherwise die.
my @userentry = ars_GetListEntry( $ctrl, "User", $userqualifier, 0, 0 );
die "No such user $user? ($ars_errstr)\n" if ( $#userentry == -1 );
# Change the password for this user by setting field 102 (the password field) with the new value
ars_SetEntry( $ctrl, "User", $userentry[0], 0, 102, $newpassword )
|| die "Error updating password: $ars_errstr";
print "Password changed for user $user on server $server\n";
example/DelUsersFromGroup.pl view on Meta::CPAN
#
#
use ARS;
die "usage: DelUserFromGroup server username password group user1 [user2] ...\n" unless ($#ARGV >= 4);
($server, $user, $pass, $group, @users) = (shift, shift, shift, shift, @ARGV);
($c = ars_Login($server, $user, $pass)) ||
die "ars_Login: $ars_errstr";
(%uf = ars_GetFieldTable($c, "User")) ||
die "ars_GetFieldTable(User): $ars_errstr";
(%gf = ars_GetFieldTable($c, "Group")) ||
die "ars_GetFieldTable(Group): $ars_errstr";
($q = ars_LoadQualifier($c, "Group", "'Group name' = \"$group\"")) ||
die "ars_LoadQualifier(Group): $ars_errstr";
@e = ars_GetListEntry($c, "Group", $q, 0);
die "No such group \"$group\"? ($ars_errstr)\n" if ($#e == -1);
(%v = ars_GetEntry($c, "Group", $e[0])) ||
die "ars_GetEntry(Group): $ars_errstr";
$group_id = $v{$gf{'Group id'}};
foreach (@users) {
print "Adding $_ to $group .. \n";
($q = ars_LoadQualifier($c, "User", "'Login name' = \"$_\"")) ||
die "ars_LoadQualifier: $ars_errstr";
@e = ars_GetListEntry($c, "User", $q, 0);
die "No User record for $_? ($ars_errstr)\n" if ($#e == -1);
(%v = ars_GetEntry($c, "User", $e[0])) ||
die "ars_GetEntry: $ars_errstr";
$cg = $v{$uf{'Group list'}};
if(($cg =~ /^$group_id;/) || ($cg =~ /\s$group_id;/)) {
print "\tcurrent group list: $cg\n";
if($cg =~ /^$group_id;/) {
$cg =~ s/^$group_id;//g;
}
elsif($cg =~ /\s$group_id/) {
$cg =~ s/\s$group_id;//g;
}
print "\tnew group list : $cg\n";
ars_SetEntry($c, "User", $e[0], 0, $uf{'Group list'}, $cg) ||
die "ars_SetEntry(User): $ars_errstr";
} else {
print "\tnot a member of $group\n";
next;
}
}
ars_Logoff($c);
exit 0;
example/Dump_Setup.pl view on Meta::CPAN
# 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
# Revision 1.6 2003/03/27 17:58:42 jcmurphy
# 5.0 changes, bug fixes
#
# Revision 1.5 1999/05/05 19:57:59 rgc
# DumpUsers.
#
# Revision 1.4 1998/12/28 15:23:29 jcmurphy
# fixed up "Login name" query for ARS4.0 ("Login Name")
#
# Revision 1.3 1997/09/30 04:49:13 jcmurphy
# added some error output
# /
#
# Revision 1.2 1997/02/19 22:41:25 jcmurphy
# misspelling
#
# Revision 1.1 1996/11/21 20:13:51 jcmurphy
# Initial revision
#
#
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)
printf( "%-30s %-45s\n", "Login name", "Full name" );
for ( my $i = 0 ; $i <= $#entries ; $i += 2 ) {
example/GetCharMenu.pl view on Meta::CPAN
# Revision 1.8 2003/03/28 05:51:56 jcmurphy
# more 5.x edits
#
# Revision 1.7 2001/10/24 14:21:27 jcmurphy
# MergeEntry doc update, minor test/example tweaks
#
# Revision 1.6 2000/05/24 18:05:26 jcmurphy
# primary ars4.5 integration in this checkpoint.
#
# Revision 1.5 1998/10/14 13:55:34 jcmurphy
# fixed syntax error
#
# Revision 1.4 1998/09/16 14:38:31 jcmurphy
# updated changeDiary code
#
# Revision 1.3 1998/02/25 19:21:32 jcmurphy
# updated to printout query if query style menu
#
# Revision 1.2 1997/11/10 23:36:52 jcmurphy
# added refreshCode to the output
#
example/GetCharMenu.pl view on Meta::CPAN
($server, $username, $password, $name) = @ARGV;
if(!defined($name)) {
print "Usage: $0 [server] [username] [password] [menuname]\n";
exit 0;
}
$ctrl = ars_Login($server, $username, $password);
print "Calling ars_GetCharMenu($ctrl, $name)..\n";
($finfo = ars_GetCharMenu($ctrl, $name)) ||
die "error in GetCharMenu: $ars_errstr";
# 10005
print "Calling ars_GetCharMenuItems($ctrl, $name)..\n";
my ($menuItems) = ars_GetCharMenuItems($ctrl, $name);
die "$ars_errstr\n" unless defined($menuItems);
print "menuItems=<<$menuItems>> (should be an array ref)\n";
die "hmm. that wasnt an array ref." unless ref ($menuItems) eq "ARRAY";
print "** Menu Info:\n";
print "Name : \"".$finfo->{"name"}."\"\n";
print "helpText : ".$finfo->{"helpText"}."\n";
print "timestamp : ".localtime($finfo->{"timestamp"})."\n";
print "owner : ".$finfo->{"owner"}."\n";
print "lastChanged : ".$finfo->{"lastChanged"}."\n";
print "changeDiary : ".$finfo->{"changeDiary"}."\n";
example/GetField.pl view on Meta::CPAN
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.
if ( !defined( $fids{$fieldname} ) ) {
print "ERROR: I couldn't find a field called \"$fieldname\" in the
Default Admin View of schema \"$schema\"\n";
exit 0;
}
# Get the field info
print "Fetching field information ..\n";
( my $fieldInfo = ars_GetField( $ctrl, $schema, $fids{$fieldname} ) )
|| die "GetField: $ars_errstr";
print "Here are some of the field attributes. More are available.
fieldId: $fieldInfo->{fieldId}
createMode: $fieldInfo->{createMode}
dataType: $fieldInfo->{dataType}
defaultVal: $fieldInfo->{defaultVal}
owner: $fieldInfo->{owner}
";
example/GetFilter.pl view on Meta::CPAN
# 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
#
example/GetFilter.pl view on Meta::CPAN
%ars_opSet = (
$AR_OPERATION_GET, "Display",
$AR_OPERATION_SET, "Modify",
$AR_OPERATION_CREATE, "Create",
$AR_OPERATION_DELETE, "Delete",
$AR_OPERATION_MERGE, "Merge"
);
$ctrl = ars_Login($server, $username, $password);
($finfo = ars_GetFilter($ctrl, $filtername)) ||
die "error in GetFilter: $ars_errstr";
print "\n\nerrstr contains \"$ars_errstr\"\n\n" if ($ars_errstr ne "");
print "** Filter Info:\n";
print "Name : \"".$finfo->{"name"}."\"\n";
print "Order : ".$finfo->{"order"}."\n";
if(defined($finfo->{'schema'})) {
print "Schema : \"".$finfo->{"schema"}."\"\n";
}
elsif(defined($finfo->{'schemaList'})) {
print "schemaList : ";
foreach my $s (@{$finfo->{'schemaList'}}) {
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'},
$ARServerStats{'CPU'} );
die "ars_GetServerStatistics: $ars_errstr" unless %stats;
foreach my $stype (keys %stats) {
if($rev_ServerStats[$stype] =~ /TIME/) {
print $rev_ServerStats[$stype]." = <".localtime($stats{$stype})."> (".$stats{$stype}.")\n";
} else {
print $rev_ServerStats[$stype]." = <".$stats{$stype}.">\n";
}
}
ars_Logoff($c);
example/Get_Diary.pl view on Meta::CPAN
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 );
# Retrieve the fieldid for the diary field
( my $diaryfield_fid = ars_GetFieldByName( $ctrl, $schema, $diaryfield ) )
|| die "no such field in this schema: '$diaryfield'";
example/List_Entries.pl view on Meta::CPAN
}
# 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 );
printf( "%-15s %-60s\n", "Entry-ID", "Short Description" );
foreach my $entry_id ( sort keys %entries ) {
printf( "%-15s %-60s\n", $entry_id, $entries{$entry_id} );
}
example/PrintQual.pl view on Meta::CPAN
}
# 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";
# Convert the decoded structure to a readable format
$e = ars_Decode_QualHash($ctrl, $schema, $dq);
print "$e\n";
ars_Logoff($ctrl);
exit 0;
example/WhoUsesIt.pl view on Meta::CPAN
system 'stty', '-echo';
chomp($password = <STDIN>);
system 'stty', 'echo';
print "\n";
}
($ctrl = ars_Login($server, $username, $password)) ||
die "couldn't allocate control structure";
(@schemas = ars_GetListSchema($ctrl)) ||
die "can't read schema list: $ars_errstr";
if($opt_M) {
# fine any menu that uses this file as it's
# source of menu items.
print "Menus that use the file \"$opt_M\"... (this may take a minute or so to do)\n";
@menus = ars_GetListCharMenu($ctrl, 0);
if($#menus != -1) {
foreach $menu (@menus) {
print "Searching: $menu\n" if $debug;
($menuDef = ars_GetCharMenu($ctrl, $menu)) ||
die "ars_GetCharMenu: $ars_errstr";
#next unless ($menu eq "PT-Assignees");
#use Data::Dumper; print Dumper($menuDef); exit 0;
# 3 is legacy.
if( ($menuDef->{menuType} == 3) || ($menuDef->{menuType} =~ /format_quotes/i) ) {
print "\tIs type File (points to ".qq{"$menuDef->{menuFile}{filename}"}.")\n" if $debug;
if ($menuDef->{menuFile}{filename} =~ /$opt_M/) {
$users{$menu} = $1;
}
}
}
foreach (sort keys %users) {
print "\t$_\n";
}
} else {
print "No menu's available!\n$ars_errstr\n";
}
} elsif($opt_a) {
# find any schema that uses this active link.
print "Searching for Active Link \"$opt_a\" in Schema \"$SCHEMA\"...\n";
foreach $schema (@schemas) {
if($schema =~ /$SCHEMA/) {
print "Searching schema $schema..\n" if $debug;
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";
ars_Logoff($c) ||
die "Logoff: $ars_errstr";
example/ars_DateToJulianDate.pl view on Meta::CPAN
use strict;
die "usage: $0 server username password year month day\n"
unless ( $#ARGV >= 5 );
my ( $server, $user, $password, $year, $month, $day, ) =
( shift, shift, shift, shift, shift, shift, );
#Logging in to the server
( my $ctrl = ars_Login( $server, $user, $password ) )
|| die "ars_Login: $ars_errstr";
print "Converting year $year month $month day $day to Julian...\n";
( my $juliandate = ars_DateToJulianDate( $ctrl, $year, $month, $day ) )
|| die "ERR: $ars_errstr\n";
ars_Logoff($ctrl);
print "The JulianDate value is $juliandate\n";
example/ars_ExecuteProcess.pl view on Meta::CPAN
use ARS;
use strict;
die "usage: ars_ExecuteProcess.pl server username \"string to execute\"\n"
if ( $#ARGV < 3 );
my ( $server, $user, $pass, $command ) = ( shift, shift, shift, shift );
#Logging in to the server
( my $ctrl = ars_Login( $server, $user, $pass ) )
|| die "ars_Login: $ars_errstr";
( my ( $num, $str ) = ars_ExecuteProcess( $ctrl, $command ) )
|| print "ERR: $ars_errstr\n";
print "gotit: $ars_errstr\n";
print "returnCode=<$num> returnString=<$str>\n";
ars_Logoff($ctrl);
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