Author: bdaw
Date: 2009-11-20 12:18:44 -0500 (Fri, 20 Nov 2009)
New Revision: 744
Added:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
Removed:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMOrganizationServiceImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMService.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMServiceImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/
Modified:
portal/trunk/component/application-registry/src/test/java/conf/portal/idm-configuration.xml
portal/trunk/component/identity/pom.xml
portal/trunk/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml
portal/trunk/component/identity/src/main/java/conf/portal/idm-config.xml
portal/trunk/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
portal/trunk/component/portal/pom.xml
portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml
portal/trunk/component/portal/src/test/java/conf/portal/idm-configuration.xml
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
portal/trunk/docs/user-guide/en/modules/configuration/IDM_Configuration.xml
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
portal/trunk/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
Log:
- upgrade to PicketLink IDM (former JBoss Identity) 1.0.0.CR1
- remove separate IDM hibernate config
Modified:
portal/trunk/component/application-registry/src/test/java/conf/portal/idm-configuration.xml
===================================================================
---
portal/trunk/component/application-registry/src/test/java/conf/portal/idm-configuration.xml 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/component/application-registry/src/test/java/conf/portal/idm-configuration.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -25,8 +25,8 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+
<key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
@@ -34,18 +34,18 @@
</value-param>
<values-param>
<name>hibernate.annotations</name>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObject</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateRealm</value>
</values-param>
<properties-param>
<name>hibernate.properties</name>
@@ -70,7 +70,7 @@
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
</configuration>
Modified: portal/trunk/component/identity/pom.xml
===================================================================
--- portal/trunk/component/identity/pom.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/identity/pom.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -55,24 +55,24 @@
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-core</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-core</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-hibernate</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-hibernate</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-ldap</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-ldap</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-cache</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-cache</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<!--To use instead of outdated version from xdoclet-->
Modified:
portal/trunk/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml
===================================================================
---
portal/trunk/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -41,19 +41,5 @@
<property
name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
- <!-- Mapping classes -->
- <!-- all nessesary mappings are added programatically to the configuration
-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>-->
-
</session-factory>
</hibernate-configuration>
\ No newline at end of file
Modified: portal/trunk/component/identity/src/main/java/conf/portal/idm-config.xml
===================================================================
--- portal/trunk/component/identity/src/main/java/conf/portal/idm-config.xml 2009-11-20
16:25:22 UTC (rev 743)
+++ portal/trunk/component/identity/src/main/java/conf/portal/idm-config.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -20,9 +20,9 @@
-->
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_beta"
+<jboss-identity xmlns="urn:picketlink:idm:config:v1_0_0_cr1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
+ xsi:schemaLocation="urn:picketlink:idm:config:v1_0_0_cr1
identity-config.xsd">
<realms>
<realm>
<id>PortalRealm</id>
@@ -35,7 +35,7 @@
<repositories>
<repository>
<id>PortalRepository</id>
-
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+
<class>org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository</class>
<external-config/>
<default-identity-store-id>HibernateStore</default-identity-store-id>
<default-attribute-store-id>HibernateStore</default-attribute-store-id>
@@ -46,7 +46,7 @@
<identity-stores>
<identity-store>
<id>HibernateStore</id>
-
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+
<class>org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
<external-config/>
<supported-relationship-types>
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
Modified:
portal/trunk/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml
===================================================================
---
portal/trunk/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -25,8 +25,8 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+
<key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
@@ -41,7 +41,7 @@
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
<external-component-plugins>
@@ -52,19 +52,18 @@
<type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
<init-params>
<values-param>
- <name>hibernate.annotations</name>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
</values-param>
</init-params>
</component-plugin>
Copied:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm
(from rev 701,
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm)
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/GroupDAOImpl.java 2009-11-19
20:53:18 UTC (rev 701)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -17,15 +17,15 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.GroupEventListener;
import org.exoplatform.services.organization.GroupHandler;
import org.exoplatform.services.organization.impl.GroupImpl;
-import org.jboss.identity.idm.api.Attribute;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.impl.api.SimpleAttribute;
+import org.picketlink.idm.api.Attribute;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.impl.api.SimpleAttribute;
import java.util.ArrayList;
import java.util.Collection;
@@ -43,13 +43,13 @@
public static final String GROUP_DESCRIPTION = "description";
- private JBossIDMService service_;
+ private PicketLinkIDMService service_;
private List<GroupEventListener> listeners_;
- private JBossIDMOrganizationServiceImpl orgService;
+ private PicketLinkIDMOrganizationServiceImpl orgService;
- public GroupDAOImpl(JBossIDMOrganizationServiceImpl orgService, JBossIDMService
service)
+ public GroupDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService,
PicketLinkIDMService service)
{
service_ = service;
this.orgService = orgService;
@@ -73,12 +73,12 @@
public void addChild(Group parent, Group child, boolean broadcast) throws Exception
{
- org.jboss.identity.idm.api.Group parentGroup = null;
+ org.picketlink.idm.api.Group parentGroup = null;
if (parent != null)
{
parentGroup =
- getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(),
orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(),
orgService.getGtnGroupType());
((GroupImpl)child).setId(parent.getId() + "/" +
child.getGroupName());
}
@@ -92,7 +92,7 @@
preSave(child, true);
}
- org.jboss.identity.idm.api.Group childGroup = persistGroup(child);
+ org.picketlink.idm.api.Group childGroup = persistGroup(child);
if (parentGroup != null)
{
@@ -132,8 +132,8 @@
preDelete(group);
}
- org.jboss.identity.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(group.getGroupName(),
orgService.getExoGroupType());
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(group.getGroupName(),
orgService.getGtnGroupType());
if (jbidGroup == null)
{
@@ -142,17 +142,17 @@
// MembershipDAOImpl.removeMembershipEntriesOfGroup(group,
getIdentitySession());
- Collection<org.jboss.identity.idm.api.Group> oneLevelChilds =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup,
orgService.getExoGroupType(),
+ Collection<org.picketlink.idm.api.Group> oneLevelChilds =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup,
orgService.getGtnGroupType(),
true, false);
- Collection<org.jboss.identity.idm.api.Group> allChilds =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup,
orgService.getExoGroupType(),
+ Collection<org.picketlink.idm.api.Group> allChilds =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup,
orgService.getGtnGroupType(),
true, true);
getIdentitySession().getRelationshipManager().disassociateGroups(jbidGroup,
oneLevelChilds);
- for (org.jboss.identity.idm.api.Group child : allChilds)
+ for (org.picketlink.idm.api.Group child : allChilds)
{
//TODO: impl force in IDM
getIdentitySession().getPersistenceManager().removeGroup(child, true);
@@ -169,12 +169,12 @@
public Collection findGroupByMembership(String userName, String membershipType) throws
Exception
{
- Collection<org.jboss.identity.idm.api.Role> allRoles =
+ Collection<org.picketlink.idm.api.Role> allRoles =
getIdentitySession().getRoleManager().findRoles(userName, membershipType);
Set<Group> exoGroups = new HashSet<Group>();
- for (org.jboss.identity.idm.api.Role role : allRoles)
+ for (org.picketlink.idm.api.Role role : allRoles)
{
exoGroups.add(convertGroup(role.getGroup()));
@@ -187,7 +187,7 @@
public Group findGroupById(String groupId) throws Exception
{
- org.jboss.identity.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
+ org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
if (jbidGroup == null)
{
@@ -199,7 +199,7 @@
public Collection findGroups(Group parent) throws Exception
{
- org.jboss.identity.idm.api.Group jbidGroup = null;
+ org.picketlink.idm.api.Group jbidGroup = null;
if (parent == null)
{
@@ -208,7 +208,7 @@
else
{
jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(),
orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(),
orgService.getGtnGroupType());
}
if (jbidGroup == null)
@@ -216,13 +216,13 @@
return Collections.emptyList();
}
- Collection<org.jboss.identity.idm.api.Group> allGroups =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup,
orgService.getExoGroupType(),
+ Collection<org.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup,
orgService.getGtnGroupType(),
true, false);
List<Group> exoGroups = new LinkedList<Group>();
- for (org.jboss.identity.idm.api.Group group : allGroups)
+ for (org.picketlink.idm.api.Group group : allGroups)
{
exoGroups.add(convertGroup(group));
@@ -241,21 +241,21 @@
// need to look at that later
//
// Caused by: java.lang.IllegalArgumentException: User name cannot be null
- // at
org.jboss.identity.idm.impl.api.session.managers.AbstractManager.checkNotNullArgument(AbstractManager.java:267)
- // at
org.jboss.identity.idm.impl.api.session.managers.RelationshipManagerImpl.findRelatedGroups(RelationshipManagerImpl.java:753)
- // at
org.exoplatform.services.organization.jbidm.GroupDAOImpl.findGroupsOfUser(GroupDAOImpl.java:225)
+ // at
org.picketlink.idm.impl.api.session.managers.AbstractManager.checkNotNullArgument(AbstractManager.java:267)
+ // at
org.picketlink.idm.impl.api.session.managers.RelationshipManagerImpl.findRelatedGroups(RelationshipManagerImpl.java:753)
+ // at
org.exoplatform.services.organization.idm.GroupDAOImpl.findGroupsOfUser(GroupDAOImpl.java:225)
// at
org.exoplatform.organization.webui.component.GroupManagement.isMemberOfGroup(GroupManagement.java:72)
// at
org.exoplatform.organization.webui.component.GroupManagement.isAdministrator(GroupManagement.java:125)
// at
org.exoplatform.organization.webui.component.UIGroupExplorer.<init>(UIGroupExplorer.java:57)
return Collections.emptyList();
}
- Collection<org.jboss.identity.idm.api.Group> allGroups =
- getIdentitySession().getRelationshipManager().findRelatedGroups(user,
orgService.getExoGroupType(), null);
+ Collection<org.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getRelationshipManager().findRelatedGroups(user,
orgService.getGtnGroupType(), null);
List<Group> exoGroups = new LinkedList<Group>();
- for (org.jboss.identity.idm.api.Group group : allGroups)
+ for (org.picketlink.idm.api.Group group : allGroups)
{
exoGroups.add(convertGroup(group));
@@ -266,14 +266,14 @@
public Collection getAllGroups() throws Exception
{
- Collection<org.jboss.identity.idm.api.Group> allGroups =
-
getIdentitySession().getPersistenceManager().findGroup(orgService.getExoGroupType());
+ Collection<org.picketlink.idm.api.Group> allGroups =
+
getIdentitySession().getPersistenceManager().findGroup(orgService.getGtnGroupType());
List<Group> exoGroups = new LinkedList<Group>();
- for (org.jboss.identity.idm.api.Group group : allGroups)
+ for (org.picketlink.idm.api.Group group : allGroups)
{
- if (!orgService.getExoGroupType().equals(orgService.getExoRootGroupType())
+ if (!orgService.getGtnGroupType().equals(orgService.getGtnRootGroupType())
|| !group.getName().equals(orgService.getExoRootGroupName()))
{
exoGroups.add(convertGroup(group));
@@ -318,8 +318,8 @@
public Group getGroup(String groupName) throws Exception
{
- org.jboss.identity.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(groupName,
orgService.getExoGroupType());
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(groupName,
orgService.getGtnGroupType());
if (jbidGroup == null)
{
@@ -330,7 +330,7 @@
}
- private Group convertGroup(org.jboss.identity.idm.api.Group jbidGroup) throws
Exception
+ private Group convertGroup(org.picketlink.idm.api.Group jbidGroup) throws Exception
{
Map<String, Attribute> attrs =
getIdentitySession().getAttributesManager().getAttributes(jbidGroup);
@@ -369,11 +369,11 @@
return "";
}
- org.jboss.identity.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(groupName,
orgService.getExoGroupType());
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(groupName,
orgService.getGtnGroupType());
- Collection<org.jboss.identity.idm.api.Group> parents =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup,
orgService.getExoGroupType(),
+ Collection<org.picketlink.idm.api.Group> parents =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup,
orgService.getGtnGroupType(),
false, false);
if (parents.size() > 1)
@@ -390,23 +390,23 @@
//return "/" + groupName;
}
- String parentGroupId =
getGroupId(((org.jboss.identity.idm.api.Group)parents.iterator().next()).getName());
+ String parentGroupId =
getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()).getName());
return parentGroupId + "/" + groupName;
}
- private org.jboss.identity.idm.api.Group persistGroup(Group exoGroup) throws
Exception
+ private org.picketlink.idm.api.Group persistGroup(Group exoGroup) throws Exception
{
- org.jboss.identity.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(exoGroup.getGroupName(),
orgService.getExoGroupType());
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(exoGroup.getGroupName(),
orgService.getGtnGroupType());
if (jbidGroup == null)
{
jbidGroup =
getIdentitySession().getPersistenceManager().createGroup(exoGroup.getGroupName(),
- orgService.getExoGroupType());
+ orgService.getGtnGroupType());
}
String description = exoGroup.getDescription();
@@ -441,17 +441,17 @@
return service_.getIdentitySession();
}
- private org.jboss.identity.idm.api.Group getRootGroup() throws Exception
+ private org.picketlink.idm.api.Group getRootGroup() throws Exception
{
- org.jboss.identity.idm.api.Group rootGroup =
+ org.picketlink.idm.api.Group rootGroup =
getIdentitySession().getPersistenceManager().findGroup(orgService.getExoRootGroupName(),
- orgService.getExoRootGroupType());
+ orgService.getGtnRootGroupType());
if (rootGroup == null)
{
rootGroup =
getIdentitySession().getPersistenceManager().createGroup(orgService.getExoRootGroupName(),
- orgService.getExoRootGroupType());
+ orgService.getGtnRootGroupType());
}
return rootGroup;
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/IDMUserListAccess.java 2009-11-19
20:53:18 UTC (rev 701)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -17,12 +17,12 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.services.organization.User;
-import org.jboss.identity.idm.api.query.UserQuery;
-import org.jboss.identity.idm.api.query.UserQueryBuilder;
+import org.picketlink.idm.api.query.UserQuery;
+import org.picketlink.idm.api.query.UserQueryBuilder;
import java.util.List;
@@ -30,7 +30,7 @@
{
private final UserDAOImpl userDAO;
- private final JBossIDMService idmService;
+ private final PicketLinkIDMService idmService;
private final UserQueryBuilder userQueryBuilder;
@@ -38,7 +38,7 @@
private final boolean countAll;
- public IDMUserListAccess(UserDAOImpl userDAO, JBossIDMService idmService,
UserQueryBuilder userQueryBuilder,
+ public IDMUserListAccess(UserDAOImpl userDAO, PicketLinkIDMService idmService,
UserQueryBuilder userQueryBuilder,
int pageSize, boolean countAll)
{
this.userDAO = userDAO;
@@ -52,13 +52,13 @@
{
userQueryBuilder.page(index, length);
UserQuery query = userQueryBuilder.createQuery();
- List<org.jboss.identity.idm.api.User> users =
idmService.getIdentitySession().list(query);
+ List<org.picketlink.idm.api.User> users =
idmService.getIdentitySession().list(query);
User[] exoUsers = new User[users.size()];
for (int i = 0; i < users.size(); i++)
{
- org.jboss.identity.idm.api.User user = users.get(i);
+ org.picketlink.idm.api.User user = users.get(i);
exoUsers[i] = UserDAOImpl.getPopulatedUser(user.getId(),
idmService.getIdentitySession());
}
Deleted:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMOrganizationServiceImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMOrganizationServiceImpl.java 2009-11-19
20:53:18 UTC (rev 701)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMOrganizationServiceImpl.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -1,175 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.jbidm;
-
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.component.ComponentRequestLifecycle;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.ValueParam;
-import org.exoplatform.services.cache.CacheService;
-import org.exoplatform.services.organization.BaseOrganizationService;
-import org.picocontainer.Startable;
-
-public class JBossIDMOrganizationServiceImpl extends BaseOrganizationService implements
Startable,
- ComponentRequestLifecycle
-{
-
- // We may have several portal containers thus we need one JBossIDMService per portal
container
- // private static JBossIDMService jbidmService_;
- private JBossIDMService jbidmService_;
-
- public static final String EXO_GROUP_TYPE_OPTION = "exoGroupTypeName";
-
- public static final String EXO_ROOT_GROUP_NAME_OPTION = "exoRootGroupName";
-
- public static final String EXO_ROOT_GROUP_TYPE_NAME_OPTION =
"exoRootGroupTypeName";
-
- public static final String PASSWORD_AS_ATTRIBUTE_OPTION =
"passwordAsAttribute";
-
- private String exoGroupType = "EXO_GROUP_TYPE";
-
- private String exoRootGroupName = "EXO_ROOT_GROUP";
-
- private String exoRootGroupType = exoGroupType;
-
- private boolean passwordAsAttribute = false;
-
- public JBossIDMOrganizationServiceImpl(InitParams params, CacheService cservice,
JBossIDMService jbidmService)
- throws Exception
- {
- groupDAO_ = new GroupDAOImpl(this, jbidmService);
- userDAO_ = new UserDAOImpl(this, jbidmService, cservice);
- userProfileDAO_ = new UserProfileDAOImpl(this, jbidmService, cservice);
- membershipDAO_ = new MembershipDAOImpl(this, jbidmService);
- membershipTypeDAO_ = new MembershipTypeDAOImpl(this, jbidmService);
-
- jbidmService_ = jbidmService;
-
- if (params != null)
- {
- //Options
- ValueParam exoGroupTypeNameParam = params.getValueParam(EXO_GROUP_TYPE_OPTION);
- ValueParam exoRootGroupTypeNameParam =
params.getValueParam(EXO_ROOT_GROUP_TYPE_NAME_OPTION);
- ValueParam exoRootGroupNameParam =
params.getValueParam(EXO_ROOT_GROUP_NAME_OPTION);
- ValueParam passwordAsAttributeParam =
params.getValueParam(PASSWORD_AS_ATTRIBUTE_OPTION);
-
- if (exoGroupTypeNameParam != null)
- {
- this.exoGroupType = exoGroupTypeNameParam.getValue();
- }
-
- if (exoRootGroupNameParam != null)
- {
- this.exoRootGroupName = exoRootGroupNameParam.getValue();
- }
-
- if (exoRootGroupTypeNameParam != null)
- {
- this.exoRootGroupType = exoRootGroupTypeNameParam.getValue();
- }
- else if (exoRootGroupTypeNameParam != null)
- {
- this.exoRootGroupType = this.exoGroupType;
- }
-
- if (passwordAsAttributeParam != null &&
passwordAsAttributeParam.getValue().equalsIgnoreCase("true"))
- {
- this.passwordAsAttribute = true;
- }
- }
-
- }
-
- public final org.jboss.identity.idm.api.Group getJBIDMGroup(String groupId) throws
Exception
- {
- String[] ids = groupId.split("/");
- String name = ids[ids.length - 1];
- return jbidmService_.getIdentitySession().getPersistenceManager().findGroup(name,
getExoGroupType());
- }
-
- @Override
- public void start()
- {
-
- try
- {
- // Wrap within transaction so all initializers can work
- jbidmService_.getIdentitySession().beginTransaction();
- super.start();
- jbidmService_.getIdentitySession().getTransaction().commit();
-
- }
- catch (Exception e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings |
File Templates.
- }
-
- }
-
- @Override
- public void stop()
- {
- //toto
- }
-
- public void startRequest(ExoContainer container)
- {
- try
- {
- jbidmService_.getIdentitySession().beginTransaction();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public void endRequest(ExoContainer container)
- {
- try
- {
- jbidmService_.getIdentitySession().getTransaction().commit();
- }
- catch (Exception e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings |
File Templates.
- }
- }
-
- public String getExoGroupType()
- {
- return exoGroupType;
- }
-
- public String getExoRootGroupName()
- {
- return exoRootGroupName;
- }
-
- public String getExoRootGroupType()
- {
- return exoRootGroupType;
- }
-
- public boolean isPasswordAsAttribute()
- {
- return passwordAsAttribute;
- }
-}
Deleted:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMService.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMService.java 2009-11-19
20:53:18 UTC (rev 701)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMService.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -1,34 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.jbidm;
-
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.IdentitySessionFactory;
-
-public interface JBossIDMService
-{
-
- IdentitySessionFactory getIdentitySessionFactory();
-
- IdentitySession getIdentitySession() throws Exception;
-
- IdentitySession getIdentitySession(String realm) throws Exception;
-
-}
Deleted:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMServiceImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMServiceImpl.java 2009-11-19
20:53:18 UTC (rev 701)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMServiceImpl.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -1,222 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.jbidm;
-
-import org.exoplatform.container.configuration.ConfigurationManager;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.PropertiesParam;
-import org.exoplatform.container.xml.Property;
-import org.exoplatform.container.xml.ValueParam;
-import org.exoplatform.container.xml.ValuesParam;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.AnnotationConfiguration;
-import org.hibernate.dialect.Dialect;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.IdentitySessionFactory;
-import org.jboss.identity.idm.api.cfg.IdentityConfiguration;
-import org.jboss.identity.idm.common.exception.IdentityConfigurationException;
-import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
-import org.jboss.identity.idm.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
-import org.jboss.identity.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
-import org.picocontainer.Startable;
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.naming.InitialContext;
-
-public class JBossIDMServiceImpl implements JBossIDMService, Startable
-{
-
- private static Log log_ = ExoLogger.getLogger(JBossIDMServiceImpl.class);
-
- public static final String PARAM_CONFIG_OPTION = "config";
-
- public static final String PARAM_HIBERNATE_PROPS = "hibernate.properties";
-
- public static final String PARAM_HIBERNATE_MAPPINGS = "hibernate.mappings";
-
- public static final String PARAM_HIBERNATE_ANNOTATIONS =
"hibernate.annotations";
-
- public static final String PARAM_JNDI_NAME_OPTION = "jndiName";
-
- public static final String DEFAULT_REALM_NAME_OPTION = "PortalRealm";
-
- // We may have several portal containers thus we need one indentitySessionFactory per
portal container
- // private static IdentitySessionFactory identitySessionFactory;
- private IdentitySessionFactory identitySessionFactory;
-
- private String config;
-
- private String defaultRealmName = "PortalRealm";
-
- private IdentityConfiguration identityConfiguration;
-
- private JBossIDMServiceImpl()
- {
- }
-
- public JBossIDMServiceImpl(InitParams initParams, ConfigurationManager confManager)
throws Exception
- {
- ValueParam config = initParams.getValueParam(PARAM_CONFIG_OPTION);
- ValueParam jndiName = initParams.getValueParam(PARAM_JNDI_NAME_OPTION);
- ValueParam realmName = initParams.getValueParam(DEFAULT_REALM_NAME_OPTION);
-
- if (config == null && jndiName == null)
- {
- throw new IllegalStateException("Either '" + PARAM_CONFIG_OPTION +
"' or '" + PARAM_JNDI_NAME_OPTION
- + "' parameter must " + "be specified");
- }
- if (realmName != null)
- {
- this.defaultRealmName = realmName.getValue();
- }
-
- SessionFactory sf = null;
-
- if (initParams.containsKey(PARAM_HIBERNATE_PROPS))
- {
- PropertiesParam param = initParams.getPropertiesParam(PARAM_HIBERNATE_PROPS);
- AnnotationConfiguration conf_ = new AnnotationConfiguration();
- Iterator properties = param.getPropertyIterator();
- while (properties.hasNext())
- {
- Property p = (Property)properties.next();
-
- //
- String name = p.getName();
- String value = p.getValue();
-
- // Julien: Don't remove that unless you know what you are doing
- if (name.equals("hibernate.dialect"))
- {
- Package pkg = Dialect.class.getPackage();
- String dialect = value.substring(22);
- value = pkg.getName() + "." + dialect; // 22 is the length of
- // "org.hibernate.dialect"
- log_.info("Using dialect " + dialect);
- }
-
- //
- conf_.setProperty(name, value);
- }
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
-
- if (initParams.containsKey(PARAM_HIBERNATE_MAPPINGS))
- {
- ValuesParam mappings = initParams.getValuesParam(PARAM_HIBERNATE_MAPPINGS);
-
- List<String> paths = mappings.getValues();
-
- for (String path : paths)
- {
- URL url = cl.getResource(path);
- log_.info("Adding Hibernate Mapping: " + path);
- conf_.addURL(url);
- }
- }
-
- if (initParams.containsKey(PARAM_HIBERNATE_ANNOTATIONS))
- {
- ValuesParam annotations =
initParams.getValuesParam(PARAM_HIBERNATE_ANNOTATIONS);
-
- List<String> classes = annotations.getValues();
-
- for (String name : classes)
- {
- Class clazz = cl.loadClass(name);
- conf_.addAnnotatedClass(clazz);
- }
-
- }
-
- sf = conf_.buildSessionFactory();
-
- }
-
- if (config != null)
- {
- this.config = config.getValue();
- URL configURL = confManager.getURL(this.config);
-
- if (configURL == null)
- {
- throw new IllegalStateException("Cannot fine resource: " +
this.config);
- }
-
- IdentityConfigurationMetaData configMD =
-
JAXB2IdentityConfiguration.createConfigurationMetaData(confManager.getInputStream(this.config));
-
- identityConfiguration = new IdentityConfigurationImpl().configure(configMD);
-
- if (sf != null)
- {
- identityConfiguration.getIdentityConfigurationRegistry().register(sf,
"hibernateSessionFactory");
- }
- }
- else
- {
- identitySessionFactory = (IdentitySessionFactory)new
InitialContext().lookup(jndiName.getValue());
- }
-
- }
-
- public void start()
- {
- if (identitySessionFactory == null)
- {
- try
- {
- identitySessionFactory =
identityConfiguration.buildIdentitySessionFactory();
- }
- catch (IdentityConfigurationException e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- public void stop()
- {
- }
-
- public IdentitySessionFactory getIdentitySessionFactory()
- {
- return identitySessionFactory; //To change body of implemented methods use File |
Settings | File Templates.
- }
-
- public IdentitySession getIdentitySession() throws Exception
- {
- return getIdentitySessionFactory().getCurrentIdentitySession(defaultRealmName);
- }
-
- public IdentitySession getIdentitySession(String realm) throws Exception
- {
- if (realm == null)
- {
- throw new IllegalArgumentException("Realm name cannot be null");
- }
- return getIdentitySessionFactory().getCurrentIdentitySession(realm);
- }
-}
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/MembershipDAOImpl.java 2009-11-19
20:53:18 UTC (rev 701)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.commons.utils.ListenerStack;
import org.exoplatform.services.organization.Group;
@@ -26,9 +26,9 @@
import org.exoplatform.services.organization.MembershipHandler;
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.User;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.Role;
-import org.jboss.identity.idm.api.RoleType;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.Role;
+import org.picketlink.idm.api.RoleType;
import java.util.Collection;
import java.util.Collections;
@@ -42,13 +42,13 @@
public class MembershipDAOImpl implements MembershipHandler
{
- private JBossIDMService service_;
+ private PicketLinkIDMService service_;
private List listeners_;
- private JBossIDMOrganizationServiceImpl orgService;
+ private PicketLinkIDMOrganizationServiceImpl orgService;
- public MembershipDAOImpl(JBossIDMOrganizationServiceImpl orgService, JBossIDMService
service)
+ public MembershipDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService,
PicketLinkIDMService service)
{
service_ = service;
listeners_ = new ListenerStack(5);
@@ -102,7 +102,7 @@
}
String groupId =
- getIdentitySession().getPersistenceManager().createGroupId(g.getGroupName(),
orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().createGroupKey(g.getGroupName(),
orgService.getGtnGroupType());
if (getIdentitySession().getRoleManager().hasRole(user.getUserName(), groupId,
mt.getName()))
{
@@ -131,8 +131,8 @@
public void saveMembership(Membership m, boolean broadcast) throws Exception
{
String groupId =
-
getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(m.getGroupId()),
- orgService.getExoGroupType());
+
getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId,
m.getMembershipType()))
{
@@ -158,8 +158,8 @@
Membership m = new MembershipImpl(id);
String groupId =
-
getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(m.getGroupId()),
- orgService.getExoGroupType());
+
getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
if (!getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId,
m.getMembershipType()))
{
@@ -218,8 +218,8 @@
public Membership findMembershipByUserGroupAndType(String userName, String groupId,
String type) throws Exception
{
String gid =
-
getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(groupId),
- orgService.getExoGroupType());
+
getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
Role role = getIdentitySession().getRoleManager().getRole(type, userName, gid);
@@ -245,8 +245,8 @@
}
String gid =
-
getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(groupId),
- orgService.getExoGroupType());
+
getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
Collection<RoleType> roleTypes =
getIdentitySession().getRoleManager().findRoleTypes(userName, gid, null);
@@ -285,10 +285,10 @@
return memberships;
}
- static void removeMembershipEntriesOfGroup(JBossIDMOrganizationServiceImpl orgService,
Group group,
+ static void removeMembershipEntriesOfGroup(PicketLinkIDMOrganizationServiceImpl
orgService, Group group,
IdentitySession session) throws Exception
{
- String gid = session.getPersistenceManager().createGroupId(group.getGroupName(),
orgService.getExoGroupType());
+ String gid = session.getPersistenceManager().createGroupKey(group.getGroupName(),
orgService.getGtnGroupType());
Collection<Role> roles = session.getRoleManager().findRoles(gid, null);
@@ -306,8 +306,8 @@
public Collection findMembershipsByGroupId(String groupId) throws Exception
{
String gid =
-
getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(groupId),
- orgService.getExoGroupType());
+
getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(gid,
null);
@@ -333,8 +333,8 @@
Membership m = new MembershipImpl(id);
String groupId =
-
getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(m.getGroupId()),
- orgService.getExoGroupType());
+
getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId,
m.getMembershipType()))
{
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/MembershipImpl.java 2009-11-19
20:53:18 UTC (rev 701)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.services.organization.Membership;
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/MembershipTypeDAOImpl.java 2009-11-19
20:53:18 UTC (rev 701)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -17,13 +17,13 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.MembershipTypeHandler;
import org.exoplatform.services.organization.impl.MembershipTypeImpl;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.RoleType;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.RoleType;
import java.text.DateFormat;
import java.util.Collection;
@@ -46,11 +46,11 @@
public static final DateFormat dateFormat = DateFormat.getInstance();
- private JBossIDMService service_;
+ private PicketLinkIDMService service_;
- private JBossIDMOrganizationServiceImpl orgService;
+ private PicketLinkIDMOrganizationServiceImpl orgService;
- public MembershipTypeDAOImpl(JBossIDMOrganizationServiceImpl orgService,
JBossIDMService service)
+ public MembershipTypeDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService,
PicketLinkIDMService service)
{
service_ = service;
this.orgService = orgService;
Copied:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
(from rev 701,
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMOrganizationServiceImpl.java)
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
(rev 0)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -0,0 +1,175 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.component.ComponentRequestLifecycle;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.services.cache.CacheService;
+import org.exoplatform.services.organization.BaseOrganizationService;
+import org.picocontainer.Startable;
+
+public class PicketLinkIDMOrganizationServiceImpl extends BaseOrganizationService
implements Startable,
+ ComponentRequestLifecycle
+{
+
+ // We may have several portal containers thus we need one PicketLinkIDMService per
portal container
+ // private static PicketLinkIDMService jbidmService_;
+ private PicketLinkIDMService idmService_;
+
+ public static final String GTN_GROUP_TYPE_OPTION = "gtnGroupTypeName";
+
+ public static final String GTN_ROOT_GROUP_NAME_OPTION = "gtnRootGroupName";
+
+ public static final String GTN_ROOT_GROUP_TYPE_NAME_OPTION =
"gtnRootGroupTypeName";
+
+ public static final String PASSWORD_AS_ATTRIBUTE_OPTION =
"passwordAsAttribute";
+
+ private String gtnGroupType = "GTN_GROUP_TYPE";
+
+ private String gtnRootGroupName = "GTN_ROOT_GROUP";
+
+ private String gtnRootGroupType = gtnGroupType;
+
+ private boolean passwordAsAttribute = false;
+
+ public PicketLinkIDMOrganizationServiceImpl(InitParams params, CacheService cservice,
PicketLinkIDMService idmService)
+ throws Exception
+ {
+ groupDAO_ = new GroupDAOImpl(this, idmService);
+ userDAO_ = new UserDAOImpl(this, idmService, cservice);
+ userProfileDAO_ = new UserProfileDAOImpl(this, idmService, cservice);
+ membershipDAO_ = new MembershipDAOImpl(this, idmService);
+ membershipTypeDAO_ = new MembershipTypeDAOImpl(this, idmService);
+
+ idmService_ = idmService;
+
+ if (params != null)
+ {
+ //Options
+ ValueParam gtnGroupTypeNameParam = params.getValueParam(GTN_GROUP_TYPE_OPTION);
+ ValueParam gtnRootGroupTypeNameParam =
params.getValueParam(GTN_ROOT_GROUP_TYPE_NAME_OPTION);
+ ValueParam gtnRootGroupNameParam =
params.getValueParam(GTN_ROOT_GROUP_NAME_OPTION);
+ ValueParam passwordAsAttributeParam =
params.getValueParam(PASSWORD_AS_ATTRIBUTE_OPTION);
+
+ if (gtnGroupTypeNameParam != null)
+ {
+ this.gtnGroupType = gtnGroupTypeNameParam.getValue();
+ }
+
+ if (gtnRootGroupNameParam != null)
+ {
+ this.gtnRootGroupName = gtnRootGroupNameParam.getValue();
+ }
+
+ if (gtnRootGroupTypeNameParam != null)
+ {
+ this.gtnRootGroupType = gtnRootGroupTypeNameParam.getValue();
+ }
+ else if (gtnRootGroupTypeNameParam != null)
+ {
+ this.gtnRootGroupType = this.gtnGroupType;
+ }
+
+ if (passwordAsAttributeParam != null &&
passwordAsAttributeParam.getValue().equalsIgnoreCase("true"))
+ {
+ this.passwordAsAttribute = true;
+ }
+ }
+
+ }
+
+ public final org.picketlink.idm.api.Group getJBIDMGroup(String groupId) throws
Exception
+ {
+ String[] ids = groupId.split("/");
+ String name = ids[ids.length - 1];
+ return idmService_.getIdentitySession().getPersistenceManager().findGroup(name,
getGtnGroupType());
+ }
+
+ @Override
+ public void start()
+ {
+
+ try
+ {
+ // Wrap within transaction so all initializers can work
+ idmService_.getIdentitySession().beginTransaction();
+ super.start();
+ idmService_.getIdentitySession().getTransaction().commit();
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings |
File Templates.
+ }
+
+ }
+
+ @Override
+ public void stop()
+ {
+ //toto
+ }
+
+ public void startRequest(ExoContainer container)
+ {
+ try
+ {
+ idmService_.getIdentitySession().beginTransaction();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void endRequest(ExoContainer container)
+ {
+ try
+ {
+ idmService_.getIdentitySession().getTransaction().commit();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public String getGtnGroupType()
+ {
+ return gtnGroupType;
+ }
+
+ public String getExoRootGroupName()
+ {
+ return gtnRootGroupName;
+ }
+
+ public String getGtnRootGroupType()
+ {
+ return gtnRootGroupType;
+ }
+
+ public boolean isPasswordAsAttribute()
+ {
+ return passwordAsAttribute;
+ }
+}
Copied:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java
(from rev 701,
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMService.java)
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java
(rev 0)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -0,0 +1,34 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.IdentitySessionFactory;
+
+public interface PicketLinkIDMService
+{
+
+ IdentitySessionFactory getIdentitySessionFactory();
+
+ IdentitySession getIdentitySession() throws Exception;
+
+ IdentitySession getIdentitySession(String realm) throws Exception;
+
+}
Copied:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
(from rev 701,
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMServiceImpl.java)
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
(rev 0)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -0,0 +1,149 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.database.HibernateService;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.IdentitySessionFactory;
+import org.picketlink.idm.api.cfg.IdentityConfiguration;
+import org.picketlink.idm.common.exception.IdentityConfigurationException;
+import org.picketlink.idm.impl.configuration.IdentityConfigurationImpl;
+import org.picketlink.idm.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
+import org.picketlink.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
+import org.picocontainer.Startable;
+
+import java.net.URL;
+
+import javax.naming.InitialContext;
+
+public class PicketLinkIDMServiceImpl implements PicketLinkIDMService, Startable
+{
+
+ private static Log log_ = ExoLogger.getLogger(PicketLinkIDMServiceImpl.class);
+
+ public static final String PARAM_CONFIG_OPTION = "config";
+
+ public static final String PARAM_HIBERNATE_PROPS = "hibernate.properties";
+
+ public static final String PARAM_HIBERNATE_MAPPINGS = "hibernate.mappings";
+
+ public static final String PARAM_HIBERNATE_ANNOTATIONS =
"hibernate.annotations";
+
+ public static final String PARAM_JNDI_NAME_OPTION = "jndiName";
+
+ public static final String DEFAULT_REALM_NAME_OPTION = "PortalRealm";
+
+ // We may have several portal containers thus we need one indentitySessionFactory per
portal container
+ // private static IdentitySessionFactory identitySessionFactory;
+ private IdentitySessionFactory identitySessionFactory;
+
+ private String config;
+
+ private String defaultRealmName = "PortalRealm";
+
+ private IdentityConfiguration identityConfiguration;
+
+ private PicketLinkIDMServiceImpl()
+ {
+ }
+
+ public PicketLinkIDMServiceImpl(InitParams initParams, HibernateService
hibernateService, ConfigurationManager confManager) throws Exception
+ {
+ ValueParam config = initParams.getValueParam(PARAM_CONFIG_OPTION);
+ ValueParam jndiName = initParams.getValueParam(PARAM_JNDI_NAME_OPTION);
+ ValueParam realmName = initParams.getValueParam(DEFAULT_REALM_NAME_OPTION);
+
+ if (config == null && jndiName == null)
+ {
+ throw new IllegalStateException("Either '" + PARAM_CONFIG_OPTION +
"' or '" + PARAM_JNDI_NAME_OPTION
+ + "' parameter must " + "be specified");
+ }
+ if (realmName != null)
+ {
+ this.defaultRealmName = realmName.getValue();
+ }
+
+ if (config != null)
+ {
+ this.config = config.getValue();
+ URL configURL = confManager.getURL(this.config);
+
+ if (configURL == null)
+ {
+ throw new IllegalStateException("Cannot fine resource: " +
this.config);
+ }
+
+ IdentityConfigurationMetaData configMD =
+
JAXB2IdentityConfiguration.createConfigurationMetaData(confManager.getInputStream(this.config));
+
+ identityConfiguration = new IdentityConfigurationImpl().configure(configMD);
+
+
identityConfiguration.getIdentityConfigurationRegistry().register(hibernateService.getSessionFactory(),
"hibernateSessionFactory");
+ }
+ else
+ {
+ identitySessionFactory = (IdentitySessionFactory)new
InitialContext().lookup(jndiName.getValue());
+ }
+
+ }
+
+ public void start()
+ {
+ if (identitySessionFactory == null)
+ {
+ try
+ {
+ identitySessionFactory =
identityConfiguration.buildIdentitySessionFactory();
+ }
+ catch (IdentityConfigurationException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ public void stop()
+ {
+ }
+
+ public IdentitySessionFactory getIdentitySessionFactory()
+ {
+ return identitySessionFactory; //To change body of implemented methods use File |
Settings | File Templates.
+ }
+
+ public IdentitySession getIdentitySession() throws Exception
+ {
+ return getIdentitySessionFactory().getCurrentIdentitySession(defaultRealmName);
+ }
+
+ public IdentitySession getIdentitySession(String realm) throws Exception
+ {
+ if (realm == null)
+ {
+ throw new IllegalArgumentException("Realm name cannot be null");
+ }
+ return getIdentitySessionFactory().getCurrentIdentitySession(realm);
+ }
+}
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/UserDAOImpl.java 2009-11-19
20:53:18 UTC (rev 701)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.commons.utils.LazyPageList;
import org.exoplatform.services.cache.CacheService;
@@ -27,11 +27,11 @@
import org.exoplatform.services.organization.UserEventListener;
import org.exoplatform.services.organization.UserHandler;
import org.exoplatform.services.organization.impl.UserImpl;
-import org.jboss.identity.idm.api.Attribute;
-import org.jboss.identity.idm.api.AttributesManager;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.query.UserQueryBuilder;
-import org.jboss.identity.idm.impl.api.SimpleAttribute;
+import org.picketlink.idm.api.Attribute;
+import org.picketlink.idm.api.AttributesManager;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.query.UserQueryBuilder;
+import org.picketlink.idm.impl.api.SimpleAttribute;
import java.text.DateFormat;
import java.util.ArrayList;
@@ -47,7 +47,7 @@
public class UserDAOImpl implements UserHandler
{
- private final JBossIDMService service_;
+ private final PicketLinkIDMService service_;
private ExoCache cache_;
@@ -71,7 +71,7 @@
public static final DateFormat dateFormat = DateFormat.getInstance();
- private JBossIDMOrganizationServiceImpl orgService;
+ private PicketLinkIDMOrganizationServiceImpl orgService;
static
{
@@ -87,7 +87,7 @@
USER_NON_PROFILE_KEYS = Collections.unmodifiableSet(keys);
}
- public UserDAOImpl(JBossIDMOrganizationServiceImpl orgService, JBossIDMService
idmService, CacheService cservice)
+ public UserDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService,
PicketLinkIDMService idmService, CacheService cservice)
throws Exception
{
service_ = idmService;
@@ -155,7 +155,7 @@
{
IdentitySession session = service_.getIdentitySession();
- org.jboss.identity.idm.api.User foundUser =
session.getPersistenceManager().findUser(userName);
+ org.picketlink.idm.api.User foundUser =
session.getPersistenceManager().findUser(userName);
if (foundUser == null)
{
@@ -163,6 +163,10 @@
return null;
}
+ // Remove all memberships and profile first
+ orgService.getMembershipHandler().removeMembershipByUser(userName, false);
+ orgService.getUserProfileHandler().removeUserProfile(userName, false);
+
User exoUser = getPopulatedUser(userName, session);
if (broadcast)
@@ -222,7 +226,7 @@
else
{
IdentitySession session = service_.getIdentitySession();
- org.jboss.identity.idm.api.User idmUser =
session.getPersistenceManager().findUser(user.getUserName());
+ org.picketlink.idm.api.User idmUser =
session.getPersistenceManager().findUser(user.getUserName());
authenticated = session.getAttributesManager().validatePassword(idmUser,
password);
}
@@ -269,7 +273,7 @@
{
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
- org.jboss.identity.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
+ org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
qb.addRelatedGroup(jbidGroup);
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/UserProfileDAOImpl.java 2009-11-19
20:53:18 UTC (rev 701)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.services.cache.CacheService;
import org.exoplatform.services.cache.ExoCache;
@@ -25,9 +25,9 @@
import org.exoplatform.services.organization.UserProfileEventListener;
import org.exoplatform.services.organization.UserProfileHandler;
import org.exoplatform.services.organization.impl.UserProfileImpl;
-import org.jboss.identity.idm.api.Attribute;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.impl.api.SimpleAttribute;
+import org.picketlink.idm.api.Attribute;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.impl.api.SimpleAttribute;
import java.util.ArrayList;
import java.util.Collection;
@@ -42,15 +42,15 @@
static private UserProfile NOT_FOUND = new UserProfileImpl();
- private JBossIDMService service_;
+ private PicketLinkIDMService service_;
private ExoCache cache_;
private List<UserProfileEventListener> listeners_;
- private JBossIDMOrganizationServiceImpl orgService;
+ private PicketLinkIDMOrganizationServiceImpl orgService;
- public UserProfileDAOImpl(JBossIDMOrganizationServiceImpl orgService, JBossIDMService
service, CacheService cservice)
+ public UserProfileDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService,
PicketLinkIDMService service, CacheService cservice)
throws Exception
{
service_ = service;
@@ -136,7 +136,7 @@
public UserProfile findUserProfileByName(String userName) throws Exception
{
- org.jboss.identity.idm.api.User foundUser =
getIdentitySession().getPersistenceManager().findUser(userName);
+ org.picketlink.idm.api.User foundUser =
getIdentitySession().getPersistenceManager().findUser(userName);
if (foundUser == null)
{
Modified: portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml
===================================================================
---
portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -25,54 +25,54 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+
<key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
<value>jar:/conf/portal/idm-config.xml</value>
</value-param>
- <values-param>
- <name>hibernate.annotations</name>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
- <property name="hibernate.current_session_context_class"
value="thread"/>
- <property name="hibernate.show_sql"
value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer"
value="true"/>
- <property name="hibernate.connection.url"
value="jdbc:hsqldb:file:target/temp/data/exodb"/>
- <property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit"
value="true"/>
- <property name="hibernate.connection.username"
value="sa"/>
- <property name="hibernate.connection.password"
value=""/>
- <property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size"
value="5"/>
- <property name="hibernate.c3p0.max_size"
value="20"/>
- <property name="hibernate.c3p0.timeout"
value="1800"/>
- <property name="hibernate.c3p0.max_statements"
value="50"/>
- </properties-param>
-
</init-params>
</component>
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
+ <component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
+ <!--<property name="hibernate.show_sql"
value="true"/>-->
+ <!--<property name="hibernate.use_sql_comments"
value="true"/>-->
+ <!--<property name="hibernate.format_sql"
value="true"/>-->
+ <property name="hibernate.current_session_context_class"
value="thread"/>
+ <property name="hibernate.jdbc.batch_size"
value="100"/>
+ <property name="hibernate.cache.use_second_level_cache"
value="true"/>
+ <property name="hibernate.cache.use_query_cache"
value="true"/>
+ <!--CHANGEME HashtableCacheProvider shold not be used in production env-->
+ <property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
+ <property name="hibernate.cglib.use_reflection_optimizer"
value="true"/>
+ <property name="hibernate.connection.url"
value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
+ <property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.autocommit"
value="true"/>
+ <property name="hibernate.connection.username"
value="sa"/>
+ <property name="hibernate.connection.password"
value=""/>
+ <property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size" value="5"/>
+ <property name="hibernate.c3p0.max_size" value="20"/>
+ <property name="hibernate.c3p0.timeout" value="1800"/>
+ <property name="hibernate.c3p0.max_statements"
value="50"/>
+ </properties-param>
+ </init-params>
+ </component>
+
<external-component-plugins>
<target-component>org.exoplatform.services.database.HibernateService</target-component>
<component-plugin>
@@ -81,19 +81,18 @@
<type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
<init-params>
<values-param>
- <name>hibernate.annotations</name>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified:
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
===================================================================
---
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -173,6 +173,7 @@
// newly created 'test' and 'demo'
assertEquals(2, piterator.currentPage().size());
+// membershipHandler_.removeMembershipByUser(USER,false);
userHandler_.removeUser(USER, true);
piterator = userHandler_.getUserPageList(10);
// one 'demo'
@@ -436,19 +437,20 @@
groupHandler_.removeGroup(group3, true);
}
- public void testUserProfileListener() throws Exception
- {
- UserProfileListener l = new UserProfileListener();
- profileHandler_.addUserProfileEventListener(l);
- User user = createUser(USER);
- assertNotNull(user);
- UserProfile profile =
profileHandler_.createUserProfileInstance(user.getUserName());
- profile.setAttribute("blah", "blah");
- profileHandler_.saveUserProfile(profile, true);
- assertTrue(l.preSave && l.postSave);
- profileHandler_.removeUserProfile(user.getUserName(), true);
- assertFalse(l.preDelete && l.postDelete);
- }
+// public void testUserProfileListener() throws Exception
+// {
+// UserProfileListener l = new UserProfileListener();
+// profileHandler_.addUserProfileEventListener(l);
+// User user = createUser(USER);
+// assertNotNull(user);
+// UserProfile profile =
profileHandler_.createUserProfileInstance(user.getUserName());
+// profile.setAttribute("blah", "blah");
+// profileHandler_.saveUserProfile(profile, true);
+// assertTrue(l.preSave && l.postSave);
+// profileHandler_.removeUserProfile(user.getUserName(), true);
+// assertFalse(l.preDelete && l.postDelete);
+// userHandler_.removeUser(user.getUserName(), false);
+// }
public void testFindUsersByGroupId() throws Exception
{
Modified: portal/trunk/component/portal/pom.xml
===================================================================
--- portal/trunk/component/portal/pom.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/portal/pom.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -82,9 +82,9 @@
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-core</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-core</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
</dependencies>
Modified:
portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml
===================================================================
---
portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -34,6 +34,9 @@
<description>Default Hibernate Service</description>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.cglib.use_reflection_optimizer"
value="true"/>
+ <property name="hibernate.cache.use_second_level_cache"
value="true"/>
+ <property name="hibernate.cache.use_query_cache"
value="true"/>
+ <property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.connection.url"
value="jdbc:hsqldb:file:target/temp/data/exodb"/>
<property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.autocommit"
value="true"/>
Modified: portal/trunk/component/portal/src/test/java/conf/portal/idm-configuration.xml
===================================================================
---
portal/trunk/component/portal/src/test/java/conf/portal/idm-configuration.xml 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/component/portal/src/test/java/conf/portal/idm-configuration.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -25,52 +25,21 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+
<key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
<value>war:/conf/organization/idm-config.xml</value>
</value-param>
- <values-param>
- <name>hibernate.annotations</name>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto"
value="update"/>
- <property name="hibernate.current_session_context_class"
value="thread"/>
- <property name="hibernate.show_sql"
value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer"
value="true"/>
- <property name="hibernate.connection.url"
value="jdbc:hsqldb:file:target/temp/data/exodb"/>
- <property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit"
value="true"/>
- <property name="hibernate.connection.username"
value="sa"/>
- <property name="hibernate.connection.password"
value=""/>
- <property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size"
value="5"/>
- <property name="hibernate.c3p0.max_size"
value="20"/>
- <property name="hibernate.c3p0.timeout"
value="1800"/>
- <property name="hibernate.c3p0.max_statements"
value="50"/>
- </properties-param>
+
</init-params>
</component>
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
<external-component-plugins>
@@ -81,19 +50,18 @@
<type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
<init-params>
<values-param>
- <name>hibernate.annotations</name>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
---
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-20
17:18:44 UTC (rev 744)
@@ -43,12 +43,12 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
import org.exoplatform.services.organization.UserHandler;
-import org.exoplatform.services.organization.jbidm.JBossIDMService;
+import org.exoplatform.services.organization.idm.PicketLinkIDMService;
import org.exoplatform.services.security.Authenticator;
import org.exoplatform.services.security.ConversationState;
import org.exoplatform.test.BasicTestCase;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.common.exception.IdentityException;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.common.exception.IdentityException;
import java.util.Arrays;
import java.util.Collections;
@@ -76,7 +76,7 @@
private DataStorage storage_;
/** . */
- private JBossIDMService idmService;
+ private PicketLinkIDMService idmService;
/** . */
private POMSessionManager mgr;
@@ -122,7 +122,7 @@
userPortalConfigSer_ =
(UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
orgService_ =
(OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
- idmService =
(JBossIDMService)container.getComponentInstanceOfType(JBossIDMService.class);
+ idmService =
(PicketLinkIDMService)container.getComponentInstanceOfType(PicketLinkIDMService.class);
mgr =
(POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
authenticator =
(Authenticator)container.getComponentInstanceOfType(Authenticator.class);
listenerService =
(ListenerService)container.getComponentInstanceOfType(ListenerService.class);
Modified: portal/trunk/docs/user-guide/en/modules/configuration/IDM_Configuration.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/configuration/IDM_Configuration.xml 2009-11-20
16:25:22 UTC (rev 743)
+++ portal/trunk/docs/user-guide/en/modules/configuration/IDM_Configuration.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -17,15 +17,15 @@
<section>
<title>Configuration files</title>
<para>Main configuration file is <emphasis
role="bold">idm-configuration</emphasis>:</para>
- <programlisting>
+ <programlisting><![CDATA[<![CDATA[<![CDATA[
<![CDATA[
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+
<key>org.exoplatform.services.orgaidmion.jbidm.PicketLinkIDMService</key>
+
<type>org.exoplatform.servicidmganization.jbidm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
@@ -33,18 +33,18 @@
</value-param>
<values-param>
<name>hibernate.annotations</name>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObject</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
+
<value>org.picketlink.idm.impl.model.hibernate.HibernateRealm</value>
</values-param>
<properties-param>
<name>hibernate.properties</name>
@@ -70,18 +70,18 @@
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
-</configuration>
+</configuration>
]]>
- </programlisting>
- <para><emphasis
role="bold">org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</emphasis>
+ ]]>]]>]]></programlisting>
+ <para><emphasis
role="bold">org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</emphasis>
is a main entrypoint implementing
<emphasis
role="bold">org.exoplatform.services.organization.OrganizationService</emphasis>
and is dependant on
- <emphasis
role="bold">org.exoplatform.services.organization.jbidm.JBossIDMService</emphasis></para>
+ <emphasis
role="bold">org.exoplatform.services.organization.idm.PicketLinkIDMService</emphasis></para>
- <para><emphasis
role="bold">org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</emphasis>
service has following
+ <para><emphasis
role="bold">org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</emphasis>
service has following
options:</para>
<itemizedlist>
<listitem>
@@ -121,25 +121,25 @@
</listitem>
</itemizedlist>
- <para><emphasis
role="bold">org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</emphasis>
service has following
+ <para><emphasis
role="bold">org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</emphasis>
service has following
options:</para>
<itemizedlist>
<listitem>
<para>
- <emphasis role="bold">exoGroupTypeName</emphasis> -
(value-param) - Name of JBoss Identity IDM GroupType
- that will be used to store groups. Default is 'EXO_GROUP_TYPE'
+ <emphasis role="bold">gtnGroupTypeName</emphasis> -
(value-param) - Name of JBoss Identity IDM GroupType
+ that will be used to store groups. Default is 'GTN_GROUP_TYPE'
</para>
</listitem>
<listitem>
<para>
- <emphasis role="bold">exoRootGroupName</emphasis> -
(value-param) - Name of JBoss Identity IDM Group that will
- be used as a root parent. Default is 'EXO_ROOT_GROUP'
+ <emphasis role="bold">gtnRootGroupName</emphasis> -
(value-param) - Name of JBoss Identity IDM Group that will
+ be used as a root parent. Default is 'GTN_ROOT_GROUP'
</para>
</listitem>
<listitem>
<para>
- <emphasis
role="bold">exoRootGroupTypeName</emphasis> - (value-param) - Name of
JBoss Identity IDM GroupType
- of a Group used as a parent root. Default is 'EXO_GROUP_TYPE'
+ <emphasis
role="bold">gtnRootGroupTypeName</emphasis> - (value-param) - Name of
JBoss Identity IDM GroupType
+ of a Group used as a parent root. Default is 'GTN_GROUP_TYPE'
</para>
</listitem>
<listitem>
@@ -187,7 +187,7 @@
<repositories>
<repository>
<id>PortalRepository</id>
-
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+
<class>org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository</class>
<external-config/>
<default-identity-store-id>HibernateStore</default-identity-store-id>
<default-attribute-store-id>HibernateStore</default-attribute-store-id>
@@ -198,7 +198,7 @@
<identity-stores>
<identity-store>
<id>HibernateStore</id>
-
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+
<class>org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
<external-config/>
<supported-relationship-types>
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
Modified: portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
===================================================================
---
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-20
17:18:44 UTC (rev 744)
@@ -37,7 +37,7 @@
var mopVersion = "${org.gatein.mop.version}";
var chromatticVersion = "${version.chromattic}";
var reflectVersion = "${version.reflect}";
- var idmVersion = "${org.jboss.identity.idm}";
+ var idmVersion = "${org.picketlink.idm}";
var pcVersion = "${org.gatein.pc.version}";
var wciVersion = "${org.gatein.wci.version}";
var commonVersion = "${org.gatein.common.version}";
@@ -115,12 +115,12 @@
module.component.identity =
new Project("org.exoplatform.portal",
"exo.portal.component.identity", "jar", module.version).
- addDependency(new Project("org.jboss.identity.idm", "idm-core",
"jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm",
"idm-common", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-api",
"jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-spi",
"jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm",
"idm-hibernate", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-ldap",
"jar", idmVersion));
+ addDependency(new Project("org.picketlink.idm",
"picketlink-idm-core", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm",
"picketlink-idm-common", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm",
"picketlink-idm-api", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm",
"picketlink-idm-spi", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm",
"picketlink-idm-hibernate", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm",
"picketlink-idm-ldap", "jar", idmVersion));
module.component.applicationRegistry =
new Project("org.exoplatform.portal",
"exo.portal.component.application-registry", "jar", module.version).
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/pom.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -46,7 +46,7 @@
<org.gatein.common.version>2.0.0-Beta03</org.gatein.common.version>
<org.gatein.wci.version>2.0.0-Beta02</org.gatein.wci.version>
<org.gatein.pc.version>2.1.0-Beta02</org.gatein.pc.version>
- <org.jboss.identity.idm>1.0.0.Beta3</org.jboss.identity.idm>
+ <org.picketlink.idm>1.0.0.CR1</org.picketlink.idm>
<org.gatein.wsrp.version>1.0.0-Beta01</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.0-Beta09</org.gatein.mop.version>
<version.chromattic>1.0.0-beta6</version.chromattic>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -33,6 +33,11 @@
<name>hibernate.properties</name>
<description>Default Hibernate Service</description>
<property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.current_session_context_class"
value="thread"/>
+ <property name="hibernate.cache.use_second_level_cache"
value="true"/>
+ <property name="hibernate.cache.use_query_cache"
value="true"/>
+ <!--CHANGEME HashtableCacheProvider shold not be used in production env-->
+ <property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.cglib.use_reflection_optimizer"
value="true"/>
<property name="hibernate.connection.url"
value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
<property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -20,9 +20,9 @@
-->
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_beta"
+<jboss-identity xmlns="urn:picketlink:idm:config:v1_0_0_cr1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
+ xsi:schemaLocation="urn:picketlink:idm:config:v1_0_0_cr1
identity-config.xsd">
<realms>
<realm>
<id>PortalRealm</id>
@@ -35,7 +35,7 @@
<repositories>
<repository>
<id>PortalRepository</id>
-
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+
<class>org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository</class>
<external-config/>
<default-identity-store-id>HibernateStore</default-identity-store-id>
<default-attribute-store-id>HibernateStore</default-attribute-store-id>
@@ -46,7 +46,7 @@
<identity-stores>
<identity-store>
<id>HibernateStore</id>
-
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+
<class>org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
<external-config/>
<supported-relationship-types>
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2009-11-20
16:25:22 UTC (rev 743)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2009-11-20
17:18:44 UTC (rev 744)
@@ -23,54 +23,50 @@
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+
<key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
<value>war:/conf/organization/idm-config.xml</value>
</value-param>
- <values-param>
- <name>hibernate.annotations</name>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
-
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto"
value="update"/>
- <property name="hibernate.current_session_context_class"
value="thread"/>
- <property name="hibernate.show_sql"
value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer"
value="true"/>
- <property name="hibernate.connection.url"
value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
- <property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit"
value="true"/>
- <property name="hibernate.connection.username"
value="sa"/>
- <property name="hibernate.connection.password"
value=""/>
- <property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size"
value="5"/>
- <property name="hibernate.c3p0.max_size"
value="20"/>
- <property name="hibernate.c3p0.timeout"
value="1800"/>
- <property name="hibernate.c3p0.max_statements"
value="50"/>
- </properties-param>
-
</init-params>
</component>
+
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
-
<type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+
<type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
+ <external-component-plugins>
+
<target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+
<type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+
<value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+
</configuration>