You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/02/26 15:44:59 UTC
svn commit: r631234 [2/2] - in /myfaces/orchestra/trunk/core/src:
main/java/org/apache/myfaces/orchestra/
main/java/org/apache/myfaces/orchestra/conversation/jsf/
main/java/org/apache/myfaces/orchestra/conversation/spring/
main/java/org/apache/myfaces/...
Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/viewController/jsf/ViewControllerVariableResolver.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/viewController/jsf/ViewControllerVariableResolver.java?rev=631234&r1=631233&r2=631234&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/viewController/jsf/ViewControllerVariableResolver.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/viewController/jsf/ViewControllerVariableResolver.java Tue Feb 26 06:44:53 2008
@@ -31,35 +31,35 @@
*/
public class ViewControllerVariableResolver extends VariableResolver
{
- private final static String VIEW_CONTROLLER_VARIABLE = "oxViewController";
- private final static ViewControllerManager DEFAULT_VCM = new DefaultViewControllerManager();
+ private final static String VIEW_CONTROLLER_VARIABLE = "oxViewController";
+ private final static ViewControllerManager DEFAULT_VCM = new DefaultViewControllerManager();
- private final VariableResolver original;
+ private final VariableResolver original;
- public ViewControllerVariableResolver(VariableResolver original)
- {
- this.original = original;
- }
-
- public Object resolveVariable(FacesContext facesContext, String variableName) throws EvaluationException
- {
- if (VIEW_CONTROLLER_VARIABLE.equals(variableName))
- {
- ViewControllerManager manager = getViewControllerManager(facesContext);
- return manager.getViewController(facesContext.getViewRoot().getViewId());
- }
-
- return original.resolveVariable(facesContext, variableName);
- }
-
- static ViewControllerManager getViewControllerManager(FacesContext context)
- {
- ViewControllerManager manager = (ViewControllerManager) context.getApplication().getVariableResolver().resolveVariable(context, ViewControllerManager.VIEW_CONTROLLER_MANAGER_NAME);
- if (manager != null)
- {
- return manager;
- }
+ public ViewControllerVariableResolver(VariableResolver original)
+ {
+ this.original = original;
+ }
+
+ public Object resolveVariable(FacesContext facesContext, String variableName) throws EvaluationException
+ {
+ if (VIEW_CONTROLLER_VARIABLE.equals(variableName))
+ {
+ ViewControllerManager manager = getViewControllerManager(facesContext);
+ return manager.getViewController(facesContext.getViewRoot().getViewId());
+ }
+
+ return original.resolveVariable(facesContext, variableName);
+ }
+
+ static ViewControllerManager getViewControllerManager(FacesContext context)
+ {
+ ViewControllerManager manager = (ViewControllerManager) context.getApplication().getVariableResolver().resolveVariable(context, ViewControllerManager.VIEW_CONTROLLER_MANAGER_NAME);
+ if (manager != null)
+ {
+ return manager;
+ }
- return DEFAULT_VCM;
- }
+ return DEFAULT_VCM;
+ }
}
Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/viewController/spring/SpringViewControllerScope.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/viewController/spring/SpringViewControllerScope.java?rev=631234&r1=631233&r2=631234&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/viewController/spring/SpringViewControllerScope.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/viewController/spring/SpringViewControllerScope.java Tue Feb 26 06:44:53 2008
@@ -91,33 +91,33 @@
// TODO: avoid using the _ViewControllerUtils class here. That is JSF-specific which this class is
// not supposed to be.
ViewControllerManager viewControllerManager = getViewControllerManager(facesContext);
- String viewControllerName = viewControllerManager.getViewControllerName(facesContext.getViewRoot().getViewId());
- if (viewControllerName == null)
- {
- throw new OrchestraException("no view controller name found for view " + facesContext.getViewRoot().getViewId());
- }
+ String viewControllerName = viewControllerManager.getViewControllerName(facesContext.getViewRoot().getViewId());
+ if (viewControllerName == null)
+ {
+ throw new OrchestraException("no view controller name found for view " + facesContext.getViewRoot().getViewId());
+ }
- String conversationName = super.getConversationNameForBean(viewControllerName);
- if (conversationName == null)
- {
- throw new OrchestraException("no view controller definition found for view " + facesContext.getViewRoot().getViewId());
- }
+ String conversationName = super.getConversationNameForBean(viewControllerName);
+ if (conversationName == null)
+ {
+ throw new OrchestraException("no view controller definition found for view " + facesContext.getViewRoot().getViewId());
+ }
- return conversationName;
- }
+ return conversationName;
+ }
private ViewControllerManager getViewControllerManager(FacesContext context)
- {
- try
- {
- return (ViewControllerManager)
- getApplicationContext().getBean(
- ViewControllerManager.VIEW_CONTROLLER_MANAGER_NAME,
- ViewControllerManager.class);
- }
- catch(NoSuchBeanDefinitionException e)
- {
- return DEFAULT_VCM;
- }
- }
+ {
+ try
+ {
+ return (ViewControllerManager)
+ getApplicationContext().getBean(
+ ViewControllerManager.VIEW_CONTROLLER_MANAGER_NAME,
+ ViewControllerManager.class);
+ }
+ catch(NoSuchBeanDefinitionException e)
+ {
+ return DEFAULT_VCM;
+ }
+ }
}
Modified: myfaces/orchestra/trunk/core/src/main/tld/misc/web-jsptaglibrary_1_2.dtd
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/tld/misc/web-jsptaglibrary_1_2.dtd?rev=631234&r1=631233&r2=631234&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/tld/misc/web-jsptaglibrary_1_2.dtd (original)
+++ myfaces/orchestra/trunk/core/src/main/tld/misc/web-jsptaglibrary_1_2.dtd Tue Feb 26 06:44:53 2008
@@ -39,7 +39,7 @@
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
- "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+ "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-->
@@ -48,14 +48,14 @@
validator?, listener*, tag+) >
<!ATTLIST taglib id ID #IMPLIED
- xmlns CDATA #FIXED
- "http://java.sun.com/JSP/TagLibraryDescriptor">
+ xmlns CDATA #FIXED
+ "http://java.sun.com/JSP/TagLibraryDescriptor">
<!ELEMENT tlib-version (#PCDATA) >
<!ELEMENT jsp-version (#PCDATA) >
<!ELEMENT short-name (#PCDATA) >
-<!ELEMENT uri (#PCDATA) >
-<!ELEMENT description (#PCDATA) >
+<!ELEMENT uri (#PCDATA) >
+<!ELEMENT description (#PCDATA) >
<!ELEMENT validator (validator-class, init-param*, description?) >
<!ELEMENT validator-class (#PCDATA) >
<!ELEMENT init-param (param-name, param-value, description?)>
@@ -81,7 +81,7 @@
<!ELEMENT declare (#PCDATA) >
<!ELEMENT scope (#PCDATA) >
<!ELEMENT attribute (name, required? , rtexprvalue?, type?, description?) >
-<!ELEMENT name (#PCDATA) >
+<!ELEMENT name (#PCDATA) >
<!ELEMENT required (#PCDATA) >
<!ELEMENT rtexprvalue (#PCDATA) >
<!ELEMENT type (#PCDATA) >
Modified: myfaces/orchestra/trunk/core/src/main/tld/myfaces_orchestra.tld
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/tld/myfaces_orchestra.tld?rev=631234&r1=631233&r2=631234&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/tld/myfaces_orchestra.tld (original)
+++ myfaces/orchestra/trunk/core/src/main/tld/myfaces_orchestra.tld Tue Feb 26 06:44:53 2008
@@ -19,64 +19,64 @@
* under the License.
-->
<!DOCTYPE taglib
- PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
- "misc/web-jsptaglibrary_1_2.dtd">
+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+ "misc/web-jsptaglibrary_1_2.dtd">
<taglib>
- <tlib-version>1.0.10</tlib-version>
- <jsp-version>1.2</jsp-version>
- <short-name>n</short-name>
- <uri>http://myfaces.apache.org/orchestra</uri>
- <description>
- Enhanced standard JSP actions and custom MyFaces actions.
- </description>
+ <tlib-version>1.0.10</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>n</short-name>
+ <uri>http://myfaces.apache.org/orchestra</uri>
+ <description>
+ Enhanced standard JSP actions and custom MyFaces actions.
+ </description>
- <!-- conversation -->
- <tag>
- <name>endConversation</name>
- <tag-class>org.apache.myfaces.orchestra.conversation.jsf.components.EndConversationTag</tag-class>
- <body-content>JSP</body-content>
- <description>Ends a conversation</description>
+ <!-- conversation -->
+ <tag>
+ <name>endConversation</name>
+ <tag-class>org.apache.myfaces.orchestra.conversation.jsf.components.EndConversationTag</tag-class>
+ <body-content>JSP</body-content>
+ <description>Ends a conversation</description>
- <attribute>
- <name>onOutcome</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- End the conversation only if the action outcome matches the given onOutcome. This can be a comma
- separated list. If not specified, then the conversation is always ended (except when the action
- returns null).
- </description>
- </attribute>
- <attribute>
- <name>errorOutcome</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- If the action method throws an exception then use the given outcome for further navigation.
- The specified outcome is checked against onOutcomes just as if the action had returned the
- same value. If not specified then the original exception will be allowed to propagate.
- </description>
- </attribute>
- <attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- the name of the conversation
- </description>
- </attribute>
+ <attribute>
+ <name>onOutcome</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ End the conversation only if the action outcome matches the given onOutcome. This can be a comma
+ separated list. If not specified, then the conversation is always ended (except when the action
+ returns null).
+ </description>
+ </attribute>
+ <attribute>
+ <name>errorOutcome</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ If the action method throws an exception then use the given outcome for further navigation.
+ The specified outcome is checked against onOutcomes just as if the action had returned the
+ same value. If not specified then the original exception will be allowed to propagate.
+ </description>
+ </attribute>
+ <attribute>
+ <name>name</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ the name of the conversation
+ </description>
+ </attribute>
- </tag>
- <tag>
- <name>separateConversationContext</name>
- <tag-class>org.apache.myfaces.orchestra.conversation.jsf.components.SeparateConversationContextTag</tag-class>
- <body-content>JSP</body-content>
- <description>Separates the current context from the children. e.g. commandLinks will start a new conversation
- context
- </description>
- </tag>
+ </tag>
+ <tag>
+ <name>separateConversationContext</name>
+ <tag-class>org.apache.myfaces.orchestra.conversation.jsf.components.SeparateConversationContextTag</tag-class>
+ <body-content>JSP</body-content>
+ <description>Separates the current context from the children. e.g. commandLinks will start a new conversation
+ context
+ </description>
+ </tag>
<tag>
<name>converter</name>
<tag-class>org.apache.myfaces.orchestra.conversation.jsf.components.ConverterTag</tag-class>
Modified: myfaces/orchestra/trunk/core/src/test/java/org/apache/myfaces/orchestra/conversation/DummyBean.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/test/java/org/apache/myfaces/orchestra/conversation/DummyBean.java?rev=631234&r1=631233&r2=631234&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/test/java/org/apache/myfaces/orchestra/conversation/DummyBean.java (original)
+++ myfaces/orchestra/trunk/core/src/test/java/org/apache/myfaces/orchestra/conversation/DummyBean.java Tue Feb 26 06:44:53 2008
@@ -20,55 +20,55 @@
public class DummyBean implements ConversationBindingListener
{
- private String data;
+ private String data;
- public static ConversationBindingListener callback;
+ public static ConversationBindingListener callback;
- public DummyBean()
- {
- }
-
- public void touch()
- {
- }
-
- public String getData()
- {
- return data;
- }
-
- public void setData(String data)
- {
- this.data = data;
- }
-
- public Conversation checkCurrentConversation()
- {
- return Conversation.getCurrentInstance();
- }
-
- public void invalidateSelf()
- {
- Conversation.getCurrentInstance().invalidate();
- }
-
- public void invalidateAndRestartSelf()
- {
- Conversation.getCurrentInstance().invalidateAndRestart();
- }
-
- public DummyBean getRaw()
- {
- return this;
- }
-
- public void valueBound(ConversationBindingEvent event)
- {
- callback.valueBound(event);
- }
-
- public void valueUnbound(ConversationBindingEvent event)
- {
- callback.valueUnbound(event);
- }
+ public DummyBean()
+ {
+ }
+
+ public void touch()
+ {
+ }
+
+ public String getData()
+ {
+ return data;
+ }
+
+ public void setData(String data)
+ {
+ this.data = data;
+ }
+
+ public Conversation checkCurrentConversation()
+ {
+ return Conversation.getCurrentInstance();
+ }
+
+ public void invalidateSelf()
+ {
+ Conversation.getCurrentInstance().invalidate();
+ }
+
+ public void invalidateAndRestartSelf()
+ {
+ Conversation.getCurrentInstance().invalidateAndRestart();
+ }
+
+ public DummyBean getRaw()
+ {
+ return this;
+ }
+
+ public void valueBound(ConversationBindingEvent event)
+ {
+ callback.valueBound(event);
+ }
+
+ public void valueUnbound(ConversationBindingEvent event)
+ {
+ callback.valueUnbound(event);
+ }
}