gatein SVN: r753 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-11-22 22:14:40 -0500 (Sun, 22 Nov 2009)
New Revision: 753
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java
Log:
GTNPORTAL-273: Still edit navigation of portal which was deleted
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-11-23 03:12:32 UTC (rev 752)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-11-23 03:14:40 UTC (rev 753)
@@ -95,7 +95,11 @@
UserPortalConfigService portalConfigService =
uiManagement.getApplicationComponent(UserPortalConfigService.class);
PageNavigation navigation = uiNodeSelector.getSelectedNavigation();
- portalConfigService.update(navigation);
+ List<String> allPortalNames = portalConfigService.getAllPortalNames();
+ if(allPortalNames.contains(navigation.getOwnerId()))
+ {
+ portalConfigService.update(navigation);
+ }
UIPortal uiPortal = Util.getUIPortal();
setNavigation(uiPortal.getNavigations(), navigation);
UIPopupWindow uiPopup = uiManagement.getParent();
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java 2009-11-23 03:12:32 UTC (rev 752)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java 2009-11-23 03:14:40 UTC (rev 753)
@@ -495,7 +495,8 @@
}
else
{
- throw new Exception("Page don't exist!");
+ uiApp.addMessage(new ApplicationMessage("UIPageNodeSelector.msg.notAvailable", null));
+ return;
}
}
}
15 years, 1 month
gatein SVN: r752 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2009-11-22 22:12:32 -0500 (Sun, 22 Nov 2009)
New Revision: 752
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
Log:
GTNPORTAL-202: Update java code to fix UI bug with mixed layout
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-23 01:08:00 UTC (rev 751)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-23 03:12:32 UTC (rev 752)
@@ -196,10 +196,17 @@
removeComponent(topAncestorId, UI_CONTAINER_PREFIX, pcontext);
return;
}
+
+ /** If the uiParent is not the topAncestor and having no child, then it is removed */
+ if(uiParent.getChildren().size() == 0)
+ {
+ /** Update server-side */
+ UIContainer itsParent = uiParent.getParent();
+ itsParent.removeChildById(uiParent.getId());
+ }
/**
- * If the topAncestor contains at least one child, then it is
- * updated via Ajax
+ * Update the topAncestor by Ajax
*/
if (!topAncestorId.startsWith(UI_CONTAINER_PREFIX))
{
15 years, 1 month
gatein SVN: r751 - in portal/branches/wsrp-integration/component/wsrp/src: main/java/org/gatein/portal/wsrp/state and 7 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-22 20:08:00 -0500 (Sun, 22 Nov 2009)
New Revision: 751
Added:
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/mapping/
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/
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/mapping/
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
Removed:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java
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/state/consumer/mapping/RegistrationPropertyMapping.java
portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
Log:
- Started adding producer configuration persistence.
- Adapted ExoKernelIntegration to API changes and hooked JCRConsumerRegistry up (needs testing).
- Started extracting common behavior into JCRPersister helper class.
- Renamed ConsumerRegistry to JCRConsumerRegistry.
- Moved RegistrationPropertyDescriptionMapping to new higher level package as it is now shared between producer and consumer
persistence.
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-22 23:43:40 UTC (rev 750)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -31,6 +31,7 @@
import org.gatein.pc.portlet.impl.state.producer.PortletStatePersistenceManagerService;
import org.gatein.pc.portlet.state.StateConverter;
import org.gatein.pc.portlet.state.producer.ProducerPortletInvoker;
+import org.gatein.portal.wsrp.state.consumer.JCRConsumerRegistry;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPersistenceManager;
import org.gatein.registration.impl.RegistrationManagerImpl;
@@ -41,7 +42,6 @@
import org.gatein.wsrp.api.SessionEventBroadcaster;
import org.gatein.wsrp.api.SessionEventListener;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
-import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
import org.gatein.wsrp.producer.ProducerHolder;
import org.gatein.wsrp.producer.WSRPProducer;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
@@ -96,10 +96,10 @@
private void startProducer(ExoContainer container)
{
- ProducerConfigurationService producerConfigurationService = new SimpleXMLProducerConfigurationService();
+ ProducerConfigurationService producerConfigurationService = new SimpleXMLProducerConfigurationService(configurationIS);
try
{
- producerConfigurationService.loadConfigurationFrom(configurationIS);
+ producerConfigurationService.reloadConfiguration();
}
catch (Exception e)
{
@@ -152,12 +152,11 @@
FederatingPortletInvoker federatingPortletInvoker =
(FederatingPortletInvoker)container.getComponentInstanceOfType(PortletInvoker.class);
- consumerRegistry = new XMLConsumerRegistry();
- consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
- consumerRegistry.setSessionEventBroadcaster(new SimpleSessionEventBroadcaster());
-
try
{
+ consumerRegistry = new JCRConsumerRegistry();
+ consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
+ consumerRegistry.setSessionEventBroadcaster(new SimpleSessionEventBroadcaster());
consumerRegistry.start();
}
catch (Exception e)
Added: 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 (rev 0)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -0,0 +1,58 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, 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.
+*/
+
+package org.gatein.portal.wsrp.state;
+
+import org.chromattic.api.Chromattic;
+import org.chromattic.api.ChromatticBuilder;
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.services.jcr.ext.registry.RegistryService;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class JCRPersister
+{
+ private Chromattic chrome;
+ public static final String WSRP_SERVICES_PATH = RegistryService.EXO_SERVICES + "/wsrp/";
+
+ public void initializeBuilderFor(List<Class> mappingClasses) throws Exception
+ {
+ ChromatticBuilder builder = ChromatticBuilder.create();
+ builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME, "org.chromattic.apt.InstrumentorImpl");
+
+ for (Class mappingClass : mappingClasses)
+ {
+ builder.add(mappingClass);
+ }
+
+ chrome = builder.build();
+ }
+
+ public ChromatticSession getSession()
+ {
+ return chrome.openSession();
+ }
+}
Deleted: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java 2009-11-22 23:43:40 UTC (rev 750)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -1,295 +0,0 @@
-/*
- * 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.
- */
-
-package org.gatein.portal.wsrp.state.consumer;
-
-import org.chromattic.api.Chromattic;
-import org.chromattic.api.ChromatticBuilder;
-import org.chromattic.api.ChromatticSession;
-import org.exoplatform.commons.utils.Safe;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.services.jcr.ext.registry.RegistryService;
-import org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping;
-import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping;
-import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping;
-import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping;
-import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyDescriptionMapping;
-import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping;
-import org.gatein.wsrp.WSRPConsumer;
-import org.gatein.wsrp.consumer.ProducerInfo;
-import org.gatein.wsrp.consumer.RegistrationInfo;
-import org.gatein.wsrp.consumer.RegistrationProperty;
-import org.gatein.wsrp.consumer.registry.AbstractConsumerRegistry;
-import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
-import org.gatein.wsrp.registration.LocalizedString;
-import org.gatein.wsrp.registration.RegistrationPropertyDescription;
-
-import javax.xml.namespace.QName;
-import java.io.ByteArrayInputStream;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class ConsumerRegistry extends AbstractConsumerRegistry
-{
- private Chromattic chrome;
- private static final String WSRP_SERVICES_PATH = RegistryService.EXO_SERVICES + "/wsrp/";
- private static final String PRODUCER_INFOS_PATH = WSRP_SERVICES_PATH + "producerinfos";
-
- public ConsumerRegistry() throws Exception
- {
- ChromatticBuilder builder = ChromatticBuilder.create();
- builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME, "org.chromattic.apt.InstrumentorImpl");
-
- builder.add(ProducerInfosMapping.class);
- builder.add(ProducerInfoMapping.class);
- builder.add(EndpointInfoMapping.class);
- builder.add(RegistrationInfoMapping.class);
- builder.add(RegistrationPropertyMapping.class);
- builder.add(RegistrationPropertyDescriptionMapping.class);
-
- chrome = builder.build();
- }
-
- public ConsumerRegistry(InitParams params, RegistryService jcrRegistry) throws Exception
- {
- this();
- }
-
- @Override
- protected void save(ProducerInfo info, String messageOnError)
- {
- String path = getPathFor(info);
- ChromatticSession session = chrome.openSession();
-
- String key = session.persist(toProducerInfoMapping(info, session), path);
- info.setKey(key);
-
- session.close();
- }
-
- @Override
- protected void delete(ProducerInfo info)
- {
- ChromatticSession session = chrome.openSession();
- delete(session, getPathFor(info));
-
- session.close();
- }
-
- @Override
- protected String update(ProducerInfo producerInfo)
- {
- String key = producerInfo.getKey();
- if (key == null)
- {
- throw new IllegalArgumentException("ProducerInfo '" + producerInfo.getId()
- + "' hasn't been persisted and thus cannot be updated.");
- }
-
- ChromatticSession session = chrome.openSession();
- session.persist(toProducerInfoMapping(producerInfo, session), getPathFor(producerInfo));
-
- return null;
- }
-
- @Override
- protected Iterator<ProducerInfo> getProducerInfosFromStorage()
- {
- ChromatticSession session = chrome.openSession();
- 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);
-
- List<ProducerInfoMapping> infos = producerInfosMapping.getProducerInfos();
-
- // Load from XML
- XMLConsumerRegistry fromXML = new XMLConsumerRegistry();
- fromXML.reloadConsumers();
-
- // Save to JCR
- List<WSRPConsumer> consumers = fromXML.getConfiguredConsumers();
- for (WSRPConsumer consumer : consumers)
- {
- infos.add(toProducerInfoMapping(consumer.getProducerInfo(), session));
- }
- 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;
- }
-
- private void delete(ChromatticSession session, String path)
- {
- ProducerInfoMapping old = session.findByPath(ProducerInfoMapping.class, path);
-
- if (old != null)
- {
- session.remove(old);
- }
- }
-
- private static String getPathFor(ProducerInfo info)
- {
- return PRODUCER_INFOS_PATH + "/" + info.getId();
- }
-
- private static ProducerInfoMapping toProducerInfoMapping(ProducerInfo producerInfo, ChromatticSession session)
- {
- ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, producerInfo.getKey());
- if (pim == null)
- {
- pim = session.insert(ProducerInfoMapping.class, getPathFor(producerInfo));
- }
-
- pim.setActive(producerInfo.isActive());
- pim.setExpirationCacheSeconds(producerInfo.getExpirationCacheSeconds());
- pim.setId(producerInfo.getId());
-
- EndpointInfoMapping eim = pim.getEndpointInfo();
- eim.setWSDLURL(producerInfo.getEndpointConfigurationInfo().getWsdlDefinitionURL());
-
- RegistrationInfoMapping rim = pim.getRegistrationInfo();
- RegistrationInfo regInfo = producerInfo.getRegistrationInfo();
- rim.setConsumerName(regInfo.getConsumerName());
- rim.setRegistrationHandle(regInfo.getRegistrationHandle());
- byte[] bytes = regInfo.getRegistrationState();
- if (bytes != null && bytes.length > 0)
- {
- ByteArrayInputStream is = new ByteArrayInputStream(bytes);
- rim.setRegistrationState(is);
- }
-
- // clear and recreate registration properties
- List<RegistrationPropertyMapping> rpms = rim.getRegistrationProperties();
- rpms.clear();
- for (RegistrationProperty property : regInfo.getRegistrationProperties().values())
- {
- // create new RegistrationPropertyMapping for this RegistrationInfoMapping
- RegistrationPropertyMapping rpm = rim.create();
-
- // set properties
- rpm.setStatus(property.getStatus().name());
- rpm.setValue(property.getValue());
-
- // description
- RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
- RegistrationPropertyDescription desc = property.getDescription();
- rpdm.setDescription(desc.getDescription().getValue()); // todo: should really persist LocalizedString here...
- rpdm.setHint(desc.getHint().getValue()); // todo: should really persist LocalizedString here...
- rpdm.setLabel(desc.getLabel().getValue()); // todo: should really persist LocalizedString here...
-
- // convert QNames to Strings
- rpdm.setName(desc.getName().toString());
- rpdm.setType(desc.getType().toString());
-
- // add newly created RegistrationPropertyMapping to parent
- rpms.add(rpm);
- }
-
- return pim;
- }
-
- private static ProducerInfo toProducerInfo(ProducerInfoMapping mapping)
- {
- // todo: should probably use a ProducerInfo implementation backed by mapping at some point
- ProducerInfo info = new ProducerInfo();
-
- // basic properties
- info.setKey(mapping.getKey());
- info.setId(mapping.getId());
- info.setActive(mapping.getActive());
- info.setExpirationCacheSeconds(mapping.getExpirationCacheSeconds());
-
- // endpoint
- info.getEndpointConfigurationInfo().setWsdlDefinitionURL(mapping.getEndpointInfo().getWSDLURL());
-
- // registration
- RegistrationInfo regInfo = info.getRegistrationInfo();
- RegistrationInfoMapping rim = mapping.getRegistrationInfo();
- regInfo.setConsumerName(rim.getConsumerName());
- regInfo.setRegistrationHandle(rim.getRegistrationHandle());
- regInfo.setRegistrationState(Safe.getBytes(rim.getRegistrationState()));
-
- // registration properties
- for (RegistrationPropertyMapping rpm : rim.getRegistrationProperties())
- {
- RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
- String name = rpdm.getName();
-
- RegistrationProperty prop = regInfo.setRegistrationPropertyValue(name, rpm.getValue());
-
- RegistrationPropertyDescription desc = new RegistrationPropertyDescription(name, QName.valueOf(rpdm.getType()));
- desc.setDefaultDescription(rpdm.getDescription());
- desc.setHint(new LocalizedString(rpdm.getHint()));
- desc.setLabel(new LocalizedString(rpdm.getLabel()));
- prop.setDescription(desc);
-
- prop.setStatus(RegistrationProperty.Status.valueOf(rpm.getStatus()));
- }
-
- return info;
- }
-
- private static class MappingToProducerInfoIterator implements Iterator<ProducerInfo>
- {
- private Iterator<ProducerInfoMapping> mappings;
-
- public MappingToProducerInfoIterator(Iterator<ProducerInfoMapping> infoMappingIterator)
- {
- this.mappings = infoMappingIterator;
- }
-
- public boolean hasNext()
- {
- return mappings.hasNext();
- }
-
- public ProducerInfo next()
- {
- return toProducerInfo(mappings.next());
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException("Remove not supported!");
- }
- }
-}
Copied: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java (from rev 747, portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java)
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java (rev 0)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -0,0 +1,290 @@
+/*
+ * 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.
+ */
+
+package org.gatein.portal.wsrp.state.consumer;
+
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.commons.utils.Safe;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.services.jcr.ext.registry.RegistryService;
+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;
+import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping;
+import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping;
+import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping;
+import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.RegistrationInfo;
+import org.gatein.wsrp.consumer.RegistrationProperty;
+import org.gatein.wsrp.consumer.registry.AbstractConsumerRegistry;
+import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
+import org.gatein.wsrp.registration.LocalizedString;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+
+import javax.xml.namespace.QName;
+import java.io.ByteArrayInputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class JCRConsumerRegistry extends AbstractConsumerRegistry
+{
+ private JCRPersister persister = new JCRPersister();
+ private static final String PRODUCER_INFOS_PATH = JCRPersister.WSRP_SERVICES_PATH + "producerinfos";
+
+ public JCRConsumerRegistry() 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.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);
+ info.setKey(key);
+
+ session.close();
+ }
+
+ @Override
+ protected void delete(ProducerInfo info)
+ {
+ ChromatticSession session = persister.getSession();
+ delete(session, getPathFor(info));
+
+ session.close();
+ }
+
+ @Override
+ protected String update(ProducerInfo producerInfo)
+ {
+ String key = producerInfo.getKey();
+ if (key == null)
+ {
+ throw new IllegalArgumentException("ProducerInfo '" + producerInfo.getId()
+ + "' hasn't been persisted and thus cannot be updated.");
+ }
+
+ ChromatticSession session = persister.getSession();
+ session.persist(toProducerInfoMapping(producerInfo, session), getPathFor(producerInfo));
+
+ return null;
+ }
+
+ @Override
+ protected Iterator<ProducerInfo> getProducerInfosFromStorage()
+ {
+ ChromatticSession session = persister.getSession();
+ 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);
+
+ List<ProducerInfoMapping> infos = producerInfosMapping.getProducerInfos();
+
+ // Load from XML
+ XMLConsumerRegistry fromXML = new XMLConsumerRegistry();
+ fromXML.reloadConsumers();
+
+ // Save to JCR
+ List<WSRPConsumer> consumers = fromXML.getConfiguredConsumers();
+ for (WSRPConsumer consumer : consumers)
+ {
+ infos.add(toProducerInfoMapping(consumer.getProducerInfo(), session));
+ }
+ 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;
+ }
+
+ private void delete(ChromatticSession session, String path)
+ {
+ ProducerInfoMapping old = session.findByPath(ProducerInfoMapping.class, path);
+
+ if (old != null)
+ {
+ session.remove(old);
+ }
+ }
+
+ private static String getPathFor(ProducerInfo info)
+ {
+ return PRODUCER_INFOS_PATH + "/" + info.getId();
+ }
+
+ private static ProducerInfoMapping toProducerInfoMapping(ProducerInfo producerInfo, ChromatticSession session)
+ {
+ ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, producerInfo.getKey());
+ if (pim == null)
+ {
+ pim = session.insert(ProducerInfoMapping.class, getPathFor(producerInfo));
+ }
+
+ pim.setActive(producerInfo.isActive());
+ pim.setExpirationCacheSeconds(producerInfo.getExpirationCacheSeconds());
+ pim.setId(producerInfo.getId());
+
+ EndpointInfoMapping eim = pim.getEndpointInfo();
+ eim.setWSDLURL(producerInfo.getEndpointConfigurationInfo().getWsdlDefinitionURL());
+
+ RegistrationInfoMapping rim = pim.getRegistrationInfo();
+ RegistrationInfo regInfo = producerInfo.getRegistrationInfo();
+ rim.setConsumerName(regInfo.getConsumerName());
+ rim.setRegistrationHandle(regInfo.getRegistrationHandle());
+ byte[] bytes = regInfo.getRegistrationState();
+ if (bytes != null && bytes.length > 0)
+ {
+ ByteArrayInputStream is = new ByteArrayInputStream(bytes);
+ rim.setRegistrationState(is);
+ }
+
+ // clear and recreate registration properties
+ List<RegistrationPropertyMapping> rpms = rim.getRegistrationProperties();
+ rpms.clear();
+ for (RegistrationProperty property : regInfo.getRegistrationProperties().values())
+ {
+ // create new RegistrationPropertyMapping for this RegistrationInfoMapping
+ RegistrationPropertyMapping rpm = rim.create();
+
+ // set properties
+ rpm.setStatus(property.getStatus().name());
+ rpm.setValue(property.getValue());
+
+ // description
+ RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
+ RegistrationPropertyDescription desc = property.getDescription();
+ rpdm.setDescription(desc.getDescription().getValue()); // todo: should really persist LocalizedString here...
+ rpdm.setHint(desc.getHint().getValue()); // todo: should really persist LocalizedString here...
+ rpdm.setLabel(desc.getLabel().getValue()); // todo: should really persist LocalizedString here...
+
+ // convert QNames to Strings
+ rpdm.setName(desc.getName().toString());
+ rpdm.setType(desc.getType().toString());
+
+ // add newly created RegistrationPropertyMapping to parent
+ rpms.add(rpm);
+ }
+
+ return pim;
+ }
+
+ private static ProducerInfo toProducerInfo(ProducerInfoMapping mapping)
+ {
+ // todo: should probably use a ProducerInfo implementation backed by mapping at some point
+ ProducerInfo info = new ProducerInfo();
+
+ // basic properties
+ info.setKey(mapping.getKey());
+ info.setId(mapping.getId());
+ info.setActive(mapping.getActive());
+ info.setExpirationCacheSeconds(mapping.getExpirationCacheSeconds());
+
+ // endpoint
+ info.getEndpointConfigurationInfo().setWsdlDefinitionURL(mapping.getEndpointInfo().getWSDLURL());
+
+ // registration
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ RegistrationInfoMapping rim = mapping.getRegistrationInfo();
+ regInfo.setConsumerName(rim.getConsumerName());
+ regInfo.setRegistrationHandle(rim.getRegistrationHandle());
+ regInfo.setRegistrationState(Safe.getBytes(rim.getRegistrationState()));
+
+ // registration properties
+ for (RegistrationPropertyMapping rpm : rim.getRegistrationProperties())
+ {
+ RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
+ String name = rpdm.getName();
+
+ RegistrationProperty prop = regInfo.setRegistrationPropertyValue(name, rpm.getValue());
+
+ RegistrationPropertyDescription desc = new RegistrationPropertyDescription(name, QName.valueOf(rpdm.getType()));
+ desc.setDefaultDescription(rpdm.getDescription());
+ desc.setHint(new LocalizedString(rpdm.getHint()));
+ desc.setLabel(new LocalizedString(rpdm.getLabel()));
+ prop.setDescription(desc);
+
+ prop.setStatus(RegistrationProperty.Status.valueOf(rpm.getStatus()));
+ }
+
+ return info;
+ }
+
+ private static class MappingToProducerInfoIterator implements Iterator<ProducerInfo>
+ {
+ private Iterator<ProducerInfoMapping> mappings;
+
+ public MappingToProducerInfoIterator(Iterator<ProducerInfoMapping> infoMappingIterator)
+ {
+ this.mappings = infoMappingIterator;
+ }
+
+ public boolean hasNext()
+ {
+ return mappings.hasNext();
+ }
+
+ public ProducerInfo next()
+ {
+ return toProducerInfo(mappings.next());
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException("Remove not supported!");
+ }
+ }
+}
Deleted: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java 2009-11-22 23:43:40 UTC (rev 750)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -1,68 +0,0 @@
-/*
- * 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.
- */
-
-package org.gatein.portal.wsrp.state.consumer.mapping;
-
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.Property;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = RegistrationPropertyDescriptionMapping.NODE_NAME)
-public abstract class RegistrationPropertyDescriptionMapping
-{
- public static final String NODE_NAME = "wsrp:registrationpropertydescription";
-
- // todo: this should really be a QName
- @Property(name = "name")
- public abstract String getName();
-
- public abstract void setName(String name);
-
- // todo: this should really be a QName
- @Property(name = "type")
- public abstract String getType();
-
- public abstract void setType(String type);
-
-
- // todo: this should really be a LocalizedString
- @Property(name = "description")
- public abstract String getDescription();
-
- public abstract void setDescription(String description);
-
- // todo: this should really be a LocalizedString
- @Property(name = "hint")
- public abstract String getHint();
-
- public abstract void setHint(String hint);
-
- // todo: this should really be a LocalizedString
- @Property(name = "label")
- public abstract String getLabel();
-
- public abstract void setLabel(String label);
-}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java 2009-11-22 23:43:40 UTC (rev 750)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -27,6 +27,7 @@
import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.Property;
import org.chromattic.api.annotations.RelatedMappedBy;
+import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -47,6 +48,7 @@
public abstract RegistrationPropertyDescriptionMapping getDescription();
// todo: this should really be an enum�
+
@Property(name = "status")
public abstract String getStatus();
Copied: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java (from rev 748, portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java)
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java (rev 0)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+
+package org.gatein.portal.wsrp.state.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = RegistrationPropertyDescriptionMapping.NODE_NAME)
+public abstract class RegistrationPropertyDescriptionMapping
+{
+ public static final String NODE_NAME = "wsrp:registrationpropertydescription";
+
+ // todo: this should really be a QName
+
+ @Property(name = "name")
+ public abstract String getName();
+
+ public abstract void setName(String name);
+
+ // todo: this should really be a QName
+
+ @Property(name = "type")
+ public abstract String getType();
+
+ public abstract void setType(String type);
+
+
+ // todo: this should really be a LocalizedString
+
+ @Property(name = "description")
+ public abstract String getDescription();
+
+ public abstract void setDescription(String description);
+
+ // todo: this should really be a LocalizedString
+
+ @Property(name = "hint")
+ public abstract String getHint();
+
+ public abstract void setHint(String hint);
+
+ // todo: this should really be a LocalizedString
+
+ @Property(name = "label")
+ public abstract String getLabel();
+
+ public abstract void setLabel(String label);
+}
Added: 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 (rev 0)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -0,0 +1,59 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, 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.
+*/
+
+package org.gatein.portal.wsrp.state.producer.configuration;
+
+import org.chromattic.api.ChromatticSession;
+import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.wsrp.producer.config.impl.AbstractProducerConfigurationService;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class JCRProducerConfigurationService extends AbstractProducerConfigurationService
+{
+ private JCRPersister persister;
+ private static String PRODUCER_CONFIGURATION_PATH = JCRPersister.WSRP_SERVICES_PATH + "producerconfiguration";
+
+ public JCRProducerConfigurationService()
+ {
+ List<Class> mappingClasses = new ArrayList<Class>();
+ Collections.addAll(mappingClasses, null);
+ }
+
+ protected void loadConfiguration() throws Exception
+ {
+ ChromatticSession session = persister.getSession();
+
+ //todo
+ }
+
+ public void saveConfiguration() throws Exception
+ {
+ //todo
+ }
+}
Added: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java (rev 0)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -0,0 +1,47 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, 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.
+*/
+
+package org.gatein.portal.wsrp.state.producer.configuration.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToOne;
+import org.chromattic.api.annotations.Property;
+import org.chromattic.api.annotations.RelatedMappedBy;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = ProducerConfigurationMapping.NODE_NAME)
+public abstract class ProducerConfigurationMapping
+{
+ public static final String NODE_NAME = "wsrp:producerconfiguration";
+
+ @Property(name = "strictmode")
+ public abstract boolean getUsingStrictMode();
+
+ public abstract void setUsingStrictMode(boolean strict);
+
+ @OneToOne
+ @RelatedMappedBy("registrationrequirements")
+ public abstract RegistrationRequirementsMapping getRegistrationRequirements();
+}
Added: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java (rev 0)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -0,0 +1,57 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, 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.
+*/
+
+package org.gatein.portal.wsrp.state.producer.configuration.mapping;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.Property;
+import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = RegistrationRequirementsMapping.NODE_NAME)
+public abstract class RegistrationRequirementsMapping
+{
+ public static final String NODE_NAME = "wsrp:registrationrequirements";
+
+ @Property(name = "registrationrequired")
+ public abstract boolean getRegistrationRequired();
+
+ public abstract void setRegistrationRequired(boolean requiresRegistration);
+
+ @Property(name = "registrationrequiredforfulldescription")
+ public abstract boolean getRegistrationRequiredForFullDescription();
+
+ public abstract void setRegistrationRequiredForFullDescription(boolean fullServiceDescriptionRequiresRegistration);
+
+ @OneToMany
+ public abstract List<RegistrationPropertyDescriptionMapping> getRegistrationPropertyDescriptions();
+
+ @Create
+ public abstract RegistrationPropertyDescriptionMapping create();
+}
Modified: portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2009-11-22 23:43:40 UTC (rev 750)
+++ portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2009-11-23 01:08:00 UTC (rev 751)
@@ -41,12 +41,12 @@
*/
public class ConsumerRegistryTestCase extends TestCase
{
- private ConsumerRegistry registry;
+ private JCRConsumerRegistry registry;
@Override
protected void setUp() throws Exception
{
- registry = new ConsumerRegistry();
+ registry = new JCRConsumerRegistry();
registry.setFederatingPortletInvoker(new FederatingPortletInvokerService());
}
15 years, 1 month
gatein SVN: r750 - in components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl: xml and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-22 18:43:40 -0500 (Sun, 22 Nov 2009)
New Revision: 750
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/AbstractProducerConfigurationService.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/FileSystemXMLProducerConfigurationService.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/SimpleXMLProducerConfigurationService.java
Log:
- Renamed AbstractProducerConfigurationService.loadConfiguration to reloadConfiguration as it needs to be the entry point and delegate actual
loading to subclasses via loadConfiguration abstract method.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/AbstractProducerConfigurationService.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/AbstractProducerConfigurationService.java 2009-11-22 22:46:54 UTC (rev 749)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/AbstractProducerConfigurationService.java 2009-11-22 23:43:40 UTC (rev 750)
@@ -46,7 +46,7 @@
return configuration;
}
- public void loadConfiguration() throws Exception
+ public void reloadConfiguration() throws Exception
{
// save listeners if we already have a configuration
List<ProducerConfigurationChangeListener> listeners = null;
@@ -65,7 +65,7 @@
}
// reload
- reloadConfiguration();
+ loadConfiguration();
// restore listeners
if (listeners != null)
@@ -94,4 +94,6 @@
}
}
}
+
+ protected abstract void loadConfiguration() throws Exception;
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/FileSystemXMLProducerConfigurationService.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/FileSystemXMLProducerConfigurationService.java 2009-11-22 22:46:54 UTC (rev 749)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/FileSystemXMLProducerConfigurationService.java 2009-11-22 23:43:40 UTC (rev 750)
@@ -110,7 +110,7 @@
reloadConfiguration();
}
- public void reloadConfiguration() throws Exception
+ public void loadConfiguration() throws Exception
{
URL configURL = getConfigLocationURL();
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/SimpleXMLProducerConfigurationService.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/SimpleXMLProducerConfigurationService.java 2009-11-22 22:46:54 UTC (rev 749)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/SimpleXMLProducerConfigurationService.java 2009-11-22 23:43:40 UTC (rev 750)
@@ -52,7 +52,7 @@
this.inputStream = inputStream;
}
- public void reloadConfiguration() throws Exception
+ public void loadConfiguration() throws Exception
{
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
ObjectModelFactory factory = new ProducerConfigurationFactory();
15 years, 1 month
gatein SVN: r749 - in components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config: impl and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-22 17:46:54 -0500 (Sun, 22 Nov 2009)
New Revision: 749
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerConfigurationService.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/AbstractProducerConfigurationService.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/FileSystemXMLProducerConfigurationService.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/SimpleXMLProducerConfigurationService.java
Log:
- Remove loadConfigurationFrom(InputStream) method from ProducerConfigurationService as it was dictating an implementation.
- Re-worked *XMLProducerConfigurationService to work with changes in interface.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerConfigurationService.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerConfigurationService.java 2009-11-20 23:21:26 UTC (rev 748)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerConfigurationService.java 2009-11-22 22:46:54 UTC (rev 749)
@@ -23,8 +23,6 @@
package org.gatein.wsrp.producer.config;
-import java.io.InputStream;
-
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision: 8784 $
@@ -49,12 +47,4 @@
* @since 2.6.3
*/
void saveConfiguration() throws Exception;
-
- /**
- * Loads a producer configuration from the given InputStream.
- *
- * @param inputStream the InputStream to load the configuration from
- * @throws Exception
- */
- void loadConfigurationFrom(InputStream inputStream) throws Exception;
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/AbstractProducerConfigurationService.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/AbstractProducerConfigurationService.java 2009-11-20 23:21:26 UTC (rev 748)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/AbstractProducerConfigurationService.java 2009-11-22 22:46:54 UTC (rev 749)
@@ -23,7 +23,6 @@
package org.gatein.wsrp.producer.config.impl;
-import org.gatein.common.util.ParameterValidation;
import org.gatein.registration.RegistrationPolicyChangeListener;
import org.gatein.registration.RegistrationPropertyChangeListener;
import org.gatein.wsrp.producer.config.ProducerConfiguration;
@@ -31,7 +30,6 @@
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
-import java.io.InputStream;
import java.util.List;
import java.util.Set;
@@ -48,10 +46,8 @@
return configuration;
}
- public void loadConfigurationFrom(InputStream inputStream) throws Exception
+ public void loadConfiguration() throws Exception
{
- ParameterValidation.throwIllegalArgExceptionIfNull(inputStream, "InputStream");
-
// save listeners if we already have a configuration
List<ProducerConfigurationChangeListener> listeners = null;
Set<RegistrationPolicyChangeListener> policyListeners = null;
@@ -69,7 +65,7 @@
}
// reload
- configuration = parseConfigurationFrom(inputStream);
+ reloadConfiguration();
// restore listeners
if (listeners != null)
@@ -98,7 +94,4 @@
}
}
}
-
- protected abstract ProducerConfiguration parseConfigurationFrom(InputStream inputStream) throws Exception;
-
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/FileSystemXMLProducerConfigurationService.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/FileSystemXMLProducerConfigurationService.java 2009-11-20 23:21:26 UTC (rev 748)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/FileSystemXMLProducerConfigurationService.java 2009-11-22 22:46:54 UTC (rev 749)
@@ -133,9 +133,9 @@
private void loadConfigurationAt(URL configURL) throws Exception
{
log.debug("About to parse producer configuration " + configURL);
- InputStream inputStream = configURL.openStream();
+ inputStream = configURL.openStream();
- loadConfigurationFrom(inputStream);
+ super.loadConfiguration();
}
private URL getConfigLocationURL() throws Exception
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/SimpleXMLProducerConfigurationService.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/SimpleXMLProducerConfigurationService.java 2009-11-20 23:21:26 UTC (rev 748)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/SimpleXMLProducerConfigurationService.java 2009-11-22 22:46:54 UTC (rev 749)
@@ -41,18 +41,22 @@
*/
public class SimpleXMLProducerConfigurationService extends AbstractProducerConfigurationService
{
+ protected InputStream inputStream;
- @Override
- protected ProducerConfiguration parseConfigurationFrom(InputStream inputStream) throws Exception
+ public SimpleXMLProducerConfigurationService()
{
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- ObjectModelFactory factory = new ProducerConfigurationFactory();
- return (ProducerConfiguration)unmarshaller.unmarshal(inputStream, factory, null);
}
+ public SimpleXMLProducerConfigurationService(InputStream inputStream)
+ {
+ this.inputStream = inputStream;
+ }
+
public void reloadConfiguration() throws Exception
{
- throw new UnsupportedOperationException("reloadConfiguration is not supported!");
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ ObjectModelFactory factory = new ProducerConfigurationFactory();
+ configuration = (ProducerConfiguration)unmarshaller.unmarshal(inputStream, factory, null);
}
public void saveConfiguration() throws Exception
15 years, 1 month
gatein SVN: r748 - in portal/branches/wsrp-integration: component/wsrp and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-20 18:21:26 -0500 (Fri, 20 Nov 2009)
New Revision: 748
Modified:
portal/branches/wsrp-integration/component/wsrp/pom.xml
portal/branches/wsrp-integration/pom.xml
Log:
- Use chromattic beta8.
Modified: portal/branches/wsrp-integration/component/wsrp/pom.xml
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/pom.xml 2009-11-20 23:20:21 UTC (rev 747)
+++ portal/branches/wsrp-integration/component/wsrp/pom.xml 2009-11-20 23:21:26 UTC (rev 748)
@@ -103,11 +103,13 @@
<version>${version.chromattic}</version>
<scope>provided</scope>
</dependency>
+
+ <!-- tests -->
<dependency>
<groupId>org.chromattic</groupId>
<artifactId>chromattic.exo</artifactId>
<version>${version.chromattic}</version>
- <scope>provided</scope>
+ <scope>test</scope>
</dependency>
</dependencies>
Modified: portal/branches/wsrp-integration/pom.xml
===================================================================
--- portal/branches/wsrp-integration/pom.xml 2009-11-20 23:20:21 UTC (rev 747)
+++ portal/branches/wsrp-integration/pom.xml 2009-11-20 23:21:26 UTC (rev 748)
@@ -50,7 +50,7 @@
<org.jboss.identity.idm>1.0.0.Beta3</org.jboss.identity.idm>
<org.gatein.wsrp.version>1.0.0-Beta02-SNAPSHOT</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.0-Beta09</org.gatein.mop.version>
- <version.chromattic>1.0.0-beta6</version.chromattic>
+ <version.chromattic>1.0.0-beta8</version.chromattic>
<version.reflect>1.0.0-beta3</version.reflect>
<!-- ************** -->
15 years, 1 month
gatein SVN: r747 - in portal/branches/wsrp-integration/component: wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-20 18:20:21 -0500 (Fri, 20 Nov 2009)
New Revision: 747
Modified:
portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
Log:
- Finished first pass at ConsumerRegistry implementation.
- Renamed ProducerInfoMapping.producerId property to id and added key property to hold generated UUID.
- Added create method on RegistrationInfoMapping to be able to create child RegistrationPropertyMapping elements.
- Use Safe.getBytes in WSRPContentProvider and ConsumerRegistry.
Modified: portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java 2009-11-20 23:18:15 UTC (rev 746)
+++ portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java 2009-11-20 23:20:21 UTC (rev 747)
@@ -19,16 +19,14 @@
package org.exoplatform.portal.pom.spi.wsrp;
+import org.exoplatform.commons.utils.Safe;
import org.exoplatform.portal.pom.spi.ContentProviderHelper;
import org.exoplatform.portal.pom.spi.HelpableContentProvider;
-import org.gatein.common.io.IOTools;
import org.gatein.mop.spi.content.ContentProvider;
import org.gatein.mop.spi.content.GetState;
import org.gatein.mop.spi.content.StateContainer;
import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
import java.util.List;
/**
@@ -80,31 +78,10 @@
persistedState.setCloned(updatedState.isCloned());
}
- private byte[] getBytes(InputStream is)
- {
- byte[] bytes;
-
- if (is == null)
- {
- return null;
- }
-
- try
- {
- bytes = IOTools.getBytes(is);
- }
- catch (IOException e)
- {
- throw new RuntimeException("Couldn't get bytes from WSRPState", e); // todo: log instead?
- }
- IOTools.safeClose(is);
- return bytes;
- }
-
public WSRP getState(WSRPState state)
{
WSRP wsrp = new WSRP();
- byte[] bytes = getBytes(state.getState());
+ byte[] bytes = Safe.getBytes(state.getState());
wsrp.setState(bytes);
wsrp.setPortletId(state.getPortletId());
wsrp.setCloned(state.getCloned());
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java 2009-11-20 23:18:15 UTC (rev 746)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java 2009-11-20 23:20:21 UTC (rev 747)
@@ -26,6 +26,7 @@
import org.chromattic.api.Chromattic;
import org.chromattic.api.ChromatticBuilder;
import org.chromattic.api.ChromatticSession;
+import org.exoplatform.commons.utils.Safe;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.services.jcr.ext.registry.RegistryService;
import org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping;
@@ -36,9 +37,15 @@
import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping;
import org.gatein.wsrp.WSRPConsumer;
import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.RegistrationInfo;
+import org.gatein.wsrp.consumer.RegistrationProperty;
import org.gatein.wsrp.consumer.registry.AbstractConsumerRegistry;
import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
+import org.gatein.wsrp.registration.LocalizedString;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import javax.xml.namespace.QName;
+import java.io.ByteArrayInputStream;
import java.util.Iterator;
import java.util.List;
@@ -78,10 +85,9 @@
String path = getPathFor(info);
ChromatticSession session = chrome.openSession();
- session.persist(toProducerInfoMapping(info), path);
+ String key = session.persist(toProducerInfoMapping(info, session), path);
+ info.setKey(key);
- // todo: find a way to inject JCR Id into ProducerInfo
-
session.close();
}
@@ -97,7 +103,16 @@
@Override
protected String update(ProducerInfo producerInfo)
{
- // todo: need JCR id to be able to find the previous ProducerInfo in case the id has been modified
+ String key = producerInfo.getKey();
+ if (key == null)
+ {
+ throw new IllegalArgumentException("ProducerInfo '" + producerInfo.getId()
+ + "' hasn't been persisted and thus cannot be updated.");
+ }
+
+ ChromatticSession session = chrome.openSession();
+ session.persist(toProducerInfoMapping(producerInfo, session), getPathFor(producerInfo));
+
return null;
}
@@ -124,7 +139,7 @@
List<WSRPConsumer> consumers = fromXML.getConfiguredConsumers();
for (WSRPConsumer consumer : consumers)
{
- infos.add(toProducerInfoMapping(consumer.getProducerInfo()));
+ infos.add(toProducerInfoMapping(consumer.getProducerInfo(), session));
}
session.persist(infos); // todo: is that sufficient?
@@ -151,19 +166,106 @@
}
}
- private String getPathFor(ProducerInfo info)
+ private static String getPathFor(ProducerInfo info)
{
return PRODUCER_INFOS_PATH + "/" + info.getId();
}
- private static ProducerInfoMapping toProducerInfoMapping(ProducerInfo producerInfo)
+ private static ProducerInfoMapping toProducerInfoMapping(ProducerInfo producerInfo, ChromatticSession session)
{
- return null; // todo: implement
+ ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, producerInfo.getKey());
+ if (pim == null)
+ {
+ pim = session.insert(ProducerInfoMapping.class, getPathFor(producerInfo));
+ }
+
+ pim.setActive(producerInfo.isActive());
+ pim.setExpirationCacheSeconds(producerInfo.getExpirationCacheSeconds());
+ pim.setId(producerInfo.getId());
+
+ EndpointInfoMapping eim = pim.getEndpointInfo();
+ eim.setWSDLURL(producerInfo.getEndpointConfigurationInfo().getWsdlDefinitionURL());
+
+ RegistrationInfoMapping rim = pim.getRegistrationInfo();
+ RegistrationInfo regInfo = producerInfo.getRegistrationInfo();
+ rim.setConsumerName(regInfo.getConsumerName());
+ rim.setRegistrationHandle(regInfo.getRegistrationHandle());
+ byte[] bytes = regInfo.getRegistrationState();
+ if (bytes != null && bytes.length > 0)
+ {
+ ByteArrayInputStream is = new ByteArrayInputStream(bytes);
+ rim.setRegistrationState(is);
+ }
+
+ // clear and recreate registration properties
+ List<RegistrationPropertyMapping> rpms = rim.getRegistrationProperties();
+ rpms.clear();
+ for (RegistrationProperty property : regInfo.getRegistrationProperties().values())
+ {
+ // create new RegistrationPropertyMapping for this RegistrationInfoMapping
+ RegistrationPropertyMapping rpm = rim.create();
+
+ // set properties
+ rpm.setStatus(property.getStatus().name());
+ rpm.setValue(property.getValue());
+
+ // description
+ RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
+ RegistrationPropertyDescription desc = property.getDescription();
+ rpdm.setDescription(desc.getDescription().getValue()); // todo: should really persist LocalizedString here...
+ rpdm.setHint(desc.getHint().getValue()); // todo: should really persist LocalizedString here...
+ rpdm.setLabel(desc.getLabel().getValue()); // todo: should really persist LocalizedString here...
+
+ // convert QNames to Strings
+ rpdm.setName(desc.getName().toString());
+ rpdm.setType(desc.getType().toString());
+
+ // add newly created RegistrationPropertyMapping to parent
+ rpms.add(rpm);
+ }
+
+ return pim;
}
private static ProducerInfo toProducerInfo(ProducerInfoMapping mapping)
{
- return null; // todo: implement
+ // todo: should probably use a ProducerInfo implementation backed by mapping at some point
+ ProducerInfo info = new ProducerInfo();
+
+ // basic properties
+ info.setKey(mapping.getKey());
+ info.setId(mapping.getId());
+ info.setActive(mapping.getActive());
+ info.setExpirationCacheSeconds(mapping.getExpirationCacheSeconds());
+
+ // endpoint
+ info.getEndpointConfigurationInfo().setWsdlDefinitionURL(mapping.getEndpointInfo().getWSDLURL());
+
+ // registration
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ RegistrationInfoMapping rim = mapping.getRegistrationInfo();
+ regInfo.setConsumerName(rim.getConsumerName());
+ regInfo.setRegistrationHandle(rim.getRegistrationHandle());
+ regInfo.setRegistrationState(Safe.getBytes(rim.getRegistrationState()));
+
+ // registration properties
+ for (RegistrationPropertyMapping rpm : rim.getRegistrationProperties())
+ {
+ RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
+ String name = rpdm.getName();
+
+ RegistrationProperty prop = regInfo.setRegistrationPropertyValue(name, rpm.getValue());
+
+ RegistrationPropertyDescription desc = new RegistrationPropertyDescription(name, QName.valueOf(rpdm.getType()));
+ desc.setDefaultDescription(rpdm.getDescription());
+ desc.setHint(new LocalizedString(rpdm.getHint()));
+ desc.setLabel(new LocalizedString(rpdm.getLabel()));
+ prop.setDescription(desc);
+
+ prop.setStatus(RegistrationProperty.Status.valueOf(rpm.getStatus()));
+ }
+
+ return info;
}
private static class MappingToProducerInfoIterator implements Iterator<ProducerInfo>
@@ -175,19 +277,16 @@
this.mappings = infoMappingIterator;
}
- @Override
public boolean hasNext()
{
return mappings.hasNext();
}
- @Override
public ProducerInfo next()
{
return toProducerInfo(mappings.next());
}
- @Override
public void remove()
{
throw new UnsupportedOperationException("Remove not supported!");
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2009-11-20 23:18:15 UTC (rev 746)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2009-11-20 23:20:21 UTC (rev 747)
@@ -23,6 +23,7 @@
package org.gatein.portal.wsrp.state.consumer.mapping;
+import org.chromattic.api.annotations.Id;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.Property;
@@ -46,9 +47,9 @@
public abstract RegistrationInfoMapping getRegistrationInfo();
@Property(name = "producerid")
- public abstract String getProducerId();
+ public abstract String getId();
- public abstract void setProducerId(String id);
+ public abstract void setId(String id);
@Property(name = "cache")
public abstract Integer getExpirationCacheSeconds();
@@ -60,8 +61,11 @@
public abstract void setActive(boolean active);
- @Property(name = "available")
- public abstract boolean getAvailable();
+ @Id
+ public abstract String getKey();
- public abstract void setAvailable(boolean available);
+ /* @Property(name = "available")
+public abstract boolean getAvailable();
+
+public abstract void setAvailable(boolean available);*/
}
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-20 23:18:15 UTC (rev 746)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java 2009-11-20 23:20:21 UTC (rev 747)
@@ -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;
import org.chromattic.api.annotations.Property;
@@ -56,4 +57,7 @@
@OneToMany
public abstract List<RegistrationPropertyMapping> getRegistrationProperties();
+
+ @Create
+ public abstract RegistrationPropertyMapping create();
}
15 years, 1 month
gatein SVN: r746 - in portal/branches/wsrp-integration/component/common: src/main/java/org/exoplatform/commons/utils and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-20 18:18:15 -0500 (Fri, 20 Nov 2009)
New Revision: 746
Modified:
portal/branches/wsrp-integration/component/common/pom.xml
portal/branches/wsrp-integration/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java
Log:
- Added getBytes method.
Modified: portal/branches/wsrp-integration/component/common/pom.xml
===================================================================
--- portal/branches/wsrp-integration/component/common/pom.xml 2009-11-20 18:01:16 UTC (rev 745)
+++ portal/branches/wsrp-integration/component/common/pom.xml 2009-11-20 23:18:15 UTC (rev 746)
@@ -19,32 +19,38 @@
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.component</artifactId>
- <version>3.0.0-Beta03-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>exo.portal.component.common</artifactId>
- <packaging>jar</packaging>
- <name>GateIn Portal Component Common</name>
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons</artifactId>
- <version>${org.exoplatform.kernel.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.database</artifactId>
- <version>${org.exoplatform.core.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component</artifactId>
+ <version>3.0.0-Beta03-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>exo.portal.component.common</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn Portal Component Common</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.database</artifactId>
+ <version>${org.exoplatform.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ <version>${org.gatein.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
Modified: portal/branches/wsrp-integration/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java
===================================================================
--- portal/branches/wsrp-integration/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java 2009-11-20 18:01:16 UTC (rev 745)
+++ portal/branches/wsrp-integration/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java 2009-11-20 23:18:15 UTC (rev 746)
@@ -1,16 +1,16 @@
/**
* 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
@@ -19,8 +19,11 @@
package org.exoplatform.commons.utils;
+import org.gatein.common.io.IOTools;
+
import java.io.Closeable;
import java.io.IOException;
+import java.io.InputStream;
/**
* A class that contains utility method that make the caller not worry much about the unexpectable expected such as
@@ -37,8 +40,8 @@
}
/**
- * Return true if both objects are null or both are non null and the equals method of one object returns true when
- * it is invoked with the other object as argument.
+ * Return true if both objects are null or both are non null and the equals method of one object returns true when it
+ * is invoked with the other object as argument.
*
* @param o1 the first object
* @param o2 the second object
@@ -57,8 +60,8 @@
}
/**
- * Close a closable object. The provided object may be null or thrown an IOException or a runtime exception during the
- * invocation of the close method without changing the control flow of the method caller. If the closeable was
+ * Close a closable object. The provided object may be null or thrown an IOException or a runtime exception during
+ * the invocation of the close method without changing the control flow of the method caller. If the closeable was
* succesfully closed the method returns true.
*
* @param closeable the closeable
@@ -82,4 +85,29 @@
}
return false;
}
+
+ public static byte[] getBytes(InputStream is)
+ {
+ byte[] bytes;
+
+ if (is == null)
+ {
+ return null;
+ }
+
+ try
+ {
+ bytes = IOTools.getBytes(is);
+ return bytes;
+ }
+ catch (IOException ignore)
+ {
+ // todo: should log
+ return null;
+ }
+ finally
+ {
+ IOTools.safeClose(is);
+ }
+ }
}
15 years, 1 month
gatein SVN: r745 - in components/mop/trunk: api/src/main/java/org/gatein/mop/api/content and 14 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-20 13:01:16 -0500 (Fri, 20 Nov 2009)
New Revision: 745
Added:
components/mop/trunk/core/src/main/resources/conf/configuration.xml
components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/
components/mop/trunk/core/src/test/resources/conf/configuration.xml
components/mop/trunk/core/src/test/resources/conf/content-nodetypes.xml
Removed:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/
components/mop/trunk/core/src/main/resources/conf/standalone/
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/
components/mop/trunk/core/src/test/resources/conf/standalone/
components/mop/trunk/core/src/test/resources/indexing-configuration.xml
components/mop/trunk/core/src/test/resources/synonyms.properties
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/GetState.java
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/BiltoTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/content/CustomizationTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletDefinition.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferenceState.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preference.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preferences.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PreferencesBuilder.java
components/mop/trunk/pom.xml
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java
Log:
- update to pom dependency 1.0.0-Beta03
- update to chromattic 1.0.0-beta8
- refactored configuration for unit tests
- refactored mop node types to remove the customization types implementations
- moved the customization type code in the unit test package as the portal redefines them
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -38,6 +38,11 @@
String getId();
/**
+ * Returns the content this customization refers to.
+ */
+ Content<S> getContent();
+
+ /**
* Returns the content id this customization refers to.
*
* @return the content id
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -43,13 +43,6 @@
import org.gatein.mop.core.api.workspace.content.ContextSpecialization;
import org.gatein.mop.core.api.workspace.content.WorkspaceClone;
import org.gatein.mop.core.api.workspace.content.WorkspaceSpecialization;
-import org.gatein.mop.core.content.portlet.PortletPreferencesState;
-import org.gatein.mop.core.content.portlet.PortletPreferenceState;
-import org.gatein.mop.core.content.portlet.Preferences;
-import org.gatein.mop.core.content.portlet.PortletContentProvider;
-import org.gatein.mop.core.content.gadget.GadgetState;
-import org.gatein.mop.core.content.gadget.Gadget;
-import org.gatein.mop.core.content.gadget.GadgetContentProvider;
import org.gatein.mop.core.api.content.ContentManagerRegistry;
import org.gatein.mop.core.api.content.CustomizationContextProviderRegistry;
@@ -57,97 +50,113 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class MOPService {
+public class MOPService
+{
- /** . */
- private Chromattic chrome;
+ /** . */
+ private Chromattic chrome;
- /** . */
- private ContentManagerRegistry contentManagerRegistry;
+ /** . */
+ private ContentManagerRegistry contentManagerRegistry;
- /** . */
- private CustomizationContextProviderRegistry customizationContextResolvers;
+ /** . */
+ private CustomizationContextProviderRegistry customizationContextResolvers;
- /** . */
- private final ChromatticBuilder builder;
+ /** . */
+ private final ChromatticBuilder builder;
- public MOPService() {
- ChromatticBuilder builder = ChromatticBuilder.create();
-// builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME, "org.chromattic.cglib.CGLibInstrumentor");
- builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME, "org.chromattic.apt.InstrumentorImpl");
- builder.setOption(ChromatticBuilder.OBJECT_FORMATTER_CLASSNAME, MOPFormatter.class.getName());
+ public MOPService()
+ {
+ ChromatticBuilder builder = ChromatticBuilder.create();
+ builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME, "org.chromattic.apt.InstrumentorImpl");
+ builder.setOption(ChromatticBuilder.OBJECT_FORMATTER_CLASSNAME, MOPFormatter.class.getName());
- //
- this.builder = builder;
- }
+ //
+ this.builder = builder;
+ }
- public <T> void setOption(ChromatticBuilder.Option<T> option, T value) {
- builder.setOption(option, value);
- }
+ public CustomizationContextProviderRegistry getCustomizationContextResolvers()
+ {
+ return customizationContextResolvers;
+ }
- public CustomizationContextProviderRegistry getCustomizationContextResolvers() {
- return customizationContextResolvers;
- }
+ public ContentManagerRegistry getContentManagerRegistry()
+ {
+ return contentManagerRegistry;
+ }
- public ContentManagerRegistry getContentManagerRegistry() {
- return contentManagerRegistry;
- }
+ protected void configure(CustomizationContextProviderRegistry registry)
+ {
+ //
+ }
- public void start() throws Exception {
- builder.add(WorkspaceImpl.class);
- builder.add(UIContainerImpl.class);
- builder.add(UIWindowImpl.class);
- builder.add(UIBodyImpl.class);
- builder.add(PageImpl.class);
- builder.add(PageContainer.class);
- builder.add(NavigationImpl.class);
- builder.add(NavigationContainer.class);
- builder.add(PageLinkImpl.class);
- builder.add(URLLinkImpl.class);
- builder.add(PortalSiteContainer.class);
- builder.add(PortalSite.class);
- builder.add(GroupSiteContainer.class);
- builder.add(GroupSite.class);
- builder.add(UserSiteContainer.class);
- builder.add(UserSite.class);
+ protected void configure(ChromatticBuilder builder)
+ {
+ //
+ }
- //
- builder.add(CustomizationContainer.class);
- builder.add(ContextTypeContainer.class);
- builder.add(ContextType.class);
- builder.add(ContextSpecialization.class);
- builder.add(WorkspaceClone.class);
- builder.add(WorkspaceSpecialization.class);
+ protected void configure(ContentManagerRegistry registry)
+ {
+ //
+ }
- //
- builder.add(PortletPreferencesState.class);
- builder.add(PortletPreferenceState.class);
+ public void start() throws Exception
+ {
+ builder.add(WorkspaceImpl.class);
+ builder.add(UIContainerImpl.class);
+ builder.add(UIWindowImpl.class);
+ builder.add(UIBodyImpl.class);
+ builder.add(PageImpl.class);
+ builder.add(PageContainer.class);
+ builder.add(NavigationImpl.class);
+ builder.add(NavigationContainer.class);
+ builder.add(PageLinkImpl.class);
+ builder.add(URLLinkImpl.class);
+ builder.add(PortalSiteContainer.class);
+ builder.add(PortalSite.class);
+ builder.add(GroupSiteContainer.class);
+ builder.add(GroupSite.class);
+ builder.add(UserSiteContainer.class);
+ builder.add(UserSite.class);
- //
- builder.add(GadgetState.class);
+ //
+ builder.add(CustomizationContainer.class);
+ builder.add(ContextTypeContainer.class);
+ builder.add(ContextType.class);
+ builder.add(ContextSpecialization.class);
+ builder.add(WorkspaceClone.class);
+ builder.add(WorkspaceSpecialization.class);
- //
- chrome = builder.build();
-
- //
- CustomizationContextProviderRegistry customizationContextResolvers = new CustomizationContextProviderRegistry();
+ //
+ configure(builder);
- //
- ContentManagerRegistry cmr = new ContentManagerRegistry();
- cmr.register(Preferences.CONTENT_TYPE, new PortletContentProvider());
- cmr.register(Gadget.CONTENT_TYPE, new GadgetContentProvider());
+ //
+ chrome = builder.build();
- //
- this.chrome = builder.build();
- this.contentManagerRegistry = cmr;
- this.customizationContextResolvers = customizationContextResolvers;
- }
+ //
+ CustomizationContextProviderRegistry customizationContextResolvers = new CustomizationContextProviderRegistry();
- public ModelImpl getModel() {
- ChromatticSession chromeSession = chrome.openSession();
- return new ModelImpl(
- chromeSession,
- contentManagerRegistry,
- customizationContextResolvers);
- }
+ //
+ configure(customizationContextResolvers);
+
+ //
+ ContentManagerRegistry cmr = new ContentManagerRegistry();
+
+ //
+ configure(cmr);
+
+ //
+ this.chrome = builder.build();
+ this.contentManagerRegistry = cmr;
+ this.customizationContextResolvers = customizationContextResolvers;
+ }
+
+ public ModelImpl getModel()
+ {
+ ChromatticSession chromeSession = chrome.openSession();
+ return new ModelImpl(
+ chromeSession,
+ contentManagerRegistry,
+ customizationContextResolvers);
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -56,136 +56,174 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ModelImpl implements Model {
+public class ModelImpl implements Model
+{
- /** . */
- private static final Map<ObjectType<?>, Class<? extends WorkspaceObjectImpl>> typeToClassImpl;
+ /** . */
+ private static final Map<ObjectType<?>, Class<? extends WorkspaceObjectImpl>> typeToClassImpl;
- static {
- Map<ObjectType<?>, Class<? extends WorkspaceObjectImpl>> tmp = new HashMap<ObjectType<?>, Class<? extends WorkspaceObjectImpl>>();
- tmp.put(ObjectType.ANY, WorkspaceObjectImpl.class);
- tmp.put(ObjectType.WORKSPACE, WorkspaceImpl.class);
- tmp.put(ObjectType.SITE, SiteImpl.class);
- tmp.put(ObjectType.PORTAL_SITE, PortalSite.class);
- tmp.put(ObjectType.GROUP_SITE, GroupSite.class);
- tmp.put(ObjectType.USER_SITE, UserSite.class);
- tmp.put(ObjectType.SHARED_SITE, SharedSite.class);
- tmp.put(ObjectType.PAGE, PageImpl.class);
- tmp.put(ObjectType.NAVIGATION, NavigationImpl.class);
- tmp.put(ObjectType.COMPONENT, UIComponentImpl.class);
- tmp.put(ObjectType.BODY, UIBodyImpl.class);
- tmp.put(ObjectType.CONTAINER, UIContainerImpl.class);
- tmp.put(ObjectType.WINDOW, UIWindowImpl.class);
- tmp.put(ObjectType.PAGE_LINK, PageLinkImpl.class);
- tmp.put(ObjectType.URL_LINK, URLLinkImpl.class);
- typeToClassImpl = tmp;
- }
+ static
+ {
+ Map<ObjectType<?>, Class<? extends WorkspaceObjectImpl>> tmp = new HashMap<ObjectType<?>, Class<? extends WorkspaceObjectImpl>>();
+ tmp.put(ObjectType.ANY, WorkspaceObjectImpl.class);
+ tmp.put(ObjectType.WORKSPACE, WorkspaceImpl.class);
+ tmp.put(ObjectType.SITE, SiteImpl.class);
+ tmp.put(ObjectType.PORTAL_SITE, PortalSite.class);
+ tmp.put(ObjectType.GROUP_SITE, GroupSite.class);
+ tmp.put(ObjectType.USER_SITE, UserSite.class);
+ tmp.put(ObjectType.SHARED_SITE, SharedSite.class);
+ tmp.put(ObjectType.PAGE, PageImpl.class);
+ tmp.put(ObjectType.NAVIGATION, NavigationImpl.class);
+ tmp.put(ObjectType.COMPONENT, UIComponentImpl.class);
+ tmp.put(ObjectType.BODY, UIBodyImpl.class);
+ tmp.put(ObjectType.CONTAINER, UIContainerImpl.class);
+ tmp.put(ObjectType.WINDOW, UIWindowImpl.class);
+ tmp.put(ObjectType.PAGE_LINK, PageLinkImpl.class);
+ tmp.put(ObjectType.URL_LINK, URLLinkImpl.class);
+ typeToClassImpl = tmp;
+ }
- /** . */
- private final ChromatticSession session;
+ /** . */
+ private final ChromatticSession session;
- /** . */
- private final ContentManagerRegistry contentManagers;
+ /** . */
+ private final ContentManagerRegistry contentManagers;
- /** . */
- private final CustomizationContextProviderRegistry customizationContextResolvers;
+ /** . */
+ private final CustomizationContextProviderRegistry customizationContextResolvers;
- /** . */
- private WorkspaceImpl workspace;
+ /** . */
+ private WorkspaceImpl workspace;
- /** . */
- private final CustomizationContextResolver customizationContextResolver = new CustomizationContextResolver() {
- public CustomizationContext resolve(String contextType, String contextId) {
- if (WorkspaceCustomizationContext.TYPE.equals(contextType)) {
- return findObjectById(ObjectType.WINDOW, contextId);
- } else {
- return customizationContextResolvers.resolve(contextType, contextId);
+ /** . */
+ private final CustomizationContextResolver customizationContextResolver = new CustomizationContextResolver()
+ {
+ public CustomizationContext resolve(String contextType, String contextId)
+ {
+ if (WorkspaceCustomizationContext.TYPE.equals(contextType))
+ {
+ return findObjectById(ObjectType.WINDOW, contextId);
+ }
+ else
+ {
+ return customizationContextResolvers.resolve(contextType, contextId);
+ }
}
- }
- };
+ };
- public ModelImpl(ChromatticSession session, ContentManagerRegistry contentManagers, CustomizationContextProviderRegistry customizationContextResolvers) {
+ public ModelImpl(ChromatticSession session, ContentManagerRegistry contentManagers, CustomizationContextProviderRegistry customizationContextResolvers)
+ {
- //
- this.session = session;
- this.contentManagers = contentManagers;
- this.customizationContextResolvers = customizationContextResolvers;
+ //
+ this.session = session;
+ this.contentManagers = contentManagers;
+ this.customizationContextResolvers = customizationContextResolvers;
- //
- session.addEventListener(contextualizer);
- }
+ //
+ session.addEventListener(contextualizer);
+ }
- public Workspace getWorkspace() {
- return getWorkspaceImpl();
- }
+ public ChromatticSession getSession()
+ {
+ return session;
+ }
- private WorkspaceImpl getWorkspaceImpl() {
- if (workspace == null) {
- workspace = session.findByPath(WorkspaceImpl.class, "workspace");
- if (workspace == null) {
- workspace = session.insert(WorkspaceImpl.class, "workspace");
+ public Workspace getWorkspace()
+ {
+ return getWorkspaceImpl();
+ }
+
+ private WorkspaceImpl getWorkspaceImpl()
+ {
+ if (workspace == null)
+ {
+ workspace = session.findByPath(WorkspaceImpl.class, "workspace");
+ if (workspace == null)
+ {
+ workspace = session.insert(WorkspaceImpl.class, "workspace");
+ }
}
- }
- return workspace;
- }
+ return workspace;
+ }
- public void save() {
- session.save();
- }
+ public void save()
+ {
+ session.save();
+ }
- public void close() {
- session.close();
- }
+ public void close()
+ {
+ session.close();
+ }
- private final LifeCycleListener contextualizer = new LifeCycleListener() {
- public void created(Object o) {
- inject(o, false);
- }
- public void loaded(String id, String path, String name, Object o) {
- inject(o, true);
- }
- public void added(String id, String path, String name, Object o) {
- inject(o, true);
- }
- public void removed(String id, String path, String name, Object o) {
- }
- };
+ private final LifeCycleListener contextualizer = new LifeCycleListener()
+ {
+ public void created(Object o)
+ {
+ inject(o, false);
+ }
- public Customization<?> findCustomizationById(String id) {
- return session.findById(Customization.class, id);
- }
+ public void loaded(String id, String path, String name, Object o)
+ {
+ inject(o, true);
+ }
- public <O extends WorkspaceObject> Iterator<O> findObject(ObjectType<O> type, String statement) {
- Class<? extends WorkspaceObjectImpl> impl = typeToClassImpl.get(type);
- return session.createQueryBuilder().from(impl).<O>where(statement).get().iterator();
- }
+ public void added(String id, String path, String name, Object o)
+ {
+ inject(o, true);
+ }
- public String pathOf(WorkspaceObject o) {
- return session.getPath(o);
- }
+ public void removed(String id, String path, String name, Object o)
+ {
+ }
+ };
- public <O extends WorkspaceObject> O findObjectByPath(ObjectType<? extends O> type, String path) {
- Class<? extends O> t = type.getJavaType();
- return session.findByPath(t, path);
- }
+ public Customization<?> findCustomizationById(String id)
+ {
+ return session.findById(Customization.class, id);
+ }
- private void inject(Object o, boolean persistent) {
- if (o instanceof AbstractCustomization) {
- ((AbstractCustomization)o).session = session;
- ((AbstractCustomization)o).registry = contentManagers;
- }
- if (o instanceof ContextSpecialization) {
- ((ContextSpecialization)o).setCustomizationContextResolver(customizationContextResolver);
- }
- }
+ public <O extends WorkspaceObject> Iterator<O> findObject(ObjectType<O> type, String statement)
+ {
+ Class<? extends WorkspaceObjectImpl> impl = typeToClassImpl.get(type);
+ return session.createQueryBuilder().from(impl).<O>where(statement).get().iterator();
+ }
- public <O extends WorkspaceObject> O findObjectById(ObjectType<O> type, String id) {
- Class<? extends WorkspaceObjectImpl> impl = typeToClassImpl.get(type);
- WorkspaceObjectImpl object = session.findById(impl, id);
- if (object != null) {
- return type.cast(object);
- } else {
- return null;
- }
- }
+ public String pathOf(WorkspaceObject o)
+ {
+ return session.getPath(o);
+ }
+
+ public <O extends WorkspaceObject> O findObjectByPath(ObjectType<? extends O> type, String path)
+ {
+ Class<? extends O> t = type.getJavaType();
+ return session.findByPath(t, path);
+ }
+
+ private void inject(Object o, boolean persistent)
+ {
+ if (o instanceof AbstractCustomization)
+ {
+ ((AbstractCustomization)o).session = session;
+ ((AbstractCustomization)o).registry = contentManagers;
+ }
+ if (o instanceof ContextSpecialization)
+ {
+ ((ContextSpecialization)o).setCustomizationContextResolver(customizationContextResolver);
+ }
+ }
+
+ public <O extends WorkspaceObject> O findObjectById(ObjectType<O> type, String id)
+ {
+ Class<? extends WorkspaceObjectImpl> impl = typeToClassImpl.get(type);
+ WorkspaceObjectImpl object = session.findById(impl, id);
+ if (object != null)
+ {
+ return type.cast(object);
+ }
+ else
+ {
+ return null;
+ }
+ }
}
Added: components/mop/trunk/core/src/main/resources/conf/configuration.xml
===================================================================
--- components/mop/trunk/core/src/main/resources/conf/configuration.xml (rev 0)
+++ components/mop/trunk/core/src/main/resources/conf/configuration.xml 2009-11-20 18:01:16 UTC (rev 745)
@@ -0,0 +1,53 @@
+<?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">
+
+ <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="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/mop-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Copied: components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml (from rev 669, components/mop/trunk/core/src/main/resources/conf/standalone/nodetypes.xml)
===================================================================
--- components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml (rev 0)
+++ components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml 2009-11-20 18:01:16 UTC (rev 745)
@@ -0,0 +1,452 @@
+<!--
+
+ 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.
+
+-->
+<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="mop:customizationstate" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:contexttypecontainer" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:contexttype" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:contexttype</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:contexttype" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:contextspecialization" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:contextspecialization</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:customization" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="contexttypes" defaultPrimaryType="mop:contexttypecontainer" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:contexttypecontainer</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="state" defaultPrimaryType="mop:customizationstate" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:customizationstate</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <!-- -->
+
+ <nodeType name="mop:workspacecustomization" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customization</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="contentid" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="mimetype" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:workspaceclone" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:workspacecustomization</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:workspacespecialization" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:workspacecustomization</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="customization" requiredType="Path" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:contextspecialization" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customization</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:customizationcontainer" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:workspacecustomization" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:workspacecustomization</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:customizationcontext" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="customizations" defaultPrimaryType="mop:customizationcontainer" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:customizationcontainer</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <!-- -->
+
+ <nodeType name="mop:workspaceobject" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY"
+ protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:uicomponent" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:workspaceobject</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:uicontainer" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>mop:uicomponent</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:uicomponent</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:uiwindow" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:uicomponent</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="customization" defaultPrimaryType="mop:workspacecustomization" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:workspacecustomization</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:uibody" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:uicomponent</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:templatized" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
+ <propertyDefinitions>
+ <propertyDefinition name="template" requiredType="Path" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:navigation" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:workspaceobject</supertype>
+ <supertype>mop:templatized</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="children" defaultPrimaryType="mop:navigationcontainer" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:navigationcontainer</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="link" defaultPrimaryType="mop:link" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:link</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:navigationcontainer" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:navigation" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:navigation</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:link" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:workspaceobject</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:pagelink" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:link</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="page" requiredType="Path" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:urllink" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:link</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="url" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:page" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:workspaceobject</supertype>
+ <supertype>mop:templatized</supertype>
+ <supertype>mop:customizationcontext</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="children" defaultPrimaryType="mop:pagecontainer" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:pagecontainer</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="rootcomponent" defaultPrimaryType="mop:uicontainer" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:uicontainer</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:pagecontainer" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:page" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:page</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:site" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:workspaceobject</supertype>
+ <supertype>mop:customizationcontext</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="rootpage" defaultPrimaryType="mop:page" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:page</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="rootnavigation" defaultPrimaryType="mop:navigation" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:navigation</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:portalsite" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:site</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:groupsite" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:site</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:usersite" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:site</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:sharedsite" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:site</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:portalsites" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:portalsite" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:portalsite</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:groupsites" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:groupsite" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:groupsite</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:usersites" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:usersite" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:usersite</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:sharedsites" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:sharedsite" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:sharedsite</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:workspace" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:workspaceobject</supertype>
+ <supertype>mop:customizationcontext</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="portalsites" defaultPrimaryType="mop:portalsites" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:portalsites</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="groupsites" defaultPrimaryType="mop:groupsites" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:groupsites</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="usersites" defaultPrimaryType="mop:usersites" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:usersites</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="sharedsites" defaultPrimaryType="mop:sharedsites" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:sharedsites</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+</nodeTypes>
+
\ No newline at end of file
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -22,9 +22,10 @@
import java.util.Collections;
-import org.gatein.mop.core.content.portlet.Preference;
-import org.gatein.mop.core.content.portlet.Preferences;
-import org.gatein.mop.core.content.portlet.PortletContentProvider;
+import org.gatein.mop.core.support.TestMOPService;
+import org.gatein.mop.core.support.content.portlet.Preference;
+import org.gatein.mop.core.support.content.portlet.Preferences;
+import org.gatein.mop.core.support.content.portlet.PortletContentProvider;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -40,10 +41,9 @@
Preferences weatherPreferences = new Preferences(Collections.<String, Preference>singletonMap(
"zip", new Preference("zip", Collections.singletonList("marseille"), false)));
PortletContentProvider portletContentProvider = new PortletContentProvider();
- portletContentProvider.addPortletDefinition("WeatherPortlet", weatherPreferences);
//
- MOPService pomService = new MOPService();
+ MOPService pomService = new TestMOPService();
//
pomService.start();
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/BiltoTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/BiltoTestCase.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/BiltoTestCase.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -20,7 +20,7 @@
import org.gatein.mop.core.api.AbstractPOMTestCase;
import org.gatein.mop.api.content.ContentType;
-import org.gatein.mop.core.content.portlet.Preferences;
+import org.gatein.mop.core.support.content.portlet.Preferences;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/content/CustomizationTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/content/CustomizationTestCase.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/content/CustomizationTestCase.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -19,8 +19,8 @@
package org.gatein.mop.core.api.workspace.content;
import org.gatein.mop.core.api.AbstractPOMTestCase;
-import org.gatein.mop.core.content.portlet.Preferences;
-import org.gatein.mop.core.content.portlet.PreferencesBuilder;
+import org.gatein.mop.core.support.content.portlet.Preferences;
+import org.gatein.mop.core.support.content.portlet.PreferencesBuilder;
import org.gatein.mop.api.workspace.Workspace;
import org.gatein.mop.api.workspace.ObjectType;
import org.gatein.mop.api.workspace.Site;
Added: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java (rev 0)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.gatein.mop.core.support;
+
+import org.chromattic.api.ChromatticBuilder;
+import org.gatein.mop.core.api.MOPService;
+import org.gatein.mop.core.api.content.ContentManagerRegistry;
+import org.gatein.mop.core.support.content.gadget.Gadget;
+import org.gatein.mop.core.support.content.gadget.GadgetContentProvider;
+import org.gatein.mop.core.support.content.gadget.GadgetState;
+import org.gatein.mop.core.support.content.portlet.PortletContentProvider;
+import org.gatein.mop.core.support.content.portlet.PortletPreferenceState;
+import org.gatein.mop.core.support.content.portlet.PortletPreferencesState;
+import org.gatein.mop.core.support.content.portlet.Preferences;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestMOPService extends MOPService
+{
+
+ @Override
+ protected void configure(ChromatticBuilder builder)
+ {
+ builder.add(PortletPreferencesState.class);
+ builder.add(PortletPreferenceState.class);
+
+ //
+ builder.add(GadgetState.class);
+ }
+
+ @Override
+ protected void configure(ContentManagerRegistry registry)
+ {
+ registry.register(Preferences.CONTENT_TYPE, new PortletContentProvider());
+ registry.register(Gadget.CONTENT_TYPE, new GadgetContentProvider());
+ }
+}
Copied: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content (from rev 669, components/mop/trunk/core/src/main/java/org/gatein/mop/core/content)
Copied: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget (from rev 744, components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/gadget)
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/gadget/Gadget.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see<http://www.gnu.org/licenses/>.
*/
-package org.gatein.mop.core.content.gadget;
+package org.gatein.mop.core.support.content.gadget;
import org.gatein.mop.api.content.ContentType;
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/gadget/GadgetContentProvider.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -14,10 +14,9 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see<http://www.gnu.org/licenses/>.
*/
-package org.gatein.mop.core.content.gadget;
+package org.gatein.mop.core.support.content.gadget;
import org.gatein.mop.spi.content.ContentProvider;
-import org.gatein.mop.spi.content.GetState;
import org.gatein.mop.spi.content.StateContainer;
import org.gatein.mop.core.api.workspace.content.AbstractCustomization;
import org.chromattic.api.ChromatticSession;
@@ -33,10 +32,6 @@
*/
public class GadgetContentProvider implements ContentProvider<Gadget> {
- public GetState<Gadget> getState(String contentId) {
- throw new UnsupportedOperationException();
- }
-
public Gadget combine(List<Gadget> states) {
throw new UnsupportedOperationException();
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/gadget/GadgetState.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see<http://www.gnu.org/licenses/>.
*/
-package org.gatein.mop.core.content.gadget;
+package org.gatein.mop.core.support.content.gadget;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.Property;
Copied: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet (from rev 744, components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/portlet)
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/portlet/PortletContentProvider.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -16,15 +16,11 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.gatein.mop.core.content.portlet;
+package org.gatein.mop.core.support.content.portlet;
import org.gatein.mop.spi.content.ContentProvider;
-import org.gatein.mop.spi.content.GetState;
import org.gatein.mop.spi.content.StateContainer;
-import org.gatein.mop.core.content.portlet.Preference;
-import org.gatein.mop.core.content.portlet.Preferences;
import org.gatein.mop.core.api.workspace.content.AbstractCustomization;
-import org.gatein.mop.core.content.portlet.PortletPreferencesState;
import org.chromattic.api.ChromatticSession;
import org.chromattic.api.UndeclaredRepositoryException;
@@ -40,26 +36,6 @@
*/
public class PortletContentProvider implements ContentProvider<Preferences> {
- /** . */
- private Map<String, PortletDefinition> definitions;
-
- public PortletContentProvider() {
- definitions = new HashMap<String, PortletDefinition>();
- }
-
- public void addPortletDefinition(String name, Preferences preferences) {
- definitions.put(name, new PortletDefinition(name, preferences));
- }
-
- public GetState<Preferences> getState(String contentId) {
- PortletDefinition def = definitions.get(contentId);
- if (def != null) {
- return new GetState<Preferences>(def.getPreferences());
- } else {
- return null;
- }
- }
-
public Preferences combine(List<Preferences> states) {
Map<String, Preference> entries = new HashMap<String, Preference>();
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletDefinition.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/portlet/PortletDefinition.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletDefinition.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -16,9 +16,9 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.gatein.mop.core.content.portlet;
+package org.gatein.mop.core.support.content.portlet;
-import org.gatein.mop.core.content.portlet.Preferences;
+import org.gatein.mop.core.support.content.portlet.Preferences;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferenceState.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/portlet/PortletPreferenceState.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferenceState.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -16,7 +16,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.gatein.mop.core.content.portlet;
+package org.gatein.mop.core.support.content.portlet;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.ManyToOne;
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/portlet/PortletPreferencesState.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -16,16 +16,16 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.gatein.mop.core.content.portlet;
+package org.gatein.mop.core.support.content.portlet;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.Create;
import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.RelatedMappedBy;
-import org.gatein.mop.core.content.portlet.Preferences;
-import org.gatein.mop.core.content.portlet.Preference;
-import org.gatein.mop.core.content.portlet.PreferencesBuilder;
+import org.gatein.mop.core.support.content.portlet.Preferences;
+import org.gatein.mop.core.support.content.portlet.Preference;
+import org.gatein.mop.core.support.content.portlet.PreferencesBuilder;
import org.gatein.mop.core.api.workspace.content.AbstractCustomization;
import java.util.Map;
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preference.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/portlet/Preference.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preference.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -16,7 +16,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.gatein.mop.core.content.portlet;
+package org.gatein.mop.core.support.content.portlet;
import java.util.List;
import java.util.Collections;
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preferences.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/portlet/Preferences.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preferences.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -16,7 +16,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.gatein.mop.core.content.portlet;
+package org.gatein.mop.core.support.content.portlet;
import org.gatein.mop.api.content.ContentType;
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PreferencesBuilder.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/content/portlet/PreferencesBuilder.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PreferencesBuilder.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -16,7 +16,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.gatein.mop.core.content.portlet;
+package org.gatein.mop.core.support.content.portlet;
import java.util.List;
Added: components/mop/trunk/core/src/test/resources/conf/configuration.xml
===================================================================
--- components/mop/trunk/core/src/test/resources/conf/configuration.xml (rev 0)
+++ components/mop/trunk/core/src/test/resources/conf/configuration.xml 2009-11-20 18:01:16 UTC (rev 745)
@@ -0,0 +1,42 @@
+<?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">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
+ <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/content-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added: components/mop/trunk/core/src/test/resources/conf/content-nodetypes.xml
===================================================================
--- components/mop/trunk/core/src/test/resources/conf/content-nodetypes.xml (rev 0)
+++ components/mop/trunk/core/src/test/resources/conf/content-nodetypes.xml 2009-11-20 18:01:16 UTC (rev 745)
@@ -0,0 +1,63 @@
+<!--
+
+ 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.
+
+-->
+<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="mop:portletpreferences" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customizationstate</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:portletpreference" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:portletpreference</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:portletpreference" isMixin="false" hasOrderableChildNodes="false" 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="readonly" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:gadget" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customizationstate</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="prefs" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
Deleted: components/mop/trunk/core/src/test/resources/indexing-configuration.xml
===================================================================
--- components/mop/trunk/core/src/test/resources/indexing-configuration.xml 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/resources/indexing-configuration.xml 2009-11-20 18:01:16 UTC (rev 745)
@@ -1,50 +0,0 @@
-<?xml version="1.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.
-
--->
-<!DOCTYPE configuration SYSTEM "http://www.exoplatform.org/dtd/indexing-configuration-1.0.dtd">
-<configuration xmlns:jcr="http://www.jcp.org/jcr/1.0"
- xmlns:nt="http://www.jcp.org/jcr/nt/1.0">
-
- <!--aggregate primaryType="nt:file">
- <include>jcr:content</include>
- </aggregate-->
-
- <index-rule nodeType="nt:unstructured"
- boost="2.0"
- condition="ancestor::*/@priority = 'low'">
- <property>Text</property>
- </index-rule>
-
- <index-rule nodeType="nt:unstructured"
- boost="2.0"
- condition="parent::indrootparent/@priority = 'low'">
- <property>Text</property>
- </index-rule>
-
- <index-rule nodeType="nt:unstructured"
- boost="2.0"
- condition="indrootchild/@priority = 'gg'">
- <property>Text</property>
- </index-rule>
-
-</configuration>
-
-
Deleted: components/mop/trunk/core/src/test/resources/synonyms.properties
===================================================================
--- components/mop/trunk/core/src/test/resources/synonyms.properties 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/core/src/test/resources/synonyms.properties 2009-11-20 18:01:16 UTC (rev 745)
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# this is a synonym definition file for PropertiesSynonymProvider
-ASF=Apache Software Foundation
-quick=fast
-sluggish=lazy
\ No newline at end of file
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/pom.xml 2009-11-20 18:01:16 UTC (rev 745)
@@ -53,7 +53,7 @@
<dependency>
<groupId>org.gatein</groupId>
<artifactId>gatein-dep</artifactId>
- <version>1.0.0-Beta02</version>
+ <version>1.0.0-Beta03</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -69,6 +69,7 @@
<artifactId>mop-spi</artifactId>
<version>${project.version}</version>
</dependency>
+
</dependencies>
</dependencyManagement>
Modified: components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java
===================================================================
--- components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -27,16 +27,6 @@
public interface ContentProvider<S> {
/**
- * <p>Returns the state wrapper associated with the specified content or null if no relationship can be
- * done with the specifiec content. When the <tt>GetState</tt> response is returned with a null state
- * it means that the content is found but is stateless.</p>
- *
- * @param contentId the content id
- * @return the content state
- */
- GetState<S> getState(String contentId);
-
- /**
* Combines several states into a single state representation.
*
* @param states the various states to combine
Deleted: components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/GetState.java
===================================================================
--- components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/GetState.java 2009-11-20 17:18:44 UTC (rev 744)
+++ components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/GetState.java 2009-11-20 18:01:16 UTC (rev 745)
@@ -1,37 +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.gatein.mop.spi.content;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class GetState<S> {
-
- /** . */
- private final S state;
-
- public GetState(S state) {
- this.state = state;
- }
-
- public S getState() {
- return state;
- }
-}
15 years, 1 month
gatein SVN: r744 - in portal/trunk: component/application-registry/src/test/java/conf/portal and 13 other directories.
by do-not-reply@jboss.org
Author: bdaw
Date: 2009-11-20 12:18:44 -0500 (Fri, 20 Nov 2009)
New Revision: 744
Added:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
Removed:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMOrganizationServiceImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMService.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMServiceImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/
Modified:
portal/trunk/component/application-registry/src/test/java/conf/portal/idm-configuration.xml
portal/trunk/component/identity/pom.xml
portal/trunk/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml
portal/trunk/component/identity/src/main/java/conf/portal/idm-config.xml
portal/trunk/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
portal/trunk/component/portal/pom.xml
portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml
portal/trunk/component/portal/src/test/java/conf/portal/idm-configuration.xml
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
portal/trunk/docs/user-guide/en/modules/configuration/IDM_Configuration.xml
portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
portal/trunk/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
Log:
- upgrade to PicketLink IDM (former JBoss Identity) 1.0.0.CR1
- remove separate IDM hibernate config
Modified: portal/trunk/component/application-registry/src/test/java/conf/portal/idm-configuration.xml
===================================================================
--- portal/trunk/component/application-registry/src/test/java/conf/portal/idm-configuration.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/application-registry/src/test/java/conf/portal/idm-configuration.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -25,8 +25,8 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
@@ -34,18 +34,18 @@
</value-param>
<values-param>
<name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObject</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateRealm</value>
</values-param>
<properties-param>
<name>hibernate.properties</name>
@@ -70,7 +70,7 @@
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
</configuration>
Modified: portal/trunk/component/identity/pom.xml
===================================================================
--- portal/trunk/component/identity/pom.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/identity/pom.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -55,24 +55,24 @@
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-core</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-core</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-hibernate</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-hibernate</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-ldap</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-ldap</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-cache</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-cache</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<!--To use instead of outdated version from xdoclet-->
Modified: portal/trunk/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml
===================================================================
--- portal/trunk/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -41,19 +41,5 @@
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
- <!-- Mapping classes -->
- <!-- all nessesary mappings are added programatically to the configuration -->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>-->
-
</session-factory>
</hibernate-configuration>
\ No newline at end of file
Modified: portal/trunk/component/identity/src/main/java/conf/portal/idm-config.xml
===================================================================
--- portal/trunk/component/identity/src/main/java/conf/portal/idm-config.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/identity/src/main/java/conf/portal/idm-config.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -20,9 +20,9 @@
-->
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_beta"
+<jboss-identity xmlns="urn:picketlink:idm:config:v1_0_0_cr1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
+ xsi:schemaLocation="urn:picketlink:idm:config:v1_0_0_cr1 identity-config.xsd">
<realms>
<realm>
<id>PortalRealm</id>
@@ -35,7 +35,7 @@
<repositories>
<repository>
<id>PortalRepository</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <class>org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository</class>
<external-config/>
<default-identity-store-id>HibernateStore</default-identity-store-id>
<default-attribute-store-id>HibernateStore</default-attribute-store-id>
@@ -46,7 +46,7 @@
<identity-stores>
<identity-store>
<id>HibernateStore</id>
- <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <class>org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
<external-config/>
<supported-relationship-types>
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
Modified: portal/trunk/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml
===================================================================
--- portal/trunk/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -25,8 +25,8 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
@@ -41,7 +41,7 @@
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
<external-component-plugins>
@@ -52,19 +52,18 @@
<type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
<init-params>
<values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
</values-param>
</init-params>
</component-plugin>
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm (from rev 701, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm)
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/GroupDAOImpl.java 2009-11-19 20:53:18 UTC (rev 701)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -17,15 +17,15 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.GroupEventListener;
import org.exoplatform.services.organization.GroupHandler;
import org.exoplatform.services.organization.impl.GroupImpl;
-import org.jboss.identity.idm.api.Attribute;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.impl.api.SimpleAttribute;
+import org.picketlink.idm.api.Attribute;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.impl.api.SimpleAttribute;
import java.util.ArrayList;
import java.util.Collection;
@@ -43,13 +43,13 @@
public static final String GROUP_DESCRIPTION = "description";
- private JBossIDMService service_;
+ private PicketLinkIDMService service_;
private List<GroupEventListener> listeners_;
- private JBossIDMOrganizationServiceImpl orgService;
+ private PicketLinkIDMOrganizationServiceImpl orgService;
- public GroupDAOImpl(JBossIDMOrganizationServiceImpl orgService, JBossIDMService service)
+ public GroupDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
{
service_ = service;
this.orgService = orgService;
@@ -73,12 +73,12 @@
public void addChild(Group parent, Group child, boolean broadcast) throws Exception
{
- org.jboss.identity.idm.api.Group parentGroup = null;
+ org.picketlink.idm.api.Group parentGroup = null;
if (parent != null)
{
parentGroup =
- getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
((GroupImpl)child).setId(parent.getId() + "/" + child.getGroupName());
}
@@ -92,7 +92,7 @@
preSave(child, true);
}
- org.jboss.identity.idm.api.Group childGroup = persistGroup(child);
+ org.picketlink.idm.api.Group childGroup = persistGroup(child);
if (parentGroup != null)
{
@@ -132,8 +132,8 @@
preDelete(group);
}
- org.jboss.identity.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(group.getGroupName(), orgService.getExoGroupType());
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(group.getGroupName(), orgService.getGtnGroupType());
if (jbidGroup == null)
{
@@ -142,17 +142,17 @@
// MembershipDAOImpl.removeMembershipEntriesOfGroup(group, getIdentitySession());
- Collection<org.jboss.identity.idm.api.Group> oneLevelChilds =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getExoGroupType(),
+ Collection<org.picketlink.idm.api.Group> oneLevelChilds =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
true, false);
- Collection<org.jboss.identity.idm.api.Group> allChilds =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getExoGroupType(),
+ Collection<org.picketlink.idm.api.Group> allChilds =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
true, true);
getIdentitySession().getRelationshipManager().disassociateGroups(jbidGroup, oneLevelChilds);
- for (org.jboss.identity.idm.api.Group child : allChilds)
+ for (org.picketlink.idm.api.Group child : allChilds)
{
//TODO: impl force in IDM
getIdentitySession().getPersistenceManager().removeGroup(child, true);
@@ -169,12 +169,12 @@
public Collection findGroupByMembership(String userName, String membershipType) throws Exception
{
- Collection<org.jboss.identity.idm.api.Role> allRoles =
+ Collection<org.picketlink.idm.api.Role> allRoles =
getIdentitySession().getRoleManager().findRoles(userName, membershipType);
Set<Group> exoGroups = new HashSet<Group>();
- for (org.jboss.identity.idm.api.Role role : allRoles)
+ for (org.picketlink.idm.api.Role role : allRoles)
{
exoGroups.add(convertGroup(role.getGroup()));
@@ -187,7 +187,7 @@
public Group findGroupById(String groupId) throws Exception
{
- org.jboss.identity.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
+ org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
if (jbidGroup == null)
{
@@ -199,7 +199,7 @@
public Collection findGroups(Group parent) throws Exception
{
- org.jboss.identity.idm.api.Group jbidGroup = null;
+ org.picketlink.idm.api.Group jbidGroup = null;
if (parent == null)
{
@@ -208,7 +208,7 @@
else
{
jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
}
if (jbidGroup == null)
@@ -216,13 +216,13 @@
return Collections.emptyList();
}
- Collection<org.jboss.identity.idm.api.Group> allGroups =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getExoGroupType(),
+ Collection<org.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
true, false);
List<Group> exoGroups = new LinkedList<Group>();
- for (org.jboss.identity.idm.api.Group group : allGroups)
+ for (org.picketlink.idm.api.Group group : allGroups)
{
exoGroups.add(convertGroup(group));
@@ -241,21 +241,21 @@
// need to look at that later
//
// Caused by: java.lang.IllegalArgumentException: User name cannot be null
- // at org.jboss.identity.idm.impl.api.session.managers.AbstractManager.checkNotNullArgument(AbstractManager.java:267)
- // at org.jboss.identity.idm.impl.api.session.managers.RelationshipManagerImpl.findRelatedGroups(RelationshipManagerImpl.java:753)
- // at org.exoplatform.services.organization.jbidm.GroupDAOImpl.findGroupsOfUser(GroupDAOImpl.java:225)
+ // at org.picketlink.idm.impl.api.session.managers.AbstractManager.checkNotNullArgument(AbstractManager.java:267)
+ // at org.picketlink.idm.impl.api.session.managers.RelationshipManagerImpl.findRelatedGroups(RelationshipManagerImpl.java:753)
+ // at org.exoplatform.services.organization.idm.GroupDAOImpl.findGroupsOfUser(GroupDAOImpl.java:225)
// at org.exoplatform.organization.webui.component.GroupManagement.isMemberOfGroup(GroupManagement.java:72)
// at org.exoplatform.organization.webui.component.GroupManagement.isAdministrator(GroupManagement.java:125)
// at org.exoplatform.organization.webui.component.UIGroupExplorer.<init>(UIGroupExplorer.java:57)
return Collections.emptyList();
}
- Collection<org.jboss.identity.idm.api.Group> allGroups =
- getIdentitySession().getRelationshipManager().findRelatedGroups(user, orgService.getExoGroupType(), null);
+ Collection<org.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getRelationshipManager().findRelatedGroups(user, orgService.getGtnGroupType(), null);
List<Group> exoGroups = new LinkedList<Group>();
- for (org.jboss.identity.idm.api.Group group : allGroups)
+ for (org.picketlink.idm.api.Group group : allGroups)
{
exoGroups.add(convertGroup(group));
@@ -266,14 +266,14 @@
public Collection getAllGroups() throws Exception
{
- Collection<org.jboss.identity.idm.api.Group> allGroups =
- getIdentitySession().getPersistenceManager().findGroup(orgService.getExoGroupType());
+ Collection<org.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getPersistenceManager().findGroup(orgService.getGtnGroupType());
List<Group> exoGroups = new LinkedList<Group>();
- for (org.jboss.identity.idm.api.Group group : allGroups)
+ for (org.picketlink.idm.api.Group group : allGroups)
{
- if (!orgService.getExoGroupType().equals(orgService.getExoRootGroupType())
+ if (!orgService.getGtnGroupType().equals(orgService.getGtnRootGroupType())
|| !group.getName().equals(orgService.getExoRootGroupName()))
{
exoGroups.add(convertGroup(group));
@@ -318,8 +318,8 @@
public Group getGroup(String groupName) throws Exception
{
- org.jboss.identity.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getExoGroupType());
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
if (jbidGroup == null)
{
@@ -330,7 +330,7 @@
}
- private Group convertGroup(org.jboss.identity.idm.api.Group jbidGroup) throws Exception
+ private Group convertGroup(org.picketlink.idm.api.Group jbidGroup) throws Exception
{
Map<String, Attribute> attrs = getIdentitySession().getAttributesManager().getAttributes(jbidGroup);
@@ -369,11 +369,11 @@
return "";
}
- org.jboss.identity.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getExoGroupType());
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
- Collection<org.jboss.identity.idm.api.Group> parents =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getExoGroupType(),
+ Collection<org.picketlink.idm.api.Group> parents =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
false, false);
if (parents.size() > 1)
@@ -390,23 +390,23 @@
//return "/" + groupName;
}
- String parentGroupId = getGroupId(((org.jboss.identity.idm.api.Group)parents.iterator().next()).getName());
+ String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()).getName());
return parentGroupId + "/" + groupName;
}
- private org.jboss.identity.idm.api.Group persistGroup(Group exoGroup) throws Exception
+ private org.picketlink.idm.api.Group persistGroup(Group exoGroup) throws Exception
{
- org.jboss.identity.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(exoGroup.getGroupName(), orgService.getExoGroupType());
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(exoGroup.getGroupName(), orgService.getGtnGroupType());
if (jbidGroup == null)
{
jbidGroup =
getIdentitySession().getPersistenceManager().createGroup(exoGroup.getGroupName(),
- orgService.getExoGroupType());
+ orgService.getGtnGroupType());
}
String description = exoGroup.getDescription();
@@ -441,17 +441,17 @@
return service_.getIdentitySession();
}
- private org.jboss.identity.idm.api.Group getRootGroup() throws Exception
+ private org.picketlink.idm.api.Group getRootGroup() throws Exception
{
- org.jboss.identity.idm.api.Group rootGroup =
+ org.picketlink.idm.api.Group rootGroup =
getIdentitySession().getPersistenceManager().findGroup(orgService.getExoRootGroupName(),
- orgService.getExoRootGroupType());
+ orgService.getGtnRootGroupType());
if (rootGroup == null)
{
rootGroup =
getIdentitySession().getPersistenceManager().createGroup(orgService.getExoRootGroupName(),
- orgService.getExoRootGroupType());
+ orgService.getGtnRootGroupType());
}
return rootGroup;
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/IDMUserListAccess.java 2009-11-19 20:53:18 UTC (rev 701)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -17,12 +17,12 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.services.organization.User;
-import org.jboss.identity.idm.api.query.UserQuery;
-import org.jboss.identity.idm.api.query.UserQueryBuilder;
+import org.picketlink.idm.api.query.UserQuery;
+import org.picketlink.idm.api.query.UserQueryBuilder;
import java.util.List;
@@ -30,7 +30,7 @@
{
private final UserDAOImpl userDAO;
- private final JBossIDMService idmService;
+ private final PicketLinkIDMService idmService;
private final UserQueryBuilder userQueryBuilder;
@@ -38,7 +38,7 @@
private final boolean countAll;
- public IDMUserListAccess(UserDAOImpl userDAO, JBossIDMService idmService, UserQueryBuilder userQueryBuilder,
+ public IDMUserListAccess(UserDAOImpl userDAO, PicketLinkIDMService idmService, UserQueryBuilder userQueryBuilder,
int pageSize, boolean countAll)
{
this.userDAO = userDAO;
@@ -52,13 +52,13 @@
{
userQueryBuilder.page(index, length);
UserQuery query = userQueryBuilder.createQuery();
- List<org.jboss.identity.idm.api.User> users = idmService.getIdentitySession().list(query);
+ List<org.picketlink.idm.api.User> users = idmService.getIdentitySession().list(query);
User[] exoUsers = new User[users.size()];
for (int i = 0; i < users.size(); i++)
{
- org.jboss.identity.idm.api.User user = users.get(i);
+ org.picketlink.idm.api.User user = users.get(i);
exoUsers[i] = UserDAOImpl.getPopulatedUser(user.getId(), idmService.getIdentitySession());
}
Deleted: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMOrganizationServiceImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMOrganizationServiceImpl.java 2009-11-19 20:53:18 UTC (rev 701)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMOrganizationServiceImpl.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -1,175 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.jbidm;
-
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.component.ComponentRequestLifecycle;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.ValueParam;
-import org.exoplatform.services.cache.CacheService;
-import org.exoplatform.services.organization.BaseOrganizationService;
-import org.picocontainer.Startable;
-
-public class JBossIDMOrganizationServiceImpl extends BaseOrganizationService implements Startable,
- ComponentRequestLifecycle
-{
-
- // We may have several portal containers thus we need one JBossIDMService per portal container
- // private static JBossIDMService jbidmService_;
- private JBossIDMService jbidmService_;
-
- public static final String EXO_GROUP_TYPE_OPTION = "exoGroupTypeName";
-
- public static final String EXO_ROOT_GROUP_NAME_OPTION = "exoRootGroupName";
-
- public static final String EXO_ROOT_GROUP_TYPE_NAME_OPTION = "exoRootGroupTypeName";
-
- public static final String PASSWORD_AS_ATTRIBUTE_OPTION = "passwordAsAttribute";
-
- private String exoGroupType = "EXO_GROUP_TYPE";
-
- private String exoRootGroupName = "EXO_ROOT_GROUP";
-
- private String exoRootGroupType = exoGroupType;
-
- private boolean passwordAsAttribute = false;
-
- public JBossIDMOrganizationServiceImpl(InitParams params, CacheService cservice, JBossIDMService jbidmService)
- throws Exception
- {
- groupDAO_ = new GroupDAOImpl(this, jbidmService);
- userDAO_ = new UserDAOImpl(this, jbidmService, cservice);
- userProfileDAO_ = new UserProfileDAOImpl(this, jbidmService, cservice);
- membershipDAO_ = new MembershipDAOImpl(this, jbidmService);
- membershipTypeDAO_ = new MembershipTypeDAOImpl(this, jbidmService);
-
- jbidmService_ = jbidmService;
-
- if (params != null)
- {
- //Options
- ValueParam exoGroupTypeNameParam = params.getValueParam(EXO_GROUP_TYPE_OPTION);
- ValueParam exoRootGroupTypeNameParam = params.getValueParam(EXO_ROOT_GROUP_TYPE_NAME_OPTION);
- ValueParam exoRootGroupNameParam = params.getValueParam(EXO_ROOT_GROUP_NAME_OPTION);
- ValueParam passwordAsAttributeParam = params.getValueParam(PASSWORD_AS_ATTRIBUTE_OPTION);
-
- if (exoGroupTypeNameParam != null)
- {
- this.exoGroupType = exoGroupTypeNameParam.getValue();
- }
-
- if (exoRootGroupNameParam != null)
- {
- this.exoRootGroupName = exoRootGroupNameParam.getValue();
- }
-
- if (exoRootGroupTypeNameParam != null)
- {
- this.exoRootGroupType = exoRootGroupTypeNameParam.getValue();
- }
- else if (exoRootGroupTypeNameParam != null)
- {
- this.exoRootGroupType = this.exoGroupType;
- }
-
- if (passwordAsAttributeParam != null && passwordAsAttributeParam.getValue().equalsIgnoreCase("true"))
- {
- this.passwordAsAttribute = true;
- }
- }
-
- }
-
- public final org.jboss.identity.idm.api.Group getJBIDMGroup(String groupId) throws Exception
- {
- String[] ids = groupId.split("/");
- String name = ids[ids.length - 1];
- return jbidmService_.getIdentitySession().getPersistenceManager().findGroup(name, getExoGroupType());
- }
-
- @Override
- public void start()
- {
-
- try
- {
- // Wrap within transaction so all initializers can work
- jbidmService_.getIdentitySession().beginTransaction();
- super.start();
- jbidmService_.getIdentitySession().getTransaction().commit();
-
- }
- catch (Exception e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
-
- }
-
- @Override
- public void stop()
- {
- //toto
- }
-
- public void startRequest(ExoContainer container)
- {
- try
- {
- jbidmService_.getIdentitySession().beginTransaction();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public void endRequest(ExoContainer container)
- {
- try
- {
- jbidmService_.getIdentitySession().getTransaction().commit();
- }
- catch (Exception e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
-
- public String getExoGroupType()
- {
- return exoGroupType;
- }
-
- public String getExoRootGroupName()
- {
- return exoRootGroupName;
- }
-
- public String getExoRootGroupType()
- {
- return exoRootGroupType;
- }
-
- public boolean isPasswordAsAttribute()
- {
- return passwordAsAttribute;
- }
-}
Deleted: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMService.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMService.java 2009-11-19 20:53:18 UTC (rev 701)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMService.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -1,34 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.jbidm;
-
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.IdentitySessionFactory;
-
-public interface JBossIDMService
-{
-
- IdentitySessionFactory getIdentitySessionFactory();
-
- IdentitySession getIdentitySession() throws Exception;
-
- IdentitySession getIdentitySession(String realm) throws Exception;
-
-}
Deleted: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMServiceImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMServiceImpl.java 2009-11-19 20:53:18 UTC (rev 701)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/JBossIDMServiceImpl.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -1,222 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.jbidm;
-
-import org.exoplatform.container.configuration.ConfigurationManager;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.PropertiesParam;
-import org.exoplatform.container.xml.Property;
-import org.exoplatform.container.xml.ValueParam;
-import org.exoplatform.container.xml.ValuesParam;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.AnnotationConfiguration;
-import org.hibernate.dialect.Dialect;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.IdentitySessionFactory;
-import org.jboss.identity.idm.api.cfg.IdentityConfiguration;
-import org.jboss.identity.idm.common.exception.IdentityConfigurationException;
-import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
-import org.jboss.identity.idm.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
-import org.jboss.identity.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
-import org.picocontainer.Startable;
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.naming.InitialContext;
-
-public class JBossIDMServiceImpl implements JBossIDMService, Startable
-{
-
- private static Log log_ = ExoLogger.getLogger(JBossIDMServiceImpl.class);
-
- public static final String PARAM_CONFIG_OPTION = "config";
-
- public static final String PARAM_HIBERNATE_PROPS = "hibernate.properties";
-
- public static final String PARAM_HIBERNATE_MAPPINGS = "hibernate.mappings";
-
- public static final String PARAM_HIBERNATE_ANNOTATIONS = "hibernate.annotations";
-
- public static final String PARAM_JNDI_NAME_OPTION = "jndiName";
-
- public static final String DEFAULT_REALM_NAME_OPTION = "PortalRealm";
-
- // We may have several portal containers thus we need one indentitySessionFactory per portal container
- // private static IdentitySessionFactory identitySessionFactory;
- private IdentitySessionFactory identitySessionFactory;
-
- private String config;
-
- private String defaultRealmName = "PortalRealm";
-
- private IdentityConfiguration identityConfiguration;
-
- private JBossIDMServiceImpl()
- {
- }
-
- public JBossIDMServiceImpl(InitParams initParams, ConfigurationManager confManager) throws Exception
- {
- ValueParam config = initParams.getValueParam(PARAM_CONFIG_OPTION);
- ValueParam jndiName = initParams.getValueParam(PARAM_JNDI_NAME_OPTION);
- ValueParam realmName = initParams.getValueParam(DEFAULT_REALM_NAME_OPTION);
-
- if (config == null && jndiName == null)
- {
- throw new IllegalStateException("Either '" + PARAM_CONFIG_OPTION + "' or '" + PARAM_JNDI_NAME_OPTION
- + "' parameter must " + "be specified");
- }
- if (realmName != null)
- {
- this.defaultRealmName = realmName.getValue();
- }
-
- SessionFactory sf = null;
-
- if (initParams.containsKey(PARAM_HIBERNATE_PROPS))
- {
- PropertiesParam param = initParams.getPropertiesParam(PARAM_HIBERNATE_PROPS);
- AnnotationConfiguration conf_ = new AnnotationConfiguration();
- Iterator properties = param.getPropertyIterator();
- while (properties.hasNext())
- {
- Property p = (Property)properties.next();
-
- //
- String name = p.getName();
- String value = p.getValue();
-
- // Julien: Don't remove that unless you know what you are doing
- if (name.equals("hibernate.dialect"))
- {
- Package pkg = Dialect.class.getPackage();
- String dialect = value.substring(22);
- value = pkg.getName() + "." + dialect; // 22 is the length of
- // "org.hibernate.dialect"
- log_.info("Using dialect " + dialect);
- }
-
- //
- conf_.setProperty(name, value);
- }
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
-
- if (initParams.containsKey(PARAM_HIBERNATE_MAPPINGS))
- {
- ValuesParam mappings = initParams.getValuesParam(PARAM_HIBERNATE_MAPPINGS);
-
- List<String> paths = mappings.getValues();
-
- for (String path : paths)
- {
- URL url = cl.getResource(path);
- log_.info("Adding Hibernate Mapping: " + path);
- conf_.addURL(url);
- }
- }
-
- if (initParams.containsKey(PARAM_HIBERNATE_ANNOTATIONS))
- {
- ValuesParam annotations = initParams.getValuesParam(PARAM_HIBERNATE_ANNOTATIONS);
-
- List<String> classes = annotations.getValues();
-
- for (String name : classes)
- {
- Class clazz = cl.loadClass(name);
- conf_.addAnnotatedClass(clazz);
- }
-
- }
-
- sf = conf_.buildSessionFactory();
-
- }
-
- if (config != null)
- {
- this.config = config.getValue();
- URL configURL = confManager.getURL(this.config);
-
- if (configURL == null)
- {
- throw new IllegalStateException("Cannot fine resource: " + this.config);
- }
-
- IdentityConfigurationMetaData configMD =
- JAXB2IdentityConfiguration.createConfigurationMetaData(confManager.getInputStream(this.config));
-
- identityConfiguration = new IdentityConfigurationImpl().configure(configMD);
-
- if (sf != null)
- {
- identityConfiguration.getIdentityConfigurationRegistry().register(sf, "hibernateSessionFactory");
- }
- }
- else
- {
- identitySessionFactory = (IdentitySessionFactory)new InitialContext().lookup(jndiName.getValue());
- }
-
- }
-
- public void start()
- {
- if (identitySessionFactory == null)
- {
- try
- {
- identitySessionFactory = identityConfiguration.buildIdentitySessionFactory();
- }
- catch (IdentityConfigurationException e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- public void stop()
- {
- }
-
- public IdentitySessionFactory getIdentitySessionFactory()
- {
- return identitySessionFactory; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IdentitySession getIdentitySession() throws Exception
- {
- return getIdentitySessionFactory().getCurrentIdentitySession(defaultRealmName);
- }
-
- public IdentitySession getIdentitySession(String realm) throws Exception
- {
- if (realm == null)
- {
- throw new IllegalArgumentException("Realm name cannot be null");
- }
- return getIdentitySessionFactory().getCurrentIdentitySession(realm);
- }
-}
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/MembershipDAOImpl.java 2009-11-19 20:53:18 UTC (rev 701)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.commons.utils.ListenerStack;
import org.exoplatform.services.organization.Group;
@@ -26,9 +26,9 @@
import org.exoplatform.services.organization.MembershipHandler;
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.User;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.Role;
-import org.jboss.identity.idm.api.RoleType;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.Role;
+import org.picketlink.idm.api.RoleType;
import java.util.Collection;
import java.util.Collections;
@@ -42,13 +42,13 @@
public class MembershipDAOImpl implements MembershipHandler
{
- private JBossIDMService service_;
+ private PicketLinkIDMService service_;
private List listeners_;
- private JBossIDMOrganizationServiceImpl orgService;
+ private PicketLinkIDMOrganizationServiceImpl orgService;
- public MembershipDAOImpl(JBossIDMOrganizationServiceImpl orgService, JBossIDMService service)
+ public MembershipDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
{
service_ = service;
listeners_ = new ListenerStack(5);
@@ -102,7 +102,7 @@
}
String groupId =
- getIdentitySession().getPersistenceManager().createGroupId(g.getGroupName(), orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().createGroupKey(g.getGroupName(), orgService.getGtnGroupType());
if (getIdentitySession().getRoleManager().hasRole(user.getUserName(), groupId, mt.getName()))
{
@@ -131,8 +131,8 @@
public void saveMembership(Membership m, boolean broadcast) throws Exception
{
String groupId =
- getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(m.getGroupId()),
- orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
{
@@ -158,8 +158,8 @@
Membership m = new MembershipImpl(id);
String groupId =
- getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(m.getGroupId()),
- orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
if (!getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
{
@@ -218,8 +218,8 @@
public Membership findMembershipByUserGroupAndType(String userName, String groupId, String type) throws Exception
{
String gid =
- getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(groupId),
- orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
Role role = getIdentitySession().getRoleManager().getRole(type, userName, gid);
@@ -245,8 +245,8 @@
}
String gid =
- getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(groupId),
- orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
Collection<RoleType> roleTypes = getIdentitySession().getRoleManager().findRoleTypes(userName, gid, null);
@@ -285,10 +285,10 @@
return memberships;
}
- static void removeMembershipEntriesOfGroup(JBossIDMOrganizationServiceImpl orgService, Group group,
+ static void removeMembershipEntriesOfGroup(PicketLinkIDMOrganizationServiceImpl orgService, Group group,
IdentitySession session) throws Exception
{
- String gid = session.getPersistenceManager().createGroupId(group.getGroupName(), orgService.getExoGroupType());
+ String gid = session.getPersistenceManager().createGroupKey(group.getGroupName(), orgService.getGtnGroupType());
Collection<Role> roles = session.getRoleManager().findRoles(gid, null);
@@ -306,8 +306,8 @@
public Collection findMembershipsByGroupId(String groupId) throws Exception
{
String gid =
- getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(groupId),
- orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(gid, null);
@@ -333,8 +333,8 @@
Membership m = new MembershipImpl(id);
String groupId =
- getIdentitySession().getPersistenceManager().createGroupId(getGroupNameFromId(m.getGroupId()),
- orgService.getExoGroupType());
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
{
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/MembershipImpl.java 2009-11-19 20:53:18 UTC (rev 701)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.services.organization.Membership;
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/MembershipTypeDAOImpl.java 2009-11-19 20:53:18 UTC (rev 701)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -17,13 +17,13 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.MembershipTypeHandler;
import org.exoplatform.services.organization.impl.MembershipTypeImpl;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.RoleType;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.RoleType;
import java.text.DateFormat;
import java.util.Collection;
@@ -46,11 +46,11 @@
public static final DateFormat dateFormat = DateFormat.getInstance();
- private JBossIDMService service_;
+ private PicketLinkIDMService service_;
- private JBossIDMOrganizationServiceImpl orgService;
+ private PicketLinkIDMOrganizationServiceImpl orgService;
- public MembershipTypeDAOImpl(JBossIDMOrganizationServiceImpl orgService, JBossIDMService service)
+ public MembershipTypeDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
{
service_ = service;
this.orgService = orgService;
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java (from rev 701, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMOrganizationServiceImpl.java)
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -0,0 +1,175 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.component.ComponentRequestLifecycle;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.services.cache.CacheService;
+import org.exoplatform.services.organization.BaseOrganizationService;
+import org.picocontainer.Startable;
+
+public class PicketLinkIDMOrganizationServiceImpl extends BaseOrganizationService implements Startable,
+ ComponentRequestLifecycle
+{
+
+ // We may have several portal containers thus we need one PicketLinkIDMService per portal container
+ // private static PicketLinkIDMService jbidmService_;
+ private PicketLinkIDMService idmService_;
+
+ public static final String GTN_GROUP_TYPE_OPTION = "gtnGroupTypeName";
+
+ public static final String GTN_ROOT_GROUP_NAME_OPTION = "gtnRootGroupName";
+
+ public static final String GTN_ROOT_GROUP_TYPE_NAME_OPTION = "gtnRootGroupTypeName";
+
+ public static final String PASSWORD_AS_ATTRIBUTE_OPTION = "passwordAsAttribute";
+
+ private String gtnGroupType = "GTN_GROUP_TYPE";
+
+ private String gtnRootGroupName = "GTN_ROOT_GROUP";
+
+ private String gtnRootGroupType = gtnGroupType;
+
+ private boolean passwordAsAttribute = false;
+
+ public PicketLinkIDMOrganizationServiceImpl(InitParams params, CacheService cservice, PicketLinkIDMService idmService)
+ throws Exception
+ {
+ groupDAO_ = new GroupDAOImpl(this, idmService);
+ userDAO_ = new UserDAOImpl(this, idmService, cservice);
+ userProfileDAO_ = new UserProfileDAOImpl(this, idmService, cservice);
+ membershipDAO_ = new MembershipDAOImpl(this, idmService);
+ membershipTypeDAO_ = new MembershipTypeDAOImpl(this, idmService);
+
+ idmService_ = idmService;
+
+ if (params != null)
+ {
+ //Options
+ ValueParam gtnGroupTypeNameParam = params.getValueParam(GTN_GROUP_TYPE_OPTION);
+ ValueParam gtnRootGroupTypeNameParam = params.getValueParam(GTN_ROOT_GROUP_TYPE_NAME_OPTION);
+ ValueParam gtnRootGroupNameParam = params.getValueParam(GTN_ROOT_GROUP_NAME_OPTION);
+ ValueParam passwordAsAttributeParam = params.getValueParam(PASSWORD_AS_ATTRIBUTE_OPTION);
+
+ if (gtnGroupTypeNameParam != null)
+ {
+ this.gtnGroupType = gtnGroupTypeNameParam.getValue();
+ }
+
+ if (gtnRootGroupNameParam != null)
+ {
+ this.gtnRootGroupName = gtnRootGroupNameParam.getValue();
+ }
+
+ if (gtnRootGroupTypeNameParam != null)
+ {
+ this.gtnRootGroupType = gtnRootGroupTypeNameParam.getValue();
+ }
+ else if (gtnRootGroupTypeNameParam != null)
+ {
+ this.gtnRootGroupType = this.gtnGroupType;
+ }
+
+ if (passwordAsAttributeParam != null && passwordAsAttributeParam.getValue().equalsIgnoreCase("true"))
+ {
+ this.passwordAsAttribute = true;
+ }
+ }
+
+ }
+
+ public final org.picketlink.idm.api.Group getJBIDMGroup(String groupId) throws Exception
+ {
+ String[] ids = groupId.split("/");
+ String name = ids[ids.length - 1];
+ return idmService_.getIdentitySession().getPersistenceManager().findGroup(name, getGtnGroupType());
+ }
+
+ @Override
+ public void start()
+ {
+
+ try
+ {
+ // Wrap within transaction so all initializers can work
+ idmService_.getIdentitySession().beginTransaction();
+ super.start();
+ idmService_.getIdentitySession().getTransaction().commit();
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+ }
+
+ @Override
+ public void stop()
+ {
+ //toto
+ }
+
+ public void startRequest(ExoContainer container)
+ {
+ try
+ {
+ idmService_.getIdentitySession().beginTransaction();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void endRequest(ExoContainer container)
+ {
+ try
+ {
+ idmService_.getIdentitySession().getTransaction().commit();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public String getGtnGroupType()
+ {
+ return gtnGroupType;
+ }
+
+ public String getExoRootGroupName()
+ {
+ return gtnRootGroupName;
+ }
+
+ public String getGtnRootGroupType()
+ {
+ return gtnRootGroupType;
+ }
+
+ public boolean isPasswordAsAttribute()
+ {
+ return passwordAsAttribute;
+ }
+}
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java (from rev 701, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMService.java)
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -0,0 +1,34 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.IdentitySessionFactory;
+
+public interface PicketLinkIDMService
+{
+
+ IdentitySessionFactory getIdentitySessionFactory();
+
+ IdentitySession getIdentitySession() throws Exception;
+
+ IdentitySession getIdentitySession(String realm) throws Exception;
+
+}
Copied: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java (from rev 701, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/JBossIDMServiceImpl.java)
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java (rev 0)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -0,0 +1,149 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.database.HibernateService;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.IdentitySessionFactory;
+import org.picketlink.idm.api.cfg.IdentityConfiguration;
+import org.picketlink.idm.common.exception.IdentityConfigurationException;
+import org.picketlink.idm.impl.configuration.IdentityConfigurationImpl;
+import org.picketlink.idm.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
+import org.picketlink.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
+import org.picocontainer.Startable;
+
+import java.net.URL;
+
+import javax.naming.InitialContext;
+
+public class PicketLinkIDMServiceImpl implements PicketLinkIDMService, Startable
+{
+
+ private static Log log_ = ExoLogger.getLogger(PicketLinkIDMServiceImpl.class);
+
+ public static final String PARAM_CONFIG_OPTION = "config";
+
+ public static final String PARAM_HIBERNATE_PROPS = "hibernate.properties";
+
+ public static final String PARAM_HIBERNATE_MAPPINGS = "hibernate.mappings";
+
+ public static final String PARAM_HIBERNATE_ANNOTATIONS = "hibernate.annotations";
+
+ public static final String PARAM_JNDI_NAME_OPTION = "jndiName";
+
+ public static final String DEFAULT_REALM_NAME_OPTION = "PortalRealm";
+
+ // We may have several portal containers thus we need one indentitySessionFactory per portal container
+ // private static IdentitySessionFactory identitySessionFactory;
+ private IdentitySessionFactory identitySessionFactory;
+
+ private String config;
+
+ private String defaultRealmName = "PortalRealm";
+
+ private IdentityConfiguration identityConfiguration;
+
+ private PicketLinkIDMServiceImpl()
+ {
+ }
+
+ public PicketLinkIDMServiceImpl(InitParams initParams, HibernateService hibernateService, ConfigurationManager confManager) throws Exception
+ {
+ ValueParam config = initParams.getValueParam(PARAM_CONFIG_OPTION);
+ ValueParam jndiName = initParams.getValueParam(PARAM_JNDI_NAME_OPTION);
+ ValueParam realmName = initParams.getValueParam(DEFAULT_REALM_NAME_OPTION);
+
+ if (config == null && jndiName == null)
+ {
+ throw new IllegalStateException("Either '" + PARAM_CONFIG_OPTION + "' or '" + PARAM_JNDI_NAME_OPTION
+ + "' parameter must " + "be specified");
+ }
+ if (realmName != null)
+ {
+ this.defaultRealmName = realmName.getValue();
+ }
+
+ if (config != null)
+ {
+ this.config = config.getValue();
+ URL configURL = confManager.getURL(this.config);
+
+ if (configURL == null)
+ {
+ throw new IllegalStateException("Cannot fine resource: " + this.config);
+ }
+
+ IdentityConfigurationMetaData configMD =
+ JAXB2IdentityConfiguration.createConfigurationMetaData(confManager.getInputStream(this.config));
+
+ identityConfiguration = new IdentityConfigurationImpl().configure(configMD);
+
+ identityConfiguration.getIdentityConfigurationRegistry().register(hibernateService.getSessionFactory(), "hibernateSessionFactory");
+ }
+ else
+ {
+ identitySessionFactory = (IdentitySessionFactory)new InitialContext().lookup(jndiName.getValue());
+ }
+
+ }
+
+ public void start()
+ {
+ if (identitySessionFactory == null)
+ {
+ try
+ {
+ identitySessionFactory = identityConfiguration.buildIdentitySessionFactory();
+ }
+ catch (IdentityConfigurationException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ public void stop()
+ {
+ }
+
+ public IdentitySessionFactory getIdentitySessionFactory()
+ {
+ return identitySessionFactory; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public IdentitySession getIdentitySession() throws Exception
+ {
+ return getIdentitySessionFactory().getCurrentIdentitySession(defaultRealmName);
+ }
+
+ public IdentitySession getIdentitySession(String realm) throws Exception
+ {
+ if (realm == null)
+ {
+ throw new IllegalArgumentException("Realm name cannot be null");
+ }
+ return getIdentitySessionFactory().getCurrentIdentitySession(realm);
+ }
+}
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/UserDAOImpl.java 2009-11-19 20:53:18 UTC (rev 701)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.commons.utils.LazyPageList;
import org.exoplatform.services.cache.CacheService;
@@ -27,11 +27,11 @@
import org.exoplatform.services.organization.UserEventListener;
import org.exoplatform.services.organization.UserHandler;
import org.exoplatform.services.organization.impl.UserImpl;
-import org.jboss.identity.idm.api.Attribute;
-import org.jboss.identity.idm.api.AttributesManager;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.query.UserQueryBuilder;
-import org.jboss.identity.idm.impl.api.SimpleAttribute;
+import org.picketlink.idm.api.Attribute;
+import org.picketlink.idm.api.AttributesManager;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.query.UserQueryBuilder;
+import org.picketlink.idm.impl.api.SimpleAttribute;
import java.text.DateFormat;
import java.util.ArrayList;
@@ -47,7 +47,7 @@
public class UserDAOImpl implements UserHandler
{
- private final JBossIDMService service_;
+ private final PicketLinkIDMService service_;
private ExoCache cache_;
@@ -71,7 +71,7 @@
public static final DateFormat dateFormat = DateFormat.getInstance();
- private JBossIDMOrganizationServiceImpl orgService;
+ private PicketLinkIDMOrganizationServiceImpl orgService;
static
{
@@ -87,7 +87,7 @@
USER_NON_PROFILE_KEYS = Collections.unmodifiableSet(keys);
}
- public UserDAOImpl(JBossIDMOrganizationServiceImpl orgService, JBossIDMService idmService, CacheService cservice)
+ public UserDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService idmService, CacheService cservice)
throws Exception
{
service_ = idmService;
@@ -155,7 +155,7 @@
{
IdentitySession session = service_.getIdentitySession();
- org.jboss.identity.idm.api.User foundUser = session.getPersistenceManager().findUser(userName);
+ org.picketlink.idm.api.User foundUser = session.getPersistenceManager().findUser(userName);
if (foundUser == null)
{
@@ -163,6 +163,10 @@
return null;
}
+ // Remove all memberships and profile first
+ orgService.getMembershipHandler().removeMembershipByUser(userName, false);
+ orgService.getUserProfileHandler().removeUserProfile(userName, false);
+
User exoUser = getPopulatedUser(userName, session);
if (broadcast)
@@ -222,7 +226,7 @@
else
{
IdentitySession session = service_.getIdentitySession();
- org.jboss.identity.idm.api.User idmUser = session.getPersistenceManager().findUser(user.getUserName());
+ org.picketlink.idm.api.User idmUser = session.getPersistenceManager().findUser(user.getUserName());
authenticated = session.getAttributesManager().validatePassword(idmUser, password);
}
@@ -269,7 +273,7 @@
{
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
- org.jboss.identity.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
+ org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
qb.addRelatedGroup(jbidGroup);
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/UserProfileDAOImpl.java 2009-11-19 20:53:18 UTC (rev 701)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.exoplatform.services.organization.jbidm;
+package org.exoplatform.services.organization.idm;
import org.exoplatform.services.cache.CacheService;
import org.exoplatform.services.cache.ExoCache;
@@ -25,9 +25,9 @@
import org.exoplatform.services.organization.UserProfileEventListener;
import org.exoplatform.services.organization.UserProfileHandler;
import org.exoplatform.services.organization.impl.UserProfileImpl;
-import org.jboss.identity.idm.api.Attribute;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.impl.api.SimpleAttribute;
+import org.picketlink.idm.api.Attribute;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.impl.api.SimpleAttribute;
import java.util.ArrayList;
import java.util.Collection;
@@ -42,15 +42,15 @@
static private UserProfile NOT_FOUND = new UserProfileImpl();
- private JBossIDMService service_;
+ private PicketLinkIDMService service_;
private ExoCache cache_;
private List<UserProfileEventListener> listeners_;
- private JBossIDMOrganizationServiceImpl orgService;
+ private PicketLinkIDMOrganizationServiceImpl orgService;
- public UserProfileDAOImpl(JBossIDMOrganizationServiceImpl orgService, JBossIDMService service, CacheService cservice)
+ public UserProfileDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service, CacheService cservice)
throws Exception
{
service_ = service;
@@ -136,7 +136,7 @@
public UserProfile findUserProfileByName(String userName) throws Exception
{
- org.jboss.identity.idm.api.User foundUser = getIdentitySession().getPersistenceManager().findUser(userName);
+ org.picketlink.idm.api.User foundUser = getIdentitySession().getPersistenceManager().findUser(userName);
if (foundUser == null)
{
Modified: portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml
===================================================================
--- portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -25,54 +25,54 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
<value>jar:/conf/portal/idm-config.xml</value>
</value-param>
- <values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
- <property name="hibernate.current_session_context_class" value="thread"/>
- <property name="hibernate.show_sql" value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:target/temp/data/exodb"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size" value="5"/>
- <property name="hibernate.c3p0.max_size" value="20"/>
- <property name="hibernate.c3p0.timeout" value="1800"/>
- <property name="hibernate.c3p0.max_statements" value="50"/>
- </properties-param>
-
</init-params>
</component>
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
+ <component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <!--<property name="hibernate.show_sql" value="true"/>-->
+ <!--<property name="hibernate.use_sql_comments" value="true"/>-->
+ <!--<property name="hibernate.format_sql" value="true"/>-->
+ <property name="hibernate.current_session_context_class" value="thread"/>
+ <property name="hibernate.jdbc.batch_size" value="100"/>
+ <property name="hibernate.cache.use_second_level_cache" value="true"/>
+ <property name="hibernate.cache.use_query_cache" value="true"/>
+ <!--CHANGEME HashtableCacheProvider shold not be used in production env-->
+ <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+ <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.autocommit" value="true"/>
+ <property name="hibernate.connection.username" value="sa"/>
+ <property name="hibernate.connection.password" value=""/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size" value="5"/>
+ <property name="hibernate.c3p0.max_size" value="20"/>
+ <property name="hibernate.c3p0.timeout" value="1800"/>
+ <property name="hibernate.c3p0.max_statements" value="50"/>
+ </properties-param>
+ </init-params>
+ </component>
+
<external-component-plugins>
<target-component>org.exoplatform.services.database.HibernateService</target-component>
<component-plugin>
@@ -81,19 +81,18 @@
<type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
<init-params>
<values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified: portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
===================================================================
--- portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -173,6 +173,7 @@
// newly created 'test' and 'demo'
assertEquals(2, piterator.currentPage().size());
+// membershipHandler_.removeMembershipByUser(USER,false);
userHandler_.removeUser(USER, true);
piterator = userHandler_.getUserPageList(10);
// one 'demo'
@@ -436,19 +437,20 @@
groupHandler_.removeGroup(group3, true);
}
- public void testUserProfileListener() throws Exception
- {
- UserProfileListener l = new UserProfileListener();
- profileHandler_.addUserProfileEventListener(l);
- User user = createUser(USER);
- assertNotNull(user);
- UserProfile profile = profileHandler_.createUserProfileInstance(user.getUserName());
- profile.setAttribute("blah", "blah");
- profileHandler_.saveUserProfile(profile, true);
- assertTrue(l.preSave && l.postSave);
- profileHandler_.removeUserProfile(user.getUserName(), true);
- assertFalse(l.preDelete && l.postDelete);
- }
+// public void testUserProfileListener() throws Exception
+// {
+// UserProfileListener l = new UserProfileListener();
+// profileHandler_.addUserProfileEventListener(l);
+// User user = createUser(USER);
+// assertNotNull(user);
+// UserProfile profile = profileHandler_.createUserProfileInstance(user.getUserName());
+// profile.setAttribute("blah", "blah");
+// profileHandler_.saveUserProfile(profile, true);
+// assertTrue(l.preSave && l.postSave);
+// profileHandler_.removeUserProfile(user.getUserName(), true);
+// assertFalse(l.preDelete && l.postDelete);
+// userHandler_.removeUser(user.getUserName(), false);
+// }
public void testFindUsersByGroupId() throws Exception
{
Modified: portal/trunk/component/portal/pom.xml
===================================================================
--- portal/trunk/component/portal/pom.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/portal/pom.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -82,9 +82,9 @@
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-core</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-core</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
</dependencies>
Modified: portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -34,6 +34,9 @@
<description>Default Hibernate Service</description>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
+ <property name="hibernate.cache.use_second_level_cache" value="true"/>
+ <property name="hibernate.cache.use_query_cache" value="true"/>
+ <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:file:target/temp/data/exodb"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.autocommit" value="true"/>
Modified: portal/trunk/component/portal/src/test/java/conf/portal/idm-configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/java/conf/portal/idm-configuration.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/portal/src/test/java/conf/portal/idm-configuration.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -25,52 +25,21 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
<value>war:/conf/organization/idm-config.xml</value>
</value-param>
- <values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto" value="update"/>
- <property name="hibernate.current_session_context_class" value="thread"/>
- <property name="hibernate.show_sql" value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:target/temp/data/exodb"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size" value="5"/>
- <property name="hibernate.c3p0.max_size" value="20"/>
- <property name="hibernate.c3p0.timeout" value="1800"/>
- <property name="hibernate.c3p0.max_statements" value="50"/>
- </properties-param>
+
</init-params>
</component>
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
<external-component-plugins>
@@ -81,19 +50,18 @@
<type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
<init-params>
<values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-20 17:18:44 UTC (rev 744)
@@ -43,12 +43,12 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
import org.exoplatform.services.organization.UserHandler;
-import org.exoplatform.services.organization.jbidm.JBossIDMService;
+import org.exoplatform.services.organization.idm.PicketLinkIDMService;
import org.exoplatform.services.security.Authenticator;
import org.exoplatform.services.security.ConversationState;
import org.exoplatform.test.BasicTestCase;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.common.exception.IdentityException;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.common.exception.IdentityException;
import java.util.Arrays;
import java.util.Collections;
@@ -76,7 +76,7 @@
private DataStorage storage_;
/** . */
- private JBossIDMService idmService;
+ private PicketLinkIDMService idmService;
/** . */
private POMSessionManager mgr;
@@ -122,7 +122,7 @@
userPortalConfigSer_ =
(UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
orgService_ = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
- idmService = (JBossIDMService)container.getComponentInstanceOfType(JBossIDMService.class);
+ idmService = (PicketLinkIDMService)container.getComponentInstanceOfType(PicketLinkIDMService.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
authenticator = (Authenticator)container.getComponentInstanceOfType(Authenticator.class);
listenerService = (ListenerService)container.getComponentInstanceOfType(ListenerService.class);
Modified: portal/trunk/docs/user-guide/en/modules/configuration/IDM_Configuration.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/configuration/IDM_Configuration.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/docs/user-guide/en/modules/configuration/IDM_Configuration.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -17,15 +17,15 @@
<section>
<title>Configuration files</title>
<para>Main configuration file is <emphasis role="bold">idm-configuration</emphasis>:</para>
- <programlisting>
+ <programlisting><![CDATA[<![CDATA[<![CDATA[
<![CDATA[
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.orgaidmion.jbidm.PicketLinkIDMService</key>
+ <type>org.exoplatform.servicidmganization.jbidm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
@@ -33,18 +33,18 @@
</value-param>
<values-param>
<name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObject</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
+ <value>org.picketlink.idm.impl.model.hibernate.HibernateRealm</value>
</values-param>
<properties-param>
<name>hibernate.properties</name>
@@ -70,18 +70,18 @@
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
-</configuration>
+</configuration>
]]>
- </programlisting>
- <para><emphasis role="bold">org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</emphasis>
+ ]]>]]>]]></programlisting>
+ <para><emphasis role="bold">org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</emphasis>
is a main entrypoint implementing
<emphasis role="bold">org.exoplatform.services.organization.OrganizationService</emphasis> and is dependant on
- <emphasis role="bold">org.exoplatform.services.organization.jbidm.JBossIDMService</emphasis></para>
+ <emphasis role="bold">org.exoplatform.services.organization.idm.PicketLinkIDMService</emphasis></para>
- <para><emphasis role="bold">org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</emphasis> service has following
+ <para><emphasis role="bold">org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</emphasis> service has following
options:</para>
<itemizedlist>
<listitem>
@@ -121,25 +121,25 @@
</listitem>
</itemizedlist>
- <para><emphasis role="bold">org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</emphasis> service has following
+ <para><emphasis role="bold">org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</emphasis> service has following
options:</para>
<itemizedlist>
<listitem>
<para>
- <emphasis role="bold">exoGroupTypeName</emphasis> - (value-param) - Name of JBoss Identity IDM GroupType
- that will be used to store groups. Default is 'EXO_GROUP_TYPE'
+ <emphasis role="bold">gtnGroupTypeName</emphasis> - (value-param) - Name of JBoss Identity IDM GroupType
+ that will be used to store groups. Default is 'GTN_GROUP_TYPE'
</para>
</listitem>
<listitem>
<para>
- <emphasis role="bold">exoRootGroupName</emphasis> - (value-param) - Name of JBoss Identity IDM Group that will
- be used as a root parent. Default is 'EXO_ROOT_GROUP'
+ <emphasis role="bold">gtnRootGroupName</emphasis> - (value-param) - Name of JBoss Identity IDM Group that will
+ be used as a root parent. Default is 'GTN_ROOT_GROUP'
</para>
</listitem>
<listitem>
<para>
- <emphasis role="bold">exoRootGroupTypeName</emphasis> - (value-param) - Name of JBoss Identity IDM GroupType
- of a Group used as a parent root. Default is 'EXO_GROUP_TYPE'
+ <emphasis role="bold">gtnRootGroupTypeName</emphasis> - (value-param) - Name of JBoss Identity IDM GroupType
+ of a Group used as a parent root. Default is 'GTN_GROUP_TYPE'
</para>
</listitem>
<listitem>
@@ -187,7 +187,7 @@
<repositories>
<repository>
<id>PortalRepository</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <class>org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository</class>
<external-config/>
<default-identity-store-id>HibernateStore</default-identity-store-id>
<default-attribute-store-id>HibernateStore</default-attribute-store-id>
@@ -198,7 +198,7 @@
<identity-stores>
<identity-store>
<id>HibernateStore</id>
- <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <class>org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
<external-config/>
<supported-relationship-types>
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
Modified: portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js
===================================================================
--- portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-20 17:18:44 UTC (rev 744)
@@ -37,7 +37,7 @@
var mopVersion = "${org.gatein.mop.version}";
var chromatticVersion = "${version.chromattic}";
var reflectVersion = "${version.reflect}";
- var idmVersion = "${org.jboss.identity.idm}";
+ var idmVersion = "${org.picketlink.idm}";
var pcVersion = "${org.gatein.pc.version}";
var wciVersion = "${org.gatein.wci.version}";
var commonVersion = "${org.gatein.common.version}";
@@ -115,12 +115,12 @@
module.component.identity =
new Project("org.exoplatform.portal", "exo.portal.component.identity", "jar", module.version).
- addDependency(new Project("org.jboss.identity.idm", "idm-core", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-common", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-api", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-spi", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-hibernate", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-ldap", "jar", idmVersion));
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-core", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-common", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-api", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-spi", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-hibernate", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-ldap", "jar", idmVersion));
module.component.applicationRegistry =
new Project("org.exoplatform.portal", "exo.portal.component.application-registry", "jar", module.version).
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/pom.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -46,7 +46,7 @@
<org.gatein.common.version>2.0.0-Beta03</org.gatein.common.version>
<org.gatein.wci.version>2.0.0-Beta02</org.gatein.wci.version>
<org.gatein.pc.version>2.1.0-Beta02</org.gatein.pc.version>
- <org.jboss.identity.idm>1.0.0.Beta3</org.jboss.identity.idm>
+ <org.picketlink.idm>1.0.0.CR1</org.picketlink.idm>
<org.gatein.wsrp.version>1.0.0-Beta01</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.0-Beta09</org.gatein.mop.version>
<version.chromattic>1.0.0-beta6</version.chromattic>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -33,6 +33,11 @@
<name>hibernate.properties</name>
<description>Default Hibernate Service</description>
<property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.current_session_context_class" value="thread"/>
+ <property name="hibernate.cache.use_second_level_cache" value="true"/>
+ <property name="hibernate.cache.use_query_cache" value="true"/>
+ <!--CHANGEME HashtableCacheProvider shold not be used in production env-->
+ <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -20,9 +20,9 @@
-->
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_beta"
+<jboss-identity xmlns="urn:picketlink:idm:config:v1_0_0_cr1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
+ xsi:schemaLocation="urn:picketlink:idm:config:v1_0_0_cr1 identity-config.xsd">
<realms>
<realm>
<id>PortalRealm</id>
@@ -35,7 +35,7 @@
<repositories>
<repository>
<id>PortalRepository</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <class>org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository</class>
<external-config/>
<default-identity-store-id>HibernateStore</default-identity-store-id>
<default-attribute-store-id>HibernateStore</default-attribute-store-id>
@@ -46,7 +46,7 @@
<identity-stores>
<identity-store>
<id>HibernateStore</id>
- <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <class>org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
<external-config/>
<supported-relationship-types>
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2009-11-20 16:25:22 UTC (rev 743)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2009-11-20 17:18:44 UTC (rev 744)
@@ -23,54 +23,50 @@
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
<value>war:/conf/organization/idm-config.xml</value>
</value-param>
- <values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto" value="update"/>
- <property name="hibernate.current_session_context_class" value="thread"/>
- <property name="hibernate.show_sql" value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size" value="5"/>
- <property name="hibernate.c3p0.max_size" value="20"/>
- <property name="hibernate.c3p0.timeout" value="1800"/>
- <property name="hibernate.c3p0.max_statements" value="50"/>
- </properties-param>
-
</init-params>
</component>
+
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+
</configuration>
15 years, 1 month