[seam-commits] Seam SVN: r12438 - in modules/security/trunk/examples/seamspace/src/main: java/org/jboss/seam/security/examples/seamspace/util and 2 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Apr 12 18:51:42 EDT 2010


Author: shane.bryzak at jboss.com
Date: 2010-04-12 18:51:41 -0400 (Mon, 12 Apr 2010)
New Revision: 12438

Removed:
   modules/security/trunk/examples/seamspace/src/main/webapp/userdetail.page.xml
Modified:
   modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/ContentAction.java
   modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/FriendAction.java
   modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/ImagePermission.java
   modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java
   modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml
   modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/faces-config.xml
   modules/security/trunk/examples/seamspace/src/main/webapp/template.xhtml
   modules/security/trunk/examples/seamspace/src/main/webapp/userdetail.xhtml
   modules/security/trunk/examples/seamspace/src/main/webapp/usermanager.xhtml
Log:
fixed user management features


Modified: modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/ContentAction.java
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/ContentAction.java	2010-04-12 21:35:13 UTC (rev 12437)
+++ modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/ContentAction.java	2010-04-12 22:51:41 UTC (rev 12438)
@@ -12,6 +12,7 @@
 public class ContentAction
 {
    @Inject EntityManager entityManager;
+   
    @Inject Identity identity;
    
    public MemberImage getImage(int imageId)

Modified: modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/FriendAction.java
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/FriendAction.java	2010-04-12 21:35:13 UTC (rev 12437)
+++ modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/FriendAction.java	2010-04-12 22:51:41 UTC (rev 12438)
@@ -10,7 +10,6 @@
 import javax.persistence.EntityManager;
 import javax.persistence.NoResultException;
 
-//import org.jboss.seam.international.StatusMessages;
 import org.jboss.seam.security.Identity;
 import org.jboss.seam.security.examples.seamspace.model.FriendComment;
 import org.jboss.seam.security.examples.seamspace.model.Member;

Modified: modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/ImagePermission.java
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/ImagePermission.java	2010-04-12 21:35:13 UTC (rev 12437)
+++ modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/action/ImagePermission.java	2010-04-12 22:51:41 UTC (rev 12438)
@@ -34,6 +34,7 @@
    private List<Member> availableFriends;   
    
    @Inject IdentityManager identityManager;
+   
    @Inject PermissionManager permissionManager;
    
    @Inject EntityManager entityManager;

Modified: modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java	2010-04-12 21:35:13 UTC (rev 12437)
+++ modules/security/trunk/examples/seamspace/src/main/java/org/jboss/seam/security/examples/seamspace/util/EntityManagerProducer.java	2010-04-12 22:51:41 UTC (rev 12438)
@@ -3,7 +3,6 @@
 import java.io.Serializable;
 
 import javax.enterprise.context.ConversationScoped;
-import javax.enterprise.context.Dependent;
 import javax.enterprise.inject.Produces;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;

Modified: modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml	2010-04-12 21:35:13 UTC (rev 12437)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml	2010-04-12 22:51:41 UTC (rev 12438)
@@ -16,4 +16,8 @@
       </idm:identityStore>
    </idm:IdentityManager-->
    
+   <interceptors>
+      <class>org.jboss.seam.transaction.JtaTxInterceptor</class>
+   </interceptors>
+   
 </beans>
\ No newline at end of file

Modified: modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/faces-config.xml	2010-04-12 21:35:13 UTC (rev 12437)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/faces-config.xml	2010-04-12 22:51:41 UTC (rev 12438)
@@ -8,5 +8,30 @@
       http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
 
    <!-- Write your navigation rules here. You are encouraged to use CDI for creating @Named managed beans. -->
+   
+  <navigation-rule>
+    <from-view-id>/usermanager.xhtml</from-view-id>
+    
+    <navigation-case>
+      <from-action>#{userAction.createUser}</from-action>
+      <if>#{true}</if>
+      <to-view-id>/userdetail.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+ 
+  </navigation-rule>  
+  
+  <navigation-rule>
+    <from-view-id>/userdetail.xhtml</from-view-id>
+    
+    <navigation-case>
+      <from-action>#{userAction.save}</from-action>
+      <from-outcome>success</from-outcome>
+      <if>#{true}</if>
+      <to-view-id>/usermanager.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+    
+  </navigation-rule>
 
 </faces-config>

Modified: modules/security/trunk/examples/seamspace/src/main/webapp/template.xhtml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/template.xhtml	2010-04-12 21:35:13 UTC (rev 12437)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/template.xhtml	2010-04-12 22:51:41 UTC (rev 12438)
@@ -17,21 +17,24 @@
     <div id="header">
       <div class="headerRight">
         <div class="headerMenu">
-  
-          <ui:fragment rendered="#{identity.loggedIn}">
-            <h:link id="profile" outcome="/profile.xhtml" value="My Profile" propagation="none">
-              <f:param name="name" value="#{authenticatedMember.memberName}"/>
-            </h:link>
-            <h:outputText styleClass="divider" value=" | "/>
-          </ui:fragment>
-  
-          <ui:fragment rendered="#{identity.hasRole('admin')}">
-            <h:link id="security" outcome="/security.xhtml" value="Security" propagation="none"/>
-            <h:outputText styleClass="divider" value=" | "/>
-          </ui:fragment>
-          
-          <h:link id="logout" action="#{identity.logout}" value="Log out" rendered="#{identity.loggedIn}"/>
-          <h:outputLink id="login" value="home.seam" rendered="#{not identity.loggedIn}">Log in</h:outputLink>
+
+          <h:form>  
+            <ui:fragment rendered="#{identity.loggedIn}">
+              <h:link id="profile" outcome="/profile.xhtml" value="My Profile" propagation="none">
+                <f:param name="name" value="#{authenticatedMember.memberName}"/>
+              </h:link>
+              <h:outputText styleClass="divider" value=" | "/>
+            </ui:fragment>
+    
+            <ui:fragment rendered="#{identity.hasRole('admin')}">
+              <h:link id="security" outcome="/security.xhtml" value="Security" propagation="none"/>
+              <h:outputText styleClass="divider" value=" | "/>
+            </ui:fragment>
+            
+            <h:commandLink id="logout" action="#{identity.logout}" value="Log out" rendered="#{identity.loggedIn}"/>
+           
+            <h:outputLink id="login" value="home.seam" rendered="#{not identity.loggedIn}">Log in</h:outputLink>
+          </h:form>
         </div>
         <br style="clear:both"/>
         <h:form>

Deleted: modules/security/trunk/examples/seamspace/src/main/webapp/userdetail.page.xml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/userdetail.page.xml	2010-04-12 21:35:13 UTC (rev 12437)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/userdetail.page.xml	2010-04-12 22:51:41 UTC (rev 12438)
@@ -1,9 +0,0 @@
-<page xmlns="http://jboss.com/products/seam/pages"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd">
-    <navigation from-action="#{userAction.save}">
-      <rule if-outcome="success">
-          <redirect view-id="/usermanager.xhtml"/>
-      </rule>
-    </navigation>
-</page>          

Modified: modules/security/trunk/examples/seamspace/src/main/webapp/userdetail.xhtml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/userdetail.xhtml	2010-04-12 21:35:13 UTC (rev 12437)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/userdetail.xhtml	2010-04-12 22:51:41 UTC (rev 12438)
@@ -54,7 +54,7 @@
             <h:outputLabel for="roles" value="Member of" styleClass="formLabel"/>
             <div class="selectMany">
               <h:selectManyCheckbox id="roles" value="#{userAction.roles}" layout="pageDirection" styleClass="roles">
-                <!--s:selectItems value="#{identityManager.grantableRoles}" var="role" label="#{role}"/-->
+                <f:selectItems value="#{identityManager.grantableRoles}" var="role" label="#{role}"/>
               </h:selectManyCheckbox>
             </div>
             <div class="validationError"><h:message for="roles"/></div>            

Modified: modules/security/trunk/examples/seamspace/src/main/webapp/usermanager.xhtml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/usermanager.xhtml	2010-04-12 21:35:13 UTC (rev 12437)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/usermanager.xhtml	2010-04-12 22:51:41 UTC (rev 12438)
@@ -24,7 +24,9 @@
 
   	    <h2>User Manager</h2>  
   	    
-        <h:button id="newUser" outcome="userdetail.xhtml" action="#{userAction.createUser}" styleClass="newuser" rendered="#{identity.hasPermission('seam.account', 'create')}"/>
+  	    <h:form>
+          <h:commandButton id="newUser" action="#{userAction.createUser}" styleClass="newuser" rendered="#{identity.hasPermission('seam.account', 'create')}"/>
+        </h:form>
   	    
         <h:dataTable 
             id="threads"



More information about the seam-commits mailing list