JBoss Portal SVN: r9487 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/info and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-12 19:40:13 -0500 (Sat, 12 Jan 2008)
New Revision: 9487
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletApplicationInfo.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
Log:
added notion of ContainerPortletApplicationInfo to hold the various items related to the application in 286
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2008-01-12 23:16:50 UTC (rev 9486)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2008-01-13 00:40:13 UTC (rev 9487)
@@ -27,15 +27,11 @@
import org.jboss.portal.portlet.container.PortletApplicationRegistry;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
-import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
-import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImpl;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
-import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
-import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder;
-import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
+import org.jboss.portal.common.FixMe;
import javax.servlet.ServletContext;
@@ -101,6 +97,8 @@
public void startPortletApplication() throws Exception
{
+ throw new FixMe("Not used anymore for now, check or reimplement in 2.6");
+/*
portletApp = new PortletApplicationImpl(portletAppMD, jbossAppMD, this, portletAPIFactory);
portletApp.start();
@@ -113,7 +111,7 @@
builder.build();
//
- for (ContainerPortletInfo containerInfo : builder.getContainerInfos())
+ for (ContainerPortletInfo containerInfo : builder.getPortlets())
{
// JBossPortletMetaData jBossPortletMD = null;
// if (jbossAppMD != null)
@@ -140,6 +138,7 @@
e.printStackTrace();
}
}
+*/
}
public void stopPortletApplication()
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-01-12 23:16:50 UTC (rev 9486)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-01-13 00:40:13 UTC (rev 9487)
@@ -55,6 +55,8 @@
import java.util.ResourceBundle;
import java.util.MissingResourceException;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
import java.net.URI;
import java.net.URISyntaxException;
@@ -81,12 +83,15 @@
private final ContainerInfoBuilderContext context;
/** . */
- private final List<ContainerPortletInfo> containerInfos;
+ private final Map<QName, ContainerEventInfo> events;
/** . */
- private final Map<QName, ContainerEventInfo> events;
+ private ContainerPortletApplicationInfo portletApplication;
/** . */
+ private final Map<String, ContainerPortletInfo> portlets;
+
+ /** . */
private final Logger log = Logger.getLogger(ContainerInfoBuilder.class);
public ContainerInfoBuilder(
@@ -95,17 +100,22 @@
{
this.portletApplicationMD = portletApplicationMD;
this.context = context;
- this.containerInfos = new ArrayList<ContainerPortletInfo>();
this.events = new HashMap<QName, ContainerEventInfo>();
+ this.portlets = new LinkedHashMap<String, ContainerPortletInfo>();
}
- public List<ContainerPortletInfo> getContainerInfos()
+ public ContainerPortletApplicationInfo getApplication()
{
- return containerInfos;
+ return portletApplication;
}
- private void fixMetaData()
+ public Collection<ContainerPortletInfo> getPortlets()
{
+ return portlets.values();
+ }
+
+ private void fixMetaData(PortletApplication10MetaData portletApplicationMD)
+ {
if (portletApplicationMD instanceof PortletApplication20MetaData)
{
PortletApplication20MetaData tmp = (PortletApplication20MetaData)portletApplicationMD;
@@ -212,14 +222,30 @@
public void build()
{
- fixMetaData();
+ portletApplication = build(portletApplicationMD);
//
- if (portletApplicationMD instanceof PortletApplication20MetaData)
+ for (PortletMetaData portletMD : portletApplicationMD.getPortletCollection())
{
- PortletApplication20MetaData tmp = (PortletApplication20MetaData)portletApplicationMD;
+ ContainerPortletInfo portlet = build(portletMD);
+ portlets.put(portlet.getName(), portlet);
+ }
+ }
+ private ContainerPortletApplicationInfo build(PortletApplication10MetaData portletApplicationMD)
+ {
+ fixMetaData(portletApplicationMD);
+
+ //
+ String defaultNamespace = XMLConstants.NULL_NS_URI;
+ if (this.portletApplicationMD instanceof PortletApplication20MetaData)
+ {
+ PortletApplication20MetaData tmp = (PortletApplication20MetaData)this.portletApplicationMD;
+
//
+ defaultNamespace = tmp.getDefaultNamespace() != null ? tmp.getDefaultNamespace().toString() : null;
+
+ //
for (EventDefinitionMetaData eventDefinitionMD : tmp.getEvents())
{
try
@@ -235,11 +261,7 @@
}
//
- for (PortletMetaData portletMD : portletApplicationMD.getPortletCollection())
- {
- ContainerPortletInfo portletInfo = build(portletMD);
- containerInfos.add(portletInfo);
- }
+ return new ContainerPortletApplicationInfo(defaultNamespace);
}
private ContainerEventInfo build(EventDefinitionMetaData eventDefinitionMD) throws NoSuchClassException
@@ -281,9 +303,6 @@
ContainerPortletInfo containerPortletInfo;
if (portletApplicationMD instanceof PortletApplication20MetaData)
{
- PortletApplication20MetaData tmp = (PortletApplication20MetaData)portletApplicationMD;
-
- //
ContainerEventsInfo containerEvents = buildContainerEventsInfo(portletMD);
//
@@ -298,7 +317,6 @@
portletMD.getPortletName(),
portletMD.getPortletClass(),
false,
- tmp.getDefaultNamespace().toString(),
context.getBundleManager(portletMD)
);
}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletApplicationInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletApplicationInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletApplicationInfo.java 2008-01-13 00:40:13 UTC (rev 9487)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.info;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerPortletApplicationInfo
+{
+
+ /** . */
+ private final String defaultNamespace;
+
+ public ContainerPortletApplicationInfo(String defaultNamespace)
+ {
+ this.defaultNamespace = defaultNamespace;
+ }
+
+ public String getDefaultNamespace()
+ {
+ return defaultNamespace;
+ }
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java 2008-01-12 23:16:50 UTC (rev 9486)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java 2008-01-13 00:40:13 UTC (rev 9487)
@@ -74,9 +74,6 @@
private final Boolean remotable;
/** . */
- private final String defaultNamespace;
-
- /** . */
private final ResourceBundleManager bundleManager;
public ContainerPortletInfo(
@@ -102,11 +99,10 @@
this.className = className;
this.initParameters = new HashMap<String, String>();
this.remotable = remotable;
- this.defaultNamespace = XMLConstants.NULL_NS_URI;
this.bundleManager = bundleManager;
}
- public ContainerPortletInfo(
+ ContainerPortletInfo(
ContainerCapabilitiesInfo capabilities,
ContainerPreferencesInfo preferences,
ContainerMetaInfo meta,
@@ -117,7 +113,6 @@
String name,
String className,
Boolean remotable,
- String defaultNamespace,
ResourceBundleManager bundleManager)
{
this.capabilities = capabilities;
@@ -131,7 +126,6 @@
this.className = className;
this.initParameters = new HashMap<String, String>();
this.remotable = remotable;
- this.defaultNamespace = defaultNamespace;
this.bundleManager = bundleManager;
}
@@ -140,11 +134,6 @@
return name;
}
- public String getDefaultNamespace()
- {
- return defaultNamespace;
- }
-
public ResourceBundleManager getBundleManager()
{
return bundleManager;
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2008-01-12 23:16:50 UTC (rev 9486)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2008-01-13 00:40:13 UTC (rev 9487)
@@ -25,6 +25,7 @@
import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletApplicationContext;
@@ -43,6 +44,9 @@
{
/** . */
+ protected final ContainerPortletApplicationInfo info;
+
+ /** . */
protected final PortletApplication10MetaData metaData;
/** . */
@@ -58,17 +62,28 @@
protected LinkedHashMap<String, PortletContainer> portlets;
/** . */
- protected PortletContext portletContext;
+ protected PortletContextImpl portletContext;
/** . */
protected String version;
+ /**
+ * Todo remove meta data reference and use info instead.
+ *
+ * @param info
+ * @param metaData
+ * @param jbossMetaData
+ * @param context
+ * @param portletAPIFactory
+ */
public PortletApplicationImpl(
+ ContainerPortletApplicationInfo info,
PortletApplication10MetaData metaData,
JBossApplicationMetaData jbossMetaData,
PortletApplicationContext context,
PortletAPIFactory portletAPIFactory)
{
+ this.info = info;
this.metaData = metaData;
this.jbossMetaData = jbossMetaData;
this.portletAPIFactory = portletAPIFactory;
@@ -81,6 +96,11 @@
return metaData.getId();
}
+ public ContainerPortletApplicationInfo getInfo()
+ {
+ return info;
+ }
+
public PortletAPIFactory getPortletAPIFactory()
{
return portletAPIFactory;
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-01-12 23:16:50 UTC (rev 9486)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-01-13 00:40:13 UTC (rev 9487)
@@ -26,6 +26,7 @@
import org.jboss.portal.common.i18n.ResourceBundleManager;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletContainer;
@@ -68,7 +69,7 @@
protected final Logger log;
/** Return info. */
- protected final ContainerPortletInfo info;
+ final ContainerPortletInfo info;
/** . */
protected PortletApplicationImpl application;
@@ -175,7 +176,7 @@
ResourceBundleManager bundleManager = PortletResourceBundleFactory.createResourceBundleManager(info.getBundleManager(), info);
// Portlet config object
- PortletConfig config = new PortletConfigImpl(application.getPortletContext(), info, bundleManager);
+ PortletConfig config = new PortletConfigImpl(info, application.info, application.portletContext, bundleManager);
// Finally initialize the porlet instance
try
@@ -263,6 +264,7 @@
return portlet;
}
+ // Cannot use covariant here as it will break the javabean property getter convention used by MC.
public PortletApplication getApplication()
{
return application;
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java 2008-01-12 23:16:50 UTC (rev 9486)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java 2008-01-13 00:40:13 UTC (rev 9487)
@@ -26,6 +26,7 @@
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
+import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
import org.jboss.portal.portlet.info.EventInfo;
import javax.portlet.PortletConfig;
@@ -47,12 +48,15 @@
{
/** . */
- private PortletContext portletContext;
+ private final ContainerPortletInfo portletInfo;
/** . */
- private ContainerPortletInfo info;
+ private final ContainerPortletApplicationInfo portletApplicationInfo;
/** . */
+ private final PortletContextImpl portletContext;
+
+ /** . */
private ResourceBundleManager bundleMgr;
/** . */
@@ -61,22 +65,29 @@
/** . */
private List<QName> processingEventQNames;
- public PortletConfigImpl(PortletContext portletContext, ContainerPortletInfo info, ResourceBundleManager bundleMgr)
+ public PortletConfigImpl(
+ ContainerPortletInfo portletInfo,
+ ContainerPortletApplicationInfo portletApplicationInfo,
+ PortletContextImpl portletContext,
+ ResourceBundleManager bundleMgr)
{
List<QName> publishingEventQNames = new ArrayList<QName>();
- for (EventInfo event : info.getEvents().getProducedEvents())
+ for (EventInfo event : portletInfo.getEvents().getProducedEvents())
{
publishingEventQNames.add(event.getName());
}
+ //
List<QName> processingEventQNames = new ArrayList<QName>();
- for (EventInfo event : info.getEvents().getConsumedEvents())
+ for (EventInfo event : portletInfo.getEvents().getConsumedEvents())
{
processingEventQNames.add(event.getName());
}
+ //
+ this.portletInfo = portletInfo;
+ this.portletApplicationInfo = portletApplicationInfo;
this.portletContext = portletContext;
- this.info = info;
this.bundleMgr = bundleMgr;
this.publishingEventQNames = publishingEventQNames;
this.processingEventQNames = processingEventQNames;
@@ -84,7 +95,7 @@
public String getPortletName()
{
- return info.getName();
+ return portletInfo.getName();
}
public PortletContext getPortletContext()
@@ -104,12 +115,12 @@
{
throw new IllegalArgumentException("name must not be null");
}
- return info.getInitParameter(s);
+ return portletInfo.getInitParameter(s);
}
public Enumeration<String> getInitParameterNames()
{
- return Collections.enumeration(info.getInitParameterNames());
+ return Collections.enumeration(portletInfo.getInitParameterNames());
}
public Enumeration<String> getPublicRenderParameterNames()
@@ -119,7 +130,7 @@
public String getDefaultNamespace()
{
- return info.getDefaultNamespace();
+ return portletApplicationInfo.getDefaultNamespace();
}
public Enumeration<QName> getPublishingEventQNames()
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java 2008-01-12 23:16:50 UTC (rev 9486)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java 2008-01-13 00:40:13 UTC (rev 9487)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.impl.jsr168.api;
import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
import javax.portlet.PortletContext;
import javax.portlet.PortletRequestDispatcher;
@@ -41,8 +42,12 @@
public class PortletContextImpl implements PortletContext
{
+ /** . */
private ServletContext servletContext;
+ /** . */
+ private ContainerPortletApplicationInfo info;
+
public PortletContextImpl(ServletContext servletContext)
{
this.servletContext = servletContext;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-01-12 23:16:50 UTC (rev 9486)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-01-13 00:40:13 UTC (rev 9487)
@@ -31,6 +31,7 @@
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder;
import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext;
+import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
import org.jboss.portal.web.WebApp;
import org.jboss.portal.common.util.Tools;
@@ -49,16 +50,14 @@
import org.jboss.beans.metadata.spi.PropertyMetaData;
import org.jboss.beans.metadata.spi.ParameterMetaData;
import org.jboss.beans.metadata.spi.InstallMetaData;
+import org.jboss.dependency.spi.ControllerState;
import org.apache.log4j.Logger;
import javax.servlet.ServletContext;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.LinkedList;
-import java.util.Iterator;
import java.util.LinkedHashMap;
-import java.util.Set;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -119,7 +118,7 @@
List<AbstractBeanMetaData> toInstall = new ArrayList<AbstractBeanMetaData>();
//
- for (ContainerPortletInfo containerInfo : builder.getContainerInfos())
+ for (ContainerPortletInfo containerInfo : builder.getPortlets())
{
//
String portletContainerId = "PortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
@@ -157,7 +156,8 @@
AbstractBeanMetaData applicationBMD = new AbstractBeanMetaData(portletApplicationId, PortletApplicationImpl.class.getName());
AbstractConstructorMetaData ctormd = new AbstractConstructorMetaData();
ctormd.setParameters(Tools.toList(
- (ParameterMetaData)new AbstractParameterMetaData(PortletApplication10MetaData.class.getName(), metaData),
+ (ParameterMetaData)new AbstractParameterMetaData(ContainerPortletApplicationInfo.class.getName(), builder.getApplication()),
+ new AbstractParameterMetaData(PortletApplication10MetaData.class.getName(), metaData),
new AbstractParameterMetaData(JBossApplicationMetaData.class.getName(), (Object)null),
new AbstractParameterMetaData(PortletApplicationContext.class.getName(), this),
new AbstractParameterMetaData(PortletAPIFactory.class.getName(), new AbstractDependencyValueMetaData("PortletAPIFactory"))));
@@ -198,7 +198,14 @@
for (KernelControllerContext kcc : installed.values())
{
- log.debug("Bean " + kcc.getName() + " was installed with state" + kcc.getState());
+ if (kcc.getState() == ControllerState.ERROR)
+ {
+ log.error("Bean " + kcc.getName() + " threw an error during start", kcc.getError());
+ }
+ else
+ {
+ log.debug("Bean " + kcc.getName() + " was installed with state" + kcc.getState());
+ }
}
}
18 years, 3 months
JBoss Portal SVN: r9486 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168 and 18 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-12 18:16:50 -0500 (Sat, 12 Jan 2008)
New Revision: 9486
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/NoEventTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/ProcessingEventTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingEventTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingProcessingEventTestCase.java
modules/portlet/trunk/test/src/test/resources/jsr286/
modules/portlet/trunk/test/src/test/resources/jsr286/tck/
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/web.xml
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventInfo.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestParametersTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Assertion.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/PortletTestSuite.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/AbstractUniversalTestPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
modules/portlet/trunk/test/src/test/build.xml
modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
Log:
- fixed a couple of bugs in the portlet container test framework
- improved the build.xml (DRY) and jsr 286 support
- implement getPublishingEventQName() and getProcessingEventQNames() in PortletConfig
- unit tests for getPublishingEventQName() and getProcessingEventQNames()
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventInfo.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventInfo.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -38,19 +38,19 @@
{
/** . */
- private QName name;
+ private final QName name;
/** . */
- private ContainerTypeInfo type;
+ private final ContainerTypeInfo type;
/** . */
- private LocalizedString displayName;
+ private final LocalizedString displayName;
/** . */
- private LocalizedString description;
+ private final LocalizedString description;
/** . */
- private List<QName> aliases;
+ private final List<QName> aliases;
public ContainerEventInfo(
QName name,
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -30,6 +30,7 @@
import org.jboss.portal.portlet.impl.metadata.portlet.SecurityRoleRefMetaData;
import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferencesMetaData;
import org.jboss.portal.portlet.impl.metadata.portlet.WindowStateMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletInfoMetaData;
import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferenceMetaData;
@@ -41,9 +42,12 @@
import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.common.reflect.NoSuchClassException;
import org.jboss.portal.Mode;
+import org.apache.log4j.Logger;
import javax.xml.namespace.QName;
+import javax.xml.XMLConstants;
import java.util.Locale;
import java.util.Map;
import java.util.HashMap;
@@ -51,6 +55,8 @@
import java.util.ResourceBundle;
import java.util.MissingResourceException;
import java.util.ArrayList;
+import java.net.URI;
+import java.net.URISyntaxException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -80,6 +86,9 @@
/** . */
private final Map<QName, ContainerEventInfo> events;
+ /** . */
+ private final Logger log = Logger.getLogger(ContainerInfoBuilder.class);
+
public ContainerInfoBuilder(
PortletApplication10MetaData portletApplicationMD,
ContainerInfoBuilderContext context)
@@ -104,6 +113,17 @@
{
tmp.setEvents(new ArrayList<EventDefinitionMetaData>());
}
+ if (tmp.getDefaultNamespace() == null)
+ {
+ try
+ {
+ tmp.setDefaultNamespace(new URI(XMLConstants.NULL_NS_URI));
+ }
+ catch (URISyntaxException e)
+ {
+ throw new Error(e);
+ }
+ }
}
}
@@ -202,8 +222,15 @@
//
for (EventDefinitionMetaData eventDefinitionMD : tmp.getEvents())
{
- ContainerEventInfo event = build(eventDefinitionMD);
- events.put(event.getName(), event);
+ try
+ {
+ ContainerEventInfo event = build(eventDefinitionMD);
+ events.put(event.getName(), event);
+ }
+ catch (NoSuchClassException e)
+ {
+ log.error("Cannot load event class " + e.getClassName(), e);
+ }
}
}
@@ -215,21 +242,26 @@
}
}
- private ContainerEventInfo build(EventDefinitionMetaData eventDefinitionMD)
+ private ContainerEventInfo build(EventDefinitionMetaData eventDefinitionMD) throws NoSuchClassException
{
QName name = getName(eventDefinitionMD.getQname(), eventDefinitionMD.getName());
ResourceBundleManager bundleMgr = context.getBundleManager();
//
String valueType = eventDefinitionMD.getValueType();
- Class clazz = context.getClass(valueType);
+ ContainerTypeInfo type = null;
+ if (valueType != null)
+ {
+ Class clazz = context.getClass(valueType);
+ type = new ContainerTypeInfo(clazz);
+ }
+
//
LocalizedString displayName = bundleMgr.getLocalizedValue("javax.portlet.app.event-definition.." + name + ".display-name", "Event " + name);
LocalizedString description = bundleMgr.getLocalizedValue("javax.portlet.app.event-definition." + name + ".description", "Description of event " + name);
//
- ContainerTypeInfo type = new ContainerTypeInfo(clazz);
return new ContainerEventInfo(name, type, displayName, description);
}
@@ -249,6 +281,9 @@
ContainerPortletInfo containerPortletInfo;
if (portletApplicationMD instanceof PortletApplication20MetaData)
{
+ PortletApplication20MetaData tmp = (PortletApplication20MetaData)portletApplicationMD;
+
+ //
ContainerEventsInfo containerEvents = buildContainerEventsInfo(portletMD);
//
@@ -263,6 +298,7 @@
portletMD.getPortletName(),
portletMD.getPortletClass(),
false,
+ tmp.getDefaultNamespace().toString(),
context.getBundleManager(portletMD)
);
}
@@ -392,11 +428,16 @@
ResourceBundleManager bundleMgr = context.getBundleManager(portletMD);
// Capture inline values
- String[] inlines = {
- portletMD.getPortletInfo().getTitle(),
- portletMD.getPortletInfo().getShortTitle(),
- portletMD.getPortletInfo().getKeywords()
- };
+ PortletInfoMetaData portletInfoMD = portletMD.getPortletInfo();
+ String[] inlines = null;
+ if (portletInfoMD != null)
+ {
+ inlines = new String[]{
+ portletMD.getPortletInfo().getTitle(),
+ portletMD.getPortletInfo().getShortTitle(),
+ portletMD.getPortletInfo().getKeywords()
+ };
+ }
// Construct info from resource bundle manager
for (int i = 0; i < KEYS.length; i++)
@@ -432,7 +473,7 @@
}
// Add the inline value if it is present
- if (inlines[i] != null)
+ if (inlines != null && inlines[i] != null)
{
tmp.put(Locale.ENGLISH, inlines[i]);
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.impl.info;
import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.common.reflect.NoSuchClassException;
import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
/**
@@ -36,6 +37,14 @@
ResourceBundleManager getBundleManager(PortletMetaData portletMD);
- Class getClass(String className);
+ /**
+ * Obtains a class.
+ *
+ * @param className the class name
+ * @return the specified class
+ * @throws IllegalArgumentException if the className argument is null
+ * @throws NoSuchClassException is the class cannot be loaded
+ */
+ Class getClass(String className) throws IllegalArgumentException, NoSuchClassException;
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -25,6 +25,7 @@
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.common.i18n.ResourceBundleManager;
+import javax.xml.XMLConstants;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
@@ -73,8 +74,11 @@
private final Boolean remotable;
/** . */
- private ResourceBundleManager bundleManager;
+ private final String defaultNamespace;
+ /** . */
+ private final ResourceBundleManager bundleManager;
+
public ContainerPortletInfo(
ContainerCapabilitiesInfo capabilities,
ContainerPreferencesInfo preferences,
@@ -93,11 +97,12 @@
this.security = security;
this.cache = cache;
this.session = session;
- this.events = null;
+ this.events = new ContainerEventsInfo();
this.name = name;
this.className = className;
this.initParameters = new HashMap<String, String>();
this.remotable = remotable;
+ this.defaultNamespace = XMLConstants.NULL_NS_URI;
this.bundleManager = bundleManager;
}
@@ -112,6 +117,7 @@
String name,
String className,
Boolean remotable,
+ String defaultNamespace,
ResourceBundleManager bundleManager)
{
this.capabilities = capabilities;
@@ -125,6 +131,7 @@
this.className = className;
this.initParameters = new HashMap<String, String>();
this.remotable = remotable;
+ this.defaultNamespace = defaultNamespace;
this.bundleManager = bundleManager;
}
@@ -133,6 +140,11 @@
return name;
}
+ public String getDefaultNamespace()
+ {
+ return defaultNamespace;
+ }
+
public ResourceBundleManager getBundleManager()
{
return bundleManager;
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -29,6 +29,7 @@
import org.jboss.portal.web.WebApp;
import org.jboss.portal.common.i18n.ResourceBundleManager;
import org.jboss.portal.common.i18n.ResourceBundleFactory;
+import org.jboss.portal.common.reflect.NoSuchClassException;
import java.util.Map;
import java.util.HashMap;
@@ -78,18 +79,23 @@
return bundleMgr;
}
- public Class getClass(String className)
+ public Class getClass(String className) throws IllegalArgumentException, NoSuchClassException
{
+ if (className == null)
+ {
+ throw new IllegalArgumentException("No null class name accepted");
+ }
try
{
return webApp.getClassLoader().loadClass(className);
}
catch (ClassNotFoundException e)
{
- e.printStackTrace();
-
- // todo
- return null;
+ throw new NoSuchClassException(className, e);
}
+ catch (NoClassDefFoundError e)
+ {
+ throw new NoSuchClassException(className, e);
+ }
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -67,6 +67,9 @@
/** Logger. */
protected final Logger log;
+ /** Return info. */
+ protected final ContainerPortletInfo info;
+
/** . */
protected PortletApplicationImpl application;
@@ -88,9 +91,6 @@
/** User data constraint. */
protected Set userDataConstraints;
- /** Return info. */
- protected ContainerPortletInfo info;
-
/**
* The preference validator, this is not exposed as runtime meta data as it is only used by the JSR 168 portlet
* container implementation.
@@ -99,6 +99,12 @@
public PortletContainerImpl(ContainerPortletInfo info)
{
+ if (info == null)
+ {
+ throw new IllegalArgumentException("No null info is accepted");
+ }
+
+ //
this.info = info;
this.valve = new Valve();
this.log = Logger.getLogger("org.jboss.portal.portlet.container." + info.getClassName().replace('.', '_'));
@@ -244,7 +250,6 @@
portlet = null;
config = null;
userDataConstraints = null;
- info = null;
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -24,7 +24,9 @@
import org.jboss.portal.common.i18n.ResourceBundleManager;
import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.common.util.Tools;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
+import org.jboss.portal.portlet.info.EventInfo;
import javax.portlet.PortletConfig;
import javax.portlet.PortletContext;
@@ -34,6 +36,8 @@
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -42,15 +46,40 @@
public class PortletConfigImpl implements PortletConfig
{
+ /** . */
private PortletContext portletContext;
+
+ /** . */
private ContainerPortletInfo info;
+
+ /** . */
private ResourceBundleManager bundleMgr;
+ /** . */
+ private List<QName> publishingEventQNames;
+
+ /** . */
+ private List<QName> processingEventQNames;
+
public PortletConfigImpl(PortletContext portletContext, ContainerPortletInfo info, ResourceBundleManager bundleMgr)
{
+ List<QName> publishingEventQNames = new ArrayList<QName>();
+ for (EventInfo event : info.getEvents().getProducedEvents())
+ {
+ publishingEventQNames.add(event.getName());
+ }
+
+ List<QName> processingEventQNames = new ArrayList<QName>();
+ for (EventInfo event : info.getEvents().getConsumedEvents())
+ {
+ processingEventQNames.add(event.getName());
+ }
+
this.portletContext = portletContext;
this.info = info;
this.bundleMgr = bundleMgr;
+ this.publishingEventQNames = publishingEventQNames;
+ this.processingEventQNames = processingEventQNames;
}
public String getPortletName()
@@ -90,17 +119,17 @@
public String getDefaultNamespace()
{
- throw new NotYetImplemented();
+ return info.getDefaultNamespace();
}
public Enumeration<QName> getPublishingEventQNames()
{
- throw new NotYetImplemented();
+ return Tools.toEnumeration(publishingEventQNames.iterator());
}
public Enumeration<QName> getProcessingEventQNames()
{
- throw new NotYetImplemented();
+ return Tools.toEnumeration(processingEventQNames.iterator());
}
public Enumeration<Locale> getSupportedLocales()
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventInfo.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventInfo.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -40,6 +40,11 @@
LocalizedString getDescription();
+ /**
+ * Returns the type of the event or null if the event does not declare a type.
+ *
+ * @return the type of the event
+ */
TypeInfo getType();
Collection<QName> getAliases();
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestParametersTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestParametersTestCase.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/IncludedRequestParametersTestCase.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -68,8 +68,8 @@
try
{
dispatcher.include(request, response);
- assertEquals("/test-jsr168-dispatcher/universalServletA/pathinfo", UTP1.local1.get());
- assertEquals("/test-jsr168-dispatcher", UTP1.local2.get());
+ assertEquals("/test-jsr168-tck-dispatcher/universalServletA/pathinfo", UTP1.local1.get());
+ assertEquals("/test-jsr168-tck-dispatcher", UTP1.local2.get());
assertEquals("/universalServletA", UTP1.local3.get());
assertEquals("/pathinfo", UTP1.local4.get());
assertEquals("foo=bar", UTP1.local5.get());
Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/NoEventTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/NoEventTestCase.java (rev 0)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/NoEventTestCase.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portletconfig;
+
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.xml.namespace.QName;
+import java.util.Enumeration;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR168_1000})
+public class NoEventTestCase
+{
+ public NoEventTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ //
+ Enumeration<QName> publishingEvents = cfg.getPublishingEventQNames();
+ assertNotNull(publishingEvents);
+ assertFalse(publishingEvents.hasMoreElements());
+
+ //
+ Enumeration<QName> processingEvents = cfg.getProcessingEventQNames();
+ assertNotNull(processingEvents);
+ assertFalse(processingEvents.hasMoreElements());
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/ProcessingEventTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/ProcessingEventTestCase.java (rev 0)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/ProcessingEventTestCase.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portletconfig;
+
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertFalse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletConfig;
+import javax.xml.namespace.QName;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR168_1000})
+public class ProcessingEventTestCase
+{
+ public ProcessingEventTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP3.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ //
+ Enumeration<QName> publishingEvents = cfg.getPublishingEventQNames();
+ assertNotNull(publishingEvents);
+ assertFalse(publishingEvents.hasMoreElements());
+
+ //
+ Enumeration<QName> processingEvents = cfg.getProcessingEventQNames();
+ assertNotNull(processingEvents);
+ List<QName> processingEventList = Tools.toList(processingEvents);
+ assertEquals(6, processingEventList.size());
+ assertEquals(PublishingEventTestCase.EVENT_NAMES, new HashSet<QName>(processingEventList));
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingEventTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingEventTestCase.java (rev 0)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingEventTestCase.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portletconfig;
+
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.*;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletConfig;
+import javax.xml.namespace.QName;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR168_1000})
+public class PublishingEventTestCase
+{
+
+ static final Set<QName> EVENT_NAMES = Collections.unmodifiableSet(Tools.toSet(
+ new QName("urn:explicit-namespace-1", "event1"),
+ new QName("urn:explicit-namespace-2", "event2"),
+ new QName("urn:default-namespace", "event3"),
+ new QName("urn:default-namespace", "event4"),
+ new QName("urn:default-namespace", "event5"),
+ new QName("urn:default-namespace", "event6")
+ ));
+
+
+ public PublishingEventTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP2.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ //
+ Enumeration<QName> publishingEvents = cfg.getPublishingEventQNames();
+ assertNotNull(publishingEvents);
+ List<QName> publishingEventList = Tools.toList(publishingEvents);
+ assertEquals(6, publishingEventList.size());
+ assertEquals(EVENT_NAMES, new HashSet<QName>(publishingEventList));
+
+ //
+ Enumeration<QName> processingEvents = cfg.getProcessingEventQNames();
+ assertNotNull(processingEvents);
+ assertFalse(processingEvents.hasMoreElements());
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingProcessingEventTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingProcessingEventTestCase.java (rev 0)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletconfig/PublishingProcessingEventTestCase.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portletconfig;
+
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.Assertion;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertFalse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletConfig;
+import javax.xml.namespace.QName;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+(a)TestCase({Assertion.JSR168_1000})
+public class PublishingProcessingEventTestCase
+{
+ public PublishingProcessingEventTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP4.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ //
+ Enumeration<QName> publishingEvents = cfg.getPublishingEventQNames();
+ assertNotNull(publishingEvents);
+ List<QName> publishingEventList = Tools.toList(publishingEvents);
+ assertEquals(6, publishingEventList.size());
+ assertEquals(PublishingEventTestCase.EVENT_NAMES, new HashSet<QName>(publishingEventList));
+
+ //
+ Enumeration<QName> processingEvents = cfg.getProcessingEventQNames();
+ assertNotNull(processingEvents);
+ List<QName> processingEventList = Tools.toList(processingEvents);
+ assertEquals(6, processingEventList.size());
+ assertEquals(PublishingEventTestCase.EVENT_NAMES, new HashSet<QName>(processingEventList));
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
\ No newline at end of file
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -315,7 +315,7 @@
public void testClonePortlet() throws Exception
{
PortletInfoSupport info = new PortletInfoSupport();
- info.getMetaSupport().setDisplayName("MyPortlet");
+ info.getMeta().setDisplayName("MyPortlet");
PortletContext popCtx = createPOPRef(info);
addPreference(popCtx, "abc", new StringValue("def"));
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Assertion.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Assertion.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/Assertion.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -425,6 +425,10 @@
" a PortletException. The root cause of the exception must be set to the original exception before being" +
" propagated."),
+
+ // ******************************************************************************************************************
+ JSR168_1000(new TCK(1000), "todo ???"),
+
;
/**
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/PortletTestSuite.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/PortletTestSuite.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/PortletTestSuite.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -58,7 +58,7 @@
{
/** . */
- private final Logger log = Logger.getLogger(getClass());
+ private static final Logger log = Logger.getLogger(PortletTestSuite.class);
/** . */
private PortletTestDriver driver;
@@ -113,7 +113,7 @@
if (assertion.getStatus() instanceof Assertion.Inactive)
{
active = false;
- log.error("Skip test case " + clazz.getName() + " because the assertion " + assertion.getRef() + " is not enabled");
+ log.debug("Skip test case " + clazz.getName() + " because the assertion " + assertion.getRef() + " is not enabled");
}
}
@@ -203,32 +203,38 @@
public void file(URL url, String name)
{
- try
+ StringBuffer tmp = new StringBuffer();
+ Iterator<String> i = packages.iterator();
+
+ // Skip "classes"
+ i.next();
+
+ // Iterate package names
+ while (i.hasNext())
{
- StringBuffer tmp = new StringBuffer();
- Iterator<String> i = packages.iterator();
+ tmp.append(i.next());
+ tmp.append('.');
+ }
- // Skip "classes"
- i.next();
+ // Append class name
+ tmp.append(name.substring(0, name.length() - ".class".length()));
- // Iterate package names
- while (i.hasNext())
- {
- tmp.append(i.next());
- tmp.append('.');
- }
+ //
+ String classname = tmp.toString();
- // Append class name
- tmp.append(name.substring(0, name.length() - ".class".length()));
-
- //
- String classname = tmp.toString();
+ //
+ try
+ {
Class clazz = loader.loadClass(classname);
classes.add(clazz);
}
+ catch (NoClassDefFoundError e)
+ {
+ log.error("Was not able to load class " + classname, e);
+ }
catch (ClassNotFoundException e)
{
- e.printStackTrace();
+ log.error("Was not able to load class " + classname, e);
}
}
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/AbstractUniversalTestPortlet.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/AbstractUniversalTestPortlet.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/base/AbstractUniversalTestPortlet.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -56,6 +56,18 @@
public abstract class AbstractUniversalTestPortlet implements Portlet
{
+ public static String getPortletName()
+ {
+ StackTraceElement elt = new Throwable().getStackTrace()[1];
+ String className = elt.getClassName();
+ int index = className.indexOf('.');
+ if (index != -1)
+ {
+ className = className.substring(index + 1);
+ }
+ return className;
+ }
+
/** . */
private final Logger log = createLogger();
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-01-12 23:16:50 UTC (rev 9486)
@@ -57,6 +57,8 @@
import java.util.Collections;
import java.util.LinkedList;
import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Set;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -78,13 +80,13 @@
private final PortletApplication10MetaData metaData;
/** . */
- private final LinkedList<String> installed;
+ private final LinkedHashMap<String, KernelControllerContext> installed;
/** . */
- private KernelControllerContext portletApplicationControllerContext;
+// private KernelControllerContext portletApplicationControllerContext;
/** . */
- private List<KernelControllerContext> portletContainerControllerContexts = new ArrayList<KernelControllerContext>();
+// private List<KernelControllerContext> portletContainerControllerContexts = new ArrayList<KernelControllerContext>();
/** . */
@@ -94,7 +96,7 @@
this.webApp = webApp;
this.metaData = metaData;
this.log = Logger.getLogger(PortletApplicationDeployment.class + "." + webApp.getContextPath().replace('.', '_'));
- this.installed = new LinkedList<String>();
+ this.installed = new LinkedHashMap<String, KernelControllerContext>();
}
void start()
@@ -114,19 +116,22 @@
builder.build();
//
+ List<AbstractBeanMetaData> toInstall = new ArrayList<AbstractBeanMetaData>();
+
+ //
for (ContainerPortletInfo containerInfo : builder.getContainerInfos())
{
//
String portletContainerId = "PortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
//
- AbstractBeanMetaData bmd = new AbstractBeanMetaData(portletContainerId, PortletContainerImpl.class.getName());
+ AbstractBeanMetaData portletBMD = new AbstractBeanMetaData(portletContainerId, PortletContainerImpl.class.getName());
AbstractConstructorMetaData ctormd = new AbstractConstructorMetaData();
ctormd.setParameters(Tools.toList((ParameterMetaData)new AbstractParameterMetaData(ContainerPortletInfo.class.getName(), containerInfo)));
- bmd.setConstructor(ctormd);
- bmd.setStart(new AbstractLifecycleMetaData("start"));
- bmd.setStop(new AbstractLifecycleMetaData("stop"));
- bmd.setProperties(Collections.singleton((PropertyMetaData)new AbstractPropertyMetaData("application", new AbstractDependencyValueMetaData(portletApplicationId))));
+ portletBMD.setConstructor(ctormd);
+ portletBMD.setStart(new AbstractLifecycleMetaData("start"));
+ portletBMD.setStop(new AbstractLifecycleMetaData("stop"));
+ portletBMD.setProperties(Collections.singleton((PropertyMetaData)new AbstractPropertyMetaData("application", new AbstractDependencyValueMetaData(portletApplicationId))));
AbstractInstallMetaData deployerinstallmd = new AbstractInstallMetaData();
deployerinstallmd.setBean("PortletApplicationDeployer");
deployerinstallmd.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
@@ -135,7 +140,7 @@
applicationinstallmd.setBean(portletApplicationId);
applicationinstallmd.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
applicationinstallmd.setMethodName("addContainer");
- bmd.setInstalls(Tools.toList((InstallMetaData)deployerinstallmd, applicationinstallmd));
+ portletBMD.setInstalls(Tools.toList((InstallMetaData)deployerinstallmd, applicationinstallmd));
AbstractInstallMetaData deployeruninstallmd = new AbstractInstallMetaData();
deployeruninstallmd.setBean("PortletApplicationDeployer");
deployeruninstallmd.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
@@ -144,56 +149,56 @@
applicationuninstallmd.setBean(portletApplicationId);
applicationuninstallmd.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
applicationuninstallmd.setMethodName("removeContainer");
- bmd.setUninstalls(Tools.toList((InstallMetaData)deployeruninstallmd, applicationuninstallmd));
- try
- {
- installed.addFirst(portletContainerId);
- KernelControllerContext portletContainerControllerContext = kernel.getController().install(bmd);
- portletContainerControllerContexts.add(portletContainerControllerContext);
- }
- catch (Throwable t)
- {
- log.debug("Cannot install portlet container " + containerInfo.getName() + " produced an error", t);
- }
+ portletBMD.setUninstalls(Tools.toList((InstallMetaData)deployeruninstallmd, applicationuninstallmd));
+ toInstall.add(portletBMD);
}
//
- AbstractBeanMetaData bmd = new AbstractBeanMetaData(portletApplicationId, PortletApplicationImpl.class.getName());
+ AbstractBeanMetaData applicationBMD = new AbstractBeanMetaData(portletApplicationId, PortletApplicationImpl.class.getName());
AbstractConstructorMetaData ctormd = new AbstractConstructorMetaData();
ctormd.setParameters(Tools.toList(
(ParameterMetaData)new AbstractParameterMetaData(PortletApplication10MetaData.class.getName(), metaData),
new AbstractParameterMetaData(JBossApplicationMetaData.class.getName(), (Object)null),
new AbstractParameterMetaData(PortletApplicationContext.class.getName(), this),
new AbstractParameterMetaData(PortletAPIFactory.class.getName(), new AbstractDependencyValueMetaData("PortletAPIFactory"))));
- bmd.setConstructor(ctormd);
- bmd.setStart(new AbstractLifecycleMetaData("start"));
- bmd.setStop(new AbstractLifecycleMetaData("stop"));
+ applicationBMD.setConstructor(ctormd);
+ applicationBMD.setStart(new AbstractLifecycleMetaData("start"));
+ applicationBMD.setStop(new AbstractLifecycleMetaData("stop"));
AbstractInstallMetaData installmd = new AbstractInstallMetaData();
installmd.setBean("PortletApplicationDeployer");
installmd.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
installmd.setMethodName("installPortletApplication");
- bmd.setInstalls(Collections.singletonList((InstallMetaData)installmd));
+ applicationBMD.setInstalls(Collections.singletonList((InstallMetaData)installmd));
AbstractInstallMetaData uninstallmd = new AbstractInstallMetaData();
uninstallmd.setBean("PortletApplicationDeployer");
uninstallmd.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
uninstallmd.setMethodName("uninstallPortletApplication");
- bmd.setUninstalls(Collections.singletonList((InstallMetaData)uninstallmd));
+ applicationBMD.setUninstalls(Collections.singletonList((InstallMetaData)uninstallmd));
+ toInstall.add(applicationBMD);
//
- try
+ for (AbstractBeanMetaData beanMetaData : toInstall)
{
- installed.addFirst(portletApplicationId);
- portletApplicationControllerContext = controller.install(bmd);
+ String beanName = beanMetaData.getName();
+ try
+ {
+ log.debug("Installing bean " + beanName);
+ KernelControllerContext kcc = controller.install(beanMetaData);
+ installed.put(beanName, kcc);
+ log.debug("Installed bean " + beanName);
+ logBeanFailure(kcc);
+ }
+ catch (Throwable throwable)
+ {
+ log.debug("Installation of bean " + beanName + " produced an error", throwable);
+ }
}
- catch (Throwable throwable)
+
+ // Print bean names
+ for (KernelControllerContext kcc : installed.values())
{
- log.debug("Installation of portlet application produced an error", throwable);
- }
- logBeanFailure(portletApplicationControllerContext);
- for (KernelControllerContext portletContainerControllerContext : portletContainerControllerContexts)
- {
- logBeanFailure(portletContainerControllerContext);
+ log.debug("Bean " + kcc.getName() + " was installed with state" + kcc.getState());
}
}
@@ -208,17 +213,21 @@
void stop()
{
- log.debug("Stopping installation");
+ log.debug("Uninstalling");
+ //
KernelController controller = kernel.getController();
- for (Iterator<String> i = installed.iterator();i.hasNext();)
+ //
+ List<String> beanNames = new ArrayList<String>(installed.keySet());
+ Collections.reverse(beanNames);
+ for (String beanName : beanNames)
{
- String beanName = i.next();
- i.remove();
try
{
+ log.debug("Uninstalling bean " + beanName);
controller.uninstall(beanName);
+ log.debug("Uninstalled bean " + beanName);
}
catch (Throwable t)
{
@@ -229,8 +238,11 @@
}
//
- portletApplicationControllerContext = null;
- portletContainerControllerContexts = null;
+ log.debug("Uninstalled");
+
+ //
+// portletApplicationControllerContext = null;
+// portletContainerControllerContexts = null;
}
public ServletContext getServletContext()
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-01-12 23:16:50 UTC (rev 9486)
@@ -103,74 +103,59 @@
<macrodef name="package-misc-test">
<attribute name="test"/>
<sequential>
- <mkdir dir="${target}/test-classes/jsr168/misc/@{test}-war/WEB-INF/classes"/>
- <copy todir="${target}/test-classes/jsr168/misc/@{test}-war/WEB-INF/classes">
- <fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/jsr168/misc/@{test}/**"/>
- <fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/framework/**"/>
- </copy>
- <mkdir dir="${target}/test-classes/jsr168/misc/@{test}-war/WEB-INF/lib"/>
- <jar jarfile="${test.temp.lib}/test-jsr168-misc-(a){test}.war">
- <fileset dir="${target}/test-classes/jsr168/misc/@{test}-war"/>
- </jar>
+ <package-testsuite testsuiteversion="jsr168" testsuitetype="misc" testsuitename="@{test}"/>
</sequential>
</macrodef>
<macrodef name="package-ext-test">
<attribute name="test"/>
<sequential>
- <mkdir dir="${target}/test-classes/jsr168/ext/@{test}-war/WEB-INF/classes"/>
- <copy todir="${target}/test-classes/jsr168/ext/@{test}-war/WEB-INF/classes">
- <fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/jsr168/ext/common/**"/>
- <fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/jsr168/ext/@{test}/**"/>
- <fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/framework/**"/>
- </copy>
- <mkdir dir="${target}/test-classes/jsr168/ext/@{test}-war/WEB-INF/lib"/>
- <copy todir="${target}/test-classes/jsr168/ext/@{test}-war/WEB-INF/lib">
- <fileset dir="${test.temp.lib}" includes="portal-portlet-test-framework-lib.jar"/>
- </copy>
- <jar jarfile="${test.temp.lib}/test-jsr168-ext-(a){test}.war">
- <fileset dir="${target}/test-classes/jsr168/ext/@{test}-war"/>
- </jar>
+ <package-testsuite testsuiteversion="jsr168" testsuitetype="ext" testsuitename="@{test}"/>
</sequential>
</macrodef>
<macrodef name="package-tck-test">
<attribute name="test"/>
<sequential>
- <mkdir dir="${target}/test-classes/jsr168/tck/@{test}-war/WEB-INF/classes"/>
- <copy todir="${target}/test-classes/jsr168/tck/@{test}-war/WEB-INF/classes">
- <fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/jsr168/tck/@{test}/**"/>
- <fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/framework/**"/>
- </copy>
- <mkdir dir="${target}/test-classes/jsr168/tck/@{test}-war/WEB-INF/lib"/>
- <copy todir="${target}/test-classes/jsr168/tck/@{test}-war/WEB-INF/lib">
- <fileset dir="${test.temp.lib}" includes="portal-portlet-test-framework-lib.jar"/>
- </copy>
- <jar jarfile="${test.temp.lib}/test-jsr168-(a){test}.war">
- <fileset dir="${target}/test-classes/jsr168/tck/@{test}-war"/>
- </jar>
+ <package-testsuite testsuiteversion="jsr168" testsuitetype="tck" testsuitename="@{test}"/>
</sequential>
</macrodef>
<macrodef name="package-api-test">
<attribute name="test"/>
<sequential>
- <mkdir dir="${target}/test-classes/jsr168/api/@{test}-war/WEB-INF/classes"/>
- <copy todir="${target}/test-classes/jsr168/api/@{test}-war/WEB-INF/classes">
- <fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/jsr168/api/@{test}/**"/>
+ <package-testsuite testsuiteversion="jsr168" testsuitetype="api" testsuitename="@{test}"/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="package-jsr286-tck-test">
+ <attribute name="test"/>
+ <sequential>
+ <package-testsuite testsuiteversion="jsr286" testsuitetype="tck" testsuitename="@{test}"/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="package-testsuite">
+ <attribute name="testsuiteversion"/>
+ <attribute name="testsuitetype"/>
+ <attribute name="testsuitename"/>
+ <sequential>
+ <mkdir dir="${target}/test-classes/@{testsuiteversion}/@{testsuitetype}/@{testsuitename}-war/WEB-INF/classes"/>
+ <copy todir="${target}/test-classes/@{testsuiteversion}/@{testsuitetype}/@{testsuitename}-war/WEB-INF/classes">
+ <fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/@{testsuiteversion}/@{testsuitetype}/common/**"/>
+ <fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/@{testsuiteversion}/@{testsuitetype}/@{testsuitename}/**"/>
<fileset dir="${test.temp.portlet}" includes="org/jboss/portal/test/portlet/framework/**"/>
</copy>
- <mkdir dir="${target}/test-classes/jsr168/api/@{test}-war/WEB-INF/lib"/>
- <copy todir="${target}/test-classes/jsr168/api/@{test}-war/WEB-INF/lib">
+ <mkdir dir="${target}/test-classes/@{testsuiteversion}/@{testsuitetype}/@{testsuitename}-war/WEB-INF/lib"/>
+ <copy todir="${target}/test-classes/@{testsuiteversion}/@{testsuitetype}/@{testsuitename}-war/WEB-INF/lib">
<fileset dir="${test.temp.lib}" includes="portal-portlet-test-framework-lib.jar"/>
</copy>
- <jar jarfile="${test.temp.lib}/test-jsr168-api-(a){test}.war">
- <fileset dir="${target}/test-classes/jsr168/api/@{test}-war"/>
+ <jar jarfile="${test.temp.lib}/test-@{testsuiteversion}-@{testsuitetype}-(a){testsuitename}.war">
+ <fileset dir="${target}/test-classes/@{testsuiteversion}/@{testsuitetype}/@{testsuitename}-war"/>
</jar>
</sequential>
</macrodef>
-
<target name="package-tests">
<unjar src="${dependency.portal-portlet-tests.test-jar}" dest="${test.temp.portlet}"/>
@@ -233,6 +218,7 @@
<package-misc-test test="log4j"/>
+ <package-jsr286-tck-test test="portletconfig"/>
<jar jarfile="${test.temp.lib}/portlet-test-lib.jar">
<fileset dir="${target}/test-classes"/>
@@ -539,7 +525,7 @@
<configuration>
<property name="cargo.servlet.port" value="8080"/>
<property name="cargo.logging" value="high"/>
- <!--<property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"/>-->
+ <!--<property name="cargo.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/>-->
<deployable type="war" file="${test.temp.lib}/manager.war"/>
<deployable type="war" file="${test.temp.lib}/tomcat-6.0/portlet-test.war"/>
</configuration>
@@ -587,7 +573,6 @@
<taskdef name="jboss-unit" classname="org.jboss.unit.tooling.ant.JBossUnitTask" classpath="${plugin_classpath}"/>
-
<jboss-unit>
<tests config="${target}/test-classes/test/remote-jboss-unit.xml" jpda="false">
Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/portlet.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/portlet.xml (rev 0)
+++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/portlet.xml 2008-01-12 23:16:50 UTC (rev 9486)
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+ <portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletB</portlet-name>
+ <portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-publishing-event>
+ <qname xmlns:a="urn:explicit-namespace-1">a:event1</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <qname xmlns:a="urn:explicit-namespace-2">a:event2</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <name>event3</name>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <qname xmlns:a="urn:default-namespace">a:event4</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <name>event5</name>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <qname xmlns:a="urn:default-namespace">a:event6</qname>
+ </supported-publishing-event>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletC</portlet-name>
+ <portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-processing-event>
+ <qname xmlns:a="urn:explicit-namespace-1">a:event1</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname xmlns:a="urn:explicit-namespace-2">a:event2</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <name>event3</name>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname xmlns:a="urn:default-namespace">a:event4</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <name>event5</name>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname xmlns:a="urn:default-namespace">a:event6</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletD</portlet-name>
+ <portlet-class>org.jboss.portal.test.portlet.framework.UTP4</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-processing-event>
+ <qname xmlns:a="urn:explicit-namespace-1">a:event1</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname xmlns:a="urn:explicit-namespace-2">a:event2</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <name>event3</name>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname xmlns:a="urn:default-namespace">a:event4</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <name>event5</name>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname xmlns:a="urn:default-namespace">a:event6</qname>
+ </supported-processing-event>
+ <supported-publishing-event>
+ <qname xmlns:a="urn:explicit-namespace-1">a:event1</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <qname xmlns:a="urn:explicit-namespace-2">a:event2</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <name>event3</name>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <qname xmlns:a="urn:default-namespace">a:event4</qname>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <name>event5</name>
+ </supported-publishing-event>
+ <supported-publishing-event>
+ <qname xmlns:a="urn:default-namespace">a:event6</qname>
+ </supported-publishing-event>
+ </portlet>
+
+ <default-namespace>urn:default-namespace</default-namespace>
+
+ <event-definition>
+ <qname xmlns:a="urn:explicit-namespace-1">a:event1</qname>
+ </event-definition>
+
+ <event-definition>
+ <qname xmlns:a="urn:explicit-namespace-2">a:event2</qname>
+ </event-definition>
+
+ <event-definition>
+ <name>event3</name>
+ </event-definition>
+
+ <event-definition>
+ <name>event4</name>
+ </event-definition>
+
+ <event-definition>
+ <qname xmlns:a="urn:default-namespace">a:event5</qname>
+ </event-definition>
+
+ <event-definition>
+ <qname xmlns:a="urn:default-namespace">a:event6</qname>
+ </event-definition>
+
+</portlet-app>
Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/web.xml (rev 0)
+++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portletconfig-war/WEB-INF/web.xml 2008-01-12 23:16:50 UTC (rev 9486)
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <listener>
+ <listener-class>org.jboss.portal.unit.PortletTestSuite</listener-class>
+ </listener>
+</web-app>
Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-01-12 22:17:37 UTC (rev 9485)
+++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-01-12 23:16:50 UTC (rev 9486)
@@ -7,47 +7,47 @@
<!--Spec TCK Assertions tests-->
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-dispatcher.war"/>
+ <property name="archiveId" value="test-jsr168-tck-dispatcher.war"/>
</generic>
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-portletconfig.war"/>
+ <property name="archiveId" value="test-jsr168-tck-portletconfig.war"/>
</generic>
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-portletcontext.war"/>
+ <property name="archiveId" value="test-jsr168-tck-portletcontext.war"/>
</generic>
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-portletinterface.war"/>
+ <property name="archiveId" value="test-jsr168-tck-portletinterface.war"/>
</generic>
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-portletmode.war"/>
+ <property name="archiveId" value="test-jsr168-tck-portletmode.war"/>
</generic>
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-portletrequests.war"/>
+ <property name="archiveId" value="test-jsr168-tck-portletrequests.war"/>
</generic>
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-portletresponses.war"/>
+ <property name="archiveId" value="test-jsr168-tck-portletresponses.war"/>
</generic>
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-portletsession.war"/>
+ <property name="archiveId" value="test-jsr168-tck-portletsession.war"/>
</generic>
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-portleturl.war"/>
+ <property name="archiveId" value="test-jsr168-tck-portleturl.war"/>
</generic>
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-preferences.war"/>
+ <property name="archiveId" value="test-jsr168-tck-preferences.war"/>
</generic>
<generic>
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
- <property name="archiveId" value="test-jsr168-windowstates.war"/>
+ <property name="archiveId" value="test-jsr168-tck-windowstates.war"/>
</generic>
<!--API Tests-->
@@ -146,6 +146,12 @@
<property name="archiveId" value="test-jsr168-ext-nocache.war"/>
</generic>
+ <!--Spec TCK Assertions tests-->
+ <generic>
+ <class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
+ <property name="archiveId" value="test-jsr286-tck-portletconfig.war"/>
+ </generic>
+
<!--Misc Tests-->
<!--
<generic>
18 years, 3 months
JBoss Portal SVN: r9485 - modules/common/trunk/common/src/main/java/org/jboss/portal/common/reflect.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-12 17:17:37 -0500 (Sat, 12 Jan 2008)
New Revision: 9485
Added:
modules/common/trunk/common/src/main/java/org/jboss/portal/common/reflect/NoSuchClassException.java
Log:
Added a reusable exception that signal a class loading error.
Added: modules/common/trunk/common/src/main/java/org/jboss/portal/common/reflect/NoSuchClassException.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/reflect/NoSuchClassException.java (rev 0)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/reflect/NoSuchClassException.java 2008-01-12 22:17:37 UTC (rev 9485)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.common.reflect;
+
+/**
+ * A generic exception that can be reused when an API expose a class loading service.
+ * The goal is to wrap any kind of throwable that would signal a class loading failure such
+ * as <code>NoClassDefFoundError</code> or <code>ClassNotFoundException</code> and make the client
+ * of the API deal with only one kind of exception.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class NoSuchClassException extends Exception
+{
+
+ /** . */
+ private final String className;
+
+ public NoSuchClassException(String className)
+ {
+ this.className = className;
+ }
+
+ public NoSuchClassException(String className, String message)
+ {
+ super(message);
+
+ //
+ this.className = className;
+ }
+
+ public NoSuchClassException(String className, String message, Throwable cause)
+ {
+ super(message, cause);
+
+ //
+ this.className = className;
+ }
+
+ public NoSuchClassException(String className, Throwable cause)
+ {
+ super(cause);
+
+ //
+ this.className = className;
+ }
+
+ public String getClassName()
+ {
+ return className;
+ }
+}
18 years, 3 months
JBoss Portal SVN: r9484 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/container and 6 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-11 11:23:48 -0500 (Fri, 11 Jan 2008)
New Revision: 9484
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventsInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerTypeInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventsInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/TypeInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventInfoSupport.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventsInfoSupport.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/TypeInfoSupport.java
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfoBuilder.java
Modified:
modules/portlet/trunk/federation/src/test/java/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PortletInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/PortletInfoSupport.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/PortletInvokerSupport.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
Log:
- preliminary implemenation for portlet event runtime info
- now ContainerPortletInfoBuilder has been renamed ContainerInfoBuilder and build the info of all portlet containers
- introduced ContainerInfoBuilderContext which provides the necessary callbacks for using a ContainerInfoBuilder
Modified: modules/portlet/trunk/federation/src/test/java/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java
===================================================================
--- modules/portlet/trunk/federation/src/test/java/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java 2008-01-10 23:37:38 UTC (rev 9483)
+++ modules/portlet/trunk/federation/src/test/java/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -75,7 +75,7 @@
// Configure
PortletInfoSupport fooInfo = federatedPortlet.getInfoSupport();
- fooInfo.getMetaSupport().setDisplayName("FooPortlet");
+ fooInfo.getMeta().setDisplayName("FooPortlet");
// Wire
federatedInvoker.addInternalPortlet("MyPortlet", federatedPortlet);
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2008-01-10 23:37:38 UTC (rev 9483)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -28,17 +28,14 @@
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
+import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImpl;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
-import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
-import org.jboss.portal.portlet.impl.info.ContainerPortletInfoBuilder;
+import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder;
+import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
-import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
-import org.jboss.portal.common.i18n.ResourceBundleFactory;
-import org.jboss.portal.common.i18n.SimpleResourceBundleFactory;
-import org.jboss.portal.common.i18n.ResourceBundleManager;
import javax.servlet.ServletContext;
@@ -110,8 +107,13 @@
//
registrationContext = registry.registerPortletApplication(portletApp);
+ // Fixme here need the web App
+ ContainerInfoBuilderContext builderContext = new ContainerInfoBuilderContextImpl(portletAppMD, null);
+ ContainerInfoBuilder builder = new ContainerInfoBuilder(portletAppMD, builderContext);
+ builder.build();
+
//
- for (PortletMetaData portletMD : portletAppMD.getPortlets().values())
+ for (ContainerPortletInfo containerInfo : builder.getContainerInfos())
{
// JBossPortletMetaData jBossPortletMD = null;
// if (jbossAppMD != null)
@@ -119,16 +121,9 @@
// jBossPortletMD = (JBossPortletMetaData)jbossAppMD.getPortlets().get(portletMD.getName());
// }
- // Create resource bundle manager
- String baseName = portletMD.getResourceBundle();
- ResourceBundleFactory rbf = new SimpleResourceBundleFactory(baseName, classLoader);
- ResourceBundleManager bundleMgr = new ResourceBundleManager(null, rbf);
- // Build container info
- ContainerPortletInfo containerInfo = new ContainerPortletInfoBuilder(portletMD, bundleMgr).build();
-
//
- PortletContainerImpl container = new PortletContainerImpl(containerInfo, bundleMgr);
+ PortletContainerImpl container = new PortletContainerImpl(containerInfo);
//
container.setApplication(portletApp);
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventInfo.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.info;
+
+import org.jboss.portal.portlet.info.EventInfo;
+import org.jboss.portal.common.i18n.LocalizedString;
+
+import javax.xml.namespace.QName;
+import java.util.List;
+import java.util.Collection;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerEventInfo implements EventInfo
+{
+
+ /** . */
+ private QName name;
+
+ /** . */
+ private ContainerTypeInfo type;
+
+ /** . */
+ private LocalizedString displayName;
+
+ /** . */
+ private LocalizedString description;
+
+ /** . */
+ private List<QName> aliases;
+
+ public ContainerEventInfo(
+ QName name,
+ ContainerTypeInfo type,
+ LocalizedString displayName,
+ LocalizedString description)
+ {
+ this.name = name;
+ this.type = type;
+ this.displayName = displayName;
+ this.description = description;
+ this.aliases = new ArrayList<QName>();
+ }
+
+ public void addAlias(QName alias)
+ {
+ aliases.add(alias);
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public ContainerTypeInfo getType()
+ {
+ return type;
+ }
+
+ public Collection<QName> getAliases()
+ {
+ return aliases;
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventsInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventsInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerEventsInfo.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.info;
+
+import org.jboss.portal.portlet.info.EventsInfo;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerEventsInfo implements EventsInfo
+{
+
+ /** . */
+ private final List<ContainerEventInfo> producedEvents;
+
+ /** . */
+ private final List<ContainerEventInfo> consumedEvents;
+
+ public ContainerEventsInfo()
+ {
+ producedEvents = new ArrayList<ContainerEventInfo>();
+ consumedEvents = new ArrayList<ContainerEventInfo>();
+ }
+
+ public void addProducedEvent(ContainerEventInfo producedEvent)
+ {
+ producedEvents.add(producedEvent);
+ }
+
+ public void addConsumedEvent(ContainerEventInfo consumedEvent)
+ {
+ consumedEvents.add(consumedEvent);
+ }
+
+ public Collection<ContainerEventInfo> getProducedEvents()
+ {
+ return producedEvents;
+ }
+
+ public Collection<ContainerEventInfo> getConsumedEvents()
+ {
+ return consumedEvents;
+ }
+}
Copied: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java (from rev 9481, modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfoBuilder.java)
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,482 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.info;
+
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferenceMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportedLocaleMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportsMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletModeMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SecurityRoleRefMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferencesMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.WindowStateMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
+import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferenceMetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.Mode;
+
+import javax.xml.namespace.QName;
+import java.util.Locale;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ResourceBundle;
+import java.util.MissingResourceException;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerInfoBuilder
+{
+
+ /** . */
+ private static final String[] KEYS = {MetaInfo.TITLE, MetaInfo.SHORT_TITLE, MetaInfo.KEYWORDS};
+
+ /** . */
+ private static final String JAVAX_PORTLET = "javax.portlet.";
+
+ /** . */
+ private static final String[] BUNDLE_KEYS = {JAVAX_PORTLET + MetaInfo.TITLE, JAVAX_PORTLET + MetaInfo.SHORT_TITLE, JAVAX_PORTLET + MetaInfo.KEYWORDS};
+
+ /** . */
+ private final PortletApplication10MetaData portletApplicationMD;
+
+ /** . */
+ private final ContainerInfoBuilderContext context;
+
+ /** . */
+ private final List<ContainerPortletInfo> containerInfos;
+
+ /** . */
+ private final Map<QName, ContainerEventInfo> events;
+
+ public ContainerInfoBuilder(
+ PortletApplication10MetaData portletApplicationMD,
+ ContainerInfoBuilderContext context)
+ {
+ this.portletApplicationMD = portletApplicationMD;
+ this.context = context;
+ this.containerInfos = new ArrayList<ContainerPortletInfo>();
+ this.events = new HashMap<QName, ContainerEventInfo>();
+ }
+
+ public List<ContainerPortletInfo> getContainerInfos()
+ {
+ return containerInfos;
+ }
+
+ private void fixMetaData()
+ {
+ if (portletApplicationMD instanceof PortletApplication20MetaData)
+ {
+ PortletApplication20MetaData tmp = (PortletApplication20MetaData)portletApplicationMD;
+ if (tmp.getEvents() == null)
+ {
+ tmp.setEvents(new ArrayList<EventDefinitionMetaData>());
+ }
+ }
+ }
+
+ private void fixMetaData(PortletMetaData portletMD)
+ {
+ if (portletMD.getSecurityRoleRef() == null)
+ {
+ portletMD.setSecurityRoleRef(new ArrayList<SecurityRoleRefMetaData>());
+ }
+ if (portletMD.getPortletApplication().getSecurityConstraints() == null)
+ {
+ portletMD.getPortletApplication().setSecurityConstraints(new ArrayList<SecurityConstraintMetaData>());
+ }
+ if (portletMD.getSupportedLocale() == null)
+ {
+ portletMD.setSupportedLocale(new ArrayList<SupportedLocaleMetaData>());
+ }
+ for (SupportsMetaData supportsMD : portletMD.getSupports())
+ {
+ if (supportsMD.getPortletModes() == null)
+ {
+ supportsMD.setPortletModes(new ArrayList<PortletModeMetaData>());
+ }
+ if (supportsMD.getWindowStates() == null)
+ {
+ supportsMD.setWindowStates(new ArrayList<WindowStateMetaData>());
+ }
+ }
+ if (portletMD.getPortletPreferences() == null)
+ {
+ portletMD.setPortletPreferences(new PortletPreferencesMetaData());
+ }
+ if (portletMD.getPortletPreferences().getPortletPreferences() == null)
+ {
+ portletMD.getPortletPreferences().setPortletPreferences(new HashMap<String, PortletPreferenceMetaData>());
+ }
+ if (portletMD.getInitParams() == null)
+ {
+ portletMD.setInitParams(new ArrayList<InitParamMetaData>());
+ }
+ for (PortletPreferenceMetaData portletPreferenceMD : portletMD.getPortletPreferences().getPortletPreferences().values())
+ {
+ if (portletPreferenceMD.getValue() == null)
+ {
+ portletPreferenceMD.setValue(new ArrayList<String>());
+ }
+ }
+
+ //
+ if (portletApplicationMD instanceof PortletApplication20MetaData)
+ {
+ if (portletMD.getSupportedProcessingEvent() == null)
+ {
+ portletMD.setSupportedProcessingEvent(new ArrayList<EventDefinitionReferenceMetaData>());
+ }
+ if (portletMD.getSupportedPublishingEvent() == null)
+ {
+ portletMD.setSupportedPublishingEvent(new ArrayList<EventDefinitionReferenceMetaData>());
+ }
+ }
+ }
+
+ private QName getName(QName name, String localPart)
+ {
+ if (name == null)
+ {
+ String namespaceURI = ((PortletApplication20MetaData)portletApplicationMD).getDefaultNamespace().toString();
+ return new QName(namespaceURI, localPart);
+ }
+ else
+ {
+ return name;
+ }
+ }
+
+ private List<Locale> getSupportedLocales(PortletMetaData portletMD)
+ {
+ List<Locale> locales = new ArrayList<Locale>();
+ for (SupportedLocaleMetaData supportedLocaleMD : portletMD.getSupportedLocale())
+ {
+ Locale locale = supportedLocaleMD.getLocale();
+ locales.add(locale);
+ }
+ return locales;
+ }
+
+ public void build()
+ {
+ fixMetaData();
+
+ //
+ if (portletApplicationMD instanceof PortletApplication20MetaData)
+ {
+ PortletApplication20MetaData tmp = (PortletApplication20MetaData)portletApplicationMD;
+
+ //
+ for (EventDefinitionMetaData eventDefinitionMD : tmp.getEvents())
+ {
+ ContainerEventInfo event = build(eventDefinitionMD);
+ events.put(event.getName(), event);
+ }
+ }
+
+ //
+ for (PortletMetaData portletMD : portletApplicationMD.getPortletCollection())
+ {
+ ContainerPortletInfo portletInfo = build(portletMD);
+ containerInfos.add(portletInfo);
+ }
+ }
+
+ private ContainerEventInfo build(EventDefinitionMetaData eventDefinitionMD)
+ {
+ QName name = getName(eventDefinitionMD.getQname(), eventDefinitionMD.getName());
+ ResourceBundleManager bundleMgr = context.getBundleManager();
+
+ //
+ String valueType = eventDefinitionMD.getValueType();
+ Class clazz = context.getClass(valueType);
+
+ //
+ LocalizedString displayName = bundleMgr.getLocalizedValue("javax.portlet.app.event-definition.." + name + ".display-name", "Event " + name);
+ LocalizedString description = bundleMgr.getLocalizedValue("javax.portlet.app.event-definition." + name + ".description", "Description of event " + name);
+
+ //
+ ContainerTypeInfo type = new ContainerTypeInfo(clazz);
+ return new ContainerEventInfo(name, type, displayName, description);
+ }
+
+ private ContainerPortletInfo build(PortletMetaData portletMD)
+ {
+ fixMetaData(portletMD);
+
+ //
+ ContainerCapabilitiesInfo containerCapabilities = buildContainerCapabilities(portletMD);
+ ContainerPreferencesInfo containerPreferences = buildContainerPreferences(portletMD);
+ ContainerMetaInfo containerMeta = buildContainerMeta(portletMD);
+ ContainerSecurityInfo containerSecurity = buildContainerSecurityInfo(portletMD);
+ ContainerCacheInfo containerCache = buildContainerCache(portletMD);
+ ContainerSessionInfo containerSession = buildContainerSession(portletMD);
+
+ //
+ ContainerPortletInfo containerPortletInfo;
+ if (portletApplicationMD instanceof PortletApplication20MetaData)
+ {
+ ContainerEventsInfo containerEvents = buildContainerEventsInfo(portletMD);
+
+ //
+ containerPortletInfo = new ContainerPortletInfo(
+ containerCapabilities,
+ containerPreferences,
+ containerMeta,
+ containerSecurity,
+ containerCache,
+ containerSession,
+ containerEvents,
+ portletMD.getPortletName(),
+ portletMD.getPortletClass(),
+ false,
+ context.getBundleManager(portletMD)
+ );
+ }
+ else
+ {
+ containerPortletInfo = new ContainerPortletInfo(
+ containerCapabilities,
+ containerPreferences,
+ containerMeta,
+ containerSecurity,
+ containerCache,
+ containerSession,
+ portletMD.getPortletName(),
+ portletMD.getPortletClass(),
+ false,
+ context.getBundleManager(portletMD)
+ );
+ }
+
+ //
+ for (InitParamMetaData initParamMD : portletMD.getInitParams())
+ {
+ containerPortletInfo.addInitParameter(initParamMD.getName(), initParamMD.getValue());
+ }
+
+ //
+ return containerPortletInfo;
+ }
+
+ private ContainerEventsInfo buildContainerEventsInfo(PortletMetaData portletMD)
+ {
+ ContainerEventsInfo portletEvents = new ContainerEventsInfo();
+
+ //
+ for (EventDefinitionReferenceMetaData eventDefinitionReferenceMD : portletMD.getSupportedProcessingEvent())
+ {
+ QName name = getName(eventDefinitionReferenceMD.getQname(), eventDefinitionReferenceMD.getName());
+ ContainerEventInfo event = events.get(name);
+ portletEvents.addConsumedEvent(event);
+ }
+
+ //
+ for (EventDefinitionReferenceMetaData eventDefinitionReferenceMD : portletMD.getSupportedPublishingEvent())
+ {
+ QName name = getName(eventDefinitionReferenceMD.getQname(), eventDefinitionReferenceMD.getName());
+ ContainerEventInfo event = events.get(name);
+ portletEvents.addProducedEvent(event);
+ }
+
+ //
+ return portletEvents;
+ }
+
+ private ContainerSecurityInfo buildContainerSecurityInfo(PortletMetaData portletMD)
+ {
+ ContainerSecurityInfo containerSecurity = new ContainerSecurityInfo();
+
+ // Security role ref
+ for (SecurityRoleRefMetaData securityRoleRefMD : portletMD.getSecurityRoleRef())
+ {
+ containerSecurity.addRoleRef(securityRoleRefMD.getRoleName(), securityRoleRefMD.getRoleLink());
+ }
+
+ //
+ for (SecurityConstraintMetaData securityConstraintMD : portletMD.getPortletApplication().getSecurityConstraints())
+ {
+ if (securityConstraintMD.getPortletList().getPortletNames().contains(portletMD.getPortletName()))
+ {
+ containerSecurity.addTransportGuarantee(securityConstraintMD.getUserDataConstraint().getTransportQuarantee());
+ }
+ }
+
+ //
+ return containerSecurity;
+ }
+
+ private ContainerSessionInfo buildContainerSession(PortletMetaData portletMD)
+ {
+ return new ContainerSessionInfo(false);
+ }
+
+ private ContainerCacheInfo buildContainerCache(PortletMetaData portletMD)
+ {
+ int expirationCache = portletMD.getExpirationCache();
+
+ //
+ if (expirationCache < 0 && expirationCache != -1)
+ {
+ // log.warn("Seen bad caching expiration value " + expirationTimeSecs + " disable caching instead");
+ expirationCache = 0;
+ }
+
+ //
+ return new ContainerCacheInfo(expirationCache);
+ }
+
+ private ContainerCapabilitiesInfo buildContainerCapabilities(PortletMetaData portletMD)
+ {
+ ContainerCapabilitiesInfo capabilities = new ContainerCapabilitiesInfo();
+
+ //
+ for (SupportsMetaData supportsMD : portletMD.getSupports())
+ {
+ // Get the mime type
+ String mimeType = supportsMD.getMimeType().toLowerCase();
+
+ // Add the content type to the view mode
+ // because each content type must handle this view
+ capabilities.add(mimeType, Mode.VIEW);
+
+ // Then process each mode
+ for (PortletModeMetaData modeMD : supportsMD.getPortletModes())
+ {
+ capabilities.add(mimeType, modeMD.getPortletMode());
+ }
+ }
+
+ //
+ return capabilities;
+ }
+
+ private ContainerMetaInfo buildContainerMeta(PortletMetaData portletMD)
+ {
+ ContainerMetaInfo containerMeta = new ContainerMetaInfo();
+
+ //
+ ResourceBundleManager bundleMgr = context.getBundleManager(portletMD);
+
+ // Capture inline values
+ String[] inlines = {
+ portletMD.getPortletInfo().getTitle(),
+ portletMD.getPortletInfo().getShortTitle(),
+ portletMD.getPortletInfo().getKeywords()
+ };
+
+ // Construct info from resource bundle manager
+ for (int i = 0; i < KEYS.length; i++)
+ {
+ String key = KEYS[i];
+
+ //
+ Map<Locale, String> tmp = new HashMap<Locale, String>();
+
+ //
+ List<Locale> locales = getSupportedLocales(portletMD);
+
+ // Add english locale
+ locales.add(Locale.ENGLISH);
+
+ // Feed with the known locales (perhaps should try more locales)
+ for (Locale locale : locales)
+ {
+ ResourceBundle bundle = bundleMgr.getResourceBundle(locale);
+
+ //
+ if (bundle != null)
+ {
+ try
+ {
+ String value = bundle.getString(BUNDLE_KEYS[i]);
+ tmp.put(locale, value);
+ }
+ catch (MissingResourceException ignore)
+ {
+ }
+ }
+ }
+
+ // Add the inline value if it is present
+ if (inlines[i] != null)
+ {
+ tmp.put(Locale.ENGLISH, inlines[i]);
+ }
+
+ //
+ LocalizedString ls = new LocalizedString(tmp, Locale.ENGLISH);
+ containerMeta.addMetaValue(key, ls);
+ }
+
+ // Add stuff coming from deployment descriptor
+ containerMeta.addMetaValue(MetaInfo.DESCRIPTION, portletMD.getDescription());
+ containerMeta.addMetaValue(MetaInfo.DISPLAY_NAME, portletMD.getDisplayName());
+
+ //
+ return containerMeta;
+ }
+
+ private ContainerPreferencesInfo buildContainerPreferences(PortletMetaData portletMD)
+ {
+ PortletPreferencesMetaData preferencesMD = portletMD.getPortletPreferences();
+
+ //
+ String validatorClassName = null;
+ if (preferencesMD != null)
+ {
+ validatorClassName = preferencesMD.getPreferenceValidator();
+ }
+
+ //
+ ContainerPreferencesInfo containerPreferences = new ContainerPreferencesInfo(validatorClassName);
+
+ //
+ ResourceBundleManager bundleMgr = context.getBundleManager(portletMD);
+
+ //
+ for (PortletPreferenceMetaData portletPreferenceMD : preferencesMD.getPortletPreferences().values())
+ {
+ Value value = new StringValue(portletPreferenceMD.getValue());
+ LocalizedString displayName = bundleMgr.getLocalizedValue("javax.portlet.preference.name." + portletPreferenceMD.getName(), portletPreferenceMD.getName());
+ LocalizedString description = bundleMgr.getLocalizedValue("javax.portlet.preference.description." + portletPreferenceMD.getName(), portletPreferenceMD.getName());
+ containerPreferences.addContainerPreference(portletPreferenceMD.getName(), value, portletPreferenceMD.isReadOnly(), displayName, description);
+ }
+
+ //
+ return containerPreferences;
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilderContext.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.info;
+
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface ContainerInfoBuilderContext
+{
+
+ ResourceBundleManager getBundleManager();
+
+ ResourceBundleManager getBundleManager(PortletMetaData portletMD);
+
+ Class getClass(String className);
+
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java 2008-01-10 23:37:38 UTC (rev 9483)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.impl.info;
import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
import java.util.Map;
import java.util.HashMap;
@@ -39,35 +40,41 @@
{
/** . */
- private ContainerCapabilitiesInfo capabilities;
+ private final ContainerCapabilitiesInfo capabilities;
/** . */
- private ContainerPreferencesInfo preferences;
+ private final ContainerPreferencesInfo preferences;
/** . */
- private ContainerMetaInfo meta;
+ private final ContainerMetaInfo meta;
/** . */
- private ContainerSecurityInfo security;
+ private final ContainerSecurityInfo security;
/** . */
- private ContainerCacheInfo cache;
+ private final ContainerCacheInfo cache;
/** . */
- private ContainerSessionInfo session;
+ private final ContainerSessionInfo session;
/** . */
- private String name;
+ private final ContainerEventsInfo events;
/** . */
- private String className;
+ private final String name;
/** . */
- private Map<String, String> initParameters;
+ private final String className;
/** . */
- private Boolean remotable;
+ private final Map<String, String> initParameters;
+ /** . */
+ private final Boolean remotable;
+
+ /** . */
+ private ResourceBundleManager bundleManager;
+
public ContainerPortletInfo(
ContainerCapabilitiesInfo capabilities,
ContainerPreferencesInfo preferences,
@@ -77,7 +84,8 @@
ContainerSessionInfo session,
String name,
String className,
- Boolean remotable)
+ Boolean remotable,
+ ResourceBundleManager bundleManager)
{
this.capabilities = capabilities;
this.preferences = preferences;
@@ -85,17 +93,51 @@
this.security = security;
this.cache = cache;
this.session = session;
+ this.events = null;
this.name = name;
this.className = className;
this.initParameters = new HashMap<String, String>();
this.remotable = remotable;
+ this.bundleManager = bundleManager;
}
+ public ContainerPortletInfo(
+ ContainerCapabilitiesInfo capabilities,
+ ContainerPreferencesInfo preferences,
+ ContainerMetaInfo meta,
+ ContainerSecurityInfo security,
+ ContainerCacheInfo cache,
+ ContainerSessionInfo session,
+ ContainerEventsInfo events,
+ String name,
+ String className,
+ Boolean remotable,
+ ResourceBundleManager bundleManager)
+ {
+ this.capabilities = capabilities;
+ this.preferences = preferences;
+ this.meta = meta;
+ this.security = security;
+ this.cache = cache;
+ this.session = session;
+ this.events = events;
+ this.name = name;
+ this.className = className;
+ this.initParameters = new HashMap<String, String>();
+ this.remotable = remotable;
+ this.bundleManager = bundleManager;
+ }
+
public String getName()
{
return name;
}
+ public ResourceBundleManager getBundleManager()
+ {
+ return bundleManager;
+ }
+
public String getClassName()
{
return className;
@@ -150,4 +192,9 @@
{
return remotable;
}
+
+ public ContainerEventsInfo getEvents()
+ {
+ return events;
+ }
}
\ No newline at end of file
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfoBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfoBuilder.java 2008-01-10 23:37:38 UTC (rev 9483)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfoBuilder.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -1,327 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.info;
-
-import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
-import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferenceMetaData;
-import org.jboss.portal.portlet.impl.metadata.portlet.SupportedLocaleMetaData;
-import org.jboss.portal.portlet.impl.metadata.portlet.SupportsMetaData;
-import org.jboss.portal.portlet.impl.metadata.portlet.PortletModeMetaData;
-import org.jboss.portal.portlet.impl.metadata.portlet.SecurityRoleRefMetaData;
-import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferencesMetaData;
-import org.jboss.portal.portlet.impl.metadata.portlet.WindowStateMetaData;
-import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
-import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
-import org.jboss.portal.portlet.info.MetaInfo;
-import org.jboss.portal.common.value.Value;
-import org.jboss.portal.common.value.StringValue;
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portal.common.i18n.ResourceBundleManager;
-import org.jboss.portal.Mode;
-
-import java.util.Locale;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.List;
-import java.util.ResourceBundle;
-import java.util.MissingResourceException;
-import java.util.ArrayList;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ContainerPortletInfoBuilder
-{
-
- /** . */
- private static final String[] KEYS = {MetaInfo.TITLE, MetaInfo.SHORT_TITLE, MetaInfo.KEYWORDS};
-
- /** . */
- private static final String JAVAX_PORTLET = "javax.portlet.";
-
- /** . */
- private static final String[] BUNDLE_KEYS = {JAVAX_PORTLET + MetaInfo.TITLE, JAVAX_PORTLET + MetaInfo.SHORT_TITLE, JAVAX_PORTLET + MetaInfo.KEYWORDS};
-
- /** . */
- private PortletMetaData portletMD;
-
- /** . */
- private ResourceBundleManager bundleMgr;
-
- public ContainerPortletInfoBuilder(PortletMetaData portletMD, ResourceBundleManager bundleMgr)
- {
- this.portletMD = portletMD;
- this.bundleMgr = bundleMgr;
- }
-
- public ContainerPortletInfo build()
- {
- fixMetaData();
-
- //
- ContainerCapabilitiesInfo containerCapabilities = buildContainerCapabilities();
- ContainerPreferencesInfo containerPreferences = buildContainerPreferences();
- ContainerMetaInfo containerMeta = buildContainerMeta();
- ContainerSecurityInfo containerSecurity = buildContainerSecurityInfo();
- ContainerCacheInfo containerCache = buildContainerCache();
- ContainerSessionInfo containerSession = buildContainerSession();
-
- //
- ContainerPortletInfo containerPortletInfo = new ContainerPortletInfo(
- containerCapabilities,
- containerPreferences,
- containerMeta,
- containerSecurity,
- containerCache,
- containerSession,
- portletMD.getPortletName(),
- portletMD.getPortletClass(),
- false
- );
-
- //
- for (InitParamMetaData initParamMD : portletMD.getInitParams())
- {
- containerPortletInfo.addInitParameter(initParamMD.getName(), initParamMD.getValue());
- }
-
- //
- return containerPortletInfo;
- }
-
- private void fixMetaData()
- {
- if (portletMD.getSecurityRoleRef() == null)
- {
- portletMD.setSecurityRoleRef(new ArrayList<SecurityRoleRefMetaData>());
- }
- if (portletMD.getPortletApplication().getSecurityConstraints() == null)
- {
- portletMD.getPortletApplication().setSecurityConstraints(new ArrayList<SecurityConstraintMetaData>());
- }
- if (portletMD.getSupportedLocale() == null)
- {
- portletMD.setSupportedLocale(new ArrayList<SupportedLocaleMetaData>());
- }
- for (SupportsMetaData supportsMD : portletMD.getSupports())
- {
- if (supportsMD.getPortletModes() == null)
- {
- supportsMD.setPortletModes(new ArrayList<PortletModeMetaData>());
- }
- if (supportsMD.getWindowStates() == null)
- {
- supportsMD.setWindowStates(new ArrayList<WindowStateMetaData>());
- }
- }
- if (portletMD.getPortletPreferences() == null)
- {
- portletMD.setPortletPreferences(new PortletPreferencesMetaData());
- }
- if (portletMD.getPortletPreferences().getPortletPreferences() == null)
- {
- portletMD.getPortletPreferences().setPortletPreferences(new HashMap<String, PortletPreferenceMetaData>());
- }
- if (portletMD.getInitParams() == null)
- {
- portletMD.setInitParams(new ArrayList<InitParamMetaData>());
- }
- for (PortletPreferenceMetaData portletPreferenceMD : portletMD.getPortletPreferences().getPortletPreferences().values())
- {
- if (portletPreferenceMD.getValue() == null)
- {
- portletPreferenceMD.setValue(new ArrayList<String>());
- }
- }
- }
-
- private List<Locale> getSupportedLocales()
- {
- List<Locale> locales = new ArrayList<Locale>();
- for (SupportedLocaleMetaData supportedLocaleMD : portletMD.getSupportedLocale())
- {
- Locale locale = supportedLocaleMD.getLocale();
- locales.add(locale);
- }
- return locales;
- }
-
- private ContainerSecurityInfo buildContainerSecurityInfo()
- {
- ContainerSecurityInfo containerSecurity = new ContainerSecurityInfo();
-
- // Security role ref
- for (SecurityRoleRefMetaData securityRoleRefMD : portletMD.getSecurityRoleRef())
- {
- containerSecurity.addRoleRef(securityRoleRefMD.getRoleName(), securityRoleRefMD.getRoleLink());
- }
-
- //
- for (SecurityConstraintMetaData securityConstraintMD : portletMD.getPortletApplication().getSecurityConstraints())
- {
- if (securityConstraintMD.getPortletList().getPortletNames().contains(portletMD.getPortletName()))
- {
- containerSecurity.addTransportGuarantee(securityConstraintMD.getUserDataConstraint().getTransportQuarantee());
- }
- }
-
- //
- return containerSecurity;
- }
-
- private ContainerSessionInfo buildContainerSession()
- {
- return new ContainerSessionInfo(false);
- }
-
- private ContainerCacheInfo buildContainerCache()
- {
- int expirationCache = portletMD.getExpirationCache();
-
- //
- if (expirationCache < 0 && expirationCache != -1)
- {
- // log.warn("Seen bad caching expiration value " + expirationTimeSecs + " disable caching instead");
- expirationCache = 0;
- }
-
- //
- return new ContainerCacheInfo(expirationCache);
- }
-
- private ContainerCapabilitiesInfo buildContainerCapabilities()
- {
- ContainerCapabilitiesInfo capabilities = new ContainerCapabilitiesInfo();
-
- //
- for (SupportsMetaData supportsMD : portletMD.getSupports())
- {
- // Get the mime type
- String mimeType = supportsMD.getMimeType().toLowerCase();
-
- // Add the content type to the view mode
- // because each content type must handle this view
- capabilities.add(mimeType, Mode.VIEW);
-
- // Then process each mode
- for (PortletModeMetaData modeMD : supportsMD.getPortletModes())
- {
- capabilities.add(mimeType, modeMD.getPortletMode());
- }
- }
-
- //
- return capabilities;
- }
-
- private ContainerMetaInfo buildContainerMeta()
- {
- ContainerMetaInfo containerMeta = new ContainerMetaInfo();
-
- // Capture inline values
- String[] inlines = {
- portletMD.getPortletInfo().getTitle(),
- portletMD.getPortletInfo().getShortTitle(),
- portletMD.getPortletInfo().getKeywords()
- };
-
- // Construct info from resource bundle manager
- for (int i = 0; i < KEYS.length; i++)
- {
- String key = KEYS[i];
-
- //
- Map<Locale, String> tmp = new HashMap<Locale, String>();
-
- //
- List<Locale> locales = getSupportedLocales();
-
- // Add english locale
- locales.add(Locale.ENGLISH);
-
- // Feed with the known locales (perhaps should try more locales)
- for (Locale locale : locales)
- {
- ResourceBundle bundle = bundleMgr.getResourceBundle(locale);
-
- //
- if (bundle != null)
- {
- try
- {
- String value = bundle.getString(BUNDLE_KEYS[i]);
- tmp.put(locale, value);
- }
- catch (MissingResourceException ignore)
- {
- }
- }
- }
-
- // Add the inline value if it is present
- if (inlines[i] != null)
- {
- tmp.put(Locale.ENGLISH, inlines[i]);
- }
-
- //
- LocalizedString ls = new LocalizedString(tmp, Locale.ENGLISH);
- containerMeta.addMetaValue(key, ls);
- }
-
- // Add stuff coming from deployment descriptor
- containerMeta.addMetaValue(MetaInfo.DESCRIPTION, portletMD.getDescription());
- containerMeta.addMetaValue(MetaInfo.DISPLAY_NAME, portletMD.getDisplayName());
-
- //
- return containerMeta;
- }
-
- private ContainerPreferencesInfo buildContainerPreferences()
- {
- PortletPreferencesMetaData preferencesMD = portletMD.getPortletPreferences();
-
- //
- String validatorClassName = null;
- if (preferencesMD != null)
- {
- validatorClassName = preferencesMD.getPreferenceValidator();
- }
-
- //
- ContainerPreferencesInfo containerPreferences = new ContainerPreferencesInfo(validatorClassName);
-
- //
- for (PortletPreferenceMetaData portletPreferenceMD : preferencesMD.getPortletPreferences().values())
- {
- Value value = new StringValue(portletPreferenceMD.getValue());
- LocalizedString displayName = bundleMgr.getLocalizedValue("javax.portlet.preference.name." + portletPreferenceMD.getName(), portletPreferenceMD.getName());
- LocalizedString description = bundleMgr.getLocalizedValue("javax.portlet.preference.description." + portletPreferenceMD.getName(), portletPreferenceMD.getName());
- containerPreferences.addContainerPreference(portletPreferenceMD.getName(), value, portletPreferenceMD.isReadOnly(), displayName, description);
- }
-
- //
- return containerPreferences;
- }
-}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerTypeInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerTypeInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerTypeInfo.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.info;
+
+import org.jboss.portal.portlet.info.TypeInfo;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.lang.reflect.AnnotatedElement;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerTypeInfo implements TypeInfo
+{
+
+ /** . */
+ private final Class type;
+
+ /** . */
+ private final XmlRootElement annotation;
+
+ public ContainerTypeInfo(Class type)
+ {
+ this.type = type;
+ this.annotation = ((AnnotatedElement)type).getAnnotation(XmlRootElement.class);
+ }
+
+ public Class getType()
+ {
+ return type;
+ }
+
+ public String getName()
+ {
+ return type.getClass().getName();
+ }
+
+ public XmlRootElement getXMLBinding()
+ {
+ return annotation;
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ContainerInfoBuilderContextImpl.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168;
+
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext;
+import org.jboss.portal.web.WebApp;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.common.i18n.ResourceBundleFactory;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerInfoBuilderContextImpl implements ContainerInfoBuilderContext
+{
+
+ private PortletApplication10MetaData metaData;
+
+ private WebApp webApp;
+
+ private final Map<String, ResourceBundleManager> portletBundleMgrs = new HashMap<String, ResourceBundleManager>();
+
+ private ResourceBundleManager applicationBundleMgr;
+
+ public ContainerInfoBuilderContextImpl(PortletApplication10MetaData metaData, WebApp webApp)
+ {
+ this.metaData = metaData;
+ this.webApp = webApp;
+ }
+
+ public ResourceBundleManager getBundleManager()
+ {
+ if (applicationBundleMgr == null)
+ {
+ String baseName = ((PortletApplication20MetaData)metaData).getResourceBundle();
+ ResourceBundleFactory rbf = new SimpleResourceBundleFactory(webApp.getClassLoader(), baseName);
+ applicationBundleMgr = new ResourceBundleManager(null, rbf);
+ }
+ return applicationBundleMgr;
+ }
+
+ public ResourceBundleManager getBundleManager(PortletMetaData portletMD)
+ {
+ ResourceBundleManager bundleMgr = portletBundleMgrs.get(portletMD.getPortletName());
+ if (bundleMgr == null)
+ {
+ String baseName = portletMD.getResourceBundle();
+ ResourceBundleFactory rbf = new SimpleResourceBundleFactory(webApp.getClassLoader(), baseName);
+ bundleMgr = new ResourceBundleManager(null, rbf);
+ portletBundleMgrs.put(portletMD.getPortletName(), bundleMgr);
+ }
+ return bundleMgr;
+ }
+
+ public Class getClass(String className)
+ {
+ try
+ {
+ return webApp.getClassLoader().loadClass(className);
+ }
+ catch (ClassNotFoundException e)
+ {
+ e.printStackTrace();
+
+ // todo
+ return null;
+ }
+ }
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-01-10 23:37:38 UTC (rev 9483)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -38,7 +38,6 @@
import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
import org.jboss.portal.portlet.impl.info.ContainerPreferencesInfo;
-import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
@@ -89,9 +88,6 @@
/** User data constraint. */
protected Set userDataConstraints;
- /** . */
- protected ResourceBundleManager internalBundleManager;
-
/** Return info. */
protected ContainerPortletInfo info;
@@ -101,10 +97,9 @@
*/
protected PreferencesValidator preferencesValidator;
- public PortletContainerImpl(ContainerPortletInfo info, ResourceBundleManager internalBundleManager)
+ public PortletContainerImpl(ContainerPortletInfo info)
{
this.info = info;
- this.internalBundleManager = internalBundleManager;
this.valve = new Valve();
this.log = Logger.getLogger("org.jboss.portal.portlet.container." + info.getClassName().replace('.', '_'));
this.started = false;
@@ -171,7 +166,7 @@
}
//
- ResourceBundleManager bundleManager = PortletResourceBundleFactory.createResourceBundleManager(internalBundleManager, info);
+ ResourceBundleManager bundleManager = PortletResourceBundleFactory.createResourceBundleManager(info.getBundleManager(), info);
// Portlet config object
PortletConfig config = new PortletConfigImpl(application.getPortletContext(), info, bundleManager);
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventInfo.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+
+import javax.xml.namespace.QName;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface EventInfo
+{
+
+ QName getName();
+
+ LocalizedString getDisplayName();
+
+ LocalizedString getDescription();
+
+ TypeInfo getType();
+
+ Collection<QName> getAliases();
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventsInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventsInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/EventsInfo.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.info;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface EventsInfo
+{
+
+ Collection<? extends EventInfo> getProducedEvents();
+
+ Collection<? extends EventInfo> getConsumedEvents();
+
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PortletInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PortletInfo.java 2008-01-10 23:37:38 UTC (rev 9483)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PortletInfo.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -85,4 +85,6 @@
* explicitely for the associated portlet.
*/
Boolean isRemotable();
+
+ EventsInfo getEvents();
}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/TypeInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/TypeInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/TypeInfo.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.info;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface TypeInfo
+{
+
+ String getName();
+
+ XmlRootElement getXMLBinding();
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventInfoSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventInfoSupport.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventInfoSupport.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.support.info;
+
+import org.jboss.portal.portlet.info.EventInfo;
+import org.jboss.portal.portlet.info.TypeInfo;
+import org.jboss.portal.common.i18n.LocalizedString;
+
+import javax.xml.namespace.QName;
+import java.util.Collection;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class EventInfoSupport implements EventInfo
+{
+
+ /** . */
+ private QName name;
+
+ /** . */
+ private TypeInfoSupport type;
+
+ /** . */
+ private LocalizedString displayName;
+
+ /** . */
+ private LocalizedString description;
+
+ /** . */
+ private List<QName> aliases;
+
+ public EventInfoSupport(QName name, TypeInfoSupport type)
+ {
+ this.name = name;
+ this.type = type;
+ this.aliases = new ArrayList<QName>();
+ this.displayName = new LocalizedString("Event " + name);
+ this.description = new LocalizedString("Description of event " + name);
+ }
+
+ public EventInfoSupport(QName name, String type)
+ {
+ this.name = name;
+ this.type = new TypeInfoSupport(type);
+ this.aliases = new ArrayList<QName>();
+ }
+
+ public QName getName()
+ {
+ return name;
+ }
+
+ public TypeInfo getType()
+ {
+ return type;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public Collection<QName> getAliases()
+ {
+ return aliases;
+ }
+
+ public void setDisplayName(LocalizedString displayName)
+ {
+ this.displayName = displayName;
+ }
+
+ public void setDescription(LocalizedString description)
+ {
+ this.description = description;
+ }
+
+ public void addAlias(QName alias)
+ {
+ aliases.add(alias);
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventsInfoSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventsInfoSupport.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/EventsInfoSupport.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.support.info;
+
+import org.jboss.portal.portlet.info.EventsInfo;
+import org.jboss.portal.portlet.info.EventInfo;
+
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class EventsInfoSupport implements EventsInfo
+{
+
+ /** . */
+ private List<EventInfoSupport> producedEvents;
+
+ /** . */
+ private List<EventInfoSupport> consumedEvents;
+
+ public EventsInfoSupport()
+ {
+ producedEvents = new ArrayList<EventInfoSupport>();
+ consumedEvents = new ArrayList<EventInfoSupport>();
+ }
+
+ public void addProducedEvent(EventInfoSupport event)
+ {
+ producedEvents.add(event);
+ }
+
+ public void addConsumedEvent(EventInfoSupport event)
+ {
+ producedEvents.add(event);
+ }
+
+ public Collection<? extends EventInfo> getProducedEvents()
+ {
+ return producedEvents;
+ }
+
+ public Collection<? extends EventInfo> getConsumedEvents()
+ {
+ return consumedEvents;
+ }
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/PortletInfoSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/PortletInfoSupport.java 2008-01-10 23:37:38 UTC (rev 9483)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/PortletInfoSupport.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -29,6 +29,7 @@
import org.jboss.portal.portlet.info.PreferencesInfo;
import org.jboss.portal.portlet.info.SecurityInfo;
import org.jboss.portal.portlet.info.SessionInfo;
+import org.jboss.portal.portlet.info.EventsInfo;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -43,62 +44,38 @@
private CacheInfoSupport cacheSupport = new CacheInfoSupport();
private SessionInfoSupport sessionSupport = new SessionInfoSupport();
private MetaInfoSupport metaSupport = new MetaInfoSupport();
+ private EventsInfoSupport eventsSupports = new EventsInfoSupport();
public CapabilitiesInfo getCapabilities()
{
throw new UnsupportedOperationException("Implement me");
}
- public PreferencesInfo getPreferences()
+ public PreferencesInfoSupport getPreferences()
{
return preferencesSupport;
}
- public PreferencesInfoSupport getPreferencesSupport()
+ public MetaInfoSupport getMeta()
{
- return preferencesSupport;
- }
-
- public MetaInfo getMeta()
- {
return metaSupport;
}
- public MetaInfoSupport getMetaSupport()
+ public SecurityInfoSupport getSecurity()
{
- return metaSupport;
- }
-
- public SecurityInfo getSecurity()
- {
return securitySupport;
}
- public SecurityInfoSupport getSecuritySupport()
+ public CacheInfoSupport getCache()
{
- return securitySupport;
- }
-
- public CacheInfo getCache()
- {
return cacheSupport;
}
- public CacheInfoSupport getCacheSupport()
+ public SessionInfoSupport getSession()
{
- return cacheSupport;
- }
-
- public SessionInfo getSession()
- {
return sessionSupport;
}
- public SessionInfoSupport getSessionSupport()
- {
- return sessionSupport;
- }
-
public Boolean isRemotable()
{
return remotable;
@@ -108,4 +85,9 @@
{
this.remotable = remotable;
}
+
+ public EventsInfoSupport getEvents()
+ {
+ return eventsSupports;
+ }
}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/TypeInfoSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/TypeInfoSupport.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/TypeInfoSupport.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.support.info;
+
+import org.jboss.portal.portlet.info.TypeInfo;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class TypeInfoSupport implements TypeInfo
+{
+
+ /** . */
+ private final String name;
+
+ public TypeInfoSupport(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public XmlRootElement getXMLBinding()
+ {
+ return null;
+ }
+}
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/PortletInvokerSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/PortletInvokerSupport.java 2008-01-10 23:37:38 UTC (rev 9483)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/PortletInvokerSupport.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -180,13 +180,13 @@
public void addPreference(String key, Value value)
{
- support.getInfoSupport().getPreferencesSupport().addPreference(key);
+ support.getInfoSupport().getPreferences().addPreference(key);
state.put(key, value);
}
public void addPreference(String key, Value value, Boolean readOnly)
{
- support.getInfoSupport().getPreferencesSupport().addPreference(key, readOnly);
+ support.getInfoSupport().getPreferences().addPreference(key, readOnly);
state.put(key, value);
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-01-10 23:37:38 UTC (rev 9483)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-01-11 16:23:48 UTC (rev 9484)
@@ -25,18 +25,16 @@
import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
-import org.jboss.portal.portlet.impl.jsr168.SimpleResourceBundleFactory;
+import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImpl;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
-import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
-import org.jboss.portal.portlet.impl.info.ContainerPortletInfoBuilder;
+import org.jboss.portal.portlet.impl.info.ContainerInfoBuilder;
+import org.jboss.portal.portlet.impl.info.ContainerInfoBuilderContext;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
import org.jboss.portal.web.WebApp;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.NotYetImplemented;
-import org.jboss.portal.common.i18n.ResourceBundleFactory;
-import org.jboss.portal.common.i18n.ResourceBundleManager;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
@@ -88,6 +86,8 @@
/** . */
private List<KernelControllerContext> portletContainerControllerContexts = new ArrayList<KernelControllerContext>();
+ /** . */
+
public PortletApplicationDeployment(Kernel kernel, WebApp webApp, PortletApplication10MetaData metaData)
{
this.kernel = kernel;
@@ -109,23 +109,20 @@
String portletApplicationId = "PortletApplication[" + webApp.getContextPath() + "]";
//
- for (PortletMetaData portletMetaData : metaData.getPortlets().values())
- {
- // Create resource bundle manager
- String baseName = portletMetaData.getResourceBundle();
- ResourceBundleFactory rbf = new SimpleResourceBundleFactory(webApp.getClassLoader(), baseName);
- ResourceBundleManager bundleMgr = new ResourceBundleManager(null, rbf);
+ ContainerInfoBuilderContext builderContext = new ContainerInfoBuilderContextImpl(metaData, webApp);
+ ContainerInfoBuilder builder = new ContainerInfoBuilder(metaData, builderContext);
+ builder.build();
- // Build container info
- ContainerPortletInfo containerInfo = new ContainerPortletInfoBuilder(portletMetaData, bundleMgr).build();
-
+ //
+ for (ContainerPortletInfo containerInfo : builder.getContainerInfos())
+ {
//
- String portletContainerId = "PortletContainer[" + webApp.getContextPath() + "," + portletMetaData.getPortletName() + "]";
+ String portletContainerId = "PortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
//
AbstractBeanMetaData bmd = new AbstractBeanMetaData(portletContainerId, PortletContainerImpl.class.getName());
AbstractConstructorMetaData ctormd = new AbstractConstructorMetaData();
- ctormd.setParameters(Tools.toList((ParameterMetaData)new AbstractParameterMetaData(ContainerPortletInfo.class.getName(), containerInfo), new AbstractParameterMetaData(ResourceBundleManager.class.getName(), bundleMgr)));
+ ctormd.setParameters(Tools.toList((ParameterMetaData)new AbstractParameterMetaData(ContainerPortletInfo.class.getName(), containerInfo)));
bmd.setConstructor(ctormd);
bmd.setStart(new AbstractLifecycleMetaData("start"));
bmd.setStop(new AbstractLifecycleMetaData("stop"));
@@ -156,7 +153,7 @@
}
catch (Throwable t)
{
- log.debug("Cannot install portlet container " + portletMetaData.getPortletName() + " produced an error", t);
+ log.debug("Cannot install portlet container " + containerInfo.getName() + " produced an error", t);
}
}
18 years, 3 months
JBoss Portal SVN: r9483 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-10 18:37:38 -0500 (Thu, 10 Jan 2008)
New Revision: 9483
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/BaseURLImpl.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
Log:
added BaseURLImpl which is a parent of PortletURLImpl mirroring the new BaseURL interface.
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/BaseURLImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/BaseURLImpl.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/BaseURLImpl.java 2008-01-10 23:37:38 UTC (rev 9483)
@@ -0,0 +1,201 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.api;
+
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.ActionURL;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.RenderURL;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
+import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.NotYetImplemented;
+
+import javax.portlet.BaseURL;
+import javax.portlet.PortletRequest;
+import javax.portlet.WindowState;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletSecurityException;
+import java.util.Map;
+import java.io.Writer;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class BaseURLImpl implements BaseURL
+{
+
+ /** . */
+ protected PortletInvocation inv;
+
+ /** . */
+ protected PortletRequest preq;
+
+ /** . */
+ protected Boolean secure;
+
+ /** . */
+ protected InternalPortletURL url;
+
+ public BaseURLImpl(PortletInvocation invocation, PortletRequest preq, InternalPortletURL url)
+ {
+ this.inv = invocation;
+ this.preq = preq;
+ this.url = url;
+ }
+
+ /** @throws IllegalArgumentException if the name is null */
+ public void setParameter(String name, String value)
+ {
+ PortletUtils.checkPortletParameterValidity(name, value);
+
+ //
+ url.getInternalParameters().setValue(name, value);
+ }
+
+ public void setParameter(String name, String[] values)
+ {
+ PortletUtils.checkPortletParameterValidity(name, values);
+
+ //
+ url.getInternalParameters().setValues(name, values);
+ }
+
+ public void setParameters(Map<String, String[]> parameters)
+ {
+ PortletUtils.checkPortletParameterMapValidity(parameters);
+
+ //
+ url.getInternalParameters().replace(parameters);
+ }
+
+ public void setSecure(boolean secure) throws PortletSecurityException
+ {
+ this.secure = Boolean.valueOf(secure);
+ }
+
+ public Map<String, String[]> getParameterMap()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void write(Writer writer) throws IOException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void write(Writer writer, boolean b) throws IOException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void addProperty(String s, String s1)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void setProperty(String s, String s1)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public String toString()
+ {
+ PortletInvocationContext responseContext = inv.getPortletContext();
+ return responseContext.renderURL(url, secure, null, true);
+ }
+
+ public static abstract class InternalPortletURL implements org.jboss.portal.portlet.PortletURL
+ {
+
+ /** . */
+ protected WindowState windowState;
+
+ /** . */
+ protected PortletMode portletMode;
+
+ public Mode getMode()
+ {
+ if (portletMode != null)
+ {
+ return Mode.create(portletMode.toString());
+ }
+ return null;
+ }
+
+ public org.jboss.portal.WindowState getWindowState()
+ {
+ if (windowState != null)
+ {
+ return org.jboss.portal.WindowState.create(windowState.toString());
+ }
+ return null;
+ }
+
+ protected abstract PortletParameters getInternalParameters();
+ }
+
+ public static class InternalActionURL extends InternalPortletURL implements ActionURL
+ {
+
+ /** . */
+ private PortletParametersStateString parameters = new PortletParametersStateString();
+
+ protected PortletParameters getInternalParameters()
+ {
+ return parameters.getParameters();
+ }
+
+ public StateString getInteractionState()
+ {
+ return parameters;
+ }
+
+ /** The portlet container does not need to have the navigational state provided. */
+ public StateString getNavigationalState()
+ {
+ return null;
+ }
+ }
+
+ public static class InternalRenderURL extends InternalPortletURL implements RenderURL
+ {
+
+ /** . */
+ private PortletParametersStateString navigationalState = new PortletParametersStateString();
+
+ protected PortletParameters getInternalParameters()
+ {
+ return navigationalState.getParameters();
+ }
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
+ }
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java 2008-01-10 23:15:34 UTC (rev 9482)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java 2008-01-10 23:37:38 UTC (rev 9483)
@@ -22,47 +22,26 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.api;
-import org.jboss.portal.Mode;
import org.jboss.portal.common.NotYetImplemented;
-import org.jboss.portal.portlet.ActionURL;
-import org.jboss.portal.portlet.PortletParameters;
-import org.jboss.portal.portlet.PortletParametersStateString;
-import org.jboss.portal.portlet.RenderURL;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.spi.PortletInvocationContext;
import javax.portlet.PortletMode;
import javax.portlet.PortletModeException;
import javax.portlet.PortletRequest;
-import javax.portlet.PortletSecurityException;
import javax.portlet.PortletURL;
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
-import java.util.Map;
-import java.io.Writer;
-import java.io.IOException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6697 $
*/
-public class PortletURLImpl implements PortletURL
+public class PortletURLImpl extends BaseURLImpl implements PortletURL
{
- private PortletInvocation inv;
- private PortletRequest preq;
-
- //
- private Boolean secure;
- private InternalPortletURL url;
-
public PortletURLImpl(PortletInvocation invocation, PortletRequest preq, InternalPortletURL url)
{
- this.inv = invocation;
- this.preq = preq;
- this.url = url;
+ super(invocation, preq, url);
}
public void setWindowState(WindowState windowState) throws WindowStateException
@@ -95,112 +74,6 @@
}
}
- /** @throws IllegalArgumentException if the name is null */
- public void setParameter(String name, String value)
- {
- PortletUtils.checkPortletParameterValidity(name, value);
-
- //
- url.getInternalParameters().setValue(name, value);
- }
-
- public void setParameter(String name, String[] values)
- {
- PortletUtils.checkPortletParameterValidity(name, values);
-
- //
- url.getInternalParameters().setValues(name, values);
- }
-
- public void setParameters(Map<String, String[]> parameters)
- {
- PortletUtils.checkPortletParameterMapValidity(parameters);
-
- //
- url.getInternalParameters().replace(parameters);
- }
-
- public void setSecure(boolean secure) throws PortletSecurityException
- {
- this.secure = Boolean.valueOf(secure);
- }
-
- public String toString()
- {
- PortletInvocationContext responseContext = inv.getPortletContext();
- return responseContext.renderURL(url, secure, null, true);
- }
-
- public static abstract class InternalPortletURL implements org.jboss.portal.portlet.PortletURL
- {
-
- /** . */
- private WindowState windowState;
-
- /** . */
- private PortletMode portletMode;
-
- public Mode getMode()
- {
- if (portletMode != null)
- {
- return Mode.create(portletMode.toString());
- }
- return null;
- }
-
- public org.jboss.portal.WindowState getWindowState()
- {
- if (windowState != null)
- {
- return org.jboss.portal.WindowState.create(windowState.toString());
- }
- return null;
- }
-
- protected abstract PortletParameters getInternalParameters();
- }
-
- public static class InternalActionURL extends InternalPortletURL implements ActionURL
- {
-
- /** . */
- private PortletParametersStateString parameters = new PortletParametersStateString();
-
- protected PortletParameters getInternalParameters()
- {
- return parameters.getParameters();
- }
-
- public StateString getInteractionState()
- {
- return parameters;
- }
-
- /** The portlet container does not need to have the navigational state provided. */
- public StateString getNavigationalState()
- {
- return null;
- }
- }
-
- public static class InternalRenderURL extends InternalPortletURL implements RenderURL
- {
-
- /** . */
- private PortletParametersStateString navigationalState = new PortletParametersStateString();
-
- protected PortletParameters getInternalParameters()
- {
- return navigationalState.getParameters();
- }
-
- public StateString getNavigationalState()
- {
- return navigationalState;
- }
- }
-
public PortletMode getPortletMode()
{
throw new NotYetImplemented();
@@ -215,29 +88,4 @@
{
throw new NotYetImplemented();
}
-
- public Map<String, String[]> getParameterMap()
- {
- throw new NotYetImplemented();
- }
-
- public void write(Writer writer) throws IOException
- {
- throw new NotYetImplemented();
- }
-
- public void write(Writer writer, boolean b) throws IOException
- {
- throw new NotYetImplemented();
- }
-
- public void addProperty(String s, String s1)
- {
- throw new NotYetImplemented();
- }
-
- public void setProperty(String s, String s1)
- {
- throw new NotYetImplemented();
- }
}
18 years, 3 months
JBoss Portal SVN: r9482 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-10 18:15:34 -0500 (Thu, 10 Jan 2008)
New Revision: 9482
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java
Log:
added ClientDataRequestImpl, MimeResponseImpl and StateAwareResponseImpl which are now intermediary interfaces between PortletRequest/PortletResponse and their subinterfaces in JSR 168
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java 2008-01-10 23:15:34 UTC (rev 9482)
@@ -26,31 +26,19 @@
import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.spi.ActionContext;
-import org.jboss.portal.common.NotYetImplemented;
import javax.portlet.ActionRequest;
-import javax.servlet.http.Cookie;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6697 $
*/
-public class ActionRequestImpl extends PortletRequestImpl implements ActionRequest
+public class ActionRequestImpl extends ClientDataRequestImpl implements ActionRequest
{
- /** . */
- protected final ActionContext actionContext;
-
public ActionRequestImpl(ActionInvocation invocation)
{
super(invocation);
- this.actionContext = (ActionContext)invocation.getPortletContext();
// Get the possibly null interaction state
StateString interactionState = actionContext.getInteractionState();
@@ -88,71 +76,4 @@
}
}
}
-
- //
-
- public InputStream getPortletInputStream() throws IOException
- {
- if ("application/x-www-form-urlencoded".equals(actionContext.getContentType()))
- {
- throw new IllegalStateException();
- }
- return actionContext.getInputStream();
- }
-
- public void setCharacterEncoding(String s) throws UnsupportedEncodingException
- {
- // This method is frankly stupid
- throw new IllegalStateException("called after the body has been read");
- // req.setCharacterEncoding(s);
- }
-
- public BufferedReader getReader() throws UnsupportedEncodingException, IOException
- {
- if ("application/x-www-form-urlencoded".equals(actionContext.getContentType()))
- {
- throw new IllegalStateException();
- }
- return actionContext.getReader();
- }
-
- public String getCharacterEncoding()
- {
- return actionContext.getCharacterEncoding();
- }
-
- public String getContentType()
- {
- return actionContext.getContentType();
- }
-
- public int getContentLength()
- {
- return actionContext.getContentLength();
- }
-
- public String getWindowID()
- {
- throw new NotYetImplemented();
- }
-
- public Cookie[] getCookies()
- {
- throw new NotYetImplemented();
- }
-
- public Map<String, String[]> getPrivateParameterMap()
- {
- throw new NotYetImplemented();
- }
-
- public Map<String, String[]> getPublicParameterMap()
- {
- throw new NotYetImplemented();
- }
-
- public String getMethod()
- {
- throw new NotYetImplemented();
- }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java 2008-01-10 23:15:34 UTC (rev 9482)
@@ -23,34 +23,21 @@
package org.jboss.portal.portlet.impl.jsr168.api;
import org.apache.log4j.Logger;
-import org.jboss.portal.Mode;
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.portlet.PortletParametersStateString;
-import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.RedirectionResponse;
import org.jboss.portal.portlet.invocation.response.RenderResponse;
-import org.w3c.dom.Element;
-import org.w3c.dom.DOMException;
import javax.portlet.ActionResponse;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletModeException;
-import javax.portlet.WindowState;
-import javax.portlet.WindowStateException;
-import javax.servlet.http.Cookie;
-import javax.xml.namespace.QName;
import java.io.IOException;
-import java.io.Serializable;
-import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7379 $
*/
-public class ActionResponseImpl extends PortletResponseImpl implements ActionResponse
+public class ActionResponseImpl extends StateAwareResponseImpl implements ActionResponse
{
private static final Logger log = Logger.getLogger(ActionResponseImpl.class);
@@ -75,55 +62,11 @@
this.decision = WANT_NOTHING;
}
- public PortletInvocationResponse getResult()
+ public void sendRedirect(String s, String s1) throws IOException
{
- return response;
+ throw new NotYetImplemented();
}
- public void setWindowState(WindowState windowState) throws WindowStateException
- {
- if (decision == WANT_NOTHING || decision == WANT_RENDER)
- {
- if (!preq.isWindowStateAllowed(windowState))
- {
- throw new WindowStateException("Not supported", windowState);
- }
- ((RenderResponse)response).setWindowState(org.jboss.portal.WindowState.create(windowState.toString()));
- decision = WANT_RENDER;
- }
- else
- {
- throw new IllegalStateException("Window state cannot be set after redirect");
- }
- }
-
- public void setPortletMode(PortletMode portletMode) throws PortletModeException
- {
- if (decision == WANT_NOTHING || decision == WANT_RENDER)
- {
- if (portletMode == null)
- {
- // The spec does not define that case
- // we just issue a warn
- log.warn("Set null portlet mode");
- }
- else
- {
- if (!preq.isPortletModeAllowed(portletMode))
- {
- throw new PortletModeException("Not supported", portletMode);
- }
- Mode mode = Mode.create(portletMode.toString());
- ((RenderResponse)response).setMode(mode);
- }
- decision = WANT_RENDER;
- }
- else
- {
- throw new IllegalStateException("Portlet mode cannot be set after redirect");
- }
- }
-
public void sendRedirect(String location) throws IOException
{
if (location == null)
@@ -140,128 +83,4 @@
throw new IllegalArgumentException("URL must be absolute. Was: " + location);
}
}
-
- /**
- * Generic send redirect.
- *
- * @param redirect
- * @throws IllegalStateException implement jsr168 behavior if the portlet as already commited stuff
- */
- protected final void sendRedirect(RedirectionResponse redirect) throws IllegalStateException
- {
- if (decision == WANT_NOTHING || decision == WANT_REDIRECT)
- {
- response = redirect;
- decision = WANT_REDIRECT;
- }
- else
- {
- throw new IllegalStateException("sendRedirect cannot be called after " +
- "setPortletMode/setWindowState/setRenderParameter/setRenderParameters " +
- "has been called previously");
- }
- }
-
- public void setRenderParameters(Map<String, String[]> map)
- {
- PortletUtils.checkPortletParameterMapValidity(map);
-
- //
- if (decision == WANT_NOTHING || decision == WANT_RENDER)
- {
- ((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).replace(map);
- decision = WANT_RENDER;
- }
- else
- {
- throw new IllegalStateException("setRenderParameters cannot be called after redirect");
- }
- }
-
- public void setRenderParameter(String name, String value)
- {
- PortletUtils.checkPortletParameterValidity(name, value);
-
- //
- if (decision == WANT_NOTHING || decision == WANT_RENDER)
- {
- ((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).setValue(name, value);
- decision = WANT_RENDER;
- }
- else
- {
- throw new IllegalStateException("setRenderParameter cannot be called after redirect");
- }
- }
-
- public void setRenderParameter(String name, String[] values)
- {
- PortletUtils.checkPortletParameterValidity(name, values);
-
- //
- if (decision == WANT_NOTHING || decision == WANT_RENDER)
- {
- ((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).setValues(name, values);
- decision = WANT_RENDER;
- }
- else
- {
- throw new IllegalStateException("setRenderParameter cannot be called after redirect");
- }
- }
-
- public String getNamespace()
- {
- throw new NotYetImplemented();
- }
-
- public void addProperty(Cookie cookie)
- {
- throw new NotYetImplemented();
- }
-
- public void addProperty(String s, Element element)
- {
- throw new NotYetImplemented();
- }
-
- public Element createElement(String s) throws DOMException
- {
- throw new NotYetImplemented();
- }
-
- public void sendRedirect(String s, String s1) throws IOException
- {
- throw new NotYetImplemented();
- }
-
- public void setEvent(QName qName, Serializable serializable)
- {
- throw new NotYetImplemented();
- }
-
- public void setEvent(String s, Serializable serializable)
- {
- throw new NotYetImplemented();
- }
-
- public Map<String, String[]> getRenderParameterMap()
- {
- throw new NotYetImplemented();
- }
-
- public PortletMode getPortletMode()
- {
- throw new NotYetImplemented();
- }
-
- public WindowState getWindowState()
- {
- throw new NotYetImplemented();
- }
-
- public void removePublicRenderParameter(String s)
- {
- throw new NotYetImplemented();
- }
}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java 2008-01-10 23:15:34 UTC (rev 9482)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.api;
+
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.spi.ActionContext;
+import org.jboss.portal.common.NotYetImplemented;
+
+import javax.portlet.ClientDataRequest;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.BufferedReader;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class ClientDataRequestImpl extends PortletRequestImpl implements ClientDataRequest
+{
+
+ /** . */
+ protected final ActionContext actionContext;
+
+ public ClientDataRequestImpl(PortletInvocation invocation)
+ {
+ super(invocation);
+
+ //
+ this.actionContext = (ActionContext)invocation.getPortletContext();
+ }
+
+ public InputStream getPortletInputStream() throws IOException
+ {
+ if ("application/x-www-form-urlencoded".equals(actionContext.getContentType()))
+ {
+ throw new IllegalStateException();
+ }
+ return actionContext.getInputStream();
+ }
+
+ public BufferedReader getReader() throws UnsupportedEncodingException, IOException
+ {
+ if ("application/x-www-form-urlencoded".equals(actionContext.getContentType()))
+ {
+ throw new IllegalStateException();
+ }
+ return actionContext.getReader();
+ }
+
+ public String getCharacterEncoding()
+ {
+ return actionContext.getCharacterEncoding();
+ }
+
+ public String getContentType()
+ {
+ return actionContext.getContentType();
+ }
+
+ public int getContentLength()
+ {
+ return actionContext.getContentLength();
+ }
+
+ public void setCharacterEncoding(String s) throws UnsupportedEncodingException
+ {
+ // This method is frankly stupid
+ throw new IllegalStateException("called after the body has been read");
+ // req.setCharacterEncoding(s);
+ }
+
+ public String getMethod()
+ {
+ throw new NotYetImplemented();
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java 2008-01-10 23:15:34 UTC (rev 9482)
@@ -0,0 +1,190 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.api;
+
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.common.NotYetImplemented;
+import org.w3c.dom.Element;
+import org.w3c.dom.DOMException;
+
+import javax.portlet.MimeResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.ResourceURL;
+import javax.portlet.CacheControl;
+import javax.activation.MimeTypeParseException;
+import javax.servlet.http.Cookie;
+import java.io.PrintWriter;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class MimeResponseImpl extends PortletResponseImpl implements MimeResponse
+{
+
+ /** The fragment result. */
+ protected FragmentResponse result;
+
+ /** Not really used but we need it to memorize what the client set optionally. */
+ protected int bufferSize;
+
+ public MimeResponseImpl(PortletInvocation invocation, PortletRequestImpl preq)
+ {
+ super(invocation, preq);
+
+ // 0 means no buffering - we say no buffering
+ this.bufferSize = 0;
+ this.result = new FragmentResponse();
+ }
+
+ public PortletInvocationResponse getResult()
+ {
+ return result;
+ }
+
+ public String getContentType()
+ {
+ return result.getContentType();
+ }
+
+ public void setContentType(String contentType)
+ {
+ try
+ {
+ // Remove the unused appended charset first
+ int index = contentType.indexOf(';');
+ if (index != -1)
+ {
+ contentType = contentType.substring(0, index);
+ }
+
+ // Find the content type among the media type we know
+ MediaType requestedMediaType = MediaType.parseMimeType(contentType);
+
+ // Get the response media type
+ ContentInfo info = invocation.getPortletContext().getMarkupInfo();
+ MediaType responseMediaType = info.getContentType();
+
+ // Check if the requested media type is allowed as a subtype of the main response
+ if (!responseMediaType.isAllowedSubType(requestedMediaType))
+ {
+ throw new IllegalArgumentException("Content type not accepted");
+ }
+
+ // Set the content type
+ result.setContentType(contentType);
+ }
+ catch (MimeTypeParseException e)
+ {
+ IllegalArgumentException ex = new IllegalArgumentException("Content type not accepted");
+ ex.initCause(e);
+ throw ex;
+ }
+ }
+
+ public PrintWriter getWriter() throws IOException
+ {
+ return result.getWriter();
+ }
+
+ public OutputStream getPortletOutputStream() throws IOException
+ {
+ return result.getOutputStream();
+ }
+
+ public PortletURL createRenderURL()
+ {
+ return PortletUtils.createRenderURL(invocation, preq);
+ }
+
+ public PortletURL createActionURL()
+ {
+ return PortletUtils.createActionURL(invocation, preq);
+ }
+
+ public String getCharacterEncoding()
+ {
+ return invocation.getPortletContext().getMarkupInfo().getCharset();
+ }
+
+ public Locale getLocale()
+ {
+ return invocation.getUserContext().getLocale();
+ }
+
+ public void setBufferSize(int bufferSize)
+ {
+ if (bufferSize > -0)
+ {
+ this.bufferSize = bufferSize;
+ }
+ }
+
+ public int getBufferSize()
+ {
+ return bufferSize;
+ }
+
+ public void flushBuffer() throws IOException
+ {
+ }
+
+ public void resetBuffer()
+ {
+ // Clear the buffer
+ result.resetBuffer();
+ }
+
+ public void reset()
+ {
+ // Clear the buffer
+ resetBuffer();
+
+ // And properties
+ invocation.getContext().getAttributeResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE).getKeys().clear();
+ }
+
+ public boolean isCommitted()
+ {
+ // Never afterCommit
+ return false;
+ }
+
+ public ResourceURL createResourceURL()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public CacheControl getCacheControl()
+ {
+ throw new NotYetImplemented();
+ }
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2008-01-10 23:15:34 UTC (rev 9482)
@@ -24,6 +24,7 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
@@ -49,6 +50,7 @@
import javax.portlet.WindowState;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
+import javax.servlet.http.Cookie;
import java.security.Principal;
import java.util.Collections;
import java.util.Enumeration;
@@ -468,4 +470,24 @@
{
return attributes;
}
+
+ public String getWindowID()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Cookie[] getCookies()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, String[]> getPrivateParameterMap()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, String[]> getPublicParameterMap()
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java 2008-01-10 23:15:34 UTC (rev 9482)
@@ -23,9 +23,14 @@
package org.jboss.portal.portlet.impl.jsr168.api;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
import org.jboss.portal.common.invocation.AttributeResolver;
+import org.jboss.portal.common.NotYetImplemented;
+import org.w3c.dom.Element;
+import org.w3c.dom.DOMException;
import javax.portlet.PortletResponse;
+import javax.servlet.http.Cookie;
import java.util.Collection;
import java.util.ArrayList;
@@ -42,6 +47,9 @@
/** . */
protected final PortletRequestImpl preq;
+ /** The namespace. */
+ protected String namespace;
+
protected PortletResponseImpl(PortletInvocation invocation, PortletRequestImpl preq)
{
this.invocation = invocation;
@@ -102,4 +110,29 @@
//
invocation.setAttribute(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, key, value);
}
+
+ public String getNamespace()
+ {
+ if (namespace == null)
+ {
+ String windowId = invocation.getWindowContext().getId();
+ namespace = PortletUtils.generateNamespaceFrom(windowId);
+ }
+ return namespace;
+ }
+
+ public void addProperty(Cookie cookie)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void addProperty(String s, Element element)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Element createElement(String s) throws DOMException
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java 2008-01-10 23:15:34 UTC (rev 9482)
@@ -69,26 +69,6 @@
}
}
- public String getWindowID()
- {
- throw new NotYetImplemented();
- }
-
- public Cookie[] getCookies()
- {
- throw new NotYetImplemented();
- }
-
- public Map<String, String[]> getPrivateParameterMap()
- {
- throw new NotYetImplemented();
- }
-
- public Map<String, String[]> getPublicParameterMap()
- {
- throw new NotYetImplemented();
- }
-
public String getETag()
{
throw new NotYetImplemented();
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java 2008-01-10 23:15:34 UTC (rev 9482)
@@ -22,210 +22,32 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.api;
-import org.jboss.portal.common.util.MediaType;
-import org.jboss.portal.common.util.ContentInfo;
import org.jboss.portal.common.NotYetImplemented;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
-import org.w3c.dom.Element;
-import org.w3c.dom.DOMException;
-import javax.activation.MimeTypeParseException;
-import javax.portlet.PortletURL;
import javax.portlet.RenderResponse;
import javax.portlet.PortletMode;
-import javax.portlet.ResourceURL;
-import javax.portlet.CacheControl;
-import javax.servlet.http.Cookie;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.Locale;
import java.util.Collection;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6704 $
*/
-public class RenderResponseImpl extends PortletResponseImpl implements RenderResponse
+public class RenderResponseImpl extends MimeResponseImpl implements RenderResponse
{
- /** The fragment result. */
- protected FragmentResponse result;
-
- /** The namespace. */
- protected String namespace;
-
- /** Not really used but we need it to memorize what the client set optionally. */
- protected int bufferSize;
-
public RenderResponseImpl(RenderInvocation invocation, PortletRequestImpl preq)
{
super(invocation, preq);
-
- // 0 means no buffering - we say no buffering
- this.bufferSize = 0;
- this.result = new FragmentResponse();
}
- public PortletInvocationResponse getResult()
- {
- return result;
- }
-
public void setTitle(String s)
{
result.setTitle(s);
}
- public String getContentType()
- {
- return result.getContentType();
- }
-
- public void setContentType(String contentType)
- {
- try
- {
- // Remove the unused appended charset first
- int index = contentType.indexOf(';');
- if (index != -1)
- {
- contentType = contentType.substring(0, index);
- }
-
- // Find the content type among the media type we know
- MediaType requestedMediaType = MediaType.parseMimeType(contentType);
-
- // Get the response media type
- ContentInfo info = invocation.getPortletContext().getMarkupInfo();
- MediaType responseMediaType = info.getContentType();
-
- // Check if the requested media type is allowed as a subtype of the main response
- if (!responseMediaType.isAllowedSubType(requestedMediaType))
- {
- throw new IllegalArgumentException("Content type not accepted");
- }
-
- // Set the content type
- result.setContentType(contentType);
- }
- catch (MimeTypeParseException e)
- {
- IllegalArgumentException ex = new IllegalArgumentException("Content type not accepted");
- ex.initCause(e);
- throw ex;
- }
- }
-
- public PrintWriter getWriter() throws IOException
- {
- return result.getWriter();
- }
-
- public OutputStream getPortletOutputStream() throws IOException
- {
- return result.getOutputStream();
- }
-
- public PortletURL createRenderURL()
- {
- return PortletUtils.createRenderURL(invocation, preq);
- }
-
- public PortletURL createActionURL()
- {
- return PortletUtils.createActionURL(invocation, preq);
- }
-
- public String getNamespace()
- {
- if (namespace == null)
- {
- String windowId = invocation.getWindowContext().getId();
- namespace = PortletUtils.generateNamespaceFrom(windowId);
- }
- return namespace;
- }
-
- public String getCharacterEncoding()
- {
- return invocation.getPortletContext().getMarkupInfo().getCharset();
- }
-
- public Locale getLocale()
- {
- return invocation.getUserContext().getLocale();
- }
-
- public void setBufferSize(int bufferSize)
- {
- if (bufferSize > -0)
- {
- this.bufferSize = bufferSize;
- }
- }
-
- public int getBufferSize()
- {
- return bufferSize;
- }
-
- public void flushBuffer() throws IOException
- {
- }
-
- public void resetBuffer()
- {
- // Clear the buffer
- result.resetBuffer();
- }
-
- public void reset()
- {
- // Clear the buffer
- resetBuffer();
-
- // And properties
- invocation.getContext().getAttributeResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE).getKeys().clear();
- }
-
- public boolean isCommitted()
- {
- // Never afterCommit
- return false;
- }
-
- public void addProperty(Cookie cookie)
- {
- throw new NotYetImplemented();
- }
-
- public void addProperty(String s, Element element)
- {
- throw new NotYetImplemented();
- }
-
- public Element createElement(String s) throws DOMException
- {
- throw new NotYetImplemented();
- }
-
public void setNextPossiblePortletModes(Collection<PortletMode> portletModes)
{
throw new NotYetImplemented();
}
-
- public ResourceURL createResourceURL()
- {
- throw new NotYetImplemented();
- }
-
- public CacheControl getCacheControl()
- {
- throw new NotYetImplemented();
- }
}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/StateAwareResponseImpl.java 2008-01-10 23:15:34 UTC (rev 9482)
@@ -0,0 +1,220 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.api;
+
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.RenderResponse;
+import org.jboss.portal.portlet.invocation.response.RedirectionResponse;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.NotYetImplemented;
+import org.apache.log4j.Logger;
+
+import javax.portlet.StateAwareResponse;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class StateAwareResponseImpl extends PortletResponseImpl implements StateAwareResponse
+{
+
+ private static final Logger log = Logger.getLogger(ActionResponseImpl.class);
+
+ protected static final int WANT_NOTHING = 0;
+ protected static final int WANT_RENDER = 1;
+ protected static final int WANT_REDIRECT = 2;
+
+ protected PortletInvocationResponse response;
+ protected int decision;
+
+ public StateAwareResponseImpl(PortletInvocation invocation, PortletRequestImpl preq)
+ {
+ super(invocation, preq);
+
+ //
+ RenderResponse rr = new RenderResponse();
+ rr.setNavigationalState(new PortletParametersStateString());
+
+ //
+ this.response = rr;
+ this.decision = WANT_NOTHING;
+ }
+
+ public PortletInvocationResponse getResult()
+ {
+ return response;
+ }
+
+ public void setWindowState(WindowState windowState) throws WindowStateException
+ {
+ if (decision == WANT_NOTHING || decision == WANT_RENDER)
+ {
+ if (!preq.isWindowStateAllowed(windowState))
+ {
+ throw new WindowStateException("Not supported", windowState);
+ }
+ ((RenderResponse)response).setWindowState(org.jboss.portal.WindowState.create(windowState.toString()));
+ decision = WANT_RENDER;
+ }
+ else
+ {
+ throw new IllegalStateException("Window state cannot be set after redirect");
+ }
+ }
+
+ public void setPortletMode(PortletMode portletMode) throws PortletModeException
+ {
+ if (decision == WANT_NOTHING || decision == WANT_RENDER)
+ {
+ if (portletMode == null)
+ {
+ // The spec does not define that case
+ // we just issue a warn
+ log.warn("Set null portlet mode");
+ }
+ else
+ {
+ if (!preq.isPortletModeAllowed(portletMode))
+ {
+ throw new PortletModeException("Not supported", portletMode);
+ }
+ Mode mode = Mode.create(portletMode.toString());
+ ((RenderResponse)response).setMode(mode);
+ }
+ decision = WANT_RENDER;
+ }
+ else
+ {
+ throw new IllegalStateException("Portlet mode cannot be set after redirect");
+ }
+ }
+
+ /**
+ * Generic send redirect.
+ *
+ * @param redirect
+ * @throws IllegalStateException implement jsr168 behavior if the portlet as already commited stuff
+ */
+ protected final void sendRedirect(RedirectionResponse redirect) throws IllegalStateException
+ {
+ if (decision == WANT_NOTHING || decision == WANT_REDIRECT)
+ {
+ response = redirect;
+ decision = WANT_REDIRECT;
+ }
+ else
+ {
+ throw new IllegalStateException("sendRedirect cannot be called after " +
+ "setPortletMode/setWindowState/setRenderParameter/setRenderParameters " +
+ "has been called previously");
+ }
+ }
+
+ public void setRenderParameters(Map<String, String[]> map)
+ {
+ PortletUtils.checkPortletParameterMapValidity(map);
+
+ //
+ if (decision == WANT_NOTHING || decision == WANT_RENDER)
+ {
+ ((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).replace(map);
+ decision = WANT_RENDER;
+ }
+ else
+ {
+ throw new IllegalStateException("setRenderParameters cannot be called after redirect");
+ }
+ }
+
+ public void setRenderParameter(String name, String value)
+ {
+ PortletUtils.checkPortletParameterValidity(name, value);
+
+ //
+ if (decision == WANT_NOTHING || decision == WANT_RENDER)
+ {
+ ((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).setValue(name, value);
+ decision = WANT_RENDER;
+ }
+ else
+ {
+ throw new IllegalStateException("setRenderParameter cannot be called after redirect");
+ }
+ }
+
+ public void setRenderParameter(String name, String[] values)
+ {
+ PortletUtils.checkPortletParameterValidity(name, values);
+
+ //
+ if (decision == WANT_NOTHING || decision == WANT_RENDER)
+ {
+ ((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).setValues(name, values);
+ decision = WANT_RENDER;
+ }
+ else
+ {
+ throw new IllegalStateException("setRenderParameter cannot be called after redirect");
+ }
+ }
+
+ public void setEvent(QName qName, Serializable serializable)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void setEvent(String s, Serializable serializable)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, String[]> getRenderParameterMap()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public PortletMode getPortletMode()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public WindowState getWindowState()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void removePublicRenderParameter(String s)
+ {
+ throw new NotYetImplemented();
+ }
+}
18 years, 3 months
JBoss Portal SVN: r9481 - in modules/portlet/trunk: portlet and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-10 17:12:28 -0500 (Thu, 10 Jan 2008)
New Revision: 9481
Modified:
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/portlet/pom.xml
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletRequestAttributes.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletSessionImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java
modules/portlet/trunk/test/pom.xml
Log:
make portlet container use Portlet 2.0 API and provided an NotYetImplemented implementation
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/build/pom.xml 2008-01-10 22:12:28 UTC (rev 9481)
@@ -50,6 +50,7 @@
<version.xerces>2.7.1</version.xerces>
<version.ant>1.7.0</version.ant>
<version.sun-jaxb>2.1.4</version.sun-jaxb>
+ <version.portlet-api>2.0-Draft32</version.portlet-api>
</properties>
<repositories>
@@ -392,6 +393,11 @@
<type>war</type>
<version>${version.cargo}</version>
</dependency>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>${version.portlet-api}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: modules/portlet/trunk/portlet/pom.xml
===================================================================
--- modules/portlet/trunk/portlet/pom.xml 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/pom.xml 2008-01-10 22:12:28 UTC (rev 9481)
@@ -12,12 +12,18 @@
<name>portlet</name>
<dependencies>
+<!--
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>portlet-jsr168api</artifactId>
<version>${project.version}</version>
</dependency>
+-->
<dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.portal.common</groupId>
<artifactId>common-portal</artifactId>
</dependency>
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletRequestAttributes.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletRequestAttributes.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletRequestAttributes.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -61,7 +61,7 @@
private UserContext userContext;
/** The lazy request attributes map added or removed during the request of the portlet. */
- private Map attributes;
+ private Map<String, Object> attributes;
public PortletRequestAttributes(PortletContainer container, UserContext userContext)
{
@@ -119,29 +119,29 @@
}
}
- public Iterator getAttributeNames(HttpServletRequest req)
+ public Iterator<String> getAttributeNames(HttpServletRequest req)
{
// Copy the attribute names to avoid ConcurrentModificationException
// one test in the TCK getPortalObjectContext the Enumeration then dispatch the call to a
// servlet where it use the Enumeration and it throws a CME if we don't copy
- Set names = new HashSet();
+ Set<String> names = new HashSet<String>();
//
if (req != null)
{
for (Enumeration e = req.getAttributeNames();e.hasMoreElements();)
{
- names.add(e.nextElement());
+ // Fixme : when migrated to servlet 2.5
+ names.add((String)e.nextElement());
}
}
//
if (attributes != null)
{
- for (Iterator i = attributes.entrySet().iterator(); i.hasNext();)
+ for (Map.Entry<String, Object> entry : attributes.entrySet())
{
- Map.Entry entry = (Map.Entry)i.next();
- String name = (String)entry.getKey();
+ String name = entry.getKey();
Object value = entry.getValue();
if (value == REMOVED_ATTRIBUTE)
{
@@ -173,7 +173,7 @@
}
if (attributes == null)
{
- attributes = new HashMap();
+ attributes = new HashMap<String, Object>();
}
attributes.put(name, value);
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -27,12 +27,15 @@
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.spi.ActionContext;
+import org.jboss.portal.common.NotYetImplemented;
import javax.portlet.ActionRequest;
+import javax.servlet.http.Cookie;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
+import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -127,4 +130,29 @@
{
return actionContext.getContentLength();
}
+
+ public String getWindowID()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Cookie[] getCookies()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, String[]> getPrivateParameterMap()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, String[]> getPublicParameterMap()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public String getMethod()
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -24,6 +24,7 @@
import org.apache.log4j.Logger;
import org.jboss.portal.Mode;
+import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
import org.jboss.portal.portlet.invocation.ActionInvocation;
@@ -31,13 +32,18 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.RedirectionResponse;
import org.jboss.portal.portlet.invocation.response.RenderResponse;
+import org.w3c.dom.Element;
+import org.w3c.dom.DOMException;
import javax.portlet.ActionResponse;
import javax.portlet.PortletMode;
import javax.portlet.PortletModeException;
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
+import javax.servlet.http.Cookie;
+import javax.xml.namespace.QName;
import java.io.IOException;
+import java.io.Serializable;
import java.util.Map;
/**
@@ -156,7 +162,7 @@
}
}
- public void setRenderParameters(Map map)
+ public void setRenderParameters(Map<String, String[]> map)
{
PortletUtils.checkPortletParameterMapValidity(map);
@@ -203,4 +209,59 @@
throw new IllegalStateException("setRenderParameter cannot be called after redirect");
}
}
+
+ public String getNamespace()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void addProperty(Cookie cookie)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void addProperty(String s, Element element)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Element createElement(String s) throws DOMException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void sendRedirect(String s, String s1) throws IOException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void setEvent(QName qName, Serializable serializable)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void setEvent(String s, Serializable serializable)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, String[]> getRenderParameterMap()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public PortletMode getPortletMode()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public WindowState getWindowState()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void removePublicRenderParameter(String s)
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -23,14 +23,17 @@
package org.jboss.portal.portlet.impl.jsr168.api;
import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
import javax.portlet.PortletConfig;
import javax.portlet.PortletContext;
+import javax.xml.namespace.QName;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Locale;
import java.util.ResourceBundle;
+import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -75,8 +78,38 @@
return info.getInitParameter(s);
}
- public Enumeration getInitParameterNames()
+ public Enumeration<String> getInitParameterNames()
{
return Collections.enumeration(info.getInitParameterNames());
}
+
+ public Enumeration<String> getPublicRenderParameterNames()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public String getDefaultNamespace()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Enumeration<QName> getPublishingEventQNames()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Enumeration<QName> getProcessingEventQNames()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Enumeration<Locale> getSupportedLocales()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, String[]> getContainerRuntimeOptions()
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -22,6 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.api;
+import org.jboss.portal.common.NotYetImplemented;
+
import javax.portlet.PortletContext;
import javax.portlet.PortletRequestDispatcher;
import javax.servlet.RequestDispatcher;
@@ -110,9 +112,9 @@
return servletContext.getRealPath(s);
}
- public Set getResourcePaths(String s)
+ public Set<String> getResourcePaths(String s)
{
- return servletContext.getResourcePaths(s);
+ return (Set<String>)servletContext.getResourcePaths(s);
}
public URL getResource(String s) throws MalformedURLException
@@ -121,8 +123,7 @@
{
throw new MalformedURLException("invalid resource");
}
- URL resource = servletContext.getResource(s);
- return resource;
+ return servletContext.getResource(s);
}
public Object getAttribute(String s)
@@ -134,9 +135,9 @@
return servletContext.getAttribute(s);
}
- public Enumeration getAttributeNames()
+ public Enumeration<String> getAttributeNames()
{
- return servletContext.getAttributeNames();
+ return (Enumeration<String>)servletContext.getAttributeNames();
}
public String getInitParameter(String s)
@@ -148,9 +149,9 @@
return servletContext.getInitParameter(s);
}
- public Enumeration getInitParameterNames()
+ public Enumeration<String> getInitParameterNames()
{
- return servletContext.getInitParameterNames();
+ return (Enumeration<String>)servletContext.getInitParameterNames();
}
public void log(String s)
@@ -181,4 +182,9 @@
{
return servletContext.getServletContextName();
}
+
+ public Enumeration<String> getContainerRuntimeOptions()
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -42,7 +42,6 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -75,7 +74,7 @@
protected final int mode;
/** Keep track of updates */
- protected final Map updates;
+ protected final Map<String, PropertyChange> updates;
public PortletPreferencesImpl(
PropertyContext prefs,
@@ -87,26 +86,25 @@
this.validator = validator;
this.containerPrefs = containerPrefs;
this.mode = mode;
- this.updates = new HashMap();
+ this.updates = new HashMap<String, PropertyChange>();
}
- public Map getMap()
+ public Map<String, String[]> getMap()
{
return new PreferencesMap();
}
- public Enumeration getNames()
+ public Enumeration<String> getNames()
{
// Clone the system names
- Set names = new HashSet(containerPrefs.getKeys());
+ Set<String> names = new HashSet<String>(containerPrefs.getKeys());
// Add the user
names.addAll(prefs.getKeys());
// Add the transient updates
- for (Iterator i = updates.values().iterator(); i.hasNext();)
+ for (PropertyChange change : updates.values())
{
- PropertyChange change = (PropertyChange)i.next();
if (change.getType() == PropertyChange.PREF_UPDATE)
{
names.add(change.getKey());
@@ -124,7 +122,7 @@
private Value getValue(String key)
{
Value value = null;
- PropertyChange change = (PropertyChange)updates.get(key);
+ PropertyChange change = updates.get(key);
if (change != null)
{
if (change.getType() == PropertyChange.PREF_UPDATE)
@@ -210,7 +208,7 @@
}
}
- public boolean isReadOnly(String key) throws IllegalArgumentException, IllegalArgumentException
+ public boolean isReadOnly(String key) throws IllegalArgumentException
{
if (key == null)
{
@@ -302,7 +300,7 @@
updates.clear();
}
- private class PreferencesMap extends HashMap
+ private class PreferencesMap extends HashMap<String, String[]>
{
/** The serialVersionUID */
@@ -313,9 +311,8 @@
super(10);
//
- for (Iterator i = containerPrefs.getKeys().iterator(); i.hasNext();)
+ for (String key : containerPrefs.getKeys())
{
- String key = (String)i.next();
String[] value = containerPrefs.getContainerPreference(key).getDefaultValue().asStringArray();
String[] clone = new String[value.length];
System.arraycopy(value, 0, clone, 0, value.length);
@@ -323,9 +320,8 @@
}
//
- for (Iterator i = prefs.getKeys().iterator(); i.hasNext();)
+ for (String key : prefs.getKeys())
{
- String key = (String)i.next();
String[] value = prefs.getValue(key).asStringArray();
String[] clone = new String[value.length];
System.arraycopy(value, 0, clone, 0, value.length);
@@ -333,9 +329,8 @@
}
//
- for (Iterator i = updates.values().iterator(); i.hasNext();)
+ for (PropertyChange change : updates.values())
{
- PropertyChange change = (PropertyChange)i.next();
String key = change.getKey();
if (change.getType() == PropertyChange.PREF_RESET)
@@ -357,9 +352,8 @@
if (value instanceof String[])
{
String[] strings = (String[])value;
- for (Iterator i = super.values().iterator(); i.hasNext();)
+ for (String[] other : super.values())
{
- String[] other = (String[])i.next();
if (Arrays.equals(strings, other))
{
return true;
@@ -369,17 +363,17 @@
return false;
}
- public Object get(Object key)
+ public String[] get(Object key)
{
- return (String[])super.get(key); // Should be cloned here to ensure immutability
+ return super.get(key); // Should be cloned here to ensure immutability
}
- public Collection values()
+ public Collection<String[]> values()
{
return super.values(); // String[] should be cloned here to ensure immutability
}
- public Set entrySet()
+ public Set<Map.Entry<String, String[]>> entrySet()
{
return super.entrySet();
}
@@ -389,7 +383,7 @@
*
* @return null
*/
- public Object put(Object key, Object value)
+ public String[] put(String key, String[] value)
{
return null;
}
@@ -399,13 +393,13 @@
*
* @return null
*/
- public Object remove(Object key)
+ public String[] remove(Object key)
{
return null;
}
/** Do not change state. */
- public void putAll(Map t)
+ public void putAll(Map<? extends String, ? extends String[]> m)
{
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -27,11 +27,14 @@
import org.jboss.portal.portlet.impl.jsr168.APIConstants;
import org.jboss.portal.portlet.impl.jsr168.DispatchedHttpServletRequest;
import org.jboss.portal.portlet.impl.jsr168.DispatchedHttpServletResponse;
+import org.jboss.portal.common.NotYetImplemented;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -91,4 +94,14 @@
throw new PortletException(e);
}
}
+
+ public void include(PortletRequest portletRequest, PortletResponse portletResponse) throws PortletException, IOException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void forward(PortletRequest portletRequest, PortletResponse portletResponse) throws PortletException, IOException, IllegalStateException
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -57,7 +57,6 @@
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import java.util.Vector;
import java.util.Collection;
/**
@@ -130,7 +129,7 @@
}
}
- public Enumeration getParameterNames()
+ public Enumeration<String> getParameterNames()
{
if (parameters != null)
{
@@ -138,7 +137,7 @@
}
else
{
- return Tools.EMPTY_ENUMERATION;
+ return (Enumeration<String>)Tools.EMPTY_ENUMERATION;
}
}
@@ -158,7 +157,7 @@
}
}
- public Map getParameterMap()
+ public Map<String, String[]> getParameterMap()
{
if (parameters != null)
{
@@ -166,7 +165,7 @@
}
else
{
- return Collections.EMPTY_MAP;
+ return (Map<String, String[]>)Collections.EMPTY_MAP;
}
}
@@ -190,7 +189,7 @@
return attributes.getAttribute(name, dreq);
}
- public Enumeration getAttributeNames()
+ public Enumeration<String> getAttributeNames()
{
return Tools.toEnumeration(attributes.getAttributeNames(dreq));
}
@@ -235,7 +234,7 @@
return (String)prop;
}
- public Enumeration getProperties(String name)
+ public Enumeration<String> getProperties(String name)
{
if (name == null)
{
@@ -244,30 +243,31 @@
//
Object prop = invocation.getAttribute(PortletInvocation.REQUEST_PROPERTIES_SCOPE, name);
- if (prop == null)
+
+ if (prop instanceof String)
{
- // Otherwise the request headers
- return dreq.getHeaders(name);
+ return Tools.toEnumeration((String)prop);
}
else if (prop instanceof Collection)
{
- return Collections.enumeration(((Collection)prop));
+ return Collections.enumeration(((Collection<String>)prop));
}
else
{
- return Tools.toEnumeration(prop);
+ // Otherwise the request headers
+ return (Enumeration<String>)dreq.getHeaders(name);
}
}
- public Enumeration getPropertyNames()
+ public Enumeration<String> getPropertyNames()
{
// First the properties
- Set names = new HashSet(invocation.getContext().getAttributeResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE).getKeys());
+ Set<String> names = new HashSet<String>((Set<String>)invocation.getContext().getAttributeResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE).getKeys());
// Then put the headers
- for (Enumeration e = dreq.getHeaderNames();e.hasMoreElements();)
+ for (Enumeration<String> e = (Enumeration<String>)dreq.getHeaderNames();e.hasMoreElements();)
{
- String name = (String)e.nextElement();
+ String name = e.nextElement();
names.add(name);
}
@@ -340,11 +340,9 @@
return invocation.getPortletContext().getMarkupInfo().getContentType().toString();
}
- public Enumeration getResponseContentTypes()
+ public Enumeration<String> getResponseContentTypes()
{
- Vector v = new Vector();
- v.add(getResponseContentType());
- return v.elements();
+ return Tools.toEnumeration(getResponseContentType());
}
// PLT.11.1.8
@@ -439,7 +437,7 @@
return dreq.isRequestedSessionIdValid();
}
- public Enumeration getLocales()
+ public Enumeration<Locale> getLocales()
{
return Collections.enumeration(userContext.getLocales());
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -77,12 +77,12 @@
}
else if (prop instanceof Collection)
{
- ((Collection)prop).add(value);
+ ((Collection<String>)prop).add(value);
}
else
{
- Collection c = new ArrayList();
- c.add(prop);
+ Collection<String> c = new ArrayList<String>();
+ c.add((String)prop);
c.add(value);
resolver.setAttribute(key, c);
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletSessionImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletSessionImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletSessionImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -22,10 +22,13 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.api;
+import org.jboss.portal.common.NotYetImplemented;
+
import javax.portlet.PortletContext;
import javax.portlet.PortletSession;
import javax.servlet.http.HttpSession;
import java.util.Enumeration;
+import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -63,15 +66,15 @@
return session.getAttribute(s);
}
- public Enumeration getAttributeNames()
+ public Enumeration<String> getAttributeNames()
{
return getAttributeNames(PORTLET_SCOPE);
}
- public Enumeration getAttributeNames(int scope)
+ public Enumeration<String> getAttributeNames(int scope)
{
final boolean app = scope == APPLICATION_SCOPE;
- return new Enumeration()
+ return new Enumeration<String>()
{
private Enumeration e;
private String next;
@@ -87,7 +90,7 @@
return next != null;
}
- public Object nextElement()
+ public String nextElement()
{
String result = next;
next = null;
@@ -195,6 +198,16 @@
return context;
}
+ public Map<String, Object> getAttributeMap()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, Object> getAttributeMap(int i)
+ {
+ throw new NotYetImplemented();
+ }
+
/** Return the underlying session. */
HttpSession getHttpSession()
{
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.impl.jsr168.api;
import org.jboss.portal.Mode;
+import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.portlet.ActionURL;
import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.PortletParametersStateString;
@@ -40,6 +41,8 @@
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
import java.util.Map;
+import java.io.Writer;
+import java.io.IOException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -109,7 +112,7 @@
url.getInternalParameters().setValues(name, values);
}
- public void setParameters(Map parameters)
+ public void setParameters(Map<String, String[]> parameters)
{
PortletUtils.checkPortletParameterMapValidity(parameters);
@@ -197,4 +200,44 @@
return navigationalState;
}
}
+
+ public PortletMode getPortletMode()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public WindowState getWindowState()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void removePublicRenderParameter(String s)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, String[]> getParameterMap()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void write(Writer writer) throws IOException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void write(Writer writer, boolean b) throws IOException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void addProperty(String s, String s1)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void setProperty(String s, String s1)
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -26,8 +26,11 @@
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.spi.RenderContext;
+import org.jboss.portal.common.NotYetImplemented;
import javax.portlet.RenderRequest;
+import javax.servlet.http.Cookie;
+import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -65,4 +68,29 @@
parameters = parametersState.getParameters();
}
}
+
+ public String getWindowID()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Cookie[] getCookies()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, String[]> getPrivateParameterMap()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Map<String, String[]> getPublicParameterMap()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public String getETag()
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java 2008-01-10 22:12:28 UTC (rev 9481)
@@ -24,19 +24,27 @@
import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
+import org.w3c.dom.Element;
+import org.w3c.dom.DOMException;
import javax.activation.MimeTypeParseException;
import javax.portlet.PortletURL;
import javax.portlet.RenderResponse;
+import javax.portlet.PortletMode;
+import javax.portlet.ResourceURL;
+import javax.portlet.CacheControl;
+import javax.servlet.http.Cookie;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Locale;
+import java.util.Collection;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -190,4 +198,34 @@
// Never afterCommit
return false;
}
+
+ public void addProperty(Cookie cookie)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void addProperty(String s, Element element)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public Element createElement(String s) throws DOMException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void setNextPossiblePortletModes(Collection<PortletMode> portletModes)
+ {
+ throw new NotYetImplemented();
+ }
+
+ public ResourceURL createResourceURL()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public CacheControl getCacheControl()
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: modules/portlet/trunk/test/pom.xml
===================================================================
--- modules/portlet/trunk/test/pom.xml 2008-01-10 21:34:08 UTC (rev 9480)
+++ modules/portlet/trunk/test/pom.xml 2008-01-10 22:12:28 UTC (rev 9481)
@@ -178,11 +178,17 @@
<artifactId>web-web</artifactId>
<type>jar</type>
</dependency>
+<!--
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>portlet-jsr168api</artifactId>
<version>${project.version}</version>
</dependency>
+-->
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ </dependency>
</dependencies>
@@ -274,9 +280,10 @@
<property name="dependency.junit.jar" value="${maven.dependency.junit.junit.jar.path}"/>
<property name="dependency.cargo-manager.war" value="${maven.dependency.cargo.cargo-manager.war.path}"/>
<property name="dependency.portal-web.jar" value="${maven.dependency.org.jboss.portal.web.web-web.jar.path}"/>
- <property name="dependency.jsr168api.jar" value="${maven.dependency.org.jboss.portal.portlet.portlet-jsr168api.jar.path}"/>
+ <!--<property name="dependency.jsr168api.jar" value="${maven.dependency.org.jboss.portal.portlet.portlet-jsr168api.jar.path}"/>-->
+ <property name="dependency.jsr168api.jar" value="${maven.dependency.javax.portlet.portlet-api.jar.path}"/>
<property name="dependency.portal-portlet.jar" value="${maven.dependency.org.jboss.portal.portlet.portlet-portlet.jar.path}"/>
- <property name="dependency.portal-portlet-tests.test-jar" value="${maven.dependency.org.jboss.portal.portlet.portlet-portlet.tests.test-jar.path}"/>
+ <property name="dependency.portal-portlet-tests.test-jar" value="${maven.dependency.org.jboss.portal.portlet.portlet-portlet.tests.test-jar.path}"/>
<property name="dependency.cargo-core-uberjar.jar" value="${maven.dependency.cargo.cargo-core-uberjar.jar.path}"/>
<property name="dependency.cargo-ant.jar" value="${maven.dependency.cargo.cargo-ant.jar.path}"/>
<property name="dependency.jaxb-api.jar" value="${maven.dependency.javax.xml.bind.jaxb-api.jar.path}"/>
18 years, 3 months
JBoss Portal SVN: r9480 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-01-10 16:34:08 -0500 (Thu, 10 Jan 2008)
New Revision: 9480
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
Log:
- Typo.
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2008-01-10 21:07:34 UTC (rev 9479)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2008-01-10 21:34:08 UTC (rev 9480)
@@ -24,9 +24,9 @@
import org.jboss.portal.common.concurrent.Valve;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
@@ -35,7 +35,7 @@
/**
* This aspect has two responsabilities :<br/> <ul> <li>continue the request only if the portlet container valve is
- * open. When the valle is closed, it will return an unavailable response to the caller. When the valve is open then the
+ * open. When the valve is closed, it will return an unavailable response to the caller. When the valve is open then the
* current thread of execution enters the valve for the duration of the call.</li> <li> if the response from the next
* aspect is an unavailable result, stop the container in order to destroy the portlet and implement this part of the
* portlet specification.</li> </ul>
18 years, 3 months
JBoss Portal SVN: r9479 - in modules/template: build and 5 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-10 16:07:34 -0500 (Thu, 10 Jan 2008)
New Revision: 9479
Modified:
modules/template/build/pom.xml
modules/template/module-a/pom.xml
modules/template/module-b/module-b1/pom.xml
modules/template/module-b/module-b2/pom.xml
modules/template/module-b/pom.xml
modules/template/module-c/pom.xml
modules/template/pom.xml
Log:
correct artifact naming
Modified: modules/template/build/pom.xml
===================================================================
--- modules/template/build/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
+++ modules/template/build/pom.xml 2008-01-10 21:07:34 UTC (rev 9479)
@@ -16,17 +16,17 @@
<version>1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.portal.templatemodule</groupId>
- <artifactId>jboss-portal-modules-templatemodule</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <groupId>org.jboss.portal.template</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>1.0-CR1</version>
<packaging>pom</packaging>
- <name>JBoss Portal TemplateModule</name>
+ <name>JBoss Portal TemplateModule Parent</name>
<description>JBoss Portal Template Module</description>
<!--All artifacts versions should be defined here-->
<properties>
<version.junit>3.8.1</version.junit>
- <version.jboss.unit>1.1.0-SNAPSHOT</version.jboss.unit>
+ <version.jboss.unit>1.2.0-SNAPSHOT</version.jboss.unit>
</properties>
@@ -78,7 +78,7 @@
<plugin>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit-tooling-maven2</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
</plugin>
</plugins>
</pluginManagement>
Modified: modules/template/module-a/pom.xml
===================================================================
--- modules/template/module-a/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
+++ modules/template/module-a/pom.xml 2008-01-10 21:07:34 UTC (rev 9479)
@@ -1,13 +1,13 @@
<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.jboss.portal.templatemodule</groupId>
- <artifactId>jboss-portal-modules-templatemodule</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <groupId>org.jboss.portal.template</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>1.0-CR1</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-portal-templatemodule-a</artifactId>
+ <artifactId>template-module-a</artifactId>
<packaging>jar</packaging>
<name>JBoss Portal TemplateModule ModuleA</name>
Modified: modules/template/module-b/module-b1/pom.xml
===================================================================
--- modules/template/module-b/module-b1/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
+++ modules/template/module-b/module-b1/pom.xml 2008-01-10 21:07:34 UTC (rev 9479)
@@ -1,13 +1,13 @@
<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.jboss.portal.templatemodule</groupId>
- <artifactId>jboss-portal-modules-templatemodule</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <groupId>org.jboss.portal.template</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>1.0-CR1</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-portal-templatemodule-b1</artifactId>
+ <artifactId>template-module-b1</artifactId>
<packaging>jar</packaging>
<name>JBoss Portal TemplateModule ModuleB1</name>
Modified: modules/template/module-b/module-b2/pom.xml
===================================================================
--- modules/template/module-b/module-b2/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
+++ modules/template/module-b/module-b2/pom.xml 2008-01-10 21:07:34 UTC (rev 9479)
@@ -1,21 +1,21 @@
<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.jboss.portal.templatemodule</groupId>
- <artifactId>jboss-portal-modules-templatemodule</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <groupId>org.jboss.portal.template</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>1.0-CR1</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-portal-templatemodule-b2</artifactId>
+ <artifactId>template-module-b2</artifactId>
<packaging>jar</packaging>
<name>JBoss Portal TemplateModule ModuleB2</name>
<!--Just a sample how we can refer to other modules in a project-->
<dependencies>
<dependency>
- <groupId>org.jboss.portal.templatemodule</groupId>
- <artifactId>jboss-portal-templatemodule-b1</artifactId>
+ <groupId>org.jboss.portal.template</groupId>
+ <artifactId>template-module-b1</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Modified: modules/template/module-b/pom.xml
===================================================================
--- modules/template/module-b/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
+++ modules/template/module-b/pom.xml 2008-01-10 21:07:34 UTC (rev 9479)
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.jboss.portal.templatemodule</groupId>
- <artifactId>jboss-portal-modules-templatemodule</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <groupId>org.jboss.portal.template</groupId>
+ <artifactId>module-aggregator</artifactId>
+ <version>1.0-CR1</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.templatemodule</groupId>
- <artifactId>jboss-portal-tempatemodule-b-aggregator</artifactId>
+ <artifactId>tempate-module-b-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal TemplateModule ModuleB (aggregator)</name>
- <version>1.0-SNAPSHOT</version>
+ <version>1.0-CR1</version>
<modules>
Modified: modules/template/module-c/pom.xml
===================================================================
--- modules/template/module-c/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
+++ modules/template/module-c/pom.xml 2008-01-10 21:07:34 UTC (rev 9479)
@@ -1,13 +1,13 @@
<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.jboss.portal.templatemodule</groupId>
- <artifactId>jboss-portal-modules-templatemodule</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <groupId>org.jboss.portal.template</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>1.0-CR1</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-portal-templatemodule-c</artifactId>
+ <artifactId>template-module-c</artifactId>
<packaging>jar</packaging>
<name>JBoss Portal TemplateModule ModuleC</name>
@@ -56,10 +56,10 @@
<!--<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>-->
<!--A temporary fork of orginal extended plugin until they update to newer ant version-->
- <groupId>org.jboss.unit</groupId>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
- <version>1.10-SNAPSHOT</version>
+ <version>1.13</version>
<dependencies>
Modified: modules/template/pom.xml
===================================================================
--- modules/template/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
+++ modules/template/pom.xml 2008-01-10 21:07:34 UTC (rev 9479)
@@ -1,11 +1,11 @@
<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>
- <groupId>org.jboss.portal.templatemodule</groupId>
- <artifactId>jboss-portal-modules-templatemodule-aggregator</artifactId>
+ <groupId>org.jboss.portal.template</groupId>
+ <artifactId>module-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Template Module (aggregator)</name>
- <version>1.0-SNAPSHOT</version>
+ <version>1.0-CR1</version>
<url>http://labs.jboss.com/jbossportal</url>
<dependencies/>
18 years, 3 months
JBoss Portal SVN: r9478 - in modules/portlet/trunk: bridge and 6 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-10 15:38:01 -0500 (Thu, 10 Jan 2008)
New Revision: 9478
Modified:
modules/portlet/trunk/bridge/pom.xml
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/federation/pom.xml
modules/portlet/trunk/jsr168api/pom.xml
modules/portlet/trunk/management/pom.xml
modules/portlet/trunk/pom.xml
modules/portlet/trunk/portlet/pom.xml
modules/portlet/trunk/test/pom.xml
Log:
normalize artifact ids
Modified: modules/portlet/trunk/bridge/pom.xml
===================================================================
--- modules/portlet/trunk/bridge/pom.xml 2008-01-10 20:37:49 UTC (rev 9477)
+++ modules/portlet/trunk/bridge/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
@@ -2,19 +2,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>jboss-portal-modules-portlet</artifactId>
+ <artifactId>module-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>bridge</artifactId>
+ <artifactId>portlet-bridge</artifactId>
<packaging>jar</packaging>
<name>bridge</name>
<dependencies>
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet</artifactId>
+ <artifactId>portlet-portlet</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-01-10 20:37:49 UTC (rev 9477)
+++ modules/portlet/trunk/build/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
@@ -17,7 +17,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>jboss-portal-modules-portlet</artifactId>
+ <artifactId>module-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Module</name>
@@ -142,22 +142,22 @@
<!--</dependency>-->
<dependency>
<groupId>org.jboss.portal.common</groupId>
- <artifactId>jboss-portal-modules-common</artifactId>
+ <artifactId>common-common</artifactId>
<version>${version.jboss.portal.common}</version>
</dependency>
<dependency>
<groupId>org.jboss.portal.common</groupId>
- <artifactId>jboss-portal-modules-common-portal</artifactId>
+ <artifactId>common-portal</artifactId>
<version>${version.jboss.portal.common}</version>
</dependency>
<dependency>
<groupId>org.jboss.portal.common</groupId>
- <artifactId>jboss-portal-modules-common-mc</artifactId>
+ <artifactId>common-mc</artifactId>
<version>${version.jboss.portal.common}</version>
</dependency>
<dependency>
<groupId>org.jboss.portal.web</groupId>
- <artifactId>portal-web</artifactId>
+ <artifactId>web-web</artifactId>
<version>${version.jboss.portal.web}</version>
</dependency>
<dependency>
@@ -188,7 +188,7 @@
</dependency>
<dependency>
<groupId>org.jboss.portal.common</groupId>
- <artifactId>jboss-portal-modules-common-mc</artifactId>
+ <artifactId>common-mc</artifactId>
<version>${version.jboss.portal.common}</version>
</dependency>
<dependency>
Modified: modules/portlet/trunk/federation/pom.xml
===================================================================
--- modules/portlet/trunk/federation/pom.xml 2008-01-10 20:37:49 UTC (rev 9477)
+++ modules/portlet/trunk/federation/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
@@ -2,19 +2,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>jboss-portal-modules-portlet</artifactId>
+ <artifactId>module-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>federation</artifactId>
+ <artifactId>portlet-federation</artifactId>
<packaging>jar</packaging>
<name>federation</name>
<dependencies>
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet</artifactId>
+ <artifactId>portlet-portlet</artifactId>
<version>${project.version}</version>
</dependency>
@@ -27,7 +27,7 @@
</dependency>
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet</artifactId>
+ <artifactId>portlet-portlet</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
Modified: modules/portlet/trunk/jsr168api/pom.xml
===================================================================
--- modules/portlet/trunk/jsr168api/pom.xml 2008-01-10 20:37:49 UTC (rev 9477)
+++ modules/portlet/trunk/jsr168api/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
@@ -2,12 +2,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>jboss-portal-modules-portlet</artifactId>
+ <artifactId>module-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>jsr168api</artifactId>
+ <artifactId>portlet-jsr168api</artifactId>
<packaging>jar</packaging>
<name>JSR 168 API</name>
Modified: modules/portlet/trunk/management/pom.xml
===================================================================
--- modules/portlet/trunk/management/pom.xml 2008-01-10 20:37:49 UTC (rev 9477)
+++ modules/portlet/trunk/management/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
@@ -2,19 +2,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>jboss-portal-modules-portlet</artifactId>
+ <artifactId>module-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>management</artifactId>
+ <artifactId>portlet-management</artifactId>
<packaging>jar</packaging>
<name>management</name>
<dependencies>
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet</artifactId>
+ <artifactId>portlet-portlet</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Modified: modules/portlet/trunk/pom.xml
===================================================================
--- modules/portlet/trunk/pom.xml 2008-01-10 20:37:49 UTC (rev 9477)
+++ modules/portlet/trunk/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
@@ -2,7 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>jboss-portal-modules-portlet-aggregator</artifactId>
+ <artifactId>module-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Module Aggregator</name>
<version>1.2.0-SNAPSHOT</version>
Modified: modules/portlet/trunk/portlet/pom.xml
===================================================================
--- modules/portlet/trunk/portlet/pom.xml 2008-01-10 20:37:49 UTC (rev 9477)
+++ modules/portlet/trunk/portlet/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
@@ -2,28 +2,28 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>jboss-portal-modules-portlet</artifactId>
+ <artifactId>module-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>portlet</artifactId>
+ <artifactId>portlet-portlet</artifactId>
<packaging>jar</packaging>
<name>portlet</name>
<dependencies>
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>jsr168api</artifactId>
+ <artifactId>portlet-jsr168api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.portal.common</groupId>
- <artifactId>jboss-portal-modules-common-portal</artifactId>
+ <artifactId>common-portal</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.portal.web</groupId>
- <artifactId>portal-web</artifactId>
+ <artifactId>web-web</artifactId>
</dependency>
<dependency>
<groupId>sun-servlet</groupId>
Modified: modules/portlet/trunk/test/pom.xml
===================================================================
--- modules/portlet/trunk/test/pom.xml 2008-01-10 20:37:49 UTC (rev 9477)
+++ modules/portlet/trunk/test/pom.xml 2008-01-10 20:38:01 UTC (rev 9478)
@@ -2,20 +2,20 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>jboss-portal-modules-portlet</artifactId>
+ <artifactId>module-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>test</artifactId>
+ <artifactId>portlet-test</artifactId>
<packaging>jar</packaging>
- <name>integration test</name>
+ <name>Portlet container test</name>
<dependencies>
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet</artifactId>
+ <artifactId>portlet-portlet</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
@@ -23,7 +23,7 @@
<!--TEST SCOPE-->
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet</artifactId>
+ <artifactId>portlet-portlet</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -32,7 +32,7 @@
</dependency>
<dependency>
<groupId>org.jboss.portal.common</groupId>
- <artifactId>jboss-portal-modules-common-mc</artifactId>
+ <artifactId>common-mc</artifactId>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
@@ -175,12 +175,12 @@
</dependency>
<dependency>
<groupId>org.jboss.portal.web</groupId>
- <artifactId>portal-web</artifactId>
+ <artifactId>web-web</artifactId>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>jsr168api</artifactId>
+ <artifactId>portlet-jsr168api</artifactId>
<version>${project.version}</version>
</dependency>
@@ -259,9 +259,9 @@
<property name="dependency.xml-apis.jar" value="${maven.dependency.apache-xerces.xml-apis.jar.path}"/>
<property name="dependency.jbossxb.jar" value="${maven.dependency.org.jboss.jbossxb.jar.path}"/>
<property name="dependency.jboss-remoting.jar" value="${maven.dependency.jboss.jboss-remoting.jar.path}"/>
- <property name="dependency.portal-common.jar" value="${maven.dependency.org.jboss.portal.common.jboss-portal-modules-common.jar.path}"/>
- <property name="dependency.portal-common-portal.jar" value="${maven.dependency.org.jboss.portal.common.jboss-portal-modules-common-portal.jar.path}"/>
- <property name="dependency.portal-common-mc.jar" value="${maven.dependency.org.jboss.portal.common.jboss-portal-modules-common-mc.jar.path}"/>
+ <property name="dependency.portal-common.jar" value="${maven.dependency.org.jboss.portal.common.common-common.jar.path}"/>
+ <property name="dependency.portal-common-portal.jar" value="${maven.dependency.org.jboss.portal.common.common-portal.jar.path}"/>
+ <property name="dependency.portal-common-mc.jar" value="${maven.dependency.org.jboss.portal.common.common-mc.jar.path}"/>
<property name="dependency.jboss-unit.jar" value="${maven.dependency.org.jboss.unit.jboss-unit.jar.path}"/>
<property name="dependency.jboss-unit-mc.jar" value="${maven.dependency.org.jboss.unit.jboss-unit-mc.jar.path}"/>
<property name="dependency.jboss-unit-remote.jar" value="${maven.dependency.org.jboss.unit.jboss-unit-remote.jar.path}"/>
@@ -273,10 +273,10 @@
<property name="dependency.activation.jar" value="${maven.dependency.javax.activation.activation.jar.path}"/>
<property name="dependency.junit.jar" value="${maven.dependency.junit.junit.jar.path}"/>
<property name="dependency.cargo-manager.war" value="${maven.dependency.cargo.cargo-manager.war.path}"/>
- <property name="dependency.portal-web.jar" value="${maven.dependency.org.jboss.portal.web.portal-web.jar.path}"/>
- <property name="dependency.jsr168api.jar" value="${maven.dependency.org.jboss.portal.portlet.jsr168api.jar.path}"/>
- <property name="dependency.portal-portlet.jar" value="${maven.dependency.org.jboss.portal.portlet.portlet.jar.path}"/>
- <property name="dependency.portal-portlet-tests.test-jar" value="${maven.dependency.org.jboss.portal.portlet.portlet.tests.test-jar.path}"/>
+ <property name="dependency.portal-web.jar" value="${maven.dependency.org.jboss.portal.web.web-web.jar.path}"/>
+ <property name="dependency.jsr168api.jar" value="${maven.dependency.org.jboss.portal.portlet.portlet-jsr168api.jar.path}"/>
+ <property name="dependency.portal-portlet.jar" value="${maven.dependency.org.jboss.portal.portlet.portlet-portlet.jar.path}"/>
+ <property name="dependency.portal-portlet-tests.test-jar" value="${maven.dependency.org.jboss.portal.portlet.portlet-portlet.tests.test-jar.path}"/>
<property name="dependency.cargo-core-uberjar.jar" value="${maven.dependency.cargo.cargo-core-uberjar.jar.path}"/>
<property name="dependency.cargo-ant.jar" value="${maven.dependency.cargo.cargo-ant.jar.path}"/>
<property name="dependency.jaxb-api.jar" value="${maven.dependency.javax.xml.bind.jaxb-api.jar.path}"/>
@@ -284,6 +284,7 @@
<ant antfile="${basedir}/src/test/build.xml">
<target name="tests"/>
</ant>
+
</tasks>
</configuration>
<goals>
18 years, 3 months