gatein SVN: r5854 - in epp/portal/branches/EPP_5_1_Branch: component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-02-07 09:18:32 -0500 (Mon, 07 Feb 2011)
New Revision: 5854
Modified:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
epp/portal/branches/EPP_5_1_Branch/pom.xml
Log:
- JBEPP-788, GTNWSRP-198: JCR persistence changes.
- Upgraded to WSRP 2.0.1-GA-SNAPSHOT.
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2011-02-03 10:56:47 UTC (rev 5853)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2011-02-07 14:18:32 UTC (rev 5854)
@@ -30,6 +30,7 @@
import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
import org.gatein.registration.RegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
+import org.gatein.registration.policies.RegistrationPolicyWrapper;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
import org.gatein.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
@@ -79,10 +80,12 @@
setRegistrationRequired(registrationRequirements.isRegistrationRequired());
setRegistrationRequiredForFullDescription(registrationRequirements.isRegistrationRequiredForFullDescription());
RegistrationPolicy policy = registrationRequirements.getPolicy();
- setPolicyClassName(policy.getClass().getName());
- if (policy instanceof DefaultRegistrationPolicy)
+ setPolicyClassName(policy.getClassName());
+
+ RegistrationPolicy unwrap = RegistrationPolicyWrapper.unwrap(policy);
+ if (unwrap instanceof DefaultRegistrationPolicy)
{
- DefaultRegistrationPolicy drp = (DefaultRegistrationPolicy)policy;
+ DefaultRegistrationPolicy drp = (DefaultRegistrationPolicy)unwrap;
setValidatorClassName(drp.getValidator().getClass().getName());
}
Modified: epp/portal/branches/EPP_5_1_Branch/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/pom.xml 2011-02-03 10:56:47 UTC (rev 5853)
+++ epp/portal/branches/EPP_5_1_Branch/pom.xml 2011-02-07 14:18:32 UTC (rev 5854)
@@ -48,7 +48,7 @@
<org.gatein.wci.version>2.0.2-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.2.0-GA</org.gatein.pc.version>
<org.picketlink.idm>1.1.7.GA</org.picketlink.idm>
- <org.gatein.wsrp.version>2.0.0-epp51-GA</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.0.1-GA-SNAPSHOT</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
13 years, 10 months
gatein SVN: r5853 - portal/branches/wsrp-extraction/component/wsrp.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-02-03 05:56:47 -0500 (Thu, 03 Feb 2011)
New Revision: 5853
Modified:
portal/branches/wsrp-extraction/component/wsrp/pom.xml
Log:
- GTNPORTAL-1760: Cleaning up POM file.
Modified: portal/branches/wsrp-extraction/component/wsrp/pom.xml
===================================================================
--- portal/branches/wsrp-extraction/component/wsrp/pom.xml 2011-02-02 22:51:10 UTC (rev 5852)
+++ portal/branches/wsrp-extraction/component/wsrp/pom.xml 2011-02-03 10:56:47 UTC (rev 5853)
@@ -92,71 +92,16 @@
</dependency>
<dependency>
- <groupId>org.exoplatform.jcr</groupId>
- <artifactId>exo.jcr.component.ext</artifactId>
- </dependency>
- <dependency>
- <groupId>org.chromattic</groupId>
- <artifactId>chromattic.api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.chromattic</groupId>
- <artifactId>chromattic.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.chromattic</groupId>
- <artifactId>chromattic.spi</artifactId>
- </dependency>
- <dependency>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-wci</artifactId>
</dependency>
- <!-- Required to process Chromattic annotations -->
- <dependency>
- <groupId>org.chromattic</groupId>
- <artifactId>chromattic.apt</artifactId>
- <scope>provided</scope>
- </dependency>
-
<!-- tests -->
<dependency>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.component.test.jcr</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <!--<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>org/gatein/portal/wsrp/SessionEventListenerAndBroadcaster.java</exclude>
- <exclude>org/gatein/portal/wsrp/MOPPortalStructureProvider.java</exclude>
- <exclude>org/gatein/portal/wsrp/state/migration/**/*.java</exclude>
- </excludes>
- </configuration>
- </plugin>-->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>org/gatein/portal/wsrp/state/consumer/**</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
13 years, 10 months
gatein SVN: r5852 - in portal/branches/wsrp-extraction: component/wsrp and 5 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-02-02 17:51:10 -0500 (Wed, 02 Feb 2011)
New Revision: 5852
Added:
portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/jcr/
portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/jcr/JCRPersister.java
Removed:
portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/
portal/branches/wsrp-extraction/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/
portal/branches/wsrp-extraction/component/wsrp/src/test/resources/
Modified:
portal/branches/wsrp-extraction/component/wsrp/pom.xml
portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
portal/branches/wsrp-extraction/packaging/module/src/main/javascript/portal.packaging.module.js
portal/branches/wsrp-extraction/pom.xml
Log:
- GTNPORTAL-1760, GTNWSRP-196:
+ Upgraded to use WSRP 2.1.0-Alpha01-SNAPSHOT to use the moved JCR persistence implementation.
+ JCRPersister now implements ChromatticPersister from WSRP JCR persistence module.
+ Removed JCR persistence implementation classes from component and moved JCRPersister to new org.gatein.portal.wsrp.jcr package.
Modified: portal/branches/wsrp-extraction/component/wsrp/pom.xml
===================================================================
--- portal/branches/wsrp-extraction/component/wsrp/pom.xml 2011-02-02 22:48:53 UTC (rev 5851)
+++ portal/branches/wsrp-extraction/component/wsrp/pom.xml 2011-02-02 22:51:10 UTC (rev 5852)
@@ -47,6 +47,11 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-jcr-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-api</artifactId>
</dependency>
Modified: portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
===================================================================
--- portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2011-02-02 22:48:53 UTC (rev 5851)
+++ portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2011-02-02 22:51:10 UTC (rev 5852)
@@ -44,11 +44,7 @@
import org.gatein.pc.portlet.state.StateConverter;
import org.gatein.pc.portlet.state.producer.PortletStatePersistenceManager;
import org.gatein.pc.portlet.state.producer.ProducerPortletInvoker;
-import org.gatein.portal.wsrp.state.consumer.JCRConsumerRegistry;
-import org.gatein.portal.wsrp.state.migration.JCRMigrationService;
-import org.gatein.portal.wsrp.state.producer.configuration.JCRProducerConfigurationService;
-import org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
-import org.gatein.portal.wsrp.state.producer.state.JCRPortletStatePersistenceManager;
+import org.gatein.portal.wsrp.jcr.JCRPersister;
import org.gatein.portal.wsrp.structure.MOPConsumerStructureProvider;
import org.gatein.portal.wsrp.structure.MOPPortalStructureAccess;
import org.gatein.portal.wsrp.structure.PortalStructureAccess;
@@ -63,14 +59,19 @@
import org.gatein.wci.WebAppListener;
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.gatein.wsrp.WSRPConstants;
+import org.gatein.wsrp.consumer.migration.JCRMigrationService;
import org.gatein.wsrp.consumer.migration.MigrationService;
import org.gatein.wsrp.consumer.registry.ActivatingNullInvokerHandler;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+import org.gatein.wsrp.consumer.registry.JCRConsumerRegistry;
import org.gatein.wsrp.payload.WSRPEventPayloadInterceptor;
import org.gatein.wsrp.producer.ProducerHolder;
-import org.gatein.wsrp.producer.WSRPPortletInvoker;
import org.gatein.wsrp.producer.WSRPProducer;
+import org.gatein.wsrp.producer.config.JCRProducerConfigurationService;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+import org.gatein.wsrp.producer.invoker.RegistrationCheckingPortletInvoker;
+import org.gatein.wsrp.producer.state.JCRPortletStatePersistenceManager;
+import org.gatein.wsrp.registration.JCRRegistrationPersistenceManager;
import org.picocontainer.Startable;
import javax.servlet.ServletContext;
@@ -164,7 +165,10 @@
JCRProducerConfigurationService producerConfigurationService;
try
{
- producerConfigurationService = new JCRProducerConfigurationService(container);
+ JCRPersister persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
+ persister.initializeBuilderFor(JCRProducerConfigurationService.mappingClasses);
+
+ producerConfigurationService = new JCRProducerConfigurationService(persister);
producerConfigurationService.setDefaultConfigurationIS(configurationIS);
producerConfigurationService.reloadConfiguration();
}
@@ -177,7 +181,10 @@
RegistrationPersistenceManager registrationPersistenceManager;
try
{
- registrationPersistenceManager = new JCRRegistrationPersistenceManager(container);
+ JCRPersister persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
+ persister.initializeBuilderFor(JCRRegistrationPersistenceManager.mappingClasses);
+
+ registrationPersistenceManager = new JCRRegistrationPersistenceManager(persister);
}
catch (Exception e)
{
@@ -227,7 +234,10 @@
PortletStatePersistenceManager producerPersistenceManager;
try
{
- producerPersistenceManager = new JCRPortletStatePersistenceManager(container);
+ JCRPersister persister = new JCRPersister(container, JCRPersister.PORTLET_STATES_WORKSPACE_NAME);
+ persister.initializeBuilderFor(JCRPortletStatePersistenceManager.mappingClasses);
+
+ producerPersistenceManager = new JCRPortletStatePersistenceManager(persister);
}
catch (Exception e)
{
@@ -248,7 +258,7 @@
producerPortletInvoker.setStateManagementPolicy(producerStateManagementPolicy);
producerPortletInvoker.setStateConverter(producerStateConverter);
- WSRPPortletInvoker wsrpPortletInvoker = new WSRPPortletInvoker();
+ RegistrationCheckingPortletInvoker wsrpPortletInvoker = new RegistrationCheckingPortletInvoker();
wsrpPortletInvoker.setNext(producerPortletInvoker);
wsrpPortletInvoker.setRegistrationManager(registrationManager);
@@ -279,7 +289,10 @@
try
{
- consumerRegistry = new JCRConsumerRegistry(container);
+ JCRPersister persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
+ persister.initializeBuilderFor(JCRConsumerRegistry.mappingClasses);
+
+ consumerRegistry = new JCRConsumerRegistry(persister);
consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
consumerRegistry.setSessionEventBroadcaster(sessionEventBroadcaster);
@@ -292,7 +305,10 @@
listenerService.addListener(DataStorage.PAGE_UPDATED, structureprovider);
// migration service
- MigrationService migrationService = new JCRMigrationService(container);
+ persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
+ persister.initializeBuilderFor(JCRMigrationService.mappingClasses);
+
+ MigrationService migrationService = new JCRMigrationService(persister);
migrationService.setStructureProvider(structureprovider);
consumerRegistry.setMigrationService(migrationService);
Copied: portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/jcr/JCRPersister.java (from rev 5849, portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java)
===================================================================
--- portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/jcr/JCRPersister.java (rev 0)
+++ portal/branches/wsrp-extraction/component/wsrp/src/main/java/org/gatein/portal/wsrp/jcr/JCRPersister.java 2011-02-02 22:51:10 UTC (rev 5852)
@@ -0,0 +1,344 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.jcr;
+
+import org.chromattic.api.Chromattic;
+import org.chromattic.api.ChromatticBuilder;
+import org.chromattic.api.ChromatticSession;
+import org.chromattic.api.format.FormatterContext;
+import org.chromattic.api.format.ObjectFormatter;
+import org.chromattic.spi.jcr.SessionLifeCycle;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.core.ManageableRepository;
+import org.exoplatform.services.jcr.ext.common.SessionProvider;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.wsrp.jcr.ChromatticPersister;
+import org.gatein.wsrp.jcr.mapping.BaseMapping;
+
+import javax.jcr.Credentials;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class JCRPersister implements ChromatticPersister
+{
+ private Chromattic chrome;
+ public static final String WSRP_WORKSPACE_NAME = "wsrp-system";
+ public static final String PORTLET_STATES_WORKSPACE_NAME = "pc-system";
+ private static final String REPOSITORY_NAME = "repository";
+ private String workspaceName;
+ private Map<Class, Class<? extends BaseMapping>> modelToMapping;
+
+ private ThreadLocal<ChromatticSession> sessionHolder = new ThreadLocal<ChromatticSession>();
+
+ public JCRPersister(ExoContainer container, String workspaceName)
+ {
+ this.workspaceName = workspaceName;
+ }
+
+ public void initializeBuilderFor(List<Class> mappingClasses) throws Exception
+ {
+ ChromatticBuilder builder = ChromatticBuilder.create();
+ builder.setOptionValue(ChromatticBuilder.INSTRUMENTOR_CLASSNAME, "org.chromattic.apt.InstrumentorImpl");
+ if (PORTLET_STATES_WORKSPACE_NAME.equals(workspaceName))
+ {
+ builder.setOptionValue(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME, PortletStatesSessionLifeCycle.class.getName());
+ }
+ else if (WSRP_WORKSPACE_NAME.equals(workspaceName))
+ {
+ builder.setOptionValue(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME, WSRPSessionLifeCycle.class.getName());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unknown workspace name: '" + workspaceName + "'");
+ }
+
+ modelToMapping = new HashMap<Class, Class<? extends BaseMapping>>(mappingClasses.size());
+ for (Class mappingClass : mappingClasses)
+ {
+ if (BaseMapping.class.isAssignableFrom(mappingClass))
+ {
+ Type[] interfaces = mappingClass.getGenericInterfaces();
+ if (ParameterValidation.existsAndIsNotEmpty(interfaces))
+ {
+ Class type = (Class)((ParameterizedType)interfaces[0]).getActualTypeArguments()[0];
+ modelToMapping.put(type, mappingClass);
+ }
+ }
+ builder.add(mappingClass);
+ }
+
+ chrome = builder.build();
+ }
+
+ public ChromatticSession getSession()
+ {
+ ChromatticSession chromatticSession = sessionHolder.get();
+ if (chromatticSession == null)
+ {
+ ChromatticSession session = chrome.openSession();
+ sessionHolder.set(session);
+ return session;
+ }
+ else
+ {
+ return chromatticSession;
+ }
+ }
+
+ public void closeSession(boolean save)
+ {
+ ChromatticSession session = getOpenedSessionOrFail();
+ if (save)
+ {
+ synchronized (this)
+ {
+ session.save();
+ }
+ }
+ session.close();
+ sessionHolder.set(null);
+ }
+
+ private ChromatticSession getOpenedSessionOrFail()
+ {
+ ChromatticSession session = sessionHolder.get();
+ if(session == null)
+ {
+ throw new IllegalStateException("Cannot close the session as it hasn't been opened first!");
+ }
+ return session;
+ }
+
+ public synchronized void save()
+ {
+ getOpenedSessionOrFail().save();
+ }
+
+ public <T> boolean delete(T toDelete, org.gatein.wsrp.jcr.StoresByPathManager<T> manager)
+ {
+ Class<? extends Object> modelClass = toDelete.getClass();
+ Class<? extends BaseMapping> baseMappingClass = modelToMapping.get(modelClass);
+ if (baseMappingClass == null)
+ {
+ throw new IllegalArgumentException("Cannot find a mapping class for " + modelClass.getName());
+ }
+
+ ChromatticSession session = getSession();
+
+ Object old = session.findByPath(baseMappingClass, manager.getChildPath(toDelete));
+
+ if (old != null)
+ {
+ session.remove(old);
+ closeSession(true);
+ return true;
+ }
+ else
+ {
+ closeSession(false);
+ return false;
+ }
+ }
+
+ public static class WSRPSessionLifeCycle implements SessionLifeCycle
+ {
+ private ManageableRepository repository;
+ private SessionProvider provider;
+
+ public WSRPSessionLifeCycle()
+ {
+ try
+ {
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ RepositoryService repoService = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ repository = repoService.getRepository(REPOSITORY_NAME);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ provider = SessionProvider.createSystemProvider();
+ }
+
+ public Session login() throws RepositoryException
+ {
+ return provider.getSession(WSRP_WORKSPACE_NAME, repository);
+ }
+
+ public Session login(String s) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session login(Credentials credentials, String s) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session login(Credentials credentials) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void save(Session session) throws RepositoryException
+ {
+ session.save();
+ }
+
+ public void close(Session session)
+ {
+ session.logout();
+ }
+ }
+
+ public static class PortletStatesSessionLifeCycle implements SessionLifeCycle
+ {
+ private ManageableRepository repository;
+ private SessionProvider provider;
+
+ public PortletStatesSessionLifeCycle()
+ {
+ try
+ {
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ RepositoryService repoService = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ repository = repoService.getRepository(REPOSITORY_NAME);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ provider = SessionProvider.createSystemProvider();
+ }
+
+ public Session login() throws RepositoryException
+ {
+ return provider.getSession(PORTLET_STATES_WORKSPACE_NAME, repository);
+ }
+
+ public Session login(String s) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session login(Credentials credentials, String s) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session login(Credentials credentials) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void save(Session session) throws RepositoryException
+ {
+ session.save();
+ }
+
+ public void close(Session session)
+ {
+ session.logout();
+ }
+ }
+
+ public static class QNameFormatter implements ObjectFormatter
+ {
+ private static final String OPEN_BRACE_REPLACEMENT = "-__";
+ private static final String CLOSE_BRACE_REPLACEMENT = "__-";
+ private static final String COLON_REPLACEMENT = "_-_";
+ private static final String CLOSE_BRACE = "}";
+ private static final String OPEN_BRACE = "{";
+ private static final String COLON = ":";
+
+ public String decodeNodeName(FormatterContext formatterContext, String s)
+ {
+ return decode(s);
+ }
+
+ public String encodeNodeName(FormatterContext formatterContext, String s)
+ {
+ return encode(s);
+ }
+
+ public String decodePropertyName(FormatterContext formatterContext, String s)
+ {
+ return decode(s);
+ }
+
+ public String encodePropertyName(FormatterContext formatterContext, String s)
+ {
+ return encode(s);
+ }
+
+ public static String decode(String s)
+ {
+ return s.replace(CLOSE_BRACE_REPLACEMENT, CLOSE_BRACE).replace(OPEN_BRACE_REPLACEMENT, OPEN_BRACE).replace(COLON_REPLACEMENT, COLON);
+ }
+
+ public static String encode(String s)
+ {
+ return s.replace(OPEN_BRACE, OPEN_BRACE_REPLACEMENT).replace(CLOSE_BRACE, CLOSE_BRACE_REPLACEMENT).replace(COLON, COLON_REPLACEMENT);
+ }
+ }
+
+ public static class PortletNameFormatter implements ObjectFormatter
+ {
+ public static final String SLASH_REPLACEMENT = "-_-";
+ private static final String SLASH = "/";
+
+ public String decodeNodeName(FormatterContext formatterContext, String s)
+ {
+ return decode(s);
+ }
+
+ public static String decode(String s)
+ {
+ return s.replace(SLASH_REPLACEMENT, SLASH);
+ }
+
+ public String encodeNodeName(FormatterContext formatterContext, String s) throws IllegalArgumentException, NullPointerException
+ {
+ return encode(s);
+ }
+
+ public static String encode(String s)
+ {
+ return s.replace(SLASH, SLASH_REPLACEMENT);
+ }
+ }
+}
Modified: portal/branches/wsrp-extraction/packaging/module/src/main/javascript/portal.packaging.module.js
===================================================================
--- portal/branches/wsrp-extraction/packaging/module/src/main/javascript/portal.packaging.module.js 2011-02-02 22:48:53 UTC (rev 5851)
+++ portal/branches/wsrp-extraction/packaging/module/src/main/javascript/portal.packaging.module.js 2011-02-02 22:51:10 UTC (rev 5852)
@@ -88,6 +88,7 @@
.addDependency(new Project("org.gatein.wsrp", "wsrp-wsrp1-ws", "jar", wsrpVersion))
.addDependency(new Project("org.gatein.wsrp", "wsrp-wsrp2-ws", "jar", wsrpVersion))
.addDependency(new Project("org.gatein.wsrp", "wsrp-consumer", "jar", wsrpVersion))
+ .addDependency(new Project("org.gatein.wsrp", "wsrp-jcr-impl", "jar", wsrpVersion))
.addDependency(new Project("org.gatein.wsrp", "wsrp-integration-api", "jar", wsrpVersion));
module.component.scripting =
Modified: portal/branches/wsrp-extraction/pom.xml
===================================================================
--- portal/branches/wsrp-extraction/pom.xml 2011-02-02 22:48:53 UTC (rev 5851)
+++ portal/branches/wsrp-extraction/pom.xml 2011-02-02 22:51:10 UTC (rev 5852)
@@ -48,7 +48,7 @@
<org.gatein.wci.version>2.1.0-Alpha02</org.gatein.wci.version>
<org.gatein.pc.version>2.3.0-Alpha01</org.gatein.pc.version>
<org.picketlink.idm>1.1.8.CR01</org.picketlink.idm>
- <org.gatein.wsrp.version>2.0.0-GA</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.1.0-Alpha01-SNAPSHOT</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
@@ -583,8 +583,14 @@
</dependency>
<dependency>
<groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-jcr-impl</artifactId>
+ <version>${org.gatein.wsrp.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-consumer</artifactId>
<version>${org.gatein.wsrp.version}</version>
+ <!-- TODO: remove -->
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
13 years, 11 months
gatein SVN: r5850 - in components/wsrp/branches/2.0.x: producer/src/main/java/org/gatein/registration and 7 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-02-02 17:01:52 -0500 (Wed, 02 Feb 2011)
New Revision: 5850
Added:
components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/policies/
components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/policies/DefaultRegistrationPolicyTestCase.java
components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/policies/RegistrationPolicyWrapperTestCase.java
Removed:
components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java
Modified:
components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java
components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java
components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java
components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPropertyValidator.java
components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java
components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirements.java
components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/ProducerConfigurationProvider.java
components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java
components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java
components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java
Log:
- GTNWSRP-198: Fixed improper persistence of custom RegistrationPolicy implementations. Made clearer the fact that RegistrationPolicy instances are wrapped using a RegistrationPolicyWrapper.
- Will need to update JCR persistence in GateIn.
Modified: components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java
===================================================================
--- components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -25,6 +25,7 @@
import org.gatein.registration.RegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
+import org.gatein.registration.policies.RegistrationPolicyWrapper;
import org.gatein.wsrp.producer.config.ProducerConfiguration;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
@@ -95,7 +96,7 @@
RegistrationPolicy policy = getRegRequirements().getPolicy();
if (policy != null)
{
- return policy.getClass().getName();
+ return policy.getClassName();
}
else
{
@@ -117,7 +118,8 @@
{
if (isDefaultRegistrationPolicy())
{
- return ((DefaultRegistrationPolicy)getRegRequirements().getPolicy()).getValidator().getClass().getName();
+ DefaultRegistrationPolicy policy = (DefaultRegistrationPolicy)RegistrationPolicyWrapper.unwrap(getRegRequirements().getPolicy());
+ return policy.getValidator().getClass().getName();
}
throw new IllegalStateException("getValidatorClassName shouldn't be called if we're not using the default registration");
}
@@ -163,14 +165,15 @@
registrationRequirements.setRegistrationRequiredForFullDescription(configuration.isRegistrationRequiredForFullDescription());
registrationRequirements.setRegistrationRequired(configuration.isRegistrationRequired());
- if (!ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
- {
- registrationRequirements.reloadPolicyFrom(policyClassName, validatorClassName);
- }
+ registrationRequirements.reloadPolicyFrom(policyClassName, validatorClassName);
registrationRequirements.setRegistrationProperties(configuration.getRegistrationRequirements().getRegistrationProperties());
getConfigurationService().saveConfiguration();
+
+ // force a reload local state
+ registrationConfiguration = null;
+
beanContext.createInfoMessage("bean_producer_save_success");
}
catch (Exception e)
Modified: components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -23,6 +23,7 @@
package org.gatein.registration;
+import org.gatein.pc.api.PortletContext;
import org.gatein.wsrp.registration.PropertyDescription;
import javax.xml.namespace.QName;
@@ -32,6 +33,13 @@
* An interface allowing users of the Registration service to customize different aspects of how Consumers are handled.
* Methods of this interface are used by RegistrationManager to make appropriate decisions. Implementations of this
* interface <strong>MUST</strong> provide a no-argument constructor for instantiation from the class name.
+ * <p/>
+ * <strong>IMPORTANT</strong>: RegistrationPolicy instances are wrapped using a {@link
+ * org.gatein.registration.policies.RegistrationPolicyWrapper}. As a result, using <code>instanceof</code> on a
+ * RegistrationPolicy will probably result in unexpected result. To retrieve the actual class of the RegistrationPolicy
+ * instance in use, use {@link #getRealClass()} (or {@link #getClassName()} to retrieve the class name). If, for some
+ * reason, the actual RegistrationPolicy instance is needed, use {@link org.gatein.registration.policies.RegistrationPolicyWrapper#unwrap(RegistrationPolicy)},
+ * though it is not recommended to manipulate actual RegistrationPolicy instances directly.
*
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision: 11406 $
@@ -122,51 +130,33 @@
void validateConsumerGroupName(String groupName, RegistrationManager manager) throws IllegalArgumentException, RegistrationException;
/**
- * Checks if a portlet handle belongs to a specific registration.
- * GTNWSRP-72
+ * TODO
*
- * @param registration The registration to check
- * @param portletHandle The portlet handle to use
- * @return True if the registration contains this portlet handle
+ * @param portletContext
+ * @param registration
+ * @param operation
+ * @return
*/
-// boolean checkPortletHandle(Registration registration, String portletHandle);
+ boolean allowAccessTo(PortletContext portletContext, Registration registration, String operation);
/**
- * Adds a Portlet Handle to a Registration
- * GTNWSRP-72
+ * TODO
*
- * @param registration The registration to use
- * @param portletHandle The portletHandle to add
+ * @return
*/
-// void addPortletHandle(Registration registration, String portletHandle);
+ boolean isWrapped();
/**
- * Removes a portlet handle from a specific registration
- * GTNWSRP-72
+ * TODO
*
- * @param registration The registration to use
- * @param portletHandle The portlet handle to remove
+ * @return
*/
-// void removePortletHandle(Registration registration, String portletHandle);
+ String getClassName();
/**
- * Updates the list of currently available portlet handles.
- * GTNWSRP-72
+ * TODO
*
- * Note: this is not registration specific. This method deals with the situation where
- * the producer has a change in the available portlets. The RegistrationPolicy needs to either handle
- * the globally available portlets separately or update each registration when this type of change occurs.
- *
- * @param portlets
+ * @return
*/
-// void updatePortletHandles(List<String> portlets);
-
- /**
- * Adds a PortletContextChangeListener to the RegistrationPolicy. The PortletContextChangeListener
- * will be called whenever the portlet contexts within a registration changes.
- * GTNWSRP-72
- *
- * @param listener The listener to add
- */
-// void addPortletContextChangeListener(RegistrationPortletContextChangeListener listener);
+ Class<? extends RegistrationPolicy> getRealClass();
}
Modified: components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -24,6 +24,7 @@
package org.gatein.registration.policies;
import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.PortletContext;
import org.gatein.registration.Consumer;
import org.gatein.registration.DuplicateRegistrationException;
import org.gatein.registration.InvalidConsumerDataException;
@@ -31,17 +32,14 @@
import org.gatein.registration.RegistrationException;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPolicy;
-import org.gatein.registration.RegistrationPortletContextChangeListener;
import org.gatein.registration.RegistrationStatus;
import org.gatein.wsrp.registration.PropertyDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.xml.namespace.QName;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -57,12 +55,12 @@
{
private RegistrationPropertyValidator validator;
private static final Logger log = LoggerFactory.getLogger(DefaultRegistrationPolicy.class);
-
- //Stores a list of the default portlet handles which should be available to all registrations (ie not cloned handles)
- List<String> defaultPortletHandleList = new ArrayList<String>();
-
- List<RegistrationPortletContextChangeListener> listeners;
+ public DefaultRegistrationPolicy()
+ {
+ validator = DefaultRegistrationPropertyValidator.DEFAULT;
+ }
+
@Override
public boolean equals(Object o)
{
@@ -170,28 +168,24 @@
/** Simply returns the given registration id. */
public String createRegistrationHandleFor(String registrationId)
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(registrationId, "Registration id", null);
return registrationId;
}
/** Doesn't support automatic ConsumerGroups so always return <code>null</code>. */
public String getAutomaticGroupNameFor(String consumerName)
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
return null;
}
/** Compute a simple, safe id based on the provided consumer name trusted (!) to be unique. */
public String getConsumerIdFrom(String consumerName, Map<QName, Object> registrationProperties) throws IllegalArgumentException, InvalidConsumerDataException
{
- return RegistrationPolicyWrapper.sanitizeConsumerName(consumerName);
+ return consumerName;
}
/** Rejects registration if a Consumer with the specified name already exists. */
public void validateConsumerName(String consumerName, final RegistrationManager manager) throws IllegalArgumentException, RegistrationException
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
-
Consumer consumer = manager.getConsumerByIdentity(getConsumerIdFrom(consumerName, Collections.<QName, Object>emptyMap()));
if (consumer != null)
{
@@ -205,6 +199,26 @@
// this is already the behavior in the RegistrationPersistenceManager so no need to do anything
}
+ public boolean allowAccessTo(PortletContext portletContext, Registration registration, String operation)
+ {
+ return true;
+ }
+
+ public boolean isWrapped()
+ {
+ return false;
+ }
+
+ public String getClassName()
+ {
+ return getClass().getName();
+ }
+
+ public Class<? extends RegistrationPolicy> getRealClass()
+ {
+ return getClass();
+ }
+
/**
* Instructs this policy to use the specified RegistrationPropertyValidator. There shouldn't be any need to call this
* method manually, as the validator is configured via the WSRP Producer xml configuration file.
@@ -225,66 +239,4 @@
{
return validator;
}
-
- public void addPortletHandle(Registration registration, String portletHandle)
- {
- if (registration != null && !registration.getPortletHandles().contains(portletHandle))
- {
- registration.getPortletHandles().add(portletHandle);
- updatePortletContextListeners(registration);
- }
- }
-
- public boolean checkPortletHandle(Registration registration, String portletHandle)
- {
- if (defaultPortletHandleList.contains(portletHandle))
- {
- return true;
- }
-
- if (registration != null && registration.getPortletHandles().contains(portletHandle))
- {
- return true;
- }
-
- return false;
- }
-
- public void removePortletHandle(Registration registration, String portletHandle)
- {
- if (registration != null)
- {
- registration.getPortletHandles().remove(portletHandle);
- updatePortletContextListeners(registration);
- }
- }
-
- public void updatePortletHandles(List<String> portletHandles)
- {
- this.defaultPortletHandleList = portletHandles;
- }
-
- public void addPortletContextChangeListener(RegistrationPortletContextChangeListener listener)
- {
- if (listeners == null)
- {
- listeners = new ArrayList<RegistrationPortletContextChangeListener>();
- }
-
- if (!listeners.contains(listener))
- {
- listeners.add(listener);
- }
- }
-
- protected void updatePortletContextListeners(Registration registration)
- {
- if (listeners != null)
- {
- for (RegistrationPortletContextChangeListener listener : listeners)
- {
- listener.portletContextsHaveChanged(registration);
- }
- }
- }
}
Modified: components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPropertyValidator.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPropertyValidator.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPropertyValidator.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -41,4 +41,6 @@
"'. DefaultRegistrationPropertyValidator only accepts non-null, non-empty Strings.");
}
}
+
+ public static final RegistrationPropertyValidator DEFAULT = new DefaultRegistrationPropertyValidator();
}
Modified: components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -24,7 +24,9 @@
package org.gatein.registration.policies;
import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.PortletContext;
import org.gatein.registration.InvalidConsumerDataException;
+import org.gatein.registration.Registration;
import org.gatein.registration.RegistrationException;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPolicy;
@@ -41,13 +43,40 @@
{
private final RegistrationPolicy delegate;
- public RegistrationPolicyWrapper(RegistrationPolicy delegate)
+ public static RegistrationPolicy wrap(RegistrationPolicy policy)
{
- ParameterValidation.throwIllegalArgExceptionIfNull(delegate, "Delegate");
+ ParameterValidation.throwIllegalArgExceptionIfNull(policy, "RegistrationPolicy to wrap");
+
+ if (!policy.isWrapped())
+ {
+ return new RegistrationPolicyWrapper(policy);
+ }
+ else
+ {
+ return policy;
+ }
+ }
+
+ public static RegistrationPolicy unwrap(RegistrationPolicy policy)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(policy, "RegistrationPolicy to unwrap");
+
+ if (policy.isWrapped())
+ {
+ return ((RegistrationPolicyWrapper)policy).getDelegate();
+ }
+ else
+ {
+ return policy;
+ }
+ }
+
+ private RegistrationPolicyWrapper(RegistrationPolicy delegate)
+ {
this.delegate = delegate;
}
- public RegistrationPolicy getDelegate()
+ private RegistrationPolicy getDelegate()
{
return delegate;
}
@@ -61,13 +90,14 @@
public String createRegistrationHandleFor(String registrationId)
throws IllegalArgumentException
{
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(registrationId, "Registration id", null);
return delegate.createRegistrationHandleFor(registrationId);
}
public String getAutomaticGroupNameFor(String consumerName)
throws IllegalArgumentException
{
- return delegate.getAutomaticGroupNameFor(consumerName);
+ return delegate.getAutomaticGroupNameFor(sanitizeConsumerName(consumerName));
}
public String getConsumerIdFrom(String consumerName, Map<QName, Object> registrationProperties)
@@ -79,7 +109,7 @@
public void validateConsumerName(String consumerName, final RegistrationManager manager)
throws IllegalArgumentException, RegistrationException
{
- delegate.validateConsumerName(consumerName, manager);
+ delegate.validateConsumerName(sanitizeConsumerName(consumerName), manager);
}
public void validateConsumerGroupName(String groupName, RegistrationManager manager)
@@ -88,40 +118,34 @@
delegate.validateConsumerGroupName(groupName, manager);
}
- static String sanitizeConsumerName(String consumerName)
+ public boolean allowAccessTo(PortletContext portletContext, Registration registration, String operation)
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
- consumerName = consumerName.trim();
- consumerName = consumerName.replaceAll(",", "_");
- consumerName = consumerName.replaceAll(" ", "_");
- consumerName = consumerName.replaceAll("/", "_");
-
- return consumerName;
+ return delegate.allowAccessTo(portletContext, registration, operation);
}
- /* GTNWSRP-72
- public void addPortletHandle(Registration registration, String portletHandle)
+ public boolean isWrapped()
{
- delegate.addPortletHandle(registration, portletHandle);
+ return true;
}
- public boolean checkPortletHandle(Registration registration, String portletHandle)
+ public String getClassName()
{
- return delegate.checkPortletHandle(registration, portletHandle);
+ return delegate.getClassName();
}
- public void removePortletHandle(Registration registration, String portletHandle)
+ public Class<? extends RegistrationPolicy> getRealClass()
{
- delegate.removePortletHandle(registration, portletHandle);
+ return delegate.getClass();
}
- public void updatePortletHandles(List<String> portletHandles)
+ static String sanitizeConsumerName(String consumerName)
{
- delegate.updatePortletHandles(portletHandles);
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
+ consumerName = consumerName.trim();
+ consumerName = consumerName.replaceAll(",", "_");
+ consumerName = consumerName.replaceAll(" ", "_");
+ consumerName = consumerName.replaceAll("/", "_");
+
+ return consumerName;
}
-
- public void addPortletContextChangeListener(RegistrationPortletContextChangeListener listener)
- {
- delegate.addPortletContextChangeListener(listener);
- }*/
}
Modified: components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirements.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirements.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirements.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -118,4 +118,6 @@
long getLastModified();
void setRegistrationProperties(Map<QName, RegistrationPropertyDescription> registrationProperties);
+
+ String getPolicyClassName();
}
Modified: components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -326,18 +326,25 @@
{
if (ParameterValidation.isOldAndNewDifferent(this.policy, policy))
{
- this.policy = policy;
-
if (policy != null)
{
- policyClassName = policy.getClass().getName();
+ this.policy = RegistrationPolicyWrapper.wrap(policy);
+ policyClassName = policy.getClassName();
- if (policy instanceof DefaultRegistrationPolicy)
+ if (DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
{
DefaultRegistrationPolicy registrationPolicy = (DefaultRegistrationPolicy)policy;
validatorClassName = registrationPolicy.getValidator().getClass().getName();
}
+ else
+ {
+ validatorClassName = null;
+ }
}
+ else
+ {
+ this.policy = null;
+ }
modifyNow();
notifyRegistrationPolicyChangeListeners();
@@ -375,10 +382,7 @@
}
RegistrationPolicy policy = (RegistrationPolicy)policyClass.newInstance();
- // wrap policy so that we can perform minimal sanitization of values
- RegistrationPolicyWrapper wrapper = new RegistrationPolicyWrapper(policy);
-
- setPolicy(wrapper);
+ setPolicy(policy);
}
catch (ClassNotFoundException e)
{
@@ -422,9 +426,9 @@
}
- DefaultRegistrationPolicy policy = new DefaultRegistrationPolicy();
- policy.setValidator(validator);
- setPolicy(policy);
+ DefaultRegistrationPolicy delegate = new DefaultRegistrationPolicy();
+ delegate.setValidator(validator);
+ setPolicy(delegate);
}
}
}
Modified: components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/ProducerConfigurationProvider.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/ProducerConfigurationProvider.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/ProducerConfigurationProvider.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -25,6 +25,7 @@
import org.gatein.registration.RegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
+import org.gatein.registration.policies.RegistrationPolicyWrapper;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
import org.gatein.wsrp.producer.config.impl.ProducerConfigurationImpl;
@@ -104,12 +105,12 @@
RegistrationPolicy policy = regReq.getPolicy();
if (policy != null)
{
- value = policy.getClass().getName();
+ value = policy.getClassName();
}
}
else if ("registration-property-validator".equals(localName))
{
- RegistrationPolicy policy = regReq.getPolicy();
+ RegistrationPolicy policy = RegistrationPolicyWrapper.unwrap(regReq.getPolicy());
if (policy instanceof DefaultRegistrationPolicy)
{
DefaultRegistrationPolicy defaultRegistrationPolicy = (DefaultRegistrationPolicy)policy;
Deleted: components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -1,183 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, 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.registration;
-
-import junit.framework.TestCase;
-import org.gatein.registration.impl.RegistrationManagerImpl;
-import org.gatein.registration.impl.RegistrationPersistenceManagerImpl;
-import org.gatein.registration.policies.DefaultRegistrationPolicy;
-import org.gatein.registration.policies.DefaultRegistrationPropertyValidator;
-import org.gatein.wsrp.registration.PropertyDescription;
-
-import javax.xml.namespace.QName;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision: 9180 $
- * @since 2.6.3
- */
-public class DefaultRegistrationPolicyTestCase extends TestCase
-{
- DefaultRegistrationPolicy policy;
- Map<QName, Object> registrationProperties;
- Map<QName, PropertyDescription> expectations;
- private static final String CONSUMER = "consumer";
- private static final QName PROP1 = new QName("prop1");
- private static final QName PROP2 = new QName("prop2");
- private static final QName PROP3 = new QName("prop3");
- private RegistrationManager manager;
-
- @Override
- protected void setUp() throws Exception
- {
- policy = new DefaultRegistrationPolicy();
-
- policy.setValidator(new DefaultRegistrationPropertyValidator());
-
- manager = new RegistrationManagerImpl();
- manager.setPolicy(policy);
- manager.setPersistenceManager(new RegistrationPersistenceManagerImpl());
- manager.createConsumer(CONSUMER);
-
- registrationProperties = new HashMap<QName, Object>();
- registrationProperties.put(PROP1, "value1");
- registrationProperties.put(PROP2, "value2");
-
- expectations = new HashMap<QName, PropertyDescription>();
- }
-
- public void testValidateRegistrationDataForNull() throws RegistrationException
- {
- try
- {
- policy.validateRegistrationDataFor(null, "foo", expectations, manager);
- fail("null data cannot be validated");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
-
- try
- {
- policy.validateRegistrationDataFor(Collections.<QName, Object>emptyMap(), null, expectations, manager);
- fail("null data cannot be validated");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
- }
-
- public void testValidateRegistrationDataForInexistentConsumer()
- {
- try
- {
- policy.validateRegistrationDataFor(Collections.<QName, Object>emptyMap(), "foo", expectations, manager);
- }
- catch (RegistrationException e)
- {
- fail("Should be possible to validate information for inexistent consumer (otherwise, how would we register!)");
- }
- }
-
- public void testValidateRegistrationDataMissingProps()
- {
- expectations.put(PROP1, new TestPropertyDescription(PROP1));
- expectations.put(PROP2, new TestPropertyDescription(PROP2));
- expectations.put(PROP3, new TestPropertyDescription(PROP3));
-
- try
- {
- policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
- fail("Missing prop3 should have been detected");
- }
- catch (RegistrationException e)
- {
- assertTrue(e.getLocalizedMessage().contains("prop3"));
- }
- }
-
- public void testValidateRegistrationDataExtraProps()
- {
- expectations.put(PROP1, new TestPropertyDescription(PROP1));
-
- try
- {
- policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
- fail("Extra prop2 should have been detected");
- }
- catch (RegistrationException e)
- {
- assertTrue(e.getLocalizedMessage().contains("prop2"));
- }
- }
-
- public void testValidateRegistrationDataInvalidValue()
- {
- expectations.put(PROP1, new TestPropertyDescription(PROP1));
-
- registrationProperties.remove(PROP2);
- registrationProperties.put(PROP1, null);
-
- try
- {
- policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
- fail("Should have detected null value for prop1");
- }
- catch (RegistrationException e)
- {
- assertTrue(e.getLocalizedMessage().contains("prop1"));
- }
- }
-
- static class TestPropertyDescription implements PropertyDescription
- {
- private QName name;
- private static final QName TYPE = new QName("type");
-
- TestPropertyDescription(QName name)
- {
- this.name = name;
- }
-
- public QName getName()
- {
- return name;
- }
-
- public QName getType()
- {
- return TYPE;
- }
-
- public int compareTo(PropertyDescription o)
- {
- return name.toString().compareTo(o.getName().toString());
- }
- }
-}
Copied: components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/policies/DefaultRegistrationPolicyTestCase.java (from rev 5803, components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java)
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/policies/DefaultRegistrationPolicyTestCase.java (rev 0)
+++ components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/policies/DefaultRegistrationPolicyTestCase.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -0,0 +1,189 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, 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.registration.policies;
+
+import junit.framework.TestCase;
+import org.gatein.registration.RegistrationException;
+import org.gatein.registration.RegistrationManager;
+import org.gatein.registration.impl.RegistrationManagerImpl;
+import org.gatein.registration.impl.RegistrationPersistenceManagerImpl;
+import org.gatein.wsrp.registration.PropertyDescription;
+
+import javax.xml.namespace.QName;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 9180 $
+ * @since 2.6.3
+ */
+public class DefaultRegistrationPolicyTestCase extends TestCase
+{
+ DefaultRegistrationPolicy policy;
+ Map<QName, Object> registrationProperties;
+ Map<QName, PropertyDescription> expectations;
+ private static final String CONSUMER = "consumer";
+ private static final QName PROP1 = new QName("prop1");
+ private static final QName PROP2 = new QName("prop2");
+ private static final QName PROP3 = new QName("prop3");
+ private RegistrationManager manager;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ policy = new DefaultRegistrationPolicy();
+
+ policy.setValidator(new DefaultRegistrationPropertyValidator());
+
+ manager = new RegistrationManagerImpl();
+ manager.setPolicy(policy);
+ manager.setPersistenceManager(new RegistrationPersistenceManagerImpl());
+ manager.createConsumer(CONSUMER);
+
+ registrationProperties = new HashMap<QName, Object>();
+ registrationProperties.put(PROP1, "value1");
+ registrationProperties.put(PROP2, "value2");
+
+ expectations = new HashMap<QName, PropertyDescription>();
+ }
+
+ public void testInitialState()
+ {
+ DefaultRegistrationPolicy registrationPolicy = new DefaultRegistrationPolicy();
+ assertEquals(DefaultRegistrationPropertyValidator.DEFAULT, registrationPolicy.getValidator());
+ }
+
+ public void testValidateRegistrationDataForNull() throws RegistrationException
+ {
+ try
+ {
+ policy.validateRegistrationDataFor(null, "foo", expectations, manager);
+ fail("null data cannot be validated");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+
+ try
+ {
+ policy.validateRegistrationDataFor(Collections.<QName, Object>emptyMap(), null, expectations, manager);
+ fail("null data cannot be validated");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testValidateRegistrationDataForInexistentConsumer()
+ {
+ try
+ {
+ policy.validateRegistrationDataFor(Collections.<QName, Object>emptyMap(), "foo", expectations, manager);
+ }
+ catch (RegistrationException e)
+ {
+ fail("Should be possible to validate information for inexistent consumer (otherwise, how would we register!)");
+ }
+ }
+
+ public void testValidateRegistrationDataMissingProps()
+ {
+ expectations.put(PROP1, new TestPropertyDescription(PROP1));
+ expectations.put(PROP2, new TestPropertyDescription(PROP2));
+ expectations.put(PROP3, new TestPropertyDescription(PROP3));
+
+ try
+ {
+ policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
+ fail("Missing prop3 should have been detected");
+ }
+ catch (RegistrationException e)
+ {
+ assertTrue(e.getLocalizedMessage().contains("prop3"));
+ }
+ }
+
+ public void testValidateRegistrationDataExtraProps()
+ {
+ expectations.put(PROP1, new TestPropertyDescription(PROP1));
+
+ try
+ {
+ policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
+ fail("Extra prop2 should have been detected");
+ }
+ catch (RegistrationException e)
+ {
+ assertTrue(e.getLocalizedMessage().contains("prop2"));
+ }
+ }
+
+ public void testValidateRegistrationDataInvalidValue()
+ {
+ expectations.put(PROP1, new TestPropertyDescription(PROP1));
+
+ registrationProperties.remove(PROP2);
+ registrationProperties.put(PROP1, null);
+
+ try
+ {
+ policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
+ fail("Should have detected null value for prop1");
+ }
+ catch (RegistrationException e)
+ {
+ assertTrue(e.getLocalizedMessage().contains("prop1"));
+ }
+ }
+
+ static class TestPropertyDescription implements PropertyDescription
+ {
+ private QName name;
+ private static final QName TYPE = new QName("type");
+
+ TestPropertyDescription(QName name)
+ {
+ this.name = name;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public QName getType()
+ {
+ return TYPE;
+ }
+
+ public int compareTo(PropertyDescription o)
+ {
+ return name.toString().compareTo(o.getName().toString());
+ }
+ }
+}
Property changes on: components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/policies/DefaultRegistrationPolicyTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/policies/RegistrationPolicyWrapperTestCase.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/policies/RegistrationPolicyWrapperTestCase.java (rev 0)
+++ components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/registration/policies/RegistrationPolicyWrapperTestCase.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, 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.registration.policies;
+
+import junit.framework.TestCase;
+import org.gatein.registration.RegistrationPolicy;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class RegistrationPolicyWrapperTestCase extends TestCase
+{
+ public void testWrap()
+ {
+ RegistrationPolicy policy = new DefaultRegistrationPolicy();
+
+ RegistrationPolicy wrapper = RegistrationPolicyWrapper.wrap(policy);
+ assertEquals(policy.getClass(), wrapper.getRealClass());
+ assertEquals(policy.getClassName(), wrapper.getClassName());
+ assertEquals(policy.getClass().getName(), wrapper.getClassName());
+
+ assertEquals(wrapper, RegistrationPolicyWrapper.wrap(wrapper));
+ assertTrue(wrapper instanceof RegistrationPolicyWrapper);
+
+ assertEquals(policy, RegistrationPolicyWrapper.unwrap(wrapper));
+ assertEquals(policy, RegistrationPolicyWrapper.unwrap(policy));
+ }
+}
Modified: components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -96,11 +96,13 @@
RegistrationPolicy policy = requirements.getPolicy();
// check that the policy is properly wrapped
- assertTrue(policy instanceof RegistrationPolicyWrapper);
+ assertTrue(policy.isWrapped());
+ // policy is wrapped so instanceof won't work!
+ assertFalse(policy instanceof TestRegistrationPolicy);
+
// and that the delegate is indeed the expected policy
- RegistrationPolicyWrapper wrapper = (RegistrationPolicyWrapper)policy;
- assertTrue(wrapper.getDelegate() instanceof TestRegistrationPolicy);
+ assertEquals(TestRegistrationPolicy.class, RegistrationPolicyWrapper.unwrap(policy).getClass());
}
public void testExtendedUnmarshalling() throws Exception
@@ -110,7 +112,7 @@
ProducerRegistrationRequirements requirements = producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
- RegistrationPolicy policy = requirements.getPolicy();
+ RegistrationPolicy policy = RegistrationPolicyWrapper.unwrap(requirements.getPolicy());
assertTrue(policy instanceof DefaultRegistrationPolicy);
RegistrationPropertyValidator propertyValidator = ((DefaultRegistrationPolicy)policy).getValidator();
assertNotNull(propertyValidator);
Modified: components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -28,7 +28,6 @@
import org.gatein.registration.RegistrationPolicyChangeListener;
import org.gatein.registration.RegistrationPropertyChangeListener;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
-import org.gatein.registration.policies.RegistrationPolicyWrapper;
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
import org.gatein.wsrp.registration.PropertyDescription;
@@ -72,16 +71,22 @@
public void testChangeRegistrationPolicy()
{
- ProducerRegistrationRequirements requirements = new ProducerRegistrationRequirementsImpl();
+ ProducerRegistrationRequirementsImpl requirements = new ProducerRegistrationRequirementsImpl();
requirements.setRegistrationRequired(true); // so that we load the policy
- assertTrue(requirements.getPolicy() instanceof DefaultRegistrationPolicy);
+ RegistrationPolicy policy = requirements.getPolicy();
+ assertTrue(policy.isWrapped());
+ assertFalse(policy instanceof DefaultRegistrationPolicy); // cannot use instanceof since policy is wrapped
+ assertEquals(ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME, policy.getClassName());
+
requirements.reloadPolicyFrom("org.gatein.wsrp.producer.config.TestRegistrationPolicy", ProducerRegistrationRequirements.DEFAULT_VALIDATOR_CLASS_NAME);
- RegistrationPolicy policy = requirements.getPolicy();
- assertTrue(policy instanceof RegistrationPolicyWrapper);
- RegistrationPolicyWrapper wrapper = (RegistrationPolicyWrapper)policy;
- assertTrue(wrapper.getDelegate() instanceof TestRegistrationPolicy);
+ policy = requirements.getPolicy();
+ assertTrue(policy.isWrapped());
+ assertFalse(policy instanceof TestRegistrationPolicy); // cannot use instanceof since policy is wrapped
+ assertEquals("org.gatein.wsrp.producer.config.TestRegistrationPolicy", requirements.getPolicyClassName());
+ assertEquals("org.gatein.wsrp.producer.config.TestRegistrationPolicy", policy.getClassName());
+ assertNull(requirements.getValidatorClassName());
}
public void testSetUnchangedRegistrationProperties()
Modified: components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java
===================================================================
--- components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java 2011-02-02 21:59:34 UTC (rev 5849)
+++ components/wsrp/branches/2.0.x/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java 2011-02-02 22:01:52 UTC (rev 5850)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -23,17 +23,15 @@
package org.gatein.wsrp.producer.config;
+import org.gatein.pc.api.PortletContext;
import org.gatein.registration.InvalidConsumerDataException;
import org.gatein.registration.Registration;
import org.gatein.registration.RegistrationException;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPolicy;
-import org.gatein.registration.RegistrationPortletContextChangeListener;
import org.gatein.wsrp.registration.PropertyDescription;
import javax.xml.namespace.QName;
-
-import java.util.List;
import java.util.Map;
/**
@@ -70,25 +68,23 @@
{
}
- public void addPortletHandle(Registration registration, String portletHandle)
+ public boolean allowAccessTo(PortletContext portletContext, Registration registration, String operation)
{
- }
-
- public boolean checkPortletHandle(Registration registration, String portletHandle)
- {
return true;
}
- public void removePortletHandle(Registration registration, String portletHandle)
+ public boolean isWrapped()
{
+ return false;
}
- public void updatePortletHandles(List<String> portletHandles)
+ public String getClassName()
{
+ return getClass().getName();
}
- public void addPortletContextChangeListener(RegistrationPortletContextChangeListener listener)
+ public Class<? extends RegistrationPolicy> getRealClass()
{
+ return getClass();
}
-
}
13 years, 11 months
gatein SVN: r5849 - in components/wsrp/trunk: jcr-impl/src/main/java/org/gatein/wsrp/producer/config/mapping and 8 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-02-02 16:59:34 -0500 (Wed, 02 Feb 2011)
New Revision: 5849
Added:
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/policies/
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/policies/DefaultRegistrationPolicyTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/policies/RegistrationPolicyWrapperTestCase.java
Removed:
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java
Modified:
components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/producer/config/mapping/RegistrationRequirementsMapping.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPropertyValidator.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirements.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/ProducerConfigurationProvider.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java
Log:
- GTNWSRP-198: Fixed improper persistence of custom RegistrationPolicy implementations. Made clearer the fact that RegistrationPolicy instances are wrapped using a RegistrationPolicyWrapper.
Modified: components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java
===================================================================
--- components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/admin-gui/src/main/java/org/gatein/wsrp/admin/ui/ProducerBean.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -25,6 +25,7 @@
import org.gatein.registration.RegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
+import org.gatein.registration.policies.RegistrationPolicyWrapper;
import org.gatein.wsrp.producer.config.ProducerConfiguration;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
@@ -95,7 +96,7 @@
RegistrationPolicy policy = getRegRequirements().getPolicy();
if (policy != null)
{
- return policy.getClass().getName();
+ return policy.getClassName();
}
else
{
@@ -117,7 +118,8 @@
{
if (isDefaultRegistrationPolicy())
{
- return ((DefaultRegistrationPolicy)getRegRequirements().getPolicy()).getValidator().getClass().getName();
+ DefaultRegistrationPolicy policy = (DefaultRegistrationPolicy)RegistrationPolicyWrapper.unwrap(getRegRequirements().getPolicy());
+ return policy.getValidator().getClass().getName();
}
throw new IllegalStateException("getValidatorClassName shouldn't be called if we're not using the default registration");
}
@@ -163,14 +165,15 @@
registrationRequirements.setRegistrationRequiredForFullDescription(configuration.isRegistrationRequiredForFullDescription());
registrationRequirements.setRegistrationRequired(configuration.isRegistrationRequired());
- if (!ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
- {
- registrationRequirements.reloadPolicyFrom(policyClassName, validatorClassName);
- }
+ registrationRequirements.reloadPolicyFrom(policyClassName, validatorClassName);
registrationRequirements.setRegistrationProperties(configuration.getRegistrationRequirements().getRegistrationProperties());
getConfigurationService().saveConfiguration();
+
+ // force a reload local state
+ registrationConfiguration = null;
+
beanContext.createInfoMessage("bean_producer_save_success");
}
catch (Exception e)
Modified: components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/producer/config/mapping/RegistrationRequirementsMapping.java
===================================================================
--- components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/producer/config/mapping/RegistrationRequirementsMapping.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/producer/config/mapping/RegistrationRequirementsMapping.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -30,6 +30,7 @@
import org.chromattic.api.annotations.Property;
import org.gatein.registration.RegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
+import org.gatein.registration.policies.RegistrationPolicyWrapper;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
import org.gatein.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
@@ -80,10 +81,12 @@
setRegistrationRequired(registrationRequirements.isRegistrationRequired());
setRegistrationRequiredForFullDescription(registrationRequirements.isRegistrationRequiredForFullDescription());
RegistrationPolicy policy = registrationRequirements.getPolicy();
- setPolicyClassName(policy.getClass().getName());
- if (policy instanceof DefaultRegistrationPolicy)
+ setPolicyClassName(policy.getClassName());
+
+ RegistrationPolicy unwrap = RegistrationPolicyWrapper.unwrap(policy);
+ if (unwrap instanceof DefaultRegistrationPolicy)
{
- DefaultRegistrationPolicy drp = (DefaultRegistrationPolicy)policy;
+ DefaultRegistrationPolicy drp = (DefaultRegistrationPolicy)unwrap;
setValidatorClassName(drp.getValidator().getClass().getName());
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/RegistrationPolicy.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -33,6 +33,13 @@
* An interface allowing users of the Registration service to customize different aspects of how Consumers are handled.
* Methods of this interface are used by RegistrationManager to make appropriate decisions. Implementations of this
* interface <strong>MUST</strong> provide a no-argument constructor for instantiation from the class name.
+ * <p/>
+ * <strong>IMPORTANT</strong>: RegistrationPolicy instances are wrapped using a {@link
+ * org.gatein.registration.policies.RegistrationPolicyWrapper}. As a result, using <code>instanceof</code> on a
+ * RegistrationPolicy will probably result in unexpected result. To retrieve the actual class of the RegistrationPolicy
+ * instance in use, use {@link #getRealClass()} (or {@link #getClassName()} to retrieve the class name). If, for some
+ * reason, the actual RegistrationPolicy instance is needed, use {@link org.gatein.registration.policies.RegistrationPolicyWrapper#unwrap(RegistrationPolicy)},
+ * though it is not recommended to manipulate actual RegistrationPolicy instances directly.
*
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision: 11406 $
@@ -122,5 +129,34 @@
*/
void validateConsumerGroupName(String groupName, RegistrationManager manager) throws IllegalArgumentException, RegistrationException;
+ /**
+ * TODO
+ *
+ * @param portletContext
+ * @param registration
+ * @param operation
+ * @return
+ */
boolean allowAccessTo(PortletContext portletContext, Registration registration, String operation);
+
+ /**
+ * TODO
+ *
+ * @return
+ */
+ boolean isWrapped();
+
+ /**
+ * TODO
+ *
+ * @return
+ */
+ String getClassName();
+
+ /**
+ * TODO
+ *
+ * @return
+ */
+ Class<? extends RegistrationPolicy> getRealClass();
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPolicy.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -56,6 +56,11 @@
private RegistrationPropertyValidator validator;
private static final Logger log = LoggerFactory.getLogger(DefaultRegistrationPolicy.class);
+ public DefaultRegistrationPolicy()
+ {
+ validator = DefaultRegistrationPropertyValidator.DEFAULT;
+ }
+
@Override
public boolean equals(Object o)
{
@@ -163,28 +168,24 @@
/** Simply returns the given registration id. */
public String createRegistrationHandleFor(String registrationId)
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(registrationId, "Registration id", null);
return registrationId;
}
/** Doesn't support automatic ConsumerGroups so always return <code>null</code>. */
public String getAutomaticGroupNameFor(String consumerName)
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
return null;
}
/** Compute a simple, safe id based on the provided consumer name trusted (!) to be unique. */
public String getConsumerIdFrom(String consumerName, Map<QName, Object> registrationProperties) throws IllegalArgumentException, InvalidConsumerDataException
{
- return RegistrationPolicyWrapper.sanitizeConsumerName(consumerName);
+ return consumerName;
}
/** Rejects registration if a Consumer with the specified name already exists. */
public void validateConsumerName(String consumerName, final RegistrationManager manager) throws IllegalArgumentException, RegistrationException
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
-
Consumer consumer = manager.getConsumerByIdentity(getConsumerIdFrom(consumerName, Collections.<QName, Object>emptyMap()));
if (consumer != null)
{
@@ -203,6 +204,21 @@
return true;
}
+ public boolean isWrapped()
+ {
+ return false;
+ }
+
+ public String getClassName()
+ {
+ return getClass().getName();
+ }
+
+ public Class<? extends RegistrationPolicy> getRealClass()
+ {
+ return getClass();
+ }
+
/**
* Instructs this policy to use the specified RegistrationPropertyValidator. There shouldn't be any need to call this
* method manually, as the validator is configured via the WSRP Producer xml configuration file.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPropertyValidator.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPropertyValidator.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/DefaultRegistrationPropertyValidator.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -41,4 +41,6 @@
"'. DefaultRegistrationPropertyValidator only accepts non-null, non-empty Strings.");
}
}
+
+ public static final RegistrationPropertyValidator DEFAULT = new DefaultRegistrationPropertyValidator();
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/policies/RegistrationPolicyWrapper.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -43,13 +43,40 @@
{
private final RegistrationPolicy delegate;
- public RegistrationPolicyWrapper(RegistrationPolicy delegate)
+ public static RegistrationPolicy wrap(RegistrationPolicy policy)
{
- ParameterValidation.throwIllegalArgExceptionIfNull(delegate, "Delegate");
+ ParameterValidation.throwIllegalArgExceptionIfNull(policy, "RegistrationPolicy to wrap");
+
+ if (!policy.isWrapped())
+ {
+ return new RegistrationPolicyWrapper(policy);
+ }
+ else
+ {
+ return policy;
+ }
+ }
+
+ public static RegistrationPolicy unwrap(RegistrationPolicy policy)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(policy, "RegistrationPolicy to unwrap");
+
+ if (policy.isWrapped())
+ {
+ return ((RegistrationPolicyWrapper)policy).getDelegate();
+ }
+ else
+ {
+ return policy;
+ }
+ }
+
+ private RegistrationPolicyWrapper(RegistrationPolicy delegate)
+ {
this.delegate = delegate;
}
- public RegistrationPolicy getDelegate()
+ private RegistrationPolicy getDelegate()
{
return delegate;
}
@@ -63,13 +90,14 @@
public String createRegistrationHandleFor(String registrationId)
throws IllegalArgumentException
{
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(registrationId, "Registration id", null);
return delegate.createRegistrationHandleFor(registrationId);
}
public String getAutomaticGroupNameFor(String consumerName)
throws IllegalArgumentException
{
- return delegate.getAutomaticGroupNameFor(consumerName);
+ return delegate.getAutomaticGroupNameFor(sanitizeConsumerName(consumerName));
}
public String getConsumerIdFrom(String consumerName, Map<QName, Object> registrationProperties)
@@ -81,7 +109,7 @@
public void validateConsumerName(String consumerName, final RegistrationManager manager)
throws IllegalArgumentException, RegistrationException
{
- delegate.validateConsumerName(consumerName, manager);
+ delegate.validateConsumerName(sanitizeConsumerName(consumerName), manager);
}
public void validateConsumerGroupName(String groupName, RegistrationManager manager)
@@ -90,6 +118,26 @@
delegate.validateConsumerGroupName(groupName, manager);
}
+ public boolean allowAccessTo(PortletContext portletContext, Registration registration, String operation)
+ {
+ return delegate.allowAccessTo(portletContext, registration, operation);
+ }
+
+ public boolean isWrapped()
+ {
+ return true;
+ }
+
+ public String getClassName()
+ {
+ return delegate.getClassName();
+ }
+
+ public Class<? extends RegistrationPolicy> getRealClass()
+ {
+ return delegate.getClass();
+ }
+
static String sanitizeConsumerName(String consumerName)
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
@@ -100,9 +148,4 @@
return consumerName;
}
-
- public boolean allowAccessTo(PortletContext portletContext, Registration registration, String operation)
- {
- return delegate.allowAccessTo(portletContext, registration, operation);
- }
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirements.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirements.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirements.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -118,4 +118,6 @@
long getLastModified();
void setRegistrationProperties(Map<QName, RegistrationPropertyDescription> registrationProperties);
+
+ String getPolicyClassName();
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -326,18 +326,25 @@
{
if (ParameterValidation.isOldAndNewDifferent(this.policy, policy))
{
- this.policy = policy;
-
if (policy != null)
{
- policyClassName = policy.getClass().getName();
+ this.policy = RegistrationPolicyWrapper.wrap(policy);
+ policyClassName = policy.getClassName();
- if (policy instanceof DefaultRegistrationPolicy)
+ if (DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
{
- DefaultRegistrationPolicy registrationPolicy = (DefaultRegistrationPolicy)policy;
+ DefaultRegistrationPolicy registrationPolicy = (DefaultRegistrationPolicy)RegistrationPolicyWrapper.unwrap(policy);
validatorClassName = registrationPolicy.getValidator().getClass().getName();
}
+ else
+ {
+ validatorClassName = null;
+ }
}
+ else
+ {
+ this.policy = null;
+ }
modifyNow();
notifyRegistrationPolicyChangeListeners();
@@ -375,10 +382,7 @@
}
RegistrationPolicy policy = (RegistrationPolicy)policyClass.newInstance();
- // wrap policy so that we can perform minimal sanitization of values
- RegistrationPolicyWrapper wrapper = new RegistrationPolicyWrapper(policy);
-
- setPolicy(wrapper);
+ setPolicy(policy);
}
catch (ClassNotFoundException e)
{
@@ -422,9 +426,9 @@
}
- DefaultRegistrationPolicy policy = new DefaultRegistrationPolicy();
- policy.setValidator(validator);
- setPolicy(policy);
+ DefaultRegistrationPolicy delegate = new DefaultRegistrationPolicy();
+ delegate.setValidator(validator);
+ setPolicy(delegate);
}
}
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/ProducerConfigurationProvider.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/ProducerConfigurationProvider.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/config/impl/xml/ProducerConfigurationProvider.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -25,6 +25,7 @@
import org.gatein.registration.RegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
+import org.gatein.registration.policies.RegistrationPolicyWrapper;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
import org.gatein.wsrp.producer.config.impl.ProducerConfigurationImpl;
@@ -104,12 +105,12 @@
RegistrationPolicy policy = regReq.getPolicy();
if (policy != null)
{
- value = policy.getClass().getName();
+ value = policy.getClassName();
}
}
else if ("registration-property-validator".equals(localName))
{
- RegistrationPolicy policy = regReq.getPolicy();
+ RegistrationPolicy policy = RegistrationPolicyWrapper.unwrap(regReq.getPolicy());
if (policy instanceof DefaultRegistrationPolicy)
{
DefaultRegistrationPolicy defaultRegistrationPolicy = (DefaultRegistrationPolicy)policy;
Deleted: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -1,183 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, 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.registration;
-
-import junit.framework.TestCase;
-import org.gatein.registration.impl.RegistrationManagerImpl;
-import org.gatein.registration.impl.RegistrationPersistenceManagerImpl;
-import org.gatein.registration.policies.DefaultRegistrationPolicy;
-import org.gatein.registration.policies.DefaultRegistrationPropertyValidator;
-import org.gatein.wsrp.registration.PropertyDescription;
-
-import javax.xml.namespace.QName;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision: 9180 $
- * @since 2.6.3
- */
-public class DefaultRegistrationPolicyTestCase extends TestCase
-{
- DefaultRegistrationPolicy policy;
- Map<QName, Object> registrationProperties;
- Map<QName, PropertyDescription> expectations;
- private static final String CONSUMER = "consumer";
- private static final QName PROP1 = new QName("prop1");
- private static final QName PROP2 = new QName("prop2");
- private static final QName PROP3 = new QName("prop3");
- private RegistrationManager manager;
-
- @Override
- protected void setUp() throws Exception
- {
- policy = new DefaultRegistrationPolicy();
-
- policy.setValidator(new DefaultRegistrationPropertyValidator());
-
- manager = new RegistrationManagerImpl();
- manager.setPolicy(policy);
- manager.setPersistenceManager(new RegistrationPersistenceManagerImpl());
- manager.createConsumer(CONSUMER);
-
- registrationProperties = new HashMap<QName, Object>();
- registrationProperties.put(PROP1, "value1");
- registrationProperties.put(PROP2, "value2");
-
- expectations = new HashMap<QName, PropertyDescription>();
- }
-
- public void testValidateRegistrationDataForNull() throws RegistrationException
- {
- try
- {
- policy.validateRegistrationDataFor(null, "foo", expectations, manager);
- fail("null data cannot be validated");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
-
- try
- {
- policy.validateRegistrationDataFor(Collections.<QName, Object>emptyMap(), null, expectations, manager);
- fail("null data cannot be validated");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
- }
-
- public void testValidateRegistrationDataForInexistentConsumer()
- {
- try
- {
- policy.validateRegistrationDataFor(Collections.<QName, Object>emptyMap(), "foo", expectations, manager);
- }
- catch (RegistrationException e)
- {
- fail("Should be possible to validate information for inexistent consumer (otherwise, how would we register!)");
- }
- }
-
- public void testValidateRegistrationDataMissingProps()
- {
- expectations.put(PROP1, new TestPropertyDescription(PROP1));
- expectations.put(PROP2, new TestPropertyDescription(PROP2));
- expectations.put(PROP3, new TestPropertyDescription(PROP3));
-
- try
- {
- policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
- fail("Missing prop3 should have been detected");
- }
- catch (RegistrationException e)
- {
- assertTrue(e.getLocalizedMessage().contains("prop3"));
- }
- }
-
- public void testValidateRegistrationDataExtraProps()
- {
- expectations.put(PROP1, new TestPropertyDescription(PROP1));
-
- try
- {
- policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
- fail("Extra prop2 should have been detected");
- }
- catch (RegistrationException e)
- {
- assertTrue(e.getLocalizedMessage().contains("prop2"));
- }
- }
-
- public void testValidateRegistrationDataInvalidValue()
- {
- expectations.put(PROP1, new TestPropertyDescription(PROP1));
-
- registrationProperties.remove(PROP2);
- registrationProperties.put(PROP1, null);
-
- try
- {
- policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
- fail("Should have detected null value for prop1");
- }
- catch (RegistrationException e)
- {
- assertTrue(e.getLocalizedMessage().contains("prop1"));
- }
- }
-
- static class TestPropertyDescription implements PropertyDescription
- {
- private QName name;
- private static final QName TYPE = new QName("type");
-
- TestPropertyDescription(QName name)
- {
- this.name = name;
- }
-
- public QName getName()
- {
- return name;
- }
-
- public QName getType()
- {
- return TYPE;
- }
-
- public int compareTo(PropertyDescription o)
- {
- return name.toString().compareTo(o.getName().toString());
- }
- }
-}
Copied: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/policies/DefaultRegistrationPolicyTestCase.java (from rev 5829, components/wsrp/trunk/producer/src/test/java/org/gatein/registration/DefaultRegistrationPolicyTestCase.java)
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/registration/policies/DefaultRegistrationPolicyTestCase.java (rev 0)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/registration/policies/DefaultRegistrationPolicyTestCase.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -0,0 +1,189 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, 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.registration.policies;
+
+import junit.framework.TestCase;
+import org.gatein.registration.RegistrationException;
+import org.gatein.registration.RegistrationManager;
+import org.gatein.registration.impl.RegistrationManagerImpl;
+import org.gatein.registration.impl.RegistrationPersistenceManagerImpl;
+import org.gatein.wsrp.registration.PropertyDescription;
+
+import javax.xml.namespace.QName;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 9180 $
+ * @since 2.6.3
+ */
+public class DefaultRegistrationPolicyTestCase extends TestCase
+{
+ DefaultRegistrationPolicy policy;
+ Map<QName, Object> registrationProperties;
+ Map<QName, PropertyDescription> expectations;
+ private static final String CONSUMER = "consumer";
+ private static final QName PROP1 = new QName("prop1");
+ private static final QName PROP2 = new QName("prop2");
+ private static final QName PROP3 = new QName("prop3");
+ private RegistrationManager manager;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ policy = new DefaultRegistrationPolicy();
+
+ policy.setValidator(new DefaultRegistrationPropertyValidator());
+
+ manager = new RegistrationManagerImpl();
+ manager.setPolicy(policy);
+ manager.setPersistenceManager(new RegistrationPersistenceManagerImpl());
+ manager.createConsumer(CONSUMER);
+
+ registrationProperties = new HashMap<QName, Object>();
+ registrationProperties.put(PROP1, "value1");
+ registrationProperties.put(PROP2, "value2");
+
+ expectations = new HashMap<QName, PropertyDescription>();
+ }
+
+ public void testInitialState()
+ {
+ DefaultRegistrationPolicy registrationPolicy = new DefaultRegistrationPolicy();
+ assertEquals(DefaultRegistrationPropertyValidator.DEFAULT, registrationPolicy.getValidator());
+ }
+
+ public void testValidateRegistrationDataForNull() throws RegistrationException
+ {
+ try
+ {
+ policy.validateRegistrationDataFor(null, "foo", expectations, manager);
+ fail("null data cannot be validated");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+
+ try
+ {
+ policy.validateRegistrationDataFor(Collections.<QName, Object>emptyMap(), null, expectations, manager);
+ fail("null data cannot be validated");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testValidateRegistrationDataForInexistentConsumer()
+ {
+ try
+ {
+ policy.validateRegistrationDataFor(Collections.<QName, Object>emptyMap(), "foo", expectations, manager);
+ }
+ catch (RegistrationException e)
+ {
+ fail("Should be possible to validate information for inexistent consumer (otherwise, how would we register!)");
+ }
+ }
+
+ public void testValidateRegistrationDataMissingProps()
+ {
+ expectations.put(PROP1, new TestPropertyDescription(PROP1));
+ expectations.put(PROP2, new TestPropertyDescription(PROP2));
+ expectations.put(PROP3, new TestPropertyDescription(PROP3));
+
+ try
+ {
+ policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
+ fail("Missing prop3 should have been detected");
+ }
+ catch (RegistrationException e)
+ {
+ assertTrue(e.getLocalizedMessage().contains("prop3"));
+ }
+ }
+
+ public void testValidateRegistrationDataExtraProps()
+ {
+ expectations.put(PROP1, new TestPropertyDescription(PROP1));
+
+ try
+ {
+ policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
+ fail("Extra prop2 should have been detected");
+ }
+ catch (RegistrationException e)
+ {
+ assertTrue(e.getLocalizedMessage().contains("prop2"));
+ }
+ }
+
+ public void testValidateRegistrationDataInvalidValue()
+ {
+ expectations.put(PROP1, new TestPropertyDescription(PROP1));
+
+ registrationProperties.remove(PROP2);
+ registrationProperties.put(PROP1, null);
+
+ try
+ {
+ policy.validateRegistrationDataFor(registrationProperties, CONSUMER, expectations, manager);
+ fail("Should have detected null value for prop1");
+ }
+ catch (RegistrationException e)
+ {
+ assertTrue(e.getLocalizedMessage().contains("prop1"));
+ }
+ }
+
+ static class TestPropertyDescription implements PropertyDescription
+ {
+ private QName name;
+ private static final QName TYPE = new QName("type");
+
+ TestPropertyDescription(QName name)
+ {
+ this.name = name;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public QName getType()
+ {
+ return TYPE;
+ }
+
+ public int compareTo(PropertyDescription o)
+ {
+ return name.toString().compareTo(o.getName().toString());
+ }
+ }
+}
Property changes on: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/policies/DefaultRegistrationPolicyTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/policies/RegistrationPolicyWrapperTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/registration/policies/RegistrationPolicyWrapperTestCase.java (rev 0)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/registration/policies/RegistrationPolicyWrapperTestCase.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, 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.registration.policies;
+
+import junit.framework.TestCase;
+import org.gatein.registration.RegistrationPolicy;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class RegistrationPolicyWrapperTestCase extends TestCase
+{
+ public void testWrap()
+ {
+ RegistrationPolicy policy = new DefaultRegistrationPolicy();
+
+ RegistrationPolicy wrapper = RegistrationPolicyWrapper.wrap(policy);
+ assertEquals(policy.getClass(), wrapper.getRealClass());
+ assertEquals(policy.getClassName(), wrapper.getClassName());
+ assertEquals(policy.getClass().getName(), wrapper.getClassName());
+
+ assertEquals(wrapper, RegistrationPolicyWrapper.wrap(wrapper));
+ assertTrue(wrapper instanceof RegistrationPolicyWrapper);
+
+ assertEquals(policy, RegistrationPolicyWrapper.unwrap(wrapper));
+ assertEquals(policy, RegistrationPolicyWrapper.unwrap(policy));
+ }
+}
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerConfigurationTestCase.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, 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.
@@ -96,11 +96,13 @@
RegistrationPolicy policy = requirements.getPolicy();
// check that the policy is properly wrapped
- assertTrue(policy instanceof RegistrationPolicyWrapper);
+ assertTrue(policy.isWrapped());
+ // policy is wrapped so instanceof won't work!
+ assertFalse(policy instanceof TestRegistrationPolicy);
+
// and that the delegate is indeed the expected policy
- RegistrationPolicyWrapper wrapper = (RegistrationPolicyWrapper)policy;
- assertTrue(wrapper.getDelegate() instanceof TestRegistrationPolicy);
+ assertEquals(TestRegistrationPolicy.class, RegistrationPolicyWrapper.unwrap(policy).getClass());
}
public void testExtendedUnmarshalling() throws Exception
@@ -110,7 +112,7 @@
ProducerRegistrationRequirements requirements = producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
- RegistrationPolicy policy = requirements.getPolicy();
+ RegistrationPolicy policy = RegistrationPolicyWrapper.unwrap(requirements.getPolicy());
assertTrue(policy instanceof DefaultRegistrationPolicy);
RegistrationPropertyValidator propertyValidator = ((DefaultRegistrationPolicy)policy).getValidator();
assertNotNull(propertyValidator);
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/ProducerRegistrationRequirementsTestCase.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -28,7 +28,6 @@
import org.gatein.registration.RegistrationPolicyChangeListener;
import org.gatein.registration.RegistrationPropertyChangeListener;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
-import org.gatein.registration.policies.RegistrationPolicyWrapper;
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
import org.gatein.wsrp.registration.PropertyDescription;
@@ -72,16 +71,22 @@
public void testChangeRegistrationPolicy()
{
- ProducerRegistrationRequirements requirements = new ProducerRegistrationRequirementsImpl();
+ ProducerRegistrationRequirementsImpl requirements = new ProducerRegistrationRequirementsImpl();
requirements.setRegistrationRequired(true); // so that we load the policy
- assertTrue(requirements.getPolicy() instanceof DefaultRegistrationPolicy);
+ RegistrationPolicy policy = requirements.getPolicy();
+ assertTrue(policy.isWrapped());
+ assertFalse(policy instanceof DefaultRegistrationPolicy); // cannot use instanceof since policy is wrapped
+ assertEquals(ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME, policy.getClassName());
+
requirements.reloadPolicyFrom("org.gatein.wsrp.producer.config.TestRegistrationPolicy", ProducerRegistrationRequirements.DEFAULT_VALIDATOR_CLASS_NAME);
- RegistrationPolicy policy = requirements.getPolicy();
- assertTrue(policy instanceof RegistrationPolicyWrapper);
- RegistrationPolicyWrapper wrapper = (RegistrationPolicyWrapper)policy;
- assertTrue(wrapper.getDelegate() instanceof TestRegistrationPolicy);
+ policy = requirements.getPolicy();
+ assertTrue(policy.isWrapped());
+ assertFalse(policy instanceof TestRegistrationPolicy); // cannot use instanceof since policy is wrapped
+ assertEquals("org.gatein.wsrp.producer.config.TestRegistrationPolicy", requirements.getPolicyClassName());
+ assertEquals("org.gatein.wsrp.producer.config.TestRegistrationPolicy", policy.getClassName());
+ assertNull(requirements.getValidatorClassName());
}
public void testSetUnchangedRegistrationProperties()
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java 2011-02-02 20:31:12 UTC (rev 5848)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/config/TestRegistrationPolicy.java 2011-02-02 21:59:34 UTC (rev 5849)
@@ -72,4 +72,19 @@
{
return true;
}
+
+ public boolean isWrapped()
+ {
+ return false;
+ }
+
+ public String getClassName()
+ {
+ return getClass().getName();
+ }
+
+ public Class<? extends RegistrationPolicy> getRealClass()
+ {
+ return getClass();
+ }
}
13 years, 11 months
gatein SVN: r5848 - portal/trunk.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-02-02 15:31:12 -0500 (Wed, 02 Feb 2011)
New Revision: 5848
Modified:
portal/trunk/pom.xml
Log:
GTNPORTAL-1777 : Update mop / chromattic / jcr dependencies
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2011-02-01 20:53:55 UTC (rev 5847)
+++ portal/trunk/pom.xml 2011-02-02 20:31:12 UTC (rev 5848)
@@ -37,10 +37,10 @@
<name>GateIn - Portal</name>
<properties>
- <org.exoplatform.kernel.version>2.2.5-GA</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.3.5-GA</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.1.5-GA</org.exoplatform.ws.version>
- <org.exoplatform.jcr.version>1.12.5-GA</org.exoplatform.jcr.version>
+ <org.exoplatform.kernel.version>2.2.7-GA</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.3.7-GA</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.1.7-GA</org.exoplatform.ws.version>
+ <org.exoplatform.jcr.version>1.12.7-GA</org.exoplatform.jcr.version>
<org.jibx.version>1.2.1</org.jibx.version>
<org.shindig.version>1.0-r790473-Patch04</org.shindig.version>
<nl.captcha.simplecaptcha.version>1.1.1-GA-Patch01</nl.captcha.simplecaptcha.version>
@@ -49,12 +49,12 @@
<org.gatein.pc.version>2.3.0-Alpha01</org.gatein.pc.version>
<org.picketlink.idm>1.1.8.CR01</org.picketlink.idm>
<org.gatein.wsrp.version>2.0.0-GA</org.gatein.wsrp.version>
- <org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
+ <org.gatein.mop.version>1.0.5-GA</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
<org.codehaus.groovy.version>1.6.5</org.codehaus.groovy.version>
<javax.servlet.version>2.5</javax.servlet.version>
- <version.chromattic>1.0.4</version.chromattic>
+ <version.chromattic>1.0.6</version.chromattic>
<version.reflext>1.0.0</version.reflext>
<jcip.version>1.0</jcip.version>
@@ -93,421 +93,141 @@
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.commons</artifactId>
<version>${org.exoplatform.kernel.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.component.cache</artifactId>
<version>${org.exoplatform.kernel.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.component.command</artifactId>
<version>${org.exoplatform.kernel.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.component.common</artifactId>
<version>${org.exoplatform.kernel.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.component.remote</artifactId>
<version>${org.exoplatform.kernel.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.container</artifactId>
<version>${org.exoplatform.kernel.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
<version>${org.exoplatform.kernel.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.mc-int</artifactId>
<version>${org.exoplatform.kernel.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.mc-kernel-extras</artifactId>
<version>${org.exoplatform.kernel.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.api</artifactId>
<version>${org.exoplatform.core.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.xml-processing</artifactId>
<version>${org.exoplatform.core.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.database</artifactId>
<version>${org.exoplatform.core.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.ldap</artifactId>
<version>${org.exoplatform.core.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.jdbc</artifactId>
<version>${org.exoplatform.core.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.ldap</artifactId>
<version>${org.exoplatform.core.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.security.core</artifactId>
<version>${org.exoplatform.core.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.document</artifactId>
<version>${org.exoplatform.core.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.component.core</artifactId>
<version>${org.exoplatform.jcr.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.framework.command</artifactId>
<version>${org.exoplatform.jcr.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.component.ext</artifactId>
<version>${org.exoplatform.jcr.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.component.webdav</artifactId>
<version>${org.exoplatform.jcr.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.framework.web</artifactId>
<version>${org.exoplatform.jcr.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.component.ftp</artifactId>
<version>${org.exoplatform.jcr.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.ws</groupId>
<artifactId>exo.ws.commons</artifactId>
<version>${org.exoplatform.ws.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.ws</groupId>
<artifactId>exo.ws.frameworks.servlet</artifactId>
<version>${org.exoplatform.ws.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.ws</groupId>
<artifactId>exo.ws.rest.ext</artifactId>
<version>${org.exoplatform.ws.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.ws</groupId>
<artifactId>exo.ws.rest.core</artifactId>
<version>${org.exoplatform.ws.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.ws</groupId>
<artifactId>exo.ws.frameworks.json</artifactId>
<version>${org.exoplatform.ws.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<!-- GateIn components -->
13 years, 11 months
gatein SVN: r5847 - in components/mop/trunk: api and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-02-01 15:53:55 -0500 (Tue, 01 Feb 2011)
New Revision: 5847
Modified:
components/mop/trunk/api/pom.xml
components/mop/trunk/core/pom.xml
components/mop/trunk/pom.xml
components/mop/trunk/spi/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: components/mop/trunk/api/pom.xml
===================================================================
--- components/mop/trunk/api/pom.xml 2011-02-01 20:53:42 UTC (rev 5846)
+++ components/mop/trunk/api/pom.xml 2011-02-01 20:53:55 UTC (rev 5847)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.5-GA</version>
+ <version>1.0.6-GA-SNAPSHOT</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/core/pom.xml
===================================================================
--- components/mop/trunk/core/pom.xml 2011-02-01 20:53:42 UTC (rev 5846)
+++ components/mop/trunk/core/pom.xml 2011-02-01 20:53:55 UTC (rev 5847)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.5-GA</version>
+ <version>1.0.6-GA-SNAPSHOT</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2011-02-01 20:53:42 UTC (rev 5846)
+++ components/mop/trunk/pom.xml 2011-02-01 20:53:55 UTC (rev 5847)
@@ -34,16 +34,16 @@
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.5-GA</version>
+ <version>1.0.6-GA-SNAPSHOT</version>
<packaging>pom</packaging>
<name>GateIn - MOP</name>
<description>Model Object for Portal</description>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/mop/tags/1.0.5-GA</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/tags/1.0.5-GA</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/mop/tags/1.0.5-GA</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/mop/trunk/</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/trunk/</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/mop/trunk/</url>
</scm>
<dependencyManagement>
Modified: components/mop/trunk/spi/pom.xml
===================================================================
--- components/mop/trunk/spi/pom.xml 2011-02-01 20:53:42 UTC (rev 5846)
+++ components/mop/trunk/spi/pom.xml 2011-02-01 20:53:55 UTC (rev 5847)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.5-GA</version>
+ <version>1.0.6-GA-SNAPSHOT</version>
</parent>
<!-- ****************** -->
13 years, 11 months
gatein SVN: r5846 - components/mop/tags.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-02-01 15:53:42 -0500 (Tue, 01 Feb 2011)
New Revision: 5846
Added:
components/mop/tags/1.0.5-GA/
Log:
[maven-scm] copy for tag 1.0.5-GA
Copied: components/mop/tags/1.0.5-GA (from rev 5845, components/mop/trunk)
13 years, 11 months
gatein SVN: r5845 - in components/mop/trunk: api and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-02-01 15:53:20 -0500 (Tue, 01 Feb 2011)
New Revision: 5845
Modified:
components/mop/trunk/api/pom.xml
components/mop/trunk/core/pom.xml
components/mop/trunk/pom.xml
components/mop/trunk/spi/pom.xml
Log:
[maven-release-plugin] prepare release 1.0.5-GA
Modified: components/mop/trunk/api/pom.xml
===================================================================
--- components/mop/trunk/api/pom.xml 2011-02-01 20:51:24 UTC (rev 5844)
+++ components/mop/trunk/api/pom.xml 2011-02-01 20:53:20 UTC (rev 5845)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.5-GA-SNAPSHOT</version>
+ <version>1.0.5-GA</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/core/pom.xml
===================================================================
--- components/mop/trunk/core/pom.xml 2011-02-01 20:51:24 UTC (rev 5844)
+++ components/mop/trunk/core/pom.xml 2011-02-01 20:53:20 UTC (rev 5845)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.5-GA-SNAPSHOT</version>
+ <version>1.0.5-GA</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2011-02-01 20:51:24 UTC (rev 5844)
+++ components/mop/trunk/pom.xml 2011-02-01 20:53:20 UTC (rev 5845)
@@ -34,16 +34,16 @@
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.5-GA-SNAPSHOT</version>
+ <version>1.0.5-GA</version>
<packaging>pom</packaging>
<name>GateIn - MOP</name>
<description>Model Object for Portal</description>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/mop/trunk/</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/trunk/</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/mop/trunk/</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/mop/tags/1.0.5-GA</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/tags/1.0.5-GA</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/mop/tags/1.0.5-GA</url>
</scm>
<dependencyManagement>
Modified: components/mop/trunk/spi/pom.xml
===================================================================
--- components/mop/trunk/spi/pom.xml 2011-02-01 20:51:24 UTC (rev 5844)
+++ components/mop/trunk/spi/pom.xml 2011-02-01 20:53:20 UTC (rev 5845)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.0.5-GA-SNAPSHOT</version>
+ <version>1.0.5-GA</version>
</parent>
<!-- ****************** -->
13 years, 11 months
gatein SVN: r5844 - components/mop/trunk.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-02-01 15:51:24 -0500 (Tue, 01 Feb 2011)
New Revision: 5844
Modified:
components/mop/trunk/pom.xml
Log:
GTNMOP-31 : Update to Chromattic 1.0.6
GTNMOP-32 : Update pom parent to 1.0.2-GA
GTNMOP-33 : Add profile for testing Chromattic trunk
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2011-02-01 19:00:58 UTC (rev 5843)
+++ components/mop/trunk/pom.xml 2011-02-01 20:51:24 UTC (rev 5844)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein</groupId>
<artifactId>gatein-parent</artifactId>
- <version>1.0.1-GA</version>
+ <version>1.0.2-GA</version>
</parent>
<!-- ****************** -->
@@ -124,11 +124,7 @@
<!-- Build settings -->
<!-- ************** -->
- <!-- maven-enforcer-plugin -->
- <jdk.min.version>1.6</jdk.min.version>
-
- <org.chromattic.version>1.0.5</org.chromattic.version>
- <!--<org.chromattic.version>1.1.0-SNAPSHOT</org.chromattic.version>-->
+ <org.chromattic.version>1.0.6</org.chromattic.version>
</properties>
@@ -159,4 +155,14 @@
<module>core</module>
</modules>
+ <!-- for testing purpose only -->
+ <profiles>
+ <profile>
+ <id>chromattictrunk</id>
+ <properties>
+ <org.chromattic.version>1.1.0-SNAPSHOT</org.chromattic.version>
+ </properties>
+ </profile>
+ </profiles>
+
</project>
13 years, 11 months