taylor 2004/06/05 18:59:59
Modified: commons/src/java/org/apache/jetspeed/container
JetspeedPortletContext.java
Log:
align Jetspeed PortletContext with Pluto
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.6 +14 -31
jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container/JetspeedPortletContext.java
Index: JetspeedPortletContext.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container/JetspeedPortletContext.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JetspeedPortletContext.java 6 Jun 2004 01:47:05 -0000 1.5
+++ JetspeedPortletContext.java 6 Jun 2004 01:59:59 -0000 1.6
@@ -17,7 +17,6 @@
import java.io.InputStream;
import java.util.Enumeration;
-import java.util.Vector;
import javax.servlet.ServletContext;
import javax.servlet.RequestDispatcher;
@@ -29,7 +28,6 @@
import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
import org.apache.jetspeed.services.JetspeedPortletServices;
import org.apache.jetspeed.services.PortletServices;
-import org.apache.jetspeed.container.namespace.NamespaceMapper;
import org.apache.pluto.om.portlet.PortletApplicationDefinition;
/**
@@ -116,15 +114,7 @@
PortletServices services = JetspeedPortletServices.getSingleton();
return services.getService(serviceName);
}
- String attributeName =
NamespaceMapper.encode(application.getId().toString(), name);
- Object attribute = servletContext.getAttribute(attributeName);
-
- if (attribute == null)
- {
- // TBD, not sure, if this should be done for all attributes or only
javax.servlet.
- attribute = servletContext.getAttribute(name);
- }
- return attribute;
+ return servletContext.getAttribute(name);
}
public void log(java.lang.String msg)
@@ -151,23 +141,7 @@
public Enumeration getAttributeNames()
{
- Enumeration attributes = servletContext.getAttributeNames();
-
- Vector portletAttributes = new Vector();
-
- while (attributes.hasMoreElements())
- {
- String attribute = (String) attributes.nextElement();
-
- String portletAttribute =
NamespaceMapper.encode(application.getId().toString(), attribute);
-
- if (portletAttribute != null) // it is in the portlet's namespace
- {
- portletAttributes.add(portletAttribute);
- }
- }
-
- return portletAttributes.elements();
+ return servletContext.getAttributeNames();
}
public java.lang.String getInitParameter(java.lang.String name)
@@ -182,12 +156,21 @@
public void removeAttribute(java.lang.String name)
{
-
servletContext.removeAttribute(NamespaceMapper.encode(application.getId().toString(),
name));
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Attribute name == null");
+ }
+
+ servletContext.removeAttribute(name);
}
public void setAttribute(java.lang.String name, java.lang.Object object)
{
-
servletContext.setAttribute(NamespaceMapper.encode(application.getId().toString(),
name), object);
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Attribute name == null");
+ }
+ servletContext.setAttribute(name, object);
}
public String getServerInfo()
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]