$ars_errstr
ars_Login(server,username,password)
undef
.
Example:
($c = ars_Login("server","jmurphy","blah")) || die "can't login";
ars_Logoff(ctrl)
No return values.
Example:
ars_Logoff($c);
ars_LoadQualifier(ctrl,schema,qualstring)
undef
.
Example:
($q = ars_LoadQualifier($c, "User", "'Login name' = \"jmurphy\"")) || print "error!";
ars_GetListField(control,schema,changedsince=0)
changedsince
is an optional unix timestamp
and defaults to 0.
undef
.
Example:
@fields = ars_GetListField($c, "User");
ars_GetFieldByName(control,schema,field_name)
undef
.
Example:
$id = ars_GetFieldByName($c, "User", "Login name");
ars_GetFieldTable(control,schema)
undef
.
Example:
%fields = ars_GetFieldTable($c, "User"); if(defined($fields{"Login name"}) { $id = $fields{"Login name"}; } else { print "Field doesnt exist!\n"; }
ars_CreateEntry(ctrl, schema, field_name1, value1, ...)
undef
.
Example:
($entry_id = ars_CreateEntry($c, "Schema01", $id, $val)) || print "submission failed\n";
ars_DeleteEntry(ctrl,schema,entry_id)
entry_id
.
Example:
ars_DeleteEntry(ctrl,"Schema01",$entry_id);
ars_GetEntry(ctrl,schema,entry_id,...)
entry_id
parameter, only the values
for those fields will be returned. If no field ids are given after
entry_id
, then all (fieldid, value) pairs are
retrieved.If the fielid is for a Diary Field, the following bit of code shows how to decode the entries:
$diaryfield_fid = ars_GetFieldByName($ctrl, $schema, $diaryfield); %vals = ars_GetEntry($ctrl, $schema, $entry_id); foreach $diary_entry (@{$vals{$diaryfield_fid}}) { print "$diary_entry->{timestamp}\t$diary_entry->{user}\n"; print "$diary_entry->{value}\n"; }
undef
.
Example:
%vals = ars_GetEntry($c, "User", $entry_id); print "Login name = ".$vals{"Login name"}."\n";
ars_GetListEntry(ctrl,schema,qualifier,maxRetrieve,...)
entry_id
's
from the specified schema. The entries are returned as a list
(associative array) of (entry_id, short-description) pairs.
This function requires a Qualifier. If you wish to retrieve all
entries in the schema (upto the maximum you specified) you should
load a Qualifier with something like (1 = 1)
.
Optional field ids may be given after maxRetrieve to specify the
sorting order. If you specify maxRetrieve = 0
then
all of the entries will be returned (or the maximum allow by the
server administrator, which ever is less). Note! The "Short-Description" mentioned above is not the contents of the "short-description" field in the schema. It is, in fact, the contents of the "Query List Fields" for this schema. See List_Entries.pl for an example.
undef
.
Example:
%entries = ars_GetListEntry($c, "User", $q, 100); foreach $entry_id (sort keys %entries) { print "EntryID: $entry_id Short-Descrip: $entries{$entry_id}\n"; }To specify a sort, you add the field you wish to sort on to the end of the call and then either 1 or 2 to indicate if you want it sorted in ascending or descending order, respectively.
Example of how to set sorting options:
$all = ars_LoadQualifier($c,"User","1=1"); $login_name = ars_GetFieldByName($c,"User","Login Name"); @a = ars_GetListEntry($c, "User", $all, 0, $login_name, 1);to get a list of all users, sorted based on Login Name.
ars_GetListSchema(ctrl, changedsince=0)
changedsince
is an optional timestamp that will cause
only schemas newer than that time to be returned.
undef
.
Example:
@schemas = ars_GetListSchema($c); for($i = 0; $i < $#schemas ; $i++) { print "$schemas[$i]\n"; }
ars_GetListServer(ctrl)
/etc/ar
file.
undef
.
Example:
@servers = ars_GetListServer($c); for($i = 0; $i < $#servers ; $i++) { print "$servers[$i]\n"; }
ars_GetActiveLink(ctrl,name)
undef
.
Example:
$alink = ars_GetActiveLink($c, "AR-Assets-GetContactinfo");
ars_GetCharMenuItems(ctrl,name)
Illustration
@menu_struct ($name = "Item1" , $value = "This is item1") . . . ($name = "Sub Menu", $value = array reference) +------> @sub_menu_struct ($name = "SubItem1", $value = ...) . . .See Show_Menu.pl for a demonstration of using this function and its output.
undef
.
Example:
$m = ars_GetCharMenuItems($ctrl, $menu_name)); @menu_struct = @$m;
ars_GetSchema(ctrl,name)
undef
Example:
$s = ars_GetSchema($c, "Group");
ars_GetListActiveLink(ctrl,schema=NULL,changedSince=0)
undef
Example:
@alink_names = ars_GetListActiveLink($c); # get all active links @alink_names = ars_GetListActiveLink($c, "Group"); # get all active links associated with the # "Group" schema.
ars_GetField(ctrl,schema,id)
Example:
ars_SetEntry(ctrl,schema,entry_id,getTime,...)
Example:
ars_GetListFilter(ctrl,schema=NULL,changedsince=0)
ars_GetListCharMenu(ctrl,changedsince=0)
ars_GetListEscalation(ctrl,schema=NULL,changedsince=0)
ars_GetListAdminExtension(ctrl, changedsince=0)
ars_Export(ctrl, displayTag, type, name)
displayTag is the particular view to export. If you pass in an empty string for this parameter, all views will be exported.
ars_simpleMenu(menu)
undef
Example:
@sm = ars_simpleMenu(ars_GetCharMenuItems($ctrl, $menu_name));
ars_padEntryid(ctrl, schema, entry_id)
{"userOrTime" => integer, "enumVal" => integer}
{"server" => string, "schema" => string, "qualifier" => reference to qualifier, "fieldId" => integer, or "statHistory" => reference to Status History Value}
{"fieldId" => integer, "assignment" => reference to Assign Struct}
{"displayTag" => string, "label" => string, "labelLocation" => "Left" or "Top" "type" => "NONE" or "TEXT" or "NUMTEXT" or "CHECKBOX" or "CHOICE" or "BUTTON" "length" => integer, "numRows" => integer, "option" => "VISIBLE" or "HIDDEN" "x" => integer, "y" => integer}
(name : string, value : string)
{"macroParms" => array of references to Macro Parm Structure, "macroText" => string, "macroName" => string}
{"accessOption" => integer, "focus" => integer, ["display" => reference to Display Structure,] ["charMenu" => string,] "fieldId" => integer}
{"macro" => reference to Active Link Macro Structure, or "assign_fields" => reference to Field Assign Structure, or "process" => string, or "message" => string, or "characteristics" => Field Characteristics, or "dde" => not implemented, or "none" => undef}
"Message"
is formatted as:
This is the text
You can parse this with a regular expression.
{"fieldId" => integer, "columnWidth" => integer, "separator" => string}
{["unique" => 1,] "fieldIds" => reference to a list of integers (internal ids)}
; integer {"min" => integer, "max" => integer} or ; real {"min" => float, "max" => float, "precision" => integer} or ; char {"maxLength" => integer, "menuStyle" => "append" or "overwrite", "match" => "anywhere" or "leading" or "equal", "charMenu" => string, "pattern" => string, "fullTextOptions" => "none" or "indexed"} or ; diary {"fullTextOptions" => "none" or "indexed"} or ; enum and bitmask array of strings or undef
{"none" => undef, or "value" => reference to Value Structure, or "field" => reference to Assign Field Structure, or "process" => string, or "arith" => reference to Arith Op Assign Structure, or "function" => reference to Function Assign Structure, or "dde" => not implemented}
(function : string, parameter...)
{"oper" => "+" or "-" or "*" or "/" or "%", "left" => reference to Assign Structure, ["right" => reference to Assign Structure]}