portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r471072 - /portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java
Date Sat, 04 Nov 2006 00:25:46 GMT
Author: smilek
Date: Fri Nov  3 16:25:45 2006
New Revision: 471072

URL: http://svn.apache.org/viewvc?view=rev&rev=471072
Log:
added two include() methods for using PortletHeaderResponse.include mechanism; added init
method to get HeaderPage init-parameter; added to doHeader, call to include if HeaderPage
init-parameter is defined

Modified:
    portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java

Modified: portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java?view=diff&rev=471072&r1=471071&r2=471072
==============================================================================
--- portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java
(original)
+++ portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java
Fri Nov  3 16:25:45 2006
@@ -18,6 +18,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 
 import org.apache.commons.logging.Log;
@@ -40,6 +41,8 @@
      * Class specific logger.
      */
     private final static Log log = LogFactory.getLog(AbstractDojoVelocityPortlet.class);
+    
+    protected String headerPage;
 
     /*
      * Portlet constructor.
@@ -49,6 +52,12 @@
         super();
     }
 
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+        this.headerPage = this.getInitParameter("HeaderPage");
+    }
+    
     /*
      * Include Dojo and Turbo header content using header resource component.
      *
@@ -63,6 +72,11 @@
 
         headerResource.dojoEnable();
         includeHeaderContent( headerResource );
+        
+        if ( this.headerPage != null )
+        {
+            include( request, response, this.headerPage );
+        }
     }
     
     protected void includeHeaderContent( HeaderResource headerResource )
@@ -70,8 +84,15 @@
         // do nothing - intended for derived classes
     }
     
-    protected void appendHeaderText(StringBuffer headerInfoText, String header)
+    protected void include(PortletHeaderRequest request, PortletHeaderResponse response,
String headerPagePath, StringBuffer headerText) throws PortletException
+    {
+        response.include(request, response, headerPagePath);
+        headerText.append(response.getContent());
+    }
+    
+    protected void include(PortletHeaderRequest request, PortletHeaderResponse response,
String headerPagePath) throws PortletException
     {
-        headerInfoText.append("dojo.require('" + header + "');\r\n");
+        response.include(request, response, headerPagePath);
+        response.getHeaderResource().addHeaderInfo(response.getContent());
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message