Author: norman.richards(a)jboss.com
Date: 2008-12-01 18:18:41 -0500 (Mon, 01 Dec 2008)
New Revision: 9691
Removed:
trunk/examples/openid/view/index.html
Modified:
trunk/examples/openid/resources/WEB-INF/components.xml
trunk/examples/openid/resources/WEB-INF/pages.xml
trunk/examples/openid/resources/import.sql
trunk/examples/openid/view/main.xhtml
Log:
a few improvements to the openid example
Modified: trunk/examples/openid/resources/WEB-INF/components.xml
===================================================================
--- trunk/examples/openid/resources/WEB-INF/components.xml 2008-12-01 23:18:14 UTC (rev
9690)
+++ trunk/examples/openid/resources/WEB-INF/components.xml 2008-12-01 23:18:41 UTC (rev
9691)
@@ -3,6 +3,7 @@
xmlns:persistence="http://jboss.com/products/seam/persistence"
xmlns:security="http://jboss.com/products/seam/security"
xmlns:framework="http://jboss.com/products/seam/framework"
xmlns:transaction="http://jboss.com/products/seam/transaction"
+
xmlns:web="http://jboss.com/products/seam/web"
xmlns:international="http://jboss.com/products/seam/international"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/core
/Users/orb/proj/jboss/seam/trunk/src/main/org/jboss/seam/core-2.1.xsd
@@ -16,6 +17,8 @@
<core:manager conversation-timeout="1200000"
concurrent-request-timeout="50000"
conversation-id-parameter="cid"/>
+ <web:rewrite-filter />
+
<transaction:ejb-transaction/>
<security:identity
authenticate-method="#{authenticator.authenticate}"/>
Modified: trunk/examples/openid/resources/WEB-INF/pages.xml
===================================================================
--- trunk/examples/openid/resources/WEB-INF/pages.xml 2008-12-01 23:18:14 UTC (rev 9690)
+++ trunk/examples/openid/resources/WEB-INF/pages.xml 2008-12-01 23:18:41 UTC (rev 9691)
@@ -7,26 +7,29 @@
<navigation evaluate="#{openid.loginImmediately()}">
<rule if-outcome="true">
<redirect view-id="/main.xhtml">
- <message>Welcome #{openid.validatedId}</message>
+ <message>OpenID login successful...</message>
</redirect>
</rule>
<rule if-outcome="false">
<redirect view-id="/main.xhtml">
- <message>OpenID login failed...</message>
+ <message>OpenID login rejected...</message>
</redirect>
</rule>
</navigation>
</page>
<page view-id="/main.xhtml">
+ <rewrite pattern="/" />
+
<navigation from-action="#{postHome.persist}"
evaluate="#{postHome.clearInstance()}">
- <redirect />
+ <redirect view-id="/main.xhtml" />
</navigation>
</page>
- <exception class="org.jboss.seam.security.NotLoggedInException">
- <redirect view-id="/home.xhtml">
- <message severity="warn">You must be logged in to use this
feature</message>
+
+ <exception class="javax.faces.application.ViewExpiredException">
+ <redirect view-id="/main.xhtml">
+ <message severity="warn">Your session expired. Please try
again.</message>
</redirect>
</exception>
Modified: trunk/examples/openid/resources/import.sql
===================================================================
--- trunk/examples/openid/resources/import.sql 2008-12-01 23:18:14 UTC (rev 9690)
+++ trunk/examples/openid/resources/import.sql 2008-12-01 23:18:41 UTC (rev 9691)
@@ -1 +1,2 @@
-insert into post (creator,message,createDate) values
('http://maximoburrito.myopenid.com/','This is too cool',now());
+insert into post (creator,message,createDate) values
('http://maximoburrito.myopenid.com/','First Post!',now());
+insert into post (creator,message,createDate) values
('http://maximoburrito.myopenid.com/','Have fun with Seam!',now());
Deleted: trunk/examples/openid/view/index.html
===================================================================
--- trunk/examples/openid/view/index.html 2008-12-01 23:18:14 UTC (rev 9690)
+++ trunk/examples/openid/view/index.html 2008-12-01 23:18:41 UTC (rev 9691)
@@ -1,5 +0,0 @@
-<html>
-<head>
- <meta http-equiv="Refresh" content="0; URL=main.seam">
-</head>
-</html>
Modified: trunk/examples/openid/view/main.xhtml
===================================================================
--- trunk/examples/openid/view/main.xhtml 2008-12-01 23:18:14 UTC (rev 9690)
+++ trunk/examples/openid/view/main.xhtml 2008-12-01 23:18:41 UTC (rev 9691)
@@ -15,14 +15,10 @@
}
</style>
-
</head>
<body>
<div id="top">
-
-
-
<rich:toolBar height="34" itemSeparator="line">
<rich:toolBarGroup>
<h:outputLabel value="OpenId Wall Demo" />
@@ -47,28 +43,22 @@
<rich:panel>
<f:facet name="header">About the Demo</f:facet>
- <rich:modalPanel id="panel" width="350"
height="100">
- <f:facet name="header">
- <h:panelGroup>OpenID</h:panelGroup>
- </f:facet>
- <f:facet name="controls">
- <h:panelGroup>
- <h:graphicImage value="/images/modal/close.png"
style="cursor:pointer" id="hidelink"/>
- <rich:componentControl for="panel"
attachTo="hidelink" operation="hide" event="onclick"/>
- </h:panelGroup>
- </f:facet>
-
- OpenID is cool...
- </rich:modalPanel>
-
-
-
+
<rich:messages />
-
- <h:outputLink value="#" id="link">
- Learn more about OpenID
- <rich:componentControl for="panel" attachTo="link"
operation="show" event="onclick"/>
- </h:outputLink>
+
+ <s:div rendered="#{!identity.loggedIn}">
+ This application demonstrates the basic use of OpenID in an application. To
login, simply enter
+ your OpenId into the login box at the top. Don't have an OpenId?
Actually, you might have one
+ and not know it. If you have a <a
href="http://openid.yahoo.com/">Yahoo</a> account, a
+ <a
href="http://www.livejournal.com/openid/">liveournal</a> account, a
blog at
+ <a href="http://blogger.com">blogger.com</a>, to name a
few you might already have an
+ OpenID available to you. If not, you can establish an independent OpenID at
+ a free service like <a
href="https://www.myopenid.com/">myOpenID</a>.
+ </s:div>
+
+ <s:div rendered="#{identity.loggedIn}">
+ Congratulations, you have logged into the Wall with an OpenID of
<b>#{openid.validatedId}</b>.
+ </s:div>
</rich:panel>
@@ -89,7 +79,10 @@
<rich:panel>
#{post.message}
<br />
- #{post.creator} -- #{post.createDate}
+ <b>#{post.creator}</b> --
+ <h:outputText value="#{post.createDate}">
+ <s:convertDateTime dateStyle="full"
type="both" />
+ </h:outputText>
</rich:panel>
</ui:repeat>
</rich:panel>