svn commit: r442097 - in /struts/struts2/trunk: apps/showcase/pom.xml apps/showcase/src/main/resources/struts.xml core/src/main/resources/struts-default.xml

2006-09-10 Thread mrdon
Author: mrdon
Date: Sun Sep 10 21:47:47 2006
New Revision: 442097

URL: http://svn.apache.org/viewvc?view=rev&rev=442097
Log:
Adding missing fileupload dep for showcase, added checkbox interceptor to 
proper stacks

WW-1349 WW-992

Modified:
struts/struts2/trunk/apps/showcase/pom.xml
struts/struts2/trunk/apps/showcase/src/main/resources/struts.xml
struts/struts2/trunk/core/src/main/resources/struts-default.xml

Modified: struts/struts2/trunk/apps/showcase/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/pom.xml?view=diff&rev=442097&r1=442096&r2=442097
==
--- struts/struts2/trunk/apps/showcase/pom.xml (original)
+++ struts/struts2/trunk/apps/showcase/pom.xml Sun Sep 10 21:47:47 2006
@@ -61,6 +61,12 @@
  rife-continuations
  0.0.2
  
+ 
+ commons-fileupload
+ commons-fileupload
+ 1.1
+ 
+
  
 
 

Modified: struts/struts2/trunk/apps/showcase/src/main/resources/struts.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/resources/struts.xml?view=diff&rev=442097&r1=442096&r2=442097
==
--- struts/struts2/trunk/apps/showcase/src/main/resources/struts.xml (original)
+++ struts/struts2/trunk/apps/showcase/src/main/resources/struts.xml Sun Sep 10 
21:47:47 2006
@@ -47,6 +47,7 @@
 
 
 
+   
 

 

Modified: struts/struts2/trunk/core/src/main/resources/struts-default.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/struts-default.xml?view=diff&rev=442097&r1=442096&r2=442097
==
--- struts/struts2/trunk/core/src/main/resources/struts-default.xml (original)
+++ struts/struts2/trunk/core/src/main/resources/struts-default.xml Sun Sep 10 
21:47:47 2006
@@ -66,7 +66,7 @@
 
 
 
-
+
 
 
 
@@ -124,6 +124,7 @@
 
 
 
+
 
 
 
@@ -156,8 +157,8 @@
 
 
 
-
 
+
 
 
 




svn commit: r442100 - /struts/sandbox/trunk/tiles/tiles-core/pom.xml

2006-09-10 Thread wsmoak
Author: wsmoak
Date: Sun Sep 10 22:06:53 2006
New Revision: 442100

URL: http://svn.apache.org/viewvc?view=rev&rev=442100
Log:
Configure the jar plugin to add specification and implementation entries.
SB-19

Modified:
struts/sandbox/trunk/tiles/tiles-core/pom.xml

Modified: struts/sandbox/trunk/tiles/tiles-core/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/pom.xml?view=diff&rev=442100&r1=442099&r2=442100
==
--- struts/sandbox/trunk/tiles/tiles-core/pom.xml (original)
+++ struts/sandbox/trunk/tiles/tiles-core/pom.xml Sun Sep 10 22:06:53 2006
@@ -63,6 +63,19 @@
 
  
   
+   
+   
+   maven-jar-plugin
+   
+   
+   
+   
true
+   
true
+   
+   
+   
+   
+   
 

 




svn commit: r442103 - /struts/sandbox/trunk/tiles/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd

2006-09-10 Thread wsmoak
Author: wsmoak
Date: Sun Sep 10 22:12:59 2006
New Revision: 442103

URL: http://svn.apache.org/viewvc?view=rev&rev=442103
Log:
Establish a version 2.0 tiles-config dtd.
SB-30

Added:

struts/sandbox/trunk/tiles/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd
  - copied unchanged from r440082, 
struts/sandbox/trunk/tiles/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_1_1.dtd



svn commit: r442105 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/CheckboxInterceptor.java

2006-09-10 Thread mrdon
Author: mrdon
Date: Sun Sep 10 22:36:37 2006
New Revision: 442105

URL: http://svn.apache.org/viewvc?view=rev&rev=442105
Log:
Forgot to add the actual checkbox interceptor :)
WW-992

Added:

struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/CheckboxInterceptor.java

Added: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/CheckboxInterceptor.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/CheckboxInterceptor.java?view=auto&rev=442105
==
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/CheckboxInterceptor.java
 (added)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/CheckboxInterceptor.java
 Sun Sep 10 22:36:37 2006
@@ -0,0 +1,81 @@
+/*
+ * $Id: CheckboxListTest.java 439747 2006-09-03 09:22:46Z mrdon $
+ *
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.struts2.interceptor;
+
+import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.interceptor.Interceptor;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * Looks for a hidden identification field that specifies the original value 
of the checkbox.
+ * If the checkbox isn't submitted, insert it into the parameters as if it was 
with the value 
+ * of 'false'.
+ * 
+ * The default value of an unchecked box can be overridden by setting the 
'uncheckedValue' property.
+ */
+public class CheckboxInterceptor implements Interceptor {
+
+/** Auto-generated serialization id */
+private static final long serialVersionUID = -586878104807229585L;
+
+private String uncheckedValue = Boolean.FALSE.toString();
+
+public void destroy() {
+}
+
+public void init() {
+}
+
+public String intercept(ActionInvocation ai) throws Exception {
+Map parameters = ai.getInvocationContext().getParameters();
+Map newParams = new HashMap();
+Set keys = parameters.keySet();
+for (Iterator iterator = keys.iterator(); iterator.hasNext();) 
{
+String key = iterator.next();
+
+if (key.startsWith("__checkbox_")) {
+String name = key.substring("__checkbox_".length());
+
+iterator.remove();
+
+// is this checkbox checked/submitted?
+if (!parameters.containsKey(name)) {
+// if not, let's be sure to default the value to false
+newParams.put(name, uncheckedValue);
+}
+}
+}
+
+parameters.putAll(newParams);
+
+return ai.invoke();
+}
+
+/**
+ * Overrides the default value for an unchecked checkbox
+ * 
+ * @param uncheckedValue The uncheckedValue to set
+ */
+public void setUncheckedValue(String uncheckedValue) {
+this.uncheckedValue = uncheckedValue;
+}
+}




