portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portals-bridges/library/velocity/macros frameworks-macros.vm
Date Fri, 12 Nov 2004 06:26:21 GMT
taylor      2004/11/11 22:26:21

  Modified:    portals-bridges/library/spring validator-configuration.xml
               portals-bridges/library/velocity/macros frameworks-macros.vm
  Added:       portals-bridges/library/spring exampleResources.properties
                        exampleResources_fr.properties
  Log:
  examples
  
  Revision  Changes    Path
  1.3       +5 -1      jakarta-jetspeed-2/portals-bridges/library/spring/validator-configuration.xml
  
  Index: validator-configuration.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portals-bridges/library/spring/validator-configuration.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- validator-configuration.xml	11 Nov 2004 01:49:53 -0000	1.2
  +++ validator-configuration.xml	12 Nov 2004 06:26:21 -0000	1.3
  @@ -24,7 +24,11 @@
                    method="validateMask"
                    methodParams="java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,java.util.Map,java.util.ResourceBundle"
                    msg="errors.mask"/>
  -                 
  +      <validator name="maxLength"
  +                 classname="org.apache.portals.bridges.frameworks.spring.validation.ValidationSupport"
  +                 method="validateMaxLength"
  +                 methodParams="java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,java.util.Map,java.util.ResourceBundle"
  +                 msg="errors.maxlength"/>                 
      </global>
      <formset>
         <form name="clientInfo">
  
  
  
  1.1                  jakarta-jetspeed-2/portals-bridges/library/spring/exampleResources.properties
  
  Index: exampleResources.properties
  ===================================================================
  # general validation errors
  errors.required = Field {0} is a required field.
  errors.range = Field {0} is out of range: [{1} - {2}]
  errors.mask = Field {0} failed to match validation pattern: {2}
  errors.maxlength = Field {0} surpasses maximum length {1}
  
  
  
  1.1                  jakarta-jetspeed-2/portals-bridges/library/spring/exampleResources_fr.properties
  
  Index: exampleResources_fr.properties
  ===================================================================
  errors.required = Field {0} est requis.
  errors.range = Field {0} hors de portee: [{1} - {2}]
  errors.mask = Field {0} echoue pour correspondu au modele de validation: {2}
  errors.maxlength = Field {0} surpasse la longueur maximum {1}
  
  
  
  1.5       +40 -9     jakarta-jetspeed-2/portals-bridges/library/velocity/macros/frameworks-macros.vm
  
  Index: frameworks-macros.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portals-bridges/library/velocity/macros/frameworks-macros.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- frameworks-macros.vm	11 Nov 2004 01:48:25 -0000	1.4
  +++ frameworks-macros.vm	12 Nov 2004 06:26:21 -0000	1.5
  @@ -30,10 +30,14 @@
   #set ($eflag = "")
   #end
     <tr colspan="4" align="right">
  -    <td width="5%" class="portlet-msg-error" align="left">#if ($!eflag == "") #else
x #end</td>
  -    <td nowrap class="portlet-form-field-label" align="right">$!MESSAGES.getString($label):&nbsp;</td>
  -    <td class="portlet-form-input-field" align="left">
  -      <input id="$!id" type="text" name="$!id" size="$!size" value="$!value">
  +  #if ($!eflag == "")
  +    <td width="5%" align="left">&nbsp;</td>
  +  #else
  +    <td width="5%" class="portlet-msg-error" align="left">&nbsp;</td> 

  +  #end
  +    <td nowrap class="portlet-section-alternate" align="right">$!MESSAGES.getString($label):&nbsp;</td>
  +    <td class="portlet-section-body" align="left">
  +      <input id="$!id" type="text" name="$!id" size="$!size" value="$!value" class="portlet-form-label-field">
       </td>
       <td width="5%" class="portlet-form-label" align="left">&nbsp;</td>
     </tr>
  @@ -52,12 +56,39 @@
   #end
   #end
   
  -#macro (Preference $prefs $name)
  -#set ($pall = $prefs.get($name))
  -#foreach ($x in $pall)
  -#set ($extraction = $x)
  +#macro (OnePref $pf)
  +#set ($pv = $pf.Value)
  +#foreach ($x in $pv)
  +#set ($extr = $x)
   #end
  -$extraction
  +$pf.Key $!extr
  +#end
  +
  +#macro (prefField $key $values $size)
  +#if ($ERRORS)
  +#set ($eflag = "$!ERRORS.get($id)")
  +#else
  +#set ($eflag = "")
  +#end
  +#set ($pv = $pf.Value)
  +#foreach ($x in $pv)
  +#set ($extr = $x)
  +#end
  +#foreach ($x in $values)
  +#set ($extr = $x)
  +#end
  +  <tr colspan="4" align="right">
  +  #if ($!eflag == "")
  +    <td width="5%" align="left">&nbsp;</td>
  +  #else
  +    <td width="5%" class="portlet-msg-error" align="left">&nbsp;</td> 

  +  #end
  +    <td nowrap class="portlet-section-alternate" align="right">$!key:&nbsp;</td>
  +    <td class="portlet-section-body" align="left">
  +      <input id="$!id" type="text" name="$!key" size="$!size" value="$!extr" class="portlet-form-label-field">
  +    </td>
  +    <td width="5%" class="portlet-form-label" align="left">&nbsp;</td>
  +  </tr>
   #end
   
   #macro (form4ColumnCell $label $value $size $id)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message