[seam-commits] Seam SVN: r13422 - in modules/security/trunk: impl/src/main/java/org/jboss/seam/security/management/action and 1 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Sat Jul 17 14:46:06 EDT 2010
Author: shane.bryzak at jboss.com
Date: 2010-07-17 14:46:05 -0400 (Sat, 17 Jul 2010)
New Revision: 13422
Modified:
modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStore.java
Log:
group search working by hard coding group type for now
Modified: modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml 2010-07-17 17:26:09 UTC (rev 13421)
+++ modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml 2010-07-17 18:46:05 UTC (rev 13422)
@@ -16,7 +16,7 @@
}
</script>
- <h3>Manage Users</h3>
+ <h3>Manage Groups</h3>
<h:form>
<h:commandButton action="#{groupAction.createGroup}" styleClass="newuser" rendered="#{identity.hasPermission('seam.account', 'create')}"/>
@@ -34,10 +34,16 @@
columnClasses=",,action">
<h:column width="auto">
<f:facet name="header">
- User name
+ Group name
</f:facet>
- #{user.username}
+ #{group.name}
</h:column>
+ <h:column width="auto">
+ <f:facet name="header">
+ Group type
+ </f:facet>
+ #{group.groupType}
+ </h:column>
<h:column id="action" width="auto">
<f:facet name="header">
Action
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java 2010-07-17 17:26:09 UTC (rev 13421)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java 2010-07-17 18:46:05 UTC (rev 13422)
@@ -30,10 +30,8 @@
@Inject public void loadUsers() throws IdentityException, QueryException
{
groups = new ArrayList<GroupDTO>();
-
- GroupQueryBuilder builder = identitySession.createGroupQueryBuilder();
- Collection<Group> results = identitySession.list(builder.createQuery());
+ Collection<Group> results = identitySession.getPersistenceManager().findGroup("GROUP");
for (Group group : results)
{
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-17 17:26:09 UTC (rev 13421)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStore.java 2010-07-17 18:46:05 UTC (rev 13422)
@@ -1278,7 +1278,6 @@
Root<?> root = criteria.from(identityClass);
- Property<?> identityNameProp = modelProperties.get(PROPERTY_IDENTITY_NAME);
Property<?> identityTypeProp = modelProperties.get(PROPERTY_IDENTITY_TYPE);
List<Predicate> predicates = new ArrayList<Predicate>();
@@ -1292,26 +1291,12 @@
criteria.where(predicates.toArray(new Predicate[0]));
List<?> results = em.createQuery(criteria).getResultList();
-
- Property<?> typeProp = modelProperties.get(PROPERTY_IDENTITY_TYPE);
- Property<?> typeNameProp = modelProperties.get(PROPERTY_IDENTITY_TYPE_NAME);
+ EntityToSpiConverter converter = new EntityToSpiConverter();
+
for (Object result : results)
- {
- String name = (String) identityNameProp.getValue(result);
- String typeName;
-
- if (typeNameProp != null)
- {
- typeName = (String) typeNameProp.getValue(typeProp.getValue(result));
- }
- else
- {
- typeName = (String) typeProp.getValue(result);
- }
-
- IdentityObjectType type = new IdentityObjectTypeImpl(typeName);
- objs.add(new IdentityObjectImpl(name, name, type));
+ {
+ objs.add(converter.convertToIdentityObject(result));
}
return objs;
More information about the seam-commits
mailing list