struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r933175 - in /struts/struts2/trunk/plugins/config-browser/src/main: java/org/apache/struts2/config_browser/ resources/config-browser/
Date Mon, 12 Apr 2010 10:23:23 GMT
Author: lukaszlenart
Date: Mon Apr 12 10:23:23 2010
New Revision: 933175

URL: http://svn.apache.org/viewvc?rev=933175&view=rev
Log:
Resolved WW-3361 - proper handling for expression validators and arrays

Modified:
    struts/struts2/trunk/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ActionNamesAction.java
    struts/struts2/trunk/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ListValidatorsAction.java
    struts/struts2/trunk/plugins/config-browser/src/main/resources/config-browser/showValidators.ftl
    struts/struts2/trunk/plugins/config-browser/src/main/resources/config-browser/validatorDetails.ftl

Modified: struts/struts2/trunk/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ActionNamesAction.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ActionNamesAction.java?rev=933175&r1=933174&r2=933175&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ActionNamesAction.java
(original)
+++ struts/struts2/trunk/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ActionNamesAction.java
Mon Apr 12 10:23:23 2010
@@ -21,16 +21,13 @@
 
 package org.apache.struts2.config_browser;
 
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.apache.struts2.StrutsConstants;
-
 import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.ObjectFactory;
-import com.opensymphony.xwork2.config.Configuration;
 import com.opensymphony.xwork2.config.entities.ActionConfig;
 import com.opensymphony.xwork2.inject.Inject;
+import org.apache.struts2.StrutsConstants;
+
+import java.util.Set;
+import java.util.TreeSet;
 
 /**
  * ActionNamesAction
@@ -79,7 +76,10 @@ public class ActionNamesAction extends A
 
     public String getExtension() {
         if ( extension == null) {
-            extension = "action";
+            return "action";
+        }
+        if (extension.indexOf(",") > -1) {
+            return extension.substring(0, extension.indexOf(","));
         }
         return extension;
     }

Modified: struts/struts2/trunk/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ListValidatorsAction.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ListValidatorsAction.java?rev=933175&r1=933174&r2=933175&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ListValidatorsAction.java
(original)
+++ struts/struts2/trunk/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ListValidatorsAction.java
Mon Apr 12 10:23:23 2010
@@ -21,15 +21,15 @@
 
 package org.apache.struts2.config_browser;
 
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.struts2.util.ClassLoaderUtils;
-
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionSupport;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.validator.ActionValidatorManager;
+import com.opensymphony.xwork2.validator.Validator;
+import org.apache.struts2.util.ClassLoaderUtils;
+
+import java.util.Collections;
+import java.util.List;
 
 /**
  * ListValidatorsAction loads the validations for a given class and context
@@ -41,7 +41,7 @@ public class ListValidatorsAction extend
 
     private String clazz;
     private String context;
-    List validators = Collections.EMPTY_LIST;
+    List<Validator> validators = Collections.EMPTY_LIST;
     private ActionValidatorManager actionValidatorManager;
 
     

Modified: struts/struts2/trunk/plugins/config-browser/src/main/resources/config-browser/showValidators.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/config-browser/src/main/resources/config-browser/showValidators.ftl?rev=933175&r1=933174&r2=933175&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/config-browser/src/main/resources/config-browser/showValidators.ftl
(original)
+++ struts/struts2/trunk/plugins/config-browser/src/main/resources/config-browser/showValidators.ftl
Mon Apr 12 10:23:23 2010
@@ -27,7 +27,7 @@
     	<#if validators?exists>
         <#foreach i in validators>       
         <tr <#if i_index%2 gt 0>class="b"<#else>class="a"</#if>>
-        	<td>${i.fieldName}</td>
+        	<td>${i.fieldName!"(see expression)"}</td>
             <td>${action.stripPackage(i.class)}</td>
             <td>
             <a href="#" onClick="window.open('validatorDetails.${extension}?clazz=${clazz}&context=${context}&selected=${row}',
'Validator Details', 'resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,width=640,height=480');">details</a>

Modified: struts/struts2/trunk/plugins/config-browser/src/main/resources/config-browser/validatorDetails.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/config-browser/src/main/resources/config-browser/validatorDetails.ftl?rev=933175&r1=933174&r2=933175&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/config-browser/src/main/resources/config-browser/validatorDetails.ftl
(original)
+++ struts/struts2/trunk/plugins/config-browser/src/main/resources/config-browser/validatorDetails.ftl
Mon Apr 12 10:23:23 2010
@@ -34,8 +34,11 @@
     <#foreach prop in properties>
     	<tr <#if prop_index%2 gt 0>class="b"<#else>class="a"</#if>>
             <td>${prop.name}</td>
-            <td><#if prop.value?exists> ${prop.value?string} <#else> <b>null</b>
</#if></td>
-            <td>${prop.type.name}</td>
+            <td><#if prop.value?exists>
+                    <#if prop.value?is_collection>(size = ${prop.value?size})<#foreach
v in prop.value>${v.value}, </#foreach>
+                    <#else>${prop.value?string}</#if>
+                <#else> <b>null</b> </#if></td>
+            <td><#if prop.value?exists && prop.value?is_collection>(collection)<#else>${prop.type.name}</#if></td>
         </tr>
     </#foreach></table>
 <#call endPage>



Mime
View raw message