Seam SVN: r12204 - in modules/xml/trunk: docs/en-US and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-03-16 09:10:58 -0400 (Tue, 16 Mar 2010)
New Revision: 12204
Modified:
modules/xml/trunk/docs/en-US/xml-general.xml
modules/xml/trunk/parent/pom.xml
modules/xml/trunk/readme.txt
Log:
document editing, minor
Modified: modules/xml/trunk/docs/en-US/xml-general.xml
===================================================================
--- modules/xml/trunk/docs/en-US/xml-general.xml 2010-03-16 13:05:49 UTC (rev 12203)
+++ modules/xml/trunk/docs/en-US/xml-general.xml 2010-03-16 13:10:58 UTC (rev 12204)
@@ -17,16 +17,16 @@
<title>Getting Started</title>
<para>By default XML files are discovered from the classpath. The extension looks for an XML file in the following locations:</para>
<itemizedlist>
- <listitem><para><literal>/WEB-INF/beans.xml</literal></para></listitem>
- <listitem><para><literal>/META-INF/beans.xml</literal></para></listitem>
- <listitem><para><literal>/WEB-INF/seam-beans.xml</literal></para></listitem>
- <listitem><para><literal>/META-INF/seam-beans.xml</literal></para></listitem>
+ <listitem><literal>/WEB-INF/beans.xml</literal></listitem>
+ <listitem><literal>/META-INF/beans.xml</literal></listitem>
+ <listitem><literal>/WEB-INF/seam-beans.xml</literal></listitem>
+ <listitem><literal>/META-INF/seam-beans.xml</literal></listitem>
</itemizedlist>
- <para>The beans.xml file is the preferred way of configuring beans via XML, however it may be possible that some JSR-299 implementations will not allow this,
- so seam-beans.xml is provided as an alternative. </para>
+ <para>The <literal>beans.xml</literal> file is the preferred way of configuring beans via XML, however it may be possible that some JSR-299 implementations will not allow this,
+ so <literal>seam-beans.xml</literal> is provided as an alternative. </para>
- <para>Lets start with a simple example</para>
+ <para>Let's start with a simple example:</para>
<programlisting>
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
@@ -47,20 +47,26 @@
</test:value>
</test:ProducerBean>
- <test:RecieverBean>
+ <test:ReceiverBean>
<test:value>
<test:ProducerQualifier/>
<s:Inject/>
</test:value>
- </test:RecieverBean>
+ </test:ReceiverBean>
</beans>
]]>
</programlisting>
- <para>You will notice that two new namspace declarations have been added to the beans.xml file: <literal>urn:java:seam:core</literal> and <literal>urn:java:org.jboss.seam.xml.test.injection</literal>.
- <literal>urn:java:seam:core</literal> is the main namespace used by the XML extension, we will cover exactly what lives in this namespace later.
- <literal>urn:java:org.jboss.seam.xml.test.injection</literal> is used to resolve classes in the java package <literal>org.jboss.seam.xml.test.injection</literal>, so in the exaple above
- <literal><test:ProducerBean></literal> resolves to <literal>org.jboss.seam.xml.test.injection.ProducerBean</literal>.</para>
+
+ <para>You will notice that two new namspace declarations have been added to the
+ <literal>beans.xml</literal> file: <literal>urn:java:seam:core</literal> and
+ <literal>urn:java:org.jboss.seam.xml.test.injection</literal>. The
+ <literal>urn:java:seam:core</literal> namespace is the main one used by the XML
+ extension, we will cover exactly what lives in this namespace later. The
+ <literal>urn:java:org.jboss.seam.xml.test.injection</literal> namespace is used
+ to resolve classes in the java package <literal>org.jboss.seam.xml.test.injection</literal>,
+ so in the example above <literal><test:ProducerBean></literal> resolves to
+ <literal>org.jboss.seam.xml.test.injection.ProducerBean</literal>.</para>
<programlisting>
<![CDATA[
<test:ProducerQualifier>
@@ -69,7 +75,8 @@
]]>
</programlisting>
- <para>The first entry in the file defines a new qualifier. <literal>ProducerQualifier</literal> is an annotation in the package <literal>org.jboss.seam.xml.test.injection</literal>.</para>
+ <para>The first entry in the file defines a new qualifier. <literal>ProducerQualifier</literal>
+ is an annotation in the package <literal>org.jboss.seam.xml.test.injection</literal>.</para>
<programlisting>
<![CDATA[
@@ -83,8 +90,10 @@
]]>
</programlisting>
- <para>The next entry in the file is a bean declaration. The bean class is <literal>org.jboss.seam.xml.test.injection.ProducerBean</literal>.
- It is important to note that this declaration does not change the existing declaration of ProducerBean, instead it installs a new bean. In
+ <para>The next entry in the file is a bean declaration. The bean class is
+ <literal>org.jboss.seam.xml.test.injection.ProducerBean</literal>.
+ It is important to note that this declaration does not change the existing declaration of
+ <literal>ProducerBean</literal>, instead it installs a new bean. In
this instance there will be two <literal>ProducerBean</literal> CDI beans.</para>
<para>This bean has a field called <literal>value</literal>, this field is configured to be a producer field using XML (it is also possible to configure producer
@@ -93,31 +102,28 @@
field. The <literal><s:value></literal> element defines an initial value for the field.</para>
<para>Child elements of fields, methods and classes that resolve to Annotation types are considered to be annotations on the corresponding element,
- so the corresponding java declaration for the XML above would be:</para>
+ so the corresponding Java declaration for the XML above would be:</para>
- <programlisting>
- <![CDATA[
-public class ProducerBean
-{
+ <programlisting><![CDATA[
+public class ProducerBean {
@Produces
@ProducerQualifier
public String value = "hello world";
}
- ]]>
- </programlisting>
- <programlisting>
- <![CDATA[
-<test:RecieverBean>
+ ]]></programlisting>
+
+ <programlisting><![CDATA[
+<test:ReceiverBean>
<test:value>
<test:ProducerQualifier/>
<s:Inject/>
</test:value>
-</test:RecieverBean>
- ]]>
- </programlisting>
+</test:ReceiverBean>
+ ]]></programlisting>
- <para>The XML above declares a new Bean that injects the value that was produced above. In this case the <literal>@Inject</literal> annotation is applied instead of
- <literal>@Produces</literal> and no initial value is set.</para>
+ <para>The XML above declares a new bean that injects the value that was produced above.
+ In this case the <literal>@Inject</literal> annotation is applied instead of
+ <literal>@Produces</literal> and no initial value is set.</para>
</section>
<section>
@@ -160,18 +166,23 @@
<listitem><para><literal>javax.interceptor</literal></para></listitem>
</itemizedlist>
- <para>So the <literal><s:Produces></literal> element above actually resolved to <literal>java.enterprise.inject.Produces</literal>
- and the <literal><s:Inject></literal> element resolved to <literal>javax.inject.Inject</literal>.</para>
+ <para>So the <literal><s:Produces></literal> element above actually resolves
+ to <literal>java.enterprise.inject.Produces</literal>
+ and the <literal><s:Inject></literal> element resolves to <literal>javax.inject.Inject</literal>.</para>
</section>
<section>
<title>Overriding and extending beans</title>
- <para>The may be cases where you want to modify an existing bean rather that adding a new one. The <literal><s:override></literal> and <literal><s:extends></literal>
- tags allow you to do this. The <literal><s:override></literal> tag prevents the existing bean from being installed, and registers a new one with the given configuration.
- The <literal><s:extends></literal> tag allows you to add extra configuration to an existing bean.</para>
- <programlisting>
- <![CDATA[
+ <para>There may be cases where you want to modify an existing bean rather than
+ adding a new one. The <literal><s:override></literal> and
+ <literal><s:extends></literal> tags allow you to do this. The
+ <literal><s:override></literal> tag prevents the existing bean from being
+ installed, and registers a new one with the given configuration. The
+ <literal><s:extends></literal> tag allows you to add extra configuration
+ to an existing bean.</para>
+
+ <programlisting><![CDATA[
<test:MyBean>
<s:extends>
<test:NewQualifier/>
@@ -269,21 +280,17 @@
</test:MethodBean>
</beans>
-public class MethodBean
-{
+public class MethodBean {
- public int method()
- {
+ public int method() {
return 1;
}
- public int method(MethodValueBean bean)
- {
+ public int method(MethodValueBean bean) {
return bean.value + 1;
}
- public void method(MethodValueBean[][] beans)
- {
+ public void method(MethodValueBean[][] beans) {
//do stuff
}
@@ -292,14 +299,18 @@
]]>
</programlisting>
- <para>In this instance <literal>MethodBean</literal> has three methods, all of them rather imaginatively named <literal>method</literal>.
- The first <literal><test:method></literal> entry in the XML file configures the method that takes no arguments.
- The <literal><s:Produces></literal> element makes it into a producer method. The next entry in the file configures
- the method that takes a <literal>MethodValueBean</literal> as a parameter. The final entry configures a method that takes a two
- dimensional array of<literal>MethodValueBean</literal>'s as a parameter. Method Parameters a specified inside the <literal><s:parameters></literal>
- tag. If these parameters have annotation children they are taken to be annotations on the parameter. </para>
+ <para>In this instance <literal>MethodBean</literal> has three methods, all of them rather
+ imaginatively named <literal>method</literal>. The first <literal><test:method></literal>
+ entry in the XML file configures the method that takes no arguments. The
+ <literal><s:Produces></literal> element makes it into a producer method. The next
+ entry in the file configures the method that takes a <literal>MethodValueBean</literal>
+ as a parameter. The final entry configures a method that takes a two
+ dimensional array of<literal>MethodValueBean</literal>'s as a parameter.
+ Method parameters are specified inside the <literal><s:parameters></literal>
+ element. If these parameters have annotation children they are taken to be annotations on
+ the parameter. </para>
- <para>The corresponding java declaration for the xml above would be:</para>
+ <para>The corresponding Java declaration for the XML above would be:</para>
<programlisting>
<![CDATA[
@Produces
@@ -333,15 +344,12 @@
<section>
<title>Annotation Members</title>
- <para>It is also possible to set the value of annotation members by. For example:</para>
+ <para>It is also possible to set the value of annotation members. For example:</para>
<programlisting>
<![CDATA[
-public @interface OtherQualifier
-{
+public @interface OtherQualifier {
String value1();
-
int value2();
-
QualifierEnum value();
}
@@ -360,8 +368,8 @@
<section>
<title>More Information</title>
- <para>For further information look at the units tests in the seam-xml distribution, also the JSR-299
- public review draft section on XML Configuration was the base for this extension,
+ <para>For further information look at the units tests in the seam-xml distribution, also the
+ JSR-299 Public Review Draft section on XML Configuration was the base for this extension,
so it may also be worthwhile reading.</para>
</section>
Modified: modules/xml/trunk/parent/pom.xml
===================================================================
--- modules/xml/trunk/parent/pom.xml 2010-03-16 13:05:49 UTC (rev 12203)
+++ modules/xml/trunk/parent/pom.xml 2010-03-16 13:10:58 UTC (rev 12204)
@@ -28,7 +28,7 @@
<version>2.2-beta-5</version>
<configuration>
<descriptors>
- <descriptor>assembly.xml</descriptor>
+ <descriptor>../assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
Modified: modules/xml/trunk/readme.txt
===================================================================
--- modules/xml/trunk/readme.txt 2010-03-16 13:05:49 UTC (rev 12203)
+++ modules/xml/trunk/readme.txt 2010-03-16 13:10:58 UTC (rev 12204)
@@ -32,7 +32,7 @@
Forums: http://www.seamframework.org/Community/SeamUsers
Source Code:
http://anonsvn.jboss.org/repos/seam/modules/xml/
-Issue Tracking: http://jira.jboss.org/jira/browse/JBSEAM
+Issue Tracking: http://jira.jboss.org/jira/browse/SEAMXML
14 years, 9 months
Seam SVN: r12203 - branches/community/Seam_2_2/src/test/ftest/examples.
by seam-commits@lists.jboss.org
Author: kpiwko(a)redhat.com
Date: 2010-03-16 09:05:49 -0400 (Tue, 16 Mar 2010)
New Revision: 12203
Modified:
branches/community/Seam_2_2/src/test/ftest/examples/build.xml
Log:
JBQA-3230
Modified: branches/community/Seam_2_2/src/test/ftest/examples/build.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/build.xml 2010-03-16 00:15:32 UTC (rev 12202)
+++ branches/community/Seam_2_2/src/test/ftest/examples/build.xml 2010-03-16 13:05:49 UTC (rev 12203)
@@ -281,6 +281,7 @@
<classpath>
<pathelement location="${container.home}/bin/run.jar" />
</classpath>
+ <sysproperty key="java.endorsed.dirs" value="${container.home}/lib/endorsed" />
<jvmarg line="${container.jvm.arguments}" />
<arg line="-c ${jboss.domain} -b ${jboss.host}" />
</java>
14 years, 9 months
Seam SVN: r12202 - branches/enterprise/JBPAPP_5_0.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-03-15 20:15:32 -0400 (Mon, 15 Mar 2010)
New Revision: 12202
Modified:
branches/enterprise/JBPAPP_5_0/build.xml
Log:
JBPAPP-3001
Modified: branches/enterprise/JBPAPP_5_0/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build.xml 2010-03-15 20:29:42 UTC (rev 12201)
+++ branches/enterprise/JBPAPP_5_0/build.xml 2010-03-16 00:15:32 UTC (rev 12202)
@@ -618,7 +618,11 @@
<entry key="qualifier" value="${qualifier}" />
</propertyfile>
<copy file="build.xml" todir="${dist.dir}" />
- <copy file="seam" todir="${dist.dir}" />
+ <!-- <copy file="seam" todir="${dist.dir}" /> -->
+ <exec executable="cp">
+ <arg value="seam"/>
+ <arg value="${dist.dir}/seam"/>
+ </exec>
<copy file="seam-text.g" todir="${dist.dir}" />
<copy file="seam.bat" todir="${dist.dir}" />
<copy todir="${dist.dir}">
14 years, 9 months
Seam SVN: r12201 - in modules/faces/trunk/src/main/java: org/jboss/seam/faces and 3 other directories.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-03-15 16:29:42 -0400 (Mon, 15 Mar 2010)
New Revision: 12201
Modified:
modules/faces/trunk/src/main/java/javax/faces/bean/FlashScoped.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/SeamFacesException.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/MethodBindingMethodExpressionAdapter.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FacesContextProducer.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedExtension.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedExtension.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/international/FacesLocaleResolver.java
Log:
* Applied Seam code style formatting
Modified: modules/faces/trunk/src/main/java/javax/faces/bean/FlashScoped.java
===================================================================
--- modules/faces/trunk/src/main/java/javax/faces/bean/FlashScoped.java 2010-03-13 18:41:27 UTC (rev 12200)
+++ modules/faces/trunk/src/main/java/javax/faces/bean/FlashScoped.java 2010-03-15 20:29:42 UTC (rev 12201)
@@ -20,6 +20,7 @@
@Documented
@Target(ElementType.TYPE)
@Retention(value = RetentionPolicy.RUNTIME)
-public @interface FlashScoped {
+public @interface FlashScoped
+{
}
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/SeamFacesException.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/SeamFacesException.java 2010-03-13 18:41:27 UTC (rev 12200)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/SeamFacesException.java 2010-03-15 20:29:42 UTC (rev 12201)
@@ -6,17 +6,18 @@
package org.jboss.seam.faces;
/**
- *
- * @author lbaxter
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*/
-public class SeamFacesException extends RuntimeException{
+public class SeamFacesException extends RuntimeException
+{
- public SeamFacesException(String string)
- {
- }
+ public SeamFacesException(String string)
+ {
+ }
- public SeamFacesException()
- {
- }
+ public SeamFacesException()
+ {
+ }
}
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/MethodBindingMethodExpressionAdapter.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/MethodBindingMethodExpressionAdapter.java 2010-03-13 18:41:27 UTC (rev 12200)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/MethodBindingMethodExpressionAdapter.java 2010-03-15 20:29:42 UTC (rev 12201)
@@ -34,111 +34,140 @@
* holder.
*/
package org.jboss.seam.faces.component;
-
+
import java.io.Serializable;
-
+
import javax.faces.component.StateHolder;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
import javax.faces.el.MethodBinding;
-
+
import javax.el.MethodExpression;
import javax.el.MethodInfo;
import javax.el.ELException;
import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
-
+
import java.util.Arrays;
import java.lang.reflect.Method;
-
+
/**
- * <p>Wrap a MethodExpression instance and expose it as a MethodBinding</p>
- *
+ * <p>
+ * Wrap a MethodExpression instance and expose it as a MethodBinding
+ * </p>
+ *
*/
-class MethodBindingMethodExpressionAdapter extends MethodBinding implements StateHolder,
- Serializable {
-
+class MethodBindingMethodExpressionAdapter extends MethodBinding implements StateHolder, Serializable
+{
+
private static final long serialVersionUID = 7334926223014401689L;
private MethodExpression methodExpression = null;
private boolean tranzient;
-
- public MethodBindingMethodExpressionAdapter() {
+
+ public MethodBindingMethodExpressionAdapter()
+ {
} // for StateHolder
-
- MethodBindingMethodExpressionAdapter(MethodExpression methodExpression) {
+
+ MethodBindingMethodExpressionAdapter(MethodExpression methodExpression)
+ {
this.methodExpression = methodExpression;
}
-
+
@Override
- public Object invoke(FacesContext context, Object params[])
- throws javax.faces.el.EvaluationException, javax.faces.el.MethodNotFoundException {
+ public Object invoke(FacesContext context, Object params[]) throws javax.faces.el.EvaluationException, javax.faces.el.MethodNotFoundException
+ {
assert (null != methodExpression);
- if (context == null) {
+ if (context == null)
+ {
throw new NullPointerException("FacesConext -> null");
}
-
+
Object result = null;
- try {
- result = methodExpression.invoke(context.getELContext(),
- params);
- } catch (javax.el.MethodNotFoundException e) {
+ try
+ {
+ result = methodExpression.invoke(context.getELContext(), params);
+ }
+ catch (javax.el.MethodNotFoundException e)
+ {
throw new javax.faces.el.MethodNotFoundException(e);
- } catch (javax.el.PropertyNotFoundException e) {
+ }
+ catch (javax.el.PropertyNotFoundException e)
+ {
throw new EvaluationException(e);
- } catch (ELException e) {
+ }
+ catch (ELException e)
+ {
Throwable cause = e.getCause();
- if (cause == null) {
+ if (cause == null)
+ {
cause = e;
}
throw new EvaluationException(cause);
- } catch (NullPointerException e) {
+ }
+ catch (NullPointerException e)
+ {
throw new javax.faces.el.MethodNotFoundException(e);
}
return result;
}
-
+
@Override
- public Class getType(FacesContext context) throws javax.faces.el.MethodNotFoundException {
+ public Class getType(FacesContext context) throws javax.faces.el.MethodNotFoundException
+ {
assert (null != methodExpression);
- if (context == null) {
+ if (context == null)
+ {
throw new NullPointerException("FacesConext -> null");
}
Class result = null;
- if (context == null) {
+ if (context == null)
+ {
throw new NullPointerException();
}
-
- try {
- MethodInfo mi =
- methodExpression.getMethodInfo(context.getELContext());
+
+ try
+ {
+ MethodInfo mi = methodExpression.getMethodInfo(context.getELContext());
result = mi.getReturnType();
- } catch (javax.el.PropertyNotFoundException e) {
+ }
+ catch (javax.el.PropertyNotFoundException e)
+ {
throw new javax.faces.el.MethodNotFoundException(e);
- } catch (javax.el.MethodNotFoundException e) {
+ }
+ catch (javax.el.MethodNotFoundException e)
+ {
throw new javax.faces.el.MethodNotFoundException(e);
- } catch (ELException e) {
+ }
+ catch (ELException e)
+ {
throw new javax.faces.el.MethodNotFoundException(e);
}
return result;
}
-
+
@Override
- public String getExpressionString() {
+ public String getExpressionString()
+ {
assert (null != methodExpression);
return methodExpression.getExpressionString();
}
-
+
@Override
- public boolean equals(Object other) {
- if (this == other) {
+ public boolean equals(Object other)
+ {
+ if (this == other)
+ {
return true;
}
- if (other instanceof MethodBindingMethodExpressionAdapter) {
+ if (other instanceof MethodBindingMethodExpressionAdapter)
+ {
return methodExpression.equals(((MethodBindingMethodExpressionAdapter) other).getWrapped());
- } else if (other instanceof MethodBinding) {
+ }
+ else if (other instanceof MethodBinding)
+ {
MethodBinding binding = (MethodBinding) other;
-
+
// We'll need to do a little leg work to determine
// if the MethodBinding is equivalent to the
// wrapped MethodExpression
@@ -147,148 +176,174 @@
String target = expr.substring(0, idx).substring(2);
String t = expr.substring(idx + 1);
String method = t.substring(0, (t.length() - 1));
-
+
FacesContext context = FacesContext.getCurrentInstance();
ELContext elContext = context.getELContext();
MethodInfo controlInfo = methodExpression.getMethodInfo(elContext);
-
+
// ensure the method names are the same
- if (!controlInfo.getName().equals(method)) {
+ if (!controlInfo.getName().equals(method))
+ {
return false;
}
-
+
// Using the target, create an expression and evaluate
// it.
ExpressionFactory factory = context.getApplication().getExpressionFactory();
- ValueExpression ve = factory.createValueExpression(elContext,
- "#{" + target + '}',
- Object.class);
- if (ve == null) {
+ ValueExpression ve = factory.createValueExpression(elContext, "#{" + target + '}', Object.class);
+ if (ve == null)
+ {
return false;
}
-
+
Object result = ve.getValue(elContext);
-
- if (result == null) {
+
+ if (result == null)
+ {
return false;
}
-
+
// Get all of the methods with the matching name and try
// to find a match based on controlInfo's return and parameter
// types
Class type = binding.getType(context);
Method[] methods = result.getClass().getMethods();
- for (Method meth : methods) {
- if (meth.getName().equals(method)
- && type.equals(controlInfo.getReturnType())
- && Arrays.equals(meth.getParameterTypes(),
- controlInfo.getParamTypes())) {
+ for (Method meth : methods)
+ {
+ if (meth.getName().equals(method) && type.equals(controlInfo.getReturnType()) && Arrays.equals(meth.getParameterTypes(), controlInfo.getParamTypes()))
+ {
return true;
}
}
}
-
+
return false;
-
+
}
-
+
@Override
- public int hashCode() {
+ public int hashCode()
+ {
assert (null != methodExpression);
-
+
return methodExpression.hashCode();
}
-
- public boolean isTransient() {
+
+ public boolean isTransient()
+ {
return this.tranzient;
}
-
- public void setTransient(boolean tranzient) {
+
+ public void setTransient(boolean tranzient)
+ {
this.tranzient = tranzient;
}
-
- public Object saveState(FacesContext context) {
- if (context == null) {
+
+ public Object saveState(FacesContext context)
+ {
+ if (context == null)
+ {
throw new NullPointerException();
}
Object result = null;
- if (!tranzient) {
- if (methodExpression instanceof StateHolder) {
+ if (!tranzient)
+ {
+ if (methodExpression instanceof StateHolder)
+ {
Object[] stateStruct = new Object[2];
-
+
// save the actual state of our wrapped methodExpression
stateStruct[0] = ((StateHolder) methodExpression).saveState(context);
// save the class name of the methodExpression impl
stateStruct[1] = methodExpression.getClass().getName();
-
+
result = stateStruct;
- } else {
+ }
+ else
+ {
result = methodExpression;
}
}
-
+
return result;
-
+
}
-
- public void restoreState(FacesContext context, Object state) {
- if (context == null) {
+
+ public void restoreState(FacesContext context, Object state)
+ {
+ if (context == null)
+ {
throw new NullPointerException();
}
// if we have state
- if (null == state) {
+ if (null == state)
+ {
return;
}
-
- if (!(state instanceof MethodExpression)) {
+
+ if (!(state instanceof MethodExpression))
+ {
Object[] stateStruct = (Object[]) state;
Object savedState = stateStruct[0];
String className = stateStruct[1].toString();
MethodExpression result = null;
-
+
Class toRestoreClass = null;
- if (null != className) {
- try {
+ if (null != className)
+ {
+ try
+ {
toRestoreClass = loadClass(className, this);
- } catch (ClassNotFoundException e) {
+ }
+ catch (ClassNotFoundException e)
+ {
throw new IllegalStateException(e.getMessage());
}
-
- if (null != toRestoreClass) {
- try {
- result =
- (MethodExpression) toRestoreClass.newInstance();
- } catch (InstantiationException e) {
+
+ if (null != toRestoreClass)
+ {
+ try
+ {
+ result = (MethodExpression) toRestoreClass.newInstance();
+ }
+ catch (InstantiationException e)
+ {
throw new IllegalStateException(e.getMessage());
- } catch (IllegalAccessException a) {
+ }
+ catch (IllegalAccessException a)
+ {
throw new IllegalStateException(a.getMessage());
}
}
-
- if (null != result && null != savedState) {
+
+ if (null != result && null != savedState)
+ {
// don't need to check transient, since that was
// done on the saving side.
((StateHolder) result).restoreState(context, savedState);
}
methodExpression = result;
}
- } else {
+ }
+ else
+ {
methodExpression = (MethodExpression) state;
}
}
-
- public MethodExpression getWrapped() {
+
+ public MethodExpression getWrapped()
+ {
return methodExpression;
}
-
+
//
// Helper methods for StateHolder
//
- private static Class loadClass(String name,
- Object fallbackClass) throws ClassNotFoundException {
- ClassLoader loader =
- Thread.currentThread().getContextClassLoader();
- if (loader == null) {
+ private static Class loadClass(String name, Object fallbackClass) throws ClassNotFoundException
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ if (loader == null)
+ {
loader = fallbackClass.getClass().getClassLoader();
}
return Class.forName(name, true, loader);
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java 2010-03-13 18:41:27 UTC (rev 12200)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java 2010-03-15 20:29:42 UTC (rev 12201)
@@ -26,72 +26,89 @@
import javax.faces.webapp.FacesServlet;
/**
- * <p><strong>UIViewAction</strong> is an {@link ActionSource2} {@link
- * UIComponent} that specifies an application-specific command (or
- * action)--defined as an EL method expression--to be invoked during one of the
- * JSF lifecycle phases that proceeds view rendering. This component must be
- * declared as a child of the {@link ViewMetadata} facet of the {@link
- * UIViewRoot} so that it gets incorporated into the JSF lifecycle on both
- * non-faces (initial) requests and faces (postback) requests.</p>
- *
- * <p>The purpose of this component is to provide a light-weight
- * front-controller solution for executing code upon the loading of a JSF view
- * to support the integration of system services, content retrieval, view
- * management, and navigation. This functionality is especially useful for
- * non-faces (initial) requests.</p>
- *
- * <p>The {@link UIViewAction} component is closely tied to the {@link
- * UIViewParameter} component. The {@link UIViewParameter} component binds a
- * request parameter to a model property. Most of the time, this binding is used
- * to populate the model with data that supports the method being invoked by a
- * {@link UIViewAction} component, much like form inputs populate the model with
- * data to support the method being invoked by a {@link UICommand}
- * component.</p>
- *
- * <p>When the <literal>decode()</literal> method of the {@link UIViewAction} is
+ * <p>
+ * <strong>UIViewAction</strong> is an {@link ActionSource2} {@link UIComponent}
+ * that specifies an application-specific command (or action)--defined as an EL
+ * method expression--to be invoked during one of the JSF lifecycle phases that
+ * proceeds view rendering. This component must be declared as a child of the
+ * {@link ViewMetadata} facet of the {@link UIViewRoot} so that it gets
+ * incorporated into the JSF lifecycle on both non-faces (initial) requests and
+ * faces (postback) requests.
+ * </p>
+ *
+ * <p>
+ * The purpose of this component is to provide a light-weight front-controller
+ * solution for executing code upon the loading of a JSF view to support the
+ * integration of system services, content retrieval, view management, and
+ * navigation. This functionality is especially useful for non-faces (initial)
+ * requests.
+ * </p>
+ *
+ * <p>
+ * The {@link UIViewAction} component is closely tied to the
+ * {@link UIViewParameter} component. The {@link UIViewParameter} component
+ * binds a request parameter to a model property. Most of the time, this binding
+ * is used to populate the model with data that supports the method being
+ * invoked by a {@link UIViewAction} component, much like form inputs populate
+ * the model with data to support the method being invoked by a
+ * {@link UICommand} component.
+ * </p>
+ *
+ * <p>
+ * When the <literal>decode()</literal> method of the {@link UIViewAction} is
* invoked, it will queue an {@link ActionEvent} to be broadcast to all
* interested listeners when the <literal>broadcast()</literal> method is
- * invoked.</p>
- *
- * <p>If the value of the component's <literal>immediate</literal> attribute is
+ * invoked.
+ * </p>
+ *
+ * <p>
+ * If the value of the component's <literal>immediate</literal> attribute is
* <literal>true</literal>, the action will be invoked during the Apply Request
* Values JSF lifecycle phase. Otherwise, the action will be invoked during the
- * Invoke Application phase, the default behavior. The phase cannot be
- * set explicitly in the <literal>phase</literal> attribute, which takes
- * precedence over the <literal>immediate</literal> attribute.</p>
- *
- * <p>The invocation of the action is normally suppressed (meaning the {@link
- * ActionEvent} is not queued) on a faces request. It can be enabled by setting
- * the component's <literal>onPostback</literal> attribute to <literal>true</literal>.
- * Execution of the method can be subject to a required condition for all requests by
- * assigning an EL value expression of expected type boolean to the component's
- * <literal>if</literal> attribute, which must evaluate to
- * <literal>true</literal> for the action to be invoked.</p>
- *
- * <p>The {@link NavigationHandler} is consulted after the action is invoked to
+ * Invoke Application phase, the default behavior. The phase cannot be set
+ * explicitly in the <literal>phase</literal> attribute, which takes precedence
+ * over the <literal>immediate</literal> attribute.
+ * </p>
+ *
+ * <p>
+ * The invocation of the action is normally suppressed (meaning the
+ * {@link ActionEvent} is not queued) on a faces request. It can be enabled by
+ * setting the component's <literal>onPostback</literal> attribute to
+ * <literal>true</literal>. Execution of the method can be subject to a required
+ * condition for all requests by assigning an EL value expression of expected
+ * type boolean to the component's <literal>if</literal> attribute, which must
+ * evaluate to <literal>true</literal> for the action to be invoked.
+ * </p>
+ *
+ * <p>
+ * The {@link NavigationHandler} is consulted after the action is invoked to
* carry out the navigation case that matches the action signature and outcome.
* If a navigation case is matched, or the response is marked complete by the
* action, subsequent {@link UIViewAction} components associated with the
- * current view are short-circuited. The lifecycle then advances
- * appropriately.</p>
- *
- * <p>It's important to note that the full component tree is not built before
- * the UIViewAction components are processed on an non-faces (initial) request.
+ * current view are short-circuited. The lifecycle then advances appropriately.
+ * </p>
+ *
+ * <p>
+ * It's important to note that the full component tree is not built before the
+ * UIViewAction components are processed on an non-faces (initial) request.
* Rather, the component tree only contains the {@link ViewMetadata}, an
* important part of the optimization of this component and what sets it apart
- * from a {@link PreRenderViewEvent} listener.</p>
- *
+ * from a {@link PreRenderViewEvent} listener.
+ * </p>
+ *
* @author Dan Allen
* @author Andy Schwartz
- *
+ *
* @see UIViewParameter
*/
@FacesComponent(
- // tagName = "viewAction",
- // namespace = "http://jboss.org/seam/faces",
- // (see https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=594)
- value = UIViewAction.COMPONENT_TYPE)
-public class UIViewAction extends UIComponentBase implements ActionSource2 {
+// tagName = "viewAction",
+// namespace = "http://jboss.org/seam/faces",
+// (see
+// https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=594)
+value = UIViewAction.COMPONENT_TYPE)
+public class UIViewAction extends UIComponentBase implements ActionSource2
+{
// ------------------------------------------------------ Manifest Constants
@@ -112,20 +129,24 @@
/**
* Properties that are tracked by state saving.
*/
- enum PropertyKeys {
+ enum PropertyKeys
+ {
onPostback, actionExpression, immediate, phase, ifAttr("if");
private String name;
- PropertyKeys() {
+ PropertyKeys()
+ {
}
- PropertyKeys(String name) {
+ PropertyKeys(String name)
+ {
this.name = name;
}
@Override
- public String toString() {
+ public String toString()
+ {
return name != null ? name : super.toString();
}
}
@@ -136,27 +157,31 @@
* Create a new {@link UIViewAction} instance with default property values.
* </p>
*/
- public UIViewAction() {
+ public UIViewAction()
+ {
super();
setRendererType(null);
}
// -------------------------------------------------------------- Properties
@Override
- public String getFamily() {
+ public String getFamily()
+ {
return COMPONENT_FAMILY;
}
/**
* {@inheritDoc}
- *
+ *
* @deprecated This has been replaced by {@link #getActionExpression}.
*/
- public MethodBinding getAction() {
+ public MethodBinding getAction()
+ {
MethodBinding result = null;
MethodExpression me;
- if (null != (me = getActionExpression())) {
+ if (null != (me = getActionExpression()))
+ {
result = new MethodBindingMethodExpressionAdapter(me);
}
return result;
@@ -164,29 +189,33 @@
/**
* {@inheritDoc}
- *
- * @deprecated This has been replaced by {@link #setActionExpression(javax.el.MethodExpression)}.
+ *
+ * @deprecated This has been replaced by
+ * {@link #setActionExpression(javax.el.MethodExpression)}.
* @throws UnsupportedOperationException if called
*/
- public void setAction(MethodBinding action) {
+ public void setAction(MethodBinding action)
+ {
throw new UnsupportedOperationException("Not supported.");
}
/**
* Action listeners are not supported by the {@link UIViewAction} component.
- *
+ *
* @throws UnsupportedOperationException if called
*/
- public MethodBinding getActionListener() {
+ public MethodBinding getActionListener()
+ {
throw new UnsupportedOperationException("Not supported.");
}
/**
* Action listeners are not supported by the {@link UIViewAction} component.
- *
+ *
* @throws UnsupportedOperationException if called
*/
- public void setActionListener(MethodBinding actionListener) {
+ public void setActionListener(MethodBinding actionListener)
+ {
throw new UnsupportedOperationException("Not supported.");
}
@@ -197,33 +226,40 @@
* Values phase. If the value of this attribute is <literal>true</literal>,
* the default, the action will be invoked in the Invoke Application Phase.
*/
- public boolean isImmediate() {
+ public boolean isImmediate()
+ {
return (Boolean) getStateHelper().eval(PropertyKeys.immediate, false);
}
/**
- * Sets the immediate flag, which controls the JSF lifecycle in which
- * the action is invoked.
+ * Sets the immediate flag, which controls the JSF lifecycle in which the
+ * action is invoked.
*/
- public void setImmediate(boolean immediate) {
+ public void setImmediate(boolean immediate)
+ {
getStateHelper().put(PropertyKeys.immediate, immediate);
}
/**
- * <p>Returns the name of the phase in which the action is to be queued. Only
- * the following phases are supported (case does not matter):</p>
+ * <p>
+ * Returns the name of the phase in which the action is to be queued. Only
+ * the following phases are supported (case does not matter):
+ * </p>
* <ul>
* <li>APPLY_REQUEST_VALUES</li>
* <li>PROCESS_VALIDATIONS</li>
* <li>UPDATE_MODEL_VALUES</li>
* <li>INVOKE_APPLICATION</li>
* </ul>
- * <p>If the phase is set, it takes precedence over the
- * immediate flag.</p>
+ * <p>
+ * If the phase is set, it takes precedence over the immediate flag.
+ * </p>
*/
- public String getPhase() {
+ public String getPhase()
+ {
String phase = (String) getStateHelper().eval(PropertyKeys.phase);
- if (phase != null) {
+ if (phase != null)
+ {
phase = phase.toUpperCase();
}
return phase;
@@ -232,66 +268,85 @@
/**
* Set the name of the phase in which the action is to be queued.
*/
- public void setPhase(String phase) {
+ public void setPhase(String phase)
+ {
getStateHelper().put(PropertyKeys.phase, phase);
}
- public PhaseId getPhaseId() {
+ public PhaseId getPhaseId()
+ {
String phase = getPhase();
- if (phase == null) {
+ if (phase == null)
+ {
return null;
}
- if ("APPLY_REQUEST_VALUES".equals(phase)) {
+ if ("APPLY_REQUEST_VALUES".equals(phase))
+ {
return PhaseId.APPLY_REQUEST_VALUES;
- } else if ("PROCESS_VALIDATIONS".equals(phase)) {
+ }
+ else if ("PROCESS_VALIDATIONS".equals(phase))
+ {
return PhaseId.PROCESS_VALIDATIONS;
- } else if ("UPDATE_MODEL_VALUES".equals(phase)) {
+ }
+ else if ("UPDATE_MODEL_VALUES".equals(phase))
+ {
return PhaseId.UPDATE_MODEL_VALUES;
- } else if ("INVOKE_APPLICATION".equals(phase)) {
+ }
+ else if ("INVOKE_APPLICATION".equals(phase))
+ {
return PhaseId.INVOKE_APPLICATION;
- } else if ("ANY_PHASE".equals(phase) || "RESTORE_VIEW".equals(phase) || "RENDER_REPONSE".equals(phase)) {
+ }
+ else if ("ANY_PHASE".equals(phase) || "RESTORE_VIEW".equals(phase) || "RENDER_REPONSE".equals(phase))
+ {
throw new FacesException("View actions cannot be executed in specified phase: [" + phase + "]");
- } else {
+ }
+ else
+ {
throw new FacesException("Not a valid phase [" + phase + "]");
}
}
/**
* Action listeners are not supported by the {@link UIViewAction} component.
- *
+ *
* @throws UnsupportedOperationException if called
*/
- public void addActionListener(ActionListener listener) {
+ public void addActionListener(ActionListener listener)
+ {
throw new UnsupportedOperationException("Not supported.");
}
/**
* Action listeners are not supported by the {@link UIViewAction} component.
*/
- public ActionListener[] getActionListeners() {
+ public ActionListener[] getActionListeners()
+ {
return new ActionListener[0];
}
/**
* Action listeners are not supported by the {@link UIViewAction} component.
- *
+ *
* @throws UnsupportedOperationException if called
*/
- public void removeActionListener(ActionListener listener) {
+ public void removeActionListener(ActionListener listener)
+ {
throw new UnsupportedOperationException("Not supported.");
}
/**
* Returns the action, represented as an EL method expression, to invoke.
*/
- public MethodExpression getActionExpression() {
+ public MethodExpression getActionExpression()
+ {
return (MethodExpression) getStateHelper().get(PropertyKeys.actionExpression);
}
/**
* Sets the action, represented as an EL method expression, to invoke.
*/
- public void setActionExpression(MethodExpression actionExpression) {
+ public void setActionExpression(MethodExpression actionExpression)
+ {
getStateHelper().put(PropertyKeys.actionExpression, actionExpression);
}
@@ -299,15 +354,17 @@
* Returns a boolean value that controls whether the action is invoked during
* faces (postback) request.
*/
- public boolean isOnPostback() {
+ public boolean isOnPostback()
+ {
return (Boolean) getStateHelper().eval(PropertyKeys.onPostback, false);
}
/**
- * Set the bookean flag that controls whether the action is invoked during
- * a faces (postback) request.
+ * Set the bookean flag that controls whether the action is invoked during a
+ * faces (postback) request.
*/
- public void setOnPostback(boolean onPostback) {
+ public void setOnPostback(boolean onPostback)
+ {
getStateHelper().put(PropertyKeys.onPostback, onPostback);
}
@@ -315,7 +372,8 @@
* Returns a condition, represented as an EL value expression, that must
* evaluate to true for the action to be invoked.
*/
- public boolean isIf() {
+ public boolean isIf()
+ {
return (Boolean) getStateHelper().eval(PropertyKeys.ifAttr, true);
}
@@ -323,68 +381,81 @@
* Sets the condition, represented as an EL value expression, that must
* evaluate to true for the action to be invoked.
*/
- public void setIf(boolean condition) {
+ public void setIf(boolean condition)
+ {
getStateHelper().put(PropertyKeys.ifAttr, condition);
}
// ----------------------------------------------------- UIComponent Methods
/**
- * <p>In addition to to the default {@link UIComponent#broadcast} processing,
- * pass the {@link ActionEvent} being broadcast to the default {@link
- * ActionListener} registered on the {@link
- * javax.faces.application.Application}.</p>
- *
+ * <p>
+ * In addition to to the default {@link UIComponent#broadcast} processing,
+ * pass the {@link ActionEvent} being broadcast to the default
+ * {@link ActionListener} registered on the
+ * {@link javax.faces.application.Application}.
+ * </p>
+ *
* @param event {@link FacesEvent} to be broadcast
- *
+ *
* @throws AbortProcessingException Signal the JavaServer Faces
- * implementation that no further processing on the current event
- * should be performed
- * @throws IllegalArgumentException if the implementation class
- * of this {@link FacesEvent} is not supported by this component
- * @throws NullPointerException if <code>event</code> is
- * <code>null</code>
+ * implementation that no further processing on the current event
+ * should be performed
+ * @throws IllegalArgumentException if the implementation class of this
+ * {@link FacesEvent} is not supported by this component
+ * @throws NullPointerException if <code>event</code> is <code>null</code>
*/
@Override
- public void broadcast(FacesEvent event) throws AbortProcessingException {
+ public void broadcast(FacesEvent event) throws AbortProcessingException
+ {
super.broadcast(event);
FacesContext context = getFacesContext();
- // OPEN QUESTION: should we consider a navigation to the same view as a no-op navigation?
+ // OPEN QUESTION: should we consider a navigation to the same view as a
+ // no-op navigation?
- // only proceed if the response has not been marked complete and navigation to another view has not occurred
- if (event instanceof ActionEvent && !context.getResponseComplete()
- && context.getViewRoot() == getViewRootOf(event)) {
+ // only proceed if the response has not been marked complete and
+ // navigation to another view has not occurred
+ if (event instanceof ActionEvent && !context.getResponseComplete() && context.getViewRoot() == getViewRootOf(event))
+ {
ActionListener listener = context.getApplication().getActionListener();
- if (listener != null) {
+ if (listener != null)
+ {
UIViewRoot viewRootBefore = context.getViewRoot();
InstrumentedFacesContext instrumentedContext = new InstrumentedFacesContext(context);
- // defer the call to renderResponse() that happens in ActionListener#processAction(ActionEvent)
+ // defer the call to renderResponse() that happens in
+ // ActionListener#processAction(ActionEvent)
instrumentedContext.disableRenderResponseControl().set();
listener.processAction((ActionEvent) event);
instrumentedContext.restore();
// if the response is marked complete, the story is over
- if (!context.getResponseComplete()) {
+ if (!context.getResponseComplete())
+ {
UIViewRoot viewRootAfter = context.getViewRoot();
- // if the view id changed as a result of navigation, then execute the JSF lifecycle for the new view id
- if (viewRootBefore != viewRootAfter) {
+ // if the view id changed as a result of navigation, then execute
+ // the JSF lifecycle for the new view id
+ if (viewRootBefore != viewRootAfter)
+ {
/*
- // execute the JSF lifecycle by dispatching a forward request
- // this approach is problematic because it throws a wrench in the event broadcasting
- try {
- context.getExternalContext().dispatch(context.getApplication()
- .getViewHandler().getActionURL(context, viewRootAfter.getViewId())
- .substring(context.getExternalContext().getRequestContextPath().length()));
- // kill this lifecycle execution
- context.responseComplete();
- } catch (IOException e) {
- throw new FacesException("Dispatch to viewId failed: " + viewRootAfter.getViewId(), e);
- }
- */
+ * // execute the JSF lifecycle by dispatching a forward
+ * request // this approach is problematic because it throws a
+ * wrench in the event broadcasting try {
+ * context.getExternalContext
+ * ().dispatch(context.getApplication()
+ * .getViewHandler().getActionURL(context,
+ * viewRootAfter.getViewId())
+ * .substring(context.getExternalContext
+ * ().getRequestContextPath().length())); // kill this
+ * lifecycle execution context.responseComplete(); } catch
+ * (IOException e) { throw new
+ * FacesException("Dispatch to viewId failed: " +
+ * viewRootAfter.getViewId(), e); }
+ */
// manually execute the JSF lifecycle on the new view id
- // certain tweaks have to be made to the FacesContext to allow us to reset the lifecycle
+ // certain tweaks have to be made to the FacesContext to allow
+ // us to reset the lifecycle
Lifecycle lifecycle = getLifecycle(context);
instrumentedContext = new InstrumentedFacesContext(context);
instrumentedContext.pushViewIntoRequestMap().clearViewRoot().clearPostback().set();
@@ -392,12 +463,15 @@
instrumentedContext.restore();
/*
- Another approach would be to register a phase listener in the
- decode() method for the phase in which the action is set to
- invoke. The phase listener would performs a servlet forward
- if a non-redirect navigation occurs after the phase.
- */
- } else {
+ * Another approach would be to register a phase listener in
+ * the decode() method for the phase in which the action is
+ * set to invoke. The phase listener would performs a servlet
+ * forward if a non-redirect navigation occurs after the
+ * phase.
+ */
+ }
+ else
+ {
// apply the deferred call (relevant when immediate is true)
context.renderResponse();
}
@@ -412,85 +486,103 @@
* evaluated value of the postback attribute is false, take no action. If the
* evaluated value of the if attribute is false, take no action. If both
* conditions pass, proceed with creating an {@link ActionEvent}.
- *
+ *
* Set the phaseId in which the queued {@link ActionEvent} should be
* broadcast by assigning the appropriate value to the phaseId property of
* the {@link ActionEvent} according to the evaluated value of the immediate
* attribute. If the value is <literal>true</literal>, set the phaseId to
* {@link PhaseId#APPLY_REQUEST_VALUES}. Otherwise, set the phaseId to to
* {@link PhaseId#INVOKE_APPLICATION}.
- *
+ *
* Finally, queue the event by calling <literal>queueEvent()</literal> and
* passing the {@link ActionEvent} just created.
*/
@Override
- public void decode(FacesContext context) {
- if (context == null) {
+ public void decode(FacesContext context)
+ {
+ if (context == null)
+ {
throw new NullPointerException();
}
- if ((context.isPostback() && !isOnPostback()) || !isIf()) {
+ if ((context.isPostback() && !isOnPostback()) || !isIf())
+ {
return;
}
ActionEvent e = new ActionEvent(this);
PhaseId phaseId = getPhaseId();
- if (phaseId != null) {
+ if (phaseId != null)
+ {
e.setPhaseId(phaseId);
- } else if (isImmediate()) {
+ }
+ else if (isImmediate())
+ {
e.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- } else {
+ }
+ else
+ {
e.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
queueEvent(e);
}
- private UIViewRoot getViewRootOf(FacesEvent e) {
+ private UIViewRoot getViewRootOf(FacesEvent e)
+ {
UIComponent c = e.getComponent();
- do {
- if (c instanceof UIViewRoot) {
+ do
+ {
+ if (c instanceof UIViewRoot)
+ {
return (UIViewRoot) c;
}
c = c.getParent();
- } while (c != null);
+ }
+ while (c != null);
return null;
}
- private Lifecycle getLifecycle(FacesContext context) {
- LifecycleFactory lifecycleFactory = (LifecycleFactory)
- FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
- String lifecycleId = context.getExternalContext()
- .getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR);
- if (lifecycleId == null) {
+ private Lifecycle getLifecycle(FacesContext context)
+ {
+ LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
+ String lifecycleId = context.getExternalContext().getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR);
+ if (lifecycleId == null)
+ {
lifecycleId = LifecycleFactory.DEFAULT_LIFECYCLE;
}
return lifecycleFactory.getLifecycle(lifecycleId);
}
/**
- * A FacesContext delegator that gives us the necessary controls over the FacesContext
- * to allow the execution of the lifecycle to accomodate the UIViewAction sequence.
+ * A FacesContext delegator that gives us the necessary controls over the
+ * FacesContext to allow the execution of the lifecycle to accomodate the
+ * UIViewAction sequence.
*/
- private class InstrumentedFacesContext extends FacesContextWrapper {
+ private class InstrumentedFacesContext extends FacesContextWrapper
+ {
private FacesContext wrapped;
private boolean viewRootCleared = false;
private boolean renderedResponseControlDisabled = false;
private Boolean postback = null;
- public InstrumentedFacesContext(FacesContext wrapped) {
+ public InstrumentedFacesContext(FacesContext wrapped)
+ {
this.wrapped = wrapped;
}
@Override
- public FacesContext getWrapped() {
+ public FacesContext getWrapped()
+ {
return wrapped;
}
@Override
- public UIViewRoot getViewRoot() {
- if (viewRootCleared) {
+ public UIViewRoot getViewRoot()
+ {
+ if (viewRootCleared)
+ {
return null;
}
@@ -498,51 +590,62 @@
}
@Override
- public void setViewRoot(UIViewRoot viewRoot) {
+ public void setViewRoot(UIViewRoot viewRoot)
+ {
viewRootCleared = false;
wrapped.setViewRoot(viewRoot);
}
@Override
- public boolean isPostback() {
+ public boolean isPostback()
+ {
return postback == null ? wrapped.isPostback() : postback;
}
@Override
- public void renderResponse() {
- if (!renderedResponseControlDisabled) {
+ public void renderResponse()
+ {
+ if (!renderedResponseControlDisabled)
+ {
wrapped.renderResponse();
}
}
/**
- * Make it look like we have dispatched a request using the include method.
+ * Make it look like we have dispatched a request using the include
+ * method.
*/
- public InstrumentedFacesContext pushViewIntoRequestMap() {
+ public InstrumentedFacesContext pushViewIntoRequestMap()
+ {
getExternalContext().getRequestMap().put("javax.servlet.include.servlet_path", wrapped.getViewRoot().getViewId());
return this;
}
- public InstrumentedFacesContext clearPostback() {
+ public InstrumentedFacesContext clearPostback()
+ {
postback = false;
return this;
}
- public InstrumentedFacesContext clearViewRoot() {
+ public InstrumentedFacesContext clearViewRoot()
+ {
viewRootCleared = true;
return this;
}
- public InstrumentedFacesContext disableRenderResponseControl() {
+ public InstrumentedFacesContext disableRenderResponseControl()
+ {
renderedResponseControlDisabled = true;
return this;
}
- public void set() {
+ public void set()
+ {
setCurrentInstance(this);
}
- public void restore() {
+ public void restore()
+ {
setCurrentInstance(wrapped);
}
}
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FacesContextProducer.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FacesContextProducer.java 2010-03-13 18:41:27 UTC (rev 12200)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FacesContextProducer.java 2010-03-15 20:29:42 UTC (rev 12201)
@@ -6,20 +6,26 @@
import javax.faces.context.FacesContext;
/**
- * <p>A producer which retrieves the current JSF FacesContext by calling
- * {@link FacesContext#getCurrentInstance}, thus allowing it to be
- * injected.</p>
+ * <p>
+ * A producer which retrieves the current JSF FacesContext by calling
+ * {@link FacesContext#getCurrentInstance}, thus allowing it to be injected.
+ * </p>
*
- * <p>QUESTION should we return null if there is no current phase id? (seems to be a common check)</p>
- * <p>QUESTION is it correct to use a @RequestScoped producer? If it is @Dependent, then a developer could unknowingly bind it to a wider-scoped bean</p>
+ * <p>
+ * QUESTION should we return null if there is no current phase id? (seems to be
+ * a common check)
+ * </p>
+ * <p>
+ * QUESTION is it correct to use a @RequestScoped producer? If it is @Dependent,
+ * then a developer could unknowingly bind it to a wider-scoped bean
+ * </p>
*
* @author Gavin King
- * @author Dan Allen
+ * @author Dan Allen
*/
public class FacesContextProducer
{
- public
- @Produces
+ public @Produces
@RequestScoped
FacesContext getFacesContext()
{
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java 2010-03-13 18:41:27 UTC (rev 12200)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java 2010-03-15 20:29:42 UTC (rev 12201)
@@ -18,7 +18,7 @@
import javax.faces.event.PhaseListener;
/**
- * This class provides the contexts lifecycle for the new JSF2 Flash Context
+ * This class provides the lifecycle for the new JSF 2 Flash Context
*
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*/
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedExtension.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedExtension.java 2010-03-13 18:41:27 UTC (rev 12200)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedExtension.java 2010-03-15 20:29:42 UTC (rev 12201)
@@ -12,21 +12,21 @@
import javax.faces.bean.FlashScoped;
/**
- * An extension to provide @FlashScoped CDI / JSF2 integration.
+ * An extension to provide @FlashScoped CDI / JSF 2 integration.
*
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*/
public class FlashScopedExtension implements Extension
{
- public void addScope(@Observes final BeforeBeanDiscovery event)
- {
- event.addScope(FlashScoped.class, true, true);
- }
+ public void addScope(@Observes final BeforeBeanDiscovery event)
+ {
+ event.addScope(FlashScoped.class, true, true);
+ }
- public void registerContext(@Observes final AfterBeanDiscovery event)
- {
- event.addContext(new FlashScopedContext());
- }
+ public void registerContext(@Observes final AfterBeanDiscovery event)
+ {
+ event.addContext(new FlashScopedContext());
+ }
}
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java 2010-03-13 18:41:27 UTC (rev 12200)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java 2010-03-15 20:29:42 UTC (rev 12201)
@@ -40,174 +40,172 @@
public class ViewScopedContext implements Context, SystemEventListener
{
- private final static String COMPONENT_MAP_NAME = "org.jboss.seam.faces.viewscope.componentInstanceMap";
- private final static String CREATIONAL_MAP_NAME = "org.jboss.seam.faces.viewscope.creationalInstanceMap";
+ private final static String COMPONENT_MAP_NAME = "org.jboss.seam.faces.viewscope.componentInstanceMap";
+ private final static String CREATIONAL_MAP_NAME = "org.jboss.seam.faces.viewscope.creationalInstanceMap";
- private boolean isJsfSubscribed = false;
+ private boolean isJsfSubscribed = false;
- @SuppressWarnings("unchecked")
- public <T> T get(final Contextual<T> component)
- {
- assertActive();
+ @SuppressWarnings("unchecked")
+ public <T> T get(final Contextual<T> component)
+ {
+ assertActive();
- if (!isJsfSubscribed)
- {
- FacesContext.getCurrentInstance().getApplication().subscribeToEvent(PreDestroyViewMapEvent.class, this);
- isJsfSubscribed = true;
- }
+ if (!isJsfSubscribed)
+ {
+ FacesContext.getCurrentInstance().getApplication().subscribeToEvent(PreDestroyViewMapEvent.class, this);
+ isJsfSubscribed = true;
+ }
- T instance = (T) getComponentInstanceMap().get(component);
+ T instance = (T) getComponentInstanceMap().get(component);
- return instance;
- }
+ return instance;
+ }
- @SuppressWarnings("unchecked")
- public <T> T get(final Contextual<T> component, final CreationalContext<T> creationalContext)
- {
- assertActive();
+ @SuppressWarnings("unchecked")
+ public <T> T get(final Contextual<T> component, final CreationalContext<T> creationalContext)
+ {
+ assertActive();
- T instance = get(component);
- if (instance == null)
- {
- if (creationalContext != null)
- {
- Map<Contextual<?>, Object> componentInstanceMap = getComponentInstanceMap();
- Map<Contextual<?>, CreationalContext<?>> creationalContextMap = getCreationalInstanceMap();
+ T instance = get(component);
+ if (instance == null)
+ {
+ if (creationalContext != null)
+ {
+ Map<Contextual<?>, Object> componentInstanceMap = getComponentInstanceMap();
+ Map<Contextual<?>, CreationalContext<?>> creationalContextMap = getCreationalInstanceMap();
- synchronized (componentInstanceMap)
- {
- instance = (T) componentInstanceMap.get(component);
- if (instance == null)
- {
- instance = component.create(creationalContext);
- if (instance != null)
- {
- componentInstanceMap.put(component, instance);
- creationalContextMap.put(component, creationalContext);
- }
- }
- }
+ synchronized (componentInstanceMap)
+ {
+ instance = (T) componentInstanceMap.get(component);
+ if (instance == null)
+ {
+ instance = component.create(creationalContext);
+ if (instance != null)
+ {
+ componentInstanceMap.put(component, instance);
+ creationalContextMap.put(component, creationalContext);
+ }
+ }
}
- }
+ }
+ }
- return instance;
- }
+ return instance;
+ }
- public Class<? extends Annotation> getScope()
- {
- return ViewScoped.class;
- }
+ public Class<? extends Annotation> getScope()
+ {
+ return ViewScoped.class;
+ }
- public boolean isActive()
- {
- return getViewRoot() != null;
- }
+ public boolean isActive()
+ {
+ return getViewRoot() != null;
+ }
- private void assertActive()
- {
- if (!isActive())
- {
- throw new ContextNotActiveException(
- "Seam context with scope annotation @ViewScoped is not active with respect to the current thread");
- }
- }
+ private void assertActive()
+ {
+ if (!isActive())
+ {
+ throw new ContextNotActiveException("Seam context with scope annotation @ViewScoped is not active with respect to the current thread");
+ }
+ }
- public boolean isListenerForSource(final Object source)
- {
- if (source instanceof UIViewRoot)
- {
- return true;
- }
+ public boolean isListenerForSource(final Object source)
+ {
+ if (source instanceof UIViewRoot)
+ {
+ return true;
+ }
- return false;
- }
+ return false;
+ }
- /**
- * We get PreDestroyViewMapEvent events from the JSF servlet and destroy our
- * contextual instances. This should (theoretically!) also get fired if the
- * webapp closes, so there should be no need to manually track all view
- * scopes and destroy them at a shutdown.
- *
- * @see javax.faces.event.SystemEventListener#processEvent(javax.faces.event.SystemEvent)
- */
- @SuppressWarnings("unchecked")
- public void processEvent(final SystemEvent event)
- {
- if (event instanceof PreDestroyViewMapEvent)
- {
- Map<Contextual<?>, Object> componentInstanceMap = getComponentInstanceMap();
- Map<Contextual<?>, CreationalContext<?>> creationalContextMap = getCreationalInstanceMap();
+ /**
+ * We get PreDestroyViewMapEvent events from the JSF servlet and destroy our
+ * contextual instances. This should (theoretically!) also get fired if the
+ * webapp closes, so there should be no need to manually track all view
+ * scopes and destroy them at a shutdown.
+ *
+ * @see javax.faces.event.SystemEventListener#processEvent(javax.faces.event.SystemEvent)
+ */
+ @SuppressWarnings("unchecked")
+ public void processEvent(final SystemEvent event)
+ {
+ if (event instanceof PreDestroyViewMapEvent)
+ {
+ Map<Contextual<?>, Object> componentInstanceMap = getComponentInstanceMap();
+ Map<Contextual<?>, CreationalContext<?>> creationalContextMap = getCreationalInstanceMap();
- if (componentInstanceMap != null)
+ if (componentInstanceMap != null)
+ {
+ for (Entry<Contextual<?>, Object> componentEntry : componentInstanceMap.entrySet())
{
- for (Entry<Contextual<?>, Object> componentEntry : componentInstanceMap.entrySet())
- {
- /*
- * No way to inform the compiler of type <T> information, so
- * it has to be abandoned here :(
- */
- Contextual contextual = componentEntry.getKey();
- Object instance = componentEntry.getValue();
- CreationalContext creational = creationalContextMap.get(contextual);
+ /*
+ * No way to inform the compiler of type <T> information, so it
+ * has to be abandoned here :(
+ */
+ Contextual contextual = componentEntry.getKey();
+ Object instance = componentEntry.getValue();
+ CreationalContext creational = creationalContextMap.get(contextual);
- contextual.destroy(instance, creational);
- }
+ contextual.destroy(instance, creational);
}
- }
- }
+ }
+ }
+ }
- protected UIViewRoot getViewRoot()
- {
- FacesContext context = FacesContext.getCurrentInstance();
+ protected UIViewRoot getViewRoot()
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
- if (context != null)
- {
- return context.getViewRoot();
- }
+ if (context != null)
+ {
+ return context.getViewRoot();
+ }
- return null;
- }
+ return null;
+ }
- protected Map<String, Object> getViewMap()
- {
- UIViewRoot viewRoot = getViewRoot();
+ protected Map<String, Object> getViewMap()
+ {
+ UIViewRoot viewRoot = getViewRoot();
- if (viewRoot != null)
- {
- return viewRoot.getViewMap(true);
- }
+ if (viewRoot != null)
+ {
+ return viewRoot.getViewMap(true);
+ }
- return null;
- }
+ return null;
+ }
- @SuppressWarnings("unchecked")
- private Map<Contextual<?>, Object> getComponentInstanceMap()
- {
- Map<String, Object> viewMap = getViewMap();
- Map<Contextual<?>, Object> map = (ConcurrentHashMap<Contextual<?>, Object>) viewMap.get(COMPONENT_MAP_NAME);
+ @SuppressWarnings("unchecked")
+ private Map<Contextual<?>, Object> getComponentInstanceMap()
+ {
+ Map<String, Object> viewMap = getViewMap();
+ Map<Contextual<?>, Object> map = (ConcurrentHashMap<Contextual<?>, Object>) viewMap.get(COMPONENT_MAP_NAME);
- if (map == null)
- {
- map = new ConcurrentHashMap<Contextual<?>, Object>();
- viewMap.put(COMPONENT_MAP_NAME, map);
- }
+ if (map == null)
+ {
+ map = new ConcurrentHashMap<Contextual<?>, Object>();
+ viewMap.put(COMPONENT_MAP_NAME, map);
+ }
- return map;
- }
+ return map;
+ }
- @SuppressWarnings("unchecked")
- private Map<Contextual<?>, CreationalContext<?>> getCreationalInstanceMap()
- {
- Map<String, Object> viewMap = getViewMap();
- Map<Contextual<?>, CreationalContext<?>> map = (Map<Contextual<?>, CreationalContext<?>>) viewMap
- .get(CREATIONAL_MAP_NAME);
+ @SuppressWarnings("unchecked")
+ private Map<Contextual<?>, CreationalContext<?>> getCreationalInstanceMap()
+ {
+ Map<String, Object> viewMap = getViewMap();
+ Map<Contextual<?>, CreationalContext<?>> map = (Map<Contextual<?>, CreationalContext<?>>) viewMap.get(CREATIONAL_MAP_NAME);
- if (map == null)
- {
- map = new ConcurrentHashMap<Contextual<?>, CreationalContext<?>>();
- viewMap.put(CREATIONAL_MAP_NAME, map);
- }
+ if (map == null)
+ {
+ map = new ConcurrentHashMap<Contextual<?>, CreationalContext<?>>();
+ viewMap.put(CREATIONAL_MAP_NAME, map);
+ }
- return map;
- }
+ return map;
+ }
}
\ No newline at end of file
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedExtension.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedExtension.java 2010-03-13 18:41:27 UTC (rev 12200)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedExtension.java 2010-03-15 20:29:42 UTC (rev 12201)
@@ -12,21 +12,21 @@
import javax.faces.bean.ViewScoped;
/**
- * An extension to provide @ViewScoped CDI / JSF2 integration.
+ * An extension to provide @ViewScoped CDI / JSF 2 integration.
*
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*/
public class ViewScopedExtension implements Extension
{
- public void addScope(@Observes final BeforeBeanDiscovery event)
- {
- event.addScope(ViewScoped.class, true, true);
- }
+ public void addScope(@Observes final BeforeBeanDiscovery event)
+ {
+ event.addScope(ViewScoped.class, true, true);
+ }
- public void registerContext(@Observes final AfterBeanDiscovery event)
- {
- event.addContext(new ViewScopedContext());
- }
+ public void registerContext(@Observes final AfterBeanDiscovery event)
+ {
+ event.addContext(new ViewScopedContext());
+ }
}
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/international/FacesLocaleResolver.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/international/FacesLocaleResolver.java 2010-03-13 18:41:27 UTC (rev 12200)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/international/FacesLocaleResolver.java 2010-03-15 20:29:42 UTC (rev 12201)
@@ -6,25 +6,25 @@
import javax.inject.Inject;
import javax.faces.context.FacesContext;
-
/**
- * A specialized version of the LocaleProducer that returns
- * the Locale associated with the current UIViewRoot or,
- * if the UIViewRoot has not been established, uses the
- * ViewHandler to calculate the Locale.
+ * A specialized version of the LocaleProducer that returns the Locale
+ * associated with the current UIViewRoot or, if the UIViewRoot has not been
+ * established, uses the ViewHandler to calculate the Locale.
*
* @author Dan Allen
*/
public class FacesLocaleResolver // extends LocaleResolver
{
- @Inject FacesContext facesContext;
-
+ @Inject
+ FacesContext facesContext;
+
public boolean isActive()
{
return facesContext != null && facesContext.getCurrentPhaseId() != null;
}
-
- public @Produces Locale getLocale()
+
+ public @Produces
+ Locale getLocale()
{
if (facesContext.getViewRoot() != null)
{
14 years, 9 months
Seam SVN: r12200 - branches/community/Seam_2_2.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-03-13 13:41:27 -0500 (Sat, 13 Mar 2010)
New Revision: 12200
Modified:
branches/community/Seam_2_2/changelog.txt
Log:
release 2.2.1.CR1
Modified: branches/community/Seam_2_2/changelog.txt
===================================================================
--- branches/community/Seam_2_2/changelog.txt 2010-03-13 07:16:22 UTC (rev 12199)
+++ branches/community/Seam_2_2/changelog.txt 2010-03-13 18:41:27 UTC (rev 12200)
@@ -1,7 +1,6 @@
JBoss Seam Changelog
====================
-
Release Notes - Seam - Version 2.2.1.CR1
** Bug
@@ -16,7 +15,6 @@
* [JBSEAM-3778] - MDB - IllegalStateException: No event context active
* [JBSEAM-3844] - Hot deployment : You are trying to use a connection factory that has been shut down
* [JBSEAM-3906] - Attachements are not shown in outlook
- * [JBSEAM-3996] - Seam should ignore duplicate classes on classpath
* [JBSEAM-4029] - NPE in JBossClusterMonitor.locateJBoss when other non-JBoss JMX servers are present
* [JBSEAM-4067] - ELSupport.coerceToType modifies BigDecimal Values
* [JBSEAM-4087] - Regexp Query.SUBJECT_PATTERN may be improved for JBSEAM-3032
@@ -55,7 +53,13 @@
* [JBSEAM-4537] - s:validateEquality tag doesn't work with JBossAS 6.0.0.M1
* [JBSEAM-4539] - s:selectItems part of UI example doesn't work with JBossAS 6.0.0.M1
* [JBSEAM-4549] - NPE in handleInbound()when servlet contexts are initialized
+ * [JBSEAM-4561] - testMultipleWindowSearch() stuck in Firefox
+ * [JBSEAM-4563] - Seambay example unable to commit transaction
+ * [JBSEAM-4566] - seam-mail does not work on JBoss AS 6
+ * [JBSEAM-4575] - Seam Itext example doesn't work correctly
+ * [JBSEAM-4580] - Booking example in cluster throws org.jboss.serial.exception.SerializationException
+
** Feature Request
* [JBSEAM-1572] - Make s:decorate behave more similarly to ui:decorate (h:panelGrid-friendly)
* [JBSEAM-2057] - Syntax highlighting
@@ -82,6 +86,7 @@
* [JBSEAM-4036] - Wicket Example - Missing jars in tomcat.deploy ant task
* [JBSEAM-4455] - Seamspace -- viewIds in s:link and s:button
+
** Task
* [JBSEAM-3035] - upgrade to Spring JAR to version 2.5
* [JBSEAM-3714] - Update release-process.txt to include the functional test execution
14 years, 9 months
Seam SVN: r12199 - modules/faces/trunk/src/main/java/org/jboss/seam/faces/component.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-03-13 02:16:22 -0500 (Sat, 13 Mar 2010)
New Revision: 12199
Modified:
modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java
Log:
formatting
update namespace to org.jboss.seam.faces
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java 2010-03-12 22:01:53 UTC (rev 12198)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/component/UIViewAction.java 2010-03-13 07:16:22 UTC (rev 12199)
@@ -24,211 +24,203 @@
import javax.faces.lifecycle.LifecycleFactory;
import javax.faces.view.ViewMetadata;
import javax.faces.webapp.FacesServlet;
-
+
/**
-* <p><strong>UIViewAction</strong> is an {@link ActionSource2} {@link
-* UIComponent} that specifies an application-specific command (or
-* action)--defined as an EL method expression--to be invoked during one of the
-* JSF lifecycle phases that proceeds view rendering. This component must be
-* declared as a child of the {@link ViewMetadata} facet of the {@link
-* UIViewRoot} so that it gets incorporated into the JSF lifecycle on both
-* non-faces (initial) requests and faces (postback) requests.</p>
-*
-* <p>The purpose of this component is to provide a light-weight
-* front-controller solution for executing code upon the loading of a JSF view
-* to support the integration of system services, content retrieval, view
-* management, and navigation. This functionality is especially useful for
-* non-faces (initial) requests.</p>
-*
-* <p>The {@link UIViewAction} component is closely tied to the {@link
-* UIViewParameter} component. The {@link UIViewParameter} component binds a
-* request parameter to a model property. Most of the time, this binding is used
-* to populate the model with data that supports the method being invoked by a
-* {@link UIViewAction} component, much like form inputs populate the model with
-* data to support the method being invoked by a {@link UICommand}
-* component.</p>
-*
-* <p>When the <literal>decode()</literal> method of the {@link UIViewAction} is
-* invoked, it will queue an {@link ActionEvent} to be broadcast to all
-* interested listeners when the <literal>broadcast()</literal> method is
-* invoked.</p>
-*
-* <p>If the value of the component's <literal>immediate</literal> attribute is
-* <literal>true</literal>, the action will be invoked during the Apply Request
-* Values JSF lifecycle phase. Otherwise, the action will be invoked during the
-* Invoke Application phase, the default behavior. The phase cannot be
-* set explicitly in the <literal>phase</literal> attribute, which takes
-* precedence over the <literal>immediate</literal> attribute.</p>
-*
-* <p>The invocation of the action is normally suppressed (meaning the {@link
-* ActionEvent} is not queued) on a faces request. It can be enabled by setting
-* the component's <literal>onPostback</literal> attribute to <literal>true</literal>.
-* Execution of the method can be subject to a required condition for all requests by
-* assigning an EL value expression of expected type boolean to the component's
-* <literal>if</literal> attribute, which must evaluate to
-* <literal>true</literal> for the action to be invoked.</p>
-*
-* <p>The {@link NavigationHandler} is consulted after the action is invoked to
-* carry out the navigation case that matches the action signature and outcome.
-* If a navigation case is matched, or the response is marked complete by the
-* action, subsequent {@link UIViewAction} components associated with the
-* current view are short-circuited. The lifecycle then advances
-* appropriately.</p>
-*
-* <p>It's important to note that the full component tree is not built before
-* the UIViewAction components are processed on an non-faces (initial) request.
-* Rather, the component tree only contains the {@link ViewMetadata}, an
-* important part of the optimization of this component and what sets it apart
-* from a {@link PreRenderViewEvent} listener.</p>
-*
-* @author Dan Allen
-* @author Andy Schwartz
-*
-* @see UIViewParameter
-*/
+ * <p><strong>UIViewAction</strong> is an {@link ActionSource2} {@link
+ * UIComponent} that specifies an application-specific command (or
+ * action)--defined as an EL method expression--to be invoked during one of the
+ * JSF lifecycle phases that proceeds view rendering. This component must be
+ * declared as a child of the {@link ViewMetadata} facet of the {@link
+ * UIViewRoot} so that it gets incorporated into the JSF lifecycle on both
+ * non-faces (initial) requests and faces (postback) requests.</p>
+ *
+ * <p>The purpose of this component is to provide a light-weight
+ * front-controller solution for executing code upon the loading of a JSF view
+ * to support the integration of system services, content retrieval, view
+ * management, and navigation. This functionality is especially useful for
+ * non-faces (initial) requests.</p>
+ *
+ * <p>The {@link UIViewAction} component is closely tied to the {@link
+ * UIViewParameter} component. The {@link UIViewParameter} component binds a
+ * request parameter to a model property. Most of the time, this binding is used
+ * to populate the model with data that supports the method being invoked by a
+ * {@link UIViewAction} component, much like form inputs populate the model with
+ * data to support the method being invoked by a {@link UICommand}
+ * component.</p>
+ *
+ * <p>When the <literal>decode()</literal> method of the {@link UIViewAction} is
+ * invoked, it will queue an {@link ActionEvent} to be broadcast to all
+ * interested listeners when the <literal>broadcast()</literal> method is
+ * invoked.</p>
+ *
+ * <p>If the value of the component's <literal>immediate</literal> attribute is
+ * <literal>true</literal>, the action will be invoked during the Apply Request
+ * Values JSF lifecycle phase. Otherwise, the action will be invoked during the
+ * Invoke Application phase, the default behavior. The phase cannot be
+ * set explicitly in the <literal>phase</literal> attribute, which takes
+ * precedence over the <literal>immediate</literal> attribute.</p>
+ *
+ * <p>The invocation of the action is normally suppressed (meaning the {@link
+ * ActionEvent} is not queued) on a faces request. It can be enabled by setting
+ * the component's <literal>onPostback</literal> attribute to <literal>true</literal>.
+ * Execution of the method can be subject to a required condition for all requests by
+ * assigning an EL value expression of expected type boolean to the component's
+ * <literal>if</literal> attribute, which must evaluate to
+ * <literal>true</literal> for the action to be invoked.</p>
+ *
+ * <p>The {@link NavigationHandler} is consulted after the action is invoked to
+ * carry out the navigation case that matches the action signature and outcome.
+ * If a navigation case is matched, or the response is marked complete by the
+ * action, subsequent {@link UIViewAction} components associated with the
+ * current view are short-circuited. The lifecycle then advances
+ * appropriately.</p>
+ *
+ * <p>It's important to note that the full component tree is not built before
+ * the UIViewAction components are processed on an non-faces (initial) request.
+ * Rather, the component tree only contains the {@link ViewMetadata}, an
+ * important part of the optimization of this component and what sets it apart
+ * from a {@link PreRenderViewEvent} listener.</p>
+ *
+ * @author Dan Allen
+ * @author Andy Schwartz
+ *
+ * @see UIViewParameter
+ */
@FacesComponent(
// tagName = "viewAction",
- // namespace = "http://java.sun.com/jsf/core",
+ // namespace = "http://jboss.org/seam/faces",
// (see https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=594)
value = UIViewAction.COMPONENT_TYPE)
public class UIViewAction extends UIComponentBase implements ActionSource2 {
-
+
// ------------------------------------------------------ Manifest Constants
-
+
/**
-* <p>
-* The standard component type for this component.
-* </p>
-*/
- public static final String COMPONENT_TYPE = "javax.faces.ViewAction";
-
+ * <p>
+ * The standard component type for this component.
+ * </p>
+ */
+ public static final String COMPONENT_TYPE = "org.jboss.seam.faces.ViewAction";
+
/**
-* <p>
-* The standard component family for this component.
-* </p>
-*/
- public static final String COMPONENT_FAMILY = "javax.faces.ViewAction";
-
+ * <p>
+ * The standard component family for this component.
+ * </p>
+ */
+ public static final String COMPONENT_FAMILY = "org.jboss.seam.faces.ViewAction";
+
/**
-* Properties that are tracked by state saving.
-*/
- enum PropertyKeys
- {
+ * Properties that are tracked by state saving.
+ */
+ enum PropertyKeys {
+
onPostback, actionExpression, immediate, phase, ifAttr("if");
-
private String name;
-
- PropertyKeys()
- {
+
+ PropertyKeys() {
}
-
- PropertyKeys(String name)
- {
+
+ PropertyKeys(String name) {
this.name = name;
}
-
+
@Override
- public String toString()
- {
+ public String toString() {
return name != null ? name : super.toString();
}
}
-
+
// ------------------------------------------------------------ Constructors
-
/**
-* <p>
-* Create a new {@link UIViewAction} instance with default property values.
-* </p>
-*/
- public UIViewAction()
- {
+ * <p>
+ * Create a new {@link UIViewAction} instance with default property values.
+ * </p>
+ */
+ public UIViewAction() {
super();
setRendererType(null);
}
-
+
// -------------------------------------------------------------- Properties
-
@Override
- public String getFamily()
- {
+ public String getFamily() {
return COMPONENT_FAMILY;
}
-
+
/**
-* {@inheritDoc}
-*
-* @deprecated This has been replaced by {@link #getActionExpression}.
-*/
+ * {@inheritDoc}
+ *
+ * @deprecated This has been replaced by {@link #getActionExpression}.
+ */
public MethodBinding getAction() {
MethodBinding result = null;
MethodExpression me;
-
+
if (null != (me = getActionExpression())) {
result = new MethodBindingMethodExpressionAdapter(me);
}
return result;
}
-
+
/**
-* {@inheritDoc}
-*
-* @deprecated This has been replaced by {@link #setActionExpression(javax.el.MethodExpression)}.
-* @throws UnsupportedOperationException if called
-*/
+ * {@inheritDoc}
+ *
+ * @deprecated This has been replaced by {@link #setActionExpression(javax.el.MethodExpression)}.
+ * @throws UnsupportedOperationException if called
+ */
public void setAction(MethodBinding action) {
throw new UnsupportedOperationException("Not supported.");
}
-
+
/**
-* Action listeners are not supported by the {@link UIViewAction} component.
-*
-* @throws UnsupportedOperationException if called
-*/
+ * Action listeners are not supported by the {@link UIViewAction} component.
+ *
+ * @throws UnsupportedOperationException if called
+ */
public MethodBinding getActionListener() {
throw new UnsupportedOperationException("Not supported.");
}
-
+
/**
-* Action listeners are not supported by the {@link UIViewAction} component.
-*
-* @throws UnsupportedOperationException if called
-*/
+ * Action listeners are not supported by the {@link UIViewAction} component.
+ *
+ * @throws UnsupportedOperationException if called
+ */
public void setActionListener(MethodBinding actionListener) {
throw new UnsupportedOperationException("Not supported.");
}
-
+
/**
-* Returns the value which dictates the JSF lifecycle phase in which the
-* action is invoked. If the value of this attribute is
-* <literal>true</literal>, the action will be invoked in the Apply Request
-* Values phase. If the value of this attribute is <literal>true</literal>,
-* the default, the action will be invoked in the Invoke Application Phase.
-*/
+ * Returns the value which dictates the JSF lifecycle phase in which the
+ * action is invoked. If the value of this attribute is
+ * <literal>true</literal>, the action will be invoked in the Apply Request
+ * Values phase. If the value of this attribute is <literal>true</literal>,
+ * the default, the action will be invoked in the Invoke Application Phase.
+ */
public boolean isImmediate() {
return (Boolean) getStateHelper().eval(PropertyKeys.immediate, false);
}
-
+
/**
-* Sets the immediate flag, which controls the JSF lifecycle in which
-* the action is invoked.
-*/
+ * Sets the immediate flag, which controls the JSF lifecycle in which
+ * the action is invoked.
+ */
public void setImmediate(boolean immediate) {
getStateHelper().put(PropertyKeys.immediate, immediate);
}
-
+
/**
-* <p>Returns the name of the phase in which the action is to be queued. Only
-* the following phases are supported (case does not matter):</p>
-* <ul>
-* <li>APPLY_REQUEST_VALUES</li>
-* <li>PROCESS_VALIDATIONS</li>
-* <li>UPDATE_MODEL_VALUES</li>
-* <li>INVOKE_APPLICATION</li>
-* </ul>
-* <p>If the phase is set, it takes precedence over the
-* immediate flag.</p>
-*/
+ * <p>Returns the name of the phase in which the action is to be queued. Only
+ * the following phases are supported (case does not matter):</p>
+ * <ul>
+ * <li>APPLY_REQUEST_VALUES</li>
+ * <li>PROCESS_VALIDATIONS</li>
+ * <li>UPDATE_MODEL_VALUES</li>
+ * <li>INVOKE_APPLICATION</li>
+ * </ul>
+ * <p>If the phase is set, it takes precedence over the
+ * immediate flag.</p>
+ */
public String getPhase() {
String phase = (String) getStateHelper().eval(PropertyKeys.phase);
if (phase != null) {
@@ -236,14 +228,14 @@
}
return phase;
}
-
+
/**
-* Set the name of the phase in which the action is to be queued.
-*/
+ * Set the name of the phase in which the action is to be queued.
+ */
public void setPhase(String phase) {
getStateHelper().put(PropertyKeys.phase, phase);
}
-
+
public PhaseId getPhaseId() {
String phase = getPhase();
if (phase == null) {
@@ -263,111 +255,107 @@
throw new FacesException("Not a valid phase [" + phase + "]");
}
}
-
+
/**
-* Action listeners are not supported by the {@link UIViewAction} component.
-*
-* @throws UnsupportedOperationException if called
-*/
+ * Action listeners are not supported by the {@link UIViewAction} component.
+ *
+ * @throws UnsupportedOperationException if called
+ */
public void addActionListener(ActionListener listener) {
throw new UnsupportedOperationException("Not supported.");
}
-
+
/**
-* Action listeners are not supported by the {@link UIViewAction} component.
-*/
+ * Action listeners are not supported by the {@link UIViewAction} component.
+ */
public ActionListener[] getActionListeners() {
return new ActionListener[0];
}
-
+
/**
-* Action listeners are not supported by the {@link UIViewAction} component.
-*
-* @throws UnsupportedOperationException if called
-*/
+ * Action listeners are not supported by the {@link UIViewAction} component.
+ *
+ * @throws UnsupportedOperationException if called
+ */
public void removeActionListener(ActionListener listener) {
throw new UnsupportedOperationException("Not supported.");
}
-
+
/**
-* Returns the action, represented as an EL method expression, to invoke.
-*/
- public MethodExpression getActionExpression()
- {
+ * Returns the action, represented as an EL method expression, to invoke.
+ */
+ public MethodExpression getActionExpression() {
return (MethodExpression) getStateHelper().get(PropertyKeys.actionExpression);
}
-
+
/**
-* Sets the action, represented as an EL method expression, to invoke.
-*/
- public void setActionExpression(MethodExpression actionExpression)
- {
+ * Sets the action, represented as an EL method expression, to invoke.
+ */
+ public void setActionExpression(MethodExpression actionExpression) {
getStateHelper().put(PropertyKeys.actionExpression, actionExpression);
}
-
+
/**
-* Returns a boolean value that controls whether the action is invoked during
-* faces (postback) request.
-*/
- public boolean isOnPostback()
- {
+ * Returns a boolean value that controls whether the action is invoked during
+ * faces (postback) request.
+ */
+ public boolean isOnPostback() {
return (Boolean) getStateHelper().eval(PropertyKeys.onPostback, false);
}
-
+
/**
-* Set the bookean flag that controls whether the action is invoked during
-* a faces (postback) request.
-*/
- public void setOnPostback(boolean onPostback)
- {
+ * Set the bookean flag that controls whether the action is invoked during
+ * a faces (postback) request.
+ */
+ public void setOnPostback(boolean onPostback) {
getStateHelper().put(PropertyKeys.onPostback, onPostback);
}
-
+
/**
-* Returns a condition, represented as an EL value expression, that must
-* evaluate to true for the action to be invoked.
-*/
- public boolean isIf()
- {
+ * Returns a condition, represented as an EL value expression, that must
+ * evaluate to true for the action to be invoked.
+ */
+ public boolean isIf() {
return (Boolean) getStateHelper().eval(PropertyKeys.ifAttr, true);
}
-
+
/**
-* Sets the condition, represented as an EL value expression, that must
-* evaluate to true for the action to be invoked.
-*/
- public void setIf(boolean condition)
- {
+ * Sets the condition, represented as an EL value expression, that must
+ * evaluate to true for the action to be invoked.
+ */
+ public void setIf(boolean condition) {
getStateHelper().put(PropertyKeys.ifAttr, condition);
}
-
+
// ----------------------------------------------------- UIComponent Methods
-
/**
-* <p>In addition to to the default {@link UIComponent#broadcast} processing,
-* pass the {@link ActionEvent} being broadcast to the default {@link
-* ActionListener} registered on the {@link
-* javax.faces.application.Application}.</p>
-*
-* @param event {@link FacesEvent} to be broadcast
-*
-* @throws AbortProcessingException Signal the JavaServer Faces
-* implementation that no further processing on the current event
-* should be performed
-* @throws IllegalArgumentException if the implementation class
-* of this {@link FacesEvent} is not supported by this component
-* @throws NullPointerException if <code>event</code> is
-* <code>null</code>
-*/
+ * <p>In addition to to the default {@link UIComponent#broadcast} processing,
+ * pass the {@link ActionEvent} being broadcast to the default {@link
+ * ActionListener} registered on the {@link
+ * javax.faces.application.Application}.</p>
+ *
+ * @param event {@link FacesEvent} to be broadcast
+ *
+ * @throws AbortProcessingException Signal the JavaServer Faces
+ * implementation that no further processing on the current event
+ * should be performed
+ * @throws IllegalArgumentException if the implementation class
+ * of this {@link FacesEvent} is not supported by this component
+ * @throws NullPointerException if <code>event</code> is
+ * <code>null</code>
+ */
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException {
-
+
super.broadcast(event);
-
+
FacesContext context = getFacesContext();
+
+ // OPEN QUESTION: should we consider a navigation to the same view as a no-op navigation?
+
// only proceed if the response has not been marked complete and navigation to another view has not occurred
- if (event instanceof ActionEvent && !context.getResponseComplete() &&
- context.getViewRoot() == getViewRootOf(event)) {
+ if (event instanceof ActionEvent && !context.getResponseComplete()
+ && context.getViewRoot() == getViewRootOf(event)) {
ActionListener listener = context.getApplication().getActionListener();
if (listener != null) {
UIViewRoot viewRootBefore = context.getViewRoot();
@@ -382,19 +370,19 @@
// if the view id changed as a result of navigation, then execute the JSF lifecycle for the new view id
if (viewRootBefore != viewRootAfter) {
/*
-// execute the JSF lifecycle by dispatching a forward request
-// this approach is problematic because it throws a wrench in the event broadcasting
-try {
-context.getExternalContext().dispatch(context.getApplication()
-.getViewHandler().getActionURL(context, viewRootAfter.getViewId())
-.substring(context.getExternalContext().getRequestContextPath().length()));
-// kill this lifecycle execution
-context.responseComplete();
-} catch (IOException e) {
-throw new FacesException("Dispatch to viewId failed: " + viewRootAfter.getViewId(), e);
-}
-*/
-
+ // execute the JSF lifecycle by dispatching a forward request
+ // this approach is problematic because it throws a wrench in the event broadcasting
+ try {
+ context.getExternalContext().dispatch(context.getApplication()
+ .getViewHandler().getActionURL(context, viewRootAfter.getViewId())
+ .substring(context.getExternalContext().getRequestContextPath().length()));
+ // kill this lifecycle execution
+ context.responseComplete();
+ } catch (IOException e) {
+ throw new FacesException("Dispatch to viewId failed: " + viewRootAfter.getViewId(), e);
+ }
+ */
+
// manually execute the JSF lifecycle on the new view id
// certain tweaks have to be made to the FacesContext to allow us to reset the lifecycle
Lifecycle lifecycle = getLifecycle(context);
@@ -402,8 +390,14 @@
instrumentedContext.pushViewIntoRequestMap().clearViewRoot().clearPostback().set();
lifecycle.execute(instrumentedContext);
instrumentedContext.restore();
- }
- else {
+
+ /*
+ Another approach would be to register a phase listener in the
+ decode() method for the phase in which the action is set to
+ invoke. The phase listener would performs a servlet forward
+ if a non-redirect navigation occurs after the phase.
+ */
+ } else {
// apply the deferred call (relevant when immediate is true)
context.renderResponse();
}
@@ -411,49 +405,47 @@
}
}
}
-
+
/**
-* First, determine if the action should be invoked by evaluating this
-* components pre-conditions. If this is a faces (postback) request and the
-* evaluated value of the postback attribute is false, take no action. If the
-* evaluated value of the if attribute is false, take no action. If both
-* conditions pass, proceed with creating an {@link ActionEvent}.
-*
-* Set the phaseId in which the queued {@link ActionEvent} should be
-* broadcast by assigning the appropriate value to the phaseId property of
-* the {@link ActionEvent} according to the evaluated value of the immediate
-* attribute. If the value is <literal>true</literal>, set the phaseId to
-* {@link PhaseId#APPLY_REQUEST_VALUES}. Otherwise, set the phaseId to to
-* {@link PhaseId#INVOKE_APPLICATION}.
-*
-* Finally, queue the event by calling <literal>queueEvent()</literal> and
-* passing the {@link ActionEvent} just created.
-*/
+ * First, determine if the action should be invoked by evaluating this
+ * components pre-conditions. If this is a faces (postback) request and the
+ * evaluated value of the postback attribute is false, take no action. If the
+ * evaluated value of the if attribute is false, take no action. If both
+ * conditions pass, proceed with creating an {@link ActionEvent}.
+ *
+ * Set the phaseId in which the queued {@link ActionEvent} should be
+ * broadcast by assigning the appropriate value to the phaseId property of
+ * the {@link ActionEvent} according to the evaluated value of the immediate
+ * attribute. If the value is <literal>true</literal>, set the phaseId to
+ * {@link PhaseId#APPLY_REQUEST_VALUES}. Otherwise, set the phaseId to to
+ * {@link PhaseId#INVOKE_APPLICATION}.
+ *
+ * Finally, queue the event by calling <literal>queueEvent()</literal> and
+ * passing the {@link ActionEvent} just created.
+ */
@Override
public void decode(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
-
+
if ((context.isPostback() && !isOnPostback()) || !isIf()) {
return;
}
-
+
ActionEvent e = new ActionEvent(this);
PhaseId phaseId = getPhaseId();
if (phaseId != null) {
e.setPhaseId(phaseId);
- }
- else if (isImmediate()) {
+ } else if (isImmediate()) {
e.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- }
- else {
+ } else {
e.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
-
+
queueEvent(e);
}
-
+
private UIViewRoot getViewRootOf(FacesEvent e) {
UIComponent c = e.getComponent();
do {
@@ -464,7 +456,7 @@
} while (c != null);
return null;
}
-
+
private Lifecycle getLifecycle(FacesContext context) {
LifecycleFactory lifecycleFactory = (LifecycleFactory)
FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
@@ -475,85 +467,83 @@
}
return lifecycleFactory.getLifecycle(lifecycleId);
}
-
+
/**
-* A FacesContext delegator that gives us the necessary controls over the FacesContext
-* to allow the execution of the lifecycle to accomodate the UIViewAction sequence.
-*/
+ * A FacesContext delegator that gives us the necessary controls over the FacesContext
+ * to allow the execution of the lifecycle to accomodate the UIViewAction sequence.
+ */
private class InstrumentedFacesContext extends FacesContextWrapper {
+
private FacesContext wrapped;
private boolean viewRootCleared = false;
private boolean renderedResponseControlDisabled = false;
private Boolean postback = null;
+
public InstrumentedFacesContext(FacesContext wrapped) {
this.wrapped = wrapped;
}
-
+
@Override
public FacesContext getWrapped() {
return wrapped;
}
-
+
@Override
public UIViewRoot getViewRoot() {
if (viewRootCleared) {
return null;
}
-
+
return wrapped.getViewRoot();
}
-
+
@Override
public void setViewRoot(UIViewRoot viewRoot) {
viewRootCleared = false;
wrapped.setViewRoot(viewRoot);
}
-
+
@Override
public boolean isPostback() {
return postback == null ? wrapped.isPostback() : postback;
}
-
+
@Override
public void renderResponse() {
if (!renderedResponseControlDisabled) {
wrapped.renderResponse();
}
}
-
+
/**
-* Make it look like we have dispatched a request using the include method.
-*/
+ * Make it look like we have dispatched a request using the include method.
+ */
public InstrumentedFacesContext pushViewIntoRequestMap() {
- getExternalContext().getRequestMap()
- .put("javax.servlet.include.servlet_path", wrapped.getViewRoot().getViewId());
+ getExternalContext().getRequestMap().put("javax.servlet.include.servlet_path", wrapped.getViewRoot().getViewId());
return this;
}
-
+
public InstrumentedFacesContext clearPostback() {
postback = false;
return this;
}
-
-
+
public InstrumentedFacesContext clearViewRoot() {
viewRootCleared = true;
return this;
}
-
+
public InstrumentedFacesContext disableRenderResponseControl() {
renderedResponseControlDisabled = true;
return this;
}
-
+
public void set() {
setCurrentInstance(this);
}
-
+
public void restore() {
setCurrentInstance(wrapped);
}
-
}
-
-}
\ No newline at end of file
+}
14 years, 9 months
Seam SVN: r12198 - modules/faces/trunk/src/main/java/org/jboss/seam/faces/context.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-03-12 17:01:53 -0500 (Fri, 12 Mar 2010)
New Revision: 12198
Modified:
modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java
Log:
Removed some buggy synch code.
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java 2010-03-12 17:13:21 UTC (rev 12197)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java 2010-03-12 22:01:53 UTC (rev 12198)
@@ -151,11 +151,13 @@
Flash flash = getFlash();
ConcurrentHashMap<Contextual<?>, Object> map = (ConcurrentHashMap<Contextual<?>, Object>) flash
.get(COMPONENT_MAP_NAME);
+
if (map == null)
{
map = new ConcurrentHashMap<Contextual<?>, Object>();
flash.put(COMPONENT_MAP_NAME, map);
}
+
return map;
}
@@ -165,11 +167,13 @@
Flash flash = getFlash();
Map<Contextual<?>, CreationalContext<?>> map = (ConcurrentHashMap<Contextual<?>, CreationalContext<?>>) flash
.get(CREATIONAL_MAP_NAME);
+
if (map == null)
{
map = new ConcurrentHashMap<Contextual<?>, CreationalContext<?>>();
flash.put(CREATIONAL_MAP_NAME, map);
}
+
return map;
}
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java 2010-03-12 17:13:21 UTC (rev 12197)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java 2010-03-12 22:01:53 UTC (rev 12198)
@@ -73,6 +73,7 @@
{
Map<Contextual<?>, Object> componentInstanceMap = getComponentInstanceMap();
Map<Contextual<?>, CreationalContext<?>> creationalContextMap = getCreationalInstanceMap();
+
synchronized (componentInstanceMap)
{
instance = (T) componentInstanceMap.get(component);
@@ -183,45 +184,30 @@
private Map<Contextual<?>, Object> getComponentInstanceMap()
{
Map<String, Object> viewMap = getViewMap();
- Map<Contextual<?>, Object> componentInstanceMap = (ConcurrentHashMap<Contextual<?>, Object>) viewMap
- .get(COMPONENT_MAP_NAME);
+ Map<Contextual<?>, Object> map = (ConcurrentHashMap<Contextual<?>, Object>) viewMap.get(COMPONENT_MAP_NAME);
- if (componentInstanceMap == null)
+ if (map == null)
{
- synchronized (componentInstanceMap)
- {
- componentInstanceMap = (ConcurrentHashMap<Contextual<?>, Object>) viewMap.get(COMPONENT_MAP_NAME);
- if (componentInstanceMap == null)
- {
- componentInstanceMap = new ConcurrentHashMap<Contextual<?>, Object>();
- viewMap.put(COMPONENT_MAP_NAME, componentInstanceMap);
- }
- }
+ map = new ConcurrentHashMap<Contextual<?>, Object>();
+ viewMap.put(COMPONENT_MAP_NAME, map);
}
- return componentInstanceMap;
+ return map;
}
@SuppressWarnings("unchecked")
private Map<Contextual<?>, CreationalContext<?>> getCreationalInstanceMap()
{
Map<String, Object> viewMap = getViewMap();
- Map<Contextual<?>, CreationalContext<?>> creationalContextMap = (Map<Contextual<?>, CreationalContext<?>>) viewMap
+ Map<Contextual<?>, CreationalContext<?>> map = (Map<Contextual<?>, CreationalContext<?>>) viewMap
.get(CREATIONAL_MAP_NAME);
- if (creationalContextMap == null)
+ if (map == null)
{
- synchronized (creationalContextMap)
- {
- creationalContextMap = (Map<Contextual<?>, CreationalContext<?>>) viewMap.get(CREATIONAL_MAP_NAME);
- if (creationalContextMap == null)
- {
- creationalContextMap = new ConcurrentHashMap<Contextual<?>, CreationalContext<?>>();
- viewMap.put(CREATIONAL_MAP_NAME, creationalContextMap);
- }
- }
+ map = new ConcurrentHashMap<Contextual<?>, CreationalContext<?>>();
+ viewMap.put(CREATIONAL_MAP_NAME, map);
}
- return creationalContextMap;
+ return map;
}
}
\ No newline at end of file
14 years, 9 months
Seam SVN: r12197 - in modules/faces/trunk: src/main/java/org/jboss/seam/faces/context and 1 other directory.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-03-12 12:13:21 -0500 (Fri, 12 Mar 2010)
New Revision: 12197
Removed:
modules/faces/trunk/faces-config.NavData
modules/faces/trunk/seam-faces.iml
Modified:
modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java
modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java
Log:
* Updated thread safety and code quality.
Deleted: modules/faces/trunk/faces-config.NavData
===================================================================
--- modules/faces/trunk/faces-config.NavData 2010-03-12 16:07:32 UTC (rev 12196)
+++ modules/faces/trunk/faces-config.NavData 2010-03-12 17:13:21 UTC (rev 12197)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Scene Scope="Project" version="2">
- <Scope Scope="Faces Configuration Only"/>
- <Scope Scope="Project"/>
- <Scope Scope="All Faces Configurations"/>
-</Scene>
Deleted: modules/faces/trunk/seam-faces.iml
===================================================================
--- modules/faces/trunk/seam-faces.iml 2010-03-12 16:07:32 UTC (rev 12196)
+++ modules/faces/trunk/seam-faces.iml 2010-03-12 17:13:21 UTC (rev 12197)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
- <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
- <excludeFolder url="file://$MODULE_DIR$/target" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" scope="PROVIDED" name="Maven: javax:javaee-web-api:6.0" level="project" />
- </component>
-</module>
-
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java 2010-03-12 16:07:32 UTC (rev 12196)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/FlashScopedContext.java 2010-03-12 17:13:21 UTC (rev 12197)
@@ -24,6 +24,8 @@
*/
public class FlashScopedContext implements Context, PhaseListener
{
+ private static final long serialVersionUID = -1580689204988513798L;
+
private final static String COMPONENT_MAP_NAME = "org.jboss.seam.faces.flash.componentInstanceMap";
private final static String CREATIONAL_MAP_NAME = "org.jboss.seam.faces.flash.creationalInstanceMap";
private final ThreadLocal<Map<Contextual<?>, Object>> lastComponentInstanceMap = new ThreadLocal<Map<Contextual<?>, Object>>();
@@ -33,9 +35,7 @@
public <T> T get(final Contextual<T> component)
{
assertActive();
- Map<Contextual<?>, Object> componentInstanceMap = getComponentInstanceMap();
- T instance = (T) componentInstanceMap.get(component);
- return instance;
+ return (T) getComponentInstanceMap().get(component);
}
@SuppressWarnings("unchecked")
@@ -74,6 +74,57 @@
return FlashScoped.class;
}
+ public boolean isActive()
+ {
+ return getFlash() != null;
+ }
+
+ /**
+ * This method should, **in theory**, catch the current instanceMap (which
+ * is the previous lifecycle's next instanceMap.) These are the objects that
+ * we want cleaned up at the end of the current render-response phase, so we
+ * save them here until after the RENDER_RESPONSE phase, because otherwise
+ * they would have been destroyed by the Flash, and we would no longer have
+ * access to them.
+ */
+ public void beforePhase(final PhaseEvent event)
+ {
+ this.lastComponentInstanceMap.set(getComponentInstanceMap());
+ this.lastCreationalContextMap.set(getCreationalContextMap());
+ }
+
+ /**
+ * Do the object cleanup using our saved references.
+ */
+ @SuppressWarnings("unchecked")
+ public void afterPhase(final PhaseEvent event)
+ {
+ // TODO verify that this is actually destroying the beans we want to be
+ // destroyed... flash is confusing, tests will make sense of it
+ Map<Contextual<?>, Object> componentInstanceMap = lastComponentInstanceMap.get();
+ Map<Contextual<?>, CreationalContext<?>> creationalContextMap = lastCreationalContextMap.get();
+
+ if (componentInstanceMap != null)
+ {
+ for (Entry<Contextual<?>, Object> componentEntry : componentInstanceMap.entrySet())
+ {
+ Contextual contextual = componentEntry.getKey();
+ Object instance = componentEntry.getValue();
+ CreationalContext creational = creationalContextMap.get(contextual);
+
+ contextual.destroy(instance, creational);
+ }
+ }
+
+ this.lastComponentInstanceMap.remove();
+ this.lastCreationalContextMap.remove();
+ }
+
+ public PhaseId getPhaseId()
+ {
+ return PhaseId.RENDER_RESPONSE;
+ }
+
private Flash getFlash()
{
FacesContext currentInstance = FacesContext.getCurrentInstance();
@@ -85,17 +136,12 @@
return null;
}
- public boolean isActive()
- {
- return getFlash() != null;
- }
-
private void assertActive()
{
if (!isActive())
{
throw new ContextNotActiveException(
- "WebBeans context with scope annotation @FlashScoped is not active with respect to the current thread");
+ "Seam context with scope annotation @FlashScoped is not active with respect to the current thread");
}
}
@@ -127,39 +173,4 @@
return map;
}
- public void beforePhase(final PhaseEvent event)
- {
- this.lastComponentInstanceMap.set(getComponentInstanceMap());
- this.lastCreationalContextMap.set(getCreationalContextMap());
- }
-
- @SuppressWarnings("unchecked")
- public void afterPhase(final PhaseEvent event)
- {
- // TODO verify that this is actually destroying the beans we want to be
- // destroyed... flash is confusing, tests will make sense of it
- Map<Contextual<?>, Object> componentInstanceMap = lastComponentInstanceMap.get();
- Map<Contextual<?>, CreationalContext<?>> creationalContextMap = lastCreationalContextMap.get();
-
- if (componentInstanceMap != null)
- {
- for (Entry<Contextual<?>, Object> componentEntry : componentInstanceMap.entrySet())
- {
- Contextual contextual = componentEntry.getKey();
- Object instance = componentEntry.getValue();
- CreationalContext creational = creationalContextMap.get(contextual);
-
- contextual.destroy(instance, creational);
- }
- }
-
- this.lastComponentInstanceMap.remove();
- this.lastCreationalContextMap.remove();
- }
-
- public PhaseId getPhaseId()
- {
- return PhaseId.RENDER_RESPONSE;
- }
-
}
Modified: modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java
===================================================================
--- modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java 2010-03-12 16:07:32 UTC (rev 12196)
+++ modules/faces/trunk/src/main/java/org/jboss/seam/faces/context/ViewScopedContext.java 2010-03-12 17:13:21 UTC (rev 12197)
@@ -53,22 +53,11 @@
if (!isJsfSubscribed)
{
FacesContext.getCurrentInstance().getApplication().subscribeToEvent(PreDestroyViewMapEvent.class, this);
-
isJsfSubscribed = true;
}
- Map<String, Object> viewMap = getViewMap();
+ T instance = (T) getComponentInstanceMap().get(component);
- ConcurrentHashMap<Contextual<?>, Object> componentInstanceMap = (ConcurrentHashMap<Contextual<?>, Object>) viewMap
- .get(COMPONENT_MAP_NAME);
-
- if (componentInstanceMap == null)
- {
- return null;
- }
-
- T instance = (T) componentInstanceMap.get(component);
-
return instance;
}
@@ -77,54 +66,27 @@
{
assertActive();
- Map<String, Object> viewMap = getViewMap();
-
- ConcurrentHashMap<Contextual<?>, Object> componentInstanceMap = (ConcurrentHashMap<Contextual<?>, Object>) viewMap
- .get(COMPONENT_MAP_NAME);
-
- if (componentInstanceMap == null)
+ T instance = get(component);
+ if (instance == null)
{
- // TODO we now need to start being carefull with reentrancy...
- componentInstanceMap = new ConcurrentHashMap<Contextual<?>, Object>();
- viewMap.put(COMPONENT_MAP_NAME, componentInstanceMap);
- }
-
- ConcurrentHashMap<Contextual<?>, CreationalContext<?>> creationalContextMap = (ConcurrentHashMap<Contextual<?>, CreationalContext<?>>) viewMap
- .get(CREATIONAL_MAP_NAME);
- if (creationalContextMap == null)
- {
- // TODO we now need to start being carefull with reentrancy...
- creationalContextMap = new ConcurrentHashMap<Contextual<?>, CreationalContext<?>>();
- viewMap.put(CREATIONAL_MAP_NAME, creationalContextMap);
- }
-
- T instance = (T) componentInstanceMap.get(component);
- if (instance != null)
- {
- return instance;
- }
-
- if (creationalContext == null)
- {
- return null;
- }
-
- synchronized (componentInstanceMap)
- {
- // just to make sure...
- T i = (T) componentInstanceMap.get(component);
- if (i != null)
+ if (creationalContext != null)
{
- return i;
+ Map<Contextual<?>, Object> componentInstanceMap = getComponentInstanceMap();
+ Map<Contextual<?>, CreationalContext<?>> creationalContextMap = getCreationalInstanceMap();
+ synchronized (componentInstanceMap)
+ {
+ instance = (T) componentInstanceMap.get(component);
+ if (instance == null)
+ {
+ instance = component.create(creationalContext);
+ if (instance != null)
+ {
+ componentInstanceMap.put(component, instance);
+ creationalContextMap.put(component, creationalContext);
+ }
+ }
+ }
}
-
- instance = component.create(creationalContext);
-
- if (instance != null)
- {
- componentInstanceMap.put(component, instance);
- creationalContextMap.put(component, creationalContext);
- }
}
return instance;
@@ -135,9 +97,6 @@
return ViewScoped.class;
}
- /**
- * The view context is active if a valid ViewRoot could be detected.
- */
public boolean isActive()
{
return getViewRoot() != null;
@@ -148,7 +107,7 @@
if (!isActive())
{
throw new ContextNotActiveException(
- "WebBeans context with scope annotation @ViewScoped is not active with respect to the current thread");
+ "Seam context with scope annotation @ViewScoped is not active with respect to the current thread");
}
}
@@ -175,23 +134,17 @@
{
if (event instanceof PreDestroyViewMapEvent)
{
- // better use the viewmap we get from the event to prevent
- // concurrent modification problems
- Map<String, Object> viewMap = ((UIViewRoot) event.getSource()).getViewMap();
+ Map<Contextual<?>, Object> componentInstanceMap = getComponentInstanceMap();
+ Map<Contextual<?>, CreationalContext<?>> creationalContextMap = getCreationalInstanceMap();
- ConcurrentHashMap<Contextual<?>, Object> componentInstanceMap = (ConcurrentHashMap<Contextual<?>, Object>) viewMap
- .get(COMPONENT_MAP_NAME);
-
- ConcurrentHashMap<Contextual<?>, CreationalContext<?>> creationalContextMap = (ConcurrentHashMap<Contextual<?>, CreationalContext<?>>) viewMap
- .get(CREATIONAL_MAP_NAME);
-
if (componentInstanceMap != null)
{
for (Entry<Contextual<?>, Object> componentEntry : componentInstanceMap.entrySet())
{
- // there is no nice way to explain the Java Compiler that we
- // are handling the same type T,
- // therefore we need completely drop the type information :(
+ /*
+ * No way to inform the compiler of type <T> information, so
+ * it has to be abandoned here :(
+ */
Contextual contextual = componentEntry.getKey();
Object instance = componentEntry.getValue();
CreationalContext creational = creationalContextMap.get(contextual);
@@ -225,4 +178,50 @@
return null;
}
+
+ @SuppressWarnings("unchecked")
+ private Map<Contextual<?>, Object> getComponentInstanceMap()
+ {
+ Map<String, Object> viewMap = getViewMap();
+ Map<Contextual<?>, Object> componentInstanceMap = (ConcurrentHashMap<Contextual<?>, Object>) viewMap
+ .get(COMPONENT_MAP_NAME);
+
+ if (componentInstanceMap == null)
+ {
+ synchronized (componentInstanceMap)
+ {
+ componentInstanceMap = (ConcurrentHashMap<Contextual<?>, Object>) viewMap.get(COMPONENT_MAP_NAME);
+ if (componentInstanceMap == null)
+ {
+ componentInstanceMap = new ConcurrentHashMap<Contextual<?>, Object>();
+ viewMap.put(COMPONENT_MAP_NAME, componentInstanceMap);
+ }
+ }
+ }
+
+ return componentInstanceMap;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Map<Contextual<?>, CreationalContext<?>> getCreationalInstanceMap()
+ {
+ Map<String, Object> viewMap = getViewMap();
+ Map<Contextual<?>, CreationalContext<?>> creationalContextMap = (Map<Contextual<?>, CreationalContext<?>>) viewMap
+ .get(CREATIONAL_MAP_NAME);
+
+ if (creationalContextMap == null)
+ {
+ synchronized (creationalContextMap)
+ {
+ creationalContextMap = (Map<Contextual<?>, CreationalContext<?>>) viewMap.get(CREATIONAL_MAP_NAME);
+ if (creationalContextMap == null)
+ {
+ creationalContextMap = new ConcurrentHashMap<Contextual<?>, CreationalContext<?>>();
+ viewMap.put(CREATIONAL_MAP_NAME, creationalContextMap);
+ }
+ }
+ }
+
+ return creationalContextMap;
+ }
}
\ No newline at end of file
14 years, 9 months
Seam SVN: r12196 - modules/faces/trunk/src/main/resources/META-INF.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-03-12 11:07:32 -0500 (Fri, 12 Mar 2010)
New Revision: 12196
Modified:
modules/faces/trunk/src/main/resources/META-INF/faces-config.xml
Log:
change faces-config.xml reference
Modified: modules/faces/trunk/src/main/resources/META-INF/faces-config.xml
===================================================================
--- modules/faces/trunk/src/main/resources/META-INF/faces-config.xml 2010-03-12 14:12:09 UTC (rev 12195)
+++ modules/faces/trunk/src/main/resources/META-INF/faces-config.xml 2010-03-12 16:07:32 UTC (rev 12196)
@@ -9,7 +9,7 @@
<ordering>
<after>
- <name>webbeans</name>
+ <name>weld</name>
</after>
</ordering>
14 years, 9 months
Seam SVN: r12195 - tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-03-12 09:12:09 -0500 (Fri, 12 Mar 2010)
New Revision: 12195
Modified:
tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Components.po
tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Concepts.po
tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Excel.po
tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Gettingstarted.po
tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Jbpm.po
Log:
ported fixed french translations
Modified: tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Components.po
===================================================================
--- tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Components.po 2010-03-12 13:50:45 UTC (rev 12194)
+++ tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Components.po 2010-03-12 14:12:09 UTC (rev 12195)
@@ -200,7 +200,7 @@
#: Components.xml:171
#, no-c-format
msgid "<literal>execute()</literal> — perform the redirect immediately."
-msgstr "<literal>execute()</literal> — réalise la redirection immédiatement."
+msgstr "<literal>execute()</literal> — réalise la redirection immédiatement."
#. Tag: para
#: Components.xml:177
Modified: tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Concepts.po
===================================================================
--- tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Concepts.po 2010-03-12 13:50:45 UTC (rev 12194)
+++ tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Concepts.po 2010-03-12 14:12:09 UTC (rev 12195)
@@ -100,7 +100,7 @@
#: Concepts.xml:49
#, no-c-format
msgid "You will recognize some of these contexts from servlet and related specifications. However, two of them might be new to you: <emphasis>conversation context</emphasis>, and <emphasis>business process context</emphasis>. One reason state management in web applications is so fragile and error-prone is that the three built-in contexts (request, session and application) are not especially meaningful from the point of view of the business logic. A user login session, for example, is a fairly arbitrary construct in terms of the actual application work flow. Therefore, most Seam components are scoped to the conversation or business process contexts, since they are the contexts which are most meaningful in terms of the application."
-msgstr "Nous pouvons reconnaître certain de ces contexte de part les spécifications des servlets autour des servlets. Malgré cela, deux d’entre elles devraient être nouvelle pour vous : <emphasis>contexte conversationnel</emphasis>, et <emphasis>contexte de processus métier<emphasis>. Une des raisons pour que le gestionnaire d’état qui est dans les applications web, soit si fragile et un nid à erreurs c’est que trois des contextes livrés (requête, session et application) ne sont pas particulièrement utile du point de vue de la logique métier. Une session d’authentification d’un utilisateur, par exemple, est construite presque arbitrairement dans une application de flot de travail. Ainsi, les composants Seam sont bornés à la conversation ou aux contextes des processus métier, ainsi ils sont les contextes qui ont le plus de sens en termes d’application. "
+msgstr "Nous pouvons reconnaître certain de ces contexte de part les spécifications des servlets autour des servlets. Malgré cela, deux d’entre elles devraient être nouvelle pour vous : <emphasis>contexte conversationnel</emphasis>, et <emphasis>contexte de processus métier</emphasis>. Une des raisons pour que le gestionnaire d’état qui est dans les applications web, soit si fragile et un nid à erreurs c’est que trois des contextes livrés (requête, session et application) ne sont pas particulièrement utile du point de vue de la logique métier. Une session d’authentification d’un utilisateur, par exemple, est construite presque arbitrairement dans une application de flot de travail. Ainsi, les composants Seam sont bornés à la conversation ou aux contextes des processus métier, ainsi ils sont les contextes qui ont le plus de sens en termes d’application. "
#. Tag: para
#: Concepts.xml:60
Modified: tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Excel.po
===================================================================
--- tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Excel.po 2010-03-12 13:50:45 UTC (rev 12194)
+++ tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Excel.po 2010-03-12 14:12:09 UTC (rev 12195)
@@ -23,7 +23,7 @@
#: Excel.xml:9
#, no-c-format
msgid "Seam also supports generation of &excel; spreadsheets through the excellent <ulink url=\"http://jexcelapi.sourceforge.net/\">JExcelAPI </ulink> library. The generated document is compatible with &excel; versions 95, 97, 2000, XP and 2003. Currently a limited subset of the library functionality is exposed but the ultimate goal is to be able to do everything the library allows for. Please refer to the JExcelAPI documentation for more information on capabilities and limitations."
-msgstr " Seam support aussi la génération de feuilles de calculs &excel au travers de l'excelente bibliothèqe <ulink url=\"http://jexcelapi.sourceforge.net/\">JExcelAPI </ulink>. Le document généré est compatible avec &excel; versions 95, 97, 2000, XP et 2003. Actuellement un sous-groupe limité de fonctionnalité de la bibliothèque sont exploité mais le but ultime est d'être capable de proposer tout ce que la bibliothèque est capable de faire. Merci de vous référer à la documentation JExcelAPI pour plus d'informations sur les possibilités et les limitations."
+msgstr " Seam support aussi la génération de feuilles de calculs &excel; au travers de l'excelente bibliothèqe <ulink url=\"http://jexcelapi.sourceforge.net/\">JExcelAPI </ulink>. Le document généré est compatible avec &excel; versions 95, 97, 2000, XP et 2003. Actuellement un sous-groupe limité de fonctionnalité de la bibliothèque sont exploité mais le but ultime est d'être capable de proposer tout ce que la bibliothèque est capable de faire. Merci de vous référer à la documentation JExcelAPI pour plus d'informations sur les possibilités et les limitations."
#. Tag: title
#: Excel.xml:21
Modified: tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Gettingstarted.po
===================================================================
--- tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Gettingstarted.po 2010-03-12 13:50:45 UTC (rev 12194)
+++ tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Gettingstarted.po 2010-03-12 14:12:09 UTC (rev 12195)
@@ -313,7 +313,7 @@
#: Gettingstarted.xml:85
#, no-c-format
msgid "This copies the Seam jars, dependent jars and the JDBC driver jar to a new Eclipse project, and generates all needed resources and configuration files, a facelets template file and stylesheet, along with Eclipse metadata and an Ant build script. The Eclipse project will be automatically deployed to an exploded directory structure in JBoss AS as soon as you add the project using <literal>New -> Project... -> General -> Project -> Next</literal>, typing the <literal>Project name</literal> (<literal>helloworld</literal> in this case), and then clicking <literal>Finish</literal>. Do not select <literal>Java Project</literal> from the New Project wizard."
-msgstr "Cela recopie les jars de Seam, les jars nécéssaires et le jar du pilote JDBC dans un nouveau projet Eclipse et génère tout les fichiers de configuration et les ressources requises, le fichier modèle facelets et la feuille de style, ainsi que les metadata Eclipse et le script de construction Ant. Le projet Eclipse va être automatiquement déployé dans une structure de dossiers transférer dans JBoss AS dès que vous ajouterez le projet en utilisant <literal>New -> Project... -> General -> Project -> Next</literal>, entrez le <literal>Project name</literal> ( <literal>helloworld</literal> dans notre cas), et alors cliquez sur <literal>Finish</literal>. Ne sélectionnez pas <literal>Java Project<literal> dans l'assistant de Nouveau Projet."
+msgstr "Cela recopie les jars de Seam, les jars nécéssaires et le jar du pilote JDBC dans un nouveau projet Eclipse et génère tout les fichiers de configuration et les ressources requises, le fichier modèle facelets et la feuille de style, ainsi que les metadata Eclipse et le script de construction Ant. Le projet Eclipse va être automatiquement déployé dans une structure de dossiers transférer dans JBoss AS dès que vous ajouterez le projet en utilisant <literal>New -> Project... -> General -> Project -> Next</literal>, entrez le <literal>Project name</literal> ( <literal>helloworld</literal> dans notre cas), et alors cliquez sur <literal>Finish</literal>. Ne sélectionnez pas <literal>Java Project</literal> dans l'assistant de Nouveau Projet."
#. Tag: para
#: Gettingstarted.xml:93
Modified: tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Jbpm.po
===================================================================
--- tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Jbpm.po 2010-03-12 13:50:45 UTC (rev 12194)
+++ tags/JBoss_Seam_2_2_1_CR1/doc/Seam_Reference_Guide/fr-FR/Jbpm.po 2010-03-12 14:12:09 UTC (rev 12195)
@@ -1,17 +1,19 @@
# Language fr-FR translations for PACKAGE package.
-# Automatically generated, 2008.
#
+# Automatically generated, 2008, 2010.
msgid ""
msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
+"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-31 09:07+0000\n"
-"PO-Revision-Date: 2009-11-30 00:37+0100\n"
-"Last-Translator: P.J <essaidetest(a)yahoo.fr>\n"
-"Language-Team: none\n"
+"PO-Revision-Date: 2010-03-12 14:40+0100\n"
+"Last-Translator: \n"
+"Language-Team: American English <kde-i18n-doc(a)kde.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.0\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. Tag: title
#: Jbpm.xml:2
@@ -47,7 +49,7 @@
#: Jbpm.xml:42
#, no-c-format
msgid "Don't get these two things confused! They operate at very different levels or granularity. <emphasis>Pageflow</emphasis>, <emphasis>conversation</emphasis> and <emphasis>task</emphasis> all refer to a single interaction with a single user. A business process spans many tasks. Futhermore, the two applications of jBPM are totally orthogonal. You can use them together or independently or not at all."
-msgstr "Ne vous laisser pas embrouillés par ces deux choses ! Elle fonctionne à des niveaux ou de granularité très différents. <emphasis>L'enchainement de page /emphasis>, <emphasis>de conversation</emphasis> et des <emphasis>tâches</emphasis> toutes ce réfèrent à une seule intéraction avec un seul utilisateur. Un processus métier s'étends sur plusieurs tâches. En outre, les deux applications de jBPM sont totalement ortogonales. Vous pouvez les utiliser ensemble ou indépendamment ou pas du tout. "
+msgstr "Ne vous laisser pas embrouillés par ces deux choses ! Elle fonctionne à des niveaux ou de granularité très différents. <emphasis>L'enchainement de page </emphasis>, <emphasis>de conversation</emphasis> et des <emphasis>tâches</emphasis> toutes ce réfèrent à une seule intéraction avec un seul utilisateur. Un processus métier s'étends sur plusieurs tâches. En outre, les deux applications de jBPM sont totalement ortogonales. Vous pouvez les utiliser ensemble ou indépendamment ou pas du tout. "
#. Tag: para
#: Jbpm.xml:51
@@ -539,7 +541,7 @@
#: Jbpm.xml:321
#, no-c-format
msgid "If we are beginning the pageflow during the <literal>RENDER_RESPONSE</literal> phase — during a <literal>@Factory</literal> or <literal>@Create</literal> method, for example — we consider ourselves to be already at the page being rendered, and use a <literal><start-page></literal> node as the first node in the pageflow, as in the example above."
-msgstr "Si nous commençons un enchainement de page pendant la phase R<literal>RENDER_RESPONSE</literal> — pendant qu'une méthode literal>@Factory</literal> ou <literal>@Create</literal>, par exemple — nous considerons nous même être à la page qui doit être rendue, et utilisons un noeud <literal><start-page></literal> comme premier noeud dans l'enchainement de page, comme le montre l'exemple ci dessous. "
+msgstr "Si nous commençons un enchainement de page pendant la phase R<literal>RENDER_RESPONSE</literal> — pendant qu'une méthode <literal>@Factory</literal> ou <literal>@Create</literal>, par exemple — nous considerons nous même être à la page qui doit être rendue, et utilisons un noeud <literal><start-page></literal> comme premier noeud dans l'enchainement de page, comme le montre l'exemple ci dessous. "
#. Tag: para
#: Jbpm.xml:329
@@ -969,7 +971,7 @@
#: Jbpm.xml:558
#, no-c-format
msgid "To initiate a business process instance, we use the <literal>@CreateProcess</literal> annotation:"
-msgstr "Pour initialiser une instance d'un processus métier, nous utilisons l'annotation literal>@CreateProcess</literal>: "
+msgstr "Pour initialiser une instance d'un processus métier, nous utilisons l'annotation <literal>@CreateProcess</literal>: "
#. Tag: programlisting
#: Jbpm.xml:563
@@ -1229,3 +1231,4 @@
msgid "Please refer to the jBPM documentation for a more thorough overview of the sophisticated features that jBPM provides for managing complex business processes."
msgstr "Merci de vous référer à la document de jBPM pour un apperçu plus détaillé des fonctionnalités sophistiquées que le jBPM fournir pour la gestion des processus métier complexes. "
+
14 years, 9 months