Author: julien(a)jboss.com
Date: 2008-02-08 13:30:24 -0500 (Fri, 08 Feb 2008)
New Revision: 9872
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/Constants.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/JspWriterResponse.java
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jsp/
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jsp/error.jsp
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PageTag.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/ParamTag.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalBodyTagSupport.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletMarkupTag.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTag.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTitleTag.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletURLTag.java
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portal.tld
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag
modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/default.jsp
Log:
start to handle errors (for now portlet not found)
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/Constants.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/Constants.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/Constants.java 2008-02-08
18:30:24 UTC (rev 9872)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.test.jsp.taglib;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public final class Constants
+{
+
+ private Constants()
+ {
+ }
+
+ /** . */
+ public static final String ERROR_STATUS =
"org.jboss.portal.portlet.portal.error.status";
+
+ /** . */
+ public static final String ERROR_EXCEPTION =
"org.jboss.portal.portlet.portal.error.exception";
+
+ /** . */
+ public static final String ERROR_PORTLET_NAME =
"org.jboss.portal.portlet.portal.error.portlet_name";
+
+ /** . */
+ public static final String ERROR_APPLICATION_NAME =
"org.jboss.portal.portlet.portal.error.application_name";
+
+ /** . */
+ public static final String ERROR_WINDOW_ID =
"org.jboss.portal.portlet.portal.error.window_id";
+
+ /** . */
+ public static final String NOT_FOUND = "not_found";
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/JspWriterResponse.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/JspWriterResponse.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/JspWriterResponse.java 2008-02-08
18:30:24 UTC (rev 9872)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.test.jsp.taglib;
+
+import org.jboss.portal.portlet.test.jsp.PortalResponse;
+
+import javax.servlet.http.HttpServletResponseWrapper;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.ServletOutputStream;
+import java.io.PrintWriter;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class JspWriterResponse extends HttpServletResponseWrapper
+{
+
+ /** . */
+ private final JspWriter delegate;
+
+ /** . */
+ private final PrintWriter writer;
+
+ public JspWriterResponse(PortalResponse portalResponse, JspWriter delegate)
+ {
+ super(portalResponse);
+
+ //
+ this.delegate = delegate;
+ this.writer = new PrintWriter(delegate);
+ }
+
+ public PrintWriter getWriter() throws IOException
+ {
+ return writer;
+ }
+
+ public ServletOutputStream getOutputStream() throws IOException
+ {
+ throw new IllegalArgumentException();
+ }
+
+ public void resetBuffer()
+ {
+ try
+ {
+ delegate.clearBuffer();
+ }
+ catch (IOException ignore)
+ {
+ }
+ }
+}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PageTag.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PageTag.java 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PageTag.java 2008-02-08
18:30:24 UTC (rev 9872)
@@ -34,30 +34,58 @@
public class PageTag extends PortalBodyTagSupport
{
+ enum Status
+ {
+ INACTIVE, ACTIVE, SUSPENDED
+ }
+
String maximizedId;
String content;
+ Status status = Status.INACTIVE;
+
public int doStartTag() throws JspException
{
- PortalResponse response = getPortalResponse();
+ if (status == Status.INACTIVE)
+ {
+ PortalResponse response = getPortalResponse();
- //
- maximizedId = response.getMaximizedWindowId();
+ //
+ status = Status.ACTIVE;
- //
- if (maximizedId != null)
- {
- return EVAL_BODY_BUFFERED;
+ //
+ maximizedId = response.getMaximizedWindowId();
+
+ //
+ if (maximizedId != null)
+ {
+ return EVAL_BODY_BUFFERED;
+ }
+ else
+ {
+ return EVAL_BODY_INCLUDE;
+ }
}
else
{
- return EVAL_BODY_INCLUDE;
+ return SKIP_BODY;
}
}
public int doEndTag() throws JspException
{
+ switch (status)
+ {
+ case SUSPENDED:
+ break;
+ case INACTIVE:
+ break;
+ case ACTIVE:
+ status = Status.INACTIVE;
+ }
+
+ //
if (maximizedId != null)
{
try
@@ -70,6 +98,7 @@
}
}
+ //
return EVAL_PAGE;
}
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/ParamTag.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/ParamTag.java 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/ParamTag.java 2008-02-08
18:30:24 UTC (rev 9872)
@@ -30,7 +30,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class ParamTag extends SimpleTagSupport
+public class ParamTag extends PortalSimpleTagSupport
{
/** . */
@@ -59,7 +59,7 @@
this.value = value;
}
- public void doTag() throws JspException, IOException
+ public void internalDoTag() throws JspException, IOException
{
AbstractURLTag urlTag =
(AbstractURLTag)SimpleTagSupport.findAncestorWithClass(this, AbstractURLTag.class);
urlTag.setParam(name, value);
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalBodyTagSupport.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalBodyTagSupport.java 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalBodyTagSupport.java 2008-02-08
18:30:24 UTC (rev 9872)
@@ -25,6 +25,7 @@
import org.jboss.portal.portlet.test.jsp.PortalResponse;
import javax.servlet.jsp.tagext.BodyTagSupport;
+import javax.servlet.jsp.JspException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -36,4 +37,44 @@
{
return (PortalResponse)pageContext.getResponse();
}
+
+ public int doStartTag() throws JspException
+ {
+ PageTag pageTag = (PageTag)findAncestorWithClass(this, PageTag.class);
+
+ //
+ if (pageTag == null || pageTag.status != PageTag.Status.ACTIVE)
+ {
+ return SKIP_BODY;
+ }
+ else
+ {
+ return internalDoStartTag();
+ }
+ }
+
+ public int doEndTag() throws JspException
+ {
+ PageTag pageTag = (PageTag)findAncestorWithClass(this, PageTag.class);
+
+ //
+ if (pageTag != null && pageTag.status == PageTag.Status.ACTIVE)
+ {
+ return internalDoEndTag();
+ }
+ else
+ {
+ return EVAL_PAGE;
+ }
+ }
+
+ public int internalDoStartTag() throws JspException
+ {
+ return super.doStartTag();
+ }
+
+ public int internalDoEndTag() throws JspException
+ {
+ return super.doEndTag();
+ }
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java 2008-02-08
18:30:24 UTC (rev 9872)
@@ -26,6 +26,8 @@
import javax.servlet.jsp.tagext.SimpleTagSupport;
import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.JspException;
+import java.io.IOException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -38,4 +40,20 @@
PageContext pageContext = (PageContext)getJspContext();
return (PortalResponse)pageContext.getResponse();
}
+
+ public void doTag() throws JspException, IOException
+ {
+ PageTag pageTag = (PageTag)findAncestorWithClass(this, PageTag.class);
+
+ //
+ if (pageTag != null && pageTag.status == PageTag.Status.ACTIVE)
+ {
+ internalDoTag();
+ }
+ }
+
+ public void internalDoTag() throws JspException, IOException
+ {
+ super.doTag();
+ }
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletMarkupTag.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletMarkupTag.java 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletMarkupTag.java 2008-02-08
18:30:24 UTC (rev 9872)
@@ -39,9 +39,8 @@
*/
public class PortletMarkupTag extends PortalSimpleTagSupport
{
- public void doTag() throws JspException, IOException
+ public void internalDoTag() throws JspException, IOException
{
-
PortalResponse resp = getPortalResponse();
PortletTag portletTag = (PortletTag)SimpleTagSupport.findAncestorWithClass(this,
PortletTag.class);
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTag.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTag.java 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTag.java 2008-02-08
18:30:24 UTC (rev 9872)
@@ -46,6 +46,10 @@
import org.jboss.portal.common.util.ParameterMap;
import javax.servlet.jsp.JspException;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.Collections;
@@ -74,125 +78,241 @@
private static final Set<WindowState> DEFAULT_WINDOW_STATES =
Collections.unmodifiableSet(Tools.toSet(WindowState.NORMAL, WindowState.MAXIMIZED,
WindowState.MINIMIZED));
/** . */
- private String name;
+ private String nameAttr;
/** . */
- private String applicationName;
+ private String applicationNameAttr;
/** . */
- private String supportedWindowStateValues;
+ private String supportedWindowStatesAttr;
/** . */
- private String supportedModeValues;
+ private String supportedModesAttr;
/** . */
- private String initialModeValue;
+ private String initialModeAttr;
/** . */
+ private String errorPageAttr;
+
+ /** . */
private int status;
/** . */
+ private Set<WindowState> supportedWindowStates;
+
+ /** . */
+ private Set<Mode> supportedModes;
+
+ /** . */
+ private Mode initialMode;
+
+ /** . */
PortletResult result;
public String getName()
{
- return name;
+ return nameAttr;
}
public void setName(String name)
{
- this.name = name;
+ this.nameAttr = name;
}
public String getApplicationName()
{
- return applicationName;
+ return applicationNameAttr;
}
public void setApplicationName(String applicationName)
{
- this.applicationName = applicationName;
+ this.applicationNameAttr = applicationName;
}
public String getSupportedWindowStates()
{
- return supportedWindowStateValues;
+ return supportedWindowStatesAttr;
}
public void setSupportedWindowStates(String supportedWindowStates)
{
- this.supportedWindowStateValues = supportedWindowStates;
+ this.supportedWindowStatesAttr = supportedWindowStates;
}
public String getSupportedModes()
{
- return supportedModeValues;
+ return supportedModesAttr;
}
public void setSupportedModes(String supportedModes)
{
- this.supportedModeValues = supportedModes;
+ this.supportedModesAttr = supportedModes;
}
public String getInitialMode()
{
- return initialModeValue;
+ return initialModeAttr;
}
public void setInitialMode(String initialMode)
{
- this.initialModeValue = initialMode;
+ this.initialModeAttr = initialMode;
}
- public int doStartTag() throws JspException
+ public String getErrorPage()
{
- PortalResponse response = getPortalResponse();
- PagePortletControllerContext context = response.getPortletControllerContext();
- PageTag pageTag = (PageTag)findAncestorWithClass(this, PageTag.class);
+ return errorPageAttr;
+ }
- //
- Portlet portlet = context.findPortlet(applicationName, name);
+ public void setErrorPage(String errorPage)
+ {
+ this.errorPageAttr = errorPage;
+ }
- // Compute window id
- String windowId = portlet.getContext().getId() + "." +
response.nextId();
-
+ private void updateInternalState()
+ {
//
+ Set<Mode> supportedModes = new LinkedHashSet<Mode>();
+ if (supportedModesAttr != null)
+ {
+ for (String supportedModeValue : supportedModesAttr.split(","))
+ {
+ Mode mode = Mode.create(supportedModeValue.trim());
+ supportedModes.add(mode);
+ }
+ }
+ else
+ {
+ supportedModes = DEFAULT_MODES;
+ }
//
- if (pageTag.maximizedId != null)
+ Set<WindowState> supportedWindowStates = new
LinkedHashSet<WindowState>();
+ if (supportedWindowStatesAttr != null)
{
- if (windowId.equals(pageTag.maximizedId))
+ for (String supportedWindowStateValue :
supportedWindowStatesAttr.split(","))
{
- result = render(response, portlet, windowId);
- status = BUFFERED;
+ WindowState windowState =
WindowState.create(supportedWindowStateValue.trim());
+ supportedWindowStates.add(windowState);
}
- else
- {
- status = SKIPPED;
- }
}
else
{
- result = render(response, portlet, windowId);
- status = RENDERED;
+ supportedWindowStates = DEFAULT_WINDOW_STATES;
}
//
- switch (status)
+ Mode initialMode = Mode.VIEW;
+ if (initialModeAttr != null)
{
- case SKIPPED:
- return SKIP_BODY;
- case RENDERED:
- return EVAL_BODY_INCLUDE;
- case BUFFERED:
- return EVAL_BODY_BUFFERED;
- default:
- throw new AssertionError();
+ initialMode = Mode.create(initialModeAttr.trim());
}
+
+ //
+ this.initialMode = initialMode;
+ this.supportedModes = supportedModes;
+ this.supportedWindowStates = supportedWindowStates;
}
- public int doEndTag() throws JspException
+// private void handleError
+
+ public int internalDoStartTag() throws JspException
{
+ updateInternalState();
+
+ //
+ PortalResponse response = getPortalResponse();
+ PagePortletControllerContext context = response.getPortletControllerContext();
+ PageTag pageTag = (PageTag)findAncestorWithClass(this, PageTag.class);
+
+ //
+ Portlet portlet = context.findPortlet(applicationNameAttr, nameAttr);
+
+ //
+ if (portlet == null)
+ {
+ if (errorPageAttr != null)
+ {
+ RequestDispatcher rd =
pageContext.getServletContext().getRequestDispatcher(errorPageAttr);
+ if (rd != null)
+ {
+ ServletRequest request= pageContext.getRequest();
+
+ //
+ try
+ {
+ pageTag.status = PageTag.Status.SUSPENDED;
+ request.setAttribute(Constants.ERROR_STATUS, Constants.NOT_FOUND);
+ request.setAttribute(Constants.ERROR_APPLICATION_NAME,
applicationNameAttr);
+ request.setAttribute(Constants.ERROR_PORTLET_NAME, nameAttr);
+
+ //
+ rd.include(pageContext.getRequest(), new JspWriterResponse(response,
pageContext.getOut()));
+ }
+ catch (ServletException e)
+ {
+ // Shall we do smth else ?
+ e.printStackTrace();
+ }
+ catch (IOException e)
+ {
+ // Shall we do smth else ?
+ e.printStackTrace();
+ }
+ finally
+ {
+ pageTag.status = PageTag.Status.ACTIVE;
+ request.removeAttribute(Constants.ERROR_STATUS);
+ request.removeAttribute(Constants.ERROR_APPLICATION_NAME);
+ request.removeAttribute(Constants.ERROR_PORTLET_NAME);
+ }
+ }
+ }
+
+ // We cannot show an absent portlet, no meta data
+ return SKIP_BODY;
+ }
+ else
+ {
+ String windowId = portlet.getContext().getId() + "." +
response.nextId();
+
+ //
+ if (pageTag.maximizedId != null)
+ {
+ if (windowId.equals(pageTag.maximizedId))
+ {
+ result = render(response, portlet, windowId);
+ status = BUFFERED;
+ }
+ else
+ {
+ status = SKIPPED;
+ }
+ }
+ else
+ {
+ result = render(response, portlet, windowId);
+ status = RENDERED;
+ }
+
+ //
+ switch (status)
+ {
+ case SKIPPED:
+ return SKIP_BODY;
+ case RENDERED:
+ return EVAL_BODY_INCLUDE;
+ case BUFFERED:
+ return EVAL_BODY_BUFFERED;
+ default:
+ throw new AssertionError();
+ }
+ }
+ }
+
+ public int internalDoEndTag() throws JspException
+ {
result = null;
//
@@ -222,43 +342,6 @@
PagePortletControllerContext context = response.getPortletControllerContext();
//
- Set<Mode> supportedModes = new LinkedHashSet<Mode>();
- if (supportedModeValues != null)
- {
- for (String supportedModeValue : supportedModeValues.split(","))
- {
- Mode mode = Mode.create(supportedModeValue.trim());
- supportedModes.add(mode);
- }
- }
- else
- {
- supportedModes = DEFAULT_MODES;
- }
-
- //
- Set<WindowState> supportedWindowStates = new
LinkedHashSet<WindowState>();
- if (supportedWindowStateValues != null)
- {
- for (String supportedWindowStateValue :
supportedWindowStateValues.split(","))
- {
- WindowState windowState =
WindowState.create(supportedWindowStateValue.trim());
- supportedWindowStates.add(windowState);
- }
- }
- else
- {
- supportedWindowStates = DEFAULT_WINDOW_STATES;
- }
-
- //
- Mode initialMode = Mode.VIEW;
- if (initialModeValue != null)
- {
- initialMode = Mode.create(initialModeValue.trim());
- }
-
- //
PageNavigationalState pageNS = response.getPageState();
//
@@ -297,7 +380,6 @@
}
}
-
//
PortletInvocationContext renderContext =
context.createPortletInvocationContext(windowId, pageNS);
RenderInvocation render = new RenderInvocation(renderContext);
@@ -331,8 +413,8 @@
//
return new PortletResult(
- name,
- applicationName,
+ nameAttr,
+ applicationNameAttr,
windowId,
portletResponse,
initialMode,
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTitleTag.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTitleTag.java 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTitleTag.java 2008-02-08
18:30:24 UTC (rev 9872)
@@ -37,7 +37,7 @@
public class PortletTitleTag extends PortalSimpleTagSupport
{
- public void doTag() throws JspException, IOException
+ public void internalDoTag() throws JspException, IOException
{
PortletTag portletTag = (PortletTag)SimpleTagSupport.findAncestorWithClass(this,
PortletTag.class);
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletURLTag.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletURLTag.java 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletURLTag.java 2008-02-08
18:30:24 UTC (rev 9872)
@@ -70,12 +70,12 @@
this.windowStateValue = windowState;
}
- public int doStartTag() throws JspException
+ public int internalDoStartTag() throws JspException
{
return EVAL_BODY_BUFFERED;
}
- public int doEndTag() throws JspException
+ public int internalDoEndTag() throws JspException
{
PortalResponse response = getPortalResponse();
PagePortletControllerContext context = response.getPortletControllerContext();
Added:
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jsp/error.jsp
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jsp/error.jsp
(rev 0)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/jsp/error.jsp 2008-02-08
18:30:24 UTC (rev 9872)
@@ -0,0 +1,7 @@
+<%@ page language="java" %>
+Portlet was not rendered<br/>
+<%=
request.getAttribute("org.jboss.portal.portlet.portal.error.status")%><br/>
+<%=
request.getAttribute("org.jboss.portal.portlet.portal.error.portlet_name")%><br/>
+<%=
request.getAttribute("org.jboss.portal.portlet.portal.error.application_name")%><br/>
+<%=
request.getAttribute("org.jboss.portal.portlet.portal.error.exception")%><br/>
+<%=
request.getAttribute("org.jboss.portal.portlet.portal.error.window_id")%><br/>
Modified:
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portal.tld
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portal.tld 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portal.tld 2008-02-08
18:30:24 UTC (rev 9872)
@@ -45,6 +45,11 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
+ <attribute>
+ <name>errorPage</name>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ </attribute>
</tag>
<tag>
Modified:
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag 2008-02-08
18:30:24 UTC (rev 9872)
@@ -6,7 +6,8 @@
<portal:portlet
name="${name}"
- applicationName="${applicationName}">
+ applicationName="${applicationName}"
+ errorPage="/WEB-INF/jsp/error.jsp">
<div class="portlet">
<div class="portlet-frame">
<div class="header full-width">
@@ -23,7 +24,7 @@
<a href="<portal:portleturl
windowState='minimized'/>"><img
src="${pageContext.request.contextPath}/images/icon-minimize.gif"
alt=""/></a>
</span>
<span class="mode-button">
- <a title="Edit" href="<portal:portleturl
mode='edit'/>">Edit</a>
+ <a title="Edit" href="<portal:portleturl
mode='edit'/>">Edit</a>
</span>
</div>
</div>
Modified:
modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/default.jsp
===================================================================
---
modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/default.jsp 2008-02-08
11:57:11 UTC (rev 9871)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/default.jsp 2008-02-08
18:30:24 UTC (rev 9872)
@@ -29,6 +29,7 @@
<jbp:layout1>
<jsp:attribute name="leftcol">
<jbp:portlet name="RemoteControl"
applicationName="remotecontrol-portlet" />
+ <jbp:portlet name="Foo" applicationName="bar" />
</jsp:attribute>
<jsp:attribute name="rightcol">
<jbp:portlet name="GoogleMap"
applicationName="google-map-portlet" />