gatein SVN: r7269 - in portal/branches/api/component/api-impl: src/test/java/org/gatein/portal/api/impl and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-08-31 18:32:32 -0400 (Wed, 31 Aug 2011)
New Revision: 7269
Added:
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/content/
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/content/ContentRegistryTestCase.java
Modified:
portal/branches/api/component/api-impl/pom.xml
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/id/ComplexApplicationContextTestCase.java
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/SiteTestCase.java
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollectionTestCase.java
Log:
embryo of content registry unit test
Modified: portal/branches/api/component/api-impl/pom.xml
===================================================================
--- portal/branches/api/component/api-impl/pom.xml 2011-08-31 22:02:22 UTC (rev 7268)
+++ portal/branches/api/component/api-impl/pom.xml 2011-08-31 22:32:32 UTC (rev 7269)
@@ -62,13 +62,6 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
-
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>5.14.10</version>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java 2011-08-31 22:02:22 UTC (rev 7268)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java 2011-08-31 22:32:32 UTC (rev 7269)
@@ -1,15 +1,32 @@
package org.gatein.portal.api.impl;
+import junit.framework.AssertionFailedError;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.portal.AbstractPortalTest;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.SiteType;
+import org.exoplatform.portal.mop.navigation.NavigationContext;
import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.mop.navigation.NavigationState;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+import org.exoplatform.portal.mop.navigation.NodeModel;
+import org.exoplatform.portal.mop.navigation.Scope;
import org.exoplatform.portal.pom.config.POMSessionManager;
import org.exoplatform.portal.pom.data.ModelDataStorage;
import org.exoplatform.web.application.RequestContext;
import org.gatein.api.GateIn;
/** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
-public class AbstractAPITestCase extends AbstractPortalTest
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration.xml")
+})
+public abstract class AbstractAPITestCase extends AbstractPortalTest
{
/** . */
@@ -54,4 +71,30 @@
RequestContext.setCurrentInstance(new SimpleRequestContext(null));
}
+ @Override
+ protected void tearDown() throws Exception
+ {
+ end(false);
+ }
+
+ protected NodeContext createSite(SiteType type, String name)
+ {
+ try
+ {
+ storage.create(new PortalConfig(type.getName(), name).build());
+ NavigationContext nav = new NavigationContext(new SiteKey(type, name), new NavigationState(0));
+ navService.saveNavigation(nav);
+ //
+ storage.create(new org.exoplatform.portal.config.model.Page(type.getName(), name, "homepage").build());
+
+ //
+ return navService.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ }
+ catch (Exception e)
+ {
+ AssertionFailedError afe = new AssertionFailedError();
+ afe.initCause(e);
+ throw afe;
+ }
+ }
}
Added: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/content/ContentRegistryTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/content/ContentRegistryTestCase.java (rev 0)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/content/ContentRegistryTestCase.java 2011-08-31 22:32:32 UTC (rev 7269)
@@ -0,0 +1,23 @@
+package org.gatein.portal.api.impl.content;
+
+import org.exoplatform.portal.mop.SiteType;
+import org.gatein.api.content.ContentRegistry;
+import org.gatein.portal.api.impl.AbstractAPITestCase;
+
+/** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
+public class ContentRegistryTestCase extends AbstractAPITestCase
+{
+
+ public void testFoo()
+ {
+ createSite(SiteType.PORTAL, "classic");
+
+ //
+ ContentRegistry registry = gatein.getDefaultPortal().getContentRegistry();
+
+ //
+ registry.getCategoryNames();
+
+ }
+
+}
Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/id/ComplexApplicationContextTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/id/ComplexApplicationContextTestCase.java 2011-08-31 22:02:22 UTC (rev 7268)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/id/ComplexApplicationContextTestCase.java 2011-08-31 22:32:32 UTC (rev 7269)
@@ -22,15 +22,9 @@
package org.gatein.portal.api.impl.id;
-import org.gatein.api.content.Portlet;
-import org.gatein.api.id.Id;
-import org.gatein.portal.api.impl.GateInImpl;
-import org.testng.annotations.Test;
-
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class ComplexApplicationContextTestCase
{
- @Test
public void checkParsing()
{
/*
Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java 2011-08-31 22:02:22 UTC (rev 7268)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java 2011-08-31 22:32:32 UTC (rev 7269)
@@ -1,70 +1,19 @@
package org.gatein.portal.api.impl.portal;
-import junit.framework.AssertionFailedError;
-import org.exoplatform.component.test.ConfigurationUnit;
-import org.exoplatform.component.test.ConfiguredBy;
-import org.exoplatform.component.test.ContainerScope;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.portal.AbstractPortalTest;
-import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.SiteType;
-import org.exoplatform.portal.mop.navigation.NavigationContext;
-import org.exoplatform.portal.mop.navigation.NavigationService;
-import org.exoplatform.portal.mop.navigation.NavigationState;
import org.exoplatform.portal.mop.navigation.NodeContext;
-import org.exoplatform.portal.mop.navigation.NodeModel;
-import org.exoplatform.portal.mop.navigation.Scope;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.portal.pom.data.ModelDataStorage;
-import org.exoplatform.web.application.RequestContext;
-import org.gatein.api.GateIn;
import org.gatein.api.portal.Navigation;
import org.gatein.api.portal.Page;
import org.gatein.api.portal.Site;
import org.gatein.portal.api.impl.AbstractAPITestCase;
-import org.gatein.portal.api.impl.GateInImpl;
-import org.gatein.portal.api.impl.SimpleRequestContext;
import java.net.URI;
import java.util.Iterator;
/** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
-@ConfiguredBy({
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration.xml")
-})
public class NavigationTestCase extends AbstractAPITestCase
{
- private NodeContext createSite(SiteType type, String name)
- {
- try
- {
- storage.create(new PortalConfig(type.getName(), name).build());
- NavigationContext nav = new NavigationContext(new SiteKey(type, name), new NavigationState(0));
- navService.saveNavigation(nav);
- //
- storage.create(new org.exoplatform.portal.config.model.Page(type.getName(), name, "homepage").build());
-
- //
- return navService.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
- }
- catch (Exception e)
- {
- AssertionFailedError afe = new AssertionFailedError();
- afe.initCause(e);
- throw afe;
- }
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- end(false);
- }
-
public void testEmptyNavigation()
{
createSite(SiteType.PORTAL, "classic");
Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/SiteTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/SiteTestCase.java 2011-08-31 22:02:22 UTC (rev 7268)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/SiteTestCase.java 2011-08-31 22:32:32 UTC (rev 7269)
@@ -22,26 +22,24 @@
package org.gatein.portal.api.impl.portal;
+import junit.framework.TestCase;
import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.pom.data.PageKey;
import org.exoplatform.portal.pom.data.PortalKey;
import org.gatein.api.portal.Site;
import org.gatein.api.util.Type;
import org.gatein.portal.api.impl.util.GateInTypesResolver;
-import org.testng.annotations.Test;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
-public class SiteTestCase
+public class SiteTestCase extends TestCase
{
- @Test
- public void checkThatTypesAreProperlyResolvedEvenIfClassIsNotLoaded()
+ public void testCheckThatTypesAreProperlyResolvedEvenIfClassIsNotLoaded()
{
Type portal = GateInTypesResolver.forName("portal", Site.class);
assert portal != null;
}
- @Test
- public void getAPITypeShouldProperlyResolve()
+ public void testGetAPITypeShouldProperlyResolve()
{
assert Site.DASHBOARD.equals(SiteImpl.getAPITypeFrom(new PageKey(SiteType.USER.getName(), "foo", "foo")));
assert Site.GROUP.equals(SiteImpl.getAPITypeFrom(new PageKey(SiteType.GROUP.getName(), "foo", "foo")));
Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollectionTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollectionTestCase.java 2011-08-31 22:02:22 UTC (rev 7268)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollectionTestCase.java 2011-08-31 22:32:32 UTC (rev 7269)
@@ -22,18 +22,6 @@
package org.gatein.portal.api.impl.util;
-import org.gatein.api.id.Id;
-import org.gatein.api.id.Identifiable;
-import org.gatein.api.util.IterableIdentifiableCollection;
-import org.gatein.portal.api.impl.GateInImpl;
-import org.gatein.portal.api.impl.IdentifiableImpl;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.NoSuchElementException;
-
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class AggregatedIterableIdentifiableCollectionTestCase
{
13 years, 3 months
gatein SVN: r7268 - in portal/branches/api: component/api-impl and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-08-31 18:02:22 -0400 (Wed, 31 Aug 2011)
New Revision: 7268
Modified:
portal/branches/api/component/api-impl/pom.xml
portal/branches/api/packaging/jboss-as5/pkg/pom.xml
portal/branches/api/packaging/jboss-as6/pkg/pom.xml
portal/branches/api/packaging/jetty/pkg/pom.xml
portal/branches/api/packaging/tomcat/pkg/pom.xml
portal/branches/api/pom.xml
Log:
we shall use the same group id as it will make release easier to perform
Modified: portal/branches/api/component/api-impl/pom.xml
===================================================================
--- portal/branches/api/component/api-impl/pom.xml 2011-08-31 21:46:45 UTC (rev 7267)
+++ portal/branches/api/component/api-impl/pom.xml 2011-08-31 22:02:22 UTC (rev 7268)
@@ -7,11 +7,12 @@
<groupId>org.exoplatform.portal</groupId>
<version>3.2.0-M02-SNAPSHOT</version>
</parent>
+
<modelVersion>4.0.0</modelVersion>
+ <artifactId>exo.portal.component.api</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn Portal Component API implementation</name>
- <groupId>org.gatein.api</groupId>
- <artifactId>java-api-impl</artifactId>
-
<dependencies>
<dependency>
<groupId>org.gatein.api</groupId>
@@ -70,8 +71,4 @@
</dependency>
</dependencies>
- <build>
- <finalName>gatein-java-api-impl-${project.version}</finalName>
- </build>
-
</project>
\ No newline at end of file
Modified: portal/branches/api/packaging/jboss-as5/pkg/pom.xml
===================================================================
--- portal/branches/api/packaging/jboss-as5/pkg/pom.xml 2011-08-31 21:46:45 UTC (rev 7267)
+++ portal/branches/api/packaging/jboss-as5/pkg/pom.xml 2011-08-31 22:02:22 UTC (rev 7268)
@@ -297,8 +297,8 @@
<!-- GateIn API -->
<dependency>
- <groupId>org.gatein.api</groupId>
- <artifactId>java-api-impl</artifactId>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.api</artifactId>
</dependency>
<dependency>
<groupId>org.gatein.api</groupId>
Modified: portal/branches/api/packaging/jboss-as6/pkg/pom.xml
===================================================================
--- portal/branches/api/packaging/jboss-as6/pkg/pom.xml 2011-08-31 21:46:45 UTC (rev 7267)
+++ portal/branches/api/packaging/jboss-as6/pkg/pom.xml 2011-08-31 22:02:22 UTC (rev 7268)
@@ -341,8 +341,8 @@
<!-- GateIn API -->
<dependency>
- <groupId>org.gatein.api</groupId>
- <artifactId>java-api-impl</artifactId>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.api</artifactId>
</dependency>
<dependency>
<groupId>org.gatein.api</groupId>
Modified: portal/branches/api/packaging/jetty/pkg/pom.xml
===================================================================
--- portal/branches/api/packaging/jetty/pkg/pom.xml 2011-08-31 21:46:45 UTC (rev 7267)
+++ portal/branches/api/packaging/jetty/pkg/pom.xml 2011-08-31 22:02:22 UTC (rev 7268)
@@ -336,8 +336,8 @@
<!-- GateIn API -->
<dependency>
- <groupId>org.gatein.api</groupId>
- <artifactId>java-api-impl</artifactId>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.api</artifactId>
</dependency>
<dependency>
<groupId>org.gatein.api</groupId>
Modified: portal/branches/api/packaging/tomcat/pkg/pom.xml
===================================================================
--- portal/branches/api/packaging/tomcat/pkg/pom.xml 2011-08-31 21:46:45 UTC (rev 7267)
+++ portal/branches/api/packaging/tomcat/pkg/pom.xml 2011-08-31 22:02:22 UTC (rev 7268)
@@ -328,8 +328,8 @@
<!-- GateIn API -->
<dependency>
- <groupId>org.gatein.api</groupId>
- <artifactId>java-api-impl</artifactId>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.api</artifactId>
</dependency>
<dependency>
<groupId>org.gatein.api</groupId>
Modified: portal/branches/api/pom.xml
===================================================================
--- portal/branches/api/pom.xml 2011-08-31 21:46:45 UTC (rev 7267)
+++ portal/branches/api/pom.xml 2011-08-31 22:02:22 UTC (rev 7268)
@@ -403,11 +403,6 @@
<artifactId>gatein-java-api</artifactId>
<version>${org.gatein.api.version}</version>
</dependency>
- <dependency>
- <groupId>org.gatein.api</groupId>
- <artifactId>java-api-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
<!-- GateIn -->
<dependency>
@@ -494,6 +489,11 @@
</dependency>
<dependency>
<groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.api</artifactId>
+ <version>3.2.0-M02-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.webui.framework</artifactId>
<version>3.2.0-M02-SNAPSHOT</version>
</dependency>
13 years, 3 months
gatein SVN: r7267 - in portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl: portal and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-08-31 17:46:45 -0400 (Wed, 31 Aug 2011)
New Revision: 7267
Added:
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java
Modified:
portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java
Log:
abstract unit test
Added: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java (rev 0)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/AbstractAPITestCase.java 2011-08-31 21:46:45 UTC (rev 7267)
@@ -0,0 +1,57 @@
+package org.gatein.portal.api.impl;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.AbstractPortalTest;
+import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.data.ModelDataStorage;
+import org.exoplatform.web.application.RequestContext;
+import org.gatein.api.GateIn;
+
+/** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
+public class AbstractAPITestCase extends AbstractPortalTest
+{
+
+ /** . */
+ protected POMSessionManager mgr;
+
+ /** . */
+ protected NavigationService navService;
+
+ /** . */
+ protected ModelDataStorage storage;
+
+ /** . */
+ protected GateIn gatein;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ //
+ PortalContainer container = getContainer();
+ POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ NavigationService navService = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ GateInImpl gatein = new GateInImpl(container.getContext(), null, null, null);
+
+ //
+ gatein.start();
+
+ // Clear the cache for each test
+ // navService.clearCache();
+
+ //
+ this.gatein = gatein;
+ this.mgr = mgr;
+ this.navService = navService;
+ this.storage = (ModelDataStorage)container.getComponentInstanceOfType(ModelDataStorage.class);
+
+ //
+ begin();
+
+ //
+ RequestContext.setCurrentInstance(new SimpleRequestContext(null));
+ }
+
+}
Modified: portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java
===================================================================
--- portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java 2011-08-31 19:22:42 UTC (rev 7266)
+++ portal/branches/api/component/api-impl/src/test/java/org/gatein/portal/api/impl/portal/NavigationTestCase.java 2011-08-31 21:46:45 UTC (rev 7267)
@@ -22,6 +22,7 @@
import org.gatein.api.portal.Navigation;
import org.gatein.api.portal.Page;
import org.gatein.api.portal.Site;
+import org.gatein.portal.api.impl.AbstractAPITestCase;
import org.gatein.portal.api.impl.GateInImpl;
import org.gatein.portal.api.impl.SimpleRequestContext;
@@ -34,51 +35,9 @@
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration.xml")
})
-public class NavigationTestCase extends AbstractPortalTest
+public class NavigationTestCase extends AbstractAPITestCase
{
- /** . */
- protected POMSessionManager mgr;
-
- /** . */
- protected NavigationService navService;
-
- /** . */
- protected ModelDataStorage storage;
-
- /** . */
- protected GateIn gatein;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- //
- PortalContainer container = getContainer();
- POMSessionManager mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- NavigationService navService = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
- GateInImpl gatein = new GateInImpl(container.getContext(), null, null, null);
-
- //
- gatein.start();
-
- // Clear the cache for each test
- // navService.clearCache();
-
- //
- this.gatein = gatein;
- this.mgr = mgr;
- this.navService = navService;
- this.storage = (ModelDataStorage)container.getComponentInstanceOfType(ModelDataStorage.class);
-
- //
- begin();
-
- //
- RequestContext.setCurrentInstance(new SimpleRequestContext(null));
- }
-
private NodeContext createSite(SiteType type, String name)
{
try
13 years, 3 months
gatein SVN: r7266 - in components/wsrp/trunk: wsrp-producer-war and 3 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-08-31 15:22:42 -0400 (Wed, 31 Aug 2011)
New Revision: 7266
Modified:
components/wsrp/trunk/pom.xml
components/wsrp/trunk/wsrp-producer-war/pom.xml
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-producer.xml
components/wsrp/trunk/wsrp-producer-war/src/test/producer-sar/portlet-container.war/WEB-INF/jboss-beans.xml
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-basic-portlet-war/WEB-INF/portlet.xml
Log:
- Updated to PC 2.3.0-Beta05: removed dependency on pc-mc, fixed ordering of elements in portlet.xml as new staxnav parsing will silently discard out of order elements.
Modified: components/wsrp/trunk/pom.xml
===================================================================
--- components/wsrp/trunk/pom.xml 2011-08-31 18:27:04 UTC (rev 7265)
+++ components/wsrp/trunk/pom.xml 2011-08-31 19:22:42 UTC (rev 7266)
@@ -21,7 +21,8 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -46,7 +47,7 @@
</scm>
<properties>
- <org.gatein.pc.version>2.3.0-Beta03</org.gatein.pc.version>
+ <org.gatein.pc.version>2.3.0-Beta05</org.gatein.pc.version>
<org.gatein.common.version>2.0.4-Beta02</org.gatein.common.version>
<org.gatein.wci.version>2.1.0-Beta01</org.gatein.wci.version>
Modified: components/wsrp/trunk/wsrp-producer-war/pom.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/pom.xml 2011-08-31 18:27:04 UTC (rev 7265)
+++ components/wsrp/trunk/wsrp-producer-war/pom.xml 2011-08-31 19:22:42 UTC (rev 7266)
@@ -22,7 +22,8 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
@@ -328,11 +329,12 @@
<scope>test</scope>
<version>${org.gatein.pc.version}</version>
</dependency>
+ <!-- Staxnav needed for PC -->
<dependency>
- <groupId>org.gatein.pc</groupId>
- <artifactId>pc-mc</artifactId>
+ <groupId>org.staxnav</groupId>
+ <artifactId>staxnav.core</artifactId>
+ <version>0.9.4</version>
<scope>test</scope>
- <version>${org.gatein.pc.version}</version>
</dependency>
<dependency>
Modified: components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-producer.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-producer.xml 2011-08-31 18:27:04 UTC (rev 7265)
+++ components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-producer.xml 2011-08-31 19:22:42 UTC (rev 7266)
@@ -1,3 +1,26 @@
+<!--
+ ~ 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.
+ -->
+
<assembly>
<id>producer</id>
<formats>
@@ -46,7 +69,7 @@
<include>javax.portlet:portlet-api</include>
<include>org.gatein.pc:pc-controller</include>
- <include>org.gatein.pc:pc-mc</include>
+ <include>org.staxnav:staxnav.core</include>
<include>org.gatein.common:common-common</include>
<include>org.gatein.common:common-logging</include>
Modified: components/wsrp/trunk/wsrp-producer-war/src/test/producer-sar/portlet-container.war/WEB-INF/jboss-beans.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/producer-sar/portlet-container.war/WEB-INF/jboss-beans.xml 2011-08-31 18:27:04 UTC (rev 7265)
+++ components/wsrp/trunk/wsrp-producer-war/src/test/producer-sar/portlet-container.war/WEB-INF/jboss-beans.xml 2011-08-31 19:22:42 UTC (rev 7266)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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,7 +23,7 @@
-->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="PortletApplicationDeployer" class="org.gatein.pc.mc.PortletApplicationDeployer">
+ <bean name="PortletApplicationDeployer" class="org.gatein.pc.portlet.impl.deployment.PortletApplicationDeployer">
<alias>PortletApplicationRegistry</alias>
<property name="servletContainerFactory">
<inject bean="ServletContainerFactory"/>
Modified: components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-basic-portlet-war/WEB-INF/portlet.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-basic-portlet-war/WEB-INF/portlet.xml 2011-08-31 18:27:04 UTC (rev 7265)
+++ components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-basic-portlet-war/WEB-INF/portlet.xml 2011-08-31 19:22:42 UTC (rev 7266)
@@ -50,15 +50,15 @@
<value>prefValue2</value>
</preference>
</portlet-preferences>
+ <supported-processing-event>
+ <qname xmlns:jbp='urn:jboss:portal:samples:event'>jbp:ZipEvent</qname>
+ </supported-processing-event>
<supported-publishing-event>
<qname xmlns:jbp='urn:jboss:portal:samples:event'>jbp:ZipEvent</qname>
</supported-publishing-event>
<supported-publishing-event>
<qname xmlns:gtn='urn:jboss:gatein'>gtn:foo</qname>
</supported-publishing-event>
- <supported-processing-event>
- <qname xmlns:jbp='urn:jboss:portal:samples:event'>jbp:ZipEvent</qname>
- </supported-processing-event>
<supported-public-render-parameter>zipcode</supported-public-render-parameter>
<supported-public-render-parameter>foo</supported-public-render-parameter>
</portlet>
@@ -69,9 +69,9 @@
</event-definition>
<event-definition>
<qname xmlns:gtn='urn:jboss:gatein'>gtn:foo</qname>
- <value-type>java.lang.String</value-type>
<alias xmlns:gtn='urn:jboss:gatein'>gtn:bar</alias>
<alias xmlns:gtn='urn:jboss:gatein'>gtn:baz</alias>
+ <value-type>java.lang.String</value-type>
</event-definition>
<public-render-parameter>
@@ -79,9 +79,9 @@
<qname xmlns:g='urn:jboss:portal:simple:google'>g:zipcode</qname>
</public-render-parameter>
<public-render-parameter>
+ <description>Foo param</description>
<identifier>foo</identifier>
<qname xmlns:gtn='urn:jboss:gatein'>gtn:fooparam</qname>
- <description>Foo param</description>
<alias xmlns:gtn='urn:jboss:gatein'>gtn:barparam</alias>
<alias xmlns:gtn='urn:jboss:gatein'>gtn:bazparam</alias>
</public-render-parameter>
13 years, 3 months
gatein SVN: r7265 - in components/pc/trunk/portlet/src/test: resources/metadata/event and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-08-31 14:27:04 -0400 (Wed, 31 Aug 2011)
New Revision: 7265
Modified:
components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/EventTestEverythingTestCase.java
components/pc/trunk/portlet/src/test/resources/metadata/event/portlet-event2.xml
Log:
- Improved tests a little.
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/EventTestEverythingTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/EventTestEverythingTestCase.java 2011-08-31 16:06:32 UTC (rev 7264)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/portlet/deployment/EventTestEverythingTestCase.java 2011-08-31 18:27:04 UTC (rev 7265)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.gatein.pc.portlet.deployment;
+import java.util.List;
import java.util.Locale;
import javax.xml.namespace.QName;
@@ -66,7 +67,10 @@
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
- EventDefinitionMetaData emd = md.getEvents().get(0);
+ final List<EventDefinitionMetaData> eventDefinitions = md.getEvents();
+ assertEquals(2, eventDefinitions.size());
+
+ EventDefinitionMetaData emd = eventDefinitions.get(0);
QName qname = emd.getQname();
assertEquals("eventID", emd.getId());
assertEquals("http://example.com/testEvents", qname.getNamespaceURI());
@@ -77,11 +81,14 @@
assertEquals("descriptionDefaultLanguage", emd.getDescription().getString(new Locale("en"), false));
assertEquals("Beschreibung in Deutsch", emd.getDescription().getString(new Locale("de"), false));
- EventDefinitionMetaData emd2 = md.getEvents().get(1);
+ EventDefinitionMetaData emd2 = eventDefinitions.get(1);
assertNull(emd2.getQname());
assertEquals("hellouh", emd2.getName());
- assertEquals("hello", emd2.getAlias().get(0).getLocalPart());
+ final List<QName> aliases = emd2.getAlias();
+ assertEquals(2, aliases.size());
+ assertEquals("hello", aliases.get(0).getLocalPart());
+ assertEquals(new QName("http://example.com/testEvents", "helloWithNS"), aliases.get(1));
// portlet event reference testing
PortletMetaData p1 = md.getPortlet("Portlet2");
Modified: components/pc/trunk/portlet/src/test/resources/metadata/event/portlet-event2.xml
===================================================================
--- components/pc/trunk/portlet/src/test/resources/metadata/event/portlet-event2.xml 2011-08-31 16:06:32 UTC (rev 7264)
+++ components/pc/trunk/portlet/src/test/resources/metadata/event/portlet-event2.xml 2011-08-31 18:27:04 UTC (rev 7265)
@@ -64,6 +64,7 @@
<event-definition>
<name>hellouh</name>
<alias>hello</alias>
+ <alias xmlns:x='http://example.com/testEvents'>x:helloWithNS</alias>
</event-definition>
</portlet-app>
\ No newline at end of file
13 years, 3 months
gatein SVN: r7264 - epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-08-31 12:06:32 -0400 (Wed, 31 Aug 2011)
New Revision: 7264
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
Log:
JBEPP-1051: merge in patch from GTNPORTAL-2035 to fix infinite scroll in portal user permissions.
Modified: epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2011-08-31 15:24:39 UTC (rev 7263)
+++ epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2011-08-31 16:06:32 UTC (rev 7264)
@@ -127,8 +127,15 @@
maskLayer.className = "MaskLayer" ;
maskLayer.id = "MaskLayer" ;
maskLayer.maxZIndex = eXo.webui.UIPopup.zIndex + 1; //3 ;
+ var offsetParent = maskLayer.offsetParent;
+ if (offsetParent && eXo.core.Browser.findPosX(offsetParent) != 0
+ && eXo.core.Browser.findPosY(offsetParent) != 0) {
+ maskLayer.style.width = offsetParent.offsetWidth + "px";
+ maskLayer.style.height = offsetParent.offsetHeight + "px";
+ } else {
maskLayer.style.width = Browser.getBrowserWidth() + "px";
maskLayer.style.height = Browser.getBrowserHeight() + "px";
+ }
maskLayer.style.top = "0px" ;
maskLayer.style.left = "0px" ;
maskLayer.style.zIndex = maskLayer.maxZIndex ;
@@ -221,8 +228,14 @@
*/
UIMaskLayer.prototype.doScroll = function() {
- if(document.getElementById("MaskLayer")) {
var maskLayer = document.getElementById("MaskLayer") ;
+ if(maskLayer) {
+ var offsetParent = maskLayer.offsetParent;
+ if (offsetParent && eXo.core.Browser.findPosX(offsetParent) != 0
+ || eXo.core.Browser.findPosY(offsetParent) != 0) {
+ maskLayer = document.getElementById("subMaskLayer");
+ if (!maskLayer) return;
+ }
if(document.documentElement && document.documentElement.scrollTop) {
maskLayer.style.top = document.documentElement.scrollTop + "px" ;
} else {
@@ -244,6 +257,13 @@
var UIMaskLayer = eXo.core.UIMaskLayer ;
var Browser = eXo.core.Browser ;
var object = UIMaskLayer.object ;
+ if (object && object.previousSibling) {
+ var offsetParent = object.previousSibling.offsetParent;
+ if (offsetParent && (eXo.core.Browser.findPosX(offsetParent) != 0
+ || eXo.core.Browser.findPosY(offsetParent) != 0)) {
+ eXo.portal.UIMaskWorkspace.resetPosition();
+ }
+ }
var blockContainer = UIMaskLayer.blockContainer ;
var position = UIMaskLayer.position ;
object.style.position = "absolute" ;
@@ -271,6 +291,9 @@
left = (blockContainer.offsetWidth - object.offsetWidth) / 2 ;
top = (Browser.getBrowserHeight() - object.offsetHeight) / 2 + topPos ;
}
+ if ((top + object.offsetHeight) > topPos + Browser.getBrowserHeight()) {
+ top = topPos + Browser.getBrowserHeight() - object.offsetHeight;
+ }
object.style.left = left + "px" ;
object.style.top = top + "px" ;
@@ -309,6 +332,17 @@
UIMaskLayer.prototype.resizeMaskLayer = function() {
var maskLayer = document.getElementById("MaskLayer");
if (maskLayer) {
+ var offsetParent = maskLayer.offsetParent;
+ if (offsetParent && (eXo.core.Browser.findPosX(offsetParent) != 0
+ || eXo.core.Browser.findPosY(offsetParent) != 0)) {
+ maskLayer = document.getElementById("subMaskLayer");
+ if (!maskLayer) return;
+ offsetParent = maskLayer.offsetParent;
+ }
+ }
+
+ if (maskLayer && offsetParent && eXo.core.Browser.findPosX(offsetParent) == 0
+ && eXo.core.Browser.findPosY(offsetParent) == 0) {
maskLayer.style.width = eXo.core.Browser.getBrowserWidth() + "px";
maskLayer.style.height = eXo.core.Browser.getBrowserHeight() + "px";
}
13 years, 3 months
gatein SVN: r7263 - in epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal: webui/page and 1 other directory.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-08-31 11:24:39 -0400 (Wed, 31 Aug 2011)
New Revision: 7263
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
Log:
JBEPP-1106: merge in patch from GTNPORTAL-2040 (r7620). Protected portals now redirect to login page instead of 404.
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2011-08-31 12:39:59 UTC (rev 7262)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2011-08-31 15:24:39 UTC (rev 7263)
@@ -101,6 +101,8 @@
final static public String REQUEST_METADATA = "portal:requestMetadata".intern();
final static private String LAST_PORTAL_NAME = "prc.lastPortalName";
+
+ final static private String DO_LOGIN_PATTERN = "dologin";
/** The path decoded from the request. */
private final String nodePath_;
@@ -329,6 +331,12 @@
appRes_ = getApplication().getResourceBundle(getLocale());
}
+ public void requestAuthenticationLogin() throws Exception
+ {
+ String doLoginPath = request_.getContextPath() + "/" + DO_LOGIN_PATTERN + "?initialURI=" + request_.getRequestURI();
+ sendRedirect(doLoginPath);
+ }
+
public String getTitle() throws Exception
{
String title = (String)request_.getAttribute(REQUEST_TITLE);
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java 2011-08-31 12:39:59 UTC (rev 7262)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java 2011-08-31 15:24:39 UTC (rev 7263)
@@ -21,7 +21,10 @@
import org.exoplatform.commons.utils.I18N;
import org.exoplatform.commons.utils.Safe;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.StaleModelException;
+import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.web.ControllerContext;
@@ -130,7 +133,20 @@
PortalRequestContext context = new PortalRequestContext(app, controllerContext, requestSiteType, requestSiteName, requestPath, requestLocale);
if (context.getUserPortalConfig() == null)
{
- context.sendError(HttpServletResponse.SC_NOT_FOUND);
+ DataStorage storage = (DataStorage)PortalContainer.getComponent(DataStorage.class);
+ PortalConfig persistentPortalConfig = storage.getPortalConfig(requestSiteType, requestSiteName);
+ if (persistentPortalConfig == null)
+ {
+ context.sendError(HttpServletResponse.SC_NOT_FOUND);
+ }
+ else if(req.getRemoteUser() == null)
+ {
+ context.requestAuthenticationLogin();
+ }
+ else
+ {
+ context.sendError(HttpServletResponse.SC_FORBIDDEN);
+ }
}
else
{
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2011-08-31 12:39:59 UTC (rev 7262)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2011-08-31 15:24:39 UTC (rev 7263)
@@ -87,8 +87,7 @@
if (targetNode != null)
{
uiPortalApp.setLastRequestURI(null);
- String doLoginPath = pcontext.getRequest().getContextPath() + "/dologin?initialURI=" + pcontext.getRequestURI();
- pcontext.sendRedirect(doLoginPath);
+ pcontext.requestAuthenticationLogin();
return;
}
}
13 years, 3 months
gatein SVN: r7262 - in portal/trunk: component/portal/src/main/java/org/exoplatform/portal/mop/navigation and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2011-08-31 08:39:59 -0400 (Wed, 31 Aug 2011)
New Revision: 7262
Added:
portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport0-configuration.xml
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NavigationServiceImpl.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java
portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
Log:
GTNPORTAL-2054 : Navigation default import mode should be configurable for component plugins and set by default to merge
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-08-31 10:33:33 UTC (rev 7261)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2011-08-31 12:39:59 UTC (rev 7262)
@@ -40,7 +40,6 @@
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.UnmarshalledObject;
-import org.exoplatform.portal.config.model.Version;
import org.exoplatform.portal.mop.description.DescriptionService;
import org.exoplatform.portal.mop.navigation.NavigationService;
import org.exoplatform.portal.pom.config.POMSession;
@@ -70,6 +69,9 @@
{
/** . */
+ private final UserPortalConfigService owner_;
+
+ /** . */
private ConfigurationManager cmanager_;
/** . */
@@ -115,6 +117,7 @@
private DescriptionService descriptionService_;
public NewPortalConfigListener(
+ UserPortalConfigService owner,
POMSessionManager pomMgr,
DataStorage dataStorage,
ConfigurationManager cmanager,
@@ -123,6 +126,7 @@
DescriptionService descriptionService)
throws Exception
{
+ owner_ = owner;
cmanager_ = cmanager;
dataStorage_ = dataStorage;
navigationService_ = navigationService;
@@ -538,7 +542,6 @@
//
PageNavigation navigation = obj.getObject();
- boolean extendedNavigation = obj.getVersion() == Version.V_1_2;
//
ImportMode importMode;
@@ -548,7 +551,7 @@
}
else
{
- importMode = ImportMode.CONSERVE;
+ importMode = owner_.getDefaultImportMode();
}
//
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2011-08-31 10:33:33 UTC (rev 7261)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2011-08-31 12:39:59 UTC (rev 7262)
@@ -32,6 +32,7 @@
import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.mop.description.DescriptionService;
+import org.exoplatform.portal.mop.importer.ImportMode;
import org.exoplatform.portal.mop.navigation.NavigationContext;
import org.exoplatform.portal.mop.navigation.NavigationService;
import org.exoplatform.portal.mop.navigation.NavigationState;
@@ -72,6 +73,9 @@
/** . */
boolean destroyUserPortal;
+ /** . */
+ private final ImportMode defaultImportMode;
+
private Log log = ExoLogger.getLogger("Portal:UserPortalConfigService");
public UserPortalConfigService(
@@ -92,6 +96,10 @@
boolean destroyUserPortal = destroyUserPortalParam == null || destroyUserPortalParam.getValue().toLowerCase().trim().equals("true");
//
+ ValueParam defaultImportModeParam = params == null ? null : params.getValueParam("default.import.mode");
+ ImportMode defaultImportMode = defaultImportModeParam == null ? ImportMode.CONSERVE : ImportMode.valueOf(defaultImportModeParam.getValue().toUpperCase().trim());
+
+ //
this.storage_ = storage;
this.orgService_ = orgService;
this.userACL_ = userACL;
@@ -99,8 +107,14 @@
this.descriptionService = descriptionService;
this.createUserPortal = createUserPortal;
this.destroyUserPortal = destroyUserPortal;
+ this.defaultImportMode = defaultImportMode;
}
+ public ImportMode getDefaultImportMode()
+ {
+ return defaultImportMode;
+ }
+
public boolean getCreateUserPortal()
{
return createUserPortal;
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NavigationServiceImpl.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NavigationServiceImpl.java 2011-08-31 10:33:33 UTC (rev 7261)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/navigation/NavigationServiceImpl.java 2011-08-31 12:39:59 UTC (rev 7262)
@@ -195,15 +195,15 @@
{
if (model == null)
{
- throw new NullPointerException();
+ throw new NullPointerException("No null model accepted");
}
if (navigation == null)
{
- throw new NullPointerException();
+ throw new NullPointerException("No null navigation accepted");
}
if (scope == null)
{
- throw new NullPointerException();
+ throw new NullPointerException("No null scope accepted");
}
String nodeId = navigation.data.rootId;
if (navigation.data.rootId != null)
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java 2011-08-31 10:33:33 UTC (rev 7261)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestImport.java 2011-08-31 12:39:59 UTC (rev 7262)
@@ -24,10 +24,19 @@
import org.exoplatform.component.test.KernelBootstrap;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.importer.Imported;
+import org.exoplatform.portal.mop.navigation.NavigationContext;
+import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.mop.navigation.Node;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+import org.exoplatform.portal.mop.navigation.Scope;
import org.exoplatform.portal.pom.config.POMSessionManager;
import org.gatein.mop.api.workspace.Workspace;
+import java.io.File;
+import java.util.Collection;
+
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
*/
@@ -59,4 +68,35 @@
RequestLifeCycle.end();
bootstrap.dispose();
}
+
+ public void testDefaultMode() throws Exception
+ {
+ KernelBootstrap bootstrap = new KernelBootstrap();
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.test.jcr-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.identity-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "conf/exo.portal.component.portal-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport0-configuration.xml");
+ bootstrap.addConfiguration(ContainerScope.PORTAL, "org/exoplatform/portal/config/TestImport1-configuration.xml");
+ System.setProperty("import.portal.0", "navigation2");
+ System.setProperty("override.1", "false");
+ System.setProperty("import.mode.1", "merge");
+ System.setProperty("import.portal.1", "navigation1");
+
+ //
+ bootstrap.boot();
+
+ //
+ PortalContainer container = bootstrap.getContainer();
+ NavigationService service = (NavigationService)container.getComponentInstanceOfType(NavigationService.class);
+ RequestLifeCycle.begin(container);
+ NavigationContext nav = service.loadNavigation(SiteKey.portal("classic"));
+ NodeContext<Node> root = service.loadNode(Node.MODEL, nav, Scope.ALL, null);
+ Collection<Node> c = root.getNodes();
+ assertEquals(3, c.size());
+ assertNotNull(root.get("foo"));
+ assertNotNull(root.get("daa"));
+ assertNotNull(root.get("bar"));
+ RequestLifeCycle.end();
+ bootstrap.dispose();
+ }
}
Modified: portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration.xml 2011-08-31 10:33:33 UTC (rev 7261)
+++ portal/trunk/component/portal/src/test/resources/conf/exo.portal.component.portal-configuration.xml 2011-08-31 12:39:59 UTC (rev 7262)
@@ -119,6 +119,12 @@
<component>
<key>org.exoplatform.portal.config.UserPortalConfigService</key>
<type>org.exoplatform.portal.config.UserPortalConfigService</type>
+ <init-params>
+ <value-param>
+ <name>default.import.mode</name>
+ <value>merge</value>
+ </value-param>
+ </init-params>
</component>
<external-component-plugins>
Added: portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport0-configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport0-configuration.xml (rev 0)
+++ portal/trunk/component/portal/src/test/resources/org/exoplatform/portal/config/TestImport0-configuration.xml 2011-08-31 12:39:59 UTC (rev 7262)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 eXo Platform SAS.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <priority>1</priority>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <value>classic</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>classic</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>portal</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/portal/config/${import.portal.0}-conf</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-08-31 10:33:33 UTC (rev 7261)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-08-31 12:39:59 UTC (rev 7262)
@@ -226,6 +226,10 @@
<name>destroy.user.portal</name>
<value>${gatein.portal.idm.destroyserportal}</value>
</value-param>
+ <value-param>
+ <name>default.import.mode</name>
+ <value>merge</value>
+ </value-param>
</init-params>
</component>
13 years, 3 months
gatein SVN: r7261 - epp/portal/branches/EPP_5_1_RH_Branch/component/web/security/src/main/java/org/exoplatform/web/login.
by do-not-reply@jboss.org
Author: mputz
Date: 2011-08-31 06:33:33 -0400 (Wed, 31 Aug 2011)
New Revision: 7261
Modified:
epp/portal/branches/EPP_5_1_RH_Branch/component/web/security/src/main/java/org/exoplatform/web/login/ErrorLoginServlet.java
Log:
GTNPORTAL-1348 Login page then username or password is incorrect shown as JSP source code.
Modified: epp/portal/branches/EPP_5_1_RH_Branch/component/web/security/src/main/java/org/exoplatform/web/login/ErrorLoginServlet.java
===================================================================
--- epp/portal/branches/EPP_5_1_RH_Branch/component/web/security/src/main/java/org/exoplatform/web/login/ErrorLoginServlet.java 2011-08-31 09:41:08 UTC (rev 7260)
+++ epp/portal/branches/EPP_5_1_RH_Branch/component/web/security/src/main/java/org/exoplatform/web/login/ErrorLoginServlet.java 2011-08-31 10:33:33 UTC (rev 7261)
@@ -65,6 +65,11 @@
unregisterTokenCookie(req);
// Clear the token cookie
clearTokenCookie(req, resp);
+
+ //nguyenanhkien2a(a)gmail.com: We set content-type here for using RequestDispatcher.include() method below
+ //We can't use RequestDispatcher.forward() if we want to use some response information for output such as clearing cookies, etc
+ resp.setContentType("text/html; charset=UTF-8");
+
// This allows the customer to define another login page without changing the portal
context.getRequestDispatcher("/login/jsp/login.jsp").include(req, resp);
}
13 years, 3 months
gatein SVN: r7260 - in portal/trunk/webui/portal/src/main/java/org/exoplatform/portal: webui/page and 1 other directory.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-08-31 05:41:08 -0400 (Wed, 31 Aug 2011)
New Revision: 7260
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
Log:
GTNPORTAL-2040 Cannot access portal if the permission is not 'public'
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2011-08-31 06:57:26 UTC (rev 7259)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2011-08-31 09:41:08 UTC (rev 7260)
@@ -101,6 +101,8 @@
final static public String REQUEST_METADATA = "portal:requestMetadata".intern();
final static private String LAST_PORTAL_NAME = "prc.lastPortalName";
+
+ final static private String DO_LOGIN_PATTERN = "dologin";
/** The path decoded from the request. */
private final String nodePath_;
@@ -331,6 +333,12 @@
appRes_ = getApplication().getResourceBundle(getLocale());
}
+ public void requestAuthenticationLogin() throws Exception
+ {
+ String doLoginPath = request_.getContextPath() + "/" + DO_LOGIN_PATTERN + "?initialURI=" + request_.getRequestURI();
+ sendRedirect(doLoginPath);
+ }
+
public String getTitle() throws Exception
{
String title = (String)request_.getAttribute(REQUEST_TITLE);
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java 2011-08-31 06:57:26 UTC (rev 7259)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java 2011-08-31 09:41:08 UTC (rev 7260)
@@ -21,7 +21,10 @@
import org.exoplatform.commons.utils.I18N;
import org.exoplatform.commons.utils.Safe;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.StaleModelException;
+import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.web.ControllerContext;
@@ -130,7 +133,20 @@
PortalRequestContext context = new PortalRequestContext(app, controllerContext, requestSiteType, requestSiteName, requestPath, requestLocale);
if (context.getUserPortalConfig() == null)
{
- context.sendError(HttpServletResponse.SC_NOT_FOUND);
+ DataStorage storage = (DataStorage)PortalContainer.getComponent(DataStorage.class);
+ PortalConfig persistentPortalConfig = storage.getPortalConfig(requestSiteType, requestSiteName);
+ if (persistentPortalConfig == null)
+ {
+ context.sendError(HttpServletResponse.SC_NOT_FOUND);
+ }
+ else if(req.getRemoteUser() == null)
+ {
+ context.requestAuthenticationLogin();
+ }
+ else
+ {
+ context.sendError(HttpServletResponse.SC_FORBIDDEN);
+ }
}
else
{
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2011-08-31 06:57:26 UTC (rev 7259)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2011-08-31 09:41:08 UTC (rev 7260)
@@ -87,8 +87,7 @@
if (targetNode != null)
{
uiPortalApp.setLastRequestURI(null);
- String doLoginPath = pcontext.getRequest().getContextPath() + "/dologin?initialURI=" + pcontext.getRequestURI();
- pcontext.sendRedirect(doLoginPath);
+ pcontext.requestAuthenticationLogin();
return;
}
}
13 years, 3 months