Author: amarkhel
Date: 2009-03-06 14:44:50 -0500 (Fri, 06 Mar 2009)
New Revision: 12882
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml
trunk/test-applications/realworld2/web/src/main/webapp/index.html
Log:
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-03-06
19:36:15 UTC (rev 12881)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-03-06
19:44:50 UTC (rev 12882)
@@ -34,6 +34,7 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.web.RequestParameter;
import org.jboss.seam.core.Conversation;
import org.jboss.seam.core.Events;
import org.jboss.seam.faces.FacesMessages;
@@ -64,6 +65,8 @@
@In("#{messages['user.confirm.error']}") private String
CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD;
+ @RequestParameter protected Long startConversation;
+
private static final long serialVersionUID = -4585673256547342140L;
@Logger Log log;
@@ -172,7 +175,11 @@
}
public String start(){
- if(!identity.isLoggedIn()){
+ if(!identity.isLoggedIn() || startConversation != null){
+ if(startConversation != null){
+ identity.logout();
+ identity.unAuthenticate();
+ }
credentials.clear();
try {
identity.authenticate();
@@ -209,4 +216,12 @@
}
return false;
}
+
+ public Long getStartConversation() {
+ return startConversation;
+ }
+
+ public void setStartConversation(Long startConversation) {
+ this.startConversation = startConversation;
+ }
}
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-06
19:36:15 UTC (rev 12881)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-06
19:44:50 UTC (rev 12882)
@@ -74,9 +74,8 @@
private NavigationEnum mainArea;
- @In
+ @In(create=true)
private User user;
- //@In(required=false, create=false) private TreeMyAlbumsItem treeMyAlbumsItem;
public Integer getSelectedImageIndex() {
return selectedImageIndex;
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml 2009-03-06
19:36:15 UTC (rev 12881)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml 2009-03-06
19:44:50 UTC (rev 12882)
@@ -18,8 +18,8 @@
</page>
<page view-id="/index.xhtml">
- <begin-conversation if="#{!conversation.longRunning}"/>
- <action if="#{!identity.isLoggedIn()}"
execute="#{authenticator.start}"/>
+ <begin-conversation join="true" if="#{!identity.isLoggedIn() or
authenticator.startConversation!=null}"/>
+ <action if="#{!identity.isLoggedIn() or
authenticator.startConversation!=null}"
execute="#{authenticator.start}"/>
<navigation from-action="#{authenticator.logout}">
<rule if-outcome="logout">
<end-conversation />
Modified: trunk/test-applications/realworld2/web/src/main/webapp/index.html
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/index.html 2009-03-06 19:36:15
UTC (rev 12881)
+++ trunk/test-applications/realworld2/web/src/main/webapp/index.html 2009-03-06 19:44:50
UTC (rev 12882)
@@ -1,5 +1,5 @@
<html>
<head>
- <meta http-equiv="Refresh" content="0; URL=index.seam">
+ <meta http-equiv="Refresh" content="0;
URL=index.seam?startConversation=1">
</head>
</html>
\ No newline at end of file
Show replies by date