Author: shane.bryzak(a)jboss.com
Date: 2010-07-19 02:16:48 -0400 (Mon, 19 Jul 2010)
New Revision: 13440
Modified:
modules/security/trunk/api/pom.xml
modules/security/trunk/examples/idmconsole/pom.xml
modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml
modules/security/trunk/examples/idmconsole/src/main/webapp/style/default.css
modules/security/trunk/impl/pom.xml
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/GroupImpl.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupAction.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserAction.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStore.java
Log:
update seam-persistence dependencies, fix group delete
Modified: modules/security/trunk/api/pom.xml
===================================================================
--- modules/security/trunk/api/pom.xml 2010-07-19 06:14:01 UTC (rev 13439)
+++ modules/security/trunk/api/pom.xml 2010-07-19 06:16:48 UTC (rev 13440)
@@ -17,6 +17,12 @@
<dependencies>
<dependency>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-api</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
Modified: modules/security/trunk/examples/idmconsole/pom.xml
===================================================================
--- modules/security/trunk/examples/idmconsole/pom.xml 2010-07-19 06:14:01 UTC (rev
13439)
+++ modules/security/trunk/examples/idmconsole/pom.xml 2010-07-19 06:16:48 UTC (rev
13440)
@@ -61,22 +61,18 @@
</dependency>
<dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>seam-persistence</artifactId>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-api</artifactId>
<version>3.0.0-SNAPSHOT</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-impl</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.seam.xml</groupId>
<artifactId>seam-xml-config</artifactId>
<version>3.0.0-SNAPSHOT</version>
Modified: modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml
===================================================================
---
modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml 2010-07-19
06:14:01 UTC (rev 13439)
+++
modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml 2010-07-19
06:16:48 UTC (rev 13440)
@@ -49,12 +49,8 @@
Action
</f:facet>
- <ui:fragment
rendered="#{identity.hasPermission('seam.identity',
'update')}">
- <h:commandLink id="edit" value="Edit"
action="#{groupAction.editGroup(group.name)}"/>
- <span> | </span>
- </ui:fragment>
<ui:fragment
rendered="#{identity.hasPermission('seam.identity',
'delete')}">
- <h:commandLink id="delete" value="Delete"
action="#{groupAction.deleteGroup(group.name)}" onclick="return
confirmDelete()"/>
+ <h:commandLink id="delete" value="Delete"
action="#{groupAction.deleteGroup(group.name, group.groupType)}"
onclick="return confirmDelete()"/>
</ui:fragment>
</h:column>
</h:dataTable>
Modified: modules/security/trunk/examples/idmconsole/src/main/webapp/style/default.css
===================================================================
---
modules/security/trunk/examples/idmconsole/src/main/webapp/style/default.css 2010-07-19
06:14:01 UTC (rev 13439)
+++
modules/security/trunk/examples/idmconsole/src/main/webapp/style/default.css 2010-07-19
06:16:48 UTC (rev 13440)
@@ -1,7 +1,7 @@
body {
margin: 0;
padding: 0;
- background-color: #EAECEE;
+ background-color: #5c6066;
font-family: Verdana, sans-serif;
font-size: 0.9em;
}
@@ -46,12 +46,12 @@
text-decoration: none;
}
-input.newuser {
- background: url(btn_newuser.png) top left no-repeat;
- height: 39px;
- width: 113px;
- margin: 4px 4px 4px 4px;
- border: 0px;
- cursor: pointer;
+input.newuser {
+ background: url(btn_newuser.png) top left no-repeat;
+ height: 39px;
+ width: 113px;
+ margin: 4px 4px 4px 4px;
+ border: 0px;
+ cursor: pointer;
}
Modified: modules/security/trunk/impl/pom.xml
===================================================================
--- modules/security/trunk/impl/pom.xml 2010-07-19 06:14:01 UTC (rev 13439)
+++ modules/security/trunk/impl/pom.xml 2010-07-19 06:16:48 UTC (rev 13440)
@@ -131,8 +131,8 @@
</dependency>
<dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>seam-persistence</artifactId>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-api</artifactId>
<version>3.0.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/GroupImpl.java
===================================================================
---
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/GroupImpl.java 2010-07-19
06:14:01 UTC (rev 13439)
+++
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/GroupImpl.java 2010-07-19
06:16:48 UTC (rev 13440)
@@ -10,7 +10,7 @@
private String groupType;
private String name;
- public GroupImpl(String groupType, String name)
+ public GroupImpl(String name, String groupType)
{
this.groupType = groupType;
this.name = name;
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
===================================================================
---
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-07-19
06:14:01 UTC (rev 13439)
+++
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-07-19
06:16:48 UTC (rev 13440)
@@ -13,7 +13,7 @@
import org.jboss.seam.security.Identity;
import org.jboss.seam.security.UserImpl;
import org.jboss.seam.security.util.Strings;
-import org.jboss.seam.transaction.Transactional;
+import org.jboss.seam.persistence.transaction.Transactional;
import org.picketlink.idm.api.Credential;
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentitySearchCriteria;
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupAction.java
===================================================================
---
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupAction.java 2010-07-19
06:14:01 UTC (rev 13439)
+++
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupAction.java 2010-07-19
06:16:48 UTC (rev 13440)
@@ -4,10 +4,12 @@
import javax.enterprise.context.Conversation;
import javax.enterprise.context.ConversationScoped;
+import javax.enterprise.inject.Instance;
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.seam.security.GroupImpl;
+import org.jboss.seam.persistence.transaction.Transactional;
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.common.exception.IdentityException;
@@ -17,32 +19,32 @@
*
* @author Shane Bryzak
*/
-public @Named @ConversationScoped class GroupAction implements Serializable
+public @Transactional @Named @ConversationScoped class GroupAction implements
Serializable
{
private static final long serialVersionUID = -1553124158319503903L;
- @Inject Conversation conversation;
+ //@Inject Conversation conversation;
- @Inject IdentitySession identitySession;
+ //@Inject IdentitySession identitySession;
private String groupName;
private String groupType;
public void createGroup()
{
- conversation.begin();
+ // conversation.begin();
}
public void deleteGroup(String name, String groupType) throws IdentityException
{
Group group = new GroupImpl(name, groupType);
- identitySession.getPersistenceManager().removeGroup(group, true);
+ // identitySession.getPersistenceManager().removeGroup(group, true);
}
public String save() throws IdentityException
{
- identitySession.getPersistenceManager().createGroup(groupName, groupType);
- conversation.end();
+ //identitySession.getPersistenceManager().createGroup(groupName, groupType);
+ //conversation.end();
return "success";
}
}
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserAction.java
===================================================================
---
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserAction.java 2010-07-19
06:14:01 UTC (rev 13439)
+++
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserAction.java 2010-07-19
06:16:48 UTC (rev 13440)
@@ -19,9 +19,7 @@
*
* @author Shane Bryzak
*/
-@Named
-@ConversationScoped
-public class UserAction implements Serializable
+public @Named @ConversationScoped class UserAction implements Serializable
{
private static final long serialVersionUID = 5820385095080724087L;
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStore.java
===================================================================
---
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStore.java 2010-07-19
06:14:01 UTC (rev 13439)
+++
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStore.java 2010-07-19
06:16:48 UTC (rev 13440)
@@ -1415,9 +1415,17 @@
criteria.where(predicates.toArray(new Predicate[0]));
- Object instance = em.createQuery(criteria).getSingleResult();
-
- em.remove(instance);
+ try
+ {
+ Object instance = em.createQuery(criteria).getSingleResult();
+ em.remove(instance);
+ }
+ catch (NoResultException ex)
+ {
+ throw new IdentityException(String.format(
+ "Exception removing identity object - [%s] not found.",
+ identity), ex);
+ }
}
public void removeRelationship(IdentityStoreInvocationContext ctx,