[Arsperl-devel] ARSperl/example List_Entries.pl,1.1,1.2
Brought to you by:
jeffmurphy
From: Michiel B. <mb...@us...> - 2009-04-14 12:55:57
|
Update of /cvsroot/arsperl/ARSperl/example In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18547 Modified Files: List_Entries.pl Log Message: Updated to work with version 5 and newer servers Index: List_Entries.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/example/List_Entries.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** List_Entries.pl 21 Nov 1996 20:13:54 -0000 1.1 --- List_Entries.pl 14 Apr 2009 12:55:54 -0000 1.2 *************** *** 7,18 **** # # DESCRIPTION ! # Log onto the server and printout a listing of Entry IDs and # Short Description (for each ID) for the given schema. ! # # NOTES # "Short Description" is *not* (neccessarily) the contents of the # "short-description" field. It is, in fact, the contents of the ! # "Query List Fields" for this schema. Try it on a schema that ! # you have some custom "Query List Fields" defined for to see # what we mean. # --- 7,18 ---- # # DESCRIPTION ! # Log onto the server and printout a listing of Entry IDs and # Short Description (for each ID) for the given schema. ! # # NOTES # "Short Description" is *not* (neccessarily) the contents of the # "short-description" field. It is, in fact, the contents of the ! # "Query List Fields" for this schema. Try it on a schema that ! # you have some custom "Query List Fields" defined for to see # what we mean. # *************** *** 23,26 **** --- 23,29 ---- # # $Log$ + # Revision 1.2 2009/04/14 12:55:54 mbeijen + # Updated to work with version 5 and newer servers + # # Revision 1.1 1996/11/21 20:13:54 jcmurphy # Initial revision *************** *** 29,37 **** use ARS; # Parse command line parameters ! ($server, $username, $password, $schema) = @ARGV; ! if(!defined($schema)) { print "usage: $0 [server] [username] [password] [schema]\n"; exit 1; --- 32,41 ---- use ARS; + use strict; # Parse command line parameters ! my ( $server, $username, $password, $schema ) = @ARGV; ! if ( !defined($schema) ) { print "usage: $0 [server] [username] [password] [schema]\n"; exit 1; *************** *** 40,59 **** # Log onto the ars server specified ! ($ctrl = ars_Login($server, $username, $password)) || ! die "can't login to the server"; # Load the qualifier structure with a dummy qualifier. ! ($qual = ars_LoadQualifier($ctrl,$schema,"(1 = 1)")) || ! die "error in ars_LoadQualifier"; # Retrieve all of the entry-id's for the schema. ! %entries = ars_GetListEntry($ctrl, $schema, $qual, 0); ! printf("%-15s %-60s\n", "Entry-ID", "Short Description"); ! foreach $entry_id (sort keys %entries) { ! printf("%-15s %-60s\n", $entry_id, $entries{$entry_id}); } --- 44,63 ---- # 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} ); } |