Author: julien(a)jboss.com
Date: 2007-01-18 11:44:51 -0500 (Thu, 18 Jan 2007)
New Revision: 6034
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderContentMetaData.java
Log:
cleanup in header content stuff
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-01-18
16:28:48 UTC (rev 6033)
+++
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-01-18
16:44:51 UTC (rev 6034)
@@ -29,7 +29,6 @@
import org.jboss.portal.portlet.container.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
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;
@@ -49,15 +48,14 @@
{
PortletInvocationResponse response =
(PortletInvocationResponse)invocation.invokeNext();
- //
+ // Only affect fragments
if (response instanceof FragmentResponse)
{
- RenderInvocation render = (RenderInvocation)invocation;
FragmentResponse fragment = (FragmentResponse)response;
// Add declaratively injected header content here (get it via the component)
String headerChars = fragment.getHeader(); // Chris' modif: note that the
header might to be re-written...
- PortletContainer container =
((ContainerPortletInfo)render.getInfo()).getContainer();
+ PortletContainer container =
((ContainerPortletInfo)invocation.getInfo()).getContainer();
JBossPortletMetaData portletMD =
(JBossPortletMetaData)container.getJBossMetaData();
if (portletMD != null)
{
@@ -91,5 +89,4 @@
writer.write(element.outputToStringWith(contextPath));
}
}
-
}
Modified:
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderContentMetaData.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderContentMetaData.java 2007-01-18
16:28:48 UTC (rev 6033)
+++
trunk/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderContentMetaData.java 2007-01-18
16:44:51 UTC (rev 6034)
@@ -27,16 +27,16 @@
/**
* Meta data to describe a portlet's data to inject into the header of the page.
<p>A portlet can define additional
- * script or link tags in its descriptor (jboss-portlet.xml) that will be injected into
the head (via a separtate jsp
+ * script or link tags in its descriptor (jboss-portlet.xml) that will be injected into
the head (via a separate jsp
* tag)</p>
*
* @author <a href="mailto:mholzner@novell.com>Martin Holzner</a>
* @version $LastChangedRevision$, $LastChangedDate$
- * @see org.jboss.portal.common.plugin.PluginMetaData
*/
public class HeaderContentMetaData
{
+ /** . */
private List elements;
public HeaderContentMetaData()
@@ -58,13 +58,30 @@
public static abstract class Element
{
- protected final String type;
- protected final String elementType;
- private String bodyContent;
+ /** . */
public static final String LINK = "link";
+
+ /** . */
public static final String SCRIPT = "script";
+
+ /** . */
public static final String META = "meta";
+ /** . */
+ protected final String type;
+
+ /** . */
+ protected final String elementType;
+
+ /** . */
+ private String bodyContent;
+
+ protected Element(String elementType, String type)
+ {
+ this.type = type;
+ this.elementType = elementType;
+ }
+
public String getElementType()
{
return elementType;
@@ -75,13 +92,6 @@
return type;
}
-
- protected Element(String elementType, String type)
- {
- this.type = type;
- this.elementType = elementType;
- }
-
/**
* Create a link header element. <p>This element will create a link
tag.</p>
*
@@ -109,18 +119,6 @@
return new ScriptElement(type, src);
}
- /**
- * Create a meta header element. <p>This element will create a meta
tag.</p>
- *
- * @param name name attribute of the meta element
- * @param content content attribute of the meta element
- * @return a new meta header element
- */
- public static Element createNamedMetaElement(String name, String content)
- {
- return new NamedMetaElement(name, content);
- }
-
public String getBodyContent()
{
return bodyContent;
@@ -174,16 +172,34 @@
}
protected abstract void outputSpecificWith(String contextPath, StringBuffer
buffer);
+ /**
+ * Create a meta header element. <p>This element will create a meta
tag.</p>
+ *
+ * @param name name attribute of the meta element
+ * @param content content attribute of the meta element
+ * @return a new meta header element
+ */
+ public static Element createNamedMetaElement(String name, String content)
+ {
+ return new NamedMetaElement(name, content);
+ }
}
public static class LinkElement extends Element
{
+
+ /** . */
private String rel;
+
+ /** . */
private String href;
+
+ /** . */
private String title;
+
+ /** . */
private String media;
-
public LinkElement(String rel, String type, String href, String title, String
media)
{
super(LINK, type);
@@ -224,9 +240,10 @@
public static class ScriptElement extends Element
{
+
+ /** . */
private String src;
-
public ScriptElement(String type, String src)
{
super(SCRIPT, type);
@@ -246,7 +263,11 @@
public static class NamedMetaElement extends Element
{
+
+ /** . */
private String name;
+
+ /** . */
private String content;
public NamedMetaElement(String name, String content)
Show replies by date