gatein SVN: r804 - in portal/branches/wsrp-integration: component/wsrp and 9 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-25 16:32:49 -0500 (Wed, 25 Nov 2009)
New Revision: 804
Added:
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
Removed:
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/common/wsrp-configuration.xml
Modified:
portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/repository-configuration.xml
portal/branches/wsrp-integration/component/wsrp/pom.xml
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
Log:
- Changed save and update methods in JCRConsumerRegistry as they should be more conform to Chromattic's usage patterns, though this is pure speculation at this point... :(
- Added custom implementation of SessionLifeCycle to JCRPersister so that it can be used by Chromattic.
- Added missing dependencies.
- Added JCR workspace configuration for WSRP persistence.
- Added nodetype definitions for JCR for both producer and consumers configuration.
- Added wsrp namespace definition for JCR.
- Added more init parameters to ExoKernelIntegration service configuration and moved it from common directory to a new wsrp directory.
- Added create method on ProducerInfosMapping.
- Renamed create method on RegistrationInfoMapping to be more explicit.
- Use node name in persistence operations instead of constructed path.
- Fixed forgotten initialization of persister in JCRProducerConfigurationService.
Modified: portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/repository-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/repository-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/repository-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -20,154 +20,215 @@
-->
<repository-service default-repository="repository">
- <repositories>
- <repository name="repository" system-workspace="system" default-workspace="portal-system">
- <security-domain>gatein-domain</security-domain>
- <access-control>optional</access-control>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="system">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo"/>
- <property name="dialect" value="${dialect}"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="target/temp/swap/system"/>
- </properties>
- <value-storages>
- <value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/system"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <repositories>
+ <repository name="repository" system-workspace="system" default-workspace="portal-system">
+ <security-domain>gatein-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo"/>
+ <property name="dialect" value="${dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="target/temp/swap/system"/>
+ </properties>
+ <value-storages>
+ <value-storage id="system"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ <property name="path" value="target/temp/values/system"/>
</properties>
- </initializer>
- <cache enabled="true">
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/system"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="target/temp/lock/system"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="portal-system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo"/>
+ <property name="dialect" value="${dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="target/temp/swap/collaboration"/>
+ </properties>
+ <value-storages>
+ <value-storage id="collaboration"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
+ <property name="path" value="target/temp/values/collaboration"/>
</properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/collaboration"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="target/temp/lock/collaboration"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="gadgets">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo"/>
+ <property name="dialect" value="${dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="target/temp/swap/gadgets"/>
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="index-dir" value="target/temp/jcrlucenedb/system"/>
+ <property name="path" value="target/temp/values/gadgets"/>
</properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock/system"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- <workspace name="portal-system">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo"/>
- <property name="dialect" value="${dialect}"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="target/temp/swap/collaboration"/>
- </properties>
- <value-storages>
- <value-storage id="collaboration" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/collaboration"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/jcrlucenedb/collaboration"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock/collaboration"/>
- </properties>
- </persister>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/gadgets"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="target/temp/lock/gadgets"/>
+ </properties>
+ </persister>
</lock-manager>
- </workspace>
- <workspace name="gadgets">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo"/>
- <property name="dialect" value="${dialect}"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="target/temp/swap/gadgets"/>
- </properties>
- <value-storages>
- <value-storage id="gadgets" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/gadgets"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ </workspace>
+
+ <!-- WSRP workspace -->
+ <workspace name="wsrp-system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo"/>
+ <property name="dialect" value="${dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="target/temp/swap/wsrp"/>
+ </properties>
+ <value-storages>
+ <value-storage id="wsrp"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ <property name="path" value="target/temp/values/wsrp"/>
</properties>
- </initializer>
- <cache enabled="true">
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/wsrp"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
+ <property name="path" value="target/temp/lock/wsrp"/>
</properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/jcrlucenedb/gadgets"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock/gadgets"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
- </repositories>
+ </persister>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
</repository-service>
Modified: portal/branches/wsrp-integration/component/wsrp/pom.xml
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/pom.xml 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/component/wsrp/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -91,7 +91,13 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+
<dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.ext</artifactId>
+ <version>${org.exoplatform.jcr.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.chromattic</groupId>
<artifactId>chromattic.api</artifactId>
<version>${version.chromattic}</version>
@@ -103,6 +109,11 @@
<version>${version.chromattic}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.spi</artifactId>
+ <version>${version.chromattic}</version>
+ </dependency>
<!-- Required to process Chromattic annotations -->
<dependency>
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2009-11-25 21:32:49 UTC (rev 804)
@@ -57,32 +57,43 @@
*/
public class ExoKernelIntegration implements Startable
{
- private static final String DEFAULT_PRODUCER_CONFIG_LOCATION = "conf/wsrp-producer-config.xml";
-
private static final String CLASSPATH = "classpath:/";
+ private static final String PRODUCER_CONFIG_LOCATION = "producerConfigLocation";
+ private static final String CONSUMERS_CONFIG_LOCATION = "consumersConfigLocation";
+ private static final String WORKSPACE_NAME = "workspaceName";
+ private static final String REPOSITORY_NAME = "repositoryName";
private final InputStream configurationIS;
-
- private String configLocation;
-
+ private final String producerConfigLocation;
private WSRPProducer producer;
+ private final String consumersConfigLocation;
private ConsumerRegistry consumerRegistry;
+ private final String workspaceName;
+ private final String repositoryName;
+
public ExoKernelIntegration(InitParams params, ConfigurationManager configurationManager,
org.exoplatform.portal.pc.ExoKernelIntegration pc) throws Exception
{
+ // IMPORTANT: even though PC ExoKernelIntegration is not used anywhere in the code, it's still needed for pico
+ // to properly make sure that this service is started after the PC one. Yes, Pico is crap. :/
+
if (params != null)
{
- configLocation = params.getValueParam("configLocation").getValue();
+ producerConfigLocation = params.getValueParam(PRODUCER_CONFIG_LOCATION).getValue();
+ consumersConfigLocation = params.getValueParam(CONSUMERS_CONFIG_LOCATION).getValue();
+ workspaceName = params.getValueParam(WORKSPACE_NAME).getValue();
+ repositoryName = params.getValueParam(REPOSITORY_NAME).getValue();
}
-
- if (configLocation == null)
+ else
{
- configLocation = DEFAULT_PRODUCER_CONFIG_LOCATION;
+ throw new IllegalArgumentException("Improperly configured service: missing values for "
+ + PRODUCER_CONFIG_LOCATION + ", " + CONSUMERS_CONFIG_LOCATION + ", " + WORKSPACE_NAME + " and "
+ + REPOSITORY_NAME);
}
- configurationIS = configurationManager.getInputStream(CLASSPATH + configLocation);
+ configurationIS = configurationManager.getInputStream(CLASSPATH + producerConfigLocation);
}
public void start()
@@ -95,15 +106,16 @@
private void startProducer(ExoContainer container)
{
- JCRProducerConfigurationService producerConfigurationService = new JCRProducerConfigurationService();
- producerConfigurationService.setDefaultConfigurationIS(configurationIS);
+ JCRProducerConfigurationService producerConfigurationService;
try
{
+ producerConfigurationService = new JCRProducerConfigurationService(container, workspaceName, repositoryName);
+ producerConfigurationService.setDefaultConfigurationIS(configurationIS);
producerConfigurationService.reloadConfiguration();
}
catch (Exception e)
{
- throw new RuntimeException("Couldn't load WSRP producer configuration from " + configLocation, e);
+ throw new RuntimeException("Couldn't load WSRP producer configuration from " + producerConfigLocation, e);
}
RegistrationPersistenceManager registrationPersistenceManager = new RegistrationPersistenceManagerImpl();
@@ -154,7 +166,7 @@
try
{
- consumerRegistry = new JCRConsumerRegistry();
+ consumerRegistry = new JCRConsumerRegistry(container, workspaceName, repositoryName);
consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
consumerRegistry.setSessionEventBroadcaster(new SimpleSessionEventBroadcaster());
consumerRegistry.start();
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2009-11-25 21:32:49 UTC (rev 804)
@@ -25,8 +25,16 @@
import org.chromattic.api.Chromattic;
import org.chromattic.api.ChromatticBuilder;
import org.chromattic.api.ChromatticSession;
-import org.exoplatform.services.jcr.ext.registry.RegistryService;
+import org.chromattic.spi.jcr.SessionLifeCycle;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.core.ManageableRepository;
+import org.exoplatform.services.jcr.ext.common.SessionProvider;
+import javax.jcr.Credentials;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
import java.util.List;
/**
@@ -36,12 +44,36 @@
public class JCRPersister
{
private Chromattic chrome;
- public static final String WSRP_SERVICES_PATH = RegistryService.EXO_SERVICES + "/wsrp/";
+ public static final String WSRP_SERVICES_PATH = "wsrp:";
+ private final SessionProvider provider;
+ private final ManageableRepository repository;
+ private final String workspaceName;
+ static ThreadLocal<JCRPersister> PERSISTER = new ThreadLocal<JCRPersister>();
+
+ public JCRPersister(ExoContainer container, String workspaceName, String repositoryName) throws RepositoryException
+ {
+ try
+ {
+ RepositoryService repoService = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ repository = repoService.getRepository(repositoryName);
+ }
+ catch (RepositoryConfigurationException e)
+ {
+ throw new RepositoryException(e);
+ }
+
+ //
+ this.provider = SessionProvider.createSystemProvider();
+ this.workspaceName = workspaceName;
+ PERSISTER.set(this);
+ }
+
public void initializeBuilderFor(List<Class> mappingClasses) throws Exception
{
ChromatticBuilder builder = ChromatticBuilder.create();
builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME, "org.chromattic.apt.InstrumentorImpl");
+ builder.setOption(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME, WSRPSessionLifeCycle.class.getName());
for (Class mappingClass : mappingClasses)
{
@@ -55,4 +87,44 @@
{
return chrome.openSession();
}
+
+
+ public static class WSRPSessionLifeCycle implements SessionLifeCycle
+ {
+
+ public WSRPSessionLifeCycle()
+ {
+ }
+
+ public Session login() throws RepositoryException
+ {
+ JCRPersister persister = PERSISTER.get();
+ return persister.provider.getSession(persister.workspaceName, persister.repository);
+ }
+
+ public Session login(String s) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session login(Credentials credentials, String s) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session login(Credentials credentials) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void save(Session session) throws RepositoryException
+ {
+ session.save();
+ }
+
+ public void close(Session session)
+ {
+ session.logout();
+ }
+ }
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-11-25 21:32:49 UTC (rev 804)
@@ -24,8 +24,7 @@
package org.gatein.portal.wsrp.state.consumer;
import org.chromattic.api.ChromatticSession;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.services.jcr.ext.registry.RegistryService;
+import org.exoplatform.container.ExoContainer;
import org.gatein.portal.wsrp.state.JCRPersister;
import org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping;
import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping;
@@ -49,31 +48,30 @@
*/
public class JCRConsumerRegistry extends AbstractConsumerRegistry
{
- private JCRPersister persister = new JCRPersister();
- private static final String PRODUCER_INFOS_PATH = JCRPersister.WSRP_SERVICES_PATH + "producerinfos";
+ private JCRPersister persister;
+ private static final String PRODUCER_INFOS_PATH = ProducerInfosMapping.NODE_NAME;
- public JCRConsumerRegistry() throws Exception
+ public JCRConsumerRegistry(ExoContainer container, String workspaceName, String repositoryName) throws Exception
{
List<Class> mappingClasses = new ArrayList<Class>(6);
Collections.addAll(mappingClasses, ProducerInfosMapping.class, ProducerInfoMapping.class,
EndpointInfoMapping.class, RegistrationInfoMapping.class, RegistrationPropertyMapping.class,
RegistrationPropertyDescriptionMapping.class);
+ persister = new JCRPersister(container, workspaceName, repositoryName);
persister.initializeBuilderFor(mappingClasses);
}
- public JCRConsumerRegistry(InitParams params, RegistryService jcrRegistry) throws Exception
- {
- this();
- }
-
@Override
protected void save(ProducerInfo info, String messageOnError)
{
- String path = getPathFor(info);
ChromatticSession session = persister.getSession();
- String key = session.persist(toProducerInfoMapping(info, session), path);
+ ProducerInfosMapping pims = getProducerInfosMapping(session);
+ ProducerInfoMapping pim = pims.createProducerInfo();
+ pim.initFrom(info);
+
+ String key = session.persist(pims, pim, info.getId());
info.setKey(key);
session.close();
@@ -99,7 +97,14 @@
}
ChromatticSession session = persister.getSession();
- session.persist(toProducerInfoMapping(producerInfo, session), getPathFor(producerInfo));
+ ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, key);
+ if (pim == null)
+ {
+ throw new IllegalArgumentException("Couldn't find ProducerInfoMapping associated with key " + key);
+ }
+ pim.initFrom(producerInfo);
+ session.save();
+ session.close();
return null;
}
@@ -108,14 +113,23 @@
protected Iterator<ProducerInfo> getProducerInfosFromStorage()
{
ChromatticSession session = persister.getSession();
+ ProducerInfosMapping producerInfosMapping = getProducerInfosMapping(session);
+
+ List<ProducerInfoMapping> mappings = producerInfosMapping.getProducerInfos();
+
+ session.save();
+ session.close();
+ return new MappingToProducerInfoIterator(mappings.iterator());
+ }
+
+ private ProducerInfosMapping getProducerInfosMapping(ChromatticSession session)
+ {
ProducerInfosMapping producerInfosMapping = session.findByPath(ProducerInfosMapping.class, PRODUCER_INFOS_PATH);
- Iterator<ProducerInfo> producerInfos;
-
// if we don't have info from JCR, load from XML and populate JCR
if (producerInfosMapping == null)
{
- producerInfosMapping = session.insert(ProducerInfosMapping.class, PRODUCER_INFOS_PATH);
+ producerInfosMapping = session.insert(ProducerInfosMapping.class, ProducerInfosMapping.NODE_NAME);
List<ProducerInfoMapping> infos = producerInfosMapping.getProducerInfos();
@@ -127,21 +141,14 @@
List<WSRPConsumer> consumers = fromXML.getConfiguredConsumers();
for (WSRPConsumer consumer : consumers)
{
- infos.add(toProducerInfoMapping(consumer.getProducerInfo(), session));
+ ProducerInfoMapping pim = producerInfosMapping.createProducerInfo();
+ pim.initFrom(consumer.getProducerInfo());
+ infos.add(pim);
}
session.persist(infos); // todo: is that sufficient?
-
- producerInfos = new ProducerInfoIterator(consumers.iterator());
}
- else
- {
- List<ProducerInfoMapping> mappings = producerInfosMapping.getProducerInfos();
- producerInfos = new MappingToProducerInfoIterator(mappings.iterator());
- }
- session.save();
- session.close();
- return producerInfos;
+ return producerInfosMapping;
}
private void delete(ChromatticSession session, String path)
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java 2009-11-25 21:32:49 UTC (rev 804)
@@ -23,6 +23,7 @@
package org.gatein.portal.wsrp.state.consumer.mapping;
+import org.chromattic.api.annotations.Create;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToMany;
@@ -39,4 +40,7 @@
@OneToMany
public abstract List<ProducerInfoMapping> getProducerInfos();
+
+ @Create
+ public abstract ProducerInfoMapping createProducerInfo();
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java 2009-11-25 21:32:49 UTC (rev 804)
@@ -65,7 +65,7 @@
public abstract List<RegistrationPropertyMapping> getRegistrationProperties();
@Create
- public abstract RegistrationPropertyMapping create();
+ public abstract RegistrationPropertyMapping createRegistrationProperty();
public void initFrom(RegistrationInfo regInfo)
{
@@ -84,7 +84,7 @@
for (RegistrationProperty property : regInfo.getRegistrationProperties().values())
{
// create new RegistrationPropertyMapping for this RegistrationInfoMapping
- RegistrationPropertyMapping rpm = create();
+ RegistrationPropertyMapping rpm = createRegistrationProperty();
// initialize
rpm.initFrom(property);
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2009-11-25 21:32:49 UTC (rev 804)
@@ -23,6 +23,7 @@
package org.gatein.portal.wsrp.state.producer.configuration;
import org.chromattic.api.ChromatticSession;
+import org.exoplatform.container.ExoContainer;
import org.gatein.portal.wsrp.state.JCRPersister;
import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
import org.gatein.portal.wsrp.state.producer.configuration.mapping.ProducerConfigurationMapping;
@@ -42,16 +43,19 @@
*/
public class JCRProducerConfigurationService extends AbstractProducerConfigurationService
{
- private JCRPersister persister = new JCRPersister();
- private static String PRODUCER_CONFIGURATION_PATH = JCRPersister.WSRP_SERVICES_PATH + "producerconfiguration";
+ private JCRPersister persister;
+ private static String PRODUCER_CONFIGURATION_PATH = ProducerConfigurationMapping.NODE_NAME;
private InputStream defaultConfigurationIS;
- public JCRProducerConfigurationService()
+ public JCRProducerConfigurationService(ExoContainer container, String workspaceName, String repositoryName) throws Exception
{
List<Class> mappingClasses = new ArrayList<Class>(3);
Collections.addAll(mappingClasses, ProducerConfigurationMapping.class, RegistrationRequirementsMapping.class,
RegistrationPropertyDescriptionMapping.class);
+
+ persister = new JCRPersister(container, workspaceName, repositoryName);
+ persister.initializeBuilderFor(mappingClasses);
}
/**
Deleted: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/common/wsrp-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/common/wsrp-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/common/wsrp-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<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.gatein.portal.wsrp.ExoKernelIntegration</key>
- <type>org.gatein.portal.wsrp.ExoKernelIntegration</type>
- <init-params>
- <value-param>
- <name>configLocation</name>
- <description>Location of the producer configuration file</description>
- <value>conf/wsrp-producer-config.xml</value>
- </value-param>
- </init-params>
- </component>
-
-</configuration>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -26,7 +26,7 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<import>war:/conf/common/common-configuration.xml</import>
<import>war:/conf/common/portlet-container-configuration.xml</import>
- <import>war:/conf/common/wsrp-configuration.xml</import>
+ <import>war:/conf/wsrp/wsrp-configuration.xml</import>
<import>war:/conf/common/logs-configuration.xml</import>
<import>war:/conf/database/database-configuration.xml</import>
<import>war:/conf/jcr/jcr-configuration.xml</import>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -24,106 +24,110 @@
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.jcr.config.RepositoryServiceConfiguration</key>
- <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>war:/conf/jcr/repository-configuration.xml</value>
- </value-param>
- <properties-param>
- <name>working-conf</name>
- <description>working-conf</description>
- <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="${dialect}"/>
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.RepositoryService</key>
- <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- </component>
-
- <component>
- <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
- <init-params>
- <properties-param>
- <name>locations</name>
- <property name="repository" value="portal-system"/>
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
- <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</key>
- <type>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</type>
- <init-params>
-
- <value-param>
- <name>auto-mix-lockable</name>
- <value>false</value>
- </value-param>
-
- <value-param>
- <name>def-folder-node-type</name>
- <value>nt:folder</value>
- </value-param>
-
- <value-param>
- <name>def-file-node-type</name>
- <value>nt:file</value>
- </value-param>
-
- <value-param>
- <name>def-file-mimetype</name>
- <value>text/plain</value>
- </value-param>
-
- <value-param>
- <name>update-policy</name>
- <value>create-version</value>
- </value-param>
- </init-params>
- </component>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
- <property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <description>Node types configuration file</description>
- <value>jar:/conf/ext-nodetypes-config.xml</value>
- <value>jar:/conf/organization-nodetypes.xml</value>
- <value>jar:/conf/standalone/nodetypes.xml</value>
- <value>jar:/conf/portal/portal-nodetypes.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>war:/conf/jcr/repository-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name"
+ value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="${dialect}"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
+ <init-params>
+ <properties-param>
+ <name>locations</name>
+ <property name="repository" value="portal-system"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</key>
+ <type>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</type>
+ <init-params>
+
+ <value-param>
+ <name>auto-mix-lockable</name>
+ <value>false</value>
+ </value-param>
+
+ <value-param>
+ <name>def-folder-node-type</name>
+ <value>nt:folder</value>
+ </value-param>
+
+ <value-param>
+ <name>def-file-node-type</name>
+ <value>nt:file</value>
+ </value-param>
+
+ <value-param>
+ <name>def-file-mimetype</name>
+ <value>text/plain</value>
+ </value-param>
+
+ <value-param>
+ <name>update-policy</name>
+ <value>create-version</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
+ <property name="wsrp" value="http://www.gatein.org/jcr/wsrp/1.0/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/ext-nodetypes-config.xml</value>
+ <value>jar:/conf/organization-nodetypes.xml</value>
+ <value>jar:/conf/standalone/nodetypes.xml</value>
+ <value>jar:/conf/portal/portal-nodetypes.xml</value>
+ <value>war:/conf/wsrp/consumers-configuration-nodetypes.xml</value>
+ <value>war:/conf/wsrp/producer-configuration-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
</configuration>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -24,105 +24,110 @@
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.jcr.config.RepositoryServiceConfiguration</key>
- <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>war:/conf/jcr/repository-configuration.xml</value>
- </value-param>
- <properties-param>
- <name>working-conf</name>
- <description>working-conf</description>
- <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="hsqldb"/>
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.RepositoryService</key>
- <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- </component>
-
- <component>
- <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
- <init-params>
- <properties-param>
- <name>locations</name>
- <property name="repository" value="portal-system"/>
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
- <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</key>
- <type>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</type>
- <init-params>
-
- <value-param>
- <name>auto-mix-lockable</name>
- <value>false</value>
- </value-param>
-
- <value-param>
- <name>def-folder-node-type</name>
- <value>nt:folder</value>
- </value-param>
-
- <value-param>
- <name>def-file-node-type</name>
- <value>nt:file</value>
- </value-param>
-
- <value-param>
- <name>def-file-mimetype</name>
- <value>text/plain</value>
- </value-param>
-
- <value-param>
- <name>update-policy</name>
- <value>create-version</value>
- </value-param>
- </init-params>
- </component>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
- <property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <description>Node types configuration file</description>
- <value>jar:/conf/ext-nodetypes-config.xml</value>
- <value>jar:/conf/organization-nodetypes.xml</value>
- <value>jar:/conf/standalone/nodetypes.xml</value>
- <value>jar:/conf/portal/portal-nodetypes.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>war:/conf/jcr/repository-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name"
+ value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
+ <init-params>
+ <properties-param>
+ <name>locations</name>
+ <property name="repository" value="portal-system"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</key>
+ <type>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</type>
+ <init-params>
+
+ <value-param>
+ <name>auto-mix-lockable</name>
+ <value>false</value>
+ </value-param>
+
+ <value-param>
+ <name>def-folder-node-type</name>
+ <value>nt:folder</value>
+ </value-param>
+
+ <value-param>
+ <name>def-file-node-type</name>
+ <value>nt:file</value>
+ </value-param>
+
+ <value-param>
+ <name>def-file-mimetype</name>
+ <value>text/plain</value>
+ </value-param>
+
+ <value-param>
+ <name>update-policy</name>
+ <value>create-version</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
+ <property name="wsrp" value="http://www.gatein.org/jcr/wsrp/1.0/"/>
+ <!-- WSRP namespace -->
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/ext-nodetypes-config.xml</value>
+ <value>jar:/conf/organization-nodetypes.xml</value>
+ <value>jar:/conf/standalone/nodetypes.xml</value>
+ <value>jar:/conf/portal/portal-nodetypes.xml</value>
+ <value>war:/conf/wsrp/consumers-configuration-nodetypes.xml</value>
+ <value>war:/conf/wsrp/producer-configuration-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -20,154 +20,214 @@
-->
<repository-service default-repository="repository">
- <repositories>
- <repository name="repository" system-workspace="system" default-workspace="portal-system">
- <security-domain>gatein-domain</security-domain>
- <access-control>optional</access-control>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="system">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="${dialect}"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/system${container.name.suffix}"/>
- </properties>
- <value-storages>
- <value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="../temp/values/system${container.name.suffix}"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="../temp/jcrlucenedb/system${container.name.suffix}"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/system${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- <workspace name="portal-system">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="${dialect}"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/portal-system${container.name.suffix}"/>
- </properties>
- <value-storages>
- <value-storage id="portal-system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="../temp/values/portal-system${container.name.suffix}"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="../temp/jcrlucenedb/portal-system${container.name.suffix}"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/portal-system${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- <workspace name="gadgets">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="${dialect}"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/gadgets${container.name.suffix}"/>
- </properties>
- <value-storages>
- <value-storage id="gadgets" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="../temp/values/gadgets${container.name.suffix}"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="../temp/jcrlucenedb/gadgets${container.name.suffix}"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/gadgets${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
- </repositories>
+ <repositories>
+ <repository name="repository" system-workspace="system" default-workspace="portal-system">
+ <security-domain>gatein-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="${dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/system${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="system"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/system${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/system${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/system${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="portal-system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="${dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/portal-system${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="portal-system"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/portal-system${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/portal-system${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/portal-system${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="gadgets">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="${dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/gadgets${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/gadgets${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/gadgets${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/gadgets${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+
+ <!-- Workspace for WSRP -->
+ <workspace name="wsrp-system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/wsrp${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/wsrp${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/wsrp${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/wsrp${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
</repository-service>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -20,154 +20,213 @@
-->
<repository-service default-repository="repository">
- <repositories>
- <repository name="repository" system-workspace="system" default-workspace="portal-system">
- <security-domain>gatein-domain</security-domain>
- <access-control>optional</access-control>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="system">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="hsqldb"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/system${container.name.suffix}"/>
- </properties>
- <value-storages>
- <value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="../temp/values/system${container.name.suffix}"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="../temp/jcrlucenedb/system${container.name.suffix}"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/system${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- <workspace name="portal-system">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="hsqldb"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/portal-system${container.name.suffix}"/>
- </properties>
- <value-storages>
- <value-storage id="portal-system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="../temp/values/portal-system${container.name.suffix}"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="../temp/jcrlucenedb/portal-system${container.name.suffix}"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/portal-system${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- <workspace name="gadgets">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="hsqldb"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/gadgets${container.name.suffix}"/>
- </properties>
- <value-storages>
- <value-storage id="gadgets" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="../temp/values/gadgets${container.name.suffix}"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="../temp/jcrlucenedb/gadgets${container.name.suffix}"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/gadgets${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
- </repositories>
+ <repositories>
+ <repository name="repository" system-workspace="system" default-workspace="portal-system">
+ <security-domain>gatein-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/system${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="system"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/system${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/system${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/system${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="portal-system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/portal-system${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="portal-system"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/portal-system${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/portal-system${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/portal-system${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="gadgets">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/gadgets${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/gadgets${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/gadgets${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/gadgets${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+
+ <!-- Workspace for WSRP-->
+ <workspace name="wsrp-system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/wsrp${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/wsrp${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="../temp/jcrlucenedb/wsrp${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/wsrp${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
</repository-service>
Added: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml (rev 0)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ 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.
+ -->
+
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+ xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="wsrp:producerinfos" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:producerinfo" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:producerinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:producerinfo" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="producerid" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="cache" requiredType="Integer" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="active" requiredType="boolean" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="endpoint" defaultPrimaryType="" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:endpointinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="registration" defaultPrimaryType="" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:registrationinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:endpointinfo" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="wsdlurl" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationinfo" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="consumername" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="handle" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="state" requiredType="Binary" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:registrationproperty" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:registrationproperty</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationproperty" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="value" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="status" requiredType="Integer" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="description" defaultPrimaryType="" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationpropertydescription" isMixin="false" hasOrderableChildNodes="true"
+ primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="type" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="description" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="hint" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="label" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
\ No newline at end of file
Added: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml (rev 0)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ 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.
+ -->
+
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+ xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="wsrp:producerconfiguration" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="strictmode" requiredType="boolean" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="registrationrequirements" defaultPrimaryType="" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:registrationrequirements</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationrequirements" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="registrationrequired" requiredType="boolean" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="registrationrequiredforfulldescription" requiredType="boolean" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="state" requiredType="Binary" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:registrationpropertydescription" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationproperty" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="value" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="status" requiredType="Integer" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="description" defaultPrimaryType="" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationpropertydescription" isMixin="false" hasOrderableChildNodes="true"
+ primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="type" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="description" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="hint" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="label" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
\ No newline at end of file
Copied: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml (from rev 748, portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/common/wsrp-configuration.xml)
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml (rev 0)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<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.gatein.portal.wsrp.ExoKernelIntegration</key>
+ <type>org.gatein.portal.wsrp.ExoKernelIntegration</type>
+ <init-params>
+ <value-param>
+ <name>producerConfigLocation</name>
+ <description>Location of the default producer configuration file</description>
+ <value>conf/wsrp-producer-config.xml</value>
+ </value-param>
+ <value-param>
+ <name>consumersConfigLocation</name>
+ <description>Location of the default consumers configuration file</description>
+ <value>conf/wsrp-consumers-config.xml</value>
+ </value-param>
+ <value-param>
+ <name>workspaceName</name>
+ <description>Name of the JCR workspace for WSRP persistence</description>
+ <value>wsrp-system</value>
+ </value-param>
+ <value-param>
+ <name>repositoryName</name>
+ <description>Name of the JCR repository for WSRP persistence</description>
+ <value>repository</value>
+ </value-param>
+ </init-params>
+ </component>
+
+</configuration>
15 years, 1 month
gatein SVN: r803 - in portal/trunk: component/application-registry/src/test/java/conf/portal and 12 other directories.
by do-not-reply@jboss.org
Author: bdaw
Date: 2009-11-25 15:49:26 -0500 (Wed, 25 Nov 2009)
New Revision: 803
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/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/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
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
Removed:
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/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
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/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/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/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:
PicketLink IDM 1.0.0.CR1
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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/application-registry/src/test/java/conf/portal/idm-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -25,52 +25,44 @@
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"/>
- <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>
Modified: portal/trunk/component/identity/pom.xml
===================================================================
--- portal/trunk/component/identity/pom.xml 2009-11-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/identity/pom.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/identity/src/main/java/conf/portal/idm-config.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -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 744, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm)
Property changes on: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm
___________________________________________________________________
Name: svn:ignore
+ *.iml
.idea
Deleted: 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/GroupDAOImpl.java 2009-11-20 17:18:44 UTC (rev 744)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -1,459 +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.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.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;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class GroupDAOImpl implements GroupHandler
-{
-
- public static final String GROUP_LABEL = "label";
-
- public static final String GROUP_DESCRIPTION = "description";
-
- private PicketLinkIDMService service_;
-
- private List<GroupEventListener> listeners_;
-
- private PicketLinkIDMOrganizationServiceImpl orgService;
-
- public GroupDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
- {
- service_ = service;
- this.orgService = orgService;
- listeners_ = new ArrayList<GroupEventListener>();
- }
-
- public void addGroupEventListener(GroupEventListener listener)
- {
- listeners_.add(listener);
- }
-
- final public Group createGroupInstance()
- {
- return new GroupImpl();
- }
-
- public void createGroup(Group group, boolean broadcast) throws Exception
- {
- addChild(null, group, broadcast);
- }
-
- public void addChild(Group parent, Group child, boolean broadcast) throws Exception
- {
- org.picketlink.idm.api.Group parentGroup = null;
-
- if (parent != null)
- {
- parentGroup =
- getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
- ((GroupImpl)child).setId(parent.getId() + "/" + child.getGroupName());
-
- }
- else
- {
- ((GroupImpl)child).setId("/" + child.getGroupName());
- }
-
- if (broadcast)
- {
- preSave(child, true);
- }
-
- org.picketlink.idm.api.Group childGroup = persistGroup(child);
-
- if (parentGroup != null)
- {
- getIdentitySession().getRelationshipManager().associateGroups(parentGroup, childGroup);
- ((GroupImpl)child).setParentId(parent.getId());
-
- }
- else
- {
- getIdentitySession().getRelationshipManager().associateGroups(getRootGroup(), childGroup);
- }
-
- if (broadcast)
- {
- postSave(child, true);
- }
-
- }
-
- public void saveGroup(Group group, boolean broadcast) throws Exception
- {
- if (broadcast)
- {
- preSave(group, false);
- }
- persistGroup(group);
- if (broadcast)
- {
- postSave(group, false);
- }
- }
-
- public Group removeGroup(Group group, boolean broadcast) throws Exception
- {
- if (broadcast)
- {
- preDelete(group);
- }
-
- org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(group.getGroupName(), orgService.getGtnGroupType());
-
- if (jbidGroup == null)
- {
- return group;
- }
-
- // MembershipDAOImpl.removeMembershipEntriesOfGroup(group, getIdentitySession());
-
- Collection<org.picketlink.idm.api.Group> oneLevelChilds =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- true, false);
-
- Collection<org.picketlink.idm.api.Group> allChilds =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- true, true);
-
- getIdentitySession().getRelationshipManager().disassociateGroups(jbidGroup, oneLevelChilds);
-
- for (org.picketlink.idm.api.Group child : allChilds)
- {
- //TODO: impl force in IDM
- getIdentitySession().getPersistenceManager().removeGroup(child, true);
- }
-
- getIdentitySession().getPersistenceManager().removeGroup(jbidGroup, true);
-
- if (broadcast)
- {
- postDelete(group);
- }
- return group;
- }
-
- public Collection findGroupByMembership(String userName, String membershipType) throws Exception
- {
- Collection<org.picketlink.idm.api.Role> allRoles =
- getIdentitySession().getRoleManager().findRoles(userName, membershipType);
-
- Set<Group> exoGroups = new HashSet<Group>();
-
- for (org.picketlink.idm.api.Role role : allRoles)
- {
- exoGroups.add(convertGroup(role.getGroup()));
-
- }
-
- return exoGroups;
- }
-
- //
- public Group findGroupById(String groupId) throws Exception
- {
-
- org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
-
- if (jbidGroup == null)
- {
- return null;
- }
-
- return convertGroup(jbidGroup);
- }
-
- public Collection findGroups(Group parent) throws Exception
- {
- org.picketlink.idm.api.Group jbidGroup = null;
-
- if (parent == null)
- {
- jbidGroup = getRootGroup();
- }
- else
- {
- jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
- }
-
- if (jbidGroup == null)
- {
- return Collections.emptyList();
- }
-
- Collection<org.picketlink.idm.api.Group> allGroups =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- true, false);
-
- List<Group> exoGroups = new LinkedList<Group>();
-
- for (org.picketlink.idm.api.Group group : allGroups)
- {
- exoGroups.add(convertGroup(group));
-
- }
-
- return exoGroups;
-
- }
-
- public Collection findGroupsOfUser(String user) throws Exception
- {
-
- if (user == null)
- {
- // julien : integration bug
- // need to look at that later
- //
- // Caused by: java.lang.IllegalArgumentException: User name cannot be null
- // 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.picketlink.idm.api.Group> allGroups =
- getIdentitySession().getRelationshipManager().findRelatedGroups(user, orgService.getGtnGroupType(), null);
-
- List<Group> exoGroups = new LinkedList<Group>();
-
- for (org.picketlink.idm.api.Group group : allGroups)
- {
- exoGroups.add(convertGroup(group));
-
- }
-
- return exoGroups;
- }
-
- public Collection getAllGroups() throws Exception
- {
- Collection<org.picketlink.idm.api.Group> allGroups =
- getIdentitySession().getPersistenceManager().findGroup(orgService.getGtnGroupType());
-
- List<Group> exoGroups = new LinkedList<Group>();
-
- for (org.picketlink.idm.api.Group group : allGroups)
- {
- if (!orgService.getGtnGroupType().equals(orgService.getGtnRootGroupType())
- || !group.getName().equals(orgService.getExoRootGroupName()))
- {
- exoGroups.add(convertGroup(group));
- }
-
- }
-
- return exoGroups;
- }
-
- private void preSave(Group group, boolean isNew) throws Exception
- {
- for (GroupEventListener listener : listeners_)
- {
- listener.preSave(group, isNew);
- }
- }
-
- private void postSave(Group group, boolean isNew) throws Exception
- {
- for (GroupEventListener listener : listeners_)
- {
- listener.postSave(group, isNew);
- }
- }
-
- private void preDelete(Group group) throws Exception
- {
- for (GroupEventListener listener : listeners_)
- {
- listener.preDelete(group);
- }
- }
-
- private void postDelete(Group group) throws Exception
- {
- for (GroupEventListener listener : listeners_)
- {
- listener.postDelete(group);
- }
- }
-
- public Group getGroup(String groupName) throws Exception
- {
- org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
-
- if (jbidGroup == null)
- {
- return null;
- }
-
- return convertGroup(jbidGroup);
-
- }
-
- private Group convertGroup(org.picketlink.idm.api.Group jbidGroup) throws Exception
- {
- Map<String, Attribute> attrs = getIdentitySession().getAttributesManager().getAttributes(jbidGroup);
-
- GroupImpl exoGroup = new GroupImpl(jbidGroup.getName());
-
- if (attrs.containsKey(GROUP_DESCRIPTION))
- {
- exoGroup.setDescription(attrs.get(GROUP_DESCRIPTION).getValue().toString());
- }
- if (attrs.containsKey(GROUP_LABEL))
- {
- exoGroup.setLabel(attrs.get(GROUP_LABEL).getValue().toString());
- }
-
- // Resolve full ID
- String id = getGroupId(jbidGroup.getName());
-
- exoGroup.setId(id);
-
- if (id.length() == jbidGroup.getName().length() + 1)
- {
- exoGroup.setParentId(null);
- }
- else
- {
- exoGroup.setParentId(id.substring(0, id.length() - jbidGroup.getName().length() - 1));
- }
-
- return exoGroup;
- }
-
- private String getGroupId(String groupName) throws Exception
- {
- if (groupName.equals(orgService.getExoRootGroupName()))
- {
- return "";
- }
-
- org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
-
- Collection<org.picketlink.idm.api.Group> parents =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- false, false);
-
- if (parents.size() > 1)
- {
- throw new IllegalStateException("Group has more than one parent: " + groupName);
- }
-
- if (parents.size() == 0)
- {
- //As there is special root group this shouldn't happen:
- throw new IllegalStateException("Group present that is not connected to the root: " + groupName);
-
- // This group is at the root
- //return "/" + groupName;
- }
-
- String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()).getName());
-
- return parentGroupId + "/" + groupName;
-
- }
-
- private org.picketlink.idm.api.Group persistGroup(Group exoGroup) throws Exception
- {
-
- org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(exoGroup.getGroupName(), orgService.getGtnGroupType());
-
- if (jbidGroup == null)
- {
- jbidGroup =
- getIdentitySession().getPersistenceManager().createGroup(exoGroup.getGroupName(),
- orgService.getGtnGroupType());
- }
-
- String description = exoGroup.getDescription();
- String label = exoGroup.getLabel();
-
- List<Attribute> attrsList = new ArrayList<Attribute>();
- if (description != null)
- {
- attrsList.add(new SimpleAttribute(GROUP_DESCRIPTION, description));
- }
-
- if (label != null)
- {
- attrsList.add(new SimpleAttribute(GROUP_LABEL, label));
- }
-
- if (attrsList.size() > 0)
- {
- Attribute[] attrs = new Attribute[attrsList.size()];
-
- attrs = attrsList.toArray(attrs);
-
- getIdentitySession().getAttributesManager().addAttributes(jbidGroup, attrs);
-
- }
-
- return jbidGroup;
- }
-
- private IdentitySession getIdentitySession() throws Exception
- {
- return service_.getIdentitySession();
- }
-
- private org.picketlink.idm.api.Group getRootGroup() throws Exception
- {
- org.picketlink.idm.api.Group rootGroup =
- getIdentitySession().getPersistenceManager().findGroup(orgService.getExoRootGroupName(),
- orgService.getGtnRootGroupType());
-
- if (rootGroup == null)
- {
- rootGroup =
- getIdentitySession().getPersistenceManager().createGroup(orgService.getExoRootGroupName(),
- orgService.getGtnRootGroupType());
- }
-
- return rootGroup;
- }
-}
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java (from rev 744, 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/GroupDAOImpl.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -0,0 +1,459 @@
+/**
+ * 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.services.organization.Group;
+import org.exoplatform.services.organization.GroupEventListener;
+import org.exoplatform.services.organization.GroupHandler;
+import org.exoplatform.services.organization.impl.GroupImpl;
+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;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class GroupDAOImpl implements GroupHandler
+{
+
+ public static final String GROUP_LABEL = "label";
+
+ public static final String GROUP_DESCRIPTION = "description";
+
+ private PicketLinkIDMService service_;
+
+ private List<GroupEventListener> listeners_;
+
+ private PicketLinkIDMOrganizationServiceImpl orgService;
+
+ public GroupDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
+ {
+ service_ = service;
+ this.orgService = orgService;
+ listeners_ = new ArrayList<GroupEventListener>();
+ }
+
+ public void addGroupEventListener(GroupEventListener listener)
+ {
+ listeners_.add(listener);
+ }
+
+ final public Group createGroupInstance()
+ {
+ return new GroupImpl();
+ }
+
+ public void createGroup(Group group, boolean broadcast) throws Exception
+ {
+ addChild(null, group, broadcast);
+ }
+
+ public void addChild(Group parent, Group child, boolean broadcast) throws Exception
+ {
+ org.picketlink.idm.api.Group parentGroup = null;
+
+ if (parent != null)
+ {
+ parentGroup =
+ getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
+ ((GroupImpl)child).setId(parent.getId() + "/" + child.getGroupName());
+
+ }
+ else
+ {
+ ((GroupImpl)child).setId("/" + child.getGroupName());
+ }
+
+ if (broadcast)
+ {
+ preSave(child, true);
+ }
+
+ org.picketlink.idm.api.Group childGroup = persistGroup(child);
+
+ if (parentGroup != null)
+ {
+ getIdentitySession().getRelationshipManager().associateGroups(parentGroup, childGroup);
+ ((GroupImpl)child).setParentId(parent.getId());
+
+ }
+ else
+ {
+ getIdentitySession().getRelationshipManager().associateGroups(getRootGroup(), childGroup);
+ }
+
+ if (broadcast)
+ {
+ postSave(child, true);
+ }
+
+ }
+
+ public void saveGroup(Group group, boolean broadcast) throws Exception
+ {
+ if (broadcast)
+ {
+ preSave(group, false);
+ }
+ persistGroup(group);
+ if (broadcast)
+ {
+ postSave(group, false);
+ }
+ }
+
+ public Group removeGroup(Group group, boolean broadcast) throws Exception
+ {
+ if (broadcast)
+ {
+ preDelete(group);
+ }
+
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(group.getGroupName(), orgService.getGtnGroupType());
+
+ if (jbidGroup == null)
+ {
+ return group;
+ }
+
+ // MembershipDAOImpl.removeMembershipEntriesOfGroup(group, getIdentitySession());
+
+ Collection<org.picketlink.idm.api.Group> oneLevelChilds =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
+ true, false);
+
+ Collection<org.picketlink.idm.api.Group> allChilds =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
+ true, true);
+
+ getIdentitySession().getRelationshipManager().disassociateGroups(jbidGroup, oneLevelChilds);
+
+ for (org.picketlink.idm.api.Group child : allChilds)
+ {
+ //TODO: impl force in IDM
+ getIdentitySession().getPersistenceManager().removeGroup(child, true);
+ }
+
+ getIdentitySession().getPersistenceManager().removeGroup(jbidGroup, true);
+
+ if (broadcast)
+ {
+ postDelete(group);
+ }
+ return group;
+ }
+
+ public Collection findGroupByMembership(String userName, String membershipType) throws Exception
+ {
+ Collection<org.picketlink.idm.api.Role> allRoles =
+ getIdentitySession().getRoleManager().findRoles(userName, membershipType);
+
+ Set<Group> exoGroups = new HashSet<Group>();
+
+ for (org.picketlink.idm.api.Role role : allRoles)
+ {
+ exoGroups.add(convertGroup(role.getGroup()));
+
+ }
+
+ return exoGroups;
+ }
+
+ //
+ public Group findGroupById(String groupId) throws Exception
+ {
+
+ org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
+
+ if (jbidGroup == null)
+ {
+ return null;
+ }
+
+ return convertGroup(jbidGroup);
+ }
+
+ public Collection findGroups(Group parent) throws Exception
+ {
+ org.picketlink.idm.api.Group jbidGroup = null;
+
+ if (parent == null)
+ {
+ jbidGroup = getRootGroup();
+ }
+ else
+ {
+ jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
+ }
+
+ if (jbidGroup == null)
+ {
+ return Collections.emptyList();
+ }
+
+ Collection<org.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
+ true, false);
+
+ List<Group> exoGroups = new LinkedList<Group>();
+
+ for (org.picketlink.idm.api.Group group : allGroups)
+ {
+ exoGroups.add(convertGroup(group));
+
+ }
+
+ return exoGroups;
+
+ }
+
+ public Collection findGroupsOfUser(String user) throws Exception
+ {
+
+ if (user == null)
+ {
+ // julien : integration bug
+ // need to look at that later
+ //
+ // Caused by: java.lang.IllegalArgumentException: User name cannot be null
+ // 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.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getRelationshipManager().findRelatedGroups(user, orgService.getGtnGroupType(), null);
+
+ List<Group> exoGroups = new LinkedList<Group>();
+
+ for (org.picketlink.idm.api.Group group : allGroups)
+ {
+ exoGroups.add(convertGroup(group));
+
+ }
+
+ return exoGroups;
+ }
+
+ public Collection getAllGroups() throws Exception
+ {
+ Collection<org.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getPersistenceManager().findGroup(orgService.getGtnGroupType());
+
+ List<Group> exoGroups = new LinkedList<Group>();
+
+ for (org.picketlink.idm.api.Group group : allGroups)
+ {
+ if (!orgService.getGtnGroupType().equals(orgService.getGtnRootGroupType())
+ || !group.getName().equals(orgService.getExoRootGroupName()))
+ {
+ exoGroups.add(convertGroup(group));
+ }
+
+ }
+
+ return exoGroups;
+ }
+
+ private void preSave(Group group, boolean isNew) throws Exception
+ {
+ for (GroupEventListener listener : listeners_)
+ {
+ listener.preSave(group, isNew);
+ }
+ }
+
+ private void postSave(Group group, boolean isNew) throws Exception
+ {
+ for (GroupEventListener listener : listeners_)
+ {
+ listener.postSave(group, isNew);
+ }
+ }
+
+ private void preDelete(Group group) throws Exception
+ {
+ for (GroupEventListener listener : listeners_)
+ {
+ listener.preDelete(group);
+ }
+ }
+
+ private void postDelete(Group group) throws Exception
+ {
+ for (GroupEventListener listener : listeners_)
+ {
+ listener.postDelete(group);
+ }
+ }
+
+ public Group getGroup(String groupName) throws Exception
+ {
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
+
+ if (jbidGroup == null)
+ {
+ return null;
+ }
+
+ return convertGroup(jbidGroup);
+
+ }
+
+ private Group convertGroup(org.picketlink.idm.api.Group jbidGroup) throws Exception
+ {
+ Map<String, Attribute> attrs = getIdentitySession().getAttributesManager().getAttributes(jbidGroup);
+
+ GroupImpl exoGroup = new GroupImpl(jbidGroup.getName());
+
+ if (attrs.containsKey(GROUP_DESCRIPTION) && attrs.get(GROUP_DESCRIPTION).getValue() != null)
+ {
+ exoGroup.setDescription(attrs.get(GROUP_DESCRIPTION).getValue().toString());
+ }
+ if (attrs.containsKey(GROUP_LABEL) && attrs.get(GROUP_LABEL).getValue() != null)
+ {
+ exoGroup.setLabel(attrs.get(GROUP_LABEL).getValue().toString());
+ }
+
+ // Resolve full ID
+ String id = getGroupId(jbidGroup.getName());
+
+ exoGroup.setId(id);
+
+ if (id.length() == jbidGroup.getName().length() + 1)
+ {
+ exoGroup.setParentId(null);
+ }
+ else
+ {
+ exoGroup.setParentId(id.substring(0, id.length() - jbidGroup.getName().length() - 1));
+ }
+
+ return exoGroup;
+ }
+
+ private String getGroupId(String groupName) throws Exception
+ {
+ if (groupName.equals(orgService.getExoRootGroupName()))
+ {
+ return "";
+ }
+
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
+
+ Collection<org.picketlink.idm.api.Group> parents =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
+ false, false);
+
+ if (parents.size() > 1)
+ {
+ throw new IllegalStateException("Group has more than one parent: " + groupName);
+ }
+
+ if (parents.size() == 0)
+ {
+ //As there is special root group this shouldn't happen:
+ throw new IllegalStateException("Group present that is not connected to the root: " + groupName);
+
+ // This group is at the root
+ //return "/" + groupName;
+ }
+
+ String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()).getName());
+
+ return parentGroupId + "/" + groupName;
+
+ }
+
+ private org.picketlink.idm.api.Group persistGroup(Group exoGroup) throws Exception
+ {
+
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(exoGroup.getGroupName(), orgService.getGtnGroupType());
+
+ if (jbidGroup == null)
+ {
+ jbidGroup =
+ getIdentitySession().getPersistenceManager().createGroup(exoGroup.getGroupName(),
+ orgService.getGtnGroupType());
+ }
+
+ String description = exoGroup.getDescription();
+ String label = exoGroup.getLabel();
+
+ List<Attribute> attrsList = new ArrayList<Attribute>();
+ if (description != null)
+ {
+ attrsList.add(new SimpleAttribute(GROUP_DESCRIPTION, description));
+ }
+
+ if (label != null)
+ {
+ attrsList.add(new SimpleAttribute(GROUP_LABEL, label));
+ }
+
+ if (attrsList.size() > 0)
+ {
+ Attribute[] attrs = new Attribute[attrsList.size()];
+
+ attrs = attrsList.toArray(attrs);
+
+ getIdentitySession().getAttributesManager().addAttributes(jbidGroup, attrs);
+
+ }
+
+ return jbidGroup;
+ }
+
+ private IdentitySession getIdentitySession() throws Exception
+ {
+ return service_.getIdentitySession();
+ }
+
+ private org.picketlink.idm.api.Group getRootGroup() throws Exception
+ {
+ org.picketlink.idm.api.Group rootGroup =
+ getIdentitySession().getPersistenceManager().findGroup(orgService.getExoRootGroupName(),
+ orgService.getGtnRootGroupType());
+
+ if (rootGroup == null)
+ {
+ rootGroup =
+ getIdentitySession().getPersistenceManager().createGroup(orgService.getExoRootGroupName(),
+ orgService.getGtnRootGroupType());
+ }
+
+ return rootGroup;
+ }
+}
Deleted: 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/IDMUserListAccess.java 2009-11-20 17:18:44 UTC (rev 744)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -1,83 +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.idm;
-
-import org.exoplatform.commons.utils.ListAccess;
-import org.exoplatform.services.organization.User;
-import org.picketlink.idm.api.query.UserQuery;
-import org.picketlink.idm.api.query.UserQueryBuilder;
-
-import java.util.List;
-
-public class IDMUserListAccess implements ListAccess<User>
-{
- private final UserDAOImpl userDAO;
-
- private final PicketLinkIDMService idmService;
-
- private final UserQueryBuilder userQueryBuilder;
-
- private final int pageSize;
-
- private final boolean countAll;
-
- public IDMUserListAccess(UserDAOImpl userDAO, PicketLinkIDMService idmService, UserQueryBuilder userQueryBuilder,
- int pageSize, boolean countAll)
- {
- this.userDAO = userDAO;
- this.idmService = idmService;
- this.userQueryBuilder = userQueryBuilder;
- this.pageSize = pageSize;
- this.countAll = countAll;
- }
-
- public User[] load(int index, int length) throws Exception, IllegalArgumentException
- {
- userQueryBuilder.page(index, length);
- UserQuery query = userQueryBuilder.createQuery();
- 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.picketlink.idm.api.User user = users.get(i);
-
- exoUsers[i] = UserDAOImpl.getPopulatedUser(user.getId(), idmService.getIdentitySession());
- }
-
- return exoUsers;
- }
-
- public int getSize() throws Exception
- {
- if (countAll)
- {
- return idmService.getIdentitySession().getPersistenceManager().getUserCount();
- }
- else
- {
- userQueryBuilder.page(0, 0);
- UserQuery query = userQueryBuilder.createQuery();
- return idmService.getIdentitySession().execute(query).size();
- }
-
- }
-}
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java (from rev 744, 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/IDMUserListAccess.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -0,0 +1,83 @@
+/**
+ * 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.commons.utils.ListAccess;
+import org.exoplatform.services.organization.User;
+import org.picketlink.idm.api.query.UserQuery;
+import org.picketlink.idm.api.query.UserQueryBuilder;
+
+import java.util.List;
+
+public class IDMUserListAccess implements ListAccess<User>
+{
+ private final UserDAOImpl userDAO;
+
+ private final PicketLinkIDMService idmService;
+
+ private final UserQueryBuilder userQueryBuilder;
+
+ private final int pageSize;
+
+ private final boolean countAll;
+
+ public IDMUserListAccess(UserDAOImpl userDAO, PicketLinkIDMService idmService, UserQueryBuilder userQueryBuilder,
+ int pageSize, boolean countAll)
+ {
+ this.userDAO = userDAO;
+ this.idmService = idmService;
+ this.userQueryBuilder = userQueryBuilder;
+ this.pageSize = pageSize;
+ this.countAll = countAll;
+ }
+
+ public User[] load(int index, int length) throws Exception, IllegalArgumentException
+ {
+ userQueryBuilder.page(index, length);
+ UserQuery query = userQueryBuilder.createQuery();
+ 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.picketlink.idm.api.User user = users.get(i);
+
+ exoUsers[i] = UserDAOImpl.getPopulatedUser(user.getId(), idmService.getIdentitySession());
+ }
+
+ return exoUsers;
+ }
+
+ public int getSize() throws Exception
+ {
+ if (countAll)
+ {
+ return idmService.getIdentitySession().getPersistenceManager().getUserCount();
+ }
+ else
+ {
+ userQueryBuilder.page(0, 0);
+ UserQuery query = userQueryBuilder.createQuery();
+ return idmService.getIdentitySession().execute(query).size();
+ }
+
+ }
+}
Deleted: 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/MembershipDAOImpl.java 2009-11-20 17:18:44 UTC (rev 744)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -1,394 +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.idm;
-
-import org.exoplatform.commons.utils.ListenerStack;
-import org.exoplatform.services.organization.Group;
-import org.exoplatform.services.organization.Membership;
-import org.exoplatform.services.organization.MembershipEventListener;
-import org.exoplatform.services.organization.MembershipHandler;
-import org.exoplatform.services.organization.MembershipType;
-import org.exoplatform.services.organization.User;
-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;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.naming.InvalidNameException;
-
-/**
- */
-public class MembershipDAOImpl implements MembershipHandler
-{
-
- private PicketLinkIDMService service_;
-
- private List listeners_;
-
- private PicketLinkIDMOrganizationServiceImpl orgService;
-
- public MembershipDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
- {
- service_ = service;
- listeners_ = new ListenerStack(5);
- this.orgService = orgService;
- }
-
- public void addMembershipEventListener(MembershipEventListener listener)
- {
- listeners_.add(listener);
- }
-
- final public Membership createMembershipInstance()
- {
- return new MembershipImpl();
- }
-
- public void createMembership(Membership m, boolean broadcast) throws Exception
- {
-
- if (broadcast)
- {
- preSave(m, true);
- }
-
- saveMembership(m, false);
-
- if (broadcast)
- {
- postSave(m, true);
- }
-
- }
-
- public void linkMembership(User user, Group g, MembershipType mt, boolean broadcast) throws Exception
- {
- if (g == null)
- {
- throw new InvalidNameException("Can not create membership record for " + user.getUserName()
- + " because group is null");
- }
-
- if (mt == null)
- {
- throw new InvalidNameException("Can not create membership record for " + user.getUserName()
- + " because membership type is null");
- }
-
- if (getIdentitySession().getRoleManager().getRoleType(mt.getName()) == null)
- {
- getIdentitySession().getRoleManager().createRoleType(mt.getName());
- }
-
- String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(g.getGroupName(), orgService.getGtnGroupType());
-
- if (getIdentitySession().getRoleManager().hasRole(user.getUserName(), groupId, mt.getName()))
- {
- return;
- }
-
- MembershipImpl membership = new MembershipImpl();
- membership.setMembershipType(mt.getName());
- membership.setUserName(user.getUserName());
- membership.setGroupId(g.getId());
-
- if (broadcast)
- {
- preSave(membership, true);
- }
-
- getIdentitySession().getRoleManager().createRole(mt.getName(), user.getUserName(), groupId);
-
- if (broadcast)
- {
- postSave(membership, true);
- }
-
- }
-
- public void saveMembership(Membership m, boolean broadcast) throws Exception
- {
- String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
- orgService.getGtnGroupType());
-
- if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
- {
- return;
- }
-
- if (broadcast)
- {
- preSave(m, false);
- }
-
- getIdentitySession().getRoleManager().createRole(m.getMembershipType(), m.getUserName(), groupId);
-
- if (broadcast)
- {
- postSave(m, false);
- }
- }
-
- public Membership removeMembership(String id, boolean broadcast) throws Exception
- {
-
- Membership m = new MembershipImpl(id);
-
- String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
- orgService.getGtnGroupType());
-
- if (!getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
- {
- return m;
- }
-
- if (broadcast)
- {
- preDelete(m);
- }
-
- getIdentitySession().getRoleManager().removeRole(m.getMembershipType(), m.getUserName(), groupId);
-
- if (broadcast)
- {
- postDelete(m);
- }
- return m;
- }
-
- public Collection removeMembershipByUser(String userName, boolean broadcast) throws Exception
- {
-
- Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(userName, null);
-
- //TODO: Exo UI has hardcoded casts to List
- List<Membership> memberships = new LinkedList<Membership>();
-
- for (Role role : roles)
- {
- MembershipImpl m = new MembershipImpl();
- Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
- m.setGroupId(g.getId());
- m.setUserName(role.getUser().getId());
- m.setMembershipType(role.getRoleType().getName());
- memberships.add(m);
-
- if (broadcast)
- {
- preDelete(m);
- }
-
- getIdentitySession().getRoleManager().removeRole(role);
-
- if (broadcast)
- {
- postDelete(m);
- }
-
- }
-
- return memberships;
-
- }
-
- public Membership findMembershipByUserGroupAndType(String userName, String groupId, String type) throws Exception
- {
- String gid =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
- orgService.getGtnGroupType());
-
- Role role = getIdentitySession().getRoleManager().getRole(type, userName, gid);
-
- if (role == null)
- {
- return null;
- }
-
- MembershipImpl m = new MembershipImpl();
- m.setGroupId(groupId);
- m.setUserName(userName);
- m.setMembershipType(type);
-
- return m;
- }
-
- public Collection findMembershipsByUserAndGroup(String userName, String groupId) throws Exception
- {
- if (userName == null)
- {
- // julien fix : if user name is null, need to check if we do need to return a special group
- return Collections.emptyList();
- }
-
- String gid =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
- orgService.getGtnGroupType());
-
- Collection<RoleType> roleTypes = getIdentitySession().getRoleManager().findRoleTypes(userName, gid, null);
-
- //TODO: Exo UI has hardcoded casts to List
- List<Membership> memberships = new LinkedList<Membership>();
-
- for (RoleType roleType : roleTypes)
- {
- MembershipImpl m = new MembershipImpl();
- m.setGroupId(groupId);
- m.setUserName(userName);
- m.setMembershipType(roleType.getName());
- memberships.add(m);
- }
-
- return memberships;
- }
-
- public Collection findMembershipsByUser(String userName) throws Exception
- {
- Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(userName, null);
-
- //TODO: Exo UI has hardcoded casts to List
- List<Membership> memberships = new LinkedList<Membership>();
-
- for (Role role : roles)
- {
- MembershipImpl m = new MembershipImpl();
- Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
- m.setGroupId(g.getId());
- m.setUserName(role.getUser().getId());
- m.setMembershipType(role.getRoleType().getName());
- memberships.add(m);
- }
-
- return memberships;
- }
-
- static void removeMembershipEntriesOfGroup(PicketLinkIDMOrganizationServiceImpl orgService, Group group,
- IdentitySession session) throws Exception
- {
- String gid = session.getPersistenceManager().createGroupKey(group.getGroupName(), orgService.getGtnGroupType());
-
- Collection<Role> roles = session.getRoleManager().findRoles(gid, null);
-
- for (Role role : roles)
- {
- session.getRoleManager().removeRole(role);
- }
- }
-
- public Collection findMembershipsByGroup(Group group) throws Exception
- {
- return findMembershipsByGroupId(group.getId());
- }
-
- public Collection findMembershipsByGroupId(String groupId) throws Exception
- {
- String gid =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
- orgService.getGtnGroupType());
-
- Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(gid, null);
-
- //TODO: Exo UI has hardcoded casts to List
- List<Membership> memberships = new LinkedList<Membership>();
-
- for (Role role : roles)
- {
- MembershipImpl m = new MembershipImpl();
- Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
- m.setGroupId(g.getId());
- m.setUserName(role.getUser().getId());
- m.setMembershipType(role.getRoleType().getName());
- memberships.add(m);
- }
-
- return memberships;
-
- }
-
- public Membership findMembership(String id) throws Exception
- {
- Membership m = new MembershipImpl(id);
-
- String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
- orgService.getGtnGroupType());
-
- if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
- {
- return m;
- }
-
- return null;
- }
-
- private void preSave(Membership membership, boolean isNew) throws Exception
- {
- for (int i = 0; i < listeners_.size(); i++)
- {
- MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
- listener.preSave(membership, isNew);
- }
- }
-
- private void postSave(Membership membership, boolean isNew) throws Exception
- {
- for (int i = 0; i < listeners_.size(); i++)
- {
- MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
- listener.postSave(membership, isNew);
- }
- }
-
- private void preDelete(Membership membership) throws Exception
- {
- for (int i = 0; i < listeners_.size(); i++)
- {
- MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
- listener.preDelete(membership);
- }
- }
-
- private void postDelete(Membership membership) throws Exception
- {
- for (int i = 0; i < listeners_.size(); i++)
- {
- MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
- listener.postDelete(membership);
- }
- }
-
- private IdentitySession getIdentitySession() throws Exception
- {
- return service_.getIdentitySession();
- }
-
- private String getGroupNameFromId(String groupId)
- {
- String[] ids = groupId.split("/");
-
- return ids[ids.length - 1];
- }
-}
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java (from rev 744, 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/MembershipDAOImpl.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -0,0 +1,394 @@
+/**
+ * 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.commons.utils.ListenerStack;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.Membership;
+import org.exoplatform.services.organization.MembershipEventListener;
+import org.exoplatform.services.organization.MembershipHandler;
+import org.exoplatform.services.organization.MembershipType;
+import org.exoplatform.services.organization.User;
+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;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.naming.InvalidNameException;
+
+/**
+ */
+public class MembershipDAOImpl implements MembershipHandler
+{
+
+ private PicketLinkIDMService service_;
+
+ private List listeners_;
+
+ private PicketLinkIDMOrganizationServiceImpl orgService;
+
+ public MembershipDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
+ {
+ service_ = service;
+ listeners_ = new ListenerStack(5);
+ this.orgService = orgService;
+ }
+
+ public void addMembershipEventListener(MembershipEventListener listener)
+ {
+ listeners_.add(listener);
+ }
+
+ final public Membership createMembershipInstance()
+ {
+ return new MembershipImpl();
+ }
+
+ public void createMembership(Membership m, boolean broadcast) throws Exception
+ {
+
+ if (broadcast)
+ {
+ preSave(m, true);
+ }
+
+ saveMembership(m, false);
+
+ if (broadcast)
+ {
+ postSave(m, true);
+ }
+
+ }
+
+ public void linkMembership(User user, Group g, MembershipType mt, boolean broadcast) throws Exception
+ {
+ if (g == null)
+ {
+ throw new InvalidNameException("Can not create membership record for " + user.getUserName()
+ + " because group is null");
+ }
+
+ if (mt == null)
+ {
+ throw new InvalidNameException("Can not create membership record for " + user.getUserName()
+ + " because membership type is null");
+ }
+
+ if (getIdentitySession().getRoleManager().getRoleType(mt.getName()) == null)
+ {
+ getIdentitySession().getRoleManager().createRoleType(mt.getName());
+ }
+
+ String groupId =
+ getIdentitySession().getPersistenceManager().createGroupKey(g.getGroupName(), orgService.getGtnGroupType());
+
+ if (getIdentitySession().getRoleManager().hasRole(user.getUserName(), groupId, mt.getName()))
+ {
+ return;
+ }
+
+ MembershipImpl membership = new MembershipImpl();
+ membership.setMembershipType(mt.getName());
+ membership.setUserName(user.getUserName());
+ membership.setGroupId(g.getId());
+
+ if (broadcast)
+ {
+ preSave(membership, true);
+ }
+
+ getIdentitySession().getRoleManager().createRole(mt.getName(), user.getUserName(), groupId);
+
+ if (broadcast)
+ {
+ postSave(membership, true);
+ }
+
+ }
+
+ public void saveMembership(Membership m, boolean broadcast) throws Exception
+ {
+ String groupId =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
+
+ if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
+ {
+ return;
+ }
+
+ if (broadcast)
+ {
+ preSave(m, false);
+ }
+
+ getIdentitySession().getRoleManager().createRole(m.getMembershipType(), m.getUserName(), groupId);
+
+ if (broadcast)
+ {
+ postSave(m, false);
+ }
+ }
+
+ public Membership removeMembership(String id, boolean broadcast) throws Exception
+ {
+
+ Membership m = new MembershipImpl(id);
+
+ String groupId =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
+
+ if (!getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
+ {
+ return m;
+ }
+
+ if (broadcast)
+ {
+ preDelete(m);
+ }
+
+ getIdentitySession().getRoleManager().removeRole(m.getMembershipType(), m.getUserName(), groupId);
+
+ if (broadcast)
+ {
+ postDelete(m);
+ }
+ return m;
+ }
+
+ public Collection removeMembershipByUser(String userName, boolean broadcast) throws Exception
+ {
+
+ Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(userName, null);
+
+ //TODO: Exo UI has hardcoded casts to List
+ List<Membership> memberships = new LinkedList<Membership>();
+
+ for (Role role : roles)
+ {
+ MembershipImpl m = new MembershipImpl();
+ Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
+ m.setGroupId(g.getId());
+ m.setUserName(role.getUser().getId());
+ m.setMembershipType(role.getRoleType().getName());
+ memberships.add(m);
+
+ if (broadcast)
+ {
+ preDelete(m);
+ }
+
+ getIdentitySession().getRoleManager().removeRole(role);
+
+ if (broadcast)
+ {
+ postDelete(m);
+ }
+
+ }
+
+ return memberships;
+
+ }
+
+ public Membership findMembershipByUserGroupAndType(String userName, String groupId, String type) throws Exception
+ {
+ String gid =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
+
+ Role role = getIdentitySession().getRoleManager().getRole(type, userName, gid);
+
+ if (role == null)
+ {
+ return null;
+ }
+
+ MembershipImpl m = new MembershipImpl();
+ m.setGroupId(groupId);
+ m.setUserName(userName);
+ m.setMembershipType(type);
+
+ return m;
+ }
+
+ public Collection findMembershipsByUserAndGroup(String userName, String groupId) throws Exception
+ {
+ if (userName == null)
+ {
+ // julien fix : if user name is null, need to check if we do need to return a special group
+ return Collections.emptyList();
+ }
+
+ String gid =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
+
+ Collection<RoleType> roleTypes = getIdentitySession().getRoleManager().findRoleTypes(userName, gid, null);
+
+ //TODO: Exo UI has hardcoded casts to List
+ List<Membership> memberships = new LinkedList<Membership>();
+
+ for (RoleType roleType : roleTypes)
+ {
+ MembershipImpl m = new MembershipImpl();
+ m.setGroupId(groupId);
+ m.setUserName(userName);
+ m.setMembershipType(roleType.getName());
+ memberships.add(m);
+ }
+
+ return memberships;
+ }
+
+ public Collection findMembershipsByUser(String userName) throws Exception
+ {
+ Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(userName, null);
+
+ //TODO: Exo UI has hardcoded casts to List
+ List<Membership> memberships = new LinkedList<Membership>();
+
+ for (Role role : roles)
+ {
+ MembershipImpl m = new MembershipImpl();
+ Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
+ m.setGroupId(g.getId());
+ m.setUserName(role.getUser().getId());
+ m.setMembershipType(role.getRoleType().getName());
+ memberships.add(m);
+ }
+
+ return memberships;
+ }
+
+ static void removeMembershipEntriesOfGroup(PicketLinkIDMOrganizationServiceImpl orgService, Group group,
+ IdentitySession session) throws Exception
+ {
+ String gid = session.getPersistenceManager().createGroupKey(group.getGroupName(), orgService.getGtnGroupType());
+
+ Collection<Role> roles = session.getRoleManager().findRoles(gid, null);
+
+ for (Role role : roles)
+ {
+ session.getRoleManager().removeRole(role);
+ }
+ }
+
+ public Collection findMembershipsByGroup(Group group) throws Exception
+ {
+ return findMembershipsByGroupId(group.getId());
+ }
+
+ public Collection findMembershipsByGroupId(String groupId) throws Exception
+ {
+ String gid =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
+
+ Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(gid, null);
+
+ //TODO: Exo UI has hardcoded casts to List
+ List<Membership> memberships = new LinkedList<Membership>();
+
+ for (Role role : roles)
+ {
+ MembershipImpl m = new MembershipImpl();
+ Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
+ m.setGroupId(g.getId());
+ m.setUserName(role.getUser().getId());
+ m.setMembershipType(role.getRoleType().getName());
+ memberships.add(m);
+ }
+
+ return memberships;
+
+ }
+
+ public Membership findMembership(String id) throws Exception
+ {
+ Membership m = new MembershipImpl(id);
+
+ String groupId =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
+
+ if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
+ {
+ return m;
+ }
+
+ return null;
+ }
+
+ private void preSave(Membership membership, boolean isNew) throws Exception
+ {
+ for (int i = 0; i < listeners_.size(); i++)
+ {
+ MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
+ listener.preSave(membership, isNew);
+ }
+ }
+
+ private void postSave(Membership membership, boolean isNew) throws Exception
+ {
+ for (int i = 0; i < listeners_.size(); i++)
+ {
+ MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
+ listener.postSave(membership, isNew);
+ }
+ }
+
+ private void preDelete(Membership membership) throws Exception
+ {
+ for (int i = 0; i < listeners_.size(); i++)
+ {
+ MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
+ listener.preDelete(membership);
+ }
+ }
+
+ private void postDelete(Membership membership) throws Exception
+ {
+ for (int i = 0; i < listeners_.size(); i++)
+ {
+ MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
+ listener.postDelete(membership);
+ }
+ }
+
+ private IdentitySession getIdentitySession() throws Exception
+ {
+ return service_.getIdentitySession();
+ }
+
+ private String getGroupNameFromId(String groupId)
+ {
+ String[] ids = groupId.split("/");
+
+ return ids[ids.length - 1];
+ }
+}
Deleted: 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/MembershipImpl.java 2009-11-20 17:18:44 UTC (rev 744)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -1,106 +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.idm;
-
-import org.exoplatform.services.organization.Membership;
-
-public class MembershipImpl implements Membership
-{
- private String membershipType = "member";
-
- private String userName = null;
-
- private String groupId = null;
-
- public MembershipImpl()
- {
- }
-
- public MembershipImpl(String id)
- {
- String[] fields = id.split(":");
-
- // Id can be pure "//" in some cases
- if (fields[0] != null)
- {
- membershipType = fields[0];
- }
- if (fields[1] != null)
- {
- userName = fields[1];
- }
- if (fields[2] != null)
- {
- groupId = fields[2];
- }
- }
-
- public String getId()
- {
- StringBuffer id = new StringBuffer();
-
- if (membershipType != null)
- {
- id.append(membershipType);
- }
- id.append(":");
- if (userName != null)
- {
- id.append(userName);
- }
- id.append(":");
- if (groupId != null)
- {
- id.append(groupId);
- }
-
- return id.toString();
- }
-
- public String getMembershipType()
- {
- return membershipType;
- }
-
- public void setMembershipType(String membershipType)
- {
- this.membershipType = membershipType;
- }
-
- public String getUserName()
- {
- return userName;
- }
-
- public void setUserName(String userName)
- {
- this.userName = userName;
- }
-
- public String getGroupId()
- {
- return groupId;
- }
-
- public void setGroupId(String groupId)
- {
- this.groupId = groupId;
- }
-}
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java (from rev 744, 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/MembershipImpl.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -0,0 +1,106 @@
+/**
+ * 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.services.organization.Membership;
+
+public class MembershipImpl implements Membership
+{
+ private String membershipType = "member";
+
+ private String userName = null;
+
+ private String groupId = null;
+
+ public MembershipImpl()
+ {
+ }
+
+ public MembershipImpl(String id)
+ {
+ String[] fields = id.split(":");
+
+ // Id can be pure "//" in some cases
+ if (fields[0] != null)
+ {
+ membershipType = fields[0];
+ }
+ if (fields[1] != null)
+ {
+ userName = fields[1];
+ }
+ if (fields[2] != null)
+ {
+ groupId = fields[2];
+ }
+ }
+
+ public String getId()
+ {
+ StringBuffer id = new StringBuffer();
+
+ if (membershipType != null)
+ {
+ id.append(membershipType);
+ }
+ id.append(":");
+ if (userName != null)
+ {
+ id.append(userName);
+ }
+ id.append(":");
+ if (groupId != null)
+ {
+ id.append(groupId);
+ }
+
+ return id.toString();
+ }
+
+ public String getMembershipType()
+ {
+ return membershipType;
+ }
+
+ public void setMembershipType(String membershipType)
+ {
+ this.membershipType = membershipType;
+ }
+
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ public void setUserName(String userName)
+ {
+ this.userName = userName;
+ }
+
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ public void setGroupId(String groupId)
+ {
+ this.groupId = groupId;
+ }
+}
Deleted: 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/MembershipTypeDAOImpl.java 2009-11-20 17:18:44 UTC (rev 744)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -1,178 +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.idm;
-
-import org.exoplatform.services.organization.MembershipType;
-import org.exoplatform.services.organization.MembershipTypeHandler;
-import org.exoplatform.services.organization.impl.MembershipTypeImpl;
-import org.picketlink.idm.api.IdentitySession;
-import org.picketlink.idm.api.RoleType;
-
-import java.text.DateFormat;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-public class MembershipTypeDAOImpl implements MembershipTypeHandler
-{
-
- public static final String MEMBERSHIP_DESCRIPTION = "description";
-
- public static final String MEMBERSHIP_OWNER = "owner";
-
- public static final String MEMBERSHIP_CREATE_DATE = "create_date";
-
- public static final String MEMBERSHIP_MODIFIED_DATE = "modified_date";
-
- public static final DateFormat dateFormat = DateFormat.getInstance();
-
- private PicketLinkIDMService service_;
-
- private PicketLinkIDMOrganizationServiceImpl orgService;
-
- public MembershipTypeDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
- {
- service_ = service;
- this.orgService = orgService;
- }
-
- final public MembershipType createMembershipTypeInstance()
- {
- return new MembershipTypeImpl();
- }
-
- public MembershipType createMembershipType(MembershipType mt, boolean broadcast) throws Exception
- {
- Date now = new Date();
- mt.setCreatedDate(now);
- mt.setModifiedDate(now);
-
- getIdentitySession().getRoleManager().createRoleType(mt.getName());
- updateMembershipType(mt);
-
- return mt;
- }
-
- public MembershipType saveMembershipType(MembershipType mt, boolean broadcast) throws Exception
- {
- Date now = new Date();
- mt.setModifiedDate(now);
- updateMembershipType(mt);
- return mt;
- }
-
- public MembershipType findMembershipType(String name) throws Exception
- {
- RoleType rt = getIdentitySession().getRoleManager().getRoleType(name);
-
- MembershipType mt = null;
-
- if (rt != null)
- {
- mt = new MembershipTypeImpl(name, null, null);
- populateMembershipType(mt);
- }
-
- return mt;
- }
-
- public MembershipType removeMembershipType(String name, boolean broadcast) throws Exception
- {
- MembershipType mt = findMembershipType(name);
-
- if (mt != null)
- {
- getIdentitySession().getRoleManager().removeRoleType(mt.getName());
- }
-
- return mt;
-
- }
-
- public Collection findMembershipTypes() throws Exception
- {
-
- Collection<RoleType> rts = getIdentitySession().getRoleManager().findRoleTypes();
-
- List<MembershipType> mts = new LinkedList<MembershipType>();
-
- for (RoleType rt : rts)
- {
- MembershipType mt = new MembershipTypeImpl(rt.getName(), null, null);
- populateMembershipType(mt);
- mts.add(mt);
- }
-
- return mts;
- }
-
- private IdentitySession getIdentitySession() throws Exception
- {
- return service_.getIdentitySession();
- }
-
- private void updateMembershipType(MembershipType mt) throws Exception
- {
-
- RoleType rt = getIdentitySession().getRoleManager().getRoleType(mt.getName());
-
- Map<String, String> props = new HashMap<String, String>();
-
- props.put(MEMBERSHIP_DESCRIPTION, mt.getDescription());
- props.put(MEMBERSHIP_CREATE_DATE, mt.getCreatedDate() == null ? null : dateFormat.format(mt.getCreatedDate()));
- props
- .put(MEMBERSHIP_MODIFIED_DATE, mt.getModifiedDate() == null ? null : dateFormat.format(mt.getModifiedDate()));
- props.put(MEMBERSHIP_OWNER, mt.getOwner());
-
- getIdentitySession().getRoleManager().setProperties(rt, props);
-
- return;
-
- }
-
- private void populateMembershipType(MembershipType mt) throws Exception
- {
- RoleType rt = getIdentitySession().getRoleManager().getRoleType(mt.getName());
-
- Map<String, String> props = getIdentitySession().getRoleManager().getProperties(rt);
-
- mt.setDescription(props.get(MEMBERSHIP_DESCRIPTION));
- mt.setOwner(props.get(MEMBERSHIP_OWNER));
-
- String cd = props.get(MEMBERSHIP_CREATE_DATE);
- String md = props.get(MEMBERSHIP_MODIFIED_DATE);
-
- if (cd != null)
- {
- mt.setCreatedDate(dateFormat.parse(cd));
- }
-
- if (md != null)
- {
- mt.setModifiedDate(dateFormat.parse(md));
- }
-
- return;
- }
-
-}
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java (from rev 744, 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/MembershipTypeDAOImpl.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -0,0 +1,178 @@
+/**
+ * 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.services.organization.MembershipType;
+import org.exoplatform.services.organization.MembershipTypeHandler;
+import org.exoplatform.services.organization.impl.MembershipTypeImpl;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.RoleType;
+
+import java.text.DateFormat;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+public class MembershipTypeDAOImpl implements MembershipTypeHandler
+{
+
+ public static final String MEMBERSHIP_DESCRIPTION = "description";
+
+ public static final String MEMBERSHIP_OWNER = "owner";
+
+ public static final String MEMBERSHIP_CREATE_DATE = "create_date";
+
+ public static final String MEMBERSHIP_MODIFIED_DATE = "modified_date";
+
+ public static final DateFormat dateFormat = DateFormat.getInstance();
+
+ private PicketLinkIDMService service_;
+
+ private PicketLinkIDMOrganizationServiceImpl orgService;
+
+ public MembershipTypeDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
+ {
+ service_ = service;
+ this.orgService = orgService;
+ }
+
+ final public MembershipType createMembershipTypeInstance()
+ {
+ return new MembershipTypeImpl();
+ }
+
+ public MembershipType createMembershipType(MembershipType mt, boolean broadcast) throws Exception
+ {
+ Date now = new Date();
+ mt.setCreatedDate(now);
+ mt.setModifiedDate(now);
+
+ getIdentitySession().getRoleManager().createRoleType(mt.getName());
+ updateMembershipType(mt);
+
+ return mt;
+ }
+
+ public MembershipType saveMembershipType(MembershipType mt, boolean broadcast) throws Exception
+ {
+ Date now = new Date();
+ mt.setModifiedDate(now);
+ updateMembershipType(mt);
+ return mt;
+ }
+
+ public MembershipType findMembershipType(String name) throws Exception
+ {
+ RoleType rt = getIdentitySession().getRoleManager().getRoleType(name);
+
+ MembershipType mt = null;
+
+ if (rt != null)
+ {
+ mt = new MembershipTypeImpl(name, null, null);
+ populateMembershipType(mt);
+ }
+
+ return mt;
+ }
+
+ public MembershipType removeMembershipType(String name, boolean broadcast) throws Exception
+ {
+ MembershipType mt = findMembershipType(name);
+
+ if (mt != null)
+ {
+ getIdentitySession().getRoleManager().removeRoleType(mt.getName());
+ }
+
+ return mt;
+
+ }
+
+ public Collection findMembershipTypes() throws Exception
+ {
+
+ Collection<RoleType> rts = getIdentitySession().getRoleManager().findRoleTypes();
+
+ List<MembershipType> mts = new LinkedList<MembershipType>();
+
+ for (RoleType rt : rts)
+ {
+ MembershipType mt = new MembershipTypeImpl(rt.getName(), null, null);
+ populateMembershipType(mt);
+ mts.add(mt);
+ }
+
+ return mts;
+ }
+
+ private IdentitySession getIdentitySession() throws Exception
+ {
+ return service_.getIdentitySession();
+ }
+
+ private void updateMembershipType(MembershipType mt) throws Exception
+ {
+
+ RoleType rt = getIdentitySession().getRoleManager().getRoleType(mt.getName());
+
+ Map<String, String> props = new HashMap<String, String>();
+
+ props.put(MEMBERSHIP_DESCRIPTION, mt.getDescription());
+ props.put(MEMBERSHIP_CREATE_DATE, mt.getCreatedDate() == null ? null : dateFormat.format(mt.getCreatedDate()));
+ props
+ .put(MEMBERSHIP_MODIFIED_DATE, mt.getModifiedDate() == null ? null : dateFormat.format(mt.getModifiedDate()));
+ props.put(MEMBERSHIP_OWNER, mt.getOwner());
+
+ getIdentitySession().getRoleManager().setProperties(rt, props);
+
+ return;
+
+ }
+
+ private void populateMembershipType(MembershipType mt) throws Exception
+ {
+ RoleType rt = getIdentitySession().getRoleManager().getRoleType(mt.getName());
+
+ Map<String, String> props = getIdentitySession().getRoleManager().getProperties(rt);
+
+ mt.setDescription(props.get(MEMBERSHIP_DESCRIPTION));
+ mt.setOwner(props.get(MEMBERSHIP_OWNER));
+
+ String cd = props.get(MEMBERSHIP_CREATE_DATE);
+ String md = props.get(MEMBERSHIP_MODIFIED_DATE);
+
+ if (cd != null)
+ {
+ mt.setCreatedDate(dateFormat.parse(cd));
+ }
+
+ if (md != null)
+ {
+ mt.setModifiedDate(dateFormat.parse(md));
+ }
+
+ return;
+ }
+
+}
Deleted: 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/PicketLinkIDMOrganizationServiceImpl.java 2009-11-20 17:18:44 UTC (rev 744)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -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.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/PicketLinkIDMOrganizationServiceImpl.java (from rev 744, 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/PicketLinkIDMOrganizationServiceImpl.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -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;
+ }
+}
Deleted: 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/PicketLinkIDMService.java 2009-11-20 17:18:44 UTC (rev 744)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -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.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/PicketLinkIDMService.java (from rev 744, 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/PicketLinkIDMService.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -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;
+
+}
Deleted: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2009-11-20 17:18:44 UTC (rev 744)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -1,149 +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.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);
- }
-}
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java (from rev 744, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.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-25 20:49:26 UTC (rev 803)
@@ -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);
+ }
+}
Deleted: 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/UserDAOImpl.java 2009-11-20 17:18:44 UTC (rev 744)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -1,420 +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.idm;
-
-import org.exoplatform.commons.utils.LazyPageList;
-import org.exoplatform.services.cache.CacheService;
-import org.exoplatform.services.cache.ExoCache;
-import org.exoplatform.services.organization.Query;
-import org.exoplatform.services.organization.User;
-import org.exoplatform.services.organization.UserEventListener;
-import org.exoplatform.services.organization.UserHandler;
-import org.exoplatform.services.organization.impl.UserImpl;
-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;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- */
-public class UserDAOImpl implements UserHandler
-{
-
- private final PicketLinkIDMService service_;
-
- private ExoCache cache_;
-
- private List<UserEventListener> listeners_ = new ArrayList<UserEventListener>(3);
-
- public static final String USER_PASSWORD = "password";
-
- public static final String USER_FIRST_NAME = "firstName";
-
- public static final String USER_LAST_NAME = "lastName";
-
- public static final String USER_EMAIL = "email";
-
- public static final String USER_CREATED_DATE = "createdDate";
-
- public static final String USER_LAST_LOGIN_TIME = "lastLoginTime";
-
- public static final String USER_ORGANIZATION_ID = "organizationId";
-
- public static final Set<String> USER_NON_PROFILE_KEYS;
-
- public static final DateFormat dateFormat = DateFormat.getInstance();
-
- private PicketLinkIDMOrganizationServiceImpl orgService;
-
- static
- {
- Set<String> keys = new HashSet<String>();
- keys.add(USER_PASSWORD);
- keys.add(USER_FIRST_NAME);
- keys.add(USER_LAST_NAME);
- keys.add(USER_EMAIL);
- keys.add(USER_CREATED_DATE);
- keys.add(USER_LAST_LOGIN_TIME);
- keys.add(USER_ORGANIZATION_ID);
-
- USER_NON_PROFILE_KEYS = Collections.unmodifiableSet(keys);
- }
-
- public UserDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService idmService, CacheService cservice)
- throws Exception
- {
- service_ = idmService;
- cache_ = cservice.getCacheInstance(UserImpl.class.getName());
- this.orgService = orgService;
- }
-
- final public List getUserEventListeners()
- {
- return listeners_;
- }
-
- public void addUserEventListener(UserEventListener listener)
- {
- listeners_.add(listener);
- }
-
- public User createUserInstance()
- {
- return new UserImpl();
- }
-
- public User createUserInstance(String username)
- {
- return new UserImpl(username);
- }
-
- public void createUser(User user, boolean broadcast) throws Exception
- {
- IdentitySession session = service_.getIdentitySession();
- if (broadcast)
- {
- preSave(user, true);
- }
-
- session.getPersistenceManager().createUser(user.getUserName());
-
- persistUserInfo(user, session);
-
- if (broadcast)
- {
- postSave(user, true);
- }
-
- }
-
- public void saveUser(User user, boolean broadcast) throws Exception
- {
- IdentitySession session = service_.getIdentitySession();
- if (broadcast)
- {
- preSave(user, false);
- }
-
- persistUserInfo(user, session);
-
- if (broadcast)
- {
- postSave(user, false);
- }
- cache_.put(user.getUserName(), user);
- }
-
- public User removeUser(String userName, boolean broadcast) throws Exception
- {
- IdentitySession session = service_.getIdentitySession();
-
- org.picketlink.idm.api.User foundUser = session.getPersistenceManager().findUser(userName);
-
- if (foundUser == null)
- {
- cache_.remove(userName);
- 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)
- {
- preDelete(exoUser);
- }
-
- session.getPersistenceManager().removeUser(foundUser, true);
- if (broadcast)
- {
- postDelete(exoUser);
- }
- cache_.remove(userName);
- return exoUser;
- }
-
- //
- public User findUserByName(String userName) throws Exception
- {
- IdentitySession session = service_.getIdentitySession();
-
- User user = (User)cache_.get(userName);
- if (user != null)
- {
- return user;
- }
- user = getPopulatedUser(userName, session);
- if (user != null)
- {
- cache_.put(userName, user);
- }
- return user;
- }
-
- public LazyPageList getUserPageList(int pageSize) throws Exception
- {
- UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
-
- return new LazyPageList(new IDMUserListAccess(this, service_, qb, pageSize, true), pageSize);
- }
-
- //
- public boolean authenticate(String username, String password) throws Exception
- {
- User user = findUserByName(username);
- if (user == null)
- {
- return false;
- }
-
- boolean authenticated = false;
-
- if (orgService.isPasswordAsAttribute())
- {
- authenticated = user.getPassword().equals(password);
- }
- else
- {
- IdentitySession session = service_.getIdentitySession();
- org.picketlink.idm.api.User idmUser = session.getPersistenceManager().findUser(user.getUserName());
-
- authenticated = session.getAttributesManager().validatePassword(idmUser, password);
- }
-
- if (authenticated)
- {
- UserImpl userImpl = (UserImpl)user;
- userImpl.setLastLoginTime(Calendar.getInstance().getTime());
- saveUser(userImpl, false);
- }
- return authenticated;
- }
-
- public LazyPageList findUsers(Query q) throws Exception
- {
-
- UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
-
- if (q.getUserName() != null)
- {
- qb.idFilter(q.getUserName());
- }
- if (q.getEmail() != null)
- {
- qb.attributeValuesFilter(UserDAOImpl.USER_EMAIL, new String[]{q.getEmail()});
- }
- if (q.getFirstName() != null)
- {
- qb.attributeValuesFilter(UserDAOImpl.USER_FIRST_NAME, new String[]{q.getFirstName()});
- }
-
- //TODO: from/to login date
-
- if (q.getLastName() != null)
- {
- qb.attributeValuesFilter(UserDAOImpl.USER_LAST_NAME, new String[]{q.getLastName()});
- }
-
- return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
- }
-
- //
- public LazyPageList findUsersByGroup(String groupId) throws Exception
- {
- UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
-
- org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
-
- qb.addRelatedGroup(jbidGroup);
-
- return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
- }
-
- //
-
- private void preSave(User user, boolean isNew) throws Exception
- {
- for (UserEventListener listener : listeners_)
- {
- listener.preSave(user, isNew);
- }
- }
-
- private void postSave(User user, boolean isNew) throws Exception
- {
- for (UserEventListener listener : listeners_)
- {
- listener.postSave(user, isNew);
- }
- }
-
- private void preDelete(User user) throws Exception
- {
- for (UserEventListener listener : listeners_)
- {
- listener.preDelete(user);
- }
- }
-
- private void postDelete(User user) throws Exception
- {
- for (UserEventListener listener : listeners_)
- {
- listener.postDelete(user);
- }
- }
-
- public void persistUserInfo(User user, IdentitySession session) throws Exception
- {
-
- AttributesManager am = session.getAttributesManager();
-
- ArrayList attributes = new ArrayList();
-
- if (user.getCreatedDate() != null)
- {
- attributes.add(new SimpleAttribute(USER_CREATED_DATE, dateFormat.format(user.getCreatedDate())));
- }
- if (user.getLastLoginTime() != null)
- {
- attributes.add(new SimpleAttribute(USER_LAST_LOGIN_TIME, dateFormat.format(user.getLastLoginTime())));
- }
- if (user.getEmail() != null)
- {
- attributes.add(new SimpleAttribute(USER_EMAIL, user.getEmail()));
- }
- if (user.getFirstName() != null)
- {
- attributes.add(new SimpleAttribute(USER_FIRST_NAME, user.getFirstName()));
- }
- if (user.getLastName() != null)
- {
- attributes.add(new SimpleAttribute(USER_LAST_NAME, user.getLastName()));
- }
- if (user.getOrganizationId() != null)
- {
- attributes.add(new SimpleAttribute(USER_ORGANIZATION_ID, user.getOrganizationId()));
- }
- if (user.getPassword() != null)
- {
- if (orgService.isPasswordAsAttribute())
- {
- attributes.add(new SimpleAttribute(USER_PASSWORD, user.getPassword()));
- }
- else
- {
- am.updatePassword(session.getPersistenceManager().findUser(user.getUserName()), user.getPassword());
- }
- }
-
- Attribute[] attrs = new Attribute[attributes.size()];
- attrs = (Attribute[])attributes.toArray(attrs);
- am.addAttributes(user.getUserName(), attrs);
- }
-
- public static User getPopulatedUser(String userName, IdentitySession session) throws Exception
- {
-
- if (session.getPersistenceManager().findUser(userName) == null)
- {
- return null;
- }
-
- AttributesManager am = session.getAttributesManager();
-
- Map<String, Attribute> attrs = am.getAttributes(userName);
-
- User user = new UserImpl(userName);
-
- if (attrs == null)
- {
-
- return user;
- }
- else
- {
- if (attrs.containsKey(USER_CREATED_DATE))
- {
- user.setCreatedDate(dateFormat.parse(attrs.get(USER_CREATED_DATE).getValue().toString()));
- }
- if (attrs.containsKey(USER_EMAIL))
- {
- user.setEmail(attrs.get(USER_EMAIL).getValue().toString());
- }
- if (attrs.containsKey(USER_FIRST_NAME))
- {
- user.setFirstName(attrs.get(USER_FIRST_NAME).getValue().toString());
- }
- if (attrs.containsKey(USER_LAST_LOGIN_TIME))
- {
- user.setLastLoginTime(dateFormat.parse(attrs.get(USER_LAST_LOGIN_TIME).getValue().toString()));
- }
- if (attrs.containsKey(USER_LAST_NAME))
- {
- user.setLastName(attrs.get(USER_LAST_NAME).getValue().toString());
- }
- if (attrs.containsKey(USER_ORGANIZATION_ID))
- {
- user.setOrganizationId(attrs.get(USER_ORGANIZATION_ID).getValue().toString());
- }
- if (attrs.containsKey(USER_PASSWORD))
- {
- user.setPassword(attrs.get(USER_PASSWORD).getValue().toString());
- }
- }
-
- return user;
-
- }
-
-}
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java (from rev 744, 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/UserDAOImpl.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -0,0 +1,420 @@
+/**
+ * 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.commons.utils.LazyPageList;
+import org.exoplatform.services.cache.CacheService;
+import org.exoplatform.services.cache.ExoCache;
+import org.exoplatform.services.organization.Query;
+import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.UserEventListener;
+import org.exoplatform.services.organization.UserHandler;
+import org.exoplatform.services.organization.impl.UserImpl;
+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;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ */
+public class UserDAOImpl implements UserHandler
+{
+
+ private final PicketLinkIDMService service_;
+
+ private ExoCache cache_;
+
+ private List<UserEventListener> listeners_ = new ArrayList<UserEventListener>(3);
+
+ public static final String USER_PASSWORD = "password";
+
+ public static final String USER_FIRST_NAME = "firstName";
+
+ public static final String USER_LAST_NAME = "lastName";
+
+ public static final String USER_EMAIL = "email";
+
+ public static final String USER_CREATED_DATE = "createdDate";
+
+ public static final String USER_LAST_LOGIN_TIME = "lastLoginTime";
+
+ public static final String USER_ORGANIZATION_ID = "organizationId";
+
+ public static final Set<String> USER_NON_PROFILE_KEYS;
+
+ public static final DateFormat dateFormat = DateFormat.getInstance();
+
+ private PicketLinkIDMOrganizationServiceImpl orgService;
+
+ static
+ {
+ Set<String> keys = new HashSet<String>();
+ keys.add(USER_PASSWORD);
+ keys.add(USER_FIRST_NAME);
+ keys.add(USER_LAST_NAME);
+ keys.add(USER_EMAIL);
+ keys.add(USER_CREATED_DATE);
+ keys.add(USER_LAST_LOGIN_TIME);
+ keys.add(USER_ORGANIZATION_ID);
+
+ USER_NON_PROFILE_KEYS = Collections.unmodifiableSet(keys);
+ }
+
+ public UserDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService idmService, CacheService cservice)
+ throws Exception
+ {
+ service_ = idmService;
+ cache_ = cservice.getCacheInstance(UserImpl.class.getName());
+ this.orgService = orgService;
+ }
+
+ final public List getUserEventListeners()
+ {
+ return listeners_;
+ }
+
+ public void addUserEventListener(UserEventListener listener)
+ {
+ listeners_.add(listener);
+ }
+
+ public User createUserInstance()
+ {
+ return new UserImpl();
+ }
+
+ public User createUserInstance(String username)
+ {
+ return new UserImpl(username);
+ }
+
+ public void createUser(User user, boolean broadcast) throws Exception
+ {
+ IdentitySession session = service_.getIdentitySession();
+ if (broadcast)
+ {
+ preSave(user, true);
+ }
+
+ session.getPersistenceManager().createUser(user.getUserName());
+
+ persistUserInfo(user, session);
+
+ if (broadcast)
+ {
+ postSave(user, true);
+ }
+
+ }
+
+ public void saveUser(User user, boolean broadcast) throws Exception
+ {
+ IdentitySession session = service_.getIdentitySession();
+ if (broadcast)
+ {
+ preSave(user, false);
+ }
+
+ persistUserInfo(user, session);
+
+ if (broadcast)
+ {
+ postSave(user, false);
+ }
+ cache_.put(user.getUserName(), user);
+ }
+
+ public User removeUser(String userName, boolean broadcast) throws Exception
+ {
+ IdentitySession session = service_.getIdentitySession();
+
+ org.picketlink.idm.api.User foundUser = session.getPersistenceManager().findUser(userName);
+
+ if (foundUser == null)
+ {
+ cache_.remove(userName);
+ 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)
+ {
+ preDelete(exoUser);
+ }
+
+ session.getPersistenceManager().removeUser(foundUser, true);
+ if (broadcast)
+ {
+ postDelete(exoUser);
+ }
+ cache_.remove(userName);
+ return exoUser;
+ }
+
+ //
+ public User findUserByName(String userName) throws Exception
+ {
+ IdentitySession session = service_.getIdentitySession();
+
+ User user = (User)cache_.get(userName);
+ if (user != null)
+ {
+ return user;
+ }
+ user = getPopulatedUser(userName, session);
+ if (user != null)
+ {
+ cache_.put(userName, user);
+ }
+ return user;
+ }
+
+ public LazyPageList getUserPageList(int pageSize) throws Exception
+ {
+ UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
+
+ return new LazyPageList(new IDMUserListAccess(this, service_, qb, pageSize, true), pageSize);
+ }
+
+ //
+ public boolean authenticate(String username, String password) throws Exception
+ {
+ User user = findUserByName(username);
+ if (user == null)
+ {
+ return false;
+ }
+
+ boolean authenticated = false;
+
+ if (orgService.isPasswordAsAttribute())
+ {
+ authenticated = user.getPassword().equals(password);
+ }
+ else
+ {
+ IdentitySession session = service_.getIdentitySession();
+ org.picketlink.idm.api.User idmUser = session.getPersistenceManager().findUser(user.getUserName());
+
+ authenticated = session.getAttributesManager().validatePassword(idmUser, password);
+ }
+
+ if (authenticated)
+ {
+ UserImpl userImpl = (UserImpl)user;
+ userImpl.setLastLoginTime(Calendar.getInstance().getTime());
+ saveUser(userImpl, false);
+ }
+ return authenticated;
+ }
+
+ public LazyPageList findUsers(Query q) throws Exception
+ {
+
+ UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
+
+ if (q.getUserName() != null)
+ {
+ qb.idFilter(q.getUserName());
+ }
+ if (q.getEmail() != null)
+ {
+ qb.attributeValuesFilter(UserDAOImpl.USER_EMAIL, new String[]{q.getEmail()});
+ }
+ if (q.getFirstName() != null)
+ {
+ qb.attributeValuesFilter(UserDAOImpl.USER_FIRST_NAME, new String[]{q.getFirstName()});
+ }
+
+ //TODO: from/to login date
+
+ if (q.getLastName() != null)
+ {
+ qb.attributeValuesFilter(UserDAOImpl.USER_LAST_NAME, new String[]{q.getLastName()});
+ }
+
+ return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
+ }
+
+ //
+ public LazyPageList findUsersByGroup(String groupId) throws Exception
+ {
+ UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
+
+ org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
+
+ qb.addRelatedGroup(jbidGroup);
+
+ return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
+ }
+
+ //
+
+ private void preSave(User user, boolean isNew) throws Exception
+ {
+ for (UserEventListener listener : listeners_)
+ {
+ listener.preSave(user, isNew);
+ }
+ }
+
+ private void postSave(User user, boolean isNew) throws Exception
+ {
+ for (UserEventListener listener : listeners_)
+ {
+ listener.postSave(user, isNew);
+ }
+ }
+
+ private void preDelete(User user) throws Exception
+ {
+ for (UserEventListener listener : listeners_)
+ {
+ listener.preDelete(user);
+ }
+ }
+
+ private void postDelete(User user) throws Exception
+ {
+ for (UserEventListener listener : listeners_)
+ {
+ listener.postDelete(user);
+ }
+ }
+
+ public void persistUserInfo(User user, IdentitySession session) throws Exception
+ {
+
+ AttributesManager am = session.getAttributesManager();
+
+ ArrayList attributes = new ArrayList();
+
+ if (user.getCreatedDate() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_CREATED_DATE, dateFormat.format(user.getCreatedDate())));
+ }
+ if (user.getLastLoginTime() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_LAST_LOGIN_TIME, dateFormat.format(user.getLastLoginTime())));
+ }
+ if (user.getEmail() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_EMAIL, user.getEmail()));
+ }
+ if (user.getFirstName() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_FIRST_NAME, user.getFirstName()));
+ }
+ if (user.getLastName() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_LAST_NAME, user.getLastName()));
+ }
+ if (user.getOrganizationId() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_ORGANIZATION_ID, user.getOrganizationId()));
+ }
+ if (user.getPassword() != null)
+ {
+ if (orgService.isPasswordAsAttribute())
+ {
+ attributes.add(new SimpleAttribute(USER_PASSWORD, user.getPassword()));
+ }
+ else
+ {
+ am.updatePassword(session.getPersistenceManager().findUser(user.getUserName()), user.getPassword());
+ }
+ }
+
+ Attribute[] attrs = new Attribute[attributes.size()];
+ attrs = (Attribute[])attributes.toArray(attrs);
+ am.addAttributes(user.getUserName(), attrs);
+ }
+
+ public static User getPopulatedUser(String userName, IdentitySession session) throws Exception
+ {
+
+ if (session.getPersistenceManager().findUser(userName) == null)
+ {
+ return null;
+ }
+
+ AttributesManager am = session.getAttributesManager();
+
+ Map<String, Attribute> attrs = am.getAttributes(userName);
+
+ User user = new UserImpl(userName);
+
+ if (attrs == null)
+ {
+
+ return user;
+ }
+ else
+ {
+ if (attrs.containsKey(USER_CREATED_DATE))
+ {
+ user.setCreatedDate(dateFormat.parse(attrs.get(USER_CREATED_DATE).getValue().toString()));
+ }
+ if (attrs.containsKey(USER_EMAIL))
+ {
+ user.setEmail(attrs.get(USER_EMAIL).getValue().toString());
+ }
+ if (attrs.containsKey(USER_FIRST_NAME))
+ {
+ user.setFirstName(attrs.get(USER_FIRST_NAME).getValue().toString());
+ }
+ if (attrs.containsKey(USER_LAST_LOGIN_TIME))
+ {
+ user.setLastLoginTime(dateFormat.parse(attrs.get(USER_LAST_LOGIN_TIME).getValue().toString()));
+ }
+ if (attrs.containsKey(USER_LAST_NAME))
+ {
+ user.setLastName(attrs.get(USER_LAST_NAME).getValue().toString());
+ }
+ if (attrs.containsKey(USER_ORGANIZATION_ID))
+ {
+ user.setOrganizationId(attrs.get(USER_ORGANIZATION_ID).getValue().toString());
+ }
+ if (attrs.containsKey(USER_PASSWORD))
+ {
+ user.setPassword(attrs.get(USER_PASSWORD).getValue().toString());
+ }
+ }
+
+ return user;
+
+ }
+
+}
Deleted: 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/idm/UserProfileDAOImpl.java 2009-11-20 17:18:44 UTC (rev 744)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -1,286 +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.idm;
-
-import org.exoplatform.services.cache.CacheService;
-import org.exoplatform.services.cache.ExoCache;
-import org.exoplatform.services.organization.UserProfile;
-import org.exoplatform.services.organization.UserProfileEventListener;
-import org.exoplatform.services.organization.UserProfileHandler;
-import org.exoplatform.services.organization.impl.UserProfileImpl;
-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;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class UserProfileDAOImpl implements UserProfileHandler
-{
-
- static private UserProfile NOT_FOUND = new UserProfileImpl();
-
- private PicketLinkIDMService service_;
-
- private ExoCache cache_;
-
- private List<UserProfileEventListener> listeners_;
-
- private PicketLinkIDMOrganizationServiceImpl orgService;
-
- public UserProfileDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service, CacheService cservice)
- throws Exception
- {
- service_ = service;
- cache_ = cservice.getCacheInstance(getClass().getName());
- listeners_ = new ArrayList<UserProfileEventListener>(3);
- this.orgService = orgService;
- }
-
- public void addUserProfileEventListener(UserProfileEventListener listener)
- {
- listeners_.add(listener);
- }
-
- final public UserProfile createUserProfileInstance()
- {
- return new UserProfileImpl();
- }
-
- public UserProfile createUserProfileInstance(String userName)
- {
- return new UserProfileImpl(userName);
- }
-
- // void createUserProfileEntry(UserProfile up, IdentitySession session) throws Exception
- // {
- // UserProfileData upd = new UserProfileData();
- // upd.setUserProfile(up);
- // session.save(upd);
- // session.flush();
- // cache_.remove(up.getUserName());
- // }
-
- public void saveUserProfile(UserProfile profile, boolean broadcast) throws Exception
- {
-
- if (broadcast)
- {
- preSave(profile, true);
- }
-
- setProfile(profile.getUserName(), profile);
-
- if (broadcast)
- {
- postSave(profile, true);
- }
-
- cache_.put(profile.getUserName(), profile);
-
- }
-
- public UserProfile removeUserProfile(String userName, boolean broadcast) throws Exception
- {
- UserProfile profile = getProfile(userName);
-
- if (profile != null)
- {
- try
- {
- if (broadcast)
- {
- preDelete(profile);
- }
-
- removeProfile(userName, profile);
-
- if (broadcast)
- {
- postDelete(profile);
- }
- cache_.remove(userName);
- return profile;
- }
- catch (Exception exp)
- {
- return null;
- }
- }
- cache_.remove(userName);
- return null;
- }
-
- public UserProfile findUserProfileByName(String userName) throws Exception
- {
-
- org.picketlink.idm.api.User foundUser = getIdentitySession().getPersistenceManager().findUser(userName);
-
- if (foundUser == null)
- {
- return null;
- }
-
- UserProfile up = (UserProfile)cache_.get(userName);
- if (up == null)
- {
- up = getProfile(userName);
- }
-
- //
- if (up == null)
- {
- up = NOT_FOUND;
- }
-
- //
- cache_.put(userName, up);
-
- // Just to avoid to return a shared object between many threads
- // that would not be thread safe nor corrct
- if (up == NOT_FOUND)
- {
- // julien : integration bug fix
- // Return an empty profile to avoid NPE in portal
- // Should clarify what do do (maybe portal should care about returned value)
- UserProfileImpl profile = new UserProfileImpl();
- profile.setUserName(userName);
- return profile;
- }
- else
- {
- return up;
- }
- }
-
- public Collection findUserProfiles() throws Exception
- {
- return null;
- }
-
- private void preSave(UserProfile profile, boolean isNew) throws Exception
- {
- for (UserProfileEventListener listener : listeners_)
- {
- listener.preSave(profile, isNew);
- }
- }
-
- private void postSave(UserProfile profile, boolean isNew) throws Exception
- {
- for (UserProfileEventListener listener : listeners_)
- {
- listener.postSave(profile, isNew);
- }
- }
-
- private void preDelete(UserProfile profile) throws Exception
- {
- for (UserProfileEventListener listener : listeners_)
- {
- listener.preDelete(profile);
- }
- }
-
- private void postDelete(UserProfile profile) throws Exception
- {
- for (UserProfileEventListener listener : listeners_)
- {
- listener.postDelete(profile);
- }
- }
-
- public UserProfile getProfile(String userName) throws Exception
- {
- if (getIdentitySession().getPersistenceManager().findUser(userName) == null)
- {
- return null;
- }
-
- Map<String, Attribute> attrs = getIdentitySession().getAttributesManager().getAttributes(userName);
-
- if (attrs == null || attrs.isEmpty())
- {
- return null;
- }
-
- Map<String, String> filteredAttrs = new HashMap<String, String>();
-
- for (String key : attrs.keySet())
- {
- // Check if attribute is part of User interface data
- if (!UserDAOImpl.USER_NON_PROFILE_KEYS.contains(key))
- {
- filteredAttrs.put(key, attrs.get(key).getValue().toString());
- }
-
- }
-
- if (filteredAttrs.isEmpty())
- {
- return null;
- }
-
- UserProfile profile = new UserProfileImpl(userName, filteredAttrs);
-
- return profile;
-
- }
-
- public void setProfile(String userName, UserProfile profile) throws Exception
- {
-
- Map<String, String> profileAttrs = profile.getUserInfoMap();
-
- Set<Attribute> attrs = new HashSet<Attribute>();
-
- for (Map.Entry<String, String> entry : profileAttrs.entrySet())
- {
- attrs.add(new SimpleAttribute(entry.getKey(), entry.getValue()));
- }
-
- Attribute[] attrArray = new Attribute[attrs.size()];
- attrArray = attrs.toArray(attrArray);
-
- getIdentitySession().getAttributesManager().updateAttributes(userName, attrArray);
-
- }
-
- public void removeProfile(String userName, UserProfile profile) throws Exception
- {
- Map<String, String> profileAttrs = profile.getUserInfoMap();
-
- String[] attrKeys = new String[profileAttrs.keySet().size()];
-
- attrKeys = profileAttrs.keySet().toArray(attrKeys);
-
- getIdentitySession().getAttributesManager().removeAttributes(userName, attrKeys);
- }
-
- private IdentitySession getIdentitySession() throws Exception
- {
- return service_.getIdentitySession();
- }
-}
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java (from rev 744, 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/idm/UserProfileDAOImpl.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -0,0 +1,286 @@
+/**
+ * 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.services.cache.CacheService;
+import org.exoplatform.services.cache.ExoCache;
+import org.exoplatform.services.organization.UserProfile;
+import org.exoplatform.services.organization.UserProfileEventListener;
+import org.exoplatform.services.organization.UserProfileHandler;
+import org.exoplatform.services.organization.impl.UserProfileImpl;
+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;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class UserProfileDAOImpl implements UserProfileHandler
+{
+
+ static private UserProfile NOT_FOUND = new UserProfileImpl();
+
+ private PicketLinkIDMService service_;
+
+ private ExoCache cache_;
+
+ private List<UserProfileEventListener> listeners_;
+
+ private PicketLinkIDMOrganizationServiceImpl orgService;
+
+ public UserProfileDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service, CacheService cservice)
+ throws Exception
+ {
+ service_ = service;
+ cache_ = cservice.getCacheInstance(getClass().getName());
+ listeners_ = new ArrayList<UserProfileEventListener>(3);
+ this.orgService = orgService;
+ }
+
+ public void addUserProfileEventListener(UserProfileEventListener listener)
+ {
+ listeners_.add(listener);
+ }
+
+ final public UserProfile createUserProfileInstance()
+ {
+ return new UserProfileImpl();
+ }
+
+ public UserProfile createUserProfileInstance(String userName)
+ {
+ return new UserProfileImpl(userName);
+ }
+
+ // void createUserProfileEntry(UserProfile up, IdentitySession session) throws Exception
+ // {
+ // UserProfileData upd = new UserProfileData();
+ // upd.setUserProfile(up);
+ // session.save(upd);
+ // session.flush();
+ // cache_.remove(up.getUserName());
+ // }
+
+ public void saveUserProfile(UserProfile profile, boolean broadcast) throws Exception
+ {
+
+ if (broadcast)
+ {
+ preSave(profile, true);
+ }
+
+ setProfile(profile.getUserName(), profile);
+
+ if (broadcast)
+ {
+ postSave(profile, true);
+ }
+
+ cache_.put(profile.getUserName(), profile);
+
+ }
+
+ public UserProfile removeUserProfile(String userName, boolean broadcast) throws Exception
+ {
+ UserProfile profile = getProfile(userName);
+
+ if (profile != null)
+ {
+ try
+ {
+ if (broadcast)
+ {
+ preDelete(profile);
+ }
+
+ removeProfile(userName, profile);
+
+ if (broadcast)
+ {
+ postDelete(profile);
+ }
+ cache_.remove(userName);
+ return profile;
+ }
+ catch (Exception exp)
+ {
+ return null;
+ }
+ }
+ cache_.remove(userName);
+ return null;
+ }
+
+ public UserProfile findUserProfileByName(String userName) throws Exception
+ {
+
+ org.picketlink.idm.api.User foundUser = getIdentitySession().getPersistenceManager().findUser(userName);
+
+ if (foundUser == null)
+ {
+ return null;
+ }
+
+ UserProfile up = (UserProfile)cache_.get(userName);
+ if (up == null)
+ {
+ up = getProfile(userName);
+ }
+
+ //
+ if (up == null)
+ {
+ up = NOT_FOUND;
+ }
+
+ //
+ cache_.put(userName, up);
+
+ // Just to avoid to return a shared object between many threads
+ // that would not be thread safe nor corrct
+ if (up == NOT_FOUND)
+ {
+ // julien : integration bug fix
+ // Return an empty profile to avoid NPE in portal
+ // Should clarify what do do (maybe portal should care about returned value)
+ UserProfileImpl profile = new UserProfileImpl();
+ profile.setUserName(userName);
+ return profile;
+ }
+ else
+ {
+ return up;
+ }
+ }
+
+ public Collection findUserProfiles() throws Exception
+ {
+ return null;
+ }
+
+ private void preSave(UserProfile profile, boolean isNew) throws Exception
+ {
+ for (UserProfileEventListener listener : listeners_)
+ {
+ listener.preSave(profile, isNew);
+ }
+ }
+
+ private void postSave(UserProfile profile, boolean isNew) throws Exception
+ {
+ for (UserProfileEventListener listener : listeners_)
+ {
+ listener.postSave(profile, isNew);
+ }
+ }
+
+ private void preDelete(UserProfile profile) throws Exception
+ {
+ for (UserProfileEventListener listener : listeners_)
+ {
+ listener.preDelete(profile);
+ }
+ }
+
+ private void postDelete(UserProfile profile) throws Exception
+ {
+ for (UserProfileEventListener listener : listeners_)
+ {
+ listener.postDelete(profile);
+ }
+ }
+
+ public UserProfile getProfile(String userName) throws Exception
+ {
+ if (getIdentitySession().getPersistenceManager().findUser(userName) == null)
+ {
+ return null;
+ }
+
+ Map<String, Attribute> attrs = getIdentitySession().getAttributesManager().getAttributes(userName);
+
+ if (attrs == null || attrs.isEmpty())
+ {
+ return null;
+ }
+
+ Map<String, String> filteredAttrs = new HashMap<String, String>();
+
+ for (String key : attrs.keySet())
+ {
+ // Check if attribute is part of User interface data
+ if (!UserDAOImpl.USER_NON_PROFILE_KEYS.contains(key))
+ {
+ filteredAttrs.put(key, attrs.get(key).getValue().toString());
+ }
+
+ }
+
+ if (filteredAttrs.isEmpty())
+ {
+ return null;
+ }
+
+ UserProfile profile = new UserProfileImpl(userName, filteredAttrs);
+
+ return profile;
+
+ }
+
+ public void setProfile(String userName, UserProfile profile) throws Exception
+ {
+
+ Map<String, String> profileAttrs = profile.getUserInfoMap();
+
+ Set<Attribute> attrs = new HashSet<Attribute>();
+
+ for (Map.Entry<String, String> entry : profileAttrs.entrySet())
+ {
+ attrs.add(new SimpleAttribute(entry.getKey(), entry.getValue()));
+ }
+
+ Attribute[] attrArray = new Attribute[attrs.size()];
+ attrArray = attrs.toArray(attrArray);
+
+ getIdentitySession().getAttributesManager().updateAttributes(userName, attrArray);
+
+ }
+
+ public void removeProfile(String userName, UserProfile profile) throws Exception
+ {
+ Map<String, String> profileAttrs = profile.getUserInfoMap();
+
+ String[] attrKeys = new String[profileAttrs.keySet().size()];
+
+ attrKeys = profileAttrs.keySet().toArray(attrKeys);
+
+ getIdentitySession().getAttributesManager().removeAttributes(userName, attrKeys);
+ }
+
+ private IdentitySession getIdentitySession() throws Exception
+ {
+ return service_.getIdentitySession();
+ }
+}
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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -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="0"/>
+ <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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/portal/pom.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -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>
<dependency>
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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -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="false"/>
+ <property name="hibernate.cache.use_query_cache" value="false"/>
+ <property name="hibernate.jdbc.batch_size" value="0"/>
+ <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:target/temp/data/exodb"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/portal/src/test/java/conf/portal/idm-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -25,52 +25,19 @@
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 +48,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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-25 20:49:26 UTC (rev 803)
@@ -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/packaging/module/src/main/javascript/portal.packaging.module.js
===================================================================
--- portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-25 19:11:07 UTC (rev 802)
+++ portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-25 20:49:26 UTC (rev 803)
@@ -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}";
@@ -120,12 +120,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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/pom.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -46,7 +46,7 @@
<org.gatein.common.version>2.0.0-CR02</org.gatein.common.version>
<org.gatein.wci.version>2.0.0-CR01</org.gatein.wci.version>
<org.gatein.pc.version>2.1.0-CR01</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-Beta10</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -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-25 19:11:07 UTC (rev 802)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2009-11-25 20:49:26 UTC (rev 803)
@@ -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>
15 years, 1 month
gatein SVN: r802 - portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/deployers/jbossweb.deployer.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-25 14:11:07 -0500 (Wed, 25 Nov 2009)
New Revision: 802
Modified:
portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/deployers/jbossweb.deployer/web.xml
Log:
GTNPORTAL-300: Portlet Taglib not correctly set
Modified: portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/deployers/jbossweb.deployer/web.xml
===================================================================
--- portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/deployers/jbossweb.deployer/web.xml 2009-11-25 15:54:36 UTC (rev 801)
+++ portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/deployers/jbossweb.deployer/web.xml 2009-11-25 19:11:07 UTC (rev 802)
@@ -304,7 +304,7 @@
<init-param>
<description>Portlet standard tlds</description>
<param-name>tagLibJar2</param-name>
- <param-value>../../deploy/gatein.ear/pc-portlet-(a){org.gatein.pc.version}.jar</param-value>
+ <param-value>../../deploy/gatein.ear/lib/pc-portlet-(a){org.gatein.pc.version}.jar</param-value>
</init-param>
15 years, 1 month
gatein SVN: r801 - portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-25 10:54:36 -0500 (Wed, 25 Nov 2009)
New Revision: 801
Modified:
portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
Log:
fix what I broke
Modified: portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
===================================================================
--- portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2009-11-25 15:54:22 UTC (rev 800)
+++ portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2009-11-25 15:54:36 UTC (rev 801)
@@ -21,6 +21,7 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.services.resources.ResourceBundleService;
import org.gatein.pc.api.PortletInvoker;
import org.gatein.pc.bridge.BridgeInterceptor;
import org.gatein.pc.federation.FederatingPortletInvoker;
@@ -57,13 +58,20 @@
/** Exo Context */
private final ExoContainer container;
+ /** DO NOT REMOVE ME, OTHERWISE YOU'LL BREAK THINGS. */
+ private final ResourceBundleService resourceBundleService;
+
/**
* We enforce the dependency with the ResourceBundleService since it must be stared before the
* <code>portletApplicationRegistry</code>
+ *
+ * @param context the exo container context
+ * @param resourceBundleService the resource bundle service that is here for the sake of creating a dependency
*/
- public ExoKernelIntegration(ExoContainerContext context)
+ public ExoKernelIntegration(ExoContainerContext context, ResourceBundleService resourceBundleService)
{
this.container = context.getContainer();
+ this.resourceBundleService = resourceBundleService;
}
public void start()
15 years, 1 month
gatein SVN: r799 - portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2009-11-25 04:08:54 -0500 (Wed, 25 Nov 2009)
New Revision: 799
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
Log:
GTNPORTAL-289: Keep position of PortalComposer
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2009-11-25 08:46:03 UTC (rev 798)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2009-11-25 09:08:54 UTC (rev 799)
@@ -543,7 +543,6 @@
var middleBlock = eXo.core.DOMUtil.findFirstChildByClass(portalComposer, "div", "MLPortalComposer");
var bottomBlock = eXo.core.DOMUtil.findFirstChildByClass(portalComposer, "div", "BLPortalComposer");
var fakeBottom = eXo.core.DOMUtil.findFirstChildByClass(portalComposer, "div", "Bottom");
- var params;
if(middleBlock && middleBlock.style.display != "none") {
middleBlock.style.display = "none";
bottomBlock.style.display = "none";
@@ -556,7 +555,7 @@
eXo.core.DOMUtil.replaceClass(clickedEle, "CollapseIcon", "ExpandIcon");
}
var requestStr = eXo.env.server.createPortalURL(portalComposer.id, "Toggle", true);
- ajaxGet(requestStr);
+ ajaxAsyncGetRequest(requestStr);
};
UIPortal.prototype.collapseExpand = function(element) {
15 years, 1 month
gatein SVN: r798 - portal/trunk/server/jboss.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-25 03:46:03 -0500 (Wed, 25 Nov 2009)
New Revision: 798
Removed:
portal/trunk/server/jboss/patch/
Modified:
portal/trunk/server/jboss/pom.xml
Log:
Removed the untested (probably broken) SAR packaging for JBoss AS
Modified: portal/trunk/server/jboss/pom.xml
===================================================================
--- portal/trunk/server/jboss/pom.xml 2009-11-25 08:00:02 UTC (rev 797)
+++ portal/trunk/server/jboss/pom.xml 2009-11-25 08:46:03 UTC (rev 798)
@@ -35,7 +35,6 @@
<name>GateIn Portal Server JBoss</name>
<modules>
- <module>patch</module>
<module>patch-ear</module>
<module>plugin</module>
</modules>
15 years, 1 month
gatein SVN: r797 - portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component.
by do-not-reply@jboss.org
Author: thanh.do
Date: 2009-11-25 03:00:02 -0500 (Wed, 25 Nov 2009)
New Revision: 797
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css
Log:
GTNPORTAL-272:Error displaying in Portal Navigation when click Show Info Bar
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css 2009-11-25 07:49:55 UTC (rev 796)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css 2009-11-25 08:00:02 UTC (rev 797)
@@ -24,7 +24,7 @@
}
.UIManagement .ManagementBlock {
- background: url('background/BgEvenRow.gif') repeat-x left top;
+ background: #f8f8f8 url('background/BgEvenRow.gif') repeat-x left top;
margin-bottom: 1px;
}
@@ -52,11 +52,11 @@
}
.UIPortalNavigationPortlet .UIManagement table.ManagementBlock td.Content {
- width: 23%;
+ width: 20%;
}
.UIPortalNavigationPortlet .UIManagement table.ManagementBlock td.ActionBlock {
- width: 65%;
+ width: 68%;
}
.UIManagement table.ManagementBlock td.Content strong {
15 years, 1 month
gatein SVN: r796 - in portal/trunk: component/pc and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-25 02:49:55 -0500 (Wed, 25 Nov 2009)
New Revision: 796
Modified:
portal/trunk/.classpath
portal/trunk/component/pc/pom.xml
portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
portal/trunk/pom.xml
Log:
Upgrade dependencies on components:
<org.gatein.common.version>2.0.0-CR02</org.gatein.common.version>
<org.gatein.wci.version>2.0.0-CR01</org.gatein.wci.version>
<org.gatein.pc.version>2.1.0-CR01</org.gatein.pc.version>
GTNPORTAL-291: Add BridgeInterceptor to enable Apache Bridges
Tested on jPetstore Struts portlet
Modified: portal/trunk/.classpath
===================================================================
--- portal/trunk/.classpath 2009-11-25 07:36:51 UTC (rev 795)
+++ portal/trunk/.classpath 2009-11-25 07:49:55 UTC (rev 796)
@@ -1,5 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="src" output="component/common/target/classes" path="component/common/src/main/java"/>
+ <classpathentry kind="src" output="component/common/target/test-classes" path="component/common/src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="component/common/target/test-classes" path="component/common/src/test/resources"/>
+ <classpathentry kind="src" output="component/resources/target/classes" path="component/resources/src/main/java"/>
+ <classpathentry kind="src" output="component/resources/target/test-classes" path="component/resources/src/test/java"/>
+ <classpathentry kind="src" output="component/pc/target/classes" path="component/pc/src/main/java"/>
+ <classpathentry kind="src" output="component/pc/target/test-classes" path="component/pc/src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="component/pc/target/test-classes" path="component/pc/src/test/resources"/>
+ <classpathentry kind="src" output="component/xml-parser/target/classes" path="component/xml-parser/src/main/java"/>
+ <classpathentry kind="src" output="component/xml-parser/target/test-classes" path="component/xml-parser/src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="component/xml-parser/target/test-classes" path="component/xml-parser/src/test/resources"/>
+ <classpathentry kind="src" output="component/wsrp/target/classes" path="component/wsrp/src/main/java"/>
+ <classpathentry kind="src" output="component/scripting/target/classes" path="component/scripting/src/main/java"/>
+ <classpathentry kind="src" output="component/scripting/target/test-classes" path="component/scripting/src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="component/scripting/target/test-classes" path="component/scripting/src/test/resources"/>
+ <classpathentry kind="src" output="component/web/target/classes" path="component/web/src/main/java"/>
+ <classpathentry kind="src" output="component/web/target/test-classes" path="component/web/src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="component/web/target/test-classes" path="component/web/src/test/resources"/>
+ <classpathentry kind="src" output="component/identity/target/classes" path="component/identity/src/main/java"/>
+ <classpathentry kind="src" output="component/identity/target/test-classes" path="component/identity/src/test/java"/>
+ <classpathentry kind="src" output="component/portal/target/classes" path="component/portal/src/main/java"/>
+ <classpathentry kind="src" output="component/portal/target/test-classes" path="component/portal/src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="component/portal/target/test-classes" path="component/portal/src/test/resources"/>
+ <classpathentry kind="src" output="component/application-registry/target/classes" path="component/application-registry/src/main/java"/>
+ <classpathentry kind="src" output="component/application-registry/target/test-classes" path="component/application-registry/src/test/java"/>
+ <classpathentry kind="src" output="webui/core/target/classes" path="webui/core/src/main/java"/>
+ <classpathentry kind="src" output="webui/core/target/test-classes" path="webui/core/src/test/java"/>
+ <classpathentry kind="src" output="webui/eXo/target/classes" path="webui/eXo/src/main/java"/>
+ <classpathentry kind="src" output="gadgets/core/target/classes" path="gadgets/core/src/main/java"/>
+ <classpathentry kind="src" output="webui/portal/target/classes" path="webui/portal/src/main/java"/>
+ <classpathentry kind="src" output="component/dashboard/target/classes" path="component/dashboard/src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="component/dashboard/target/classes" path="component/dashboard/src/main/resources"/>
+ <classpathentry kind="src" output="gadgets/eXoGadgets/target/classes" path="gadgets/eXoGadgets/src/main/java"/>
+ <classpathentry kind="src" output="portlet/dashboard/target/classes" path="portlet/dashboard/src/main/java"/>
+ <classpathentry kind="src" output="portlet/exoadmin/target/classes" path="portlet/exoadmin/src/main/java"/>
+ <classpathentry kind="src" output="portlet/web/target/classes" path="portlet/web/src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="server/tomcat/patch/target/classes" path="server/tomcat/patch/src/main/tomcat"/>
+ <classpathentry kind="src" output="server/tomcat/plugin/target/classes" path="server/tomcat/plugin/src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="server/jboss/patch/target/classes" path="server/jboss/patch/src/main/jboss"/>
+ <classpathentry kind="src" output="server/jboss/plugin/target/classes" path="server/jboss/plugin/src/main/java"/>
+ <classpathentry kind="src" output="sample/extension/config/target/classes" path="sample/extension/config/src/main/java"/>
+ <classpathentry kind="src" output="sample/extension/jar/target/classes" path="sample/extension/jar/src/main/java"/>
+ <classpathentry kind="src" output="sample/portal/config/target/classes" path="sample/portal/config/src/main/java"/>
+ <classpathentry kind="src" output="sample/portal/jar/target/classes" path="sample/portal/jar/src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: portal/trunk/component/pc/pom.xml
===================================================================
--- portal/trunk/component/pc/pom.xml 2009-11-25 07:36:51 UTC (rev 795)
+++ portal/trunk/component/pc/pom.xml 2009-11-25 07:49:55 UTC (rev 796)
@@ -89,6 +89,11 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-bridge</artifactId>
+ <version>${org.gatein.pc.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-wci</artifactId>
<version>${org.gatein.wci.version}</version>
Modified: portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
===================================================================
--- portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2009-11-25 07:36:51 UTC (rev 795)
+++ portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2009-11-25 07:49:55 UTC (rev 796)
@@ -22,6 +22,7 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.gatein.pc.api.PortletInvoker;
+import org.gatein.pc.bridge.BridgeInterceptor;
import org.gatein.pc.federation.FederatingPortletInvoker;
import org.gatein.pc.federation.impl.FederatingPortletInvokerService;
import org.gatein.pc.mc.PortletApplicationDeployer;
@@ -83,8 +84,10 @@
requestAttributeConversationInterceptor.setNext(eventPayloadInterceptor);
CCPPInterceptor ccppInterceptor = new CCPPInterceptor();
ccppInterceptor.setNext(requestAttributeConversationInterceptor);
+ BridgeInterceptor bridgepInterceptor = new BridgeInterceptor();
+ bridgepInterceptor.setNext(ccppInterceptor);
ProducerCacheInterceptor producerCacheInterceptor = new ProducerCacheInterceptor();
- producerCacheInterceptor.setNext(ccppInterceptor);
+ producerCacheInterceptor.setNext(bridgepInterceptor);
ContextDispatcherInterceptor contextDispatcherInterceptor = new ContextDispatcherInterceptor();
contextDispatcherInterceptor.setNext(producerCacheInterceptor);
SecureTransportInterceptor secureTransportInterceptor = new SecureTransportInterceptor();
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-25 07:36:51 UTC (rev 795)
+++ portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-25 07:49:55 UTC (rev 796)
@@ -53,7 +53,8 @@
new Project("org.exoplatform.portal", "exo.portal.component.resources", "jar", module.version);
module.component.common =
- new Project("org.exoplatform.portal", "exo.portal.component.common", "jar", module.version);
+ new Project("org.exoplatform.portal", "exo.portal.component.common", "jar", module.version).
+ addDependency(new Project("org.gatein.common", "common-logging", "jar", commonVersion));
module.component.pc =
new Project("org.exoplatform.portal", "exo.portal.component.pc", "jar", module.version).
@@ -61,6 +62,7 @@
addDependency(new Project("javax.ccpp", "ccpp", "jar", "1.0")).
addDependency(new Project("javax.xml.bind", "jaxb-api", "jar", "2.1")).
addDependency(new Project("org.gatein.pc", "pc-api", "jar", pcVersion)).
+ addDependency(new Project("org.gatein.pc", "pc-bridge", "jar", pcVersion)).
addDependency(new Project("org.gatein.pc", "pc-portlet", "jar", pcVersion)).
addDependency(new Project("org.gatein.pc", "pc-mc", "jar", pcVersion)).
addDependency(new Project("org.gatein.pc", "pc-controller", "jar", pcVersion)).
@@ -72,6 +74,7 @@
addDependency(new Project("log4j", "log4j", "jar", "1.2.14")).
addDependency(new Project("org.jboss", "jbossxb", "jar", "2.0.1.GA")).
addDependency(new Project("org.jboss.logging", "jboss-logging-spi", "jar", "2.0.5.GA")).
+ addDependency(new Project("org.apache.portals.bridges", "portals-bridges-common", "jar", "1.0.4")).
addDependency(new Project("org.jboss", "jboss-common-core", "jar", "2.2.9.GA"));
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2009-11-25 07:36:51 UTC (rev 795)
+++ portal/trunk/pom.xml 2009-11-25 07:49:55 UTC (rev 796)
@@ -43,9 +43,9 @@
<org.exoplatform.jcr.version>1.12.0-Beta04</org.exoplatform.jcr.version>
<org.jibx.version>1.2.1</org.jibx.version>
<org.shindig.version>SNAPSHOT-r790473</org.shindig.version>
- <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.gatein.common.version>2.0.0-CR02</org.gatein.common.version>
+ <org.gatein.wci.version>2.0.0-CR01</org.gatein.wci.version>
+ <org.gatein.pc.version>2.1.0-CR01</org.gatein.pc.version>
<org.jboss.identity.idm>1.0.0.Beta3</org.jboss.identity.idm>
<org.gatein.wsrp.version>1.0.0-Beta01</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.0-Beta10</org.gatein.mop.version>
15 years, 1 month
gatein SVN: r795 - portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPage.
by do-not-reply@jboss.org
Author: thanh.do
Date: 2009-11-25 02:36:51 -0500 (Wed, 25 Nov 2009)
New Revision: 795
Modified:
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPage/Stylesheet.css
Log:
GTNPORTAL-225:IE6: Error UI in New Account portlet in public mode
Modified: portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPage/Stylesheet.css
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPage/Stylesheet.css 2009-11-25 07:11:32 UTC (rev 794)
+++ portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPage/Stylesheet.css 2009-11-25 07:36:51 UTC (rev 795)
@@ -92,7 +92,8 @@
}
.UIPageBody .VIEW-PAGEBODY .UIPage .UIComponentBlock {
- background: white;
+ background: white;
+ height: 100%;
}
.UIPageBody .BLPagebody {
15 years, 1 month
gatein SVN: r794 - portal/trunk/web/portal/src/main/webapp/templates/groovy/webui/component.
by do-not-reply@jboss.org
Author: thanh.do
Date: 2009-11-25 02:11:32 -0500 (Wed, 25 Nov 2009)
New Revision: 794
Modified:
portal/trunk/web/portal/src/main/webapp/templates/groovy/webui/component/UIHomePagePortlet.gtmpl
Log:
GTNPORTAL-186:Little error when check Show Info Bar of Homepage portlet
Modified: portal/trunk/web/portal/src/main/webapp/templates/groovy/webui/component/UIHomePagePortlet.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/templates/groovy/webui/component/UIHomePagePortlet.gtmpl 2009-11-25 00:34:26 UTC (rev 793)
+++ portal/trunk/web/portal/src/main/webapp/templates/groovy/webui/component/UIHomePagePortlet.gtmpl 2009-11-25 07:11:32 UTC (rev 794)
@@ -92,10 +92,4 @@
</div>
<div class="ClearBoth"><span></span></div>
</div>
-<div class="BottomDecoratorHome">
- <div class="BottomDecoratorLeft">
- <div class="BottomDecoratorRight">
- <div class="BottomDecoratorMiddle"><span></span></div>
- </div>
- </div>
-</div>
+
15 years, 1 month