gatein SVN: r6174 - components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-04-07 11:02:19 -0400 (Thu, 07 Apr 2011)
New Revision: 6174
Modified:
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
Log:
- GTNPC-58: Use constants and change portlet id value so that it passes PortletContext validation.
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2011-04-07 14:27:35 UTC (rev 6173)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2011-04-07 15:02:19 UTC (rev 6174)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.pc.test.portlet.state;
import org.gatein.common.util.Tools;
@@ -65,6 +65,9 @@
*/
public abstract class AbstractStatefulPortletInvokerTestCase
{
+ public static final String PORTLET_ID = "/foo.PortletId";
+ public static final String NON_EXISTING_PORTLET_ID = "/foo.NonExistingPortletId";
+ public static final String INVALID_PORTLET_ID = "/foo.InvalidPortletId";
/** . */
protected final boolean persistLocally;
@@ -472,7 +475,7 @@
// @Test
// public void testDestroyInvalidCCP() throws Exception
// {
-// PortletContext ccpId = getProducer().wrapCCP("PortletId");
+// PortletContext ccpId = getProducer().wrapCCP(PORTLET_ID);
// List failures = getProducer().destroyClones(Collections.singletonList(ccpId));
// assertEquals(1, failures.size());
// DestroyCloneFailure failure = (DestroyCloneFailure)failures.get(0);
@@ -1050,7 +1053,7 @@
PortletContext export0Ctx = exportPortletContext(popCtx);
//Make sure we get back the ID for the original portlet
- assertEquals("PortletId", export0Ctx.getId());
+ assertEquals(PORTLET_ID, export0Ctx.getId());
//check by doing an import
checkWithImportPortlet(export0Ctx, popCtx, new SimplePropertyMap());
@@ -1060,7 +1063,7 @@
PortletContext export1Ctx = exportPortletContext(popCtx);
//Make sure we get back the ID for the original portlet
- assertEquals("PortletId", export1Ctx.getId());
+ assertEquals(PORTLET_ID, export1Ctx.getId());
//check by doing an import
checkWithImportPortlet(export1Ctx, popCtx, expectedProperties);
@@ -1068,7 +1071,7 @@
PortletContext export2Ctx = exportPortletContext(ccp1Ctx);
//Make sure we get back the ID for the original portlet
- assertEquals("PortletId", export2Ctx.getId());
+ assertEquals(PORTLET_ID, export2Ctx.getId());
//Check by doing an import
checkWithImportPortlet(export2Ctx, ccp1Ctx, expectedProperties);
@@ -1083,7 +1086,7 @@
PortletContext export3Ctx = exportPortletContext(ccp2Ctx);
//Make sure we get back the ID for the original portlet
- assertEquals("PortletId", export3Ctx.getId());
+ assertEquals(PORTLET_ID, export3Ctx.getId());
//Check by doing an import
checkWithImportPortlet(export3Ctx, ccp2Ctx, expectedProperties);
}
@@ -1198,10 +1201,10 @@
StateConverter sc = new StateConverterV0();
PropertyMap propertyMap = new SimplePropertyMap();
propertyMap.setProperty("test", Arrays.asList("123"));
- PortletState portletState = new PortletState("PortletId", propertyMap);
+ PortletState portletState = new PortletState(PORTLET_ID, propertyMap);
byte[] stateBytes = sc.marshall(PortletStateType.OPAQUE, portletState);
- StatefulPortletContext portletContext = StatefulPortletContext.create("PortletId", PortletStateType.OPAQUE, stateBytes);
+ StatefulPortletContext portletContext = StatefulPortletContext.create(PORTLET_ID, PortletStateType.OPAQUE, stateBytes);
//import portlet
PortletContext importedPortletContext = importPortletContext(portletContext);
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2011-04-07 14:27:35 UTC (rev 6173)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2011-04-07 15:02:19 UTC (rev 6174)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.pc.test.portlet.state;
import org.gatein.pc.api.Portlet;
@@ -46,6 +46,7 @@
import org.gatein.pc.portlet.state.producer.ProducerPortlet;
import static org.jboss.unit.api.Assert.*;
+
import org.jboss.unit.api.pojo.annotations.Create;
import java.util.Collections;
@@ -58,7 +59,6 @@
*/
public class ConsumerStatefulPortletInvokerTestCase extends AbstractStatefulPortletInvokerTestCase
{
-
public ConsumerStatefulPortletInvokerTestCase(boolean persistLocally)
{
super(persistLocally);
@@ -137,24 +137,24 @@
protected PortletContext createPOPRef(PortletInfoSupport portletSupport) throws PortletInvokerException
{
- container.addPortlet("PortletId", portletSupport);
+ container.addPortlet(PORTLET_ID, portletSupport);
Portlet portlet = getSinglePOP();
return portlet.getContext();
}
protected PortletContext createNonExistingPOPRef() throws PortletInvokerException
{
- container.addPortlet("NonExistingPortletId", new PortletInfoSupport());
+ container.addPortlet(NON_EXISTING_PORTLET_ID, new PortletInfoSupport());
PortletContext popContext = getSinglePOP().getContext();
- container.removePortlet("NonExistingPortletId");
+ container.removePortlet(NON_EXISTING_PORTLET_ID);
return popContext;
}
protected PortletContext createInvalidPOPRef() throws PortletInvokerException
{
- container.addPortlet("InvalidPortletId", new PortletInfoSupport());
+ container.addPortlet(INVALID_PORTLET_ID, new PortletInfoSupport());
PortletContext popContext = getSinglePOP().getContext();
- container.setValid("InvalidPortletId", false);
+ container.setValid(INVALID_PORTLET_ID, false);
return popContext;
}
@@ -252,12 +252,12 @@
assertEquals(1, portlets.size());
return (Portlet)portlets.iterator().next();
}
-
+
protected PortletContext importPortletContext(PortletContext contextToImport) throws PortletInvokerException
{
return consumer.importPortlet(PortletStateType.OPAQUE, contextToImport);
}
-
+
protected PortletContext exportPortletContext(PortletContext originalPortletContext) throws PortletInvokerException
{
return consumer.exportPortlet(PortletStateType.OPAQUE, originalPortletContext);
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2011-04-07 14:27:35 UTC (rev 6173)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2011-04-07 15:02:19 UTC (rev 6174)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, 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. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.pc.test.portlet.state;
import org.gatein.pc.api.Portlet;
@@ -104,24 +104,24 @@
protected PortletContext createPOPRef(PortletInfoSupport portletSupport) throws PortletInvokerException
{
- container.addPortlet("PortletId", portletSupport);
+ container.addPortlet(PORTLET_ID, portletSupport);
Portlet portlet = getSinglePOP();
return portlet.getContext();
}
protected PortletContext createNonExistingPOPRef()
{
- container.addPortlet("NonExistingPortletId", new PortletInfoSupport());
+ container.addPortlet(NON_EXISTING_PORTLET_ID, new PortletInfoSupport());
PortletContext popCtx = getSinglePOP().getContext();
- container.removePortlet("NonExistingPortletId");
+ container.removePortlet(NON_EXISTING_PORTLET_ID);
return popCtx;
}
protected PortletContext createInvalidPOPRef()
{
- container.addPortlet("InvalidPortletId", new PortletInfoSupport());
+ container.addPortlet(INVALID_PORTLET_ID, new PortletInfoSupport());
PortletContext popCtx = getSinglePOP().getContext();
- container.setValid("InvalidPortletId", false);
+ container.setValid(INVALID_PORTLET_ID, false);
return popCtx;
}
13 years, 9 months
gatein SVN: r6173 - components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-04-07 10:27:35 -0400 (Thu, 07 Apr 2011)
New Revision: 6173
Modified:
components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
Log:
- GTNPC-58: Make code compile. :(
Modified: components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
===================================================================
--- components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2011-04-07 12:47:22 UTC (rev 6172)
+++ components/pc/trunk/portlet/src/test/java/org/gatein/pc/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2011-04-07 14:27:35 UTC (rev 6173)
@@ -49,6 +49,7 @@
import org.gatein.pc.portlet.state.producer.PortletState;
import static org.jboss.unit.api.Assert.*;
+
import org.jboss.unit.api.pojo.annotations.Test;
import java.util.Collections;
@@ -172,18 +173,18 @@
*
*/
protected abstract void addPreference(PortletContext popRef, String key, List<String> defaultValue, Boolean readOnly);
-
+
/**
- *
+ *
*/
protected abstract PortletContext exportPortletContext(PortletContext contextToImport) throws PortletInvokerException;
-
+
/**
*
*/
protected abstract PortletContext importPortletContext(PortletContext contextToImport) throws PortletInvokerException;
-
+
/**
*
*/
@@ -769,15 +770,15 @@
//
PropertyChange[] changes = new PropertyChange[]
- {
- PropertyChange.newUpdate("override_update", Arrays.asList("override_update_clone_value_2")),
- PropertyChange.newReset("override_reset"),
- PropertyChange.newUpdate("override_create", Arrays.asList("override_create_clone_value_2")),
- PropertyChange.newUpdate("dynamic_update", Arrays.asList("dynamic_update_clone_value_2")),
- PropertyChange.newReset("dynamic_reset"),
- PropertyChange.newUpdate("dynamic_create", Arrays.asList("dynamic_create_clone_value_2")),
- PropertyChange.newUpdate("readonly_create", Arrays.asList("readonly_create_clone_value_2")),
- };
+ {
+ PropertyChange.newUpdate("override_update", Arrays.asList("override_update_clone_value_2")),
+ PropertyChange.newReset("override_reset"),
+ PropertyChange.newUpdate("override_create", Arrays.asList("override_create_clone_value_2")),
+ PropertyChange.newUpdate("dynamic_update", Arrays.asList("dynamic_update_clone_value_2")),
+ PropertyChange.newReset("dynamic_reset"),
+ PropertyChange.newUpdate("dynamic_create", Arrays.asList("dynamic_create_clone_value_2")),
+ PropertyChange.newUpdate("readonly_create", Arrays.asList("readonly_create_clone_value_2")),
+ };
ccpCtx = setProperties(ccpCtx, changes);
//
@@ -916,7 +917,7 @@
PortletSupport portletSupport = getPortletSupport(popCtx);
portletSupport.addHandler(handler);
addPreference(popCtx, "abc", Arrays.asList("def"));
-
+
//
PortletContext ccpCtx = createClone(popCtx);
@@ -951,17 +952,17 @@
// Compare States
Object expectedState = null;
Object actualState = null;
-
+
if (expected instanceof StatefulPortletContext)
- {
+ {
expectedState = ((StatefulPortletContext)expected).getState();
}
-
+
if (actual instanceof StatefulPortletContext)
{
actualState = ((StatefulPortletContext)actual).getState();
}
-
+
if (expectedState == null)
{
assertNull("Actual state should be null", actualState);
@@ -973,7 +974,7 @@
}
}
}
-
+
@Test
public void testExportNullPortletContext() throws Exception
{
@@ -988,11 +989,11 @@
}
assertNoExistingState();
}
-
+
@Test
public void testExportsNonExisitngPOP() throws Exception
{
- PortletContext popCTX = createNonExistingPOPRef();
+ PortletContext popCTX = createNonExistingPOPRef();
try
{
exportPortletContext(popCTX);
@@ -1004,11 +1005,11 @@
}
assertNoExistingState();
}
-
+
@Test
public void testExportNonExisitngCCP() throws Exception
{
- PortletContext ccpCTX = createNonExistingLocalCCPRef();
+ PortletContext ccpCTX = createNonExistingLocalCCPRef();
try
{
exportPortletContext(ccpCTX);
@@ -1020,7 +1021,7 @@
}
assertNoExistingState();
}
-
+
@Test
public void testExportInvalidPOP() throws Exception
{
@@ -1035,25 +1036,25 @@
}
assertNoExistingState();
}
-
+
@Test
public void testExportPortlet() throws Exception
{
PropertyMap expectedProperties = new SimplePropertyMap();
expectedProperties.setProperty("abc", Arrays.asList("def"));
-
+
PortletInfoSupport info = new PortletInfoSupport();
info.getMeta().setDisplayName("MyPortlet");
PortletContext popCtx = createPOPRef(info);
-
+
PortletContext export0Ctx = exportPortletContext(popCtx);
//Make sure we get back the ID for the original portlet
assertEquals("PortletId", export0Ctx.getId());
//check by doing an import
checkWithImportPortlet(export0Ctx, popCtx, new SimplePropertyMap());
-
-
+
+
//add a preference to the portlet to make it store a state
addPreference(popCtx, "abc", Arrays.asList("def"));
PortletContext export1Ctx = exportPortletContext(popCtx);
@@ -1062,15 +1063,15 @@
assertEquals("PortletId", export1Ctx.getId());
//check by doing an import
checkWithImportPortlet(export1Ctx, popCtx, expectedProperties);
-
+
PortletContext ccp1Ctx = createClone(popCtx);
PortletContext export2Ctx = exportPortletContext(ccp1Ctx);
-
+
//Make sure we get back the ID for the original portlet
assertEquals("PortletId", export2Ctx.getId());
//Check by doing an import
checkWithImportPortlet(export2Ctx, ccp1Ctx, expectedProperties);
-
+
PortletContext ccp2Ctx = createClone(ccp1Ctx);
//make sure that adding a property to the already cloned ccp1Ctx doesn't interfere with exports
PropertyChange[] propertyChanges = new PropertyChange[1];
@@ -1078,7 +1079,7 @@
ccp1Ctx = setProperties(ccp1Ctx, propertyChanges);
assertTrue(getProperties(ccp1Ctx).containsKey("123"));
assertFalse(getProperties(export2Ctx).containsKey("123"));
-
+
PortletContext export3Ctx = exportPortletContext(ccp2Ctx);
//Make sure we get back the ID for the original portlet
@@ -1090,27 +1091,27 @@
protected void checkWithImportPortlet(PortletContext exportedPortletContext, PortletContext originalPortletContext, PropertyMap expectedProperties) throws Exception
{
PortletContext importedPortletContext = importPortletContext(exportedPortletContext);
-
+
Portlet importedPortlet = getPortlet(importedPortletContext);
-
+
PortletContext portletContext = importedPortlet.getContext();
-
+
//make sure the expected portlet context and the one we get back from the import are the same
- assertEquals(originalPortletContext.getApplicationName(), portletContext.getApplicationName());
- assertEquals(originalPortletContext.getPortletName(), portletContext.getPortletName());
-
+ assertEquals(originalPortletContext.getComponents().getApplicationName(), portletContext.getComponents().getApplicationName());
+ assertEquals(originalPortletContext.getComponents().getPortletName(), portletContext.getComponents().getPortletName());
+
if (originalPortletContext instanceof StatefulPortletContext)
{
StatefulPortletContext statefulExpected = (StatefulPortletContext)originalPortletContext;
-
+
assertTrue(portletContext instanceof StatefulPortletContext);
StatefulPortletContext statefulPortletContext = (StatefulPortletContext)portletContext;
-
+
//Check that the states are the same
StateConverter sc = new StateConverterV0();
PortletState state = sc.unmarshall(PortletStateType.OPAQUE, (byte[])statefulPortletContext.getState());
PortletState expectedState = sc.unmarshall(PortletStateType.OPAQUE, (byte[])statefulExpected.getState());
-
+
assertEquals(expectedState.getPortletId(), state.getPortletId());
assertEquals(expectedState.getProperties(), state.getProperties());
assertEquals(expectedState.getTerminationTime(), state.getTerminationTime());
@@ -1120,9 +1121,9 @@
PropertyMap properties = getProperties(portletContext);
assertEquals(expectedProperties, properties);
assertEquals(getProperties(originalPortletContext), properties);
-
+
}
-
+
@Test
public void testImportNullPortletContext() throws Exception
{
@@ -1137,11 +1138,11 @@
}
assertNoExistingState();
}
-
+
@Test
public void testImportsNonExisitngPOP() throws Exception
{
- PortletContext popCTX = createNonExistingPOPRef();
+ PortletContext popCTX = createNonExistingPOPRef();
try
{
importPortletContext(popCTX);
@@ -1153,11 +1154,11 @@
}
assertNoExistingState();
}
-
+
@Test
public void testImportNonExisitngCCP() throws Exception
{
- PortletContext ccpCTX = createNonExistingLocalCCPRef();
+ PortletContext ccpCTX = createNonExistingLocalCCPRef();
try
{
importPortletContext(ccpCTX);
@@ -1169,7 +1170,7 @@
}
assertNoExistingState();
}
-
+
@Test
public void testImportInvalidPOP() throws Exception
{
@@ -1191,7 +1192,7 @@
//This will create the portlet into the container and check that it doesn't have any properties set
PortletContext popCtx = createPOPRef(new PortletInfoSupport());
assertTrue(getProperties(popCtx).isEmpty());
-
+
//Create the state bytes manually and create the portletcontext.
//Tests what happens if a stateful portlet is export on one machine and imported into another
StateConverter sc = new StateConverterV0();
@@ -1199,14 +1200,14 @@
propertyMap.setProperty("test", Arrays.asList("123"));
PortletState portletState = new PortletState("PortletId", propertyMap);
byte[] stateBytes = sc.marshall(PortletStateType.OPAQUE, portletState);
-
+
StatefulPortletContext portletContext = StatefulPortletContext.create("PortletId", PortletStateType.OPAQUE, stateBytes);
-
+
//import portlet
PortletContext importedPortletContext = importPortletContext(portletContext);
-
+
//Make sure that this new portlet has the properties we want
assertEquals(propertyMap, getProperties(importedPortletContext));
}
-
+
}
13 years, 9 months
gatein SVN: r6172 - epp/portal/branches/EPP_5_1_Branch/examples/portal/war/src/main/webapp/WEB-INF.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-04-07 08:47:22 -0400 (Thu, 07 Apr 2011)
New Revision: 6172
Modified:
epp/portal/branches/EPP_5_1_Branch/examples/portal/war/src/main/webapp/WEB-INF/web.xml
Log:
JBEPP-805: The GenericFilter should be called after that the request context has been properly set (ecmdemo portal, sample portal)
Modified: epp/portal/branches/EPP_5_1_Branch/examples/portal/war/src/main/webapp/WEB-INF/web.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2011-04-07 12:30:30 UTC (rev 6171)
+++ epp/portal/branches/EPP_5_1_Branch/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2011-04-07 12:47:22 UTC (rev 6172)
@@ -82,10 +82,6 @@
<filter-name>PortalContainerFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
- <filter-mapping>
- <filter-name>GenericFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
<filter-mapping>
<filter-name>ResourceRequestFilter</filter-name>
@@ -132,6 +128,11 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
+ <filter-mapping>
+ <filter-name>GenericFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
<!-- ================================================================== -->
<!-- LISTENER -->
<!-- ================================================================== -->
13 years, 9 months
gatein SVN: r6171 - in components/pc/trunk/api/src: test/java/org/gatein/pc/api and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-04-07 08:30:30 -0400 (Thu, 07 Apr 2011)
New Revision: 6171
Modified:
components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java
Log:
- GTNPC-58: Provided validation of currently known PortletContexts format. Now validates input by default. Added inner PortletContextComponents class to record components extracted during validation so that they can be used if needed.
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2011-04-07 08:34:16 UTC (rev 6170)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2011-04-07 12:30:30 UTC (rev 6171)
@@ -35,104 +35,115 @@
public class PortletContext implements Serializable
{
- /** . */
- protected final String id;
- private final String applicationName;
- private final String portletName;
private static final String PREFIX = "/";
private static final char SEPARATOR = '.';
- PortletContext(String id) throws IllegalArgumentException
+ /* TODO: remove from ProducerPortletInvoker so that we can use these constants in GateIn
+ public static final String CONSUMER_CLONE_ID = "_dumbvalue";
+ public static final String PRODUCER_CLONE_ID_PREFIX = "_";
+ public final static PortletContext CONSUMER_CLONE = PortletContext.createPortletContext(PortletInvoker.LOCAL_PORTLET_INVOKER_ID + SEPARATOR + CONSUMER_CLONE_ID);*/
+
+ protected final String id;
+ private final PortletContextComponents components;
+
+ protected PortletContext(String id) throws IllegalArgumentException
{
+ this(id, true);
+ }
+
+ protected PortletContext(String id, boolean interpret)
+ {
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "portlet id", "PortletContext");
+ PortletContextComponents components = null;
+ boolean isSimpleAppPortlet = false;
+ boolean isOpaquePortlet = false;
+ boolean isCompoundAppPortlet = false;
+
// components
- String trimmedId = id.trim();
- if (trimmedId.startsWith(PREFIX)) // only consider components if the id starts with '/'
+ if (interpret)
{
- int separator = trimmedId.indexOf(SEPARATOR); // find first separator, other separator are considered part of the portlet name
- if (separator != -1)
- {
- portletName = trimmedId.substring(separator + 1).trim();
- applicationName = PREFIX + trimmedId.substring(1, separator).trim();
- }
- else
- {
- portletName = null;
- applicationName = null;
- }
- }
- else
- {
- // check if we have the case: invokerId./application.portlet
- int prefix = trimmedId.indexOf(PREFIX);
- int invoker = trimmedId.indexOf(SEPARATOR);
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "portlet id", "PortletContext");
- // find first separator, check if it could be an invoker id
- if (invoker > 0 && invoker < prefix)
+ String trimmedId = id.trim();
+
+ try
{
- // check if we have a second separator, which would indicate a portlet context with invoker id
- int separator = trimmedId.indexOf(SEPARATOR, prefix);
- if (separator != -1)
+ if (trimmedId.startsWith(PREFIX))
{
- String invokerId = trimmedId.substring(0, invoker).trim();
- portletName = trimmedId.substring(separator + 1).trim();
- trimmedId = trimmedId.substring(invoker + 1).trim();
- applicationName = PREFIX + trimmedId.substring(1, trimmedId.indexOf(SEPARATOR)).trim();
- this.id = invokerId + SEPARATOR + buildIdFrom(applicationName, portletName); // recreate id with invoker
- return;
+ // check the case: /application.portlet
+ int separator = trimmedId.indexOf(SEPARATOR); // find first separator, other separator are considered part of the portlet name
+ String portletName = trimmedId.substring(separator + 1).trim();
+ String appName = trimmedId.substring(1, separator).trim();
+ isSimpleAppPortlet = separator != -1 && appName.length() > 0 && portletName.length() > 0;
+ if (isSimpleAppPortlet)
+ {
+ components = new PortletContextComponents(null, appName, portletName);
+ }
}
else
{
- portletName = null;
- applicationName = null;
+ int invoker = trimmedId.indexOf(SEPARATOR);
+ int prefix = trimmedId.indexOf(PREFIX);
+
+ if (prefix != -1)
+ {
+ // check if we have the case: invokerId./something
+ if (invoker > 0 && invoker < prefix)
+ {
+ String invokerId = trimmedId.substring(0, invoker).trim();
+
+ int separator = trimmedId.indexOf(SEPARATOR, prefix);
+ // check the case: invokerId./application.portlet
+ if (separator != -1)
+ {
+ String portletName = trimmedId.substring(separator + 1).trim();
+ trimmedId = trimmedId.substring(invoker + 1).trim();
+ String applicationName = trimmedId.substring(1, trimmedId.indexOf(SEPARATOR)).trim();
+ isCompoundAppPortlet = invokerId.length() > 0 && applicationName.length() > 0 && portletName.length() > 0;
+ if (isCompoundAppPortlet)
+ {
+ components = new PortletContextComponents(invokerId, applicationName, portletName);
+ }
+ }
+ }
+ }
+
+ // check if we have the case: invokerId.portletId
+ if (!isCompoundAppPortlet && invoker > 0)
+ {
+ String invokerId = trimmedId.substring(0, invoker).trim();
+ String portletName = trimmedId.substring(invoker + 1).trim();
+ isOpaquePortlet = invokerId.length() > 0 && portletName.length() > 0;
+ if (isOpaquePortlet)
+ {
+ components = new PortletContextComponents(invokerId, null, portletName);
+ }
+ }
}
}
- else
+ catch (Exception e)
{
- portletName = null;
- applicationName = null;
+ throw new IllegalArgumentException("Couldn't interpret id '" + id + "'", e);
}
}
- if (portletName == null || applicationName == null)
+ if (interpret && !(isSimpleAppPortlet || isCompoundAppPortlet || isOpaquePortlet))
{
- this.id = trimmedId;
+ throw new IllegalArgumentException("Couldn't interpret id '" + id + "'");
}
- else
- {
- this.id = buildIdFrom(applicationName, portletName);
- }
- }
- private PortletContext(String applicationName, String portletName, boolean formatApplicationName)
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(applicationName, "portlet application id", "PortletContext");
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletName, "container id", "PortletContext");
-
- if (!applicationName.startsWith(PREFIX))
- {
- if (formatApplicationName)
- {
- applicationName = PREFIX + applicationName;
- }
- else
- {
- throw new IllegalArgumentException("Application name must start with '" + PREFIX + "'. Was: " + applicationName);
- }
- }
-
- this.applicationName = applicationName;
- this.portletName = portletName;
- this.id = buildIdFrom(applicationName, portletName);
+ this.components = components;
+ this.id = components != null ? components.getId() : id;
}
- private String buildIdFrom(final String applicationName, final String portletName)
+ protected PortletContext(PortletContextComponents components)
{
- return applicationName + SEPARATOR + portletName;
+ ParameterValidation.throwIllegalArgExceptionIfNull(components, "portlet context components");
+ this.components = components;
+ this.id = components.getId();
}
-
public boolean equals(Object o)
{
if (this == o)
@@ -172,14 +183,7 @@
@Deprecated()
public static PortletContext createPortletContext(String id, byte[] state)
{
- if (state != null && state.length > 0)
- {
- return new StatefulPortletContext<byte[]>(id, PortletStateType.OPAQUE, state);
- }
- else
- {
- return new PortletContext(id);
- }
+ return createPortletContext(id, state, true);
}
/**
@@ -199,19 +203,21 @@
public static PortletContext createPortletContext(String portletId)
{
- return createPortletContext(portletId, (byte[])null);
+ return createPortletContext(portletId, null, true);
}
- public String getApplicationName()
+ public static PortletContext createPortletContext(String portletId, byte[] state, boolean interpret)
{
- return applicationName;
+ if (state != null && state.length > 0)
+ {
+ return new StatefulPortletContext<byte[]>(portletId, PortletStateType.OPAQUE, state);
+ }
+ else
+ {
+ return new PortletContext(portletId, interpret);
+ }
}
- public String getPortletName()
- {
- return portletName;
- }
-
/**
* Creates a new PortletContext referencing the specified portlet in the specified application (usually a web
* application).
@@ -224,23 +230,55 @@
*/
public static PortletContext createPortletContext(String applicationName, String portletName)
{
- return createPortletContext(applicationName, portletName, false);
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(applicationName, "portlet application id", "PortletContext");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletName, "container id", "PortletContext");
+
+ if (applicationName.startsWith(PREFIX))
+ {
+ applicationName = applicationName.substring(1);
+ }
+
+ return new PortletContext(new PortletContextComponents(null, applicationName, portletName));
}
- /**
- * Creates a new PortletContext referencing the specified portlet in the specified application (usually a web
- * application).
- *
- * @param applicationName the application name (usually a web application context path)
- * @param portletName the portlet name
- * @param formatApplicationName <code>true</code> if the application name should be formatted before attempting to
- * create the PortletContext, <code>false</code> otherwise.
- * @return a newly created PortletContext referencing the specified portlet in the specified application.
- * @throws IllegalArgumentException if the specified arguments are null or empty and if the application name is not
- * properly formatted.
- */
- public static PortletContext createPortletContext(String applicationName, String portletName, boolean formatApplicationName)
+ public PortletContextComponents getComponents()
{
- return new PortletContext(applicationName, portletName, formatApplicationName);
+ return components;
}
+
+ public static class PortletContextComponents
+ {
+ private final String applicationName;
+ private final String portletName;
+ private final String invokerName;
+
+ public PortletContextComponents(String invokerName, String applicationName, String portletName)
+ {
+ this.applicationName = applicationName;
+ this.portletName = portletName;
+ this.invokerName = invokerName;
+ }
+
+ public String getApplicationName()
+ {
+ return applicationName;
+ }
+
+ public String getPortletName()
+ {
+ return portletName;
+ }
+
+ public String getInvokerName()
+ {
+ return invokerName;
+ }
+
+ public String getId()
+ {
+ return (invokerName == null ? "" : invokerName + SEPARATOR)
+ + (applicationName == null ? "" : PREFIX + applicationName + SEPARATOR)
+ + (portletName == null ? "" : portletName);
+ }
+ }
}
Modified: components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java
===================================================================
--- components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java 2011-04-07 08:34:16 UTC (rev 6170)
+++ components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java 2011-04-07 12:30:30 UTC (rev 6171)
@@ -33,89 +33,126 @@
public void testGetComponents()
{
PortletContext context = PortletContext.createPortletContext("/applicationName.portletName");
- assertEquals("/applicationName", context.getApplicationName());
- assertEquals("portletName", context.getPortletName());
assertEquals("/applicationName.portletName", context.getId());
+ PortletContext.PortletContextComponents components = context.getComponents();
+ assertNotNull(components);
+ assertNull(components.getInvokerName());
+ assertEquals("applicationName", components.getApplicationName());
+ assertEquals("portletName", components.getPortletName());
context = PortletContext.createPortletContext("\t\t\n /applicationName.portletName \t");
- assertEquals("/applicationName", context.getApplicationName());
- assertEquals("portletName", context.getPortletName());
assertEquals("/applicationName.portletName", context.getId());
+ components = context.getComponents();
+ assertNotNull(components);
+ assertNull(components.getInvokerName());
+ assertEquals("applicationName", components.getApplicationName());
+ assertEquals("portletName", components.getPortletName());
- context = PortletContext.createPortletContext("/");
- assertNull(context.getApplicationName());
- assertNull(context.getPortletName());
- assertEquals("/", context.getId());
+ try
+ {
+ PortletContext.createPortletContext("/");
+ fail("invalid");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
context = PortletContext.createPortletContext("applicationName.portletName");
- assertNull(context.getApplicationName());
- assertNull(context.getPortletName());
assertEquals("applicationName.portletName", context.getId());
+ components = context.getComponents();
+ assertNotNull(components);
+ assertEquals("applicationName", components.getInvokerName());
+ assertNull(components.getApplicationName());
+ assertEquals("portletName", components.getPortletName());
context = PortletContext.createPortletContext("/applicationName.portlet.Name");
- assertEquals("/applicationName", context.getApplicationName());
- assertEquals("portlet.Name", context.getPortletName());
assertEquals("/applicationName.portlet.Name", context.getId());
+ components = context.getComponents();
+ assertNotNull(components);
+ assertNull(components.getInvokerName());
+ assertEquals("applicationName", components.getApplicationName());
+ assertEquals("portlet.Name", components.getPortletName());
- context = PortletContext.createPortletContext("/.");
- assertEquals("/", context.getApplicationName());
- assertEquals("", context.getPortletName());
- assertEquals("/.", context.getId());
+ try
+ {
+ PortletContext.createPortletContext("/.");
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
context = PortletContext.createPortletContext("/ applicationName\t. portlet Name");
- assertEquals("/applicationName", context.getApplicationName());
- assertEquals("portlet Name", context.getPortletName());
assertEquals("/applicationName.portlet Name", context.getId());
+ components = context.getComponents();
+ assertNotNull(components);
+ assertNull(components.getInvokerName());
+ assertEquals("applicationName", components.getApplicationName());
+ assertEquals("portlet Name", components.getPortletName());
}
public void testPortletContextWithInvokerId()
{
PortletContext context = PortletContext.createPortletContext("local./foo.bar");
- assertEquals("/foo", context.getApplicationName());
- assertEquals("bar", context.getPortletName());
assertEquals("local./foo.bar", context.getId());
+ PortletContext.PortletContextComponents components = context.getComponents();
+ assertNotNull(components);
+ assertEquals("local", components.getInvokerName());
+ assertEquals("foo", components.getApplicationName());
+ assertEquals("bar", components.getPortletName());
context = PortletContext.createPortletContext(" local\t . / foo \t. \t\n bar");
- assertEquals("/foo", context.getApplicationName());
- assertEquals("bar", context.getPortletName());
assertEquals("local./foo.bar", context.getId());
+ components = context.getComponents();
+ assertNotNull(components);
+ assertEquals("local", components.getInvokerName());
+ assertEquals("foo", components.getApplicationName());
+ assertEquals("bar", components.getPortletName());
context = PortletContext.createPortletContext("local.foo.bar");
- assertNull(context.getApplicationName());
- assertNull(context.getPortletName());
assertEquals("local.foo.bar", context.getId());
+ components = context.getComponents();
+ assertNotNull(components);
+ assertEquals("local", components.getInvokerName());
+ assertNull(components.getApplicationName());
+ assertEquals("foo.bar", components.getPortletName());
context = PortletContext.createPortletContext("local./foo");
- assertNull(context.getApplicationName());
- assertNull(context.getPortletName());
assertEquals("local./foo", context.getId());
+ components = context.getComponents();
+ assertNotNull(components);
+ assertEquals("local", components.getInvokerName());
+ assertNull(components.getApplicationName());
+ assertEquals("/foo", components.getPortletName());
}
public void testCreateFromComponents()
{
- PortletContext context;
- try
- {
- context = PortletContext.createPortletContext("applicationName", "portletName");
- fail("'applicationName' is not a properly formatted application name");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
-
PortletContext fromId = PortletContext.createPortletContext("/applicationName.portletName");
- context = PortletContext.createPortletContext("applicationName", "portletName", true);
- assertEquals("/applicationName", context.getApplicationName());
- assertEquals("portletName", context.getPortletName());
+ PortletContext context = PortletContext.createPortletContext("applicationName", "portletName");
assertEquals("/applicationName.portletName", context.getId());
+ PortletContext.PortletContextComponents components = context.getComponents();
+ assertNotNull(components);
+ assertNull(components.getInvokerName());
+ assertEquals("applicationName", components.getApplicationName());
+ assertEquals("portletName", components.getPortletName());
assertEquals(context, fromId);
+ }
- context = PortletContext.createPortletContext("/applicationName", "portletName");
- assertEquals("/applicationName", context.getApplicationName());
- assertEquals("portletName", context.getPortletName());
+ public void testShouldProperlyHandleApplicationNameStartingWithSlash()
+ {
+ PortletContext fromId = PortletContext.createPortletContext("/applicationName.portletName");
+
+ PortletContext context = PortletContext.createPortletContext("/applicationName", "portletName");
assertEquals("/applicationName.portletName", context.getId());
+ PortletContext.PortletContextComponents components = context.getComponents();
+ assertNotNull(components);
+ assertNull(components.getInvokerName());
+ assertEquals("applicationName", components.getApplicationName());
+ assertEquals("portletName", components.getPortletName());
assertEquals(context, fromId);
}
13 years, 9 months
gatein SVN: r6170 - portal/branches.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-04-07 04:34:16 -0400 (Thu, 07 Apr 2011)
New Revision: 6170
Added:
portal/branches/site-describability/
Log:
GTNPORTAL-1854 Create branch for site describability feature
13 years, 9 months
gatein SVN: r6169 - in components/pc/trunk/api/src: test/java/org/gatein/pc/api and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-04-06 10:29:24 -0400 (Wed, 06 Apr 2011)
New Revision: 6169
Modified:
components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java
Log:
- Updated semantics of PortletContext.getApplicationName() to include prefix so that it's not confusing. Will need to be checked upstream but usage lookup in WSRP and GateIn show that this shouldn't be an issue.
- Added support for PortletContext formatted as invokerId./application.portlet
- Added documentation and test case.
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2011-04-06 13:39:23 UTC (rev 6168)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2011-04-06 14:29:24 UTC (rev 6169)
@@ -50,13 +50,11 @@
String trimmedId = id.trim();
if (trimmedId.startsWith(PREFIX)) // only consider components if the id starts with '/'
{
- String compound = trimmedId.substring(1); // exclude starting '/'
-
- int separator = compound.indexOf(SEPARATOR); // find first separator, other separator are considered part of the portlet name
+ int separator = trimmedId.indexOf(SEPARATOR); // find first separator, other separator are considered part of the portlet name
if (separator != -1)
{
- portletName = compound.substring(separator + 1).trim();
- applicationName = compound.substring(0, separator).trim();
+ portletName = trimmedId.substring(separator + 1).trim();
+ applicationName = PREFIX + trimmedId.substring(1, separator).trim();
}
else
{
@@ -66,8 +64,35 @@
}
else
{
- portletName = null;
- applicationName = null;
+ // check if we have the case: invokerId./application.portlet
+ int prefix = trimmedId.indexOf(PREFIX);
+ int invoker = trimmedId.indexOf(SEPARATOR);
+
+ // find first separator, check if it could be an invoker id
+ if (invoker > 0 && invoker < prefix)
+ {
+ // check if we have a second separator, which would indicate a portlet context with invoker id
+ int separator = trimmedId.indexOf(SEPARATOR, prefix);
+ if (separator != -1)
+ {
+ String invokerId = trimmedId.substring(0, invoker).trim();
+ portletName = trimmedId.substring(separator + 1).trim();
+ trimmedId = trimmedId.substring(invoker + 1).trim();
+ applicationName = PREFIX + trimmedId.substring(1, trimmedId.indexOf(SEPARATOR)).trim();
+ this.id = invokerId + SEPARATOR + buildIdFrom(applicationName, portletName); // recreate id with invoker
+ return;
+ }
+ else
+ {
+ portletName = null;
+ applicationName = null;
+ }
+ }
+ else
+ {
+ portletName = null;
+ applicationName = null;
+ }
}
if (portletName == null || applicationName == null)
@@ -76,11 +101,38 @@
}
else
{
- this.id = PREFIX + applicationName + SEPARATOR + portletName;
+ this.id = buildIdFrom(applicationName, portletName);
}
}
+ private PortletContext(String applicationName, String portletName, boolean formatApplicationName)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(applicationName, "portlet application id", "PortletContext");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletName, "container id", "PortletContext");
+ if (!applicationName.startsWith(PREFIX))
+ {
+ if (formatApplicationName)
+ {
+ applicationName = PREFIX + applicationName;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Application name must start with '" + PREFIX + "'. Was: " + applicationName);
+ }
+ }
+
+ this.applicationName = applicationName;
+ this.portletName = portletName;
+ this.id = buildIdFrom(applicationName, portletName);
+ }
+
+ private String buildIdFrom(final String applicationName, final String portletName)
+ {
+ return applicationName + SEPARATOR + portletName;
+ }
+
+
public boolean equals(Object o)
{
if (this == o)
@@ -160,8 +212,35 @@
return portletName;
}
- public static PortletContext createPortletContext(String portletApplicationId, String containerId)
+ /**
+ * Creates a new PortletContext referencing the specified portlet in the specified application (usually a web
+ * application).
+ *
+ * @param applicationName the application name (usually a web application context path)
+ * @param portletName the portlet name
+ * @return a newly created PortletContext referencing the specified portlet in the specified application.
+ * @throws IllegalArgumentException if the specified arguments are null or empty and if the application name is not
+ * properly formatted.
+ */
+ public static PortletContext createPortletContext(String applicationName, String portletName)
{
- return PortletContext.createPortletContext(portletApplicationId + SEPARATOR + containerId);
+ return createPortletContext(applicationName, portletName, false);
}
+
+ /**
+ * Creates a new PortletContext referencing the specified portlet in the specified application (usually a web
+ * application).
+ *
+ * @param applicationName the application name (usually a web application context path)
+ * @param portletName the portlet name
+ * @param formatApplicationName <code>true</code> if the application name should be formatted before attempting to
+ * create the PortletContext, <code>false</code> otherwise.
+ * @return a newly created PortletContext referencing the specified portlet in the specified application.
+ * @throws IllegalArgumentException if the specified arguments are null or empty and if the application name is not
+ * properly formatted.
+ */
+ public static PortletContext createPortletContext(String applicationName, String portletName, boolean formatApplicationName)
+ {
+ return new PortletContext(applicationName, portletName, formatApplicationName);
+ }
}
Modified: components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java
===================================================================
--- components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java 2011-04-06 13:39:23 UTC (rev 6168)
+++ components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java 2011-04-06 14:29:24 UTC (rev 6169)
@@ -24,7 +24,6 @@
import junit.framework.TestCase;
-
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -34,12 +33,12 @@
public void testGetComponents()
{
PortletContext context = PortletContext.createPortletContext("/applicationName.portletName");
- assertEquals("applicationName", context.getApplicationName());
+ assertEquals("/applicationName", context.getApplicationName());
assertEquals("portletName", context.getPortletName());
assertEquals("/applicationName.portletName", context.getId());
context = PortletContext.createPortletContext("\t\t\n /applicationName.portletName \t");
- assertEquals("applicationName", context.getApplicationName());
+ assertEquals("/applicationName", context.getApplicationName());
assertEquals("portletName", context.getPortletName());
assertEquals("/applicationName.portletName", context.getId());
@@ -54,21 +53,72 @@
assertEquals("applicationName.portletName", context.getId());
context = PortletContext.createPortletContext("/applicationName.portlet.Name");
- assertEquals("applicationName", context.getApplicationName());
+ assertEquals("/applicationName", context.getApplicationName());
assertEquals("portlet.Name", context.getPortletName());
assertEquals("/applicationName.portlet.Name", context.getId());
context = PortletContext.createPortletContext("/.");
- assertEquals("", context.getApplicationName());
+ assertEquals("/", context.getApplicationName());
assertEquals("", context.getPortletName());
assertEquals("/.", context.getId());
context = PortletContext.createPortletContext("/ applicationName\t. portlet Name");
- assertEquals("applicationName", context.getApplicationName());
+ assertEquals("/applicationName", context.getApplicationName());
assertEquals("portlet Name", context.getPortletName());
assertEquals("/applicationName.portlet Name", context.getId());
}
+ public void testPortletContextWithInvokerId()
+ {
+ PortletContext context = PortletContext.createPortletContext("local./foo.bar");
+ assertEquals("/foo", context.getApplicationName());
+ assertEquals("bar", context.getPortletName());
+ assertEquals("local./foo.bar", context.getId());
+
+ context = PortletContext.createPortletContext(" local\t . / foo \t. \t\n bar");
+ assertEquals("/foo", context.getApplicationName());
+ assertEquals("bar", context.getPortletName());
+ assertEquals("local./foo.bar", context.getId());
+
+ context = PortletContext.createPortletContext("local.foo.bar");
+ assertNull(context.getApplicationName());
+ assertNull(context.getPortletName());
+ assertEquals("local.foo.bar", context.getId());
+
+ context = PortletContext.createPortletContext("local./foo");
+ assertNull(context.getApplicationName());
+ assertNull(context.getPortletName());
+ assertEquals("local./foo", context.getId());
+ }
+
+ public void testCreateFromComponents()
+ {
+ PortletContext context;
+ try
+ {
+ context = PortletContext.createPortletContext("applicationName", "portletName");
+ fail("'applicationName' is not a properly formatted application name");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+
+ PortletContext fromId = PortletContext.createPortletContext("/applicationName.portletName");
+
+ context = PortletContext.createPortletContext("applicationName", "portletName", true);
+ assertEquals("/applicationName", context.getApplicationName());
+ assertEquals("portletName", context.getPortletName());
+ assertEquals("/applicationName.portletName", context.getId());
+ assertEquals(context, fromId);
+
+ context = PortletContext.createPortletContext("/applicationName", "portletName");
+ assertEquals("/applicationName", context.getApplicationName());
+ assertEquals("portletName", context.getPortletName());
+ assertEquals("/applicationName.portletName", context.getId());
+ assertEquals(context, fromId);
+ }
+
public void testCreateFromNullOrEmpty()
{
try
13 years, 9 months
gatein SVN: r6168 - in portal/trunk: web/portal/src/main/webapp/WEB-INF/conf/organization and 1 other directories.
by do-not-reply@jboss.org
Author: bdaw
Date: 2011-04-06 09:39:23 -0400 (Wed, 06 Apr 2011)
New Revision: 6168
Added:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-api-cluster.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-store-cluster.xml
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
Log:
GTNPORTAL-1853 - IDM caching improvements for cluster
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2011-04-06 13:31:47 UTC (rev 6167)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2011-04-06 13:39:23 UTC (rev 6168)
@@ -29,6 +29,8 @@
import org.jboss.cache.Cache;
import org.jboss.cache.CacheFactory;
import org.jboss.cache.DefaultCacheFactory;
+
+import org.jgroups.JChannelFactory;
import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.api.IdentitySessionFactory;
import org.picketlink.idm.api.cfg.IdentityConfiguration;
@@ -52,7 +54,7 @@
public class PicketLinkIDMServiceImpl implements PicketLinkIDMService, Startable
{
- private static Log log_ = ExoLogger.getLogger(PicketLinkIDMServiceImpl.class);
+ private static Log log = ExoLogger.getLogger(PicketLinkIDMServiceImpl.class);
public static final String PARAM_CONFIG_OPTION = "config";
@@ -70,6 +72,10 @@
public static final String CACHE_CONFIG_STORE_OPTION = "storeCacheConfig";
+ public static final String JGROUPS_CONFIG = "jgroups-configuration";
+
+ public static final String JGROUPS_MUX_ENABLED = "jgroups-multiplexer-stack";
+
private IdentitySessionFactory identitySessionFactory;
private String config;
@@ -80,6 +86,8 @@
private IntegrationCache integrationCache;
+ private static final JChannelFactory CHANNEL_FACTORY = new JChannelFactory();
+
private PicketLinkIDMServiceImpl()
{
}
@@ -96,6 +104,8 @@
ValueParam realmName = initParams.getValueParam(REALM_NAME_OPTION);
ValueParam apiCacheConfig = initParams.getValueParam(CACHE_CONFIG_API_OPTION);
ValueParam storeCacheConfig = initParams.getValueParam(CACHE_CONFIG_STORE_OPTION);
+ ValueParam jgroupsStack = initParams.getValueParam(JGROUPS_MUX_ENABLED);
+ ValueParam jgroupsConfig = initParams.getValueParam(JGROUPS_CONFIG);
if (config == null && jndiName == null)
{
@@ -128,9 +138,9 @@
if (apiCacheConfig != null)
{
+
InputStream configStream = confManager.getInputStream(apiCacheConfig.getValue());
- // Create common JBoss Cache instance
CacheFactory factory = new DefaultCacheFactory();
if (configStream == null)
@@ -140,6 +150,8 @@
Cache cache = factory.createCache(configStream);
+ applyJGroupsConfig(cache, confManager, jgroupsStack, jgroupsConfig);
+
cache.create();
cache.start();
@@ -157,12 +169,30 @@
picketLinkIDMCache.register(apiCacheProvider);
}
+
+
if (storeCacheConfig != null)
{
InputStream configStream = confManager.getInputStream(storeCacheConfig.getValue());
+ CacheFactory factory = new DefaultCacheFactory();
+
+ if (configStream == null)
+ {
+ throw new IllegalArgumentException("JBoss Cache configuration InputStream is null");
+ }
+
+ Cache cache = factory.createCache(configStream);
+
+ applyJGroupsConfig(cache, confManager, jgroupsStack, jgroupsConfig);
+
+ cache.create();
+ cache.start();
+
+ configStream.close();
+
JBossCacheIdentityStoreCacheProviderImpl storeCacheProvider = new JBossCacheIdentityStoreCacheProviderImpl();
- storeCacheProvider.initialize(configStream);
+ storeCacheProvider.initialize(cache);
picketLinkIDMCache.register(storeCacheProvider);
identityConfiguration.getIdentityConfigurationRegistry().register(storeCacheProvider, "storeCacheProvider");
@@ -225,4 +255,61 @@
{
return realmName;
}
+
+ /**
+ * Applying JGroups configuration for JBossCache.
+ * Code forked from org.exoplatform.services.jcr.jbosscacheExoJBossCacheFactory
+ *
+ * @param cache
+ * @param configurationManager
+ * @param jgroupsEnabledParam
+ * @param jgroupsConfigurationParam
+ */
+ private void applyJGroupsConfig(Cache cache,
+ ConfigurationManager configurationManager,
+ ValueParam jgroupsEnabledParam,
+ ValueParam jgroupsConfigurationParam)
+ {
+
+ String jgroupsEnabled = jgroupsEnabledParam != null ? jgroupsEnabledParam.getValue() : null;
+ String jgroupsConfiguration = jgroupsConfigurationParam != null ? jgroupsConfigurationParam.getValue() : null;
+
+ // JGroups multiplexer configuration if enabled
+ if (jgroupsEnabled != null && jgroupsEnabled.equalsIgnoreCase("true"))
+ {
+ try
+ {
+ if (jgroupsConfiguration != null)
+ {
+ // Create and inject multiplexer factory
+ CHANNEL_FACTORY.setMultiplexerConfig(configurationManager.getResource(jgroupsConfiguration));
+ cache.getConfiguration().getRuntimeConfig().setMuxChannelFactory(CHANNEL_FACTORY);
+ log.info("Multiplexer stack successfully enabled for the cache.");
+ }
+ }
+ catch (Exception e)
+ {
+ // exception occurred setting mux factory
+ throw new IllegalStateException("Error setting multiplexer configuration.", e);
+ }
+ }
+ else
+ {
+ // Multiplexer is not enabled. If jGroups configuration preset it is applied
+ if (jgroupsConfiguration != null)
+ {
+ try
+ {
+ cache.getConfiguration().setJgroupsConfigFile(
+ configurationManager.getResource(jgroupsConfiguration));
+ log.info("Custom JGroups configuration set:"
+ + configurationManager.getResource(jgroupsConfiguration));
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error setting JGroups configuration.", e);
+ }
+ }
+ }
+ }
}
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2011-04-06 13:31:47 UTC (rev 6167)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2011-04-06 13:39:23 UTC (rev 6168)
@@ -96,7 +96,7 @@
<value-param profiles="cluster">
<name>apiCacheConfig</name>
- <value>war:/conf/organization/picketlink-idm/jboss-cache-cluster.xml</value>
+ <value>war:/conf/organization/picketlink-idm/jboss-cache-api-cluster.xml</value>
</value-param>
<value-param>
@@ -106,9 +106,19 @@
<value-param profiles="cluster">
<name>storeCacheConfig</name>
- <value>war:/conf/organization/picketlink-idm/jboss-cache-cluster.xml</value>
+ <value>war:/conf/organization/picketlink-idm/jboss-cache-store-cluster.xml</value>
</value-param>
+ <value-param profiles="cluster">
+ <name>jgroups-configuration</name>
+ <value>${gatein.jcr.jgroups.config}</value>
+ </value-param>
+
+ <value-param profiles="cluster">
+ <name>jgroups-multiplexer-stack</name>
+ <value>true</value>
+ </value-param>
+
</init-params>
</component>
Copied: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-api-cluster.xml (from rev 6164, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml)
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-api-cluster.xml (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-api-cluster.xml 2011-04-06 13:39:23 UTC (rev 6168)
@@ -0,0 +1,19 @@
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <clustering mode="replication" clusterName="${jboss.partition.name:DefaultPartition}-idm-api-cluster">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig multiplexerStack="jcr.stack" />
+ <sync />
+ </clustering>
+
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.ExpirationAlgorithm"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="100000" />
+ <property name="timeToLive" value="120000" />
+ <property name="warnNoExpirationKey" value="false" />
+ </default>
+ </eviction>
+
+</jbosscache>
Copied: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-store-cluster.xml (from rev 6164, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml)
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-store-cluster.xml (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-store-cluster.xml 2011-04-06 13:39:23 UTC (rev 6168)
@@ -0,0 +1,19 @@
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <clustering mode="replication" clusterName="${jboss.partition.name:DefaultPartition}-idm-store-cluster">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig multiplexerStack="jcr.stack" />
+ <sync />
+ </clustering>
+
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.ExpirationAlgorithm"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="100000" />
+ <property name="timeToLive" value="120000" />
+ <property name="warnNoExpirationKey" value="false" />
+ </default>
+ </eviction>
+
+</jbosscache>
13 years, 9 months
gatein SVN: r6167 - in components/pc/trunk/api: src/test and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-04-06 09:31:47 -0400 (Wed, 06 Apr 2011)
New Revision: 6167
Removed:
components/pc/trunk/api/src/test/resources/
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java
Log:
- Removed unneeded use of jBoss Unit.
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2011-04-06 13:04:32 UTC (rev 6166)
+++ components/pc/trunk/api/pom.xml 2011-04-06 13:31:47 UTC (rev 6167)
@@ -1,4 +1,5 @@
-<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">
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
@@ -19,55 +20,18 @@
<groupId>org.gatein.wci</groupId>
<artifactId>wci-wci</artifactId>
</dependency>
-
- <dependency>
- <groupId>sun-jaxb</groupId>
- <artifactId>jaxb-api</artifactId>
- </dependency>
- <!--<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>-->
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-mc</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${version.apache.log4j}</version>
- </dependency>
</dependencies>
<build>
<plugins>
<plugin>
- <groupId>org.jboss.unit</groupId>
- <artifactId>jboss-unit-tooling-maven2</artifactId>
- <executions>
- <execution>
- <phase>test</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- </execution>
- </executions>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3.1</version>
<configuration>
- <failOnError>true</failOnError>
- <testsuites>
- <testsuite>
- <config>jboss-unit.xml</config>
- </testsuite>
- </testsuites>
- <reports>
- <xml>target/tests/reports/xml</xml>
- <html>target/tests/reports/html</html>
- </reports>
+ <skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
-
</project>
Modified: components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java
===================================================================
--- components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java 2011-04-06 13:04:32 UTC (rev 6166)
+++ components/pc/trunk/api/src/test/java/org/gatein/pc/api/PortletContextTestCase.java 2011-04-06 13:31:47 UTC (rev 6167)
@@ -22,16 +22,15 @@
package org.gatein.pc.api;
-import static org.jboss.unit.api.Assert.*;
-import org.jboss.unit.api.pojo.annotations.Test;
+import junit.framework.TestCase;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class PortletContextTestCase
+public class PortletContextTestCase extends TestCase
{
- @Test
public void testGetComponents()
{
PortletContext context = PortletContext.createPortletContext("/applicationName.portletName");
@@ -70,7 +69,6 @@
assertEquals("/applicationName.portlet Name", context.getId());
}
- @Test
public void testCreateFromNullOrEmpty()
{
try
13 years, 9 months
gatein SVN: r6166 - components/pc/trunk/docs/user-guide.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2011-04-06 09:04:32 -0400 (Wed, 06 Apr 2011)
New Revision: 6166
Modified:
components/pc/trunk/docs/user-guide/pom.xml
Log:
- Reference docs-aggregator instead of pc-parent as parent to please Maven 3.
Modified: components/pc/trunk/docs/user-guide/pom.xml
===================================================================
--- components/pc/trunk/docs/user-guide/pom.xml 2011-04-06 12:29:14 UTC (rev 6165)
+++ components/pc/trunk/docs/user-guide/pom.xml 2011-04-06 13:04:32 UTC (rev 6166)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
- <artifactId>pc-parent</artifactId>
+ <artifactId>docs-aggregator</artifactId>
<version>2.3.0-Beta02-SNAPSHOT</version>
</parent>
<groupId>org.gatein.pc</groupId>
13 years, 9 months
gatein SVN: r6165 - epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/portal/webui/workspace.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-04-06 08:29:14 -0400 (Wed, 06 Apr 2011)
New Revision: 6165
Modified:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl
Log:
JBEPP-605: Comment in UIPortalApplication.gtmpl is rendered in HTML response
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl 2011-04-06 06:45:26 UTC (rev 6164)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl 2011-04-06 12:29:14 UTC (rev 6165)
@@ -47,10 +47,12 @@
<link id="${portletSkin.id}" rel="stylesheet" type="text/css" href= "$url" />
<%}%>
<script type="text/javascript">
+ <%
// This variable must be used only to initialize other variables otherwise
// please use eXo.env.portal.context or eXo.env.portal.context instead
// Those 2 last variables cannot be used to initialize variables because
// we cannot be sure that they will be initialized before initializing your script
+ %>
var currentContext = '<%=docBase%>' ;
</script>
<%if(org.exoplatform.commons.utils.PropertyManager.isDevelopping()) {
13 years, 9 months