Seam SVN: r15476 - branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2013-04-08 04:27:01 -0400 (Mon, 08 Apr 2013)
New Revision: 15476
Modified:
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Interpolator.java
Log:
bz947542 fixed NPE
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Interpolator.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Interpolator.java 2013-04-08 08:12:40 UTC (rev 15475)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Interpolator.java 2013-04-08 08:27:01 UTC (rev 15476)
@@ -61,6 +61,11 @@
throw new IllegalArgumentException("more than 10 parameters");
}
+ if (string == null)
+ {
+ string = "";
+ }
+
if (string.indexOf('#') >= 0 || string.indexOf('{') >= 0)
{
string = interpolateExpressions(string, params);
11 years, 7 months
Seam SVN: r15475 - in branches/enterprise/WFK-2_1/jboss-seam-gen/dist: test and 1 other directory.
by seam-commits@lists.jboss.org
Author: vdedik
Date: 2013-04-08 04:12:40 -0400 (Mon, 08 Apr 2013)
New Revision: 15475
Modified:
branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build.xml
branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/ActionTest.java
branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/FormTest.java
Log:
bz 947910 -- removed unecessary imports from seam-gen tests
Modified: branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build.xml
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build.xml 2013-04-05 13:22:58 UTC (rev 15474)
+++ branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build.xml 2013-04-08 08:12:40 UTC (rev 15475)
@@ -1294,6 +1294,9 @@
</copy>
<copy file="${templates.dir}/test/ActionTest.java" tofile="${test.file}">
<filterset refid="filters"/>
+ <filterset>
+ <filter token="extraImports" value="import ${action.package}.${interface.name};${line.separator}import ${action.package}.${bean.name};"/>
+ </filterset>
</copy>
<mkdir dir="${project.home}/resources-test"/>
<copy file="${templates.dir}/test/arquillian.xml" tofile="${project.home}/resources-test/arquillian.xml">
@@ -1312,6 +1315,9 @@
</copy>
<copy file="${templates.dir}/test/ActionTest.java" tofile="${test.file}">
<filterset refid="filters"/>
+ <filterset>
+ <filter token="extraImports" value="import ${action.package}.${bean.name};"/>
+ </filterset>
</copy>
<mkdir dir="${project.home}/resources-test"/>
<copy file="${templates.dir}/test/arquillian.xml" tofile="${project.home}/resources-test/arquillian.xml">
@@ -1330,6 +1336,9 @@
</copy>
<copy file="${templates.dir}/test/FormTest.java" tofile="${test.file}">
<filterset refid="filters"/>
+ <filterset>
+ <filter token="extraImports" value="import ${action.package}.${bean.name};"/>
+ </filterset>
</copy>
<copy file="${templates.dir}/view/form.xhtml" tofile="${page.file}">
<filterset refid="filters"/>
@@ -1351,6 +1360,9 @@
</copy>
<copy file="${templates.dir}/test/FormTest.java" tofile="${test.file}">
<filterset refid="filters"/>
+ <filterset>
+ <filter token="extraImports" value="import ${action.package}.${interface.name};${line.separator}import ${action.package}.${bean.name};"/>
+ </filterset>
</copy>
<copy file="${templates.dir}/view/form.xhtml" tofile="${page.file}">
<filterset refid="filters"/>
Modified: branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/ActionTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/ActionTest.java 2013-04-05 13:22:58 UTC (rev 15474)
+++ branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/ActionTest.java 2013-04-08 08:12:40 UTC (rev 15475)
@@ -10,12 +10,11 @@
import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.seam.mock.JUnitSeamTest;
-import @actionPackage@.@interfaceName@;
-import @actionPackage@.@beanName@;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.runner.RunWith;
import java.io.File;
+@extraImports@
+
@RunWith(Arquillian.class)
public class @interfaceName@Test extends JUnitSeamTest {
Modified: branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/FormTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/FormTest.java 2013-04-05 13:22:58 UTC (rev 15474)
+++ branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/FormTest.java 2013-04-08 08:12:40 UTC (rev 15475)
@@ -12,12 +12,11 @@
import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.seam.mock.JUnitSeamTest;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.runner.RunWith;
-import @actionPackage@.@interfaceName@;
-import @actionPackage@.@beanName@;
import java.io.File;
+@extraImports@
+
@RunWith(Arquillian.class)
public class @interfaceName@Test extends JUnitSeamTest {
11 years, 7 months
Seam SVN: r15474 - branches/enterprise/WFK-2_1/distribution.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2013-04-05 09:22:58 -0400 (Fri, 05 Apr 2013)
New Revision: 15474
Modified:
branches/enterprise/WFK-2_1/distribution/get-arquillian-libs.xml
Log:
fixing bz947816 to not include old xnio-api and xnio-nio jars
Modified: branches/enterprise/WFK-2_1/distribution/get-arquillian-libs.xml
===================================================================
--- branches/enterprise/WFK-2_1/distribution/get-arquillian-libs.xml 2013-04-05 09:54:49 UTC (rev 15473)
+++ branches/enterprise/WFK-2_1/distribution/get-arquillian-libs.xml 2013-04-05 13:22:58 UTC (rev 15474)
@@ -15,6 +15,8 @@
<aether:dependency groupid="org.jboss.as" artifactid="jboss-as-arquillian-container-remote" version="${version.jboss-as7}">
<aether:exclusion groupid="org.jboss.remotingjmx" artifactid="remoting-jmx" />
<aether:exclusion groupid="org.jboss.remoting3" artifactid="jboss-remoting" />
+ <aether:exclusion groupid="org.jboss.xnio" artifactid="xnio-api" />
+ <aether:exclusion groupid="org.jboss.xnio" artifactid="xnio-nio" />
</aether:dependency>
<aether:dependency groupid="org.jboss.arquillian.junit" artifactid="arquillian-junit-container" version="${version.arquillian-junit}" />
<aether:dependency groupid="org.jboss.arquillian.protocol" artifactid="arquillian-protocol-servlet" version="${version.arquillian-junit}" />
11 years, 7 months
Seam SVN: r15473 - in branches/enterprise/WFK-2_1/examples: seamspace and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2013-04-05 05:54:49 -0400 (Fri, 05 Apr 2013)
New Revision: 15473
Modified:
branches/enterprise/WFK-2_1/examples/booking/build.xml
branches/enterprise/WFK-2_1/examples/seamspace/build.xml
Log:
bz948354 added check for ant to be 1.8.0 at least and some enhancements for replacing tokens
Modified: branches/enterprise/WFK-2_1/examples/booking/build.xml
===================================================================
(Binary files differ)
Modified: branches/enterprise/WFK-2_1/examples/seamspace/build.xml
===================================================================
(Binary files differ)
11 years, 7 months
Seam SVN: r15472 - in branches/enterprise/WFK-2_1: functional-tests and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2013-04-05 05:54:39 -0400 (Fri, 05 Apr 2013)
New Revision: 15472
Modified:
branches/enterprise/WFK-2_1/distribution/pom.xml
branches/enterprise/WFK-2_1/functional-tests/pom.xml
Log:
bz947881 updated dependency versions to EAP 6.0.1
Modified: branches/enterprise/WFK-2_1/distribution/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/distribution/pom.xml 2013-04-03 12:28:06 UTC (rev 15471)
+++ branches/enterprise/WFK-2_1/distribution/pom.xml 2013-04-05 09:54:39 UTC (rev 15472)
@@ -220,7 +220,7 @@
<dependency>
<groupId>org.jboss.remoting3</groupId>
<artifactId>jboss-remoting</artifactId>
- <version>3.2.13.GA-redhat-1</version>
+ <version>3.2.14.GA-redhat-1</version>
</dependency>
</dependencies>
<dependencyManagement>
@@ -228,7 +228,7 @@
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
- <version>4.0.1.Final-redhat-1</version>
+ <version>4.0.1.Final-redhat-2</version>
</dependency>
</dependencies>
</dependencyManagement>
Modified: branches/enterprise/WFK-2_1/functional-tests/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/functional-tests/pom.xml 2013-04-03 12:28:06 UTC (rev 15471)
+++ branches/enterprise/WFK-2_1/functional-tests/pom.xml 2013-04-05 09:54:39 UTC (rev 15472)
@@ -40,12 +40,12 @@
<dependency>
<groupId>xalan</groupId>
<artifactId>serializer</artifactId>
- <version>2.7.1-redhat-1</version>
+ <version>2.7.1-redhat-3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
- <version>4.1.3-redhat-1</version>
+ <version>4.1.3-redhat-2</version>
</dependency>
</dependencies>
</dependencyManagement>
11 years, 7 months
Seam SVN: r15471 - in branches/enterprise/WFK-2_1/jboss-seam/src: main/java/org/jboss/seam/core and 5 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2013-04-03 08:28:06 -0400 (Wed, 03 Apr 2013)
New Revision: 15471
Added:
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesPage.java
Modified:
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Contexts.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationPropagation.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesManager.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamViewHandler.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Pages.java
branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PhaseListenerTest.java
Log:
Revert "bz921660 removing FacesPage, moving conversation restoration to pre restore view"
This reverts commit 483c0496ff052a3a874c3b83d22c318ab12b6716.
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Contexts.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Contexts.java 2013-04-03 12:27:45 UTC (rev 15470)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Contexts.java 2013-04-03 12:28:06 UTC (rev 15471)
@@ -115,6 +115,12 @@
{
log.debug("Page Context will be lazilly created");
FacesLifecycle.resumePage();
+ Map<String, String> parameters = facesContext.getExternalContext().getRequestParameterMap();
+ ConversationPropagation.instance().restoreConversationId(parameters);
+ boolean conversationFound = Manager.instance().restoreConversation();
+ pageContext.get().set("org.jboss.seam.jsf.SeamPhaseListener.conversationFound", conversationFound);
+
+ FacesLifecycle.resumeConversation(facesContext.getExternalContext());
}
}
}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationPropagation.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationPropagation.java 2013-04-03 12:27:45 UTC (rev 15470)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationPropagation.java 2013-04-03 12:28:06 UTC (rev 15471)
@@ -54,6 +54,7 @@
{
restoreNaturalConversationId(parameters);
restoreSyntheticConversationId(parameters);
+ restorePageContextConversationId();
getPropagationFromRequestParameter(parameters);
handlePropagationType(parameters);
}
@@ -72,6 +73,26 @@
}
}
+ private void restorePageContextConversationId()
+ {
+ if ( Contexts.isPageContextActive() && isMissing(conversationId) )
+ {
+ //checkPageContext is a workaround for a bug in MySQL server-side state saving
+
+ //if it is not passed as a request parameter,
+ //try to get it from the page context
+ org.jboss.seam.faces.FacesPage page = org.jboss.seam.faces.FacesPage.instance();
+ conversationId = page.getConversationId();
+ parentConversationId = null;
+ validateLongRunningConversation = page.isConversationLongRunning();
+ }
+
+ else
+ {
+ log.trace("Found conversation id in request parameter: " + conversationId);
+ }
+ }
+
private void restoreNaturalConversationId(Map parameters)
{
conversationName = getRequestParameterValue(parameters, CONVERSATION_NAME_PARAMETER);
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesManager.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesManager.java 2013-04-03 12:27:45 UTC (rev 15470)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesManager.java 2013-04-03 12:28:06 UTC (rev 15471)
@@ -99,6 +99,16 @@
}
redirect(url, parameters, true, true);
}
+
+ @Override
+ protected void storeConversationToViewRootIfNecessary()
+ {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ if ( facesContext!=null && (FacesLifecycle.getPhaseId()==PhaseId.RENDER_RESPONSE || FacesLifecycle.getPhaseId()==PhaseId.RESTORE_VIEW) )
+ {
+ FacesPage.instance().storeConversation();
+ }
+ }
@Override
protected String generateInitialConversationId()
Added: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesPage.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesPage.java (rev 0)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesPage.java 2013-04-03 12:28:06 UTC (rev 15471)
@@ -0,0 +1,173 @@
+package org.jboss.seam.faces;
+
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
+import java.io.Serializable;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.Init;
+import org.jboss.seam.core.Manager;
+//import org.jboss.seam.pageflow.Pageflow;
+import org.jboss.seam.web.Session;
+
+/**
+ * Book-keeping component that persists information
+ * about the conversation associated with the current
+ * page.
+ *
+ * @author Gavin King
+ *
+ */
+@Name("org.jboss.seam.faces.facesPage")
+@BypassInterceptors
+@Install(precedence=BUILT_IN, classDependencies="javax.faces.context.FacesContext")
+(a)Scope(ScopeType.PAGE)
+public class FacesPage implements Serializable
+{
+ private static final long serialVersionUID = 4807114041808347239L;
+ private String pageflowName;
+ private Integer pageflowCounter;
+ private String pageflowNodeName;
+
+ private String conversationId;
+ private boolean conversationIsLongRunning;
+
+ //private Map<String, Object> pageParameters;
+
+ public String getConversationId()
+ {
+ return conversationId;
+ }
+
+ public void discardTemporaryConversation()
+ {
+ conversationId = null;
+ conversationIsLongRunning = false;
+ }
+
+ public void discardNestedConversation(String outerConversationId)
+ {
+ conversationId = outerConversationId;
+ conversationIsLongRunning = true;
+ }
+
+ public void storeConversation(String conversationId)
+ {
+ this.conversationId = conversationId;
+ conversationIsLongRunning = true;
+ }
+
+ public void storePageflow()
+ {
+// if ( Init.instance().isJbpmInstalled() )
+// {
+// Pageflow pageflow = Pageflow.instance();
+// if ( pageflow.isInProcess() /*&& !pageflow.getProcessInstance().hasEnded()*/ && Manager.instance().isLongRunningConversation() )
+// {
+// pageflowName = pageflow.getSubProcessInstance().getProcessDefinition().getName();
+// pageflowNodeName = pageflow.getNode().getName();
+// pageflowCounter = pageflow.getPageflowCounter();
+// }
+// else
+// {
+// pageflowName = null;
+// pageflowNodeName = null;
+// pageflowCounter = null;
+// }
+// }
+ }
+
+ public static FacesPage instance()
+ {
+ if ( !Contexts.isPageContextActive() )
+ {
+ throw new IllegalStateException("No page context active");
+ }
+ return (FacesPage) Component.getInstance(FacesPage.class, ScopeType.PAGE);
+ }
+
+ public boolean isConversationLongRunning()
+ {
+ return conversationIsLongRunning;
+ }
+
+ public Integer getPageflowCounter()
+ {
+ return pageflowCounter;
+ }
+
+ public String getPageflowName()
+ {
+ return pageflowName;
+ }
+
+ public String getPageflowNodeName()
+ {
+ return pageflowNodeName;
+ }
+
+ public void storeConversation()
+ {
+ Manager manager = Manager.instance();
+
+ //we only need to execute this code when we are in the
+ //RENDER_RESPONSE phase, ie. not before redirects
+
+ Session session = Session.getInstance();
+ boolean sessionInvalid = session!=null && session.isInvalid();
+ if ( !sessionInvalid && manager.isLongRunningConversation() )
+ {
+ storeConversation( manager.getCurrentConversationId() );
+ }
+ else if ( !sessionInvalid && manager.isNestedConversation() )
+ {
+ discardNestedConversation( manager.getParentConversationId() );
+ }
+ else
+ {
+ discardTemporaryConversation();
+ }
+
+ /*if ( !sessionInvalid && Init.instance().isClientSideConversations() )
+ {
+ // if we are using client-side conversations, put the
+ // map containing the conversation context variables
+ // into the view root (or remove it for a temp
+ // conversation context)
+ Contexts.getConversationContext().flush();
+ }*/
+
+ }
+
+ /*public Map<String, Object> getPageParameters()
+ {
+ return pageParameters==null ? Collections.EMPTY_MAP : pageParameters;
+ }
+
+ public void setPageParameters(Map<String, Object> pageParameters)
+ {
+ this.pageParameters = pageParameters.isEmpty() ? null : pageParameters;
+ }
+
+ /**
+ * Used by test harness
+ *
+ * @param name the page parameter name
+ * @param value the value
+ */
+ /*public void setPageParameter(String name, Object value)
+ {
+ if (pageParameters==null)
+ {
+ pageParameters = new HashMap<String, Object>();
+ }
+ pageParameters.put(name, value);
+ }*/
+
+}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java 2013-04-03 12:27:45 UTC (rev 15470)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java 2013-04-03 12:28:06 UTC (rev 15471)
@@ -34,6 +34,7 @@
import org.jboss.seam.exception.Exceptions;
import org.jboss.seam.faces.FacesManager;
import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.faces.FacesPage;
import org.jboss.seam.faces.Switcher;
import org.jboss.seam.faces.Validation;
import org.jboss.seam.log.LogProvider;
@@ -115,19 +116,6 @@
{
beforeServletPhase(event);
}
-
- // We resume conversation after handleTransactionsBeforePhase,
- // so that Conversation-scoped entityManager has a transaction to enlist
- if (event.getPhaseId() == RESTORE_VIEW) {
- FacesContext facesContext = event.getFacesContext();
- Map<String, String> parameters = facesContext.getExternalContext().getRequestParameterMap();
- ConversationPropagation.instance().restoreConversationId(parameters);
- boolean conversationFound = Manager.instance().restoreConversation();
-
- Contexts.getEventContext().set("org.jboss.seam.jsf.SeamPhaseListener.conversationFound", conversationFound);
- FacesLifecycle.resumeConversation(facesContext.getExternalContext());
- }
-
raiseEventsBeforePhase(event);
}
catch (Exception e)
@@ -396,15 +384,18 @@
* Restore the page and conversation contexts during a JSF request
*/
protected void afterRestoreView(FacesContext facesContext)
- {
- boolean conversationFound = Contexts.isEventContextActive() ? Contexts.getEventContext().isSet("org.jboss.seam.jsf.SeamPhaseListener.conversationFound") : false;
-
- if (!Contexts.isPageContextActive()) {
- FacesLifecycle.resumePage();
- }
-
- Map parameters = facesContext.getExternalContext().getRequestParameterMap();
- postRestorePage(facesContext, parameters, conversationFound);
+ {
+ boolean conversationFound = Contexts.isPageContextActive() ? Contexts.getPageContext().isSet("org.jboss.seam.jsf.SeamPhaseListener.conversationFound") : false;
+ FacesLifecycle.resumePage();
+ Map parameters = facesContext.getExternalContext().getRequestParameterMap();
+ if (!conversationFound) // there is exceptional case when restoring of conversation wasn't called while page context was lazily initialized
+ {
+ ConversationPropagation.instance().restoreConversationId(parameters);
+ conversationFound = Manager.instance().restoreConversation();
+ }
+ FacesLifecycle.resumeConversation( facesContext.getExternalContext() );
+ postRestorePage(facesContext, parameters, conversationFound);
+
}
public void raiseEventsBeforePhase(PhaseEvent event)
@@ -500,6 +491,9 @@
FacesManager.instance().prepareBackswitch(facesContext);
}
+ FacesPage.instance().storeConversation();
+ FacesPage.instance().storePageflow();
+
PersistenceContexts persistenceContexts = PersistenceContexts.instance();
if (persistenceContexts != null)
{
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamViewHandler.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamViewHandler.java 2013-04-03 12:27:45 UTC (rev 15470)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamViewHandler.java 2013-04-03 12:28:06 UTC (rev 15471)
@@ -99,22 +99,18 @@
if (!getSource().equals(Source.BOOKMARKABLE) && !getSource().equals(Source.REDIRECT) )
{
- if (conversation.isLongRunning())
+ if ( !conversation.isNested() || conversation.isLongRunning() )
{
return new FacesUrlTransformer(actionUrl, facesContext)
.appendConversationIdIfNecessary(conversationIdParameter, conversation.getId())
.getUrl();
}
- else if (conversation.isNested())
+ else
{
return new FacesUrlTransformer(actionUrl, facesContext)
.appendConversationIdIfNecessary(conversationIdParameter, conversation.getParentId())
.getUrl();
}
- else
- {
- return actionUrl;
- }
} else {
return actionUrl;
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java 2013-04-03 12:27:45 UTC (rev 15470)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java 2013-04-03 12:28:06 UTC (rev 15471)
@@ -78,7 +78,6 @@
protected MockHttpSession session;
private Map<String, Map> conversationViewRootAttributes;
protected Filter seamFilter;
- protected String conversationIdParameter = "conversationId";
private static ServletContext realServletContext = null;
@@ -123,7 +122,7 @@
protected String getConversationIdParameter()
{
- return conversationIdParameter;
+ return "conversationId";
}
/**
@@ -742,12 +741,6 @@
setParameter(getConversationIdParameter(), conversationId);
}
phases.beforePhase(new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, MockLifecycle.INSTANCE));
-
- // We cannot get conversationIdParameter before restore view phase, as Manager is in
- // event context, which is not active yet, so we hope we set this in the first request
- // and we assume it won't change. In other cases, you may just override getConversationIdParameter();
- conversationIdParameter = Manager.instance().getConversationIdParameter();
-
try
{
UIViewRoot viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext, getViewId());
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Pages.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Pages.java 2013-04-03 12:27:45 UTC (rev 15470)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Pages.java 2013-04-03 12:28:06 UTC (rev 15471)
@@ -568,9 +568,21 @@
{
noConversation();
+ //stuff from jPDL takes precedence
+ org.jboss.seam.faces.FacesPage facesPage = org.jboss.seam.faces.FacesPage.instance();
+ String pageflowName = facesPage.getPageflowName();
+ String pageflowNodeName = facesPage.getPageflowNodeName();
+
String noConversationViewId = null;
- String viewId = Pages.getCurrentViewId();
- noConversationViewId = getNoConversationViewId(viewId);
+ if (pageflowName==null || pageflowNodeName==null)
+ {
+ String viewId = Pages.getCurrentViewId();
+ noConversationViewId = getNoConversationViewId(viewId);
+ }
+ else
+ {
+ //noConversationViewId = Pageflow.instance().getNoConversationViewId(pageflowName, pageflowNodeName);
+ }
if (noConversationViewId!=null)
{
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PhaseListenerTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PhaseListenerTest.java 2013-04-03 12:27:45 UTC (rev 15470)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PhaseListenerTest.java 2013-04-03 12:28:06 UTC (rev 15471)
@@ -26,17 +26,16 @@
import org.jboss.seam.core.ResourceLoader;
import org.jboss.seam.faces.FacesManager;
import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.faces.FacesPage;
import org.jboss.seam.faces.Validation;
import org.jboss.seam.jsf.SeamPhaseListener;
import org.jboss.seam.jsf.SeamStateManager;
import org.jboss.seam.mock.MockApplication;
import org.jboss.seam.mock.MockExternalContext;
import org.jboss.seam.mock.MockFacesContext;
-import org.jboss.seam.mock.MockHttpServletRequest;
import org.jboss.seam.mock.MockLifecycle;
import org.jboss.seam.navigation.Pages;
import org.jboss.seam.servlet.ServletRequestSessionMap;
-import org.jboss.seam.web.ServletContexts;
import org.jboss.seam.web.Session;
import org.testng.annotations.Test;
@@ -50,6 +49,7 @@
appContext.set( Seam.getComponentName(Init.class), init );
installComponent(appContext, FacesManager.class);
installComponent(appContext, ConversationEntries.class);
+ installComponent(appContext, FacesPage.class);
installComponent(appContext, Conversation.class);
installComponent(appContext, FacesMessages.class);
installComponent(appContext, Pages.class);
@@ -58,7 +58,6 @@
installComponent(appContext, Session.class);
installComponent(appContext, ConversationPropagation.class);
installComponent(appContext, ResourceLoader.class);
- installComponent(appContext, ServletContexts.class);
}
private void installComponent(Context appContext, Class clazz)
@@ -94,7 +93,7 @@
assert Contexts.isEventContextActive();
assert Contexts.isSessionContextActive();
assert Contexts.isApplicationContextActive();
- assert Contexts.isConversationContextActive();
+ assert !Contexts.isConversationContextActive();
phases.afterPhase( new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, MockLifecycle.INSTANCE ) );
@@ -116,7 +115,9 @@
phases.beforePhase( new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, MockLifecycle.INSTANCE ) );
- assert facesContext.getViewRoot().getViewMap().size()==0;
+ // there is one additional item - conversationFound
+ assert facesContext.getViewRoot().getViewMap().size()==2;
+ assert ( (FacesPage) getPageMap(facesContext).get( getPrefix() + Seam.getComponentName(FacesPage.class) ) ).getConversationId()==null;
assert Contexts.isEventContextActive();
assert Contexts.isSessionContextActive();
assert Contexts.isApplicationContextActive();
@@ -143,8 +144,7 @@
{
MockFacesContext facesContext = createFacesContext();
- MockHttpServletRequest request = (MockHttpServletRequest)facesContext.getExternalContext().getRequest();
- request.getParameters().put("conversationId", new String[] {"2"});
+ getPageMap(facesContext).put( getPrefix() + Seam.getComponentName(FacesPage.class), new FacesPage() { @Override public String getConversationId() { return "2"; } });
List<String> conversationIdStack = new ArrayList<String>();
conversationIdStack.add("2");
@@ -165,7 +165,7 @@
assert Contexts.isEventContextActive();
assert Contexts.isSessionContextActive();
assert Contexts.isApplicationContextActive();
- assert Contexts.isConversationContextActive();
+ assert !Contexts.isConversationContextActive();
phases.afterPhase( new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, MockLifecycle.INSTANCE ) );
@@ -196,9 +196,10 @@
facesContext.getApplication().getStateManager().saveView(facesContext);
- assert Manager.instance().getCurrentConversationId().equals("2");
phases.afterPhase( new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, MockLifecycle.INSTANCE ) );
+ assert ( (FacesPage) getPageMap(facesContext).get( getPrefix() + Seam.getComponentName(FacesPage.class) ) ).getConversationId().equals("2");
+
assert !Contexts.isEventContextActive();
assert !Contexts.isSessionContextActive();
assert !Contexts.isApplicationContextActive();
@@ -227,7 +228,7 @@
assert Contexts.isEventContextActive();
assert Contexts.isSessionContextActive();
assert Contexts.isApplicationContextActive();
- assert Contexts.isConversationContextActive();
+ assert !Contexts.isConversationContextActive();
phases.afterPhase( new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, MockLifecycle.INSTANCE ) );
@@ -258,7 +259,7 @@
facesContext.getApplication().getStateManager().saveView(facesContext);
- assert facesContext.getViewRoot().getViewMap().size()==0;
+ assert facesContext.getViewRoot().getViewMap().size()==2;
phases.afterPhase( new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, MockLifecycle.INSTANCE ) );
@@ -284,7 +285,7 @@
assert Contexts.isEventContextActive();
assert Contexts.isSessionContextActive();
assert Contexts.isApplicationContextActive();
- assert Contexts.isConversationContextActive();
+ assert !Contexts.isConversationContextActive();
phases.afterPhase( new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, MockLifecycle.INSTANCE ) );
@@ -326,7 +327,7 @@
assert Contexts.isEventContextActive();
assert Contexts.isSessionContextActive();
assert Contexts.isApplicationContextActive();
- assert Contexts.isConversationContextActive();
+ assert !Contexts.isConversationContextActive();
phases.afterPhase( new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, MockLifecycle.INSTANCE ) );
@@ -335,8 +336,8 @@
phases.beforePhase( new PhaseEvent(facesContext, PhaseId.RENDER_RESPONSE, MockLifecycle.INSTANCE ) );
- assert facesContext.getViewRoot().getViewMap().size()==0;
- //assert ( (FacesPage) getPageMap(facesContext).get( getPrefix() + Seam.getComponentName(FacesPage.class) ) ).getConversationId()==null;
+ assert facesContext.getViewRoot().getViewMap().size()==2;
+ assert ( (FacesPage) getPageMap(facesContext).get( getPrefix() + Seam.getComponentName(FacesPage.class) ) ).getConversationId()==null;
assert Contexts.isEventContextActive();
assert Contexts.isSessionContextActive();
assert Contexts.isApplicationContextActive();
11 years, 7 months
Seam SVN: r15470 - branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2013-04-03 08:27:45 -0400 (Wed, 03 Apr 2013)
New Revision: 15470
Modified:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/BoundComponentConversationTest.java
Log:
Revert "ignore BoundComponentConversationTest, assumes conversation can be started during a componet render"
This reverts commit 9884eb2305094ff667066c17e594a081f54c3199.
Modified: branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/BoundComponentConversationTest.java
===================================================================
--- branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/BoundComponentConversationTest.java 2013-03-28 18:15:51 UTC (rev 15469)
+++ branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/BoundComponentConversationTest.java 2013-04-03 12:27:45 UTC (rev 15470)
@@ -23,7 +23,6 @@
import org.jboss.seam.test.integration.Deployments;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -65,7 +64,6 @@
}
@Test
- @Ignore
public void testConversationRestoration() throws Exception
{
Pattern conversationIdPattern = Pattern.compile("Conversation id: (\\d+)\\.");
11 years, 7 months