portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r417769 - /portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java
Date Wed, 28 Jun 2006 14:47:09 GMT
Author: taylor
Date: Wed Jun 28 07:47:09 2006
New Revision: 417769

URL: http://svn.apache.org/viewvc?rev=417769&view=rev
Log:
include dojo

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?rev=417769&r1=417768&r2=417769&view=diff
==============================================================================
--- 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
Wed Jun 28 07:47:09 2006
@@ -41,7 +41,18 @@
  */
 public abstract class AbstractDojoVelocityPortlet extends GenericVelocityPortlet 
 {
-    protected abstract void includeDojoRequires(StringBuffer headerInfo);    
+    protected void includeDojoRequires(StringBuffer headerInfoText)
+    {
+    }
+    protected void includeDojoWidgetRequires(StringBuffer headerInfoText)
+    {
+        appendHeaderText(headerInfoText, "dojo.widget.Manager");
+    }
+    protected void includeDojoCustomWidgetRequires(StringBuffer headerInfoText)
+    {
+        headerInfoText.append("dojo.hostenv.setModulePrefix('jetspeed.ui.widget', '../desktop/widget');\r\n");
+        headerInfoText.append("dojo.hostenv.setModulePrefix('jetspeed.desktop', '../desktop/core');\r\n");
+    }
     
     /*
      * Class specific logger.
@@ -142,8 +153,9 @@
             headerInfoText.setLength(0);
             headerInfoText.append("\r\n");
             includeDojoRequires(headerInfoText);
+            includeDojoWidgetRequires(headerInfoText);
+            includeDojoCustomWidgetRequires(headerInfoText);
             
-            headerInfoText.append("dojo.hostenv.setModulePrefix('jetspeed.desktop', '../desktop/core');\r\n");
             headerInfoText.append("dojo.require('jetspeed.desktop.compatibility');\r\n");
 
             headerInfoMap = new HashMap(8);
@@ -164,6 +176,18 @@
             headerInfoMap.put("type", "text/javascript");
             headerResource.addHeaderInfo("script", headerInfoMap, headerInfoText.toString());
         }
+
+        // add jetspeed widget package if not already in use as desktop
+        if (!isJetspeedDesktop) 
+        {
+            headerInfoText.setLength(0);
+            headerInfoText.append("\r\n");
+            headerInfoText.append("dojo.widget.manager.registerWidgetPackage('jetspeed.ui.widget');\r\n");
+            headerInfoMap = new HashMap(8);
+            headerInfoMap.put("language", "JavaScript");
+            headerInfoMap.put("type", "text/javascript");
+            headerResource.addHeaderInfo("script", headerInfoMap, headerInfoText.toString());
+        }
         
         if (!isJetspeedDesktop)
         {
@@ -178,8 +202,6 @@
             headerInfoMap = new HashMap(8);
             headerResource.addHeaderInfo("style", headerInfoMap, headerInfoText.toString());
         }
-        
-
     }
     
     protected void appendHeaderText(StringBuffer headerInfoText, String header)



---------------------------------------------------------------------
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