Author: julien(a)jboss.com
Date: 2008-02-06 20:28:49 -0500 (Wed, 06 Feb 2008)
New Revision: 9821
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletChunk.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletMarkupChunk.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletTitleChunk.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletURLChunk.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/MarkupTag.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/TitleTag.java
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/PortletChunk.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTag.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/index.jsp
Log:
improve taglib with support of markup/title
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java 2008-02-07
01:08:46 UTC (rev 9820)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java 2008-02-07
01:28:49 UTC (rev 9821)
@@ -25,7 +25,9 @@
import org.jboss.portal.portlet.test.jsp.response.Chunk;
import org.jboss.portal.portlet.test.jsp.response.BytesChunk;
import org.jboss.portal.portlet.test.jsp.response.CharsChunk;
-import org.jboss.portal.portlet.test.jsp.response.PortletChunk;
+import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk;
+import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChunk;
+import org.jboss.portal.portlet.test.jsp.response.portlet.PortletTitleChunk;
import org.jboss.portal.portlet.test.jsp.response.BufferingResponse;
import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer;
import org.jboss.portal.portlet.PortletInvoker;
@@ -214,6 +216,8 @@
//
int count = 0;
+ PortletChunk portletChunk = null;
+ PortletInvocationResponse portletResponse = null;
for (Chunk chunk : page.getChunks())
{
if (chunk instanceof BytesChunk)
@@ -230,15 +234,29 @@
}
else if (chunk instanceof PortletChunk)
{
- PortletChunk portletChunk = (PortletChunk)chunk;
+ portletChunk = (PortletChunk)chunk;
String windowId = "" + count++;
-
- PortletInvocationResponse response = responses.get(windowId);
- if (response != null)
+ portletResponse = responses.get(windowId);
+ }
+ else if (chunk instanceof PortletTitleChunk)
+ {
+ if (portletResponse != null)
{
- if (response instanceof FragmentResponse)
+ if (portletResponse instanceof FragmentResponse)
{
- FragmentResponse fragment = (FragmentResponse)response;
+ FragmentResponse fragment = (FragmentResponse)portletResponse;
+ writer.write(fragment.getTitle());
+ writer.flush();
+ }
+ }
+ }
+ else if (chunk instanceof PortletMarkupChunk)
+ {
+ if (portletResponse != null)
+ {
+ if (portletResponse instanceof FragmentResponse)
+ {
+ FragmentResponse fragment = (FragmentResponse)portletResponse;
if (fragment.getType() != FragmentResponse.TYPE_EMPTY)
{
String frag;
@@ -258,7 +276,7 @@
}
else
{
- writer.write(response.getClass().getSimpleName() + "[" +
portletChunk.getPortletName() + "," + portletChunk.getApplicationName() +
"]");
+ writer.write(portletResponse.getClass().getSimpleName() + "["
+ portletChunk.getPortletName() + "," + portletChunk.getApplicationName() +
"]");
writer.flush();
}
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java 2008-02-07
01:08:46 UTC (rev 9820)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PagePortletControllerContext.java 2008-02-07
01:28:49 UTC (rev 9821)
@@ -24,8 +24,7 @@
import org.jboss.portal.portlet.test.controller.AbstractPortletControllerContext;
import org.jboss.portal.portlet.test.jsp.response.Chunk;
-import org.jboss.portal.portlet.test.jsp.response.PortletChunk;
-import org.jboss.portal.portlet.test.jsp.response.BufferingResponse;
+import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk;
import org.jboss.portal.portlet.test.jsp.response.ResponseBuffer;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
Deleted:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/PortletChunk.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/PortletChunk.java 2008-02-07
01:08:46 UTC (rev 9820)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/PortletChunk.java 2008-02-07
01:28:49 UTC (rev 9821)
@@ -1,53 +0,0 @@
-/******************************************************************************
- * 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.response;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletChunk extends Chunk
-{
-
- /** . */
- private final String portletName;
-
- /** . */
- private final String applicationName;
-
- public PortletChunk(String portletName, String applicationName)
- {
- this.portletName = portletName;
- this.applicationName = applicationName;
- }
-
- public String getPortletName()
- {
- return portletName;
- }
-
- public String getApplicationName()
- {
- return applicationName;
- }
-}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletChunk.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletChunk.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletChunk.java 2008-02-07
01:28:49 UTC (rev 9821)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * 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.response.portlet;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.portlet.test.jsp.response.Chunk;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletChunk extends Chunk
+{
+
+ /** . */
+ private final String portletName;
+
+ /** . */
+ private final String applicationName;
+
+ /** . */
+ private final Mode initialMode;
+
+ /** . */
+ private final Set<Mode> supportedModes;
+
+ /** . */
+ private final Set<WindowState> supportedWindowStates;
+
+ public PortletChunk(String portletName, String applicationName, Mode initialMode,
Set<Mode> supportedModes, Set<WindowState> supportedWindowStates)
+ {
+ this.portletName = portletName;
+ this.applicationName = applicationName;
+ this.initialMode = initialMode;
+ this.supportedModes = supportedModes;
+ this.supportedWindowStates = supportedWindowStates;
+ }
+
+ public String getPortletName()
+ {
+ return portletName;
+ }
+
+ public String getApplicationName()
+ {
+ return applicationName;
+ }
+
+ public Mode getInitialMode()
+ {
+ return initialMode;
+ }
+
+ public Set<Mode> getSupportedModes()
+ {
+ return supportedModes;
+ }
+
+ public Set<WindowState> getSupportedWindowStates()
+ {
+ return supportedWindowStates;
+ }
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletMarkupChunk.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletMarkupChunk.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletMarkupChunk.java 2008-02-07
01:28:49 UTC (rev 9821)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.response.portlet;
+
+import org.jboss.portal.portlet.test.jsp.response.Chunk;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletMarkupChunk extends Chunk
+{
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletTitleChunk.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletTitleChunk.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletTitleChunk.java 2008-02-07
01:28:49 UTC (rev 9821)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.response.portlet;
+
+import org.jboss.portal.portlet.test.jsp.response.Chunk;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletTitleChunk extends Chunk
+{
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletURLChunk.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletURLChunk.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/response/portlet/PortletURLChunk.java 2008-02-07
01:28:49 UTC (rev 9821)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.response.portlet;
+
+import org.jboss.portal.portlet.test.jsp.response.Chunk;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletURLChunk extends Chunk
+{
+}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/MarkupTag.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/MarkupTag.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/MarkupTag.java 2008-02-07
01:28:49 UTC (rev 9821)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.response.BufferingResponse;
+import org.jboss.portal.portlet.test.jsp.response.portlet.PortletTitleChunk;
+import org.jboss.portal.portlet.test.jsp.response.portlet.PortletMarkupChunk;
+
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class MarkupTag extends SimpleTagSupport
+{
+ public void doTag() throws JspException, IOException
+ {
+ PageContext pageCtx = (PageContext)getJspContext();
+ pageCtx.getOut().flush();
+ BufferingResponse response = (BufferingResponse)pageCtx.getResponse();
+ response.addChunk(new PortletMarkupChunk());
+ }
+}
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-07
01:08:46 UTC (rev 9820)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortletTag.java 2008-02-07
01:28:49 UTC (rev 9821)
@@ -23,26 +23,48 @@
package org.jboss.portal.portlet.test.jsp.taglib;
import org.jboss.portal.portlet.test.jsp.response.BufferingResponse;
-import org.jboss.portal.portlet.test.jsp.response.PortletChunk;
+import org.jboss.portal.portlet.test.jsp.response.portlet.PortletChunk;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.Tools;
import javax.servlet.jsp.tagext.SimpleTagSupport;
+import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import java.io.IOException;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.Collections;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class PortletTag extends SimpleTagSupport
+public class PortletTag extends BodyTagSupport
{
/** . */
+ private static final Set<Mode> DEFAULT_MODES =
Collections.unmodifiableSet(Tools.toSet(Mode.VIEW, Mode.EDIT, Mode.HELP));
+
+ /** . */
+ private static final Set<WindowState> DEFAULT_WINDOW_STATES =
Collections.unmodifiableSet(Tools.toSet(WindowState.NORMAL, WindowState.MAXIMIZED,
WindowState.MINIMIZED));
+
+ /** . */
private String name;
/** . */
private String applicationName;
+ /** . */
+ private String supportedWindowStateValues;
+
+ /** . */
+ private String supportedModeValues;
+
+ /** . */
+ private String initialModeValue;
+
public String getName()
{
return name;
@@ -63,11 +85,99 @@
this.applicationName = applicationName;
}
- public void doTag() throws JspException, IOException
+ public String getSupportedWindowStates()
{
- PageContext pageCtx = (PageContext)getJspContext();
- pageCtx.getOut().flush();
- BufferingResponse response = (BufferingResponse)pageCtx.getResponse();
- response.addChunk(new PortletChunk(name, applicationName));
+ return supportedWindowStateValues;
}
+
+ public void setSupportedWindowStates(String supportedWindowStates)
+ {
+ this.supportedWindowStateValues = supportedWindowStates;
+ }
+
+ public String getSupportedModes()
+ {
+ return supportedModeValues;
+ }
+
+ public void setSupportedModes(String supportedModes)
+ {
+ this.supportedModeValues = supportedModes;
+ }
+
+ public String getInitialMode()
+ {
+ return initialModeValue;
+ }
+
+ public void setInitialMode(String initialMode)
+ {
+ this.initialModeValue = initialMode;
+ }
+
+ public int doStartTag() throws JspException
+ {
+ 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());
+ }
+
+ //
+ try
+ {
+ pageContext.getOut().flush();
+ }
+ catch (IOException e)
+ {
+ throw new JspException(e);
+ }
+
+ //
+ BufferingResponse response = (BufferingResponse)pageContext.getResponse();
+ response.addChunk(new PortletChunk(
+ name,
+ applicationName,
+ initialMode,
+ supportedModes,
+ supportedWindowStates));
+
+ //
+ return EVAL_BODY_INCLUDE;
+ }
+
+ public int doEndTag() throws JspException
+ {
+ return EVAL_PAGE;
+ }
}
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/TitleTag.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/TitleTag.java
(rev 0)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/TitleTag.java 2008-02-07
01:28:49 UTC (rev 9821)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * 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.response.BufferingResponse;
+import org.jboss.portal.portlet.test.jsp.response.portlet.PortletTitleChunk;
+
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class TitleTag extends SimpleTagSupport
+{
+ public void doTag() throws JspException, IOException
+ {
+ PageContext pageCtx = (PageContext)getJspContext();
+ pageCtx.getOut().flush();
+ BufferingResponse response = (BufferingResponse)pageCtx.getResponse();
+ response.addChunk(new PortletTitleChunk());
+ }
+}
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-07
01:08:46 UTC (rev 9820)
+++
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portal.tld 2008-02-07
01:28:49 UTC (rev 9821)
@@ -17,7 +17,7 @@
<tag>
<name>portlet</name>
<tag-class>org.jboss.portal.portlet.test.jsp.taglib.PortletTag</tag-class>
- <body-content>empty</body-content>
+ <body-content>JSP</body-content>
<attribute>
<name>name</name>
<required>true</required>
@@ -28,6 +28,30 @@
<required>true</required>
<type>java.lang.String</type>
</attribute>
+ <attribute>
+ <name>initialMode</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>supportedModes</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>supportedWindowStates</name>
+ <type>java.lang.String</type>
+ </attribute>
</tag>
+ <tag>
+ <name>markup</name>
+
<tag-class>org.jboss.portal.portlet.test.jsp.taglib.MarkupTag</tag-class>
+ <body-content>empty</body-content>
+ </tag>
+
+ <tag>
+ <name>title</name>
+
<tag-class>org.jboss.portal.portlet.test.jsp.taglib.TitleTag</tag-class>
+ <body-content>empty</body-content>
+ </tag>
+
</taglib>
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp 2008-02-07
01:08:46 UTC (rev 9820)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/index.jsp 2008-02-07
01:28:49 UTC (rev 9821)
@@ -4,19 +4,37 @@
<html>
<body>
<portal:page>
- ONE
+****************************************************<br/>
<portal:portlet
name="GoogleWeather"
- applicationName="google-weather-portlet"/>
- TWO
+ applicationName="google-weather-portlet">
+-----------------------------------<br/>
+<portal:title/><br/>
+-----------------------------------<br/>
+ <portal:markup/>
+-----------------------------------<br/>
+ </portal:portlet>
+****************************************************<br/>
<portal:portlet
name="GoogleMap"
- applicationName="google-map-portlet"/>
- THREE
+ applicationName="google-map-portlet">
+-----------------------------------<br/>
+<portal:title/><br/>
+-----------------------------------<br/>
+ <portal:markup/>
+-----------------------------------<br/>
+ </portal:portlet>
+****************************************************<br/>
<portal:portlet
name="RemoteControl"
- applicationName="remotecontrol-portlet"/>
- FOUR
+ applicationName="remotecontrol-portlet">
+-----------------------------------<br/>
+<portal:title/><br/>
+-----------------------------------<br/>
+ <portal:markup/>
+-----------------------------------<br/>
+ </portal:portlet>
+****************************************************<br/>
</portal:page>
</body>
</html>