[seam-commits] Seam SVN: r12682 - in modules/faces/trunk: api/src/main/java/org/jboss/seam/faces/display and 14 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue May 4 16:47:48 EDT 2010


Author: lincolnthree
Date: 2010-05-04 16:47:47 -0400 (Tue, 04 May 2010)
New Revision: 12682

Added:
   modules/faces/trunk/api/src/main/java/org/jboss/seam/faces/validation/
   modules/faces/trunk/api/src/main/java/org/jboss/seam/faces/validation/InputField.java
   modules/faces/trunk/api/src/test/java/org/
   modules/faces/trunk/api/src/test/java/org/jboss/
   modules/faces/trunk/api/src/test/java/org/jboss/seam/
   modules/faces/trunk/api/src/test/java/org/jboss/seam/faces/
   modules/faces/trunk/api/src/test/java/org/jboss/seam/faces/display/
   modules/faces/trunk/api/src/test/java/org/jboss/seam/faces/display/LevelTest.java
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java
   modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/component/
   modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/component/UIValidateFormTest.java
Modified:
   modules/faces/trunk/api/src/main/java/org/jboss/seam/faces/display/Level.java
   modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml
   modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display/SeamMessage.java
   modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml
   modules/faces/trunk/impl/src/main/resources/META-INF/seam-faces.taglib.xml
   modules/faces/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider
   modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml
Log:
* Committing cross-field-validation v1 - still writing tests.

Modified: modules/faces/trunk/api/src/main/java/org/jboss/seam/faces/display/Level.java
===================================================================
--- modules/faces/trunk/api/src/main/java/org/jboss/seam/faces/display/Level.java	2010-05-04 13:12:18 UTC (rev 12681)
+++ modules/faces/trunk/api/src/main/java/org/jboss/seam/faces/display/Level.java	2010-05-04 20:47:47 UTC (rev 12682)
@@ -21,6 +21,23 @@
       this.severity = severity;
    }
 
