[portal-commits] JBoss Portal SVN: r6074 - in trunk/core-samples/src/main/org/jboss/portal/core/portlet: plugins and 1 other directory.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Tue Jan 23 08:00:22 EST 2007


Author: julien at jboss.com
Date: 2007-01-23 08:00:22 -0500 (Tue, 23 Jan 2007)
New Revision: 6074

Added:
   trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/
   trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/HeaderContentPortlet.java
Log:
added header content portlet to core-samples

Added: trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/HeaderContentPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/HeaderContentPortlet.java	                        (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/HeaderContentPortlet.java	2007-01-23 13:00:22 UTC (rev 6074)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, 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.core.portlet.plugins;
+
+import org.apache.log4j.Logger;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.Writer;
+
+/*
+ * Portlet to demonstrate the declarative header content feature.
+ * <p>This portlet injects css into the html HEAD tag via jboss-portlet.xml</p>
+ *
+ * @author <a href="mailto:mholzner at novell.com">Martin Holzner</a>
+ * @version $Revision: 5448 $
+*/
+
+public class HeaderContentPortlet extends GenericPortlet
+{
+   private static Logger log = Logger.getLogger(HeaderContentPortlet.class);
+
+   public void doView(RenderRequest req, RenderResponse res)
+      throws PortletException, IOException
+   {
+      log.debug("doView(): ...");
+
+      res.setContentType("text/html");
+      Writer writer = res.getWriter();
+      writer.write("<div id='Introducing-HeaderContent'/>");
+      writer.write("<div class=\"portlet-section-body\"><p id='rewrite-js'><button id=\"Introducing-HeaderContentInput\" class=\"portlet-form-button\" type='button' onClick='injectJS()'>Call injected javascript</button></p></div>");
+      writer.flush();
+      writer.close();
+   }
+}


Property changes on: trunk/core-samples/src/main/org/jboss/portal/core/portlet/plugins/HeaderContentPortlet.java
___________________________________________________________________
Name: svn:executable
   + *




More information about the portal-commits mailing list