gatein SVN: r6649 - in components/mop/trunk: api and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-14 10:08:03 -0400 (Tue, 14 Jun 2011)
New Revision: 6649
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-06-14 14:07:53 UTC (rev 6648)
+++ components/mop/trunk/api/pom.xml 2011-06-14 14:08:03 UTC (rev 6649)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta04</version>
+ <version>1.1.0-Beta05-SNAPSHOT</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/core/pom.xml
===================================================================
--- components/mop/trunk/core/pom.xml 2011-06-14 14:07:53 UTC (rev 6648)
+++ components/mop/trunk/core/pom.xml 2011-06-14 14:08:03 UTC (rev 6649)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta04</version>
+ <version>1.1.0-Beta05-SNAPSHOT</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2011-06-14 14:07:53 UTC (rev 6648)
+++ components/mop/trunk/pom.xml 2011-06-14 14:08:03 UTC (rev 6649)
@@ -34,16 +34,16 @@
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta04</version>
+ <version>1.1.0-Beta05-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.1.0-B...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/tags/1.1.0-Beta04</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/mop/tags/1.1.0-Beta04</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-06-14 14:07:53 UTC (rev 6648)
+++ components/mop/trunk/spi/pom.xml 2011-06-14 14:08:03 UTC (rev 6649)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta04</version>
+ <version>1.1.0-Beta05-SNAPSHOT</version>
</parent>
<!-- ****************** -->
13 years, 6 months
gatein SVN: r6648 - components/mop/tags.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-14 10:07:53 -0400 (Tue, 14 Jun 2011)
New Revision: 6648
Added:
components/mop/tags/1.1.0-Beta04/
Log:
[maven-scm] copy for tag 1.1.0-Beta04
13 years, 6 months
gatein SVN: r6647 - in components/mop/trunk: api and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-14 10:07:31 -0400 (Tue, 14 Jun 2011)
New Revision: 6647
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.1.0-Beta04
Modified: components/mop/trunk/api/pom.xml
===================================================================
--- components/mop/trunk/api/pom.xml 2011-06-14 14:05:40 UTC (rev 6646)
+++ components/mop/trunk/api/pom.xml 2011-06-14 14:07:31 UTC (rev 6647)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta04-SNAPSHOT</version>
+ <version>1.1.0-Beta04</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/core/pom.xml
===================================================================
--- components/mop/trunk/core/pom.xml 2011-06-14 14:05:40 UTC (rev 6646)
+++ components/mop/trunk/core/pom.xml 2011-06-14 14:07:31 UTC (rev 6647)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta04-SNAPSHOT</version>
+ <version>1.1.0-Beta04</version>
</parent>
<!-- ****************** -->
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2011-06-14 14:05:40 UTC (rev 6646)
+++ components/mop/trunk/pom.xml 2011-06-14 14:07:31 UTC (rev 6647)
@@ -34,16 +34,16 @@
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta04-SNAPSHOT</version>
+ <version>1.1.0-Beta04</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.1.0-B...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/mop/tags/1.1.0-Beta04</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/mop/tags/1.1.0-Beta04</url>
</scm>
<dependencyManagement>
Modified: components/mop/trunk/spi/pom.xml
===================================================================
--- components/mop/trunk/spi/pom.xml 2011-06-14 14:05:40 UTC (rev 6646)
+++ components/mop/trunk/spi/pom.xml 2011-06-14 14:07:31 UTC (rev 6647)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-parent</artifactId>
- <version>1.1.0-Beta04-SNAPSHOT</version>
+ <version>1.1.0-Beta04</version>
</parent>
<!-- ****************** -->
13 years, 6 months
gatein SVN: r6646 - in components/mop/trunk: core/src/main/java/org/gatein/mop/core/api and 8 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-06-14 10:05:40 -0400 (Tue, 14 Jun 2011)
New Revision: 6646
Added:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/AdapterFactoryRegistration.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Bar.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Foo.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Juu.java
components/mop/trunk/core/src/test/resources/META-INF/
components/mop/trunk/core/src/test/resources/META-INF/services/
components/mop/trunk/core/src/test/resources/META-INF/services/org.gatein.mop.spi.AdapterFactory
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/AdapterFactory.java
Removed:
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/SecuredImpl.java
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/Adaptable.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/Tools.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AdapterTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Secured.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
Log:
GTNMOP-40 : Adapter pattern support for non mixin types
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/Adaptable.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/Adaptable.java 2011-06-14 08:48:03 UTC (rev 6645)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/Adaptable.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -20,7 +20,7 @@
package org.gatein.mop.api;
/**
- * The adapter pattern for the MOP.
+ * The adapter pattern.
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -29,19 +29,20 @@
{
/**
- * Returns an adapter for the specified type.
+ * Returns an adaptee for the specified type.
*
- * @param adaptedType the adapted type class
- * @param <A> the adapted type
- * @return the adapter or null
+ * @param adapterType the adapter type class
+ * @param <A> the adapter type
+ * @return the adaptee or null
*/
- <A> A adapt(Class<A> adaptedType);
+ <A> A adapt(Class<A> adapterType);
/**
* Returns true if the workspace object is adapted to the specified type.
*
- * @param adaptedType the adapted type
+ * @param adapterType the adapter type
* @return the adaptability of the current object
*/
- boolean isAdapted(Class<?> adaptedType);
+ boolean isAdapted(Class<?> adapterType);
+
}
Added: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/AdapterFactoryRegistration.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/AdapterFactoryRegistration.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/AdapterFactoryRegistration.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -0,0 +1,72 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.mop.core.api;
+
+import org.gatein.mop.core.util.Tools;
+import org.gatein.mop.spi.AdapterFactory;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ServiceLoader;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class AdapterFactoryRegistration<T, A>
+{
+
+ /** . */
+ private static final Map<Class<?>, AdapterFactoryRegistration<?, ?>> instances;
+
+ static
+ {
+ ServiceLoader<AdapterFactory> loader = ServiceLoader.load(AdapterFactory.class);
+ Map<Class<?>, AdapterFactoryRegistration<?, ?>> map = new HashMap<Class<?>, AdapterFactoryRegistration<?, ?>>();
+ for (AdapterFactory factory : loader)
+ {
+ AdapterFactoryRegistration registration = new AdapterFactoryRegistration(factory);
+ map.put(registration.adapterType, registration);
+ }
+
+ //
+ instances = map;
+ }
+
+ static <A> AdapterFactoryRegistration<Object, A> getInstance(Class<A> type)
+ {
+ return (AdapterFactoryRegistration<Object, A>)instances.get(type);
+ }
+
+ /** . */
+ final AdapterFactory<T, A> factory;
+
+ /** . */
+ final Class<T> adapteeType;
+
+ /** . */
+ final Class<A> adapterType;
+
+ AdapterFactoryRegistration(AdapterFactory<T, A> factory)
+ {
+ this.factory = factory;
+ this.adapteeType = (Class<T>)Tools.resolve(factory.getClass(), AdapterFactory.class, 0);
+ this.adapterType = (Class<A>)Tools.resolve(factory.getClass(), AdapterFactory.class, 1);
+ }
+}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java 2011-06-14 08:48:03 UTC (rev 6645)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPService.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -78,10 +78,6 @@
//
}
- protected <A> Class<? extends A> getConcreteAdapterType(Class<A> adapterType) {
- return null;
- }
-
protected abstract Chromattic getChromattic();
public void start() throws Exception
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java 2011-06-14 08:48:03 UTC (rev 6645)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/ModelImpl.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -123,22 +123,31 @@
return getWorkspaceImpl();
}
- public <A> A getAdapter(Object o, Class<A> adaptedType, boolean adapt)
+ public <A> A getAdapter(Object o, Class<A> adapterType)
{
- Class<? extends A> adapterType = mop.getConcreteAdapterType(adaptedType);
- if (adapterType == null) {
- adapterType = adaptedType;
+ AdapterFactoryRegistration<Object, A> registration = AdapterFactoryRegistration.getInstance(adapterType);
+
+ //
+ if (registration != null)
+ {
+ if (registration.adapteeType.isInstance(o))
+ {
+ return registration.factory.getAdapter(o, adapterType);
+ }
+ else
+ {
+ return null;
+ }
}
- return _getAdapter(o, adapterType, adapt);
+ else
+ {
+ return null;
+ }
}
- private <A> A _getAdapter(Object o, Class<A> type, boolean adapt) {
- A a = session.getEmbedded(o, type);
- if (a == null && adapt) {
- a = session.create(type);
- session.setEmbedded(o, type, a);
- }
- return a;
+ public <A> boolean isAdaptable(Class<A> adapterType)
+ {
+ return AdapterFactoryRegistration.getInstance(adapterType) != null;
}
private WorkspaceImpl getWorkspaceImpl()
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java 2011-06-14 08:48:03 UTC (rev 6645)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -18,6 +18,7 @@
*/
package org.gatein.mop.core.api.workspace;
+import org.chromattic.api.ChromatticSession;
import org.chromattic.api.annotations.*;
import org.chromattic.ext.format.BaseEncodingObjectFormatter;
import org.gatein.mop.api.workspace.WorkspaceObject;
@@ -26,6 +27,9 @@
import org.gatein.mop.core.api.AttributesImpl;
import org.gatein.mop.core.api.ModelImpl;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -39,6 +43,9 @@
/** . */
public ModelImpl model;
+ /** . */
+ private Map adapters;
+
@Name
public abstract String getNodeName();
@@ -52,16 +59,74 @@
@Owner
public abstract AttributesImpl getAttributes();
- public <A> A adapt(Class<A> adaptedType)
+ public final <A> A adapt(Class<A> adapterType)
{
- return model.getAdapter(this, adaptedType, true);
+ // Lookup in map first
+ if (adapters != null)
+ {
+ Object adapter = adapters.get(adapterType);
+ if (adapter != null)
+ {
+ return (A)adapter;
+ }
+ }
+
+ //
+ A adapter;
+ if (model.isAdaptable(adapterType))
+ {
+ adapter = model.getAdapter(this, adapterType);
+ if (adapter != null)
+ {
+ if (adapters == null)
+ {
+ adapters = new HashMap();
+ }
+ adapters.put(adapterType, adapter);
+ }
+ }
+ else
+ {
+ adapter = getMixin(adapterType, true);
+ }
+
+ //
+ return adapter;
}
- public boolean isAdapted(Class<?> adaptedType)
+ public final boolean isAdapted(Class<?> adapterType)
{
- return model.getAdapter(this, adaptedType, false) != null;
+ if (adapters != null)
+ {
+ if (adapters.containsKey(adapterType))
+ {
+ return true;
+ }
+ }
+
+ //
+ if (model.isAdaptable(adapterType))
+ {
+ return false;
+ }
+ else
+ {
+ return getMixin(adapterType, false) != null;
+ }
}
+ private <A> A getMixin(Class<A> type, boolean adapt)
+ {
+ ChromatticSession session = model.getSession();
+ A a = session.getEmbedded(this, type);
+ if (a == null && adapt)
+ {
+ a = session.create(type);
+ session.setEmbedded(this, type, a);
+ }
+ return a;
+ }
+
public String getName()
{
return getNodeName();
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/Tools.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/Tools.java 2011-06-14 08:48:03 UTC (rev 6645)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/Tools.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -18,6 +18,9 @@
*/
package org.gatein.mop.core.util;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
@@ -140,4 +143,67 @@
}
};
}
+
+ /**
+ * A simplistic implementation, it may not handle all cases but it should handle enough.
+ *
+ * @param implementation the type for which the parameter requires a resolution
+ * @param type the type that owns the parameter
+ * @param parameterIndex the parameter index
+ * @return the resolved type
+ */
+ public static Type resolve(Type implementation, Class<?> type, int parameterIndex) {
+ if (implementation == null) {
+ throw new NullPointerException();
+ }
+
+ //
+ if (implementation == type) {
+ TypeVariable<? extends Class<?>>[] tp = type.getTypeParameters();
+ if (parameterIndex < tp.length) {
+ return tp[parameterIndex];
+ } else {
+ throw new IllegalArgumentException();
+ }
+ } else if (implementation instanceof Class<?>) {
+ Class<?> c = (Class<?>) implementation;
+ Type gsc = c.getGenericSuperclass();
+ Type resolved = null;
+ if (gsc != null) {
+ resolved = resolve(gsc, type, parameterIndex);
+ if (resolved == null) {
+ // Try with interface
+ }
+ }
+ return resolved;
+ } else if (implementation instanceof ParameterizedType) {
+ ParameterizedType pt = (ParameterizedType) implementation;
+ Type[] typeArgs = pt.getActualTypeArguments();
+ Type rawType = pt.getRawType();
+ if (rawType == type) {
+ return typeArgs[parameterIndex];
+ } else if (rawType instanceof Class<?>) {
+ Class<?> classRawType = (Class<?>)rawType;
+ Type resolved = resolve(classRawType, type, parameterIndex);
+ if (resolved == null) {
+ return null;
+ } else if (resolved instanceof TypeVariable) {
+ TypeVariable resolvedTV = (TypeVariable)resolved;
+ TypeVariable[] a = classRawType.getTypeParameters();
+ for (int i = 0;i < a.length;i++) {
+ if (a[i].equals(resolvedTV)) {
+ return resolve(implementation, classRawType, i);
+ }
+ }
+ throw new AssertionError();
+ } else {
+ throw new UnsupportedOperationException("Cannot support resolution of " + resolved);
+ }
+ } else {
+ throw new UnsupportedOperationException();
+ }
+ } else {
+ throw new UnsupportedOperationException("todo " + implementation + " " + implementation.getClass());
+ }
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AdapterTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AdapterTestCase.java 2011-06-14 08:48:03 UTC (rev 6645)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AdapterTestCase.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -37,11 +37,10 @@
public void testSecured() throws Exception
{
- pomService.addAdapter(Secured.class, SecuredImpl.class);
ModelImpl model = pomService.getModel();
Workspace workspace = model.getWorkspace();
- Site site = workspace.addSite(ObjectType.PORTAL_SITE, "adaptablefoo");
- assertFalse(site.isAdapted(SecuredImpl.class));
+ Site site = workspace.addSite(ObjectType.PORTAL_SITE, "adaptable_secured");
+ assertFalse(site.isAdapted(Secured.class));
Secured secured = site.adapt(Secured.class);
assertNotNull(secured);
assertTrue(site.isAdapted(Secured.class));
@@ -51,4 +50,48 @@
permissions.add("FOO");
model.save();
}
+
+ public void testWorkspaceObjectType() throws Exception
+ {
+ ModelImpl model = pomService.getModel();
+ Workspace workspace = model.getWorkspace();
+ Site site = workspace.addSite(ObjectType.PORTAL_SITE, "adaptable_foo");
+ assertFalse(site.isAdapted(Foo.class));
+ Foo foo = site.adapt(Foo.class);
+ assertNotNull(foo);
+ assertSame(foo, site.adapt(Foo.class));
+ assertSame(site, foo.adaptee);
+ assertSame(Foo.class, foo.adapterType);
+ assertTrue(site.isAdapted(Foo.class));
+ }
+
+ public void testWorkspaceObjectImplType() throws Exception
+ {
+ ModelImpl model = pomService.getModel();
+ Workspace workspace = model.getWorkspace();
+ Site site = workspace.addSite(ObjectType.PORTAL_SITE, "adaptable_bar");
+ assertFalse(site.isAdapted(Bar.class));
+ Bar bar = site.adapt(Bar.class);
+ assertNotNull(bar);
+ assertSame(bar, site.adapt(Bar.class));
+ assertSame(site, bar.adaptee);
+ assertSame(Bar.class, bar.adapterType);
+ assertTrue(site.isAdapted(Bar.class));
+ }
+
+ public void testSiteType() throws Exception
+ {
+ ModelImpl model = pomService.getModel();
+ Workspace workspace = model.getWorkspace();
+ assertNull(workspace.adapt(Juu.class));
+
+ Site site = workspace.addSite(ObjectType.PORTAL_SITE, "adaptable_juu");
+ assertFalse(site.isAdapted(Juu.class));
+ Juu juu = site.adapt(Juu.class);
+ assertNotNull(juu);
+ assertSame(juu, site.adapt(Juu.class));
+ assertSame(site, juu.adaptee);
+ assertSame(Juu.class, juu.adapterType);
+ assertTrue(site.isAdapted(Juu.class));
+ }
}
Added: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Bar.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Bar.java (rev 0)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Bar.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.mop.core.api.workspace;
+
+import org.gatein.mop.spi.AdapterFactory;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class Bar
+{
+
+ /** . */
+ final WorkspaceObjectImpl adaptee;
+
+ /** . */
+ final Class<Bar> adapterType;
+
+ public Bar(WorkspaceObjectImpl adaptee, Class<Bar> adapterType)
+ {
+ this.adaptee = adaptee;
+ this.adapterType = adapterType;
+ }
+
+ public static class Factory extends AdapterFactory<WorkspaceObjectImpl, Bar>
+ {
+ public Bar getAdapter(WorkspaceObjectImpl adaptee, Class<Bar> adapterType)
+ {
+ return new Bar(adaptee, adapterType);
+ }
+ }
+}
Added: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Foo.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Foo.java (rev 0)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Foo.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.mop.core.api.workspace;
+
+import org.gatein.mop.api.workspace.WorkspaceObject;
+import org.gatein.mop.spi.AdapterFactory;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class Foo
+{
+
+ /** . */
+ final WorkspaceObject adaptee;
+
+ /** . */
+ final Class<Foo> adapterType;
+
+ public Foo(WorkspaceObject adaptee, Class<Foo> adapterType)
+ {
+ this.adaptee = adaptee;
+ this.adapterType = adapterType;
+ }
+
+ public static class Factory extends AdapterFactory<WorkspaceObject, Foo>
+ {
+ @Override
+ public Foo getAdapter(WorkspaceObject adaptee, Class<Foo> adapterType)
+ {
+ return new Foo(adaptee, adapterType);
+ }
+ }
+}
Added: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Juu.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Juu.java (rev 0)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Juu.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.mop.core.api.workspace;
+
+import org.gatein.mop.api.workspace.Site;
+import org.gatein.mop.spi.AdapterFactory;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class Juu
+{
+
+ /** . */
+ final Site adaptee;
+
+ /** . */
+ final Class<Juu> adapterType;
+
+ public Juu(Site adaptee, Class<Juu> adapterType)
+ {
+ this.adaptee = adaptee;
+ this.adapterType = adapterType;
+ }
+
+ public static class Factory extends AdapterFactory<Site, Juu>
+ {
+ @Override
+ public Juu getAdapter(Site adaptee, Class<Juu> adapterType)
+ {
+ return new Juu(adaptee, adapterType);
+ }
+ }
+}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Secured.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Secured.java 2011-06-14 08:48:03 UTC (rev 6645)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/Secured.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -19,16 +19,21 @@
package org.gatein.mop.core.api.workspace;
+import org.chromattic.api.annotations.MixinType;
+import org.chromattic.api.annotations.Property;
+
import java.util.List;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface Secured
+@MixinType(name = "mop:secured")
+public abstract class Secured
{
- List<String> getPermissions();
+ @Property(name = "mop:permissions")
+ public abstract List<String> getPermissions();
- void setPermissions(List<String> permissions);
+ public abstract void setPermissions(List<String> permissions);
}
Deleted: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/SecuredImpl.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/SecuredImpl.java 2011-06-14 08:48:03 UTC (rev 6645)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/SecuredImpl.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2010 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.gatein.mop.core.api.workspace;
-
-import org.chromattic.api.annotations.MixinType;
-import org.chromattic.api.annotations.Property;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@MixinType(name = "mop:secured")
-public abstract class SecuredImpl implements Secured
-{
-
- @Property(name = "mop:permissions")
- public abstract List<String> getPermissions();
-
-}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2011-06-14 08:48:03 UTC (rev 6645)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -38,8 +38,8 @@
import org.gatein.mop.core.api.workspace.PageLinkImpl;
import org.gatein.mop.core.api.workspace.PortalSite;
import org.gatein.mop.core.api.workspace.PortalSiteContainer;
-import org.gatein.mop.core.api.workspace.SecuredImpl;
import org.gatein.mop.core.api.StringAttribute;
+import org.gatein.mop.core.api.workspace.Secured;
import org.gatein.mop.core.api.workspace.SiteContainer;
import org.gatein.mop.core.api.workspace.SiteImpl;
import org.gatein.mop.core.api.workspace.TemplatizedImpl;
@@ -83,9 +83,6 @@
/** . */
private final Chromattic chromattic;
- /** . */
- private final Map<Class<?>, Class<?>> adapterMap;
-
public TestMOPService() throws Exception
{
ChromatticBuilder builder = ChromatticBuilder.create();
@@ -146,24 +143,13 @@
builder.add(GadgetState.class);
//
- builder.add(SecuredImpl.class);
+ builder.add(Secured.class);
//
this.chromattic = builder.build();
- this.adapterMap = new HashMap<Class<?>, Class<?>>();
}
- public <A> void addAdapter(Class<A> adaptedType, Class<? extends A> adapterType) {
- adapterMap.put(adaptedType, adapterType);
- }
-
@Override
- protected <A> Class<? extends A> getConcreteAdapterType(Class<A> adapterType)
- {
- return (Class<A>)adapterMap.get(adapterType);
- }
-
- @Override
protected Chromattic getChromattic()
{
return chromattic;
Added: components/mop/trunk/core/src/test/resources/META-INF/services/org.gatein.mop.spi.AdapterFactory
===================================================================
--- components/mop/trunk/core/src/test/resources/META-INF/services/org.gatein.mop.spi.AdapterFactory (rev 0)
+++ components/mop/trunk/core/src/test/resources/META-INF/services/org.gatein.mop.spi.AdapterFactory 2011-06-14 14:05:40 UTC (rev 6646)
@@ -0,0 +1,3 @@
+org.gatein.mop.core.api.workspace.Foo$Factory
+org.gatein.mop.core.api.workspace.Bar$Factory
+org.gatein.mop.core.api.workspace.Juu$Factory
Added: components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/AdapterFactory.java
===================================================================
--- components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/AdapterFactory.java (rev 0)
+++ components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/AdapterFactory.java 2011-06-14 14:05:40 UTC (rev 6646)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.gatein.mop.spi;
+
+/**
+ * The adapter factory.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class AdapterFactory<T, A>
+{
+
+ public abstract A getAdapter(T adaptee, Class<A> adapterType);
+
+}
13 years, 6 months
gatein SVN: r6644 - in epp/portal/branches/EPP_5_1_Branch: distribution and 5 other directories.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-06-14 00:48:48 -0400 (Tue, 14 Jun 2011)
New Revision: 6644
Modified:
epp/portal/branches/EPP_5_1_Branch/distribution/pack/examples/pom.xml
epp/portal/branches/EPP_5_1_Branch/distribution/pack/portletbridge/pom.xml
epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/gatein.ear/pom.xml
epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/integration.war/pom.xml
epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/pom.xml
epp/portal/branches/EPP_5_1_Branch/distribution/pom.xml
epp/portal/branches/EPP_5_1_Branch/pom.xml
epp/portal/branches/EPP_5_1_Branch/settings.xml
Log:
Integrate distribbution to build
Modified: epp/portal/branches/EPP_5_1_Branch/distribution/pack/examples/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/distribution/pack/examples/pom.xml 2011-06-13 10:14:55 UTC (rev 6643)
+++ epp/portal/branches/EPP_5_1_Branch/distribution/pack/examples/pom.xml 2011-06-14 04:48:48 UTC (rev 6644)
@@ -6,6 +6,7 @@
<groupId>org.exoplatform.portal</groupId>
<artifactId>distribution.parent</artifactId>
<version>5.1.1-epp-DEV02</version>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.exoplatform.portal.distribution</groupId>
Modified: epp/portal/branches/EPP_5_1_Branch/distribution/pack/portletbridge/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/distribution/pack/portletbridge/pom.xml 2011-06-13 10:14:55 UTC (rev 6643)
+++ epp/portal/branches/EPP_5_1_Branch/distribution/pack/portletbridge/pom.xml 2011-06-14 04:48:48 UTC (rev 6644)
@@ -6,6 +6,7 @@
<groupId>org.exoplatform.portal</groupId>
<artifactId>distribution.parent</artifactId>
<version>5.1.1-epp-DEV02</version>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.exoplatform.portal.distribution.root</groupId>
Modified: epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/gatein.ear/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/gatein.ear/pom.xml 2011-06-13 10:14:55 UTC (rev 6643)
+++ epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/gatein.ear/pom.xml 2011-06-14 04:48:48 UTC (rev 6644)
@@ -6,6 +6,7 @@
<groupId>org.exoplatform.portal</groupId>
<artifactId>distribution.parent</artifactId>
<version>5.1.1-epp-DEV02</version>
+ <relativePath>../../../pom.xml</relativePath>
</parent>
<artifactId>gatein</artifactId>
<packaging>ear</packaging>
Modified: epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/integration.war/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/integration.war/pom.xml 2011-06-13 10:14:55 UTC (rev 6643)
+++ epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/integration.war/pom.xml 2011-06-14 04:48:48 UTC (rev 6644)
@@ -5,6 +5,7 @@
<groupId>org.exoplatform.portal</groupId>
<artifactId>distribution.parent</artifactId>
<version>5.1.1-epp-DEV02</version>
+ <relativePath>../../../pom.xml</relativePath>
</parent>
<artifactId>integration</artifactId>
<packaging>war</packaging>
Modified: epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/pom.xml 2011-06-13 10:14:55 UTC (rev 6643)
+++ epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/pom.xml 2011-06-14 04:48:48 UTC (rev 6644)
@@ -6,6 +6,7 @@
<groupId>org.exoplatform.portal</groupId>
<artifactId>distribution.parent</artifactId>
<version>5.1.1-epp-DEV02</version>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.exoplatform.portal.distribution.deploy</groupId>
Modified: epp/portal/branches/EPP_5_1_Branch/distribution/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/distribution/pom.xml 2011-06-13 10:14:55 UTC (rev 6643)
+++ epp/portal/branches/EPP_5_1_Branch/distribution/pom.xml 2011-06-14 04:48:48 UTC (rev 6644)
@@ -32,8 +32,16 @@
</properties>
- <modules>
- <module>pack</module>
- </modules>
-
+
+ <profiles>
+ <profile>
+ <id>epp-distribution</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <modules>
+ <module>pack</module>
+ </modules>
+ </profile>
+ </profiles>
</project>
\ No newline at end of file
Modified: epp/portal/branches/EPP_5_1_Branch/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/pom.xml 2011-06-13 10:14:55 UTC (rev 6643)
+++ epp/portal/branches/EPP_5_1_Branch/pom.xml 2011-06-14 04:48:48 UTC (rev 6644)
@@ -83,6 +83,7 @@
<module>starter</module>
<module>packaging</module>
<module>testsuite</module>
+ <module>distribution</module>
</modules>
<dependencyManagement>
Modified: epp/portal/branches/EPP_5_1_Branch/settings.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/settings.xml 2011-06-13 10:14:55 UTC (rev 6643)
+++ epp/portal/branches/EPP_5_1_Branch/settings.xml 2011-06-14 04:48:48 UTC (rev 6644)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
- <localRepository>${env.HOME}/.m2_EPP</localRepository>
+ <localRepository>${env.HOME}/.m2_EPPpack</localRepository>
<mirrors>
<mirror>
13 years, 6 months
gatein SVN: r6643 - in epp/portal/branches/EPP_5_1_Branch/distribution: pack and 5 other directories.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-06-13 06:14:55 -0400 (Mon, 13 Jun 2011)
New Revision: 6643
Modified:
epp/portal/branches/EPP_5_1_Branch/distribution/pack/
epp/portal/branches/EPP_5_1_Branch/distribution/pack/examples/
epp/portal/branches/EPP_5_1_Branch/distribution/pack/pom.xml
epp/portal/branches/EPP_5_1_Branch/distribution/pack/portletbridge/
epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/
epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/gatein.ear/
epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/integration.war/
epp/portal/branches/EPP_5_1_Branch/distribution/pom.xml
Log:
Properties and optimalization.
Property changes on: epp/portal/branches/EPP_5_1_Branch/distribution/pack
___________________________________________________________________
Added: svn:ignore
+ target
Property changes on: epp/portal/branches/EPP_5_1_Branch/distribution/pack/examples
___________________________________________________________________
Added: svn:ignore
+ target
Modified: epp/portal/branches/EPP_5_1_Branch/distribution/pack/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/distribution/pack/pom.xml 2011-06-13 03:06:36 UTC (rev 6642)
+++ epp/portal/branches/EPP_5_1_Branch/distribution/pack/pom.xml 2011-06-13 10:14:55 UTC (rev 6643)
@@ -102,7 +102,7 @@
<property name="eap.path">${project.build.directory}/${project.build.finalName}/${eap.dir}</property>
<move file="${eap.path}" toFile="${epp.path}"/>
- <move file="${epp.path}/gatein-sso-${sso.version}" toFile="${epp.path}/gatein-sso"/>
+ <move file="${epp.path}/gatein-sso-${sso.version}" toFile="${epp.path}/${sso.directory}"/>
<ant antfile="src/build.xml" inheritRefs="true">
<target name="patch"/>
@@ -131,7 +131,7 @@
<executions>
<execution>
<id>distro-assembly-zip</id>
- <phase>package</phase>
+ <phase>compile</phase>
<goals>
<goal>single</goal>
</goals>
Property changes on: epp/portal/branches/EPP_5_1_Branch/distribution/pack/portletbridge
___________________________________________________________________
Added: svn:ignore
+ target
Property changes on: epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon
___________________________________________________________________
Added: svn:ignore
+ target
Property changes on: epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/gatein.ear
___________________________________________________________________
Added: svn:ignore
+ target
Property changes on: epp/portal/branches/EPP_5_1_Branch/distribution/pack/serverAddon/integration.war
___________________________________________________________________
Added: svn:ignore
+ target
Modified: epp/portal/branches/EPP_5_1_Branch/distribution/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/distribution/pom.xml 2011-06-13 03:06:36 UTC (rev 6642)
+++ epp/portal/branches/EPP_5_1_Branch/distribution/pom.xml 2011-06-13 10:14:55 UTC (rev 6643)
@@ -18,9 +18,18 @@
<eap.version>5.1.0</eap.version>
<eap.dir>jboss-eap-5.1</eap.dir>
<epp.dir>jboss-epp-5.1.1</epp.dir>
+
+ <!-- portlet bridge directory - not used, distribution module name is used as directory name -->
+ <portletbridge.directory>portletbridge</portletbridge.directory>
+ <!-- gatein-sso directory name within EPP -->
+ <sso.directory>gatein-sso</sso.directory>
+ <!-- EPP Documentation main directory -->
+ <epp.doc.directory>jboss-epp-doc-5.1</epp.doc.directory>
+
<sso.version>1.0.2-epp-DEV01</sso.version>
<portletbridge.version>2.1.0.GA.EPP51</portletbridge.version>
+
</properties>
<modules>
13 years, 6 months
gatein SVN: r6642 - portal/branches/branch-GTNPORTAL-1921/docs/reference-guide/en-US/modules/AuthenticationAndIdentity.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-06-12 23:06:36 -0400 (Sun, 12 Jun 2011)
New Revision: 6642
Modified:
portal/branches/branch-GTNPORTAL-1921/docs/reference-guide/en-US/modules/AuthenticationAndIdentity/SSO.xml
Log:
GTNPORTAL-1929 SSO Productization Documentation
Modified: portal/branches/branch-GTNPORTAL-1921/docs/reference-guide/en-US/modules/AuthenticationAndIdentity/SSO.xml
===================================================================
--- portal/branches/branch-GTNPORTAL-1921/docs/reference-guide/en-US/modules/AuthenticationAndIdentity/SSO.xml 2011-06-10 14:48:22 UTC (rev 6641)
+++ portal/branches/branch-GTNPORTAL-1921/docs/reference-guide/en-US/modules/AuthenticationAndIdentity/SSO.xml 2011-06-13 03:06:36 UTC (rev 6642)
@@ -4,7 +4,7 @@
%BOOK_ENTITIES;
]>
<section id="chap-Reference_Guide-SSO_Single_Sign_On">
- <title>SSO - Single Sign On</title>
+ <title>Single-Sign-On (SSO)</title>
<section id="sect-Reference_Guide-Single_Sign_On-Overview">
<title>Overview</title>
<para>
@@ -19,7 +19,7 @@
In this tutorial, the SSO server is installed in a Tomcat installation. Tomcat can be obtained from <ulink type="http" url="http://tomcat.apache.org">http://tomcat.apache.org</ulink>.
</para>
<para>
- All the packages required for setup can be found in a zip file located at: <ulink type="http" url="http://repository.jboss.org/maven2/org/gatein/sso/sso-packaging">http://repository.jboss.org/maven2/org/gatein/sso/sso-packaging</ulink>. In this document we will call the directory where the file is extracted $GATEIN_SSO_HOME.
+ All the packages required for setup can be found in a zip file located at: <ulink type="http" url="https://repository.jboss.org/nexus/content/groups/public/org/gatein/sso/s...">https://repository.jboss.org/nexus/content/groups/public/org/gatein/sso/s...</ulink>. In this document we will call $GATEIN_SSO_HOME the directory where the file is extracted.
</para>
<para>
Users are advised to not run any portal extensions that could override the data when manipulating the <filename>gatein.ear</filename> file directly.
@@ -32,7 +32,7 @@
</section>
<section id="sect-Reference_Guide-Single_Sign_On-CAS_Central_Authentication_Service">
- <title>CAS - Central Authentication Service</title>
+ <title>Central Authentication Service (CAS)</title>
<para>
This Single Sign On plugin enables seamless integration between &PRODUCT; and the CAS Single Sign On Framework. Details about CAS can be found <ulink url="http://www.ja-sig.org/products/cas/">here</ulink>.
</para>
@@ -55,7 +55,7 @@
</section>
<section id="sect-Reference_Guide-CAS_server-Modifying_CAS_server">
- <title>Modifying CAS server</title>
+ <title>Modifying the CAS server</title>
<para>
To configure the web archive as desired, the simplest way is to make the necessary changes directly in CAS codebase.
</para>
@@ -82,7 +82,7 @@
</step>
<step>
<para>
- Replace:
+ Replace:
<programlisting> <!--
| Whereas CredentialsToPrincipalResolvers identify who it is some Credentials might authenticate,
| AuthenticationHandlers actually authenticate credentials. Here e declare the AuthenticationHandlers that
@@ -116,7 +116,7 @@
With the following (Make sure to set the host, port and context with the values corresponding to your portal). Also available in <filename>GATEIN_SSO_HOME/cas/plugin/WEB-INF/deployerConfigContext.xml</filename>.
</para>
<para>
-
+
<programlisting><!--
| Whereas CredentialsToPrincipalResolvers identify who it is some Credentials might authenticate,
| AuthenticationHandlers actually authenticate credentials. Here we declare the AuthenticationHandlers that
@@ -226,10 +226,10 @@
<para>
In Tomcat, edit <filename>GATEIN_HOME/conf/jaas.conf</filename> and uncomment this section:
</para>
-<programlisting>org.gatein.sso.agent.login.SSOLoginModule required
+<programlisting>org.gatein.sso.agent.login.SSOLoginModule required;
org.exoplatform.services.security.j2ee.TomcatLoginModule required
portalContainerName=portal
-realmName=gatein-domain
+realmName=gatein-domain;
</programlisting>
</listitem>
</itemizedlist>
@@ -260,7 +260,7 @@
To utilize the Central Authentication Service, &PRODUCT; needs to redirect all user authentication to the CAS server.
</para>
<para>
- Information about where the CAS is hosted must be properly configured within the &PRODUCT; instance. The required configuration is done by modifying three files:
+ Information about where the CAS is hosted must be properly configured within the &PRODUCT; instance. The required configuration is done by modifying three files:
<itemizedlist>
<listitem>
<para>
@@ -291,7 +291,7 @@
<listitem>
<para>
Replace the entire contents of <filename>gatein.ear/02portal.war/login/jsp/login.jsp</filename> with:
- </para>
+ </para>
<programlisting><html>
<head>
<script type="text/javascript">
@@ -307,7 +307,7 @@
<para>
Add the following Filters at the top of the filter chain in <filename>gatein.ear/02portal.war/WEB-INF/web.xml</filename>:
-
+
<programlisting>
<![CDATA[
<filter>
@@ -398,15 +398,18 @@
<section id="sect-Reference_Guide-JOSSO_server-Obtaining_JOSSO">
<title>Obtaining JOSSO</title>
<para>
- JOSSO can be downloaded from <ulink type="http" url="http://sourceforge.net/projects/josso/files/">http://sourceforge.net/projects/josso/files/</ulink>. Use the package that embeds Apache Tomcat. The integration was tested with JOSSO-1.8.1.
+ JOSSO can be downloaded from <ulink type="http" url="http://sourceforge.net/projects/josso/files/">http://sourceforge.net/projects/josso/files/</ulink>. Use the package that embeds Apache Tomcat.
</para>
<para>
Once downloaded, extract the package into what will be called <filename>JOSSO_HOME</filename> in this example.
</para>
+ <warning>
+ <para>The steps described later are only correct in case of JOSSO v.1.8.1.</para>
+ </warning>
</section>
<section id="sect-Reference_Guide-JOSSO_server-Modifying_JOSSO_server">
- <title>Modifying JOSSO server</title>
+ <title>Modifying the JOSSO server</title>
<procedure>
<step>
<para>
@@ -498,10 +501,10 @@
<para>
In Tomcat, edit <filename>GATEIN_HOME/conf/jaas.conf</filename> and uncomment this section:
</para>
-<programlisting>org.gatein.sso.agent.login.SSOLoginModule required
+<programlisting>org.gatein.sso.agent.login.SSOLoginModule required;
org.exoplatform.services.security.j2ee.TomcatLoginModule requiredtm
portalContainerName=portal
-realmName=gatein-domain
+realmName=gatein-domain;
</programlisting>
</listitem>
</itemizedlist>
@@ -532,7 +535,7 @@
The next part of the process is to redirect all user authentication to the JOSSO server.
</para>
<para>
- Information about where the JOSSO server is hosted must be properly configured within the &PRODUCT; instance. The required configuration is done by modifying four files:
+ Information about where the JOSSO server is hosted must be properly configured within the &PRODUCT; instance. The required configuration is done by modifying four files:
<itemizedlist>
<listitem>
<para>
@@ -563,7 +566,7 @@
<listitem>
<para>
Replace the entire contents of <filename>gatein.ear/02portal.war/login/jsp/login.jsp</filename> with:
- </para>
+ </para>
<programlisting><html>
<head>
<script type="text/javascript">
@@ -579,7 +582,7 @@
<para>
Add the following Filters at the top of the filter chain in <filename>gatein.ear/02portal.war/WEB-INF/web.xml</filename>:
-
+
<programlisting>
<![CDATA[
<filter>
@@ -618,7 +621,7 @@
<listitem>
<para>
Replace the <literal>InitiateLoginServlet</literal> declaration in <filename>gatein.ear/02portal.war/WEB-INF/web.xml</filename> with:
- </para>
+ </para>
<programlisting><servlet>
<servlet-name>InitiateLoginServlet</servlet-name>
<servlet-class>org.gatein.sso.agent.GenericSSOAgent</servlet-class>
@@ -662,7 +665,7 @@
<section id="sect-Reference_Guide-OpenSSO_server-Obtaining_OpenSSO">
<title>Obtaining OpenSSO</title>
<para>
- OpenSSO can be downloaded from <ulink type="http" url="https://opensso.dev.java.net/public/use/index.html">https://opensso.dev.java.net/public/use/index.html</ulink>.
+ OpenSSO can be downloaded from <ulink type="http" url="http://download.oracle.com/otn/nt/middleware/11g/oracle_opensso_80U2.zip">http://download.oracle.com/otn/nt/middleware/11g/oracle_opensso_80U2.zip</ulink>.
</para>
<para>
Once downloaded, extract the package into a suitable location. This location will be referred to as <filename>OPENSSO_HOME</filename> in this example.
@@ -702,7 +705,7 @@
</step>
<step>
<para>
- Ensure the <filename>TOMCAT_HOME/webapps/opensso/config/auth/default/AuthenticationPlugin.xml</filename> file looks like this:
+ Ensure the <filename>TOMCAT_HOME/webapps/opensso/config/auth/default/AuthenticationPlugin.xml</filename> file looks like this:
<programlisting>
<?xml version='1.0' encoding="UTF-8"?>
@@ -794,7 +797,7 @@
<para>Do the same for "gatein" realm.</para>
</step>
</procedure>
- <para>TODO: The above OpenSSO manual configuration could be replaced by configuration files prepared in advance</para>
+ <para>Also, instead of configuring OpenSSO manually as above, you can refer to the available configuration files <ulink url="https://repository.jboss.org/nexus/content/groups/public/org/gatein/sso/s...">here</ulink>.</para>
</section>
</section>
@@ -825,18 +828,18 @@
</listitem>
<listitem>
<para>
- If you are running GateIn in Tomcat, edit $GATEIN_HOME/conf/jaas.conf and uncomment this section
+ If you are running &PRODUCT; in Tomcat, edit $GATEIN_HOME/conf/jaas.conf and uncomment this section
</para>
-<programlisting>org.gatein.sso.agent.login.SSOLoginModule required
+<programlisting>org.gatein.sso.agent.login.SSOLoginModule required;
org.exoplatform.services.security.j2ee.TomcatLoginModule required
portalContainerName=portal
-realmName=gatein-domain
+realmName=gatein-domain;
</programlisting>
</listitem>
</itemizedlist>
<para>
- At this point the installation can be tested:
+ At this point the installation can be tested:
</para>
<procedure>
<step>
@@ -891,7 +894,7 @@
<listitem>
<para>
Replace the entire contents of <filename>gatein.ear/02portal.war/login/jsp/login.jsp</filename> with:
- </para>
+ </para>
<programlisting><html>
<head>
<script type="text/javascript">
@@ -907,7 +910,7 @@
<para>
Add the following Filters at the top of the filter chain in <filename>gatein.ear/02portal.war/WEB-INF/web.xml</filename>:
-
+
<programlisting>
<![CDATA[
<filter>
@@ -946,7 +949,7 @@
<listitem>
<para>
Replace the <literal>InitiateLoginServlet</literal> declaration in <filename>gatein.ear/02portal.war/WEB-INF/web.xml</filename> with:
- </para>
+ </para>
<programlisting><servlet>
<servlet-name>InitiateLoginServlet</servlet-name>
<servlet-class>org.gatein.sso.agent.GenericSSOAgent</servlet-class>
@@ -970,7 +973,7 @@
</section>
- <section id="sect-Reference_Guide-Single_Sign_On-SPNEGO">
+ <section id="Single_Sign_On-SPNEGO">
<title>SPNEGO</title>
<para>SPNEGO (Simple and Protected GSSAPI Negotiation Mechanism) is
used to authenticate transparently through the web browser after the
@@ -999,48 +1002,231 @@
<para>The User has seamless SSO into the web application.</para>
</step>
</procedure>
-
- <section>
- <title>Configuration</title>
- <para>GateIn uses JBoss Negotiation to enable SPNEGO based desktop
- SSO for the Portal. Here are the steps to integrate SPNEGO with
- GateIn.</para>
+
+ <section id="SPNEGO_server_configuration">
+ <title>SPNEGO Server Configuration</title>
+ <note>
+ <para>Information stated here only describes basic steps for you to configure the SPNEGO server. If you are already familiar with SPNEGO, jump to the <xref linkend="Single_Sign_On-SPNEGO-GateIn_Configuration" /> to see how to integrate SPNEGO with &PRODUCT;.</para>
+ </note>
+ <procedure>
+ <step>
+ <para>Correct the setup of network on the machine. For example, if you are using the "server.local.network" domain as your machine where Kerberos and &PRODUCT; are localed,
+ add the line containing the machine's IP address to the <emphasis role="bold">/etc/host </emphasis> file.
+ </para>
+ <programlisting>
+192.168.1.88 server.local.network
+ </programlisting>
+ <note>
+ <para>It is not recommended you use loopback addresses.</para>
+ </note>
+ </step>
+ <step>
+ <para>Install Kerberos with these packages: krb5-admin-server, krb5-kdc, krb5-config, krb5-user, krb5-clients, and krb5-rsh-server.
+ </para>
+ </step>
+ <step>
+ <para>Edit the Kerberos configuration file at <emphasis role="bold">/etc/krb5.config</emphasis>, including:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>Uncomment on these lines:</para>
+<programlisting>
+default_tgs_enctypes = des3-hmac-sha1
+default_tkt_enctypes = des3-hmac-sha1
+permitted_enctypes = des3-hmac-sha1
+</programlisting>
+ </listitem>
+ <listitem>
+ <para>Add <emphasis role="bold">local.network</emphasis> as a default realm and it is also added to the list of realms and remove the remains of realms. The content looks like:
+ </para>
+<programlisting>
+[libdefaults]
+ default_realm = LOCAL.NETWORK
+
+# The following krb5.conf variables are only for MIT Kerberos.
+ krb4_config = /etc/krb.conf
+ krb4_realms = /etc/krb.realms
+ kdc_timesync = 1
+ ccache_type = 4
+ forwardable = true
+ proxiable = true
+
+# The following encryption type specification will be used by MIT Kerberos
+# if uncommented. In general, the defaults in the MIT Kerberos code are
+# correct and overriding these specifications only serves to disable new
+# encryption types as they are added, creating interoperability problems.
+#
+# Thie only time when you might need to uncomment these lines and change
+# the enctypes is if you have local software that will break on ticket
+# caches containing ticket encryption types it doesn't know about (such as
+# old versions of Sun Java).
+
+ default_tgs_enctypes = des3-hmac-sha1
+ default_tkt_enctypes = des3-hmac-sha1
+ permitted_enctypes = des3-hmac-sha1
+
+# The following libdefaults parameters are only for Heimdal Kerberos.
+ v4_instance_resolve = false
+ v4_name_convert = {
+ host = {
+ rcmd = host
+ ftp = ftp
+ }
+ plain = {
+ something = something-else
+ }
+ }
+ fcc-mit-ticketflags = true
+
+[realms]
+ LOCAL.NETWORK = {
+ kdc = server.local.network
+ admin_server = server.local.network
+ }
+
+[domain_realm]
+ .local.network = LOCAL.NETWORK
+ local.network = LOCAL.NETWORK
+
+[login]
+ krb4_convert = true
+ krb4_get_tickets = false
+</programlisting>
+ </listitem>
+ </itemizedlist>
+ </step>
+ <step>
+ <para>Edit the KDC configuraton file at <emphasis role="bold">/etc/krb5kdc/kdc.conf</emphasis> that looks like.
+ </para>
+<programlisting>
+[kdcdefaults]
+ kdc_ports = 750,88
+
+[realms]
+ LOCAL.NETWORK = {
+ database_name = /home/gatein/krb5kdc/principal
+ admin_keytab = FILE:/home/gatein/krb5kdc/kadm5.keytab
+ acl_file = /home/gatein/krb5kdc/kadm5.acl
+ key_stash_file = /home/gatein/krb5kdc/stash
+ kdc_ports = 750,88
+ max_life = 10h 0m 0s
+ max_renewable_life = 7d 0h 0m 0s
+ master_key_type = des3-hmac-sha1
+ supported_enctypes = aes256-cts:normal arcfour-hmac:normal des3-hmac-sha1:normal des-cbc-crc:normal des:normal des:v4 des:norealm des:onlyrealm des:afs3
+ default_principal_flags = +preauth
+ }
+
+[logging]
+ kdc = FILE:/home/gatein/krb5logs/kdc.log
+ admin_server = FILE:/home/gatein/krb5logs/kadmin.log
+</programlisting>
+ <itemizedlist>
+ <listitem>
+ <para>Create krb5kdc and krb5logs directory for Kerberos database as shown in the configuration file above.</para></listitem>
+ <listitem>
+ <para>Next, create a KDC database using the following command.</para>
+<programlisting>
+sudo krb5_newrealm
+</programlisting>
+ </listitem>
+ <listitem>
+ <para>Start the KDC and Kerberos admin servers using these commands:</para>
+<programlisting>
+sudo /etc/init.d/krb5-kdc restart
+sudo /etc/init.d/krb-admin-server restart
+</programlisting>
+ </listitem>
+ </itemizedlist>
+ </step>
+ <step>
+ <para>Add Principals and create Keys.</para>
+ <itemizedlist>
+ <listitem>
+ <para>Start an interactive 'kadmin' session and create the necessary Principals.</para>
+<programlisting>
+sudo kadmin.local
+</programlisting>
+ </listitem>
+ <listitem>
+ <para>Add the &PRODUCT; machine and keytab file that need to be authenticated.</para>
+<programlisting>
+addprinc -randkey HTTP/server.local.network(a)LOCAL.NETWORK
+ktadd HTTP/server.local.network(a)LOCAL.NETWORK
+</programlisting>
+ </listitem>
+ <listitem>
+ <para>Add the default &PRODUCT; user accounts and enter the password for each created user that will be authenticated.</para>
+<programlisting>
+addprinc john
+addprinc demo
+addprinc root
+</programlisting>
+ </listitem>
+ </itemizedlist>
+ </step>
+ <step>
+ <para>Test your changed setup by using the command.</para>
+<programlisting>
+kinit -A demo
+</programlisting>
+ <itemizedlist>
+ <listitem>
+ <para>If the setup works well, you are required to enter the password created for this user in Step 5.</para>
+ </listitem>
+ <listitem>
+ <para>If you want to login with another user, use this command.</para>
+<programlisting>
+kdestroy
+</programlisting>
+ </listitem>
+ </itemizedlist>
+ </step>
+ </procedure>
+ </section>
+ <section id="Single_Sign_On-SPNEGO-GateIn_Configuration">
+ <title>&PRODUCT; Configuration</title>
+ <para>&PRODUCT; uses JBoss Negotiation to enable SPNEGO-based desktop
+ SSO for the portal. Here are the steps to integrate SPNEGO with
+ &PRODUCT;.
+ </para>
<procedure>
<step>
<para>
- Activate the Host authentication
-
+ Activate the Host authentication under the <emphasis role="bold">conf/login-config.xml </emphasis> file adding the following host login module:
+ </para>
+
Under conf/login-config.xml, add the following host login module:
<programlisting><![CDATA[<!-- SPNEGO domain -->
- <application-policy name="host">
- <authentication>
+<application-policy name="host">
+ <authentication>
<login-module code="com.sun.security.auth.module.Krb5LoginModule"
flag="required">
<module-option name="storeKey">true</module-option>
- <module-option name="useKeyTab">true</module-option>
- <module-option name="principal">HTTP/server.local.network(a)LOCAL.NETWORK</module-option>
- <module-option name="keyTab">/home/user/krb5keytabs/jboss.keytab</module-option>
- <module-option name="doNotPrompt">true</module-option>
- <module-option name="debug">true</module-option>
- </login-module>
- </authentication>
+ <module-option name="useKeyTab">true</module-option>
+ <module-option name="principal">HTTP/server.local.network(a)LOCAL.NETWORK</module-option>
+ <module-option name="keyTab">/etc/krb5.keytab</module-option>
+ <module-option name="doNotPrompt">true</module-option>
+ <module-option name="debug">true</module-option>
+ </login-module>
+ </authentication>
</application-policy>
]]></programlisting>
- the 'keyTab' value should point to the keytab file that was
- generated by the kadmin kerberos tool. See the Setting up your
- Kerberos Development Environment guide for more details.
- </para>
+
+ <para>The 'keyTab' value should point to the keytab file that was
+ generated by the kadmin kerberos tool. See the <xref linkend="SPNEGO_server_configuration"/> section for more details.
+ </para>
</step>
- <step>
+
+ <step>
<para>
- Extend the core authentication mechanisms to support
- SPNEGO
+ Extend the core authentication mechanisms to support SPNEGO under
+ <emphasis role="bold">deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml</emphasis> by
+ adding the 'SPNEGO' authenticators property.
+ </para>
- Under
- deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml,
- add 'SPNEGO' authenticators property
-
- <programlisting><![CDATA[<property name="authenticators">
+<programlisting language="xml">
+<![CDATA[
+<property name="authenticators">
<map keyClass="java.lang.String" valueClass="java.lang.String">
<entry>
<key>BASIC</key>
@@ -1068,135 +1254,119 @@
<key>SPNEGO</key>
<value>org.jboss.security.negotiation.NegotiationAuthenticator</value>
</entry>
- </map>
- </property>]]></programlisting>
-
- </para>
+ </map>
+</property>
+]]>
+</programlisting>
</step>
<step>
- <para>Add the JBoss Negotiation binary
-
- copy $GATEIN_SSO_HOME/spnego/jboss-negotiation-2.0.3.GA.jar to lib
-</para>
+ <para>Add the GateIn SSO module binaries by copying <emphasis role="bold">$GATEIN_SSO_HOME/spnego/gatein.ear/lib/sso-agent.jar</emphasis>, and <emphasis role="bold">$GATEIN_SSO_HOME/spnego/gatein.ear/lib/sso-spnego.jar</emphasis> to the <emphasis role="bold">deploy/gatein.ear/lib</emphasis> directory.
+ </para>
</step>
<step>
- <para>Add the Gatein SSO module binaries
-
- Add $GATEIN_SSO_HOME/spnego/gatein.ear/lib/sso-agent.jar, and $GATEIN_SSO_HOME/spnego/gatein.ear/lib/sso-spnego.jar to deploy/gatein.ear/lib
-</para>
- </step>
- <step>
<para>
- Activate SPNEGO LoginModule for GateIn
+ Modify the <emphasis role="bold">deploy/gatein.ear/META-INF/gatein-jboss-beans.xml</emphasis> file as below, then comment on other parts.
+ </para>
- Modify deploy/gatein.ear/META-INF/gatein-jboss-beans.xml, so that it
- looks like this:
-
- <programlisting><![CDATA[<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <application-policy xmlns="urn:jboss:security-beans:1.0" name="gatein-domain">
- <!-- Uncomment this for Kerberos based SSO integration -->
- <authentication>
- <login-module
- code="org.gatein.sso.spnego.SPNEGOLoginModule"
- flag="requisite">
- <module-option name="password-stacking">useFirstPass</module-option>
- <module-option name="serverSecurityDomain">host</module-option>
- </login-module>
- <login-module
- code="org.gatein.sso.agent.login.SPNEGORolesModule"
- flag="required">
- <module-option name="password-stacking">useFirstPass</module-option>
- <module-option name="portalContainerName">portal</module-option>
- <module-option name="realmName">gatein-domain</module-option>
- </login-module>
- </authentication>
- </application-policy>
-</deployment>]]></programlisting>
- </para>
+ <programlisting language="xml"><![CDATA[
+<login-module code="org.gatein.sso.spnego.SPNEGOLoginModule" flag="required">
+ <module-option name="password-stacking">useFirstPass</module-option>
+ <module-option name="serverSecurityDomain">host</module-option>
+</login-module>
+<login-module code="org.gatein.sso.agent.login.SPNEGORolesModule" flag="required">
+ <module-option name="password-stacking">useFirstPass</module-option>
+ <module-option name="portalContainerName">portal</module-option>
+ <module-option name="realmName">gatein-domain</module-option>
+</login-module>]]>
+</programlisting>
</step>
<step>
<para>
- Integrate SPNEGO support into the Portal web archive
+ Modify <emphasis role="bold">gatein.ear/02portal.war/WEB-INF/web.xml</emphasis> as below.</para>
- Switch GateIn authentication mechanism from the default "FORM"
- based to "SPNEGO" based authentication as follows:
-
- Modify gatein.ear/02portal.war/WEB-INF/web.xml
-
- <programlisting><![CDATA[ <!--
- <login-config>
- <auth-method>FORM</auth-method>
- <realm-name>gatein-domain</realm-name>
- <form-login-config>
- <form-login-page>/initiatelogin</form-login-page>
- <form-error-page>/errorlogin</form-error-page>
- </form-login-config>
- </login-config>
- -->
- <login-config>
- <auth-method>SPNEGO</auth-method>
- <realm-name>SPNEGO</realm-name>
- </login-config>]]></programlisting>
-
-
- Integrate request pre-processing needed for SPNEGO via filters.
- Add the following filters to the web.xml at the top of the Filter
- chain:
-
- <programlisting><![CDATA[ <filter>
- <filter-name>LoginRedirectFilter</filter-name>
- <filter-class>org.gatein.sso.agent.filter.LoginRedirectFilter</filter-class>
- <init-param>
- <!-- This should point to your SSO authentication server -->
- <param-name>LOGIN_URL</param-name>
- <param-value>/portal/private/classic</param-value>
- </init-param>
- </filter>
- <filter>
- <filter-name>SPNEGOFilter</filter-name>
- <filter-class>org.gatein.sso.agent.filter.SPNEGOFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>LoginRedirectFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>SPNEGOFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>]]></programlisting>
- </para>
+ <programlisting language="xml"><![CDATA[
+<!--
+<login-config>
+ <auth-method>FORM</auth-method>
+ <realm-name>gatein-domain</realm-name>
+ <form-login-config>
+ <form-login-page>/initiatelogin</form-login-page>
+ <form-error-page>/errorlogin</form-error-page>
+ </form-login-config>
+</login-config>
+-->
+
+<login-config>
+ <auth-method>SPNEGO</auth-method>
+ <realm-name>SPNEGO</realm-name>
+</login-config>]]>
+</programlisting>
+ <para>This integrates SPNEGO support into the Portal web archive by switching the authentication mechanism from the default "FORM"-based to "SPNEGO"-based authentication.</para>
</step>
<step>
- <para>
- Modify the Portal's 'Sign In' link to perform SPNEGO
- authentication
+ <para>Integrate the request pre-processing needed for SPNEGO via filters by adding the following filters to the <emphasis role="bold">web.xml </emphasis> at the top of the Filter chain.</para>
- Modify the 'Sign In' link on
- gatein.war/web.war/groovy/groovy/webui/component/UIBannerPortlet.gtmpl
- as follows:
-
- <programlisting><![CDATA[<!--
-<a onclick="$signInAction"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>
--->
-<a href="/portal/sso"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>]]></programlisting>
- </para>
+<programlisting><![CDATA[
+<filter>
+ <filter-name>LoginRedirectFilter</filter-name>
+ <filter-class>org.gatein.sso.agent.filter.LoginRedirectFilter</filter-class>
+ <init-param>
+ <!-- This should point to your SSO authentication server -->
+ <param-name>LOGIN_URL</param-name>
+ <param-value>/portal/private/classic</param-value>
+ </init-param>
+</filter>
+<filter>
+ <filter-name>SPNEGOFilter</filter-name>
+ <filter-class>org.gatein.sso.agent.filter.SPNEGOFilter</filter-class>
+</filter>
+<filter-mapping>
+ <filter-name>LoginRedirectFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+</filter-mapping>
+<filter-mapping>
+ <filter-name>SPNEGOFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+</filter-mapping>]]>
+</programlisting>
+
</step>
<step>
<para>
- Start the GateIn Portal
- <programlisting>sudo ./run.sh -Djava.security.krb5.realm=LOCAL.NETWORK -Djava.security.krb5.kdc=server.local.network -c spnego -b server.local.network</programlisting>
- </para>
+ Start the &PRODUCT; portal using the command below.</para>
+ <programlisting>sudo ./run.sh -Djava.security.krb5.realm=LOCAL.NETWORK -Djava.security.krb5.kdc=server.local.network -c PROFILE -b server.local.network</programlisting>
+ <para>The PROFILE parameter in the above command should be replaced with the server profile modified in the above configuration. For example, if you are configuring the default profile, your command will be.</para>
+ <programlisting>sudo ./run.sh -Djava.security.krb5.realm=LOCAL.NETWORK -Djava.security.krb5.kdc=server.local.network -c default -b server.local.network</programlisting>
</step>
<step>
- <para>Login to Kerberos
+ <para>Login to Kerberos with the command.</para>
<programlisting>kinit -A demo</programlisting>
- You should be able to click the 'Sign In' link on the GateIn Portal
- and the 'demo' user from the GateIn portal should be automatically
- logged in</para>
+ <para>You should be able to click the 'Sign In' link on the &PRODUCT; portal
+ and the 'demo' user from the &PRODUCT; portal should be automatically
+ logged in.</para>
</step>
</procedure>
</section>
+ <section id="Single_Sign_On-CAS_Central_Clients">
+ <title>Clients</title>
+ <para>After performing all configurations above, you need to enable the <emphasis role="bold">Negotiate authentication </emphasis> of Firefox in clients so that clients could be authenticated by &PRODUCT; as follows:
+ </para>
+ <procedure>
+ <step>
+ <para>Start Firefox, then enter the command: <emphasis role="bold">about:config </emphasis> into the address field.</para>
+ </step>
+ <step>
+ <para>Enter <emphasis role="bold">network.negotiate-auth</emphasis> and set the value as below:</para>
+<programlisting>
+network.negotiate-auth.allow-proxies = true
+network.negotiate-auth.delegation-uris = .local.network
+network.negotiate-auth.gsslib (no-value)
+network.negotiate-auth.trusted-uris = .local.network
+network.negotiate-auth.using-native-gsslib = true
+</programlisting>
+ </step>
+ </procedure>
+ </section>
</section>
</section>
13 years, 6 months
gatein SVN: r6641 - in components/shindig/trunk: features and 6 other directories.
by do-not-reply@jboss.org
Author: theute
Date: 2011-06-10 10:48:22 -0400 (Fri, 10 Jun 2011)
New Revision: 6641
Modified:
components/shindig/trunk/features/pom.xml
components/shindig/trunk/java/common/pom.xml
components/shindig/trunk/java/gadgets/pom.xml
components/shindig/trunk/java/pom.xml
components/shindig/trunk/java/samples/pom.xml
components/shindig/trunk/java/server/pom.xml
components/shindig/trunk/java/social-api/pom.xml
components/shindig/trunk/pom.xml
Log:
Prepare for next release
Modified: components/shindig/trunk/features/pom.xml
===================================================================
--- components/shindig/trunk/features/pom.xml 2011-06-10 14:47:14 UTC (rev 6640)
+++ components/shindig/trunk/features/pom.xml 2011-06-10 14:48:22 UTC (rev 6641)
@@ -23,12 +23,12 @@
<parent>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-project</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>shindig-features</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Apache Shindig Features</name>
Modified: components/shindig/trunk/java/common/pom.xml
===================================================================
--- components/shindig/trunk/java/common/pom.xml 2011-06-10 14:47:14 UTC (rev 6640)
+++ components/shindig/trunk/java/common/pom.xml 2011-06-10 14:48:22 UTC (rev 6641)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-parent</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/shindig/trunk/java/gadgets/pom.xml
===================================================================
--- components/shindig/trunk/java/gadgets/pom.xml 2011-06-10 14:47:14 UTC (rev 6640)
+++ components/shindig/trunk/java/gadgets/pom.xml 2011-06-10 14:48:22 UTC (rev 6641)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-parent</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/shindig/trunk/java/pom.xml
===================================================================
--- components/shindig/trunk/java/pom.xml 2011-06-10 14:47:14 UTC (rev 6640)
+++ components/shindig/trunk/java/pom.xml 2011-06-10 14:48:22 UTC (rev 6641)
@@ -22,11 +22,11 @@
<parent>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-project</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
</parent>
<artifactId>shindig-parent</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Apache Shindig Project Parent</name>
Modified: components/shindig/trunk/java/samples/pom.xml
===================================================================
--- components/shindig/trunk/java/samples/pom.xml 2011-06-10 14:47:14 UTC (rev 6640)
+++ components/shindig/trunk/java/samples/pom.xml 2011-06-10 14:48:22 UTC (rev 6641)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-parent</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
</parent>
<artifactId>shindig-samples</artifactId>
Modified: components/shindig/trunk/java/server/pom.xml
===================================================================
--- components/shindig/trunk/java/server/pom.xml 2011-06-10 14:47:14 UTC (rev 6640)
+++ components/shindig/trunk/java/server/pom.xml 2011-06-10 14:48:22 UTC (rev 6641)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-parent</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/shindig/trunk/java/social-api/pom.xml
===================================================================
--- components/shindig/trunk/java/social-api/pom.xml 2011-06-10 14:47:14 UTC (rev 6640)
+++ components/shindig/trunk/java/social-api/pom.xml 2011-06-10 14:48:22 UTC (rev 6641)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-parent</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: components/shindig/trunk/pom.xml
===================================================================
--- components/shindig/trunk/pom.xml 2011-06-10 14:47:14 UTC (rev 6640)
+++ components/shindig/trunk/pom.xml 2011-06-10 14:48:22 UTC (rev 6641)
@@ -28,7 +28,7 @@
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-project</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Apache Shindig Project</name>
@@ -1244,32 +1244,32 @@
<dependency>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-features</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-common</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-gadgets</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-server</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-social-api</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-common</artifactId>
- <version>1.0-r790473-Patch07</version>
+ <version>1.0-r790473-Patch08-SNAPSHOT</version>
<type>test-jar</type>
</dependency>
13 years, 6 months
gatein SVN: r6640 - components/shindig/tags.
by do-not-reply@jboss.org
Author: theute
Date: 2011-06-10 10:47:14 -0400 (Fri, 10 Jun 2011)
New Revision: 6640
Added:
components/shindig/tags/1.0-r790473-Patch07/
Log:
Tagging 1.0-r790473-Patch06
13 years, 6 months