+   public static Level valueOf(final Severity severity)
+   {
+      Level result = null;
+
+      if (severity != null)
+      {
+         for (Level l : Level.values())
+         {
+            if (l.severity.equals(severity))
+            {
+               result = l;
+            }
+         }
+      }
+      return result;
+   }
+
    public Severity getSeverity()
    {
       return severity;

Added: modules/faces/trunk/api/src/main/java/org/jboss/seam/faces/validation/InputField.java
===================================================================
--- modules/faces/trunk/api/src/main/java/org/jboss/seam/faces/validation/InputField.java	                        (rev 0)
+++ modules/faces/trunk/api/src/main/java/org/jboss/seam/faces/validation/InputField.java	2010-05-04 20:47:47 UTC (rev 12682)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.faces.validation;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.faces.validator.FacesValidator;
+import javax.faces.validator.Validator;
+import javax.inject.Qualifier;
+
+/**
+ * To be used in conjunction with <code>&lt;s:validateForm /&gt;</code> in
+ * Validators that should have their values fetched from a JSF form field.
+ * <p>
+ * Example:
+ * <p>
+ * <code>
+ * 
+ * public @{@link FacesValidator}(&quot;locationValidator&quot;) class
+ *         LocationValidator implements {@link Validator} {<p>
+ * 
+ *         &nbsp;&nbsp;&nbsp; public @Field String city;<br/> &nbsp;&nbsp;&nbsp;
+ *         public @Field String state;<br/> &nbsp;&nbsp;&nbsp; public
+ * 
+ * @Field("zip") String zipcode;<br/> <p> &nbsp;&nbsp;&nbsp; public void
+ *               validate(FacesContext context, UIComponent comp, Object
+ *               componentMap <br/> &nbsp;&nbsp;&nbsp; {<br/>
+ *               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ *               //validate like usual. <br/> &nbsp;&nbsp;&nbsp; } <p> }</code>
+ *               <p>
+ *               <b>Note:</b> The annotation value @Field("id") Specifies the
+ *               default clientId alias for which values will be bound to the
+ *               field annotated by this annotation.
+ * 
+ *               &lt;h:form id=&quot;form&quot;&gt;<br/>
+ *               &nbsp;&nbsp;&nbsp; &lt;h:inputText id=&quot;cityId&quot;
+ *               value=&quot;#{bean.city}&quot; /&gt;<br/>
+ *               &nbsp;&nbsp;&nbsp; &lt;h:inputText id=&quot;state&quot;
+ *               value=&quot;#{bean.state}&quot; /&gt;<br/>
+ *               &nbsp;&nbsp;&nbsp; &lt;h:inputText id=&quot;zip&quot;
+ *               value=&quot;#{bean.zip}&quot; /&gt;<br/>
+ *               &nbsp;&nbsp;&nbsp; &lt;h:commandButton id=&quot;submit&quot;
+ *               value=&quot;Submit&quot; action=&quot;#{bean.submit}&quot;
+ *               /&gt;
+ *               <p>
+ *               &nbsp;&nbsp;&nbsp; &lt;s:validateForm
+ *               fields=&quot;city=cityId&quot;
+ *               validatorId=&quot;<b>locationValidator</b>&quot; /&gt;<br/>
+ *               &lt;/h:form&gt; </code>
+ *               <p>
+ *               Notice in the above example, that not all fields must be
+ *               specified in the validator tag. If the Facelet field IDs match
+ *               the validator fields, the values will automatically be mapped
+ *               to the validator.
+ *               <p>
+ *               Fields can also be mapped to the validator through a simple
+ *               alias: "validatorFieldId=componentClientId", where
+ *               validatorFieldId is the name of the annotated @Field in the
+ *               Validator, and componentClientId is the ID of the input
+ *               component relative to the form in which it resides.
+ *               <p>
+ *               When writing your <b>public void validate(FacesContext context,
+ *               UIComponent comp, Object componentMap)</b> method, keep in mind
+ *               the following differences from a normal validator:
+ *               <ul>
+ *               <li>"comp" is the parent UIForm that contains this
+ *               &lt;s:validateForm /&gt; tag.</li>
+ *               <li>"componentMap" is a map of the requested input field names,
+ *               and their corresponding UIInput component objects. This allows
+ *               programmatic access to each of the components being validated.</li>
+ *               </ul>
+ * 
+ * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>
+ */
+ at Qualifier
+ at Retention(RUNTIME)
+ at Target( { FIELD })
+public @interface InputField
+{
+   @Nonbinding
+   public String value() default "";
+}
\ No newline at end of file

Added: modules/faces/trunk/api/src/test/java/org/jboss/seam/faces/display/LevelTest.java
===================================================================
--- modules/faces/trunk/api/src/test/java/org/jboss/seam/faces/display/LevelTest.java	                        (rev 0)
+++ modules/faces/trunk/api/src/test/java/org/jboss/seam/faces/display/LevelTest.java	2010-05-04 20:47:47 UTC (rev 12682)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.faces.display;
+
+import static org.junit.Assert.assertEquals;
+
+import javax.faces.application.FacesMessage;
+
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>
+ * 
+ */
+public class LevelTest
+{
+   @Test
+   public void testValueOfInfo() throws Exception
+   {
+      assertEquals(Level.INFO, Level.valueOf(FacesMessage.SEVERITY_INFO));
+   }
+
+   @Test
+   public void testValueOfWarn() throws Exception
+   {
+      assertEquals(Level.WARN, Level.valueOf(FacesMessage.SEVERITY_WARN));
+   }
+
+   @Test
+   public void testValueOfError() throws Exception
+   {
+      assertEquals(Level.ERROR, Level.valueOf(FacesMessage.SEVERITY_ERROR));
+   }
+
+   @Test
+   public void testValueOfFatal() throws Exception
+   {
+      assertEquals(Level.FATAL, Level.valueOf(FacesMessage.SEVERITY_FATAL));
+   }
+}

Modified: modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml	2010-05-04 13:12:18 UTC (rev 12681)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/components.xml	2010-05-04 20:47:47 UTC (rev 12682)
@@ -3,9 +3,97 @@
    "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
 <chapter id="components">
 	<title>Seam Faces Components</title>
+	<para>While Seam Faces does not provide layout components or other UI-design related features, it does provide
+	functional components designed to make developing JSF applications easier, more functional, more scalable, and
+	more practical.</para>
 	<para>
-		Mission statement for Faces Module components. Explain that they are functional, not UI-oriented.
+	For layout and design components, take a look at <ulink url="http://jboss.org/richfaces">RichFaces</ulink>, a 
+	UI component library specifically tailored for easy, rich web-interfaces.
 	</para>
+	<section id="basicUsage">
+		<title>Introduction</title>
+		<para>
+			In order to use the Seam Faces components, you must first add the namespace to your view file, 
+			just like the standard JSF component libraries.
+			
+			<programlisting><![CDATA[<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:s="http://jboss.com/products/seam/faces"
+      xmlns:ui="http://java.sun.com/jsf/facelets">
+      
+      <h1>This is a page using Seam Faces</h1>
+      <h:outputText value="#{bean.sayHello()}" />
+      
+</html>]]></programlisting>
+			<tip>
+				<para>
+					All Seam Faces components use the same namespace: 
+					<literal>http://jboss.com/products/seam/faces</literal>
+				</para>
+			</tip>
+		</para>
+	</section>
+	<section id="validateForm">
+		<title>&lt;s:validateForm&gt;</title>
+		<para>
+			Performing cross-field form validation is simple using the Form Validation component.
+			<programlisting><![CDATA[<h:form id="locationForm">
+     <h:inputText id="city" value="#{bean.author}" />
+     <h:inputText id="state" value="#{bean.title}" />
+     <h:inputText id="zip" value="#{bean.text}" />
+     <h:commandButton id="submit" value="Submit" action="#{bean.submitPost}" />
+                  
+      <s:validateForm validatorId="locationValidator" />
+</h:form>]]></programlisting> 
+
+
+
+			The corresponding Validator for the example above would look something like this:
+			<programlisting>@FacesValidator("locationValidator")
+public class LocationValidator implements Validator
+{
+   @Inject
+   Directory directory;
+
+   @InputField
+   private String city;
+
+   @InputField
+   private String state;
+
+   @InputField
+   private String zip;
+
+   @Override
+   public void validate(final FacesContext context, final UIComponent comp, final Object values) throws ValidatorException
+   {
+      if(!directory.exists(city, state, zip))
+      {
+         throw new ValidatorException(new FacesMessage("Multiple fields-- failed validation baby!"));
+      }
+   }
+}</programlisting>
+
+
+
+			Notice that the IDs of the inputText components match the IDs of your Validator 
+			@InputFields. The name of the @InputField will automatically
+			be matched to the ID of the input component, unless overridden by using a field
+			ID alias (see below.) Notice that "zip" will still be referenced normally; you need only
+			specify aliases for fields that differ in name from the Validator @InputFields.
+			<programlisting><![CDATA[<h:form id="locationForm">
+     <h:inputText id="cityId" value="#{bean.author}" />
+     <h:inputText id="stateId" value="#{bean.title}" />
+     <h:inputText id="zip" value="#{bean.text}" />
+     <h:commandButton id="submit" value="Submit" action="#{bean.submitPost}" />
+                  
+      <s:validateForm fields="city=cityId state=stateId" validatorId="locationValidator" />
+</h:form>]]></programlisting>
+
+
+		</para>
+	</section>
 	<section id="viewaction">
 		<title>&lt;s:viewAction&gt;</title>
 		<para>

Added: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java	                        (rev 0)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/component/UIValidateForm.java	2010-05-04 20:47:47 UTC (rev 12682)
@@ -0,0 +1,281 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.faces.component;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.FacesComponent;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIForm;
+import javax.faces.component.UIInput;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>
+ * 
+ */
+ at FacesComponent(UIValidateForm.COMPONENT_TYPE)
+public class UIValidateForm extends UIInput
+{
+   public static final String COMPONENT_TYPE = "org.jboss.seam.faces.ValidateForm";
+   public static final String COMPONENT_FAMILY = "org.jboss.seam.faces.ValidateForm";
+
+   private String validatorId = "";
+   private String fields = "";
+
+   private final Logger log = LoggerFactory.getLogger(UIValidateForm.class);
+
+   private final Map<String, UIInput> components = Collections.synchronizedMap(new HashMap<String, UIInput>());
+
+   @Override
+   public String getFamily()
+   {
+      return COMPONENT_FAMILY;
+   }
+
+   @Override
+   public void validate(final FacesContext context)
+   {
+      UIComponent parent = this.getParent();
+      while (!(parent instanceof UIForm))
+      {
+         parent = parent.getParent();
+         if ((parent == null) || (parent instanceof UIViewRoot))
+         {
+            throw new IllegalStateException("The form validator must be placed within a UIForm");
+         }
+      }
+
+      Validator validator = context.getApplication().createValidator(validatorId);
+      if (validator == null)
+      {
+         throw new IllegalArgumentException("Could not create Validator with id: [" + validatorId + "]");
+      }
+
+      try
+      {
+         locateComponents(validator, parent, fields);
+         injectFieldValues(validator, context);
+         validator.validate(context, parent, components);
+      }
+      catch (ValidatorException e)
+      {
+         setComponentsInvalid();
+         setValid(false);
+         context.addMessage(null, e.getFacesMessage());
+      }
+   }
+
+   public void locateComponents(final Validator validator, final UIComponent component, final String fields)
+   {
+      UIForm form = (UIForm) component;
+
+      List<String> validatorFieldIds = getValidatorFieldNames(validator);
+
+      if ((fields != null) && !"".equals(fields.trim()))
+      {
+         List<String> clientFieldIds = Arrays.asList(fields.split("\\s+"));
+         for (String field : clientFieldIds)
+         {
+            List<String> mapping = Arrays.asList(field.split("\\s*=\\s*"));
+            String clientValidatorFieldId = mapping.get(0);
+            if (validatorFieldIds.contains(clientValidatorFieldId))
+            {
+               validatorFieldIds.remove(clientValidatorFieldId);
+            }
+            else
+            {
+               throw new IllegalArgumentException("Unknown field: [" + field + "] for Validator of type: " + validator.getClass().getName() + ", expected fields: " + getValidatorFieldNames(validator));
+            }
+
+            String clientFieldId = clientValidatorFieldId;
+
+            if (mapping.size() > 1)
+            {
+               clientFieldId = mapping.get(1);
+            }
+
+            UIComponent comp = form.findComponent(clientFieldId);
+            if ((comp != null) && (comp instanceof UIInput))
+            {
+               components.put(clientValidatorFieldId, (UIInput) comp);
+            }
+            else
+            {
+               log.warn("Could not locate component in form [" + form.getClientId() + ":" + clientValidatorFieldId + "]");
+            }
+         }
+      }
+
+      for (String field : validatorFieldIds)
+      {
+         UIComponent comp = form.findComponent(field);
+         if ((comp != null) && (comp instanceof UIInput))
+         {
+            components.put(field, (UIInput) comp);
+         }
+         else
+         {
+            log.warn("Could not locate component in form [" + form.getClientId() + ":" + field + "] while processing Validator:" + validator.getClass().getName());
+         }
+      }
+   }
+
+   private void injectFieldValues(final Validator validator, final FacesContext context)
+   {
+      Field[] declaredFields = validator.getClass().getDeclaredFields();
+      for (Field f : declaredFields)
+      {
+         String name = getFieldName(f);
+
+         boolean restricted = false;
+         if (!f.isAccessible())
+         {
+            restricted = true;
+            f.setAccessible(true);
+         }
+
+         try
+         {
+            UIInput input = components.get(name);
+            if (input != null)
+            {
+               Object value = input.getValue();
+               f.set(validator, value);
+            }
+         }
+         catch (Exception e)
+         {
+            throw new RuntimeException("Could not inject value into validator: " + validator.getClass().getName(), e);
+         }
+
+         if (restricted)
+         {
+            f.setAccessible(false);
+         }
+      }
+
+      return;
+   }
+
+   private void setComponentsInvalid()
+   {
+      for (UIComponent comp : components.values())
+      {
+         if ((comp != null) && (comp instanceof UIInput))
+         {
+            UIInput input = (UIInput) comp;
+            input.setValid(false);
+         }
+      }
+   }
+
+   private List<String> getValidatorFieldNames(final Validator validator)
+   {
+      List<String> result = new ArrayList<String>();
+      Field[] declaredFields = validator.getClass().getDeclaredFields();
+      for (Field f : declaredFields)
+      {
+         if (f.isAnnotationPresent(org.jboss.seam.faces.validation.InputField.class))
+         {
+            result.add(getFieldName(f));
+         }
+      }
+      return result;
+   }
+
+   private String getFieldName(final Field f)
+   {
+      String name = "";
+      if (f.isAnnotationPresent(org.jboss.seam.faces.validation.InputField.class))
+      {
+         name = f.getAnnotation(org.jboss.seam.faces.validation.InputField.class).value();
+      }
+      if ("".equals(name))
+      {
+         name = f.getName();
+      }
+      return name;
+   }
+
+   /*
+    * Prevent any rendered output.
+    */
+
+   @Override
+   public void encodeAll(final FacesContext context) throws IOException
+   {
+   }
+
+   @Override
+   public void encodeBegin(final FacesContext context) throws IOException
+   {
+   }
+
+   @Override
+   public void encodeEnd(final FacesContext context) throws IOException
+   {
+   }
+
+   @Override
+   public void encodeChildren(final FacesContext context) throws IOException
+   {
+   }
+
+   /*
+    * Getters & Setters
+    */
+
+   public String getFields()
+   {
+      return fields;
+   }
+
+   public void setFields(final String fields)
+   {
+      this.fields = fields;
+   }
+
+   public String getValidatorId()
+   {
+      return validatorId;
+   }
+
+   public void setValidatorId(final String validatorId)
+   {
+      this.validatorId = validatorId;
+   }
+}

Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display/SeamMessage.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display/SeamMessage.java	2010-05-04 13:12:18 UTC (rev 12681)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/display/SeamMessage.java	2010-05-04 20:47:47 UTC (rev 12682)
@@ -40,6 +40,12 @@
       this.level = level;
    }
 
