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}"/>