arsperl-devel Mailing List for ARSperl (Page 2)
Brought to you by:
jeffmurphy
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(48) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(10) |
Oct
|
Nov
(4) |
Dec
(2) |
2007 |
Jan
|
Feb
(5) |
Mar
(8) |
Apr
(2) |
May
|
Jun
|
Jul
(18) |
Aug
(22) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(5) |
Dec
|
2009 |
Jan
(1) |
Feb
|
Mar
(14) |
Apr
(26) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Michiel B. <mi...@be...> - 2009-04-01 16:45:59
|
If you can wait a few more days, tomorrow I want to have finished updating the documentation and examples. Regards, Michiel Beijen Software Consultant +31 6 457 42 418 Bee Free IT + http://beefreeit.nl On Apr 1, 2009 5:02 PM, "Thilo Stapff" <thi...@ap...> wrote: Well, that is pretty much what I found out too. To summarize my results: - we can get rid of "artypes.ph" - it would be too much hassle to remove "_h2ph_pre.ph" - but at least "_h2ph_pre.ph" can be moved to the "ARS/" subdirectory where it won't bother anyone. The next check-in will be up on SourceForge very soon. Thilo jeff murphy wrote: > > On Apr 1, 2009, at 3:58 AM, Thilo Stapff wrote: >>> >> >> Are you sure? On... > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > ______________... |
From: jeff m. <jcm...@je...> - 2009-04-01 15:18:12
|
On Apr 1, 2009, at 11:15 AM, Thilo Stapff wrote: > That was only a guess before I implemented it. As it turned out, the > users won't have to make any code changes. > Hurray! :-) |
From: Thilo S. <thi...@ap...> - 2009-04-01 15:16:10
|
That was only a guess before I implemented it. As it turned out, the users won't have to make any code changes. Thilo jeff murphy wrote: > Make sure the user affecting changes are documented. If people need to > change code (as you've said they will) let them know (in the changes > file) exactly what they need to do and what error they will receive if > they don't make the changes. > > thanks > > jeff > > > > On Apr 1, 2009, at 11:04 AM, Thilo Stapff wrote: > >> Update of /cvsroot/arsperl/ARSperl/ARS >> In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10690/ARS >> >> Added Files: >> OOform.pm OOmsgs.pm OOsup.pm nparm.pm >> Log Message: > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Arsperl-devel mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-devel |
From: jeff m. <jcm...@je...> - 2009-04-01 15:08:09
|
Make sure the user affecting changes are documented. If people need to change code (as you've said they will) let them know (in the changes file) exactly what they need to do and what error they will receive if they don't make the changes. thanks jeff On Apr 1, 2009, at 11:04 AM, Thilo Stapff wrote: > Update of /cvsroot/arsperl/ARSperl/ARS > In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10690/ARS > > Added Files: > OOform.pm OOmsgs.pm OOsup.pm nparm.pm > Log Message: |
From: Thilo S. <ts...@us...> - 2009-04-01 15:05:02
|
Update of /cvsroot/arsperl/ARSperl In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10690 Modified Files: ARS.pm ARS.xs MANIFEST Makefile.PL StructDef.pl changes.dat supportrev_generated.c supportrev_generated.h Removed Files: ARSOOform.pm ARSOOmsgs.pm ARSOOsup.pm ARSnparm.pm Log Message: directory reorganization/cleanup Index: changes.dat =================================================================== RCS file: /cvsroot/arsperl/ARSperl/changes.dat,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** changes.dat 31 Mar 2009 17:41:17 -0000 1.63 --- changes.dat 1 Apr 2009 15:04:50 -0000 1.64 *************** *** 1,3 **** --- 1,4 ---- released=xx/xx/xxx version=1.92 + TS package directory reorganization/cleanup TS additional ars_Login parameters by Conny Martin TS implemented ars_GetList/Get/Create/Set/DeleteImage Index: ARS.xs =================================================================== RCS file: /cvsroot/arsperl/ARSperl/ARS.xs,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** ARS.xs 1 Apr 2009 12:29:29 -0000 1.123 --- ARS.xs 1 Apr 2009 15:04:50 -0000 1.124 *************** *** 2325,2328 **** --- 2325,2329 ---- (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED, "ars_GetImage() is only available in ARS >= 7.5"); + XSRETURN_UNDEF; #endif } *************** *** 3096,3099 **** --- 3097,3101 ---- (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED, "ars_DeleteImage() is only available in ARS >= 7.5"); + XSRETURN_UNDEF; #endif } *************** *** 6592,6595 **** --- 6594,6598 ---- (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED, "ars_CreateImage() is only available in ARS >= 7.5"); + XSRETURN_UNDEF; #endif } *************** *** 6702,6705 **** --- 6705,6709 ---- (void) ARError_add( AR_RETURN_ERROR, AP_ERR_DEPRECATED, "ars_SetImage() is only available in ARS >= 7.5"); + XSRETURN_UNDEF; #endif } Index: Makefile.PL =================================================================== RCS file: /cvsroot/arsperl/ARSperl/Makefile.PL,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Makefile.PL 6 Jan 2009 19:21:46 -0000 1.82 --- Makefile.PL 1 Apr 2009 15:04:50 -0000 1.83 *************** *** 124,130 **** $ARS_STATIC_LIB = ""; ! $PM = {}; ! foreach my $pm2install (qw{ARSarerrno-h.pm ARSar-h.pm ARSnparm.pm ARSnterrno-h.pm ARSnt-h.pm ARSOOform.pm ARSOOmsgs.pm ARSOOsup.pm ARS.pm}) { ! $PM->{$pm2install} = '$(INST_LIBDIR)/'.$pm2install; } --- 124,130 ---- $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; } *************** *** 138,142 **** $ARS_LIBS = " -lar -larencrypt -lnsl " if $ENCRYPT; } ! $PM->{'artypes.ph'} = '$(INST_LIBDIR)/artypes.ph' if $ARSVERSION >= 6.3; if ($GNU_WIN) { $ARS_LIBS = join(' ', map { "$ARSAPI/lib/" . $_ } @{$ra_arlibs}); --- 138,142 ---- $ARS_LIBS = " -lar -larencrypt -lnsl " if $ENCRYPT; } ! #$PM->{'ARS/artypes.ph'} = '$(INST_LIBDIR)/ARS/artypes.ph' if $ARSVERSION >= 6.3; if ($GNU_WIN) { $ARS_LIBS = join(' ', map { "$ARSAPI/lib/" . $_ } @{$ra_arlibs}); *************** *** 203,221 **** print "Converting C header files to perl modules ..\n"; ! foreach ("ar", "arerrno", "nt", "nterrno") { 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, "> artypes.ph") || die "open: $!"; ! print FD "\# hackaround for artypes.h. do not remove.\n1;\n"; ! close(FD); ! next; ! } # arsystem <= 6.0.3 doesnt have artypes.h --- 203,224 ---- 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: $!"; ! # print FD "\# hackaround for artypes.h. do not remove.\n1;\n"; ! # close(FD); ! # next; ! # } # arsystem <= 6.0.3 doesnt have artypes.h *************** *** 225,246 **** die "couldn't find $headerFile" if (! -e $headerFile); ! # due to the endless confusion over h2ph, i'm including ! # a known-good copy in the arsperl distribution. the ! # -d should make it create _h2ph_pre in the current ! # directory incase you never ran h2ph before (as root) if ($_ eq "artypes") { ! $rv = system("$Config{'perlpath'} infra/h2ph -d . < $headerFile > ${_}.ph"); } else { ! $rv = system("$Config{'perlpath'} infra/h2ph -d . < $headerFile > ARS${_}-h.pm"); } ! unlink ('_h2ph_pre.ph'); ! open (FD, "> _h2ph_pre.ph") || die "open: $!"; print FD "1;\n"; close(FD); ! if((! -e "ARS${_}-h.pm") || (-z "ARS${_}-h.pm")) { ! open (FD, "> ARS${_}-h.pm") || die "open: $!"; print FD "\# your perl installation was either missing the 'h2ph' \# utility or it was not in your path with you ran 'perl Makefile.PL' --- 228,249 ---- die "couldn't find $headerFile" if (! -e $headerFile); ! # # due to the endless confusion over h2ph, i'm including ! # # a known-good copy in the arsperl distribution. the ! # # -d should make it create _h2ph_pre in the current ! # # directory incase you never ran h2ph before (as root) if ($_ eq "artypes") { ! $rv = system("$Config{'perlpath'} infra/h2ph -d ./ARS < $headerFile > ARS/${_}.ph"); } else { ! $rv = system("$Config{'perlpath'} infra/h2ph -d ./ARS < $headerFile > ARS/${_}-h.pm"); } ! unlink ('ARS/_h2ph_pre.ph'); ! open (FD, "> ARS/_h2ph_pre.ph") || die "open: $!"; print FD "1;\n"; close(FD); ! if((! -e "ARS/${_}-h.pm") || (-z "ARS/${_}-h.pm")) { ! open (FD, "> ARS/${_}-h.pm") || die "open: $!"; print FD "\# your perl installation was either missing the 'h2ph' \# utility or it was not in your path with you ran 'perl Makefile.PL' *************** *** 256,260 **** print "\tAUTODEFINES = $AUTODEFINES\n"; ! $PM->{'_h2ph_pre.ph'} = '$(INST_LIBDIR)/_h2ph_pre.ph'; WriteMakefile( --- 259,263 ---- print "\tAUTODEFINES = $AUTODEFINES\n"; ! #$PM->{'ARS/_h2ph_pre.ph'} = '$(INST_LIBDIR)/ARS/_h2ph_pre.ph'; WriteMakefile( *************** *** 316,320 **** 'realclean' => { ! 'FILES' => 'support.h ARSar-h.pm ARSarerrno-h.pm ARSnt-h.pm ARSnterrno-h.pm t/config.cache serverTypeInfoHints.h *~ .purify *-h.pm _h2ph_pre.ph artypes.ph ' } ); --- 319,323 ---- 'realclean' => { ! 'FILES' => 'support.h ARS/ar-h.pm ARS/arerrno-h.pm ARS/_h2ph_pre.ph t/config.cache serverTypeInfoHints.h *~ .purify ' } ); Index: ARS.pm =================================================================== RCS file: /cvsroot/arsperl/ARSperl/ARS.pm,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** ARS.pm 31 Mar 2009 17:41:16 -0000 1.76 --- ARS.pm 1 Apr 2009 15:04:49 -0000 1.77 *************** *** 65,76 **** use Config; ! require 'ARSar-h.pm'; ! require 'ARSarerrno-h.pm'; ! require 'ARSnt-h.pm'; ! require 'ARSnterrno-h.pm'; ! require 'ARSnparm.pm'; ! require 'ARSOOform.pm'; ! require 'ARSOOmsgs.pm'; ! require 'ARSOOsup.pm'; @ARS::ISA = qw(Exporter DynaLoader); --- 65,71 ---- use Config; ! require 'ARS/ar-h.pm'; ! require 'ARS/arerrno-h.pm'; ! require 'ARS/nparm.pm'; @ARS::ISA = qw(Exporter DynaLoader); *************** *** 224,227 **** --- 219,230 ---- + sub new { + require 'ARS/OOform.pm'; + require 'ARS/OOmsgs.pm'; + require 'ARS/OOsup.pm'; + return newObject( @_ ); + } + + # ROUTINE # ars_simpleMenu(menuItems, prepend) Index: StructDef.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/StructDef.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StructDef.pl 1 Apr 2009 12:29:34 -0000 1.6 --- StructDef.pl 1 Apr 2009 15:04:50 -0000 1.7 *************** *** 1922,1925 **** --- 1922,1926 ---- ARMultiSchemaNestedQueryStruct => { + _min_version => '7.5.0', queryFromList => { _type => 'ARMultiSchemaQueryFromList', *************** *** 1936,1939 **** --- 1937,1941 ---- }, ARMultiSchemaRecursiveQueryStruct => { + _min_version => '7.5.0', recursiveSchemaAlias => { _type => 'ARNameType', *************** *** 2093,2096 **** --- 2095,2099 ---- ARMultiSchemaCurrencyPartStruct => { + _min_version => '7.5.0', fieldId => { _type => 'ARMultiSchemaFieldIdStruct', *************** *** 2107,2110 **** --- 2110,2114 ---- }, ARMultiSchemaFieldIdStruct => { + _min_version => '7.5.0', queryFromAlias => { _type => 'ARNameType', *************** *** 2117,2120 **** --- 2121,2125 ---- }, ARMultiSchemaArithOpStruct => { + _min_version => '7.5.0', operation => { _type => 'unsigned int', *************** *** 2131,2134 **** --- 2136,2140 ---- }, ARMultiSchemaValueSetQueryStruct => { + _min_version => '7.5.0', queryFromList => { _type => 'ARMultiSchemaQueryFromList', *************** *** 2145,2148 **** --- 2151,2155 ---- }, ARMultiSchemaStatHistoryValue => { + _min_version => '7.5.0', queryFromAlias => { _type => 'ARNameType', *************** *** 2159,2162 **** --- 2166,2170 ---- }, ARMultiSchemaFieldIdList => { + _min_version => '7.5.0', _num => 'p->numItems', _list => 'p->listPtr', Index: MANIFEST =================================================================== RCS file: /cvsroot/arsperl/ARSperl/MANIFEST,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** MANIFEST 15 May 2008 18:30:00 -0000 1.34 --- MANIFEST 1 Apr 2009 15:04:50 -0000 1.35 *************** *** 3,9 **** ARS.xs ARS/CodeTemplate.pm ! ARSOOmsgs.pm ! ARSOOsup.pm ! ARSnparm.pm Artistic CHANGES --- 3,9 ---- ARS.xs ARS/CodeTemplate.pm ! ARS/OOmsgs.pm ! ARS/OOsup.pm ! ARS/nparm.pm Artistic CHANGES Index: supportrev_generated.c =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev_generated.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** supportrev_generated.c 1 Apr 2009 12:29:34 -0000 1.7 --- supportrev_generated.c 1 Apr 2009 15:04:50 -0000 1.8 *************** *** 8894,8898 **** ! int rev_ARMultiSchemaArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaArithOpStruct *p ){ --- 8894,8898 ---- ! #if AR_CURRENT_API_VERSION >= 14 int rev_ARMultiSchemaArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaArithOpStruct *p ){ *************** *** 8989,8996 **** return 0; } ! ! int rev_ARMultiSchemaCurrencyPartStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaCurrencyPartStruct *p ){ --- 8989,8996 ---- return 0; } + #endif ! #if AR_CURRENT_API_VERSION >= 14 int rev_ARMultiSchemaCurrencyPartStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaCurrencyPartStruct *p ){ *************** *** 9087,9094 **** return 0; } ! ! int rev_ARMultiSchemaFieldIdList( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdList *p ){ --- 9087,9094 ---- return 0; } + #endif ! #if AR_CURRENT_API_VERSION >= 14 int rev_ARMultiSchemaFieldIdList( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdList *p ){ *************** *** 9162,9169 **** return 0; } ! ! int rev_ARMultiSchemaFieldIdStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdStruct *p ){ --- 9162,9169 ---- return 0; } + #endif ! #if AR_CURRENT_API_VERSION >= 14 int rev_ARMultiSchemaFieldIdStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdStruct *p ){ *************** *** 9245,9249 **** return 0; } ! --- 9245,9249 ---- return 0; } ! #endif *************** *** 9601,9605 **** ! int rev_ARMultiSchemaNestedQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaNestedQueryStruct *p ){ --- 9601,9605 ---- ! #if AR_CURRENT_API_VERSION >= 14 int rev_ARMultiSchemaNestedQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaNestedQueryStruct *p ){ *************** *** 9696,9700 **** return 0; } ! --- 9696,9700 ---- return 0; } ! #endif *************** *** 10331,10335 **** ! int rev_ARMultiSchemaRecursiveQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaRecursiveQueryStruct *p ){ --- 10331,10335 ---- ! #if AR_CURRENT_API_VERSION >= 14 int rev_ARMultiSchemaRecursiveQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaRecursiveQueryStruct *p ){ *************** *** 10471,10475 **** return 0; } ! --- 10471,10475 ---- return 0; } ! #endif *************** *** 10608,10612 **** ! int rev_ARMultiSchemaStatHistoryValue( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaStatHistoryValue *p ){ --- 10608,10612 ---- ! #if AR_CURRENT_API_VERSION >= 14 int rev_ARMultiSchemaStatHistoryValue( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaStatHistoryValue *p ){ *************** *** 10703,10710 **** return 0; } ! ! int rev_ARMultiSchemaValueSetQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaValueSetQueryStruct *p ){ --- 10703,10710 ---- return 0; } + #endif ! #if AR_CURRENT_API_VERSION >= 14 int rev_ARMultiSchemaValueSetQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaValueSetQueryStruct *p ){ *************** *** 10801,10805 **** return 0; } ! --- 10801,10805 ---- return 0; } ! #endif --- ARSOOsup.pm DELETED --- --- ARSnparm.pm DELETED --- Index: supportrev_generated.h =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev_generated.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** supportrev_generated.h 1 Apr 2009 12:29:35 -0000 1.6 --- supportrev_generated.h 1 Apr 2009 15:04:50 -0000 1.7 *************** *** 245,266 **** ! EXTERN int rev_ARMultiSchemaArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaArithOpStruct *p ); ! ! EXTERN int rev_ARMultiSchemaCurrencyPartStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaCurrencyPartStruct *p ); ! ! EXTERN int rev_ARMultiSchemaFieldIdList( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdList *p ); ! ! EXTERN int rev_ARMultiSchemaFieldIdStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdStruct *p ); ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaFieldValueOrArithStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldValueOrArithStruct *p ); #endif ! EXTERN int rev_ARMultiSchemaNestedQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaNestedQueryStruct *p ); ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaQualifierStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaQualifierStruct *p ); --- 245,266 ---- ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaArithOpStruct *p ); ! #endif ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaCurrencyPartStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaCurrencyPartStruct *p ); ! #endif ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaFieldIdList( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdList *p ); ! #endif ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaFieldIdStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdStruct *p ); ! #endif #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaFieldValueOrArithStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldValueOrArithStruct *p ); #endif ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaNestedQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaNestedQueryStruct *p ); ! #endif #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaQualifierStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaQualifierStruct *p ); *************** *** 272,287 **** EXTERN int rev_ARMultiSchemaQueryFromStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaQueryFromStruct *p ); #endif ! EXTERN int rev_ARMultiSchemaRecursiveQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaRecursiveQueryStruct *p ); ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaRelOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaRelOpStruct *p ); #endif ! EXTERN int rev_ARMultiSchemaStatHistoryValue( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaStatHistoryValue *p ); ! ! EXTERN int rev_ARMultiSchemaValueSetQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaValueSetQueryStruct *p ); ! EXTERN int rev_ARNameList( ARControlStruct *ctrl, HV *h, char *k, ARNameList *p ); --- 272,287 ---- EXTERN int rev_ARMultiSchemaQueryFromStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaQueryFromStruct *p ); #endif ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaRecursiveQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaRecursiveQueryStruct *p ); ! #endif #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaRelOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaRelOpStruct *p ); #endif ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaStatHistoryValue( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaStatHistoryValue *p ); ! #endif ! #if AR_CURRENT_API_VERSION >= 14 EXTERN int rev_ARMultiSchemaValueSetQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaValueSetQueryStruct *p ); ! #endif EXTERN int rev_ARNameList( ARControlStruct *ctrl, HV *h, char *k, ARNameList *p ); --- ARSOOmsgs.pm DELETED --- --- ARSOOform.pm DELETED --- |
From: Thilo S. <ts...@us...> - 2009-04-01 15:04:58
|
Update of /cvsroot/arsperl/ARSperl/ARS In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10690/ARS Added Files: OOform.pm OOmsgs.pm OOsup.pm nparm.pm Log Message: directory reorganization/cleanup --- NEW FILE: OOsup.pm --- # # ARSperl - An ARS v2-v4 / Perl5 Integration Kit # # Copyright (C) 1995-1999 Joel Murphy, jm...@ac... # Jeff Murphy, jcm...@ac... # # This program is free software; you can redistribute it and/or modify # it under the terms as Perl itself. # # Refer to the file called "Artistic" that accompanies the source distribution # 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): # See URL above. # # Object Oriented Hoopla sub newObject { my ($class, @p) = (shift, @_); my ($self) = {}; 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)" ); } $self->{'.catch'} = $catch if (defined($catch)); # if we've received a ctrl parameter, then we'll used that # and ignore the other three parameters. in addition, we'll # leave it upto the user to call ars_Logoff() since they must've # called ars_Login() in order to pass us the ctrl parameter. # this allows the user to mix-and-match OO and non-OO ARS module # routines with greater ease. if(defined($ctrl)) { 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'}; } sub print { my $this = shift; my($cacheId, $operationTime, $user, $password, $lang, $server) = ars_GetControlStructFields($this->{'ctrl'}); print "connection object details:\n"; print "\tcacheId = $cacheId\n"; print "\toperationTime = ".localtime($operationTime)."\n"; print "\tuser = $user\n"; print "\tpassword = $password\n"; print "\tserver = $server\n"; print "\tlang = $lang\n"; } sub availableSchemas { my $this = shift; my ($changedSince, $schemaType, $name) = rearrange([CHANGEDSINCE,SCHEMATYPE,NAME],@_); $changedSince = 0 unless defined($changedSince); $schemaType = ARS::AR_LIST_SCHEMA_ALL unless defined($schemaType); $name = "" unless defined($name); return ars_GetListSchema($this->{'ctrl'}, $changedSince, $schemaType, undef, $name); } sub openForm { my $this = shift; my($form, $vui) = rearrange([FORM,VUI], @_); $this->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: c->openForm(-form => name, -vui => vui)\nform parameter is required.") if(!defined($form) || ($form eq "")); $this->tryCatch(); return new ARS::form(-form => $form, -vui => $vui, -connection => $this); } 1; --- NEW FILE: OOmsgs.pm --- # # ARSperl - An ARS v2-v4 / Perl5 Integration Kit # # Copyright (C) 1995-1999 Joel Murphy, jm...@ac... # Jeff Murphy, jcm...@ac... # # This program is free software; you can redistribute it and/or modify # it under the terms as Perl itself. # # Refer to the file called "Artistic" that accompanies the source distribution # 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): # See URL above. # sub internalDie { my ($this, $msg, $trace) = (shift, shift, shift); $msg = "[no message available]" unless (defined($msg) && ($msg ne "")); $trace = "[no traceback available]" unless (defined($trace) && ($trace ne "")); die "$msg\n\nTRACEBACK:\n\n$trace\n"; } sub internalWarn { my ($this, $msg, $trace) = (shift, shift, shift); $msg = "[no message available]" unless (defined($msg) && ($msg ne "")); $trace = "[no traceback available]" unless (defined($trace) && ($trace ne "")); warn "$msg\n\nTRACEBACK:\n\n$trace\n"; } # 81000 = Usage Errors # 81001 = Field Name Not In VUI # 81002 = Invalid Field ID # 81003 = Unknown Field Data Type # 81004 = Unable to Xlate Enum Value # 81005 = misspelled/invalid parameter # .catch is a hash ref sub initCatch { my $this = shift; $this->setCatch(&ARS::AR_RETURN_WARNING => "internalWarn"); $this->setCatch(&ARS::AR_RETURN_ERROR => "internalDie"); $this->setCatch(&ARS::AR_RETURN_FATAL => "internalDie"); } sub setCatch { my $this = shift; my $type = shift; my $func = shift; $this->{'.catch'}->{$type} = $func; } # this routine is periodically called to see if any exceptions # have occurred. if they have, and an exception handler is specified, # we will call the handler and pass it the exception. sub tryCatch { my $this = shift; if(defined($this->{'.catch'}) && ref($this->{'.catch'}) eq "HASH") { foreach (&ARS::AR_RETURN_WARNING, &ARS::AR_RETURN_ERROR, &ARS::AR_RETURN_FATAL) { if(defined($this->{'.catch'}->{$_}) && $this->hasMessageType($_)) { 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 { my $this = shift; return $this->hasMessageType(&ARS::AR_RETURN_ERROR); } sub hasWarnings { my $this = shift; return $this->hasMessageType(&ARS::AR_RETURN_WARNING); } 1; --- NEW FILE: nparm.pm --- # # ARSperl - An ARS v2-v4 / Perl5 Integration Kit # # Copyright (C) 1995-1999 Joel Murphy, jm...@ac... # Jeff Murphy, jcm...@ac... # # This program is free software; you can redistribute it and/or modify # it under the terms as Perl itself. # # Refer to the file called "Artistic" that accompanies the source distribution # 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): # See URL above. # # the following two routines # make_attributes() # rearrange() # were borrowed from the CGI module. these routines implement # named parameters. # (http://stein.cshl.org/WWW/software/CGI/cgi_docs.html) # Copyright 1995-1997 Lincoln D. Stein. All rights reserved. sub make_attributes { my($attr) = @_; return () unless $attr && ref($attr) && ref($attr) eq 'HASH'; my(@att); foreach (keys %{$attr}) { #print "attr=$_\n"; my($key) = $_; $key=~s/^\-//; # get rid of initial - if present $key=~tr/a-z_/A-Z-/; # parameters are upper case, use dashes push(@att,$attr->{$_} ne '' ? qq/$key="$attr->{$_}"/ : qq/$key/); } return @att; } # rearrange(order, params) # order will be an array reference (might contain other array refs) # that lists the order we want the params returned in. # # param is the actual params, probably as (-key, value) pairs. sub rearrange { my($order,@param) = @_; return () unless @param; my($param, @possibilities); foreach (@$order) { if(ref($_) && (ref($_) eq "ARRAY")) { foreach my $P (@{$_}) { push @possibilities, $P; } } else { push @possibilities, $_; } } #print "possibilities=".join(',', @possibilities)."\n"; unless (ref($param[0]) eq 'HASH') { return @param unless (defined($param[0]) && substr($param[0],0,1) eq '-'); $param = {@param}; # convert into associative array } else { $param = $param[0]; } my($key)=''; foreach (keys %{$param}) { my $old = $_; s/^\-//; # get rid of initial - if present tr/a-z/A-Z/; # parameters are upper case next if $_ eq $old; $param->{$_} = $param->{$old}; delete $param->{$old}; } # scan the keys in param and make sure they are valid. foreach my $key (keys %$param) { #print "validating: $key\n"; my (@t) = grep(/^$key$/, @possibilities); Carp::confess( "invalid named parameter \"$key\"" ) if $#t == -1; } my(@return_array); foreach $key (@$order) { #print "key=$key\n"; my($value); # this is an awful hack to fix spurious warnings when the # -w switch is set. if (ref($key) && ref($key) eq 'ARRAY') { foreach (@$key) { last if defined($value); $value = $param->{$_}; delete $param->{$_}; } } else { $value = $param->{$key}; delete $param->{$key}; } push(@return_array,$value); } push (@return_array,make_attributes($param)) if %{$param}; return (@return_array); } 1; --- NEW FILE: OOform.pm --- # # ARSperl - An ARS v2-v4 / Perl5 Integration Kit # # Copyright (C) 1995-1999 Joel Murphy, jm...@ac... # Jeff Murphy, jcm...@ac... # # This program is free software; you can redistribute it and/or modify # it under the terms as Perl itself. # # Refer to the file called "Artistic" that accompanies the source distribution # 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): # See URL above. # package ARS::form; require Carp; # new ARS::form(-form => name, -vui => view, -connection => connection) sub new { my ($class, $self) = (shift, {}); my ($b) = bless($self, $class); my ($form, $vui, $connection) = ARS::rearrange([FORM,VUI,CONNECTION],@_); $connection->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: new ARS::form(-form => name, -vui => vui, -connection => connection)\nform and connection parameters are required." ) if(!defined($form) || !defined($connection)); $vui = "Default Admin View" unless defined $vui; $self->{'form'} = $form; $self->{'connection'} = $connection; $self->{'vui'} = $vui; my %f = ARS::ars_GetFieldTable($connection->{'ctrl'}, $form); $connection->tryCatch(); $self->{'fields'} = \%f; my %rev = reverse %f; # convenient $self->{'fields_rev'} = \%rev; my(%t, %enums); foreach (keys %f) { print "caching field: $_\n" if $self->{'connection'}->{'.debug'}; my $fv = ARS::ars_GetField($self->{'connection'}->{'ctrl'}, $self->{'form'}, $f{$_}); $connection->tryCatch(); $t{$_} = $fv->{'dataType'}; print "\tdatatype: $t{$_}\n" if $self->{'connection'}->{'.debug'}; if ($fv->{'dataType'} eq "enum") { if (ref($fv->{'limit'}->{'enumLimits'}) eq "ARRAY") { my $i = 0; $enums{$_} = { map { $i++, $_ } @{$fv->{'limit'}->{'enumLimits'}} }; } elsif (exists $fv->{'limit'}->{'enumLimits'}->{'regularList'}) { my $i = 0; $enums{$_} = { map { $i++, $_ } @{$fv->{'limit'}->{'enumLimits'}->{'regularList'}} }; } else { $enums{$_} = { map { $_->{itemNumber}, $_->{itemName} } @{$fv->{'limit'}->{'enumLimits'}->{customList}} }; } } } $self->{'fieldtypes'} = \%t; $self->{'fieldEnumValues'} = \%enums; return $b; } sub DESTROY { } # getEnumValues(-field => "fieldname") sub getEnumValues { my ($this) = shift; my ($field) = ARS::rearrange([FIELD], @_); if(ref($this->{'fieldEnumValues'}->{$field}) eq "ARRAY") { return @{$this->{'fieldEnumValues'}->{$field}}; } $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81006, "field $field is not an enumeration field."); $this->{'connection'}->tryCatch(); return undef; } # query(-query => "qualifier", -maxhits => 100, -firstretrieve => 0) sub query { my ($this) = shift; my ($query, $maxhits, $firstretr) = ARS::rearrange([QUERY,MAXHITS,FIRSTRETRIEVE], @_); $query = "(1 = 1)" unless defined($query); $maxhits = 0 unless defined($maxhits); $firstretr = 0 unless defined($firstretr); if($this->{'connection'}->{'.debug'}) { print "form->query(".$this->{'form'}.", $query, ".$this->{'vui'}.")\n"; } $this->{'qualifier'} = ARS::ars_LoadQualifier($this->{'connection'}->{'ctrl'}, $this->{'form'}, $query, $this->{'vui'}); $this->{'connection'}->tryCatch(); my @sortOrder = (); if(defined($this->{'sortOrder'}) && ref($this->{'sortOrder'}) eq "ARRAY") { @sortOrder = @{$this->{'sortOrder'}}; } my @matches = ARS::ars_GetListEntry($this->{'connection'}->{'ctrl'}, $this->{'form'}, $this->{'qualifier'}, $maxhits, $firstretr, @sortOrder); my(@mids, @mdescs); for(my $i = 0; $i <= $#matches ; $i += 2) { push @mids, $matches[$i]; push @mdescs, $matches[$i+1]; } $this->{'matches'} = \@mids; $this->{'querylist'} = \@mdescs; return @mids; } # getFieldID(-field => name) sub getFieldID { my $this = shift; my ($name) = ARS::rearrange([FIELD], @_); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->getFieldID(-field => name)\nname parameter is required.") unless defined($name); if(!defined($this->{'fields'}->{$name})) { $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81001, "field '$name' not in view: ".$this->{'vui'}."\n" ); } return $this->{'fields'}->{$name} if(defined($name)); } # getFieldName(-id => id) sub getFieldName { my $this = shift; my ($id) = ARS::rearrange([ID], @_); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->getFieldName(-id => id)\nid parameter required." ) unless defined($id); return $this->{'fields_rev'}->{$id} if defined($this->{'fields_rev'}->{$id}); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81002, "field id '$id' not available on form: ".$this->{'form'}."" ); } # getFieldType(-field => name, -id => id) sub getFieldType { my $this = shift; my ($name, $id) = ARS::rearrange([FIELD,ID], @_); if(!defined($name) && !defined($id)) { $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->getFieldType(-field => name, -id => id)\none of the parameters must be specified."); } if(defined($name) && !defined($this->{'fieldtypes'}->{$name})) { $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81001, "field '$name' not in view: ".$this->{'vui'}."\n" ); } #print "getFieldType($name, $id)\n" if $this->{'connection'}->{'.debug'}; return $this->{'fieldtypes'}->{$name} if defined($name); # they didnt give us a name, but instead gave us an id. look up the # name and return the type. if(defined($id)) { my $n = $this->getFieldName(-id => $id); return $this->{'fieldtypes'}->{$n}; } $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81003, "couldn't determine dataType for field."); } # delete(-entry => id) sub delete { my $this = shift; my ($id) = ARS::rearrange([ENTRY],@_); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->delete(-entry => id)\nentry parameter is required.") unless defined($id); my (@d); # allow the user to delete multiple entries in one shot if(ref($id) eq "ARRAY") { @d = @{$id}; } else { push @d, $id; } foreach (@d) { ARS::ars_DeleteEntry($this->{'connection'}->{'ctrl'}, $this->{'form'}, $_); $this->{'connection'}->tryCatch(); } } # merge(-type => mergeType, -values => { field1 => value1, ... }) sub merge { my ($this) = shift; my ($type, $vals) = ARS::rearrange([TYPE,[VALUE,VALUES]],@_); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->merge(-type => mergeType, -values => { field1 => value1, ... })\ntype and values parameters are required.") unless(defined($type) && defined($vals)); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->merge(-type => mergeType, -values => { field1 => value1, ... })\nvalues parameter must be HASH ref.") unless ref($vals) eq "HASH"; my (%realmap); # as we work thru each value, we need to perform translations for # enum fields. foreach (keys %{$vals}) { my ($rv) = $this->value2internal(-field => $_, -value => $vals->{$_}); #print "[form->merge] realval for $_ = $rv\n"; $realmap{$this->getFieldID($_)} = $rv; } print "merge/type=$type\n" if $this->{'connection'}->{'.debug'}; my ($rv) = ARS::ars_MergeEntry($this->{'connection'}->{'ctrl'}, $this->{'form'}, $type, %realmap); $this->{'connection'}->tryCatch(); # if ($rv is "") and there are no FATAL or ERRORs and # an entry id was in our vals realmap hash, then this was # a successful "OVERWRITE" or "MERGE" operation. lets return # the entry-id. if $rv is no "", then whatever operation this # was - it was successful. if it's "" and we had no entry-id # specified - or we did have one specified and there are FATALs # or ERRORs then something is wrong. complicated, but that's how # the C API works. we try to make the OO layer a little nicer for # the end user. if(($rv eq "") && defined($realmap{1})) { if(!$this->{'connection'}->hasFatals() && !$this->{'connection'}->hasErrors()) { $rv = $realmap{1}; } } return $rv; } # set(-entry => id, -gettime => tstamp, -values => { field1 => value1, ... }) sub set { my ($this) = shift; my ($entry,$gettime,$vals) = ARS::rearrange([ENTRY,GETTIME,[VALUE,VALUES]],@_); $gettime = 0 unless defined($gettime); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->set(-entry => id, -gettime => tstamp, -values => { field1 => value1, ... })\nentry and values parameters are required." ) unless (defined($vals) && defined($entry)); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->set(-entry => id, -values => { field1 => value1, ... })\nvalues parameter must be HASH ref.") unless ref($vals) eq "HASH"; my (%realmap); # as we work thru each value, we need to perform translations for # enum fields. foreach (keys %{$vals}) { my ($rv) = $this->value2internal(-field => $_, -value => $vals->{$_}); #print "realval for $_ = $rv\n"; $realmap{$this->getFieldID($_)} = $rv; } my ($rv) = ARS::ars_SetEntry($this->{'connection'}->{'ctrl'}, $this->{'form'}, $entry, $gettime, %realmap); $this->{'connection'}->tryCatch(); return $rv; } # value2internal(-field => name, -value => value) sub value2internal { my ($this) = shift; my ($f, $v) = ARS::rearrange([FIELD,VALUE], @_); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->value2internal(-field => name, -value => value)\nfield parameter is required.") unless (defined($f)); return $v unless defined $v; my ($t) = $this->getFieldType($f); print "value2internal($f, $v) type=$t\n" if $this->{'connection'}->{'.debug'}; # translate an text value into an enumeration number if this # field is an enumeration field and we havent been passed a number # to begin with. if(($t eq "enum") && ($v !~ /^\d+$/)) { if(!defined($this->{'fieldEnumValues'}->{$f})) { $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81004, "[1] unable to translate enumeration value for field '$f'"); } foreach (keys %{$this->{'fieldEnumValues'}->{$f}}) { return $_ if $this->{'fieldEnumValues'}->{$f}->{$_} eq $v; } $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81004, "[2] unable to translate enumeration value for field '$f'"); } # we don't need translation.. return $v; } # internal2value(-field => name, -id => id, -value => value) sub internal2value { my ($this) = shift; my ($f, $id, $v) = ARS::rearrange([FIELD,ID,VALUE], @_); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->internal2value(-field => name, -id => id, -value => value)\nid or field parameter are required.") unless (defined($f) || defined($id)); $f = $this->getFieldName(-id => $id) unless defined($f); my ($t) = $this->getFieldType($f); print "internal2value($f, $v) type=$t\n" if $this->{'connection'}->{'.debug'}; # translate an enumeration value into a text value if($t eq "enum") { # if the field doesnt exist in our cache, or if the # enumeration value exceeds the known list of enumerations, # barf. return undef unless defined $v; if(!defined($this->{'fieldEnumValues'}->{$f}) || (!exists($this->{'fieldEnumValues'}->{$f}->{$v})) ) { $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81004, "[1] unable to translate enumeration value for field '$f'" ); } return $this->{'fieldEnumValues'}->{$f}->{$v} } # we don't need translation.. return $v; } # create(-values => { field1 => value1, ... }) sub create { my ($this) = shift; my ($vals) = ARS::rearrange([[VALUES,VALUE]],@_); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->create(-values => { field1 => value1, ... })\nvalues parameter is required.") unless defined($vals); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->create(-values => { field1 => value1, ... })\nvalues parameter must be HASH ref.") unless ref($vals) eq "HASH"; my (%realmap); print "Mapping field information.\n" if $self->{'connection'}->{'.debug'}; foreach (keys %{$vals}) { my ($rv) = $this->value2internal(-field => $_, -value => $vals->{$_}); #print "realval for $_ = $rv\n"; $realmap{$this->getFieldID($_)} = $rv; } print "calling ars_CreateEntry..\n" if $self->{'connection'}->{'.debug'}; my ($id) = ARS::ars_CreateEntry($this->{'connection'}->{'ctrl'}, $this->{'form'}, %realmap); print "calling tryCatch()..\n" if $self->{'connection'}->{'.debug'}; $this->{'connection'}->tryCatch(); return $id; } # get(-entry => entryid, -fields => [ field1, field2 ]) sub get { my $this = shift; my ($eid, $fields) = ARS::rearrange([ENTRY,[FIELD,FIELDS]],@_); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->get(-entry => entryid, -fields => [ field1, field2, ... ])\nentry parameter is required.") unless defined($eid); my (@fieldlist) = (); my ($allfields) = 1; if(defined($fields)) { $allfields = 0; foreach (@{$fields}) { push @fieldlist, $this->getFieldID($_); } } # what we want to do is: retrieve all of the values, but for # certain datatypes (attachments) we want to insert # an object instead of the field value. for enum types, # we want to decode the value. #print "("; print $this->{'form'}; print ", $eid, @fieldlist)\n"; my @v; if($allfields == 0) { @v = ARS::ars_GetEntry($this->{'connection'}->{'ctrl'}, $this->{'form'}, $eid, @fieldlist); } else { @v = ARS::ars_GetEntry($this->{'connection'}->{'ctrl'}, $this->{'form'}, $eid); } my @rv; for(my $i = 0 ; $i <= $#v ; $i += 2) { if($this->getFieldType(-id => $v[$i]) eq "attach") { push @rv, $v[$i+1]; # "attach"; } elsif($this->getFieldType(-id => $v[$i]) eq "enum") { push @rv, $this->internal2value(-id => $v[$i], -value => $v[$i+1]); } else { push @rv, $v[$i+1]; } } return @rv unless ($#rv == 0); return $rv[0]; } # getAsHash(-entry => entryid, -fields => [field1, field2, ...]) sub getAsHash { my $this = shift; my ($eid, $fields) = ARS::rearrange([ENTRY,[FIELD,FIELDS]],@_); $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: form->getAsHash(-entry => entryid, -fields => [ field1, field2, ... ])\nentry parameter is required.") unless defined($eid); my (@fieldlist) = (); my ($allfields) = 1; if(defined($fields)) { $allfields = 0; foreach (@{$fields}) { push @fieldlist, $this->getFieldID($_); } } my @v; if($allfields == 0) { @v = ARS::ars_GetEntry($this->{'connection'}->{'ctrl'}, $this->{'form'}, $eid, @fieldlist); } else { @v = ARS::ars_GetEntry($this->{'connection'}->{'ctrl'}, $this->{'form'}, $eid); } for(my $i = 0 ; $i <= $#v ; $i += 2) { if($this->getFieldType(-id => $v[$i]) eq "attach") { #$v[$i+1] = "attach"; } elsif($this->getFieldType(-id => $v[$i]) eq "enum") { $v[$i+1] = $this->internal2value(-id => $v[$i], -value => $v[$i+1]); } $v[$i] = $this->getFieldName(-id => $v[$i]); } return @v; } # getAttachment(-entry => eid, -field => fieldname, -file => filename) # if file isnt specified, the attachment is returned "in core" sub getAttachment { my $this = shift; my ($eid, $field, $file) = ARS::rearrange([ENTRY,FIELD,FILE],@_); if(!defined($eid) && !defined($field)) { $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: getAttachment(-entry => eid, -field => fieldname, -file => filename)\nentry and field parameters are required."); } if(defined($file)) { my $rv = ARS::ars_GetEntryBLOB($this->{'connection'}->{'ctrl'}, $this->{'form'}, $eid, $this->getFieldID($field), ARS::AR_LOC_FILENAME, $file); $this->{'connection'}->tryCatch(); return $rv; } return ARS::ars_GetEntryBLOB($this->{'connection'}->{'ctrl'}, $this->{'form'}, $eid, $this->getFieldID($field), ARS::AR_LOC_BUFFER); } #setSort(... ) sub setSort { my $this = shift; if(($#_+1) % 2 == 1){ $this->{'connection'}->pushMessage(&ARS::AR_RETURN_ERROR, 81000, "usage: setSort(...)\nMust have an even number of parameters. (nparm = $#_)"); } my (@t) = @_; for(my $i = 0 ; $i <= $#t ; $i+=2) { $t[$i] = $this->getFieldID($t[$i]); } $this->{'sortOrder'} = \@t; } 1; |
From: Thilo S. <thi...@ap...> - 2009-04-01 15:02:01
|
Well, that is pretty much what I found out too. To summarize my results: - we can get rid of "artypes.ph" - it would be too much hassle to remove "_h2ph_pre.ph" - but at least "_h2ph_pre.ph" can be moved to the "ARS/" subdirectory where it won't bother anyone. The next check-in will be up on SourceForge very soon. Thilo jeff murphy wrote: > > On Apr 1, 2009, at 3:58 AM, Thilo Stapff wrote: >>> >> >> Are you sure? On my system (Windows XP), "_h2ph_pre.ph" and "artypes.ph" >> are almost empty. They contain only the statement "1;" so that they can >> be successfully loaded. The ARS::AR_XXXX_YYYYY constants are defined in >> ARSar-h.pm (which is also generated by Makefile.PL). Are things >> generated differently on Unix systems? >> > > > Ah. I think the memory is coming back to me now... :-) > > > # due to the endless confusion over h2ph, i'm including > # a known-good copy in the arsperl distribution. the > # -d should make it create _h2ph_pre in the current > # directory incase you never ran h2ph before (as root) > > There might even be something in the mail archives about this. > > When you run h2ph, it'll create _h2ph_pre in the current dir. I then > delete that file and replace it with the "1;" file because (I'm > assuming) there must have been issues with parsing that file in the > past. Instead of fiddling with the ARSar-h.pm file to strip the > "require" at the top, I opt'd to replace the contents of _h2ph_pre with > a "1;" Most people install Perl and don't run h2ph, so that file > (_h2ph_pre) tends not to exist on systems until they install ARSperl > (which runs h2ph for them). > > Basically, my sense is that we can't get rid of that file at this point. > However, if you want to re-examine the h2ph process to see if _h2ph_pre > can be removed, feel free. You'll need to test it on Windows and at > least one Unix for the cases: > > 1. h2ph was already executed > 2. h2ph has never been executed > > > jeff > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Arsperl-devel mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-devel |
From: jeff m. <jcm...@je...> - 2009-04-01 14:43:18
|
On Apr 1, 2009, at 3:58 AM, Thilo Stapff wrote: >> > > Are you sure? On my system (Windows XP), "_h2ph_pre.ph" and > "artypes.ph" > are almost empty. They contain only the statement "1;" so that they > can > be successfully loaded. The ARS::AR_XXXX_YYYYY constants are defined > in > ARSar-h.pm (which is also generated by Makefile.PL). Are things > generated differently on Unix systems? > Ah. I think the memory is coming back to me now... :-) # due to the endless confusion over h2ph, i'm including # a known-good copy in the arsperl distribution. the # -d should make it create _h2ph_pre in the current # directory incase you never ran h2ph before (as root) There might even be something in the mail archives about this. When you run h2ph, it'll create _h2ph_pre in the current dir. I then delete that file and replace it with the "1;" file because (I'm assuming) there must have been issues with parsing that file in the past. Instead of fiddling with the ARSar-h.pm file to strip the "require" at the top, I opt'd to replace the contents of _h2ph_pre with a "1;" Most people install Perl and don't run h2ph, so that file (_h2ph_pre) tends not to exist on systems until they install ARSperl (which runs h2ph for them). Basically, my sense is that we can't get rid of that file at this point. However, if you want to re-examine the h2ph process to see if _h2ph_pre can be removed, feel free. You'll need to test it on Windows and at least one Unix for the cases: 1. h2ph was already executed 2. h2ph has never been executed jeff |
From: Thilo S. <thi...@ap...> - 2009-04-01 13:28:38
|
> > The "ARS::AR_SORT_ASCENDING" business comes from those files. Those > files are supposedly to be generated by Makefile.PL during the build > process. The intention is to give people mnemonic access to header > constants without having them rely on "ars_export(..., 1 | 2 | 8 | > 4096)" messiness. > In Makefile.PL, the empty artypes.ph is generated from a block with the following condition: if( ($ARSVERSION >= 5.0) && /^nt/ ) { ..... To me it looks like artypes.ph ceased to be relevant with the introduction of ARS 5.0, when the NT API functions where disposed. Since we don't support the 4.X API anymore, artypes.ph can probably be removed, as well as ARSnt-h.pm and ARSnterrno-h.pm. Thilo |
From: Thilo S. <ts...@us...> - 2009-04-01 13:16:04
|
Update of /cvsroot/arsperl/ARSperl In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24060 Modified Files: ARS.xs StructDef.pl supportrev_generated.c supportrev_generated.h Log Message: ars_GetListEntryWithMultiSchemaFields (first attempt) Index: supportrev_generated.c =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev_generated.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** supportrev_generated.c 31 Mar 2009 17:41:18 -0000 1.6 --- supportrev_generated.c 1 Apr 2009 12:29:34 -0000 1.7 *************** *** 8896,8899 **** --- 8896,10809 ---- int + rev_ARMultiSchemaArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaArithOpStruct *p ){ + SV **val; + int i = 0; + + if( !p ){ + ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaArithOpStruct: AR Object param is NULL" ); + return -1; [...1885 lines suppressed...] + } + }else{ + ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARMultiSchemaValueSetQueryStruct: key doesn't exist"); + ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, k ); + return -2; + } + }else{ + ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARMultiSchemaValueSetQueryStruct: first argument is not a hash"); + return -1; + } + + return 0; + } + + + + + int rev_ARNameList( ARControlStruct *ctrl, HV *h, char *k, ARNameList *p ){ SV **val; Index: supportrev_generated.h =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev_generated.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** supportrev_generated.h 31 Mar 2009 17:41:18 -0000 1.5 --- supportrev_generated.h 1 Apr 2009 12:29:35 -0000 1.6 *************** *** 246,249 **** --- 246,288 ---- + EXTERN int rev_ARMultiSchemaArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaArithOpStruct *p ); + + + EXTERN int rev_ARMultiSchemaCurrencyPartStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaCurrencyPartStruct *p ); + + + EXTERN int rev_ARMultiSchemaFieldIdList( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdList *p ); + + + EXTERN int rev_ARMultiSchemaFieldIdStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldIdStruct *p ); + + #if AR_CURRENT_API_VERSION >= 14 + EXTERN int rev_ARMultiSchemaFieldValueOrArithStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaFieldValueOrArithStruct *p ); + #endif + + EXTERN int rev_ARMultiSchemaNestedQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaNestedQueryStruct *p ); + + #if AR_CURRENT_API_VERSION >= 14 + EXTERN int rev_ARMultiSchemaQualifierStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaQualifierStruct *p ); + #endif + #if AR_CURRENT_API_VERSION >= 14 + EXTERN int rev_ARMultiSchemaQueryFromList( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaQueryFromList *p ); + #endif + #if AR_CURRENT_API_VERSION >= 14 + EXTERN int rev_ARMultiSchemaQueryFromStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaQueryFromStruct *p ); + #endif + + EXTERN int rev_ARMultiSchemaRecursiveQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaRecursiveQueryStruct *p ); + + #if AR_CURRENT_API_VERSION >= 14 + EXTERN int rev_ARMultiSchemaRelOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaRelOpStruct *p ); + #endif + + EXTERN int rev_ARMultiSchemaStatHistoryValue( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaStatHistoryValue *p ); + + + EXTERN int rev_ARMultiSchemaValueSetQueryStruct( ARControlStruct *ctrl, HV *h, char *k, ARMultiSchemaValueSetQueryStruct *p ); + + EXTERN int rev_ARNameList( ARControlStruct *ctrl, HV *h, char *k, ARNameList *p ); Index: ARS.xs =================================================================== RCS file: /cvsroot/arsperl/ARSperl/ARS.xs,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** ARS.xs 31 Mar 2009 17:41:17 -0000 1.122 --- ARS.xs 1 Apr 2009 12:29:29 -0000 1.123 *************** *** 6559,6563 **** * image. */ ! if(rv == 0) { ret = ARCreateImage( ctrl, name, &imageBuf, --- 6559,6563 ---- * image. */ ! if( rv == 0 ){ ret = ARCreateImage( ctrl, name, &imageBuf, *************** *** 6569,6574 **** if(!ARError( ret, status)) RETVAL = 1; ! } else ARError_add( AR_RETURN_ERROR, AP_ERR_PREREVFAIL); } if (helpText) { --- 6569,6575 ---- if(!ARError( ret, status)) RETVAL = 1; ! }else{ ARError_add( AR_RETURN_ERROR, AP_ERR_PREREVFAIL); + } } if (helpText) { *************** *** 6667,6671 **** * image. */ ! if(rv == 0) { ret = ARSetImage( ctrl, name, newNamePtr, --- 6668,6672 ---- * image. */ ! if( rv == 0 ){ ret = ARSetImage( ctrl, name, newNamePtr, *************** *** 6678,6683 **** if(!ARError( ret, status)) RETVAL = 1; ! } else ! ARError_add( AR_RETURN_ERROR, AP_ERR_PREREVFAIL); } if (helpText) { --- 6679,6685 ---- if(!ARError( ret, status)) RETVAL = 1; ! }else{ ! ARError_add( AR_RETURN_ERROR, AP_ERR_PREREVFAIL); ! } } if (helpText) { *************** *** 7049,7083 **** void ars_GetListEntryWithMultiSchemaFields(ctrl,schema,qualifier,maxRetrieve=0,firstRetrieve=0,...) ! ARControlStruct * ctrl ! char * schema ! ARQualifierStruct * qualifier ! unsigned int firstRetrieve ! unsigned int maxRetrieve PPCODE: { ARStatusList status; ! #if AR_CURRENT_API_VERSION >= 99999 ! unsigned int c = (items - 5) / 2, i; ! int field_off = 5; ! ARMultiSchemaQueryFromList queryFromList, ! ARMultiSchemaFieldIdList getListFields, *getList = NULL; ! ARMultiSchemaQualifierStruct qualifierStruct, ARMultiSchemaSortList sortList; ARMultiSchemaFieldValueListList entryFieldValueList; ! int ret = 0; ! AV *getListFields_array; (void) ARError_reset(); Zero(&queryFromList, 1, ARMultiSchemaQueryFromList); - Zero(&getListFields, 1, ARMultiSchemaFieldIdList); Zero(&qualifierStruct, 1, ARMultiSchemaQualifierStruct); Zero(&sortList, 1, ARMultiSchemaSortList); Zero(&entryFieldValueList, 1, ARMultiSchemaFieldValueListList); Zero(&status, 1, ARStatusList); ! sortList.sortList = NULL; getListFields.fieldsList = NULL; ! entryFieldValueList.entryList = NULL; ! if ((items - 5) % 2) { /* odd number of arguments, so argument after maxRetrieve is optional getListFields (an array of hash refs) */ --- 7051,7096 ---- void ars_GetListEntryWithMultiSchemaFields(ctrl,schema,qualifier,maxRetrieve=0,firstRetrieve=0,...) ! ARControlStruct * ctrl ! SV * schema ! SV * qualifier ! unsigned int firstRetrieve ! unsigned int maxRetrieve PPCODE: { ARStatusList status; ! #if AR_CURRENT_API_VERSION >= 14 ! unsigned int c = (items - 5) / 2, i; ! int field_off = 5; ! ARMultiSchemaQueryFromList queryFromList; ! ARMultiSchemaQualifierStruct qualifierStruct; ! ARMultiSchemaFieldIdList getListFields; ARMultiSchemaSortList sortList; ARMultiSchemaFieldValueListList entryFieldValueList; ! int ret = 0, rv = 0; ! AV *getListFields_array; ! HV *hDummy; ! ! printf( "\n\n!!!! ars_GetListEntryWithMultiSchemaFields(): experimental implementation, not really working yet !!!!\n\n" ); (void) ARError_reset(); Zero(&queryFromList, 1, ARMultiSchemaQueryFromList); Zero(&qualifierStruct, 1, ARMultiSchemaQualifierStruct); + Zero(&getListFields, 1, ARMultiSchemaFieldIdList); Zero(&sortList, 1, ARMultiSchemaSortList); Zero(&entryFieldValueList, 1, ARMultiSchemaFieldValueListList); Zero(&status, 1, ARStatusList); ! hDummy = newHV(); ! hv_store( hDummy, "queryFromList", 13, newSVsv(schema), 0 ); ! hv_store( hDummy, "qualifierStruct", 15, newSVsv(qualifier), 0 ); ! rv += rev_ARMultiSchemaQueryFromList( ctrl, hDummy, "queryFromList", &queryFromList ); ! rv += rev_ARMultiSchemaQualifierStruct( ctrl, hDummy, "qualifierStruct", &qualifierStruct ); ! hv_undef( hDummy ); ! ! /* sortList.sortList = NULL; getListFields.fieldsList = NULL; ! entryFieldValueList.entryList = NULL; */ ! #ifdef XXX_DUMMY_FIELDLIST ! if( (items - 5) % 2 ){ /* odd number of arguments, so argument after maxRetrieve is optional getListFields (an array of hash refs) */ *************** *** 7085,7088 **** --- 7098,7103 ---- (getListFields_array = (AV *)SvRV(ST(field_off))) && (SvTYPE(getListFields_array) == SVt_PVAV) ) { + + getList = &getListFields; getListFields.numItems = av_len(getListFields_array) + 1; *************** *** 7091,7098 **** getListFields.fieldsList = MALLOCNN( sizeof(AREntryListFieldStruct) * getListFields.numItems ); /* set query field list */ ! for (i=0; i<getListFields.numItems; i++) { SV **array_entry; /* get fieldID from array */ ! if (! (array_entry = av_fetch(getListFields_array, i, 0))) { (void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_LFLDS); goto getlistentry_end; --- 7106,7113 ---- getListFields.fieldsList = MALLOCNN( sizeof(AREntryListFieldStruct) * getListFields.numItems ); /* set query field list */ ! for( i = 0; i<getListFields.numItems; i++ ){ SV **array_entry; /* get fieldID from array */ ! if( ! (array_entry = av_fetch(getListFields_array, i, 0)) ){ (void) ARError_add( AR_RETURN_ERROR, AP_ERR_BAD_LFLDS); goto getlistentry_end; *************** *** 7106,7110 **** getListFields.fieldsList[i].separator) ); } ! } else { (void) ARError_add( AR_RETURN_ERROR, AP_ERR_LFLDS_TYPE); goto getlistentry_end; --- 7121,7125 ---- getListFields.fieldsList[i].separator) ); } ! }else{ (void) ARError_add( AR_RETURN_ERROR, AP_ERR_LFLDS_TYPE); goto getlistentry_end; *************** *** 7113,7116 **** --- 7128,7133 ---- field_off ++; } + #endif + #ifdef XXX_DUMMY_SORTLIST /* build sortList */ sortList.numItems = c; *************** *** 7121,7127 **** sortList.sortList[i].sortOrder = SvIV(ST(i*2+field_off+1)); } ret = ARGetListEntryWithMultiSchemaFields( ctrl, &queryFromList, ! getList, &qualifierStruct, &sortList, --- 7138,7151 ---- sortList.sortList[i].sortOrder = SvIV(ST(i*2+field_off+1)); } + #endif + + if( rv != 0 ){ + ARError_add( AR_RETURN_ERROR, AP_ERR_PREREVFAIL ); + goto getlistentry_multischema_end; + } + ret = ARGetListEntryWithMultiSchemaFields( ctrl, &queryFromList, ! &getListFields, &qualifierStruct, &sortList, *************** *** 7135,7176 **** ((ars_ctrl *)ctrl)->queries++; #endif ! if (ARError( ret, status)) { ! goto getlistentry_end; } ! for (i=0; i < entryFieldValueList.numItems; i++) { HV * fieldValue_hash = newHV(); unsigned int field; ! char intstr[12]; ! if (entryFieldValueList.entryList[i].entryId.numItems == 1) { ! /* only one entryId -- so just return its value to be compatible ! with ars 2 */ ! XPUSHs(sv_2mortal(newSVpv(entryFieldValueList.entryList[i].entryId.entryIdList[0], 0))); ! } else { ! /* more than one entry -- this must be a join schema. merge ! * the list into a single entry-id to keep things ! * consistent. */ ! unsigned int entry; ! char *joinId = (char *)NULL; ! char joinSep[2] = {AR_ENTRY_ID_SEPARATOR, 0}; ! for (entry=0; entry < entryFieldValueList.entryList[i].entryId.numItems; entry++) { ! joinId = strappend(joinId, entryFieldValueList.entryList[i].entryId.entryIdList[entry]); ! if(entry < entryFieldValueList.entryList[i].entryId.numItems-1) ! joinId = strappend(joinId, joinSep); ! } ! XPUSHs(sv_2mortal(newSVpv(joinId, 0))); ! } ! for (field=0; field < entryFieldValueList.entryList[i].entryValues->numItems; field++) { ! sprintf(intstr,"%ld",entryFieldValueList.entryList[i].entryValues->fieldValueList[field].fieldId); hv_store( fieldValue_hash, ! intstr, strlen(intstr), ! perl_ARValueStruct(ctrl,&entryFieldValueList.entryList[i].entryValues->fieldValueList[field].value), ! 0 ); } XPUSHs( sv_2mortal( newRV_noinc((SV *)fieldValue_hash) ) ); } ! getlistentry_end: ! FreeAREntryListFieldValueList( &entryFieldValueList,FALSE ); ! FreeARSortList( &sortList, FALSE ); ! FreeAREntryListFieldList( &getListFields, FALSE ); #else /* prior to ARS 7.5 */ (void) ARError_reset(); --- 7159,7184 ---- ((ars_ctrl *)ctrl)->queries++; #endif ! if( ARError( ret, status) ){ ! goto getlistentry_multischema_end; } ! for( i = 0; i < entryFieldValueList.numItems; ++i ){ HV * fieldValue_hash = newHV(); unsigned int field; ! char keyStr[AR_MAX_NAME_SIZE + 12 + 1]; ! ! for( field = 0; field < entryFieldValueList.listPtr[i].numItems; ++field ){ ! ARMultiSchemaFieldValueStruct *valPtr = &(entryFieldValueList.listPtr[i].listPtr[field]); ! sprintf( keyStr, "%s|%ld", valPtr->fieldId.queryFromAlias, valPtr->fieldId.fieldId ); hv_store( fieldValue_hash, ! keyStr, strlen(keyStr), ! perl_ARValueStruct( ctrl, &(valPtr->value) ), ! 0 ); } XPUSHs( sv_2mortal( newRV_noinc((SV *)fieldValue_hash) ) ); } ! getlistentry_multischema_end: ! FreeARMultiSchemaFieldIdList( &getListFields, FALSE ); ! FreeARMultiSchemaSortList( &sortList, FALSE ); ! FreeARMultiSchemaFieldValueListList( &entryFieldValueList, FALSE ); #else /* prior to ARS 7.5 */ (void) ARError_reset(); Index: StructDef.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/StructDef.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StructDef.pl 31 Mar 2009 17:41:17 -0000 1.5 --- StructDef.pl 1 Apr 2009 12:29:34 -0000 1.6 *************** *** 2,12 **** %CURRENT_API_VERSION = ( ! '4.5.1' => '7', ! '4.5.2' => '7', ! '5.0.0' => '8', ! '5.0.1' => '8', ! '5.1.0' => '9', ! '5.1.1' => '9', ! '5.1.2' => '9', '6.0.0' => '10', '6.0.1' => '10', --- 2,12 ---- %CURRENT_API_VERSION = ( ! '4.5.1' => '7', ! '4.5.2' => '7', ! '5.0.0' => '8', ! '5.0.1' => '8', ! '5.1.0' => '9', ! '5.1.1' => '9', ! '5.1.2' => '9', '6.0.0' => '10', '6.0.1' => '10', *************** *** 15,18 **** --- 15,19 ---- '7.0.1' => '12', '7.1.0' => '13', + '7.5.0' => '14', ); *************** *** 1876,1879 **** --- 1877,2168 ---- + ARMultiSchemaQueryFromList => { + _min_version => '7.5.0', + _num => 'p->numItems', + _list => 'p->listPtr', + _type => 'ARMultiSchemaQueryFromStruct', + }, + ARMultiSchemaQueryFromStruct => { + _min_version => '7.5.0', + _switch => 'p->type', + queryFromAlias => { + _type => 'ARNameType', + _data => 'p->queryFromAlias', + }, + joinType => { + _type => 'unsigned int', + _data => 'p->joinType', + }, + joinQual => { + _type => 'ARMultiSchemaQualifierStruct*', + _data => 'p->joinQual', + }, + _switch => 'p->type', + _case => { + AR_MULTI_SCHEMA_SCHEMA_NAME => { + schemaName => { + _type => 'ARNameType', + _data => 'p->u.schemaName', + }, + }, + AR_MULTI_SCHEMA_NESTED_QUERY => { + nestedQuery => { + _type => 'ARMultiSchemaNestedQueryStruct*', + _data => 'p->u.nestedQuery', + }, + }, + AR_MULTI_SCHEMA_RECURSIVE_QUERY => { + recursiveQuery => { + _type => 'ARMultiSchemaRecursiveQueryStruct*', + _data => 'p->u.recursiveQuery', + }, + }, + }, + }, + + ARMultiSchemaNestedQueryStruct => { + queryFromList => { + _type => 'ARMultiSchemaQueryFromList', + _data => 'p->queryFromList', + }, + getListFields => { + _type => 'ARMultiSchemaFieldIdList', + _data => 'p->getListFields', + }, + qualifier => { + _type => 'ARMultiSchemaQualifierStruct*', + _data => 'p->qualifier', + }, + }, + ARMultiSchemaRecursiveQueryStruct => { + recursiveSchemaAlias => { + _type => 'ARNameType', + _data => 'p->recursiveSchemaAlias', + }, + queryFromList => { + _type => 'ARMultiSchemaQueryFromList', + _data => 'p->queryFromList', + }, + getListFields => { + _type => 'ARMultiSchemaFieldIdList', + _data => 'p->getListFields', + }, + startQual => { + _type => 'ARMultiSchemaQualifierStruct*', + _data => 'p->startQual', + }, + recursionQual => { + _type => 'ARMultiSchemaQualifierStruct*', + _data => 'p->recursionQual', + }, + levelsToRetrieve => { + _type => 'int', + _data => 'p->levelsToRetrieve', + }, + }, + ARMultiSchemaQualifierStruct => { + _min_version => '7.5.0', + _switch => 'p->operation', + _map => [ 'oper', { + AR_COND_OP_AND => 'and', + AR_COND_OP_OR => 'or', + AR_COND_OP_NOT => 'not', + AR_COND_OP_REL_OP => 'rel_op', + AR_COND_OP_FROM_FIELD => 'external', + } ], + _case => { + AR_COND_OP_NONE => { + _default => 1, + }, + AR_COND_OP_AND => { + left => { + _type => 'ARMultiSchemaQualifierStruct*', + _data => 'p->u.andor.operandLeft', + }, + right => { + _type => 'ARMultiSchemaQualifierStruct*', + _data => 'p->u.andor.operandRight', + }, + }, + AR_COND_OP_OR => { + left => { + _type => 'ARMultiSchemaQualifierStruct*', + _data => 'p->u.andor.operandLeft', + }, + right => { + _type => 'ARMultiSchemaQualifierStruct*', + _data => 'p->u.andor.operandRight', + }, + }, + AR_COND_OP_NOT => { + 'not' => { + _type => 'ARMultiSchemaQualifierStruct*', + _data => 'p->u.notQual', + }, + }, + AR_COND_OP_REL_OP => { + rel_op => { + _type => 'ARMultiSchemaRelOpStruct*', + _data => 'p->u.relOp', + }, + }, + AR_COND_OP_FROM_FIELD => { + fieldId => { + _type => 'ARMultiSchemaFieldIdStruct', + _data => 'p->u.fieldId', + }, + }, + }, + }, + + ARMultiSchemaRelOpStruct => { + _min_version => '7.5.0', + oper => { + _type => 'unsigned int', + _data => 'p->operation', + _map => { + AR_REL_OP_EQUAL => '==', + AR_REL_OP_GREATER => '>', + AR_REL_OP_GREATER_EQUAL => '>=', + AR_REL_OP_LESS => '<', + AR_REL_OP_LESS_EQUAL => '<=', + AR_REL_OP_NOT_EQUAL => '!=', + AR_REL_OP_LIKE => 'like', + AR_REL_OP_IN => 'in', + }, + }, + left => { + _type => 'ARMultiSchemaFieldValueOrArithStruct', + _data => 'p->operandLeft', + }, + right => { + _type => 'ARMultiSchemaFieldValueOrArithStruct', + _data => 'p->operandRight', + }, + }, + + ARMultiSchemaFieldValueOrArithStruct => { + _min_version => '7.5.0', + _switch => 'p->tag', + _case => { + AR_FIELD => { + fieldId => { + _type => 'ARMultiSchemaFieldIdStruct', + _data => 'p->u.fieldId', + }, + }, + AR_VALUE => { + value => { + _type => 'ARValueStruct', + _data => 'p->u.value', + }, + }, + AR_ARITHMETIC => { + arith => { + _type => 'ARMultiSchemaArithOpStruct*', + _data => 'p->u.arithOp', + }, + }, + AR_STAT_HISTORY => { + statHistory => { + _type => 'ARMultiSchemaStatHistoryValue', + _data => 'p->u.statHistory', + }, + }, + AR_VALUE_SET => { + valueSet => { + _type => 'ARValueList', + _data => 'p->u.valueSet', + }, + }, + AR_CURRENCY_FLD => { + _min_version => '5.1.0', + currencyField => { + _type => 'ARMultiSchemaCurrencyPartStruct*', + _data => 'p->u.currencyField', + }, + }, + AR_VALUE_SET_QUERY => { + queryValue => { + _type => 'ARMultiSchemaValueSetQueryStruct*', + _data => 'p->u.valueSetQuery', + }, + }, + }, + }, + + ARMultiSchemaCurrencyPartStruct => { + fieldId => { + _type => 'ARMultiSchemaFieldIdStruct', + _data => 'p->fieldId', + }, + partTag => { + _type => 'unsigned int', + _data => 'p->partTag', + }, + currencyCode => { + _type => 'ARCurrencyCodeType', + _data => 'p->currencyCode', + }, + }, + ARMultiSchemaFieldIdStruct => { + queryFromAlias => { + _type => 'ARNameType', + _data => 'p->queryFromAlias', + }, + fieldId => { + _type => 'ARInternalId', + _data => 'p->fieldId', + }, + }, + ARMultiSchemaArithOpStruct => { + operation => { + _type => 'unsigned int', + _data => 'p->operation', + }, + operandLeft => { + _type => 'ARMultiSchemaFieldValueOrArithStruct', + _data => 'p->operandLeft', + }, + operandRight => { + _type => 'ARMultiSchemaFieldValueOrArithStruct', + _data => 'p->operandRight', + }, + }, + ARMultiSchemaValueSetQueryStruct => { + queryFromList => { + _type => 'ARMultiSchemaQueryFromList', + _data => 'p->queryFromList', + }, + fieldId => { + _type => 'ARMultiSchemaFieldIdStruct', + _data => 'p->fieldId', + }, + qualifier => { + _type => 'ARMultiSchemaQualifierStruct*', + _data => 'p->qualifier', + }, + }, + ARMultiSchemaStatHistoryValue => { + queryFromAlias => { + _type => 'ARNameType', + _data => 'p->queryFromAlias', + }, + enumVal => { + _type => 'unsigned long', + _data => 'p->enumVal', + }, + userOrTime => { + _type => 'unsigned int', + _data => 'p->userOrTime', + }, + }, + ARMultiSchemaFieldIdList => { + _num => 'p->numItems', + _list => 'p->listPtr', + _type => 'ARMultiSchemaFieldIdStruct', + }, + + #ARArchiveInfoStruct => { |
From: Thilo S. <thi...@ap...> - 2009-04-01 11:53:42
|
Georg Grabler wrote: > Hi, > > h2ph_pre.ph <http://h2ph_pre.ph> and artypes.ph <http://artypes.ph> look > the same on my linux workstation in between (1;, with a comment in > artypes.ph <http://artypes.ph> that you should not remove this hack :D). That's exactly the same as on my system. There's also the comment warning about removal, but I can see absolutely no reason *why* it shouldn't be removed. > It would be "cleaner" if you change to ARS.pm and ARS:: modules. I'm not > sure about the advantages you'd gain though, except that you have a > different package structure then. I don't think that you'll need > polymorphism, so you'll probably not gain an advantage out of this. Well, having a cleaner package structure *is* an advantage. Usually there are many other packages installed in "site/lib" and I would be a horrible mess if each of them just dumped a lot files directly into the main directory (one of them might even come with its own "_h2ph_pre.ph" where it would get really ugly). BTW, I think now that the package structure change can probably be implemented fully backwards compatible, without requiring any changes in user code. Regards, Thilo > > Kind regards, > Georg > > On Wed, Apr 1, 2009 at 9:58 AM, Thilo Stapff <thi...@ap... > <mailto:thi...@ap...>> wrote: > > > > > The "ARS::AR_SORT_ASCENDING" business comes from those files. Those > > files are supposedly to be generated by Makefile.PL during the build > > process. The intention is to give people mnemonic access to header > > constants without having them rely on "ars_export(..., 1 | 2 | 8 | > > 4096)" messiness. > > > > Are you sure? On my system (Windows XP), "_h2ph_pre.ph > <http://h2ph_pre.ph>" and "artypes.ph <http://artypes.ph>" > are almost empty. They contain only the statement "1;" so that they can > be successfully loaded. The ARS::AR_XXXX_YYYYY constants are defined in > ARSar-h.pm (which is also generated by Makefile.PL). Are things > generated differently on Unix systems? > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Arsperl-devel mailing list > Ars...@ar... <mailto:Ars...@ar...> > https://lists.sourceforge.net/lists/listinfo/arsperl-devel > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Arsperl-devel mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-devel |
From: Thilo S. <thi...@ap...> - 2009-04-01 11:34:01
|
Michiel, the set fields structure has changed from: 'assign_fields' => \@fieldAssignments, to: 'assign_fields' => { 'sampleSchema' => $sampleSchema, 'sampleServer' => $sampleServer, 'fieldList' => \@fieldAssignments, }, I implemented this change when Remedy introduced the "advanced" Workflow feature. Unfortunately it seems that forgot to record this in changes.dat, so I can't determine when the change occured, but I suspect that Show_ALink.pl is broken at least since 1.90. BTW, it also happens to break ARSdoc. If you search the ARSList for "arsdoc 1.29 array reference error", you'll find a thread about exactly this problem. Regards, Thilo Michiel Beijen wrote: > Thilo, > > I compiled your new changes on my PC with the 7.5 api. > > When I was testing out the example files I ran into an issue with > Show_ALink.pl when I ran it against an active link with a set fields > action, and I guess it is because the data structure returned by > ars_GetActiveLink is not OK: > > C:\ARSperl\example>perl Show_ALink.pl <server> <user> <pass> "GR-Insert NOT" > Active Link Attributes: > Name: GR-Insert NOT > Execution Order: 0 > schemaList : "Group" > Group Perms: 0; > Execute On: Button > Field: > Display List: > Qual Text: [none defined] > Actions: > Action 1: > Set Fields: > Not an ARRAY reference at Show_ALink.pl line 364. > > ** so I decided to use Data::Dumper to dump out the datastructure in > line 362: > if(defined($action->{assign_fields})) { > printl 2, "Set Fields:\n"; > use Data::Dumper; print Dumper({assign_fields}); > print Dumper(%{$action}); > #foreach $setFields (@{$action->{assign_fields}}) { > # printl 3, "fieldId: $setFields->{fieldId}\n"; > # ProcessSetFields($setFields->{assignment}); > #} > } > ** that resulted in the following: > > $VAR1 = 'assign_fields'; > $VAR2 = { > 'sampleSchema' => '', > 'sampleServer' => '', > 'fieldList' => [ > { > 'assignment' => { > 'arith' => { > 'left' => { > > 'field' > => { > 'qualifier' => bless( do{\(my $o = 25379692)}, > 'ARQualifierStructPtr' ), > 'noMatchOption' => 'error', > 'fieldId' => 121, > 'multiMatchOption' => 'picklist', > 'tag' => 1, > 'server' => '*', > 'schema' => '*' > } > }, > 'right' => { > > 'value' > => ' NOT ', > > 'valueT > ype' => 'char' > }, > 'oper' => '+' > } > }, > 'fieldId' => 121 > } > ] > }; > Help Text: > Owner: Demo > Last changed by: Demo > Last Modified: Tue Mar 17 22:05:13 2009 > Change Diary: > I guess you see the datastructure is not as it should be. Can you advise? > > Kind regards, > -- > Michiel Beijen > Software Consultant > +31 6 - 457 42 418 > Bee Free IT + http://beefreeit.nl > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Arsperl-devel mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-devel |
From: Michiel B. <mi...@be...> - 2009-04-01 10:00:29
|
Thilo, I compiled your new changes on my PC with the 7.5 api. When I was testing out the example files I ran into an issue with Show_ALink.pl when I ran it against an active link with a set fields action, and I guess it is because the data structure returned by ars_GetActiveLink is not OK: C:\ARSperl\example>perl Show_ALink.pl <server> <user> <pass> "GR-Insert NOT" Active Link Attributes: Name: GR-Insert NOT Execution Order: 0 schemaList : "Group" Group Perms: 0; Execute On: Button Field: Display List: Qual Text: [none defined] Actions: Action 1: Set Fields: Not an ARRAY reference at Show_ALink.pl line 364. ** so I decided to use Data::Dumper to dump out the datastructure in line 362: if(defined($action->{assign_fields})) { printl 2, "Set Fields:\n"; use Data::Dumper; print Dumper({assign_fields}); print Dumper(%{$action}); #foreach $setFields (@{$action->{assign_fields}}) { # printl 3, "fieldId: $setFields->{fieldId}\n"; # ProcessSetFields($setFields->{assignment}); #} } ** that resulted in the following: $VAR1 = 'assign_fields'; $VAR2 = { 'sampleSchema' => '', 'sampleServer' => '', 'fieldList' => [ { 'assignment' => { 'arith' => { 'left' => { 'field' => { 'qualifier' => bless( do{\(my $o = 25379692)}, 'ARQualifierStructPtr' ), 'noMatchOption' => 'error', 'fieldId' => 121, 'multiMatchOption' => 'picklist', 'tag' => 1, 'server' => '*', 'schema' => '*' } }, 'right' => { 'value' => ' NOT ', 'valueT ype' => 'char' }, 'oper' => '+' } }, 'fieldId' => 121 } ] }; Help Text: Owner: Demo Last changed by: Demo Last Modified: Tue Mar 17 22:05:13 2009 Change Diary: I guess you see the datastructure is not as it should be. Can you advise? Kind regards, -- Michiel Beijen Software Consultant +31 6 - 457 42 418 Bee Free IT + http://beefreeit.nl |
From: Georg G. <ggr...@gm...> - 2009-04-01 08:41:00
|
Hi, h2ph_pre.ph and artypes.ph look the same on my linux workstation in between (1;, with a comment in artypes.ph that you should not remove this hack :D). It would be "cleaner" if you change to ARS.pm and ARS:: modules. I'm not sure about the advantages you'd gain though, except that you have a different package structure then. I don't think that you'll need polymorphism, so you'll probably not gain an advantage out of this. Kind regards, Georg On Wed, Apr 1, 2009 at 9:58 AM, Thilo Stapff <thi...@ap...>wrote: > > > > The "ARS::AR_SORT_ASCENDING" business comes from those files. Those > > files are supposedly to be generated by Makefile.PL during the build > > process. The intention is to give people mnemonic access to header > > constants without having them rely on "ars_export(..., 1 | 2 | 8 | > > 4096)" messiness. > > > > Are you sure? On my system (Windows XP), "_h2ph_pre.ph" and "artypes.ph" > are almost empty. They contain only the statement "1;" so that they can > be successfully loaded. The ARS::AR_XXXX_YYYYY constants are defined in > ARSar-h.pm (which is also generated by Makefile.PL). Are things > generated differently on Unix systems? > > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Arsperl-devel mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-devel > |
From: Thilo S. <thi...@ap...> - 2009-04-01 07:58:26
|
> > The "ARS::AR_SORT_ASCENDING" business comes from those files. Those > files are supposedly to be generated by Makefile.PL during the build > process. The intention is to give people mnemonic access to header > constants without having them rely on "ars_export(..., 1 | 2 | 8 | > 4096)" messiness. > Are you sure? On my system (Windows XP), "_h2ph_pre.ph" and "artypes.ph" are almost empty. They contain only the statement "1;" so that they can be successfully loaded. The ARS::AR_XXXX_YYYYY constants are defined in ARSar-h.pm (which is also generated by Makefile.PL). Are things generated differently on Unix systems? |
From: jeff m. <jcm...@je...> - 2009-03-31 20:04:51
|
On Mar 31, 2009, at 3:52 PM, Thilo Stapff wrote: > Hi all, > > I'd like to make a reorganization to the directory structure of the > ARSperl package which might not be entirely backwards compatible, > especially concerning the OO-Modules, so I want to discuss it here > first. > > I've always regarded it as rather bad practice that ARSperl installs > sol > many files directly into the "site/lib" directory. In my opinion there > should only be ARS.pm and an "ARS/" subdirectory containing everything > else. So what I'd like to do is moving the following files to the > "ARS/" > subdirectory: > > ARSar-h.pm > ARSarerrno-h.pm > ARSnparm.pm > ARSnt-h.pm > ARSnterrno-h.pm > ARSOOform.pm > ARSOOmsgs.pm > ARSOOsup.pm > artypes.ph > _h2ph_pre.ph > > thereby changing the filenames to "ARS/ar-h.pm", "ARS/arerrno.pm" etc. > > I'll try to make this as backwards compatible as possible, which might > not be entirely feasible for the OO-Modules, so users might have to > change their code from "new ARS(...)" to something like "new > ARS::OO(...)". sounds OK to me, if the change is minimal to user code. > > Does anyone know what "_h2ph_pre.ph" and "artypes.ph" are about? They > are "require"d by most of the .pm modules, but only contain the code > "1;", which doesn't seem to make sense. I'd like to get rid of them > altogether unless there is a reason for their existence. > http://www.arsperl.org/manual/OO/form.html#setSort The "ARS::AR_SORT_ASCENDING" business comes from those files. Those files are supposedly to be generated by Makefile.PL during the build process. The intention is to give people mnemonic access to header constants without having them rely on "ars_export(..., 1 | 2 | 8 | 4096)" messiness. > > Regards, > Thilo > > > > > > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Arsperl-devel mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-devel |
From: Thilo S. <thi...@ap...> - 2009-03-31 19:53:09
|
Hi all, I'd like to make a reorganization to the directory structure of the ARSperl package which might not be entirely backwards compatible, especially concerning the OO-Modules, so I want to discuss it here first. I've always regarded it as rather bad practice that ARSperl installs sol many files directly into the "site/lib" directory. In my opinion there should only be ARS.pm and an "ARS/" subdirectory containing everything else. So what I'd like to do is moving the following files to the "ARS/" subdirectory: ARSar-h.pm ARSarerrno-h.pm ARSnparm.pm ARSnt-h.pm ARSnterrno-h.pm ARSOOform.pm ARSOOmsgs.pm ARSOOsup.pm artypes.ph _h2ph_pre.ph thereby changing the filenames to "ARS/ar-h.pm", "ARS/arerrno.pm" etc. I'll try to make this as backwards compatible as possible, which might not be entirely feasible for the OO-Modules, so users might have to change their code from "new ARS(...)" to something like "new ARS::OO(...)". Does anyone know what "_h2ph_pre.ph" and "artypes.ph" are about? They are "require"d by most of the .pm modules, but only contain the code "1;", which doesn't seem to make sense. I'd like to get rid of them altogether unless there is a reason for their existence. Regards, Thilo |
From: Thilo S. <ts...@us...> - 2009-03-31 17:41:30
|
Update of /cvsroot/arsperl/ARSperl In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19729 Modified Files: ARS.pm ARS.xs StructDef.pl changes.dat support-h.template support.c supportrev.c supportrev.h supportrev_generated.c supportrev_generated.h Log Message: arsystem 7.5 port, AR*Image functions Index: changes.dat =================================================================== RCS file: /cvsroot/arsperl/ARSperl/changes.dat,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** changes.dat 6 Jan 2009 19:21:46 -0000 1.62 --- changes.dat 31 Mar 2009 17:41:17 -0000 1.63 *************** *** 1,3 **** --- 1,7 ---- released=xx/xx/xxx version=1.92 + 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 key/value pair TS ars_GetFieldTable performance improvement by using ARGetMultipleFields Index: ARS.xs =================================================================== RCS file: /cvsroot/arsperl/ARSperl/ARS.xs,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** ARS.xs 6 Jan 2009 19:21:46 -0000 1.121 --- ARS.xs 31 Mar 2009 17:41:17 -0000 1.122 *************** *** 240,244 **** ARControlStruct * ! ars_Login(server, username, password, lang=NULL, authString=NULL, tcpport=0, rpcnumber=0) char * server char * username --- 240,244 ---- ARControlStruct * ! ars_Login(server, username, password, lang=NULL, authString=NULL, tcpport=0, rpcnumber=0, ...) char * server [...1236 lines suppressed...] *** 7332,7335 **** --- 7863,7880 ---- } + + char * + field_cache_key(ctrl) + ARControlStruct * ctrl + CODE: + { + char server_tag[100]; + sprintf( server_tag, "%s:%p", ctrl->server, ctrl ); + RETVAL = server_tag; + } + OUTPUT: + RETVAL + + MODULE = ARS PACKAGE = ARQualifierStructPtr Index: ARS.pm =================================================================== RCS file: /cvsroot/arsperl/ARSperl/ARS.pm,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** ARS.pm 3 Nov 2008 17:08:18 -0000 1.75 --- ARS.pm 31 Mar 2009 17:41:16 -0000 1.76 *************** *** 112,115 **** --- 112,117 ---- 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 ); Index: support.c =================================================================== RCS file: /cvsroot/arsperl/ARSperl/support.c,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** support.c 6 Jan 2009 19:21:46 -0000 1.68 --- support.c 31 Mar 2009 17:41:17 -0000 1.69 *************** *** 2514,2518 **** --- 2514,2520 ---- } + /* printf("numItems = %d\n", in->numItems); */ for (i = 0; i < in->numItems; i++) { + /* printf("[%d] %i\n", i, (int) in->permissionList[i].groupId); */ sprintf(groupid, "%i", (int) in->permissionList[i].groupId); for (j = 0; tmap[j].number != TYPEMAP_LAST; j++) { *************** *** 2931,2934 **** --- 2933,2951 ---- #endif + #if AR_CURRENT_API_VERSION >= 14 + SV * + perl_ARImageDataStruct(ARControlStruct * ctrl, ARImageDataStruct * in) + { + SV *byte_list; + + if( in->numItems == 0 ){ + return newSVsv(&PL_sv_undef); + } + + byte_list = newSVpv((char *) in->bytes, in->numItems); + return byte_list; + } + #endif + SV * perl_ARByteList(ARControlStruct * ctrl, ARByteList * in) *************** *** 3212,3217 **** hv_store(hash, "oper", strlen("oper") , newSVpv(oper, 0), 0); if (in->operation == AR_ARITH_OP_NEGATE) { ! hv_store(hash, "left", strlen("left") , ! perl_ARFieldValueOrArithStruct(ctrl, &in->operandLeft), 0); } else { hv_store(hash, "right", strlen("right") , --- 3229,3236 ---- hv_store(hash, "oper", strlen("oper") , newSVpv(oper, 0), 0); if (in->operation == AR_ARITH_OP_NEGATE) { ! /* hv_store(hash, "left", strlen("left") , ! perl_ARFieldValueOrArithStruct(ctrl, &in->operandLeft), 0); */ ! hv_store(hash, "right", strlen("right") , ! perl_ARFieldValueOrArithStruct(ctrl, &in->operandRight), 0); } else { hv_store(hash, "right", strlen("right") , Index: StructDef.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/StructDef.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StructDef.pl 15 May 2008 18:30:01 -0000 1.4 --- StructDef.pl 31 Mar 2009 17:41:17 -0000 1.5 *************** *** 626,651 **** }, }, ! ARArithOpStruct => { ! oper => { ! _type => 'unsigned int', ! _data => 'p->operation', ! _map => { ! AR_ARITH_OP_ADD => '+', ! AR_ARITH_OP_SUBTRACT => '-', ! AR_ARITH_OP_MULTIPLY => '*', ! AR_ARITH_OP_DIVIDE => '/', ! AR_ARITH_OP_MODULO => '%', ! AR_ARITH_OP_NEGATE => '-', ! }, ! }, ! left => { ! _type => 'ARFieldValueOrArithStruct', ! _data => 'p->operandLeft', ! }, ! right => { ! _type => 'ARFieldValueOrArithStruct', ! _data => 'p->operandRight', ! }, ! }, ARStatHistoryValue => { _header_only => 1, --- 626,651 ---- }, }, ! #ARArithOpStruct => { ! # oper => { ! # _type => 'unsigned int', ! # _data => 'p->operation', ! # _map => { ! # AR_ARITH_OP_ADD => '+', ! # AR_ARITH_OP_SUBTRACT => '-', ! # AR_ARITH_OP_MULTIPLY => '*', ! # AR_ARITH_OP_DIVIDE => '/', ! # AR_ARITH_OP_MODULO => '%', ! # AR_ARITH_OP_NEGATE => '-', ! # }, ! # }, ! # left => { ! # _type => 'ARFieldValueOrArithStruct', ! # _data => 'p->operandLeft', ! # }, ! # right => { ! # _type => 'ARFieldValueOrArithStruct', ! # _data => 'p->operandRight', ! # }, ! #}, ARStatHistoryValue => { _header_only => 1, Index: supportrev_generated.c =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev_generated.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** supportrev_generated.c 15 May 2008 18:30:07 -0000 1.5 --- supportrev_generated.c 31 Mar 2009 17:41:18 -0000 1.6 *************** *** 178,307 **** int - rev_ARArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARArithOpStruct *p ){ - SV **val; - int i = 0; - - if( !p ){ - ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: AR Object param is NULL" ); - return -1; - } - - if( SvTYPE((SV*) h) == SVt_PVHV ){ - - // printf( "ARArithOpStruct: k = <%s>\n", k ); - if( hv_exists(h,k,strlen(k)) ){ - val = hv_fetch( h, k, strlen(k), 0 ); - if( val && *val ){ - { - - - if( SvTYPE(SvRV(*val)) == SVt_PVHV ){ - int i = 0, num = 0; - HV *h = (HV* ) SvRV((SV*) *val); - char k[256]; - k[255] = '\0'; - - - { - SV **val; - strncpy( k, "left", 255 ); - val = hv_fetch( h, "left", 4, 0 ); - if( val && *val ){ - { - rev_ARFieldValueOrArithStruct( ctrl, h, k, &(p->operandLeft) ); - } - }else{ - ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"left\"" ); - return -1; - } - } - - - { - SV **val; - strncpy( k, "right", 255 ); - val = hv_fetch( h, "right", 5, 0 ); - if( val && *val ){ - { - rev_ARFieldValueOrArithStruct( ctrl, h, k, &(p->operandRight) ); - } - }else{ - ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"right\"" ); - return -1; - } - } - - - { - SV **val; - strncpy( k, "oper", 255 ); - val = hv_fetch( h, "oper", 4, 0 ); - if( val && *val ){ - { - int flag = 0; - if( !strcmp(SvPV_nolen(*val),"/") ){ - p->operation = AR_ARITH_OP_DIVIDE; - flag = 1; - } - if( !strcmp(SvPV_nolen(*val),"%") ){ - p->operation = AR_ARITH_OP_MODULO; - flag = 1; - } - if( !strcmp(SvPV_nolen(*val),"+") ){ - p->operation = AR_ARITH_OP_ADD; - flag = 1; - } - if( !strcmp(SvPV_nolen(*val),"-") ){ - p->operation = AR_ARITH_OP_NEGATE; - flag = 1; - } - if( !strcmp(SvPV_nolen(*val),"*") ){ - p->operation = AR_ARITH_OP_MULTIPLY; - flag = 1; - } - if( !strcmp(SvPV_nolen(*val),"-") ){ - p->operation = AR_ARITH_OP_SUBTRACT; - flag = 1; - } - if( flag == 0 ){ - ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: invalid key value" ); - ARError_add( AR_RETURN_ERROR, AP_ERR_CONTINUE, SvPV_nolen(*val) ); - } - } - }else{ - ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"oper\"" ); - return -1; - } - } - - - }else{ - ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: hash value is not a hash reference" ); - return -1; - } - - - } - }else{ - ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARArithOpStruct: hv_fetch returned null"); - return -2; - } - }else{ - ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARArithOpStruct: key doesn't exist"); - ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, k ); - return -2; - } - }else{ - ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: first argument is not a hash"); - return -1; - } - - return 0; - } - - - - - int rev_ARAttachLimitsStruct( ARControlStruct *ctrl, HV *h, char *k, ARAttachLimitsStruct *p ){ SV **val; --- 178,181 ---- Index: supportrev.h =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** supportrev.h 15 May 2008 18:30:03 -0000 1.17 --- supportrev.h 31 Mar 2009 17:41:18 -0000 1.18 *************** *** 89,92 **** --- 89,97 ---- HV *h, char *k, ARMacroParmList *m); + #if AR_CURRENT_API_VERSION >= 14 + EXTERN int rev_ARImageDataStruct(ARControlStruct * ctrl, + HV * h, char *k, ARImageDataStruct * b); + #endif + #if AR_EXPORT_VERSION >= 3 EXTERN int rev_ARByteList(ARControlStruct *ctrl, *************** *** 135,138 **** --- 140,145 ---- #endif + EXTERN int + rev_ARArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARArithOpStruct *p ); #endif /* __supportrev_h_ */ Index: support-h.template =================================================================== RCS file: /cvsroot/arsperl/ARSperl/support-h.template,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** support-h.template 6 Jan 2009 19:21:46 -0000 1.35 --- support-h.template 31 Mar 2009 17:41:17 -0000 1.36 *************** *** 498,501 **** --- 498,504 ---- EXTERN SV *perl_ARCompoundSchema(ARControlStruct *ctrl, ARCompoundSchema *); EXTERN SV *perl_ARSortList(ARControlStruct *ctrl, ARSortList *); + #if AR_CURRENT_API_VERSION >= 14 + EXTERN SV *perl_ARImageDataStruct(ARControlStruct * ctrl, ARImageDataStruct * in); + #endif EXTERN SV *perl_ARByteList(ARControlStruct *ctrl, ARByteList *); EXTERN SV *perl_ARCoordStruct(ARControlStruct *ctrl, ARCoordStruct *); Index: supportrev_generated.h =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev_generated.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** supportrev_generated.h 15 May 2008 18:30:07 -0000 1.4 --- supportrev_generated.h 31 Mar 2009 17:41:18 -0000 1.5 *************** *** 26,32 **** #endif - EXTERN int rev_ARArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARArithOpStruct *p ); - - EXTERN int rev_ARAttachLimitsStruct( ARControlStruct *ctrl, HV *h, char *k, ARAttachLimitsStruct *p ); --- 26,29 ---- Index: supportrev.c =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** supportrev.c 24 Sep 2008 13:03:12 -0000 1.32 --- supportrev.c 31 Mar 2009 17:41:18 -0000 1.33 *************** *** 1462,1465 **** --- 1462,1503 ---- } + #if AR_CURRENT_API_VERSION >= 14 + int + rev_ARImageDataStruct(ARControlStruct * ctrl, HV * h, char *k, ARImageDataStruct * b) + { + if (!h || !k || !b) { + ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, + "rev_ARImageDataStruct: invalid (NULL) parameter"); + return -1; + } + if (hv_exists(h, k, strlen(k) )) { + SV **vv = hv_fetch(h, k, strlen(k) , 0); + + if (vv && *vv && SvPOK(*vv)) { + char *byteString = SvPV(*vv, PL_na); + int byteLen = SvCUR(*vv); + + b->numItems = byteLen; + b->bytes = MALLOCNN(byteLen + 1); /* don't want FreeAR.. to whack us */ + + copymem(b->bytes, byteString, byteLen); + return 0; + } else { + ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, + "rev_ARImageDataStruct: hash value is not a defined scalar for key:"); + ARError_add(AR_RETURN_ERROR, AP_ERR_CONTINUE, + k ? k : "[key null]"); + } + } else { + ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, + "rev_ARImageDataStruct: hash key doesn't exist:"); + ARError_add(AR_RETURN_WARNING, AP_ERR_CONTINUE, + k ? k : "[key null]"); + return -2; + } + return -1; + } + #endif + #if AR_EXPORT_VERSION >= 3 int *************** *** 3487,3488 **** --- 3525,3662 ---- #endif + + + + int + rev_ARArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARArithOpStruct *p ){ + SV **val; + int i = 0; + + if( !p ){ + ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: AR Object param is NULL" ); + return -1; + } + + if( SvTYPE((SV*) h) == SVt_PVHV ){ + + // printf( "ARArithOpStruct: k = <%s>\n", k ); + if( hv_exists(h,k,strlen(k)) ){ + val = hv_fetch( h, k, strlen(k), 0 ); + if( val && *val ){ + { + + + if( SvTYPE(SvRV(*val)) == SVt_PVHV ){ + int i = 0, num = 0; + HV *h = (HV* ) SvRV((SV*) *val); + char k[256]; + k[255] = '\0'; + + + { + SV **val; + strncpy( k, "oper", 255 ); + val = hv_fetch( h, "oper", 4, 0 ); + if( val && *val ){ + { + int flag = 0; + if( !strcmp(SvPV_nolen(*val),"/") ){ + p->operation = AR_ARITH_OP_DIVIDE; + flag = 1; + } + if( !strcmp(SvPV_nolen(*val),"%") ){ + p->operation = AR_ARITH_OP_MODULO; + flag = 1; + } + if( !strcmp(SvPV_nolen(*val),"+") ){ + p->operation = AR_ARITH_OP_ADD; + flag = 1; + } + /* + if( !strcmp(SvPV_nolen(*val),"-") ){ + p->operation = AR_ARITH_OP_NEGATE; + flag = 1; + } + */ + if( !strcmp(SvPV_nolen(*val),"*") ){ + p->operation = AR_ARITH_OP_MULTIPLY; + flag = 1; + } + if( !strcmp(SvPV_nolen(*val),"-") ){ + p->operation = AR_ARITH_OP_SUBTRACT; + flag = 1; + } + if( flag == 0 ){ + ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: invalid key value" ); + ARError_add( AR_RETURN_ERROR, AP_ERR_CONTINUE, SvPV_nolen(*val) ); + } + } + }else{ + ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"oper\"" ); + return -1; + } + } + + + { + SV **val; + strncpy( k, "left", 255 ); + val = hv_fetch( h, "left", 4, 0 ); + if( val && *val ){ + { + rev_ARFieldValueOrArithStruct( ctrl, h, k, &(p->operandLeft) ); + } + }else{ + if( p->operation == AR_ARITH_OP_SUBTRACT ){ + p->operation = AR_ARITH_OP_NEGATE; + }else{ + ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"left\"" ); + return -1; + } + } + } + + + { + SV **val; + strncpy( k, "right", 255 ); + val = hv_fetch( h, "right", 5, 0 ); + if( val && *val ){ + { + rev_ARFieldValueOrArithStruct( ctrl, h, k, &(p->operandRight) ); + } + }else{ + ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"right\"" ); + return -1; + } + } + + + + + }else{ + ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: hash value is not a hash reference" ); + return -1; + } + + + } + }else{ + ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARArithOpStruct: hv_fetch returned null"); + return -2; + } + }else{ + ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARArithOpStruct: key doesn't exist"); + ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, k ); + return -2; + } + }else{ + ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: first argument is not a hash"); + return -1; + } + + return 0; + } + + + |
From: Thilo S. <ts...@us...> - 2009-03-31 17:41:26
|
Update of /cvsroot/arsperl/ARSperl/infra In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19729/infra Modified Files: exsi.pl Log Message: arsystem 7.5 port, AR*Image functions Index: exsi.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/infra/exsi.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** exsi.pl 24 Sep 2008 13:03:14 -0000 1.3 --- exsi.pl 31 Mar 2009 17:41:18 -0000 1.4 *************** *** 16,21 **** # # $Log$ ! # Revision 1.3 2008/09/24 13:03:14 tstapff ! # bugfix for serverTypeInfoHints.h # # Revision 1.2 2007/09/13 22:50:26 tstapff --- 16,24 ---- # # $Log$ ! # Revision 1.4 2009/03/31 17:41:18 tstapff ! # arsystem 7.5 port, AR*Image functions ! # ! # Revision 1.3 2008/09/24 13:03:14 tstapff ! # bugfix for serverTypeInfoHints.h # # Revision 1.2 2007/09/13 22:50:26 tstapff *************** *** 57,60 **** --- 60,65 ---- die "!!! ERROR: Cannot determine type for AR_SERVER_INFO constant $ct !!!" if $siv != $ct; + next if $sit eq 'deprecated'; + # jump thru some more hoops *************** *** 85,88 **** --- 90,100 ---- $sit = "char" if $sin eq "AR_SERVER_INFO_GUID_PREFIX"; + $sit = "char" if $sin eq "AR_SERVER_INFO_FT_COLLECTION_DIR"; # deprecated in 7.5 + $sit = "char" if $sin eq "AR_SERVER_INFO_FT_CONFIGURATION_DIR"; # deprecated in 7.5 + $sit = "char" if $sin eq "AR_SERVER_INFO_FT_TEMP_DIR"; # deprecated in 7.5 + + $sit = "int" if $sin eq "AR_SERVER_INFO_LICENSE_USAGE"; + $sit = "int" if $sin eq "AR_SERVER_INFO_MAX_CLIENT_MANAGED_TRANSACTIONS"; + $sit = "int" if $sin eq "AR_SERVER_INFO_CLIENT_MANAGED_TRANSACTION_TIMEOUT"; #print "\t/*$sin [$siv] is an $sit*/\n"; |
From: Thilo S. <thi...@ap...> - 2009-03-31 14:08:11
|
Michiel, I can't reproduce this problem. When I run the following script: .... my @roleList = ars_GetListRole( $ctrl, undef ); die "ars_GetListRole(): $ars_errstr\n" if defined $ars_errstr; ... it prints out the correct error message: [ERROR] Der angegebene Container ist nicht vorhanden (390620) (ARERR #8804) Maybe you could send me your test script, so I can test if it runs correctly in my environment. Regards, Thilo Michiel Beijen wrote: > Thilo, > > I'm busy updating documentation and examples. I have already committed a > few of the files. > > I have a question, when I used my @roles = ars_GetListRoles($ctrl, > $application_name) or ars_GetListRoles($ctrl, undef) it returns an empty > error; meaning that $ar_errstr is not undef but also doesn't contain > helpful information. > I had the very same behaviour when I tried to use ars_GetListLicense. Do > you have any clue why that may be? > > Kind regards, > -- > Michiel Beijen > Software Consultant > +31 6 - 457 42 418 > Bee Free IT + http://beefreeit.nl <http://beefreeit.nl/> > > > On Mon, Mar 30, 2009 at 12:05, Thilo Stapff <thi...@ap... > <mailto:thi...@ap...>> wrote: > > Hi Michiel, > > sorry for the delayed response. > > I'm working on ARGetListEntryWithMultiSchemaFields and the AR*Image > functions. > > I've indeed done nothing about the debug functions. At this point, > I'm not really using 7.5 already, and I don't even know what they are > about. On the other hand, most of them look rather easy to implement, so > I might take a look at it. > > I'll probably do a check-in later today or tomorrow. > > Actually, there are lots of areas where I could need help: > > - The new functions will need documentation. There are also some > recently added functions which are still undocumented (see changes.dat). > > - The test scripts could be improved. Most of them only check that no > error occurs, but don't really verify the correctness of the results. > > - The sample scripts could need improvement, too. Some of them are > probably rather outdated. > > - Of course I wouldn't mind if you implement some of the ARWfd* > functions. > > > Kind regards, > Thilo > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Arsperl-devel mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-devel |
From: Michiel B. <mb...@us...> - 2009-03-31 13:54:51
|
Update of /cvsroot/arsperl/ARSperl/example In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4241 Modified Files: AddUsersToGroup.pl Dump_Users.pl GetField.pl Get_Diary.pl ars_ExecuteProcess.pl ars_GetListSQL.pl ars_GetListUser.pl ars_GetServerInfo.pl Removed Files: ars_GetFullTextInfo.pl Log Message: Verified and updated examples. Removed ars_GetFullTextInfo.pl because ars_GetFullTextInfo is obsolete since ARS > 6.01 Index: ars_GetListUser.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/example/ars_GetListUser.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ars_GetListUser.pl 11 Apr 2001 15:10:15 -0000 1.2 --- ars_GetListUser.pl 31 Mar 2009 13:34:32 -0000 1.3 *************** *** 16,20 **** # email addr and notify mech are (as far as we can tell) part of the # return values from the API, but are never filled in. this is not a ! # bug in arsperl. # # AUTHOR --- 16,20 ---- # email addr and notify mech are (as far as we can tell) part of the # return values from the API, but are never filled in. this is not a ! # bug in arsperl. # # AUTHOR *************** *** 22,25 **** --- 22,29 ---- # # $Log$ + # Revision 1.3 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.2 2001/04/11 15:10:15 jcmurphy # updates to Makefile.PL for server info map *************** *** 32,41 **** use ARS; ! @noteMech = ("NONE", "NOTIFIER", "EMAIL", "?"); ! @licType = ("NONE", "FIXED", "FLOATING", "FIXED2"); ! @licTag = ("", "WRITE", "FULL_TEXT", "RESERVED1"); ! ($c = ars_Login(shift, shift, shift)) || die "login: $ars_errstr"; print "Calling GetListUser and asking for all connected users...\n"; --- 36,53 ---- 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"; ! ! my @noteMech = ( "NONE", "NOTIFIER", "EMAIL", "?" ); ! my @licType = ( "NONE", "FIXED", "FLOATING", "FIXED2" ); ! my @licTag = ( "", "WRITE", "FULL_TEXT", "RESERVED1" ); print "Calling GetListUser and asking for all connected users...\n"; *************** *** 47,73 **** # default = 0 ! (@h = ars_GetListUser($c, &ARS::AR_USER_LIST_REGISTERED)) || die "ERR: $ars_errstr\n"; ! print "errstr=$ars_errstr\n"; print "GetListUser returned the following:\n"; ! foreach $userHash (@h) { ! print "userName: $userHash->{userName}\n"; ! print "\tconnectTime: ".localtime($userHash->{connectTime})."\n"; ! print "\tlastAccess: ".localtime($userHash->{lastAccess})."\n"; ! print "\tnotify mech: $userHash->{defaultNotifyMech} (".$noteMech[$userHash->{defaultNotifyMech}].")\n"; ! print "\temail addr: $userHash->{emailAddr}\n"; ! for($i = 0; $i <= $#{$userHash->{licenseTag}}; $i++) { ! print "\tlicense \#$i info:\n"; ! print "\t\tlicenseTag: ".@{$userHash->{licenseTag}}[$i]. ! " (".$licTag[@{$userHash->{licenseTag}}[$i]].")\n"; ! print "\t\tlicenseType: ".@{$userHash->{licenseType}}[$i]. ! " (".$licType[@{$userHash->{licenseType}}[$i]].")\n"; ! print "\t\tcurrentLicenseType: ".@{$userHash->{currentLicenseType}}[$i]. ! " (".$licType[@{$userHash->{currentLicenseType}}[$i]].")\n"; } } ! ars_Logoff($c); --- 59,88 ---- # default = 0 ! ( my @h = ars_GetListUser( $ctrl, 2 ) ) || die "ERR: $ars_errstr\n"; print "GetListUser returned the following:\n"; ! foreach (@h) { ! print "userName: $_->{userName}\n"; ! print "\tconnectTime: " . localtime( $_->{connectTime} ) . "\n"; ! print "\tlastAccess: " . localtime( $_->{lastAccess} ) . "\n"; ! print "\tnotify mech: $_->{defaultNotifyMech} (" ! . $noteMech[ $_->{defaultNotifyMech} ] . ")\n"; ! print "\temail addr: $_->{emailAddr}\n"; ! for ( my $i = 0 ; $i <= $#{ $_->{licenseTag} } ; $i++ ) { ! print "\tlicense \#$i info:\n"; ! print "\t\tlicenseTag: " ! . @{ $_->{licenseTag} }[$i] . " (" ! . $licTag[ @{ $_->{licenseTag} }[$i] ] . ")\n"; ! print "\t\tlicenseType: " ! . @{ $_->{licenseType} }[$i] . " (" ! . $licType[ @{ $_->{licenseType} }[$i] ] . ")\n"; ! print "\t\tcurrentLicenseType: " ! . @{ $_->{currentLicenseType} }[$i] . " (" ! . $licType[ @{ $_->{currentLicenseType} }[$i] ] . ")\n"; } } ! ars_Logoff($ctrl); --- ars_GetFullTextInfo.pl DELETED --- Index: GetField.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/example/GetField.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GetField.pl 11 Sep 1998 14:46:18 -0000 1.4 --- GetField.pl 31 Mar 2009 13:34:32 -0000 1.5 *************** *** 9,13 **** # Connect to the server and fetch information about the # named field. Print the information out. ! # # NOTES # We'll be looking up the field names in the Default Admin View. --- 9,13 ---- # Connect to the server and fetch information about the # named field. Print the information out. ! # # NOTES # We'll be looking up the field names in the Default Admin View. *************** *** 19,22 **** --- 19,26 ---- # # $Log$ + # 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 *************** *** 37,45 **** use ARS; # Parse command line parameters ! ($server, $username, $password, $schema, $fieldname) = @ARGV; ! if(!defined($password)) { print "usage: $0 [server] [username] [password] [schema] [fieldname]\n"; exit 1; --- 41,50 ---- use ARS; + use strict; # Parse command line parameters ! my ( $server, $username, $password, $schema, $fieldname ) = @ARGV; ! if ( !defined($fieldname) ) { print "usage: $0 [server] [username] [password] [schema] [fieldname]\n"; exit 1; *************** *** 50,55 **** print "Logging in ..\n"; ! ($ctrl = ars_Login($server, $username, $password)) || ! die "can't login to the server"; # Fetch all of the fieldnames/ids for the specified schema --- 55,60 ---- 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 *************** *** 57,66 **** print "Fetching field table ..\n"; ! (%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"; --- 62,71 ---- 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"; *************** *** 72,77 **** print "Fetching field information ..\n"; ! ($fieldInfo = ars_GetField($ctrl, $schema, $fids{$fieldname})) || ! die "GetField: $ars_errstr"; print "Here are some of the field attributes. More are available. --- 77,82 ---- 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. *************** *** 85,126 **** "; ! dumpKV($fieldInfo, 0); ars_Logoff($ctrl); - exit 0; sub dumpKV { ! my $hr = shift; ! my $i = shift; ! foreach $k (keys %$hr){ ! print "\t"x$i."key=<$k> val=<$hr->{$k}>\n"; ! if(ref($hr->{$k}) eq "HASH") { ! dumpKV($hr->{$k}, $i+1); ! } ! elsif(ref($hr->{$k}) eq "ARRAY") { ! dumpAV($hr->{$k}, $i+1); ! } ! } } sub dumpAV { ! my $ar = shift; ! my $i = shift; ! my $a = 0; ! foreach (@$ar) { ! print "\t"x$i."index=<$a> val=<$_>\n"; ! if(ref($_) eq "HASH") { ! dumpKV($_, $i+1); ! } ! elsif(ref($_) eq "ARRAY") { ! dumpAV($_, $i+1); ! } ! $a++; ! } } --- 90,130 ---- "; ! dumpKV( $fieldInfo, 0 ); ars_Logoff($ctrl); exit 0; sub dumpKV { ! my $hr = shift; ! my $i = shift; ! foreach my $k ( keys %$hr ) { ! print "\t" x $i . "key=<$k> val=<$hr->{$k}>\n"; ! if ( ref( $hr->{$k} ) eq "HASH" ) { ! dumpKV( $hr->{$k}, $i + 1 ); ! } ! elsif ( ref( $hr->{$k} ) eq "ARRAY" ) { ! dumpAV( $hr->{$k}, $i + 1 ); ! } ! } } sub dumpAV { ! my $ar = shift; ! my $i = shift; ! my $a = 0; ! foreach (@$ar) { ! print "\t" x $i . "index=<$a> val=<$_>\n"; ! if ( ref($_) eq "HASH" ) { ! dumpKV( $_, $i + 1 ); ! } ! elsif ( ref($_) eq "ARRAY" ) { ! dumpAV( $_, $i + 1 ); ! } ! $a++; ! } } Index: ars_ExecuteProcess.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/example/ars_ExecuteProcess.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ars_ExecuteProcess.pl 2 Aug 2007 14:48:21 -0000 1.2 --- ars_ExecuteProcess.pl 31 Mar 2009 13:34:32 -0000 1.3 *************** *** 10,14 **** # if you need to use a specified TCP port, export the ARTCPPORT environment variable # with the TCP Port number ! # # EXAMPLE # ars_ExecuteProcess.pl arserver user password "ls -l /" (if the server is on Unix) --- 10,14 ---- # if you need to use a specified TCP port, export the ARTCPPORT environment variable # with the TCP Port number ! # # EXAMPLE # ars_ExecuteProcess.pl arserver user password "ls -l /" (if the server is on Unix) *************** *** 23,26 **** --- 23,30 ---- # # $Log$ + # Revision 1.3 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.2 2007/08/02 14:48:21 mbeijen # modified examples for ExecuteProcess and decodeStatusHistory *************** *** 33,44 **** use ARS; ! $c = ars_Login(shift, shift, shift) || die "login: $ars_errstr"; ! $b = shift; ! (($num, $str) = ars_ExecuteProcess($c, $b)) || print "ERR: $ars_errstr\n"; print "gotit: $ars_errstr\n"; print "returnCode=<$num> returnString=<$str>\n"; ! ars_Logoff($c); --- 37,56 ---- 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); Index: AddUsersToGroup.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/example/AddUsersToGroup.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AddUsersToGroup.pl 4 Aug 2007 15:20:04 -0000 1.4 --- AddUsersToGroup.pl 31 Mar 2009 13:34:32 -0000 1.5 *************** *** 13,16 **** --- 13,20 ---- # # $Log$ + # 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 2007/08/04 15:20:04 mbeijen # Adjusted the code for current ARSperl version, added use strict; and added comments. *************** *** 26,34 **** use ARS; use strict; die "usage: AddUserToGroup server username password group user1 [user2] ...\n" if ( $#ARGV < 4 ); ! ( my $server, my $user, my $pass, my $group, my @users ) = ( shift, shift, shift, shift, @ARGV ); --- 30,39 ---- use ARS; use strict; + 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 ); Index: ars_GetServerInfo.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/example/ars_GetServerInfo.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ars_GetServerInfo.pl 3 Feb 2007 02:33:11 -0000 1.2 --- ars_GetServerInfo.pl 31 Mar 2009 13:34:32 -0000 1.3 *************** *** 5,9 **** # NAME # ars_GetServerInfo.pl ! # # USAGE # ars_GetServerInfo.pl [server] [username] [password] --- 5,9 ---- # NAME # ars_GetServerInfo.pl ! # # USAGE # ars_GetServerInfo.pl [server] [username] [password] *************** *** 16,19 **** --- 16,23 ---- # # $Log$ + # Revision 1.3 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.2 2007/02/03 02:33:11 tstapff # arsystem 7.0 port, new ars_Create/Set functions *************** *** 26,39 **** use ARS; ! ($c = ars_Login(shift, shift, shift)) || die "login: $ars_errstr"; print "Calling GetServerInfo ..\n"; ! (%h = ars_GetServerInfo($c)) || die "ERR: $ars_errstr\n"; ! for $it (sort keys %h) { ! printf("%25s %s\n", $it, $h{$it}); } ! ars_Logoff($c); --- 30,51 ---- 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"; print "Calling GetServerInfo ..\n"; ! ( my %h = ars_GetServerInfo($ctrl) ) || die "ERR: $ars_errstr\n"; ! for my $it ( sort keys %h ) { ! printf( "%25s %s\n", $it, $h{$it} ); } ! ars_Logoff($ctrl); Index: Dump_Users.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/example/Dump_Users.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Dump_Users.pl 13 Mar 2007 13:20:32 -0000 1.7 --- Dump_Users.pl 31 Mar 2009 13:34:32 -0000 1.8 *************** *** 7,16 **** # # 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 --- 7,16 ---- # # 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 *************** *** 20,23 **** --- 20,27 ---- # # $Log$ + # Revision 1.8 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.7 2007/03/13 13:20:32 jeffmurphy # minor update to example scripts *************** *** 45,55 **** use ARS; ! $SCHEMA = "User"; # Parse command line parameters ! ($server, $username, $password) = @ARGV; ! if(!defined($password)) { print "usage: $0 [server] [username] [password]\n"; exit 1; --- 49,60 ---- use ARS; + use strict; ! my $SCHEMA = "User"; # Parse command line parameters ! my ( $server, $username, $password ) = @ARGV; ! if ( !defined($password) ) { print "usage: $0 [server] [username] [password]\n"; exit 1; *************** *** 58,70 **** # Log onto the ars server specified ! ($ctrl = ars_Login($server, $username, $password)) || ! die "can't login to the server: $ars_errstr"; # Load the qualifier structure with a dummy qualifier. ! ($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. --- 63,73 ---- # 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. *************** *** 72,119 **** # and use whatever we find. ! $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. ! @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; ! ($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 ($i =0; $i <= $#entries; $i+=2) { ! #foreach $entry_id (sort keys %entries) { # Retrieve the (fieldid, value) pairs for this entry ! %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. - - $profile = ars_GetProfileInfo($ctrl); - ars_Logoff($ctrl); - - $endTime = time(); - print "startTime = ".localtime($profile->{startTime})."\n"; - print "endTime = ".localtime(time())."\n"; - print "run time = ".($endTime - $profile->{startTime})." (secs)\n"; - print "queries = ".$profile->{queries}."\n"; - print "rate = ".($profile->{queries}/($endTime-$profile->{startTime}))." Q/S\n"; - --- 75,113 ---- # 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 ) { ! ! #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); Index: ars_GetListSQL.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/example/ars_GetListSQL.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ars_GetListSQL.pl 3 Feb 2000 21:29:03 -0000 1.2 --- ars_GetListSQL.pl 31 Mar 2009 13:34:32 -0000 1.3 *************** *** 1,3 **** ! #!/usr/local/bin/perl # # $Header$ --- 1,3 ---- ! #!/usr/bin/perl # # $Header$ *************** *** 21,24 **** --- 21,28 ---- # # $Log$ + # Revision 1.3 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.2 2000/02/03 21:29:03 jcmurphy # *************** *** 31,58 **** # - use ARS; ! ($c = ars_Login(shift, shift, shift)) || die "login: $ars_errstr"; # The arschema table contains information about what schemas are # in the system. We'll grab some of the columns and dump them. ! $sql = "select name, schemaid, nextid from arschema"; print "Calling GetListSQL with:\n\t$sql\n\n"; ! ($h = ars_GetListSQL($c, $sql)) || die "GetListSQL Failed: $ars_errstr\n"; print "GetListSQL returned the following rows:\n"; ! print "rows fetched: $h->{numMatches}\n"; print "name\t\tschemaid\t\tnextid\n"; ! for($col = 0; $col < $h->{numMatches}; $col++) { ! for($row = 0 ; $row <= $#{@{$h->{rows}}[$col]}; $row++) { ! print @{@{$h->{rows}}[$col]}[$row]."\t\t"; } print "\n"; } - ars_Logoff($c); --- 35,73 ---- # 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"; # The arschema table contains information about what schemas are # in the system. We'll grab some of the columns and dump them. ! my $sql = "select name, schemaid, nextid from arschema"; print "Calling GetListSQL with:\n\t$sql\n\n"; ! ( my $sql_hash = ars_GetListSQL( $ctrl, $sql ) ) ! || die "GetListSQL Failed: $ars_errstr\n"; ! ! # Log off nicely ! ! ars_Logoff($ctrl); print "GetListSQL returned the following rows:\n"; ! print "rows fetched: $sql_hash->{numMatches}\n"; print "name\t\tschemaid\t\tnextid\n"; ! for ( my $col = 0 ; $col < $sql_hash->{numMatches} ; $col++ ) { ! for ( my $row = 0 ; $row <= $#{ @{ $sql_hash->{rows} }[$col] } ; $row++ ) { ! print @{ @{ $sql_hash->{rows} }[$col] }[$row] . "\t\t"; } print "\n"; } Index: Get_Diary.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/example/Get_Diary.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Get_Diary.pl 3 Jul 2003 19:01:14 -0000 1.4 --- Get_Diary.pl 31 Mar 2009 13:34:32 -0000 1.5 *************** *** 7,19 **** # # DESCRIPTION ! # Log onto the server and dump all diary entries for a particular # qualification ! # # AUTHOR # jeff murphy # # 03/06/96 ! # # $Log$ # Revision 1.4 2003/07/03 19:01:14 jcmurphy # 1.81rc1 mem fixes from steve drew at hp.com --- 7,23 ---- # # DESCRIPTION ! # Log onto the server and dump all diary entries for a particular # qualification ! # # AUTHOR # jeff murphy # # 03/06/96 ! # # $Log$ + # 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 2003/07/03 19:01:14 jcmurphy # 1.81rc1 mem fixes from steve drew at hp.com *************** *** 31,39 **** use ARS; # Parse command line parameters ! ($server, $username, $password, $schema, $qualifier, $diaryfield) = @ARGV; ! if(!defined($diaryfield)) { print "usage: $0 [server] [username] [password] [schema] [qualifier]\n"; print " [diaryfieldname]\n"; --- 35,44 ---- use ARS; + use strict; # Parse command line parameters ! my ( $server, $username, $password, $schema, $qualifier, $diaryfield ) = @ARGV; ! if ( !defined($diaryfield) ) { print "usage: $0 [server] [username] [password] [schema] [qualifier]\n"; print " [diaryfieldname]\n"; *************** *** 47,68 **** diaryfield=$diaryfield\n"; ! ($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, $qualifier)) || ! die "error in ars_LoadQualifier:\n$ars_errstr"; # Retrieve all of the entry-id's for the qualification. ! %entries = ars_GetListEntry($ctrl, $schema, $qual, 0, 0); # Retrieve the fieldid for the diary field ! ($diaryfield_fid = ars_GetFieldByName($ctrl, $schema, $diaryfield)) || ! die "no such field in this schema: '$diaryfield'"; ! foreach $entry_id (sort keys %entries) { print ">>>>> Entry-id: $entry_id <<<<<\n\n"; --- 52,73 ---- 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'"; ! foreach my $entry_id ( sort keys %entries ) { print ">>>>> Entry-id: $entry_id <<<<<\n\n"; *************** *** 70,83 **** # Retrieve the (fieldid, value) pairs for this entry ! %e_vals = ars_GetEntry($ctrl, $schema, $entry_id, ! $diaryfield_fid); # Print out the diary entries for this entry-id ! foreach $diary_entry (@{$e_vals{$diaryfield_fid}}) { ! print scalar localtime($diary_entry->{timestamp}); ! print " ", $diary_entry->{user}, "\n"; ! print $diary_entry->{value}; ! print "\n\n"; } } --- 75,87 ---- # Retrieve the (fieldid, value) pairs for this entry ! my %e_vals = ars_GetEntry( $ctrl, $schema, $entry_id, $diaryfield_fid ); # Print out the diary entries for this entry-id ! foreach my $diary_entry ( @{ $e_vals{$diaryfield_fid} } ) { ! print scalar localtime( $diary_entry->{timestamp} ); ! print " ", $diary_entry->{user}, "\n"; ! print $diary_entry->{value}; ! print "\n\n"; } } |
From: Michiel B. <mi...@be...> - 2009-03-31 13:42:13
|
Thilo, I'm busy updating documentation and examples. I have already committed a few of the files. I have a question, when I used my @roles = ars_GetListRoles($ctrl, $application_name) or ars_GetListRoles($ctrl, undef) it returns an empty error; meaning that $ar_errstr is not undef but also doesn't contain helpful information. I had the very same behaviour when I tried to use ars_GetListLicense. Do you have any clue why that may be? Kind regards, -- Michiel Beijen Software Consultant +31 6 - 457 42 418 Bee Free IT + http://beefreeit.nl On Mon, Mar 30, 2009 at 12:05, Thilo Stapff <thi...@ap...>wrote: > Hi Michiel, > > sorry for the delayed response. > > I'm working on ARGetListEntryWithMultiSchemaFields and the AR*Image > functions. > > I've indeed done nothing about the debug functions. At this point, > I'm not really using 7.5 already, and I don't even know what they are > about. On the other hand, most of them look rather easy to implement, so > I might take a look at it. > > I'll probably do a check-in later today or tomorrow. > > Actually, there are lots of areas where I could need help: > > - The new functions will need documentation. There are also some > recently added functions which are still undocumented (see changes.dat). > > - The test scripts could be improved. Most of them only check that no > error occurs, but don't really verify the correctness of the results. > > - The sample scripts could need improvement, too. Some of them are > probably rather outdated. > > - Of course I wouldn't mind if you implement some of the ARWfd* functions. > > > Kind regards, > Thilo > > |
From: Michiel B. <mb...@us...> - 2009-03-31 13:30:01
|
Update of /cvsroot/arsperl/ARSperl/example In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3947 Added Files: ChangePassword.pl ars_DateToJulianDate.pl getCharSets.pl Log Message: added new examples: ChangePassword.pl, ars_DateToJulianDate.pl, getCharSets.pl --- NEW FILE: ChangePassword.pl --- #!/usr/bin/perl # # NAME # ChangePassword.pl server username password newpassword # # DESCRIPTION # This script allows a user to change his password. Since user accounts are just # plain records in a form we use the common getlistentry and setentry calls to # fetch the user's record and update the password field. # Note that on some systems permissions are set strangely and depending on # the type of license you have you might not be able to update your password # (Think Read Restricted licenses...) # Also on some systems the User form is renamed to something other than "User". # # AUTHOR # Michiel Beijen, Mansolutions, 2007. # 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"; --- NEW FILE: ars_DateToJulianDate.pl --- #!/usr/local/bin/perl # # $Header: /cvsroot/arsperl/ARSperl/example/ars_DateToJulianDate.pl,v 1.1 2009/03/31 13:29:50 mbeijen Exp $ # # NAME # ars_DateToJulianDate.pl # # USAGE # ars_DateToJulianDate.pl [server] [username] [password] [year] [ month] [date] # # DESCRIPTION # Converts a year-month-date value to a JulianDate. # # AUTHOR # Michiel Beijen # # $Log: ars_DateToJulianDate.pl,v $ # Revision 1.1 2009/03/31 13:29:50 mbeijen # added new examples: ChangePassword.pl, ars_DateToJulianDate.pl, getCharSets.pl # # use ARS; 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"; --- NEW FILE: getCharSets.pl --- #!/usr/local/bin/perl # # $Header: /cvsroot/arsperl/ARSperl/example/getCharSets.pl,v 1.1 2009/03/31 13:29:50 mbeijen Exp $ # # NAME # GetCharSets.pl # # USAGE # GetCharSets.pl [server] [username] [password] # # DESCRIPTION # Fetches and prints the charsets used by client and server # # AUTHOR # Michiel Beijen # # $Log: getCharSets.pl,v $ # Revision 1.1 2009/03/31 13:29:50 mbeijen # added new examples: ChangePassword.pl, ars_DateToJulianDate.pl, getCharSets.pl # # use ARS; use strict; die "usage: $0 server username password \n" unless ( $#ARGV >= 2 ); my ( $server, $user, $password, ) = ( shift, shift, shift ); # if you'd like to use UTF8: # $ENV{'LANG'} = "en_US.utf8"; #Logging in to the server ( my $ctrl = ars_Login( $server, $user, $password ) ) || die "ars_Login: $ars_errstr"; print "Fetching the charsets - easy...\n"; ( my $servercharset = ars_GetServerCharSet($ctrl) ) || die "ERR: $ars_errstr\n"; ( my $clientcharset = ars_GetClientCharSet($ctrl) ) || die "ERR: $ars_errstr\n"; ars_Logoff($ctrl); print "The server uses the $servercharset character set and the client uses $clientcharset.\n"; |
From: Michiel B. <mb...@us...> - 2009-03-31 12:31:43
|
Update of /cvsroot/arsperl/ARSperl In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv893 Added Files: META.yml Log Message: Added META.yml (see http://cpants.perl.org/dist/overview/ARSperl) --- NEW FILE: META.yml --- --- #YAML:1.0 name: ARS version: 1.92 abstract: ARSperl is an integration kit for Perl 5 and the BMC Remedy ARS System license: perl author: - ARSperl Dev Group <ars...@ar...> generated_by: mic...@gm... distribution_type: module requires: resources: license: http://dev.perl.org/licenses/ homepage: http://arsperl.org/ meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.3.html version: 1.3 |
From: Michiel B. <mb...@us...> - 2009-03-31 12:17:56
|
Update of /cvsroot/arsperl/ARSperl/html/manual In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32576 Added Files: ars_DateToJulianDate.html ars_GetClientCharSet.html ars_GetServerCharSet.html Log Message: New manual files for calls added in ARSperl 1.92 --- NEW FILE: ars_GetClientCharSet.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> ARSperl Programmer's Manual </title> <style type="text/css"> /*<![CDATA[*/ dt.c1 {font-weight: bold} /*]]>*/ /*<![CDATA[*/ p.c1 {font-style: italic} /*]]>*/ </style> </head> <body> <h2> <code>ars_GetClientCharSet(control)</code> </h2>Retrieves a string that represents the name of the character set the client is using. The API assumes that all character data the client passes it is encoded in this character set, and returns all character data encoded in this character set. If this differs from the server charset (see <a href="ars_GetServerCharSet.html">ars_GetServerCharSet</a>), the API converts the data to the right character set.<br /> <dl> <dt class="c1"> On success </dt> <dd> Returns a string. </dd> <dt class="c1"> On failure </dt> <dd> Returns undef. </dd> </dl> <p> Example: </p> <pre> my $charset = ars_GetClientCharSet($ctrl);<br /> print "This client is using character set $charset\n";<br /> </pre> <p class="c1"> ars_GetClientCharSet was introduced in version 1.92 of ARSperl </p> <p> <a href="toc.html">Back to Table of Contents</a> </p> <address> Last changes to this page 30 March 2009 by mi...@be...<br /> </address> </body> </html> --- NEW FILE: ars_DateToJulianDate.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> ARSperl Programmer's Manual </title> <style type="text/css"> /*<![CDATA[*/ dt.c1 {font-weight: bold} p.c1 {font-style: italic} /*]]>*/ </style> </head> <body> <h2> <code>ars_DateToJulianDate(control, year, month, day)</code> </h2> <p> Converts a year, month, and day value to a Julian date. The Julian date is the number of days since noon, Universal Time, on January 1, 4713 BCE (on the Julian calendar). The changeover from the Julian calendar to the Gregorian calendar occurred in October, 1582. The Julian calendar is used for dates on or before October 4, 1582. The Gregorian calendar is used for dates on or after October 15, 1582. </p> <dl> <dt class="c1"> On success </dt> <dd> Returns an integer. </dd> <dt class="c1"> On failure </dt> <dd> Returns undef. </dd> </dl> <p> Example: </p> <pre> my $juliandate = ars_DateToJulianDate($ctrl, 1066, 10, 14); print "The Battle of Hastings was on October 14th, 1066.\n"; print "This is $juliandate days after January 1st, 4713 BCE.\n"; </pre> <p class="c1"> ars_DateToJulianDate was introduced in version 1.92 of ARSperl </p> <p> <a href="toc.html">Back to Table of Contents</a> </p> <address> Last changes to this page 30 March 2009 by mic...@gm...<br /> </address> </body> </html> --- NEW FILE: ars_GetServerCharSet.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> ARSperl Programmer's Manual </title> <style type="text/css"> /*<![CDATA[*/ dt.c1 {font-weight: bold} p.c1 {font-style: italic} /*]]>*/ </style> </head> <body> <h2> <code>ars_GetServerCharSet(control)</code> </h2>Retrieves a string that represents the name of the character set the API library uses to communicate with the server. If this differs from the client charset, the API converts the data to the right character set.<br /> <dl> <dt class="c1"> On success </dt> <dd> Returns a string. </dd> <dt class="c1"> On failure </dt> <dd> Returns undef. </dd> </dl> <p> Example: </p> <pre> my $charset = ars_GetServerCharSet($ctrl);<br /> print "This server is using character set $charset\n";<br /> </pre> <p class="c1"> ars_GetServerCharSet was introduced in version 1.92 of ARSperl </p> <p> <a href="toc.html">Back to Table of Contents</a> </p> <address> Last changes to this page 30 March 2009 by mi...@be...<br /> </address> </body> </html> |