+   @Override
+   public String toString()
+   {
+      return "SeamMessage [clientId=" + clientId + ", details=" + details + ", level=" + level + ", message=" + message + "]";
+   }
+
    public Message component(final String clientId)
    {
       this.clientId = clientId;

Modified: modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml	2010-05-04 13:12:18 UTC (rev 12681)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/faces-config.xml	2010-05-04 20:47:47 UTC (rev 12682)
@@ -48,9 +48,4 @@
 		</system-event-listener>
 	</application>
 
-	<component>
-		<component-type>org.jboss.seam.faces.ViewAction</component-type>
-		<component-class>org.jboss.seam.faces.component.UIViewAction</component-class>
-	</component>
-
-</faces-config>
+</faces-config>
\ No newline at end of file

Modified: modules/faces/trunk/impl/src/main/resources/META-INF/seam-faces.taglib.xml
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/seam-faces.taglib.xml	2010-05-04 13:12:18 UTC (rev 12681)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/seam-faces.taglib.xml	2010-05-04 20:47:47 UTC (rev 12682)
@@ -31,5 +31,11 @@
          <component-type>org.jboss.seam.faces.ViewAction</component-type>
       </component>
    </tag>
+   <tag>
+      <tag-name>validateForm</tag-name>
+      <component>
+         <component-type>org.jboss.seam.faces.ValidateForm</component-type>
+      </component>
+   </tag>
 
 </facelet-taglib>
\ No newline at end of file

Modified: modules/faces/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider	2010-05-04 13:12:18 UTC (rev 12681)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider	2010-05-04 20:47:47 UTC (rev 12682)
@@ -1 +1,3 @@
 org.jboss.seam.faces.beanManager.FacesServletContextBeanManagerProvider
+org.jboss.weld.extensions.beanManager.DefaultJndiBeanManagerProvider
+org.jboss.weld.extensions.beanManager.JBossJndiBeanManagerProvider

Modified: modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml
===================================================================
--- modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml	2010-05-04 13:12:18 UTC (rev 12681)
+++ modules/faces/trunk/impl/src/main/resources/META-INF/web-fragment.xml	2010-05-04 20:47:47 UTC (rev 12682)
@@ -3,7 +3,7 @@
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd">
 	<name>seamfaces</name>
-
+	
 	<listener>
 		<listener-class>org.jboss.seam.faces.beanManager.BeanManagerServletContextListener</listener-class>
 	</listener>

Added: modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/component/UIValidateFormTest.java
===================================================================
--- modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/component/UIValidateFormTest.java	                        (rev 0)
+++ modules/faces/trunk/impl/src/test/java/org/jboss/seam/faces/component/UIValidateFormTest.java	2010-05-04 20:47:47 UTC (rev 12682)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.faces.component;
+
+import javax.faces.component.UIViewRoot;
+
+import org.jboss.test.faces.mock.application.MockApplication;
+import org.jboss.test.faces.mock.context.MockFacesContext;
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com>Lincoln Baxter, III</a>
+ * 
+ */
+public class UIValidateFormTest
+{
+
+   private final MockFacesContext facesContext = new MockFacesContext();
+   private final MockApplication application = new MockApplication();
+   private static final UIViewRoot uiViewRoot = new UIViewRoot();
+
+   static
+   {
+      uiViewRoot.setViewId("foo.xhtml");
+   }
+
+   @Test
+   public void testCanLocateChildComponents() throws Exception
+   {
+      UIValidateForm vf = new UIValidateForm();
+   }
+}



More information about the seam-commits mailing list