You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by dd...@apache.org on 2004/03/26 04:38:17 UTC
cvs commit: jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl package.html ActionRequestImpl.java ActionResponseImpl.java PortletContextImpl.java PortletPreferencesImpl.java PortletRequestDispatcherImpl.java PortletSessionImpl.java
ddewolf 2004/03/25 19:38:17
Modified: sandbox/kuiper/src/java/org/apache/pluto/impl
ActionRequestImpl.java ActionResponseImpl.java
PortletContextImpl.java PortletPreferencesImpl.java
PortletRequestDispatcherImpl.java
PortletSessionImpl.java
Added: sandbox/kuiper/src/java/org/apache/pluto/impl package.html
Log:
Adding JavaDocs
Revision Changes Path
1.3 +7 -1 jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/ActionRequestImpl.java
Index: ActionRequestImpl.java
===================================================================
RCS file: /home/cvs/jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/ActionRequestImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ActionRequestImpl.java 25 Mar 2004 05:27:10 -0000 1.2
+++ ActionRequestImpl.java 26 Mar 2004 03:38:17 -0000 1.3
@@ -26,7 +26,8 @@
import java.io.InputStream;
import java.io.IOException;
-/**
+/** ActionRequest Implementation. Leverages the PortletRequstImpl
+ * for most of it's implementation.
*
* @author <A href="mailto:ddewolf@apache.org">David H. DeWolf</A>
* @version 1.0
@@ -42,6 +43,11 @@
super(plutoEnvironment, portletContext, window, request);
}
+ /** Retrieve the input stream for this request.
+ *
+ * @return
+ * @throws IOException
+ */
public InputStream getPortletInputStream()
throws IOException {
return super.getInputStream();
1.3 +41 -2 jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/ActionResponseImpl.java
Index: ActionResponseImpl.java
===================================================================
RCS file: /home/cvs/jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/ActionResponseImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ActionResponseImpl.java 25 Mar 2004 05:27:10 -0000 1.2
+++ ActionResponseImpl.java 26 Mar 2004 03:38:17 -0000 1.3
@@ -27,7 +27,8 @@
import java.io.IOException;
import java.util.Map;
-/**
+/** ActionResponse implementation. Leverages the PortletResponseImpl
+ * for most of it's implementation.
*
* @author <A href="mailto:ddewolf@apache.org">David H. DeWolf</A>
* @version 1.0
@@ -36,29 +37,46 @@
public class ActionResponseImpl extends PortletResponseImpl
implements ActionResponse {
+ /** The PortletWindow associated with this request. */
private PortletWindow window;
+
+ /** The render parameters associated with this
+ * response.
+ */
private Map renderParameters;
+
+ /** Flag indicating that the response has been commited. */
private boolean commited;
+ /** Default Constructor. */
public ActionResponseImpl(PortletWindow window,
HttpServletResponse response) {
super(response);
this.window = window;
this.renderParameters = new java.util.HashMap();
}
-
+
+ /** Update the window state by utilizing
+ * {@see PortletWindow#setWindowState} callback.
+ */
public void setWindowState(WindowState windowState)
throws WindowStateException {
commited = true;
window.setWindowState(windowState);
}
+ /** Update the PortletMode by utilizing the
+ * {@see PortletMode#setPortletMode} callback.
+ * @param portletMode
+ * @throws PortletModeException
+ */
public void setPortletMode(PortletMode portletMode)
throws PortletModeException {
commited = true;
window.setPortletMode(portletMode);
}
+ /** Instruct the portal to redirect it's response. */
public void sendRedirect(String url)
throws IOException {
if(isInCommitedState()) {
@@ -71,18 +89,39 @@
super.sendRedirect(url);
}
+ /** Set the render parameters of
+ * that should be used to any subsequent render
+ * request.
+ *
+ * @param map
+ */
public void setRenderParameters(Map map) {
renderParameters = map;
}
+ /** Set a render parameters that should be used for
+ * any subsequent render request.
+ * @param key
+ * @param value
+ */
public void setRenderParameter(String key, String value) {
renderParameters.put(key, new String[] {value});
}
+ /** Set the render parameter that should be set
+ * for any subsequent render request.
+ *
+ * @param key
+ * @param values
+ */
public void setRenderParameter(String key, String[] values) {
renderParameters.put(key, values);
}
+ /** Determine whther the response has been commited.
+ *
+ * @return
+ */
private boolean isInCommitedState() {
return commited;
}
1.3 +13 -2 jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/PortletContextImpl.java
Index: PortletContextImpl.java
===================================================================
RCS file: /home/cvs/jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/PortletContextImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PortletContextImpl.java 25 Mar 2004 05:27:10 -0000 1.2
+++ PortletContextImpl.java 26 Mar 2004 03:38:17 -0000 1.3
@@ -32,7 +32,17 @@
import java.net.URL;
import java.net.MalformedURLException;
-/**
+/** PortletContext implementation.
+ * This implementation leverages the underlying ServletContext
+ * by acting as a decorator.
+ *
+ * <P>NOTE: The {@link LoggerService} for this implementation
+ * not only provides internal logging facilities, it also
+ * is used to provide the default portlet context log which
+ * will be used for all {@link #log(java.lang.String)} and
+ * {@link #log(java.lang.String, java.lang.Throwable)}
+ * requests. The name associated with this log is
+ * org.apache.pluto.impl.portlet_context_log.
*
* @author <A href="mailto:ddewolf@apache.org">David H. DeWolf</A>
* @version 1.0
@@ -44,7 +54,8 @@
private Logger logger;
private HashMap attributes;
- public PortletContextImpl(ServletContext context, LoggerService service) {
+ public PortletContextImpl(ServletContext context,
+ LoggerService service) {
this.context = context;
this.attributes = new HashMap();
this.logger = service.getLogger(PortletContextImpl.class);
1.3 +19 -1 jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/PortletPreferencesImpl.java
Index: PortletPreferencesImpl.java
===================================================================
RCS file: /home/cvs/jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/PortletPreferencesImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PortletPreferencesImpl.java 25 Mar 2004 05:27:10 -0000 1.2
+++ PortletPreferencesImpl.java 26 Mar 2004 03:38:17 -0000 1.3
@@ -25,7 +25,12 @@
import java.util.Collections;
import java.io.IOException;
-/**
+/** PortletPreferences implementation. This implementation
+ * does NOT support setting preferences.
+ *
+ * This implementation still needs a lot of help! We need to
+ * support the prefernce validator as well as all storage
+ * set and resets.
*
* @author <A href="mailto:ddewolf@apache.org">David H. DeWolf</A>
* @version 1.0
@@ -55,30 +60,43 @@
return dflts;
}
+ /** Set the value of the given preference. */
public void setValue(String s, String s1) throws ReadOnlyException {
throw new ReadOnlyException("Set not implemented/supported");
}
+ /** Set the values of the given preferences. */
public void setValues(String s, String[] strings) throws ReadOnlyException {
throw new ReadOnlyException("Set not implemented/supported");
}
+ /** Retrieve all of th names of the preferences. */
public Enumeration getNames() {
return new Vector(map.keySet()).elements();
}
+ /** Retrieve the preferences as a map.
+ *
+ * @return
+ */
public Map getMap() {
return Collections.unmodifiableMap(map);
}
+ /** Add all of the following preferences
+ * to this preference store.
+ * @param map
+ */
public void addAll(Map map) {
this.map.putAll(map);
}
+ /** Reset the given preferences to the default value. */
public void reset(String s) throws ReadOnlyException {
throw new ReadOnlyException("Reset not implemented/supported");
}
+ /** Store any modified preferences. */
public void store() throws IOException, ValidatorException {
throw new IOException("Store not supported");
}
1.3 +12 -3 jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/PortletRequestDispatcherImpl.java
Index: PortletRequestDispatcherImpl.java
===================================================================
RCS file: /home/cvs/jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/PortletRequestDispatcherImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PortletRequestDispatcherImpl.java 25 Mar 2004 05:27:10 -0000 1.2
+++ PortletRequestDispatcherImpl.java 26 Mar 2004 03:38:17 -0000 1.3
@@ -24,9 +24,9 @@
import javax.servlet.ServletException;
import java.io.IOException;
-/**
- * <B>TODO</B>: Document
- *
+/** PortletRequestDispatcher implementation. This implementation
+ * leverages the RequestDispatcher which it decorates.
+ *
* @author <A href="mailto:ddewolf@apache.org">David H. DeWolf</A>
* @version 1.0
* @since Mar 4, 2004 at 9:43:57 PM
@@ -34,15 +34,24 @@
public class PortletRequestDispatcherImpl
implements PortletRequestDispatcher {
+ /** Underlying/Decorated dispatcher. */
private RequestDispatcher dispatcher;
+
+ /** Default Constructor. */
public PortletRequestDispatcherImpl(RequestDispatcher dispatcher) {
this.dispatcher = dispatcher;
}
+ /** Include the given resources. */
public void include(RenderRequest request,
RenderResponse response)
throws PortletException, IOException {
try {
+ //@TODO when the OptionalServiceFactory
+ // is implemented, we'll need to take
+ // a hard look at this! We *may* be
+ // ok though since it's the request
+ // which manages out lifecycle.
if(request instanceof RenderRequestImpl
&&response instanceof RenderResponseImpl) {
dispatcher.include((RenderRequestImpl)request,
1.3 +51 -3 jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/PortletSessionImpl.java
Index: PortletSessionImpl.java
===================================================================
RCS file: /home/cvs/jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/PortletSessionImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PortletSessionImpl.java 25 Mar 2004 05:27:10 -0000 1.2
+++ PortletSessionImpl.java 26 Mar 2004 03:38:17 -0000 1.3
@@ -22,16 +22,22 @@
import java.util.Enumeration;
import java.util.Vector;
-/**
+/** PortletSession implementation. Leverages the decorated
+ * HttpSession wherever possible.
*
* @author <A href="mailto:ddewolf@apache.org">David H. DeWolf</A>
* @version 1.0
* @since Mar 4, 2004 at 10:00:57 PM
*/
public class PortletSessionImpl implements PortletSession {
-
+
+ /** Decorated session. */
private HttpSession session;
+
+ /** The portlet prefix which identifies us. */
private String prefix;
+
+ /** The PortletContext in which we reside. */
private PortletContext context;
/** Constructs a PortletSessionImpl for the given
@@ -48,11 +54,20 @@
this.prefix = "javax.portlet.p."+windowID+"?";
this.session = session;
}
-
+
+ /** Retrieve the attribute (within portlet scope)
+ * with the given key.
+ */
public Object getAttribute(String s) {
return getAttribute(s, PORTLET_SCOPE);
}
+ /** Retrieve the attribute with the given key
+ * and scope.
+ * @param s
+ * @param i
+ * @return
+ */
public Object getAttribute(String s, int i) {
if(i==PortletSession.APPLICATION_SCOPE) {
return session.getAttribute(s);
@@ -62,6 +77,10 @@
}
}
+ /** Retrieve all of the attribute names
+ * which reside within Portlet scope.
+ * @return
+ */
public Enumeration getAttributeNames() {
return getAttributeNames(PortletSession.PORTLET_SCOPE);
}
@@ -89,34 +108,48 @@
}
}
+ /** Retrieve the time at which the
+ * underlying session was created.
+ * @return
+ */
public long getCreationTime() {
return session.getCreationTime();
}
+ /** Retrieve the id of the underlying session. */
public String getId() {
return session.getId();
}
+ /** Retrieve the last time this session was accessed. */
public long getLastAccessedTime() {
return session.getLastAccessedTime();
}
+ /** Retrieve the maximum timeout interval of
+ * the underlying session.
+ * @return
+ */
public int getMaxInactiveInterval() {
return session.getMaxInactiveInterval();
}
+ /** Invalidate this and the underlying session. */
public void invalidate() {
session.invalidate();
}
+ /** Determine if the underlying session is new. */
public boolean isNew() {
return session.isNew();
}
+ /** Remove the named attribute. */
public void removeAttribute(String s) {
removeAttribute(s, PortletSession.PORTLET_SCOPE);
}
+ /** Remove the named attribute in the given scope. */
public void removeAttribute(String s, int i) {
if(i==PortletSession.APPLICATION_SCOPE) {
session.removeAttribute(s);
@@ -126,10 +159,21 @@
}
}
+ /** Set the attribute with the given name
+ * and value.
+ * @param s
+ * @param o
+ */
public void setAttribute(String s, Object o) {
setAttribute(s,o,PortletSession.PORTLET_SCOPE);
}
+ /** Set the attribute with the given name,
+ * value and scope.
+ * @param s
+ * @param o
+ * @param i
+ */
public void setAttribute(String s, Object o, int i) {
if(i==PortletSession.APPLICATION_SCOPE) {
session.setAttribute(s,o);
@@ -139,6 +183,10 @@
}
}
+ /** Set the maximum inactive interval for the
+ * underlying session.
+ * @param i
+ */
public void setMaxInactiveInterval(int i) {
session.setMaxInactiveInterval(i);
}
1.1 jakarta-pluto/sandbox/kuiper/src/java/org/apache/pluto/impl/package.html
Index: package.html
===================================================================
<HTML>
<BODY>
Default implementations of the Portlet API.
</BODY>
</HTML>