[Struts Wiki] Update of "JinHao" by JinHao

2006-09-10 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Struts Wiki" for change 
notification.

The following page has been changed by JinHao:
http://wiki.apache.org/struts/JinHao

The comment on the change is:
my first edition

New page:
My first page,no real value.


svn commit: r442080 - /struts/struts2/trunk/extras/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java

2006-09-10 Thread husted
Author: husted
Date: Sun Sep 10 20:06:36 2006
New Revision: 442080

URL: http://svn.apache.org/viewvc?view=rev&rev=442080
Log:
XW-414  Extract oscore dependency

Modified:

struts/struts2/trunk/extras/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java

Modified: 
struts/struts2/trunk/extras/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/extras/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java?view=diff&rev=442080&r1=442079&r2=442080
==
--- 
struts/struts2/trunk/extras/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
 (original)
+++ 
struts/struts2/trunk/extras/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
 Sun Sep 10 20:06:36 2006
@@ -41,7 +41,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import com.opensymphony.util.TextUtils;
+import com.opensymphony.xwork2.util.TextUtils;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.dispatcher.StrutsResultSupport;
 import com.opensymphony.xwork2.ActionInvocation;




svn commit: r442085 - in /struts/struts2/trunk/core/src: main/java/org/apache/struts2/jsf/ main/java/org/apache/struts2/sitegraph/collectors/ main/resources/ main/resources/template/simple/ test/resou

2006-09-10 Thread mrdon
Author: mrdon
Date: Sun Sep 10 21:03:24 2006
New Revision: 442085

URL: http://svn.apache.org/viewvc?view=rev&rev=442085
Log:
Added automatic checkbox handling code that detect an unchecked checkbox and 
add it as a parameter with a default (usually 'false') value.  Uses a specially
named hidden field to detect unsubmitted checkboxes.  The default unchecked 
value
is overridable for non-boolean value'd checkboxes. Minor source formatting and 
cleaned
out an empty directory.

WW-992 WW-1372 WW-1349

Removed:

struts/struts2/trunk/core/src/main/java/org/apache/struts2/sitegraph/collectors/
Modified:

struts/struts2/trunk/core/src/main/java/org/apache/struts2/jsf/FacesSetupInterceptor.java
struts/struts2/trunk/core/src/main/resources/struts-default.xml
struts/struts2/trunk/core/src/main/resources/template/simple/checkbox.ftl

struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Checkbox-1.txt

struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Checkbox-2.txt

struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Checkbox-3.txt

struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Checkbox-4.txt

struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Checkbox-5.txt

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/jsf/FacesSetupInterceptor.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/jsf/FacesSetupInterceptor.java?view=diff&rev=442085&r1=442084&r2=442085
==
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/jsf/FacesSetupInterceptor.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/jsf/FacesSetupInterceptor.java
 Sun Sep 10 21:03:24 2006
@@ -59,21 +59,21 @@
  * Example struts.xml configuration:
  * 
  * 
- *  
- *  
- *  
- *  
- *  
- *  
- *  org.apache.struts2.jsf.StrutsNavigationHandler
- *  
- *  
- *  
- *  org.apache.myfaces.el.VariableResolverImpl
- * ,org.apache.struts2.jsf.StrutsVariableResolver
- *  
- *  org.apache.shale.tiles.TilesViewHandler
- *  
+ *   
+ *   
+ *   
+ *   
+ *   
+ *   
+ *   org.apache.struts2.jsf.StrutsNavigationHandler
+ *   
+ *   
+ *   
+ *   org.apache.myfaces.el.VariableResolverImpl
+ *  ,org.apache.struts2.jsf.StrutsVariableResolver
+ *   
+ *   org.apache.shale.tiles.TilesViewHandler
+ *   
  * 
  * 
  * 
@@ -209,16 +209,16 @@
  *The action invocation
  */
 public String intercept(ActionInvocation invocation) throws Exception {
-if (facesContextFactory != null)
-{
+if (facesContextFactory != null) {
 if (isFacesAction(invocation)) {
 
 invocation.getInvocationContext().put(
 FacesInterceptor.FACES_ENABLED, Boolean.TRUE);
 
-FacesContext facesContext = 
facesContextFactory.getFacesContext(
-ServletActionContext.getServletContext(),
-ServletActionContext.getRequest(), ServletActionContext
+FacesContext facesContext = facesContextFactory
+.getFacesContext(ServletActionContext
+.getServletContext(), ServletActionContext
+.getRequest(), ServletActionContext
 .getResponse(), lifecycle);
 
 setLifecycle(lifecycle);
@@ -230,7 +230,8 @@
 }
 }
 } else {
-throw new StrutsException("Unable to initialize jsf interceptors 
probably due missing JSF implementation libraries",
+throw new StrutsException(
+"Unable to initialize jsf interceptors probably due 
missing JSF implementation libraries",
 invocation.getProxy().getConfig());
 }
 return invocation.invok