From: Wouter Z. <dra...@us...> - 2004-02-02 21:09:31
|
User: draftdog Date: 04/02/02 13:07:23 Modified: andromda-bpm4struts/src/templates Tag: V3x_MMD StrutsForm.vsl Log: generated form beans are now ready to be processed by xdoclet, to contribute to struts-config.xml and validator.xml a form field now supports the "required" attribute and the "mask" attribute which allows input to be matched against the argument Perl regular expression pattern documentation is now also rendered into the Javadoc blocks Revision Changes Path No revision No revision 1.3.2.4 +27 -11 cartridges/andromda-bpm4struts/src/templates/StrutsForm.vsl Index: StrutsForm.vsl =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-bpm4struts/src/templates/StrutsForm.vsl,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -u -w -r1.3.2.3 -r1.3.2.4 --- StrutsForm.vsl 1 Feb 2004 13:28:33 -0000 1.3.2.3 +++ StrutsForm.vsl 2 Feb 2004 21:07:21 -0000 1.3.2.4 @@ -3,9 +3,9 @@ ## package $class.packageName; -import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionMapping; +import org.apache.struts.validator.ValidatorForm; import javax.servlet.http.HttpServletRequest; @@ -14,12 +14,17 @@ ## #set ($formName = $str.toJavaMethodName($class.formBeanName)) /** +$class.getDocumentation(" ") + * * @struts.form * name="$formName" */ -public final class $class.name extends ActionForm +public final class $class.name extends ValidatorForm { #foreach ($inputField in $class.inputFields) + /** +$inputField.getDocumentation(" ") + */ #if ($inputField.defaultValue) private $inputField.type.fullyQualifiedName $inputField.name = $inputField.defaultValue; #else @@ -59,15 +64,26 @@ #foreach ($inputField in $class.inputFields) /** #if ($inputField.isRequired()) - * @struts.validator - * type="required" -## * arg0resource="$inputField.fieldMessageKey" -## * msgKey="$inputField.errorMessageKey" +#set ($required = "required") +#else +#set ($required = "") #end #if ($inputField.maskPattern) +#set ($mask = "mask") +#else +#set ($mask = "") +#end +#if ($inputField.isRequired() && $inputField.maskPattern) +#set ($commaOne = ",") +#else +#set ($commaOne = "") +#end + * @struts.validator + * type="$required$commaOne$mask" * +#if ($inputField.maskPattern) * @struts.validator-var - * name="mask" + * name="$mask" * value="$inputField.maskPattern" * #end @@ -110,8 +126,8 @@ this.$parameter = null; #end -#foreach ($inputField in $class.resetInputFields) - this.$inputField.name = $inputField.name; -#end +###foreach ($inputField in $class.resetInputFields) +## this.$inputField.name = $inputField.name; +###end } } |