From: Eliot S. <eli...@Ri...> - 2004-09-03 08:26:01
|
Hi=20Christian, =20 Looks=20like=20you've=20got=20a=20spelling=20error,=20"elemeMt": =20 =20=20=20=20=20=20=20=20<elememt=20name=3D"numRecurrsEveryXDays"/> =20 Kind=20regards, Eliot -----Original=20Message----- From:=20f...@li...=20[mailto:formproc-= dev...@li...]=20On=20Behalf=20Of=20Christian=20Ca= banero Sent:=2003=20September=202004=2006:20 To:=20f...@li... Subject:=20[FormProc-developer]=20Problem=20(potential=20bug?)=20with=20Fo= rmManager#loadForm(Configuration) I=20have=20a=20form=20with=20an=20element-group=20specified=20in=20the=20f= ollowing=20way: =20 =20=20=20=20<element-group=20name=3D"dailyRecurrence"> =20=20=20=20=20=20=20=20<element=20name=3D"dailyRecurrence"/> =20=20=20=20=20=20=20=20<element=20name=3D"recurrsEveryXDays"/> =20=20=20=20=20=20=20=20<element=20name=3D"recurrsEveryWeekday"/> =20=20=20=20=20=20=20=20<elememt=20name=3D"numRecurrsEveryXDays"/> =20=20=20=20=20=20=20=20<validator=20type=3D"shared"=20name=3D"dailyRecurr= ence"> =20=20=20=20=20=20=20=20=20=20=20=20<error=20lang=3D"en">Daily=20recurrenc= e=20problem.</error> =20=20=20=20=20=20=20=20</validator> =20=20=20=20</element-group> =20 I=20also=20have=20several=20single=20"element"=20elements=20in=20the=20fil= e=20as=20well.=20=20What=20I've=20noticed=20tracing=20through=20the=20code= =20is=20that=20although=20the=20element-group=20seems=20to=20load=20ok=20f= rom=20the=20configuration=20file=20only=203=20out=20of=20the=204=20sub=20e= lements=20within=20the=20element-group=20get=20returned=20as=20part=20of=20= the=20the=20formConfiguration's=20formElementGroups'=20Map=20entry=20for=20= the=20"dailyRecurrence"=20element-group.=20=20The=20DefaultFormElementGrou= p=20object's=20formElement=20list=20for=20"dailyRecurrence"=20contains=20o= nly=203=20DefaultFormElement=20objects=20that=20correspond=20to=20the=20fi= rst=203=20elements=20and=20none=20exists=20for=20"numRecurrsEveryXDays".=20= =20The=20code=20I've=20been=20tracing=20through=20is=20on=20line=20530=20o= f=20FormManager.java=20and=20then=20it=20goes=20into=20ClassPathResourceLo= ader.java=20but=20I=20haven't=20been=20able=20to=20get=20my=20IDE=20to=20t= race=20into=20that=20code=20correctly=20which=20is=20making=20me=20tear=20= my=20hair=20out. =20 I=20was=20wondering=20if=20anyone=20had=20any=20suggestions=20on=20this=20= problem=20or=20if=20I'm=20missing=20something.=20=20I'm=20using=20the=20la= test=20version=20of=20formproc=20in=20cvs=20and=20also=20using=20the=20ede= nlib=20that=20comes=20with=20it,=20version=202.0b1. =20 Thanks, Christian ________________________________________________________________________ This=20email=20has=20been=20scanned=20for=20all=20viruses=20by=20the=20Mes= sageLabs=20service. ________________________________________________________________________ This=20email=20has=20been=20scanned=20for=20all=20viruses=20by=20the=20Mes= sageLabs=20service.=20 ________________________________________________________________________ |
From: Barrie S. <ba...@ro...> - 2004-11-22 03:32:38
|
I'm trying to use python for regex validation, but get error on the import. If I run the script at the command line, it finds the import and the script works fine. If there a setting for imports, or do the have to be in a specific place? Thanks, Barrie Selack |
From: Barrie S. <ba...@ro...> - 2004-11-26 20:09:51
|
I noticed that scripts are much slower than rules .. is there going to be any caching of scripts? Either configured to cache, or not cache... or cache with a date stamp? Let me know.. if not, I'll probably add it. Barrie |
From: Anthony E. <me...@an...> - 2004-11-27 05:38:36
|
I don't think I'll have time to implement that right now, but if you implement that I'll be happy to apply it to CVS. Please make sure to work off of the CVS head though. Sincerely, Anthony Eden Barrie Selack wrote: > I noticed that scripts are much slower than rules .. is there going to be > any caching of scripts? Either configured to cache, or not cache... or > cache with a date stamp? > > Let me know.. if not, I'll probably add it. > > Barrie > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > FormProc-developer mailing list > For...@li... > https://lists.sourceforge.net/lists/listinfo/formproc-developer |
From: Barrie S. <ba...@ro...> - 2004-11-27 21:04:14
|
Anthony, Thanks for the response. My main problem was that I decided to use Groovy as a scripting language. Although BeanShell supports it, it was painfully slow (over 1.2 seconds per field on the page) I thought at first it may be a caching problem, but it was just the instantiation of BeanShell that was the issue. So I wrote a GroovyValidator that compiles and caches the class for reuse. It also allows you to specify an update-interval for checking to see if the script has changed. The time has dropped from 1.2 seconds to 10ms or less per field. Big difference. I'm attaching it for consideration of inclusion into FormProc. It's set up just like a regular script in formproc.xml except for the uodate-interval. <validator-map type="groovy" classnam e="org.formproc.validation.GroovyValidator"> <property name="script-root" value=""/> <property name="script-root-type" value="classpath"/> <property name="update-interval" value="-1"/> </validator-map> <shared-validator name="required"> <validator type="groovy"> <script>FieldRequired.gy</script> <error>Required Field</error> </validator> </shared-validator> It requires only three jars from Groovy: groovy-1.0-beta-7.jar asm-1.4.3.jar asm-util-1.4.3.jar and a sample script (the FieldRequired.gy) -------------------------------------------- import org.apache.commons.lang.StringUtils field1 = null for (i in formData) { if (field1 == null) { field1 = i.getValue(); } } isValid = false if (field1 != null) { field1 = StringUtils.trim(field1) if (field1 != "") { isValid = true } } result.setPassed(isValid) -------------------------------------------- Let me know what you think. Regards, Barrie Selack >I don't think I'll have time to implement that right now, but if you >implement that I'll be happy to apply it to CVS. Please make sure to >work off of the CVS head though. > >Sincerely, >Anthony Eden > >Barrie Selack wrote: >> I noticed that scripts are much slower than rules .. is there going to be >> any caching of scripts? Either configured to cache, or not cache... or >> cache with a date stamp? >> >> Let me know.. if not, I'll probably add it. >> >> Barrie >> >> >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real users. >> Discover which products truly live up to the hype. Start reading now. >> http://productguide.itmanagersjournal.com/ >> _______________________________________________ >> FormProc-developer mailing list >> For...@li... >> https://lists.sourceforge.net/lists/listinfo/formproc-developer > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://productguide.itmanagersjournal.com/ >_______________________________________________ >FormProc-developer mailing list >For...@li... >https://lists.sourceforge.net/lists/listinfo/formproc-developer > > |
From: Anthony E. <me...@an...> - 2004-11-27 21:29:39
|
I've got a deadline of December 1st for my job but once that's done I'll test out the code and put it in the CVS. Sincerely, Anthony Eden Barrie Selack wrote: > Anthony, > > Thanks for the response. My main problem was that I decided to use Groovy > as a scripting language. Although BeanShell supports it, it was painfully > slow (over 1.2 seconds per field on the page) I thought at first it may > be a caching problem, but it was just the instantiation of BeanShell that > was the issue. So I wrote a GroovyValidator that compiles and caches the > class for reuse. It also allows you to specify an update-interval for > checking to see if the script has changed. The time has dropped from 1.2 > seconds to 10ms or less per field. Big difference. > > I'm attaching it for consideration of inclusion into FormProc. It's set > up just like a regular script in formproc.xml except for the uodate-interval. <snip> |