From portal-commits at lists.jboss.org Thu Jan 18 11:44:51 2007 Content-Type: multipart/mixed; boundary="===============1822767400464408105==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r6034 - in trunk/core/src/main/org/jboss/portal/core: metadata/portlet and 1 other directory. Date: Thu, 18 Jan 2007 11:44:51 -0500 Message-ID: --===============1822767400464408105== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/HeaderIntercep= tor.java trunk/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderContent= MetaData.java Log: cleanup in header content stuff Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderI= nterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterce= ptor.java 2007-01-18 16:28:48 UTC (rev 6033) +++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterce= ptor.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.PortletInvocationRespo= nse; = @@ -49,15 +48,14 @@ { PortletInvocationResponse response =3D (PortletInvocationResponse)in= vocation.invokeNext(); = - // + // Only affect fragments if (response instanceof FragmentResponse) { - RenderInvocation render =3D (RenderInvocation)invocation; FragmentResponse fragment =3D (FragmentResponse)response; = // Add declaratively injected header content here (get it via the= component) String headerChars =3D fragment.getHeader(); // Chris' modif: not= e that the header might to be re-written... - PortletContainer container =3D ((ContainerPortletInfo)render.getI= nfo()).getContainer(); + PortletContainer container =3D ((ContainerPortletInfo)invocation.= getInfo()).getContainer(); JBossPortletMetaData portletMD =3D (JBossPortletMetaData)containe= r.getJBossMetaData(); if (portletMD !=3D null) { @@ -91,5 +89,4 @@ writer.write(element.outputToStringWith(contextPath)); } } - } Modified: trunk/core/src/main/org/jboss/portal/core/metadata/portlet/Header= ContentMetaData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderConten= tMetaData.java 2007-01-18 16:28:48 UTC (rev 6033) +++ trunk/core/src/main/org/jboss/portal/core/metadata/portlet/HeaderConten= tMetaData.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.

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)

* * @author Martin Holzner * @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 =3D "link"; + + /** . */ public static final String SCRIPT =3D "script"; + + /** . */ public static final String META =3D "meta"; = + /** . */ + protected final String type; + + /** . */ + protected final String elementType; + + /** . */ + private String bodyContent; + + protected Element(String elementType, String type) + { + this.type =3D type; + this.elementType =3D elementType; + } + public String getElementType() { return elementType; @@ -75,13 +92,6 @@ return type; } = - - protected Element(String elementType, String type) - { - this.type =3D type; - this.elementType =3D elementType; - } - /** * Create a link header element.

This element will create a link = tag.

* @@ -109,18 +119,6 @@ return new ScriptElement(type, src); } = - /** - * Create a meta header element.

This element will create a meta = tag.

- * - * @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 con= tent) - { - return new NamedMetaElement(name, content); - } - public String getBodyContent() { return bodyContent; @@ -174,16 +172,34 @@ } = protected abstract void outputSpecificWith(String contextPath, Strin= gBuffer buffer); + /** + * Create a meta header element.

This element will create a meta = tag.

+ * + * @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 con= tent) + { + 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 titl= e, 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) --===============1822767400464408105==--