portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r472285 - in /portals/jetspeed-2/trunk: components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/ components/portal/src/java/org/apache/jetspeed/aggregator/impl/ components/portal/src/java/org/apache/jetspeed/desktop/impl...
Date Tue, 07 Nov 2006 21:32:42 GMT
Author: smilek
Date: Tue Nov  7 13:32:41 2006
New Revision: 472285

URL: http://svn.apache.org/viewvc?view=rev&rev=472285
Log:
updated for dojo-release-0.4.0

Modified:
    portals/jetspeed-2/trunk/components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopContextImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/Constants.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/MovePortletAction.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/desktop/JetspeedDesktopContext.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/headerresource/HeaderResource.java

Modified: portals/jetspeed-2/trunk/components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java?view=diff&rev=472285&r1=472284&r2=472285
==============================================================================
--- portals/jetspeed-2/trunk/components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java (original)
+++ portals/jetspeed-2/trunk/components/header-resource/src/java/org/apache/jetspeed/headerresource/impl/HeaderResourceImpl.java Tue Nov  7 13:32:41 2006
@@ -37,7 +37,7 @@
  * Default implementation for HeaderResource
  * 
  * @author <a href="mailto:shinsuke@yahoo.co.jp">Shinsuke Sugaya</a>
- * @version $Id: PortalReservedParameters.java 188569 2005-05-13 13:35:18Z weaver $
+ * @version $Id: HeaderResourceImpl.java 188569 2005-05-13 13:35:18Z weaver $
  */
 public class HeaderResourceImpl implements HeaderResource
 {
@@ -954,16 +954,16 @@
      */
     public void dojoEnable()
     {
-        getHeaderDynamicConfiguration().put( "dojo.enable", "true" );
+        getHeaderDynamicConfiguration().put( HEADER_CONFIG_DOJO_ENABLE, "true" );
     }
     
     protected void dojoDisable()
     {
-        getHeaderDynamicConfiguration().put( "dojo.enable", "false" );
+        getHeaderDynamicConfiguration().put( HEADER_CONFIG_DOJO_ENABLE, "false" );
     }
     protected String dojoGetPath()
     {
-        return (String)getHeaderDynamicConfiguration().get( "dojo.path" );
+        return (String)getHeaderDynamicConfiguration().get( HEADER_CONFIG_DOJO_PATH );
     }
     protected void dojoAddRequire( String dojoRequire, String addToHeaderName )
     {

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java?view=diff&rev=472285&r1=472284&r2=472285
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java Tue Nov  7 13:32:41 2006
@@ -54,7 +54,7 @@
  * 
  * @author <a href="mailto:raphael@apache.org">Rapha�l Luta </a>
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
- * @version $Id: PageAggregatorImpl.java 359125 2005-12-26 23:16:39Z rwatler $
+ * @version $Id: HeaderAggregatorImpl.java 359125 2005-12-26 23:16:39Z rwatler $
  */
 public class HeaderAggregatorImpl implements PageAggregator
 {
@@ -185,6 +185,7 @@
      *    "header.types"         - HeaderResource.HEADER_CONFIG_TYPES
      *    "header.requiredflag"  - HeaderResource.HEADER_CONFIG_REQUIREDFLAG
      *    "dojo"                 - HeaderResource.HEADER_CONFIG_DOJO
+     *    "desktop"              - HeaderResource.HEADER_CONFIG_DESKTOP
      */
     protected Map initializeHeaderConfigurationDefaults( HashMap namedResourcesDefault, HashMap namedResourcesAddedFragmentsDefault )
     {
@@ -223,6 +224,7 @@
                 }
             }
         }
+        initializeMissingHeaderConfigurationEntryDefaults( namedResourcesDefault, namedResourcesAddedFragmentsDefault, headerDynamicConfigurationDefault );
         
         postinitializeHeaderOrderConfigurationDefaults( headerDynamicConfigurationDefault );
         
@@ -366,9 +368,29 @@
             initializeDojoHeaderConfigurationDefaults( (Map)headerConfigValue, namedResourcesDefault, namedResourcesAddedFragmentsDefault, headerDynamicConfigurationDefault );
             return true;
         }
+        else if ( headerConfigKey.equals( HeaderResource.HEADER_CONFIG_DESKTOP ) )
+        {
+            initializeDesktopHeaderConfigurationDefaults( (Map)headerConfigValue, namedResourcesDefault, namedResourcesAddedFragmentsDefault, headerDynamicConfigurationDefault );
+            return true;
+        }
         return false;
     }
     
+    protected void initializeMissingHeaderConfigurationEntryDefaults( HashMap namedResourcesDefault, HashMap namedResourcesAddedFragmentsDefault, HashMap headerDynamicConfigurationDefault )
+    {
+        if ( isDesktop() )
+        {
+            if ( this.headerConfiguration.get( HeaderResource.HEADER_CONFIG_DOJO ) == null )
+            {
+                initializeDojoHeaderConfigurationDefaults( null, namedResourcesDefault, namedResourcesAddedFragmentsDefault, headerDynamicConfigurationDefault );
+            }
+            if ( this.headerConfiguration.get( HeaderResource.HEADER_CONFIG_DESKTOP ) == null )
+            {
+                initializeDesktopHeaderConfigurationDefaults( null, namedResourcesDefault, namedResourcesAddedFragmentsDefault, headerDynamicConfigurationDefault );
+            }
+        }
+    }
+    
     protected void registerAndOrderNamedHeaderResource( String headerName, String headerType, String headerReqFlag, Map headerDynamicConfigurationDefault )
     {
         orderNamedHeaderResource( headerName, headerDynamicConfigurationDefault );
@@ -444,15 +466,21 @@
         if ( headerFragmentName != null && ! namedResourcesAddedFragmentsDefault.containsKey( headerFragmentName ) )
         {
             namedResourcesAddedFragmentsDefault.put( headerFragmentName, Boolean.TRUE );
-            String registryContentVal = (String)this.headerResourceRegistry.get( headerFragmentName );
-            registryContent[0] = registryContentVal;
-            if ( registryContentVal != null )
+            if ( registryContent != null )
             {
-                this.headerResourceRegistry.remove( headerFragmentName );
+                String registryContentVal = (String)this.headerResourceRegistry.get( headerFragmentName );
+                registryContent[0] = registryContentVal;
+                if ( registryContentVal != null )
+                {
+                    this.headerResourceRegistry.remove( headerFragmentName );
+                }
             }
             return true;
         }
-        registryContent[0] = null;
+        if ( registryContent != null )
+        {
+            registryContent[0] = null;
+        }
         return false;
     }
     
@@ -481,251 +509,433 @@
         }
         return statementOut.toString();
     }
+    protected String makeJSONStringArray( List stringList )
+    {
+        return makeJSONStringArray( stringList, null );
+    }
+    protected String makeJSONStringArray( List stringList, List compiledUniqueValues )
+    {
+        if ( stringList != null && stringList.size() > 0 )
+        {
+            StringBuffer stringListContent = new StringBuffer();
+            Iterator stringListIter = stringList.iterator();
+            while ( stringListIter.hasNext() )
+            {
+                String value = (String)stringListIter.next();
+                if ( value != null && value.length() > 0 )
+                {
+                    if ( stringListContent.length() > 0 )
+                    {
+                        stringListContent.append( ", " );
+                    }
+                    else
+                    {
+                        stringListContent.append( "[ " );
+                    }
+                    stringListContent.append( "\"" ).append( value ).append( "\"" );
+                    if ( compiledUniqueValues != null )
+                    {
+                        if ( ! compiledUniqueValues.contains( value ) )
+                        {
+                            compiledUniqueValues.add( value );
+                        }
+                    }
+                }
+            }
+            if ( stringListContent.length() > 0 )
+            {
+                stringListContent.append( " ]" );
+                return stringListContent.toString();
+            }
+        }
+        return null;
+    }
+    protected String makeJSONInteger( Object source, boolean quote )
+    {
+        String sourceStr = ( ( source == null ) ? (String)null : source.toString() );
+        if ( sourceStr != null )
+        {
+            try
+            {
+                Integer.parseInt( sourceStr );
+                if ( quote )
+                {
+                    sourceStr = "\"" + sourceStr + "\"";
+                }
+            }
+            catch ( NumberFormatException nex )
+            {
+                sourceStr = null;
+            }
+        }
+        return sourceStr;
+    }
     
+    protected String makeJSONBoolean( Object source )
+    {
+        String boolStr = ( ( source == null ) ? (String)null : source.toString() );
+        if ( boolStr != null && ( ! boolStr.equals( "false" ) ) && ( ! boolStr.equals( "true" ) ) )
+        {
+            boolStr = null;
+        }
+        return boolStr;
+    }
+    
+    protected void initializeDesktopHeaderConfigurationDefaults( Map desktopConfigMap, HashMap namedResourcesDefault, HashMap namedResourcesAddedFragmentsDefault, HashMap headerDynamicConfigurationDefault )
+    {
+        if ( desktopConfigMap == null )
+        {
+            desktopConfigMap = new HashMap();
+        }
+        
+        StringBuffer desktopDojoConfigContent = new StringBuffer();
+        
+        String desktopWindowTilingName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_TILING;
+        String desktopWindowTiling = makeJSONBoolean( desktopConfigMap.get( desktopWindowTilingName ) );
+        if ( desktopWindowTiling != null && canAddHeaderNamedResourceFragment( desktopWindowTilingName, namedResourcesAddedFragmentsDefault, null ) )
+        {
+            desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME ).append( ".windowTiling = " ).append( desktopWindowTiling ).append( ";" ).append( EOL );
+        }
+        
+        String desktopWindowHeightExpandName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_HEIGHT_EXPAND;
+        String desktopWindowHeightExpand = makeJSONBoolean( desktopConfigMap.get( desktopWindowHeightExpandName ) );
+        if ( desktopWindowHeightExpand != null && canAddHeaderNamedResourceFragment( desktopWindowHeightExpandName, namedResourcesAddedFragmentsDefault, null ) )
+        {
+            desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME ).append( ".windowHeightExpand = " ).append( desktopWindowHeightExpand ).append( ";" ).append( EOL );
+        }
+
+        String desktopWindowHeightName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_HEIGHT;
+        String desktopWindowHeight = makeJSONInteger( desktopConfigMap.get( desktopWindowHeightName ), true );
+        if ( desktopWindowHeight != null && canAddHeaderNamedResourceFragment( desktopWindowHeightName, namedResourcesAddedFragmentsDefault, null ) )
+        {
+            desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME ).append( ".windowHeight = " ).append( desktopWindowHeight ).append( ";" ).append( EOL );
+        }
+        
+        String desktopWindowWidthName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_WIDTH;
+        String desktopWindowWidth = makeJSONInteger( desktopConfigMap.get( desktopWindowWidthName ), true );
+        if ( desktopWindowWidth != null && canAddHeaderNamedResourceFragment( desktopWindowWidthName, namedResourcesAddedFragmentsDefault, null ) )
+        {
+            desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME ).append( ".windowWidth = " ).append( desktopWindowWidth ).append( ";" ).append( EOL );
+        }
+        
+        List actionList = new ArrayList();
+        
+        String windowActionButtonOrderName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_ACTION_BUTTON_ORDER;
+        String actionButtonOrderContent = makeJSONStringArray( (List)desktopConfigMap.get( windowActionButtonOrderName ), actionList );
+        if ( actionButtonOrderContent.length() > 0 )
+        {
+            if ( canAddHeaderNamedResourceFragment( windowActionButtonOrderName, namedResourcesAddedFragmentsDefault, null ) )
+            {
+                desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME ).append( ".windowActionButtonOrder = " ).append( actionButtonOrderContent ).append( ";" ).append( EOL );
+            }
+        }
+        
+        String windowActionNoImageName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_ACTION_NOIMAGE;
+        String actionNoImageContent = makeJSONStringArray( (List)desktopConfigMap.get( windowActionNoImageName ), actionList );
+        if ( actionNoImageContent.length() > 0 )
+        {
+            if ( canAddHeaderNamedResourceFragment( windowActionNoImageName, namedResourcesAddedFragmentsDefault, null ) )
+            {
+                desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME ).append( ".windowActionNoImage = " ).append( actionNoImageContent ).append( ";" ).append( EOL );
+            }
+        }
+        
+        String windowActionMenuOrderName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_ACTION_MENU_ORDER;
+        String actionMenuOrderContent = makeJSONStringArray( (List)desktopConfigMap.get( windowActionMenuOrderName ), actionList );
+        if ( actionMenuOrderContent.length() > 0 )
+        {
+            if ( canAddHeaderNamedResourceFragment( windowActionMenuOrderName, namedResourcesAddedFragmentsDefault, null ) )
+            {
+                desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME ).append( ".windowActionMenuOrder = " ).append( actionMenuOrderContent ).append( ";" ).append( EOL );
+            }
+        }
+
+        headerDynamicConfigurationDefault.put( HeaderResource.HEADER_INTERNAL_CONFIG_DESKTOP_WINDOW_ACTION, actionList );
+
+
+        String windowActionButtonHideName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_ACTION_BUTTON_HIDE;
+        String windowActionButtonHide = makeJSONBoolean( desktopConfigMap.get( windowActionButtonHideName ) );
+        if ( windowActionButtonHide != null && canAddHeaderNamedResourceFragment( windowActionButtonHideName, namedResourcesAddedFragmentsDefault, null ) )
+        {
+            desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME ).append( ".windowActionButtonHide = " ).append( windowActionButtonHide ).append( ";" ).append( EOL );
+        }
+
+        // windowActionButtonMax - desktop.window.action.button.maximum
+        String windowActionButtonMaxName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_ACTION_BUTTON_MAX;
+        String windowActionButtonMax = makeJSONInteger( desktopConfigMap.get( windowActionButtonMaxName ), false );
+        if ( windowActionButtonMax != null && canAddHeaderNamedResourceFragment( windowActionButtonMaxName, namedResourcesAddedFragmentsDefault, null ) )
+        {
+            desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME ).append( ".windowActionButtonMax = " ).append( windowActionButtonMax ).append( ";" ).append( EOL );
+        }
+
+        if ( desktopDojoConfigContent.length() > 0 )
+        {
+            namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_CONFIG, desktopDojoConfigContent.toString() );
+        }
+        
+        StringBuffer desktopInitScript = new StringBuffer();
+        desktopInitScript.append( "    function doRender(bindArgs,portletEntityId) { " );
+        desktopInitScript.append( "jetspeed.doRender(bindArgs,portletEntityId); }" ).append( EOL );
+        desktopInitScript.append( "    function doAction(bindArgs,portletEntityId) { " );
+        desktopInitScript.append( "jetspeed.doAction(bindArgs,portletEntityId); }" ).append( EOL );
+        desktopInitScript.append( "    dojo.addOnLoad( jetspeed.initializeDesktop );" ).append( EOL );
+        if ( canAddHeaderNamedResourceFragment( "desktop.init", namedResourcesAddedFragmentsDefault, null ) )
+        {
+            namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DESKTOP_INIT, desktopInitScript.toString() );
+            setNamedHeaderResourceProperties( HeaderResource.HEADER_SECTION_DESKTOP_INIT, HeaderResource.HEADER_TYPE_SCRIPT_BLOCK_START, null, headerDynamicConfigurationDefault );
+        }
+    }
     
     /**
      * Read dojo header configuration settings and compile dojo header resource defaults
      */
     protected void initializeDojoHeaderConfigurationDefaults( Map dojoConfigMap, HashMap namedResourcesDefault, HashMap namedResourcesAddedFragmentsDefault, HashMap headerDynamicConfigurationDefault )
     {
-        if ( dojoConfigMap != null && dojoConfigMap.size() > 0 )
+        if ( dojoConfigMap == null )
         {
-            String[] registryContent = new String[] { null };
-            
-            // add dojo.enable and dojo.path to dynamic configuration
-            String dojoEnableName = "dojo.enable";
-            Object dojoEnableObj = dojoConfigMap.get( dojoEnableName );
-            String dojoEnable = ( ( dojoEnableObj == null ) ? (String)null : dojoEnableObj.toString() );
-            if ( dojoEnable == null || ! dojoEnable.equals( "true" ) )
+            dojoConfigMap = new HashMap();
+        }
+        String[] registryContent = new String[] { null };
+        
+        // add dojo.enable and dojo.path to dynamic configuration
+        String dojoEnableName = HeaderResource.HEADER_CONFIG_DOJO_ENABLE;
+        Object dojoEnableObj = dojoConfigMap.get( dojoEnableName );
+        String dojoEnable = ( ( dojoEnableObj == null ) ? (String)null : dojoEnableObj.toString() );
+        if ( dojoEnable == null || ! dojoEnable.equals( "true" ) )
+        {
+            dojoEnable = "false";
+        }
+        headerDynamicConfigurationDefault.put( dojoEnableName, dojoEnable );
+        String dojoPath = (String)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_PATH );
+        if ( dojoPath == null || dojoPath.length() == 0 )
+        {
+            dojoPath = "/javascript/dojo/";
+        }
+        headerDynamicConfigurationDefault.put( HeaderResource.HEADER_CONFIG_DOJO_PATH, dojoPath );
+        
+        // dojo parameters - djConfig parameters
+        String dojoParamDebug = (String)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_PARAM_ISDEBUG );
+        String dojoParamDebugAtAllCosts = (String)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_PARAM_DEBUGALLCOSTS );
+        String dojoParams = (String)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_PARAMS );
+        if ( dojoParamDebug != null || dojoParamDebugAtAllCosts != null || dojoParams != null )
+        {
+            StringBuffer dojoConfigContent = new StringBuffer();
+            boolean addedMembers = false;
+            if ( dojoParams != null && dojoParams.length() > 0 )
             {
-                dojoEnable = "false";
+                dojoConfigContent.append( dojoParams );
+                addedMembers = true;
             }
-            headerDynamicConfigurationDefault.put( dojoEnableName, dojoEnable );
-            String dojoPath = (String)dojoConfigMap.get( "dojo.path" );
-            if ( dojoPath == null || dojoPath.length() == 0 )
+            if ( dojoParamDebug != null && dojoParamDebug.length() > 0 )
             {
-                dojoPath = "/javascript/dojo/";
-            }
-            headerDynamicConfigurationDefault.put( "dojo.path", dojoPath );
-            
-            // dojo parameters - djConfig parameters
-            String dojoParamDebug = (String)dojoConfigMap.get( "dojo.parameter.isDebug" );
-            String dojoParamDebugAtAllCosts = (String)dojoConfigMap.get( "dojo.parameter.debugAtAllCosts" );
-            String dojoParams = (String)dojoConfigMap.get( "dojo.parameters" );
-            if ( dojoParamDebug != null || dojoParamDebugAtAllCosts != null || dojoParams != null )
-            {
-                StringBuffer dojoConfigContent = new StringBuffer();
-                boolean addedMembers = false;
-                if ( dojoParams != null && dojoParams.length() > 0 )
+                if ( addedMembers )
                 {
-                    dojoConfigContent.append( dojoParams );
-                    addedMembers = true;
+                    dojoConfigContent.append( ", " );
                 }
-                if ( dojoParamDebug != null && dojoParamDebug.length() > 0 )
+                dojoConfigContent.append( "isDebug: " ).append( dojoParamDebug ) ;
+                addedMembers = true;
+            }
+            if ( dojoParamDebugAtAllCosts != null && dojoParamDebugAtAllCosts.length() > 0 )
+            {
+                if ( addedMembers )
                 {
-                    if ( addedMembers )
-                    {
-                        dojoConfigContent.append( ", " );
-                    }
-                    dojoConfigContent.append( "isDebug: " ).append( dojoParamDebug ) ;
-                    addedMembers = true;
+                    dojoConfigContent.append( ", " );
                 }
-                if ( dojoParamDebugAtAllCosts != null && dojoParamDebugAtAllCosts.length() > 0 )
+                dojoConfigContent.append( "debugAtAllCosts: " ).append( dojoParamDebugAtAllCosts ) ;
+                addedMembers = true;
+            }
+            if ( addedMembers )
+            {
+                dojoConfigContent.append( ", " );
+            }
+            dojoConfigContent.append( HeaderResource.HEADER_INTERNAL_JETSPEED_VAR_NAME ).append( ": {}" ) ;
+            addedMembers = true;
+            
+            if ( canAddHeaderNamedResourceFragment( HeaderResource.HEADER_CONFIG_DOJO_PARAMS, namedResourcesAddedFragmentsDefault, registryContent ) )
+            {
+                String dojoParamContent = dojoConfigContent.toString();
+                if ( registryContent[0] != null )
                 {
-                    if ( addedMembers )
-                    {
-                        dojoConfigContent.append( ", " );
-                    }
-                    dojoConfigContent.append( "debugAtAllCosts: " ).append( dojoParamDebugAtAllCosts ) ;
-                    addedMembers = true;
+                    dojoParamContent = registryContent[0];
                 }
-                if ( canAddHeaderNamedResourceFragment( "dojo.parameters", namedResourcesAddedFragmentsDefault, registryContent ) )
+                if ( dojoParamContent.length() > 0 )
                 {
-                    String dojoParamContent = dojoConfigContent.toString();
-                    if ( registryContent[0] != null )
-                    {
-                        dojoParamContent = registryContent[0];
-                    }
-                    if ( dojoParamContent.length() > 0 )
-                    {
-                        namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_PARAMETERS, ( "    var djConfig = {" + dojoParamContent + "};" + EOL ) );
-                    }
+                    namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_PARAMETERS, ( "    var djConfig = {" + dojoParamContent + "};" + EOL ) );
                 }
-                registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_PARAMETERS, HeaderResource.HEADER_TYPE_SCRIPT_BLOCK_START, dojoEnableName, headerDynamicConfigurationDefault );
             }
-            
-            // dojo preinit - for automatically added members to djConfig (eg. djConfig.baseScriptUri="...")
-            //    - adding to order only at this point
-            //    - if header contains content, generated content will not be added
-            registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_PREINIT, null, dojoEnableName, headerDynamicConfigurationDefault );
-            
-            // dojo config - for adding members to djConfig (eg. djConfig.parseWidgets=false)
-            //    - adding to order only at this point
-            registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_CONFIG, null, dojoEnableName, headerDynamicConfigurationDefault );
-            
-            // dojo init - script tag for dojo.js
-            //    - adding to order only at this point
-            //    - if header contains content, generated content will not be added
-            registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_INIT, HeaderResource.HEADER_TYPE_SCRIPT_TAG, dojoEnableName, headerDynamicConfigurationDefault );
-            
-            // dojo requires - core libraries
-            List dojoRequiresCore = (List)dojoConfigMap.get( "dojo.requires.core" );
-            if ( dojoRequiresCore != null && dojoRequiresCore.size() > 0 )
-            {
-                StringBuffer dojoRequiresContent = new StringBuffer();
-                Iterator dojoRequiresCoreIter = dojoRequiresCore.iterator();
-                while ( dojoRequiresCoreIter.hasNext() )
+            registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_PARAMETERS, HeaderResource.HEADER_TYPE_SCRIPT_BLOCK_START, dojoEnableName, headerDynamicConfigurationDefault );
+        }
+        
+        // dojo preinit - for automatically added members to djConfig (eg. djConfig.baseScriptUri="...")
+        //    - adding to order only at this point
+        //    - if header contains content, generated content will not be added
+        registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_PREINIT, null, dojoEnableName, headerDynamicConfigurationDefault );
+        
+        // dojo config - for adding members to djConfig (eg. djConfig.parseWidgets=false)
+        //    - adding to order only at this point
+        registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_CONFIG, null, dojoEnableName, headerDynamicConfigurationDefault );
+        
+        // dojo init - script tag for dojo.js
+        //    - adding to order only at this point
+        //    - if header contains content, generated content will not be added
+        registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_INIT, HeaderResource.HEADER_TYPE_SCRIPT_TAG, dojoEnableName, headerDynamicConfigurationDefault );
+        
+        // dojo requires - core libraries
+        List dojoRequiresCore = (List)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_REQUIRES_CORE );
+        if ( dojoRequiresCore != null && dojoRequiresCore.size() > 0 )
+        {
+            StringBuffer dojoRequiresContent = new StringBuffer();
+            Iterator dojoRequiresCoreIter = dojoRequiresCore.iterator();
+            while ( dojoRequiresCoreIter.hasNext() )
+            {
+                String dojoReq = (String)dojoRequiresCoreIter.next();
+                if ( dojoReq != null && dojoReq.length() > 0 )
                 {
-                    String dojoReq = (String)dojoRequiresCoreIter.next();
-                    if ( dojoReq != null && dojoReq.length() > 0 )
+                    if ( canAddHeaderNamedResourceFragment( dojoReq, namedResourcesAddedFragmentsDefault, registryContent ) )
                     {
-                        if ( canAddHeaderNamedResourceFragment( dojoReq, namedResourcesAddedFragmentsDefault, registryContent ) )
+                        if ( registryContent[0] != null )
                         {
-                            if ( registryContent[0] != null )
+                            String dojoReqFromRegistry = makeJavascriptStatement( registryContent[0], "    ", true );
+                            if ( dojoReqFromRegistry.length() > 0 )
                             {
-                                String dojoReqFromRegistry = makeJavascriptStatement( registryContent[0], "    ", true );
-                                if ( dojoReqFromRegistry.length() > 0 )
-                                {
-                                    dojoRequiresContent.append( registryContent[0] );
-                                }
-                            }
-                            else
-                            {
-                                dojoRequiresContent.append( "    dojo.require(\"").append( dojoReq ).append( "\");" ).append( EOL );
+                                dojoRequiresContent.append( registryContent[0] );
                             }
                         }
+                        else
+                        {
+                            dojoRequiresContent.append( "    dojo.require(\"").append( dojoReq ).append( "\");" ).append( EOL );
+                        }
                     }
                 }
-                namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_REQUIRES_CORE, dojoRequiresContent.toString() );
-                registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_REQUIRES_CORE, null, dojoEnableName, headerDynamicConfigurationDefault );
             }
-            
-            // dojo module definition
-            List dojoModules = (List)dojoConfigMap.get( "dojo.modules" );
-            if ( dojoModules != null && dojoModules.size() > 0 )
-            {
-                StringBuffer dojoModulesContent = new StringBuffer();
-                boolean addedContent = false;
-                Iterator dojoModulesIter = dojoModules.iterator();
-                while ( dojoModulesIter.hasNext() )
+            namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_REQUIRES_CORE, dojoRequiresContent.toString() );
+            registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_REQUIRES_CORE, null, dojoEnableName, headerDynamicConfigurationDefault );
+        }
+        
+        // dojo modules path definition
+        List dojoModulesPath = (List)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_MODULES_PATH );
+        if ( dojoModulesPath != null && dojoModulesPath.size() > 0 )
+        {
+            StringBuffer dojoModulesPathContent = new StringBuffer();
+            boolean addedContent = false;
+            Iterator dojoModulesPathIter = dojoModulesPath.iterator();
+            while ( dojoModulesPathIter.hasNext() )
+            {
+                String dojoModule = (String)dojoModulesPathIter.next();
+                if ( dojoModule != null && dojoModule.length() > 0 )
                 {
-                    String dojoModule = (String)dojoModulesIter.next();
-                    if ( dojoModule != null && dojoModule.length() > 0 )
+                    if ( canAddHeaderNamedResourceFragment( dojoModule, namedResourcesAddedFragmentsDefault, registryContent ) )
                     {
-                        if ( canAddHeaderNamedResourceFragment( dojoModule, namedResourcesAddedFragmentsDefault, registryContent ) )
+                        String dojoModuleContent = null;
+                        if ( registryContent[0] != null )
                         {
-                            String dojoModuleContent = null;
-                            if ( registryContent[0] != null )
-                            {
-                                dojoModuleContent = registryContent[0];
-                            }
-                            else
-                            {
-                                dojoModuleContent = dojoModule;
-                            }
-                            dojoModuleContent = makeJavascriptStatement( dojoModuleContent, "    ", true );
-                            if ( dojoModuleContent.length() > 0 )
-                            {
-                                dojoModulesContent.append( dojoModuleContent );
-                                addedContent = true;
-                            }
+                            dojoModuleContent = registryContent[0];
+                        }
+                        else
+                        {
+                            dojoModuleContent = dojoModule;
+                        }
+                        dojoModuleContent = makeJavascriptStatement( dojoModuleContent, "    ", true );
+                        if ( dojoModuleContent.length() > 0 )
+                        {
+                            dojoModulesPathContent.append( dojoModuleContent );
+                            addedContent = true;
                         }
                     }
                 }
-                if ( addedContent )
-                {
-                    namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_MODULES_PATH, dojoModulesContent.toString() );
-                    registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_MODULES_PATH, null, dojoEnableName, headerDynamicConfigurationDefault );
-                }
             }
-            
-            // dojo widget module definition
-            List dojoModulesWidget = (List)dojoConfigMap.get( "dojo.modules.widget" );
-            if ( dojoModulesWidget != null && dojoModulesWidget.size() > 0 )
-            {
-                StringBuffer dojoModulesWidgetContent = new StringBuffer();
-                boolean addedContent = false;
-                Iterator dojoModulesWidgetIter = dojoModulesWidget.iterator();
-                while ( dojoModulesWidgetIter.hasNext() )
+            if ( addedContent )
+            {
+                namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_MODULES_PATH, dojoModulesPathContent.toString() );
+                registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_MODULES_PATH, null, dojoEnableName, headerDynamicConfigurationDefault );
+            }
+        }
+        
+        // dojo modules namespace definition
+        List dojoModulesNamespace = (List)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_MODULES_NAMESPACE );
+        if ( dojoModulesNamespace != null && dojoModulesNamespace.size() > 0 )
+        {
+            StringBuffer dojoModulesNamespaceContent = new StringBuffer();
+            boolean addedContent = false;
+            Iterator dojoModulesNamespaceIter = dojoModulesNamespace.iterator();
+            while ( dojoModulesNamespaceIter.hasNext() )
+            {
+                String dojoModuleWidget = (String)dojoModulesNamespaceIter.next();
+                if ( dojoModuleWidget != null && dojoModuleWidget.length() > 0 )
                 {
-                    String dojoModuleWidget = (String)dojoModulesWidgetIter.next();
-                    if ( dojoModuleWidget != null && dojoModuleWidget.length() > 0 )
+                    if ( canAddHeaderNamedResourceFragment( dojoModuleWidget, namedResourcesAddedFragmentsDefault, registryContent ) )
                     {
-                        if ( canAddHeaderNamedResourceFragment( dojoModuleWidget, namedResourcesAddedFragmentsDefault, registryContent ) )
+                        String dojoModuleContent = null;
+                        if ( registryContent[0] != null )
                         {
-                            String dojoModuleContent = null;
-                            if ( registryContent[0] != null )
-                            {
-                                dojoModuleContent = registryContent[0];
-                            }
-                            else
-                            {
-                                dojoModuleContent = dojoModuleWidget;
-                            }
-                            dojoModuleContent = makeJavascriptStatement( dojoModuleContent, "    ", true );
-                            if ( dojoModuleContent.length() > 0 )
-                            {
-                                dojoModulesWidgetContent.append( dojoModuleContent );
-                                addedContent = true;
-                            }
+                            dojoModuleContent = registryContent[0];
+                        }
+                        else
+                        {
+                            dojoModuleContent = dojoModuleWidget;
+                        }
+                        dojoModuleContent = makeJavascriptStatement( dojoModuleContent, "    ", true );
+                        if ( dojoModuleContent.length() > 0 )
+                        {
+                            dojoModulesNamespaceContent.append( dojoModuleContent );
+                            addedContent = true;
                         }
                     }
                 }
-                if ( addedContent )
-                {
-                    namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_MODULES_NAMESPACE, dojoModulesWidgetContent.toString() );
-                    // registerAndOrderNamedHeaderResource called below
-                }
             }
-            
-            // dojo requires - module libraries (from add-on modules)
-            List dojoRequiresModules = (List)dojoConfigMap.get( "dojo.requires.modules" );
-            if ( dojoRequiresModules != null && dojoRequiresModules.size() > 0 )
-            {
-                StringBuffer dojoRequiresContent = new StringBuffer();
-                Iterator dojoRequiresModulesIter = dojoRequiresModules.iterator();
-                while ( dojoRequiresModulesIter.hasNext() )
+            if ( addedContent )
+            {
+                namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_MODULES_NAMESPACE, dojoModulesNamespaceContent.toString() );
+                // registerAndOrderNamedHeaderResource called below
+            }
+        }
+        
+        // dojo requires - module libraries (from add-on modules)
+        List dojoRequiresModules = (List)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_REQUIRES_MODULES );
+        if ( dojoRequiresModules != null && dojoRequiresModules.size() > 0 )
+        {
+            StringBuffer dojoRequiresContent = new StringBuffer();
+            Iterator dojoRequiresModulesIter = dojoRequiresModules.iterator();
+            while ( dojoRequiresModulesIter.hasNext() )
+            {
+                String dojoReq = (String)dojoRequiresModulesIter.next();
+                if ( dojoReq != null && dojoReq.length() > 0 )
                 {
-                    String dojoReq = (String)dojoRequiresModulesIter.next();
-                    if ( dojoReq != null && dojoReq.length() > 0 )
+                    if ( canAddHeaderNamedResourceFragment( dojoReq, namedResourcesAddedFragmentsDefault, registryContent ) )
                     {
-                        if ( canAddHeaderNamedResourceFragment( dojoReq, namedResourcesAddedFragmentsDefault, registryContent ) )
+                        if ( registryContent[0] != null )
                         {
-                            if ( registryContent[0] != null )
-                            {
-                                String dojoReqFromRegistry = makeJavascriptStatement( registryContent[0], "    ", true );
-                                if ( dojoReqFromRegistry.length() > 0 )
-                                {
-                                    dojoRequiresContent.append( registryContent[0] );
-                                }
-                            }
-                            else
+                            String dojoReqFromRegistry = makeJavascriptStatement( registryContent[0], "    ", true );
+                            if ( dojoReqFromRegistry.length() > 0 )
                             {
-                                dojoRequiresContent.append( "    dojo.require(\"").append( dojoReq ).append( "\");" ).append( EOL );
+                                dojoRequiresContent.append( registryContent[0] );
                             }
                         }
+                        else
+                        {
+                            dojoRequiresContent.append( "    dojo.require(\"").append( dojoReq ).append( "\");" ).append( EOL );
+                        }
                     }
                 }
-                namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_REQUIRES_MODULES, dojoRequiresContent.toString() );
-                registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_REQUIRES_MODULES, null, dojoEnableName, headerDynamicConfigurationDefault );
             }
-            
-            // dojo writeincludes - for automatically added members to djConfig (eg. djConfig.baseScriptUri="...")
-            //    - adding to order only at this point
-            //    - if header contains content, generated content will not be added
-            registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_WRITEINCLUDES, HeaderResource.HEADER_TYPE_SCRIPT_BLOCK_START, dojoEnableName, headerDynamicConfigurationDefault );
-            
-            // dojo widget module - register widget packages (eg. dojo.widget.manager.registerWidgetPackage('jetspeed.ui.widget'))
-            //    - default resource added above
-            registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_MODULES_NAMESPACE, HeaderResource.HEADER_TYPE_SCRIPT_BLOCK_START, dojoEnableName, headerDynamicConfigurationDefault );
-            
-            // dojo style bodyexpand
-            setNamedHeaderResourceProperties( HeaderResource.HEADER_SECTION_DOJO_STYLE_BODYEXPAND, HeaderResource.HEADER_TYPE_STYLE_BLOCK, dojoEnableName, headerDynamicConfigurationDefault );
-            
-            // dojo style bodyexpand noscroll
-            setNamedHeaderResourceProperties( HeaderResource.HEADER_SECTION_DOJO_STYLE_BODYEXPAND_NOSCROLL, HeaderResource.HEADER_TYPE_STYLE_BLOCK, dojoEnableName, headerDynamicConfigurationDefault );
-            
-        }   // if ( dojoConfigMap != null && dojoConfigMap.size() > 0 )
+            namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_REQUIRES_MODULES, dojoRequiresContent.toString() );
+            registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_REQUIRES_MODULES, null, dojoEnableName, headerDynamicConfigurationDefault );
+        }
+        
+        // dojo writeincludes
+        //    - adding to order only at this point
+        //    - if header contains content, generated content will not be added
+        registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_WRITEINCLUDES, HeaderResource.HEADER_TYPE_SCRIPT_BLOCK_START, dojoEnableName, headerDynamicConfigurationDefault );
+        
+        // dojo widget module - register widget packages (eg. dojo.widget.manager.registerWidgetPackage('jetspeed.ui.widget'))
+        //    - default resource added above
+        registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_MODULES_NAMESPACE, HeaderResource.HEADER_TYPE_SCRIPT_BLOCK_START, dojoEnableName, headerDynamicConfigurationDefault );
+        
+        // dojo style bodyexpand
+        setNamedHeaderResourceProperties( HeaderResource.HEADER_SECTION_DOJO_STYLE_BODYEXPAND, HeaderResource.HEADER_TYPE_STYLE_BLOCK, dojoEnableName, headerDynamicConfigurationDefault );
+        
+        // dojo style bodyexpand noscroll
+        setNamedHeaderResourceProperties( HeaderResource.HEADER_SECTION_DOJO_STYLE_BODYEXPAND_NOSCROLL, HeaderResource.HEADER_TYPE_STYLE_BLOCK, dojoEnableName, headerDynamicConfigurationDefault );
     }
 
     

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopContextImpl.java?view=diff&rev=472285&r1=472284&r2=472285
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopContextImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopContextImpl.java Tue Nov  7 13:32:41 2006
@@ -36,7 +36,7 @@
  * Jetspeed Desktop 
  *
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
+ * @version $Id: JetspeedDesktopContextImpl.java $
  */
 public class JetspeedDesktopContextImpl implements JetspeedDesktopContext
 {

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopImpl.java?view=diff&rev=472285&r1=472284&r2=472285
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/desktop/impl/JetspeedDesktopImpl.java Tue Nov  7 13:32:41 2006
@@ -18,8 +18,12 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
+import java.util.List;
 import java.util.Properties;
+import java.util.ResourceBundle;
+
 
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletContext;
@@ -40,7 +44,7 @@
  * Desktop Valve
  *
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
+ * @version $Id: JetspeedDesktopImpl.java $
  */
 public class JetspeedDesktopImpl implements JetspeedDesktop, ServletContextAware
 {    
@@ -50,9 +54,13 @@
     
     private static final String RESOURCE_FILE_ATTR =  "resource.file";
 
-    private final static String EOL = "\r\n";   // html eol    
-    private final static String INIT_FUNCTION_NAME = "jetspeed.initializeDesktop";
-    private final static String DOJO_CONFIG_THEME_ROOT_URL_VAR_NAME = "djConfig.desktopThemeRootUrl";
+    private final static String EOL = "\r\n";   // html eol
+    private final static String DOJO_CONFIG_THEME_ROOT_URL_VAR_NAME = HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME + ".desktopThemeRootUrl";
+    private final static String DOJO_CONFIG_THEME_VAR_NAME = HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME + ".desktopTheme";
+    private final static String DOJO_CONFIG_ACTION_LABELS_NAME = HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME + ".desktopActionLabels";
+
+    private final static String[] DESKTOP_WINDOW_ACTIONS = new String[] { "tile", "untile", "heightexpand", "heightnormal", "restore", "remove" };
+    private final static String DESKTOP_WINDOW_ACTION_RESOURCE_NAME_PREFIX = "desktop.window.action.";
     
     private static final Log log = LogFactory.getLog( JetspeedDesktopImpl.class );
 
@@ -106,6 +114,8 @@
             
             HeaderResource hr = getHeaderResourceFactory().getHeaderResouce( request );
             
+            hr.dojoEnable();
+            
             JetspeedDesktopContext desktopContext = new JetspeedDesktopContextImpl(
                     request, this.baseUrlAccess, theme, getThemeRootPath( theme ), getResourceName( theme ), hr );
             request.getRequest().setAttribute( JetspeedDesktopContext.DESKTOP_ATTRIBUTE, desktopContext );
@@ -113,32 +123,43 @@
             request.getRequest().setAttribute( "JS2ComponentManager", Jetspeed.getComponentManager() );
             
             StringBuffer dojoConfigAddOn = new StringBuffer();
-            dojoConfigAddOn.append( "    " ).append( DOJO_CONFIG_THEME_ROOT_URL_VAR_NAME ).append( " = \"" ).append( desktopContext.getDesktopThemeRootUrl() ).append( "\";" );
-            hr.addHeaderSectionFragment( DOJO_CONFIG_THEME_ROOT_URL_VAR_NAME, HeaderResource.HEADER_SECTION_DOJO_CONFIG, dojoConfigAddOn.toString() );
+            dojoConfigAddOn.append( "    " ).append( DOJO_CONFIG_THEME_ROOT_URL_VAR_NAME ).append( " = \"" ).append( desktopContext.getDesktopThemeRootUrl() ).append( "\";" ).append( EOL );
+            dojoConfigAddOn.append( "    " ).append( DOJO_CONFIG_THEME_VAR_NAME ).append( " = \"" ).append( desktopContext.getDesktopTheme() ).append( "\";" );
+            hr.addHeaderSectionFragment( DOJO_CONFIG_THEME_VAR_NAME, HeaderResource.HEADER_SECTION_DOJO_CONFIG, dojoConfigAddOn.toString() );
             
             if ( hr.isHeaderSectionIncluded( HeaderResource.HEADER_SECTION_DESKTOP_STYLE_DESKTOPTHEME ) )
             {
                 hr.setHeaderSectionType( HeaderResource.HEADER_SECTION_DESKTOP_STYLE_DESKTOPTHEME, HeaderResource.HEADER_TYPE_LINK_TAG );
                 StringBuffer desktopThemeStyleLink = new StringBuffer();
-                desktopThemeStyleLink.append( "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection\" href=\"" ).append( desktopContext.getDesktopThemeRootUrl() ).append( "/css/styles.css\"/>" );
+                desktopThemeStyleLink.append( "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection\" href=\"" );
+                desktopThemeStyleLink.append( desktopContext.getDesktopThemeRootUrl() ).append( "/css/styles.css\"/>" );
                 hr.addHeaderSectionFragment( "desktop.style.desktoptheme", HeaderResource.HEADER_SECTION_DESKTOP_STYLE_DESKTOPTHEME, desktopThemeStyleLink.toString() );
             }
-            if ( hr.isHeaderSectionIncluded( HeaderResource.HEADER_SECTION_DESKTOP_INIT ) )
+            
+            // desktop action labels
+            StringBuffer desktopActionLabels = new StringBuffer();
+            ResourceBundle messages = desktopContext.getResourceBundle( request.getLocale() );
+            for ( int i = 0 ; i < DESKTOP_WINDOW_ACTIONS.length ; i++ )
+            {
+                String actionLabel = messages.getString( DESKTOP_WINDOW_ACTION_RESOURCE_NAME_PREFIX + DESKTOP_WINDOW_ACTIONS[ i ] );
+                if ( actionLabel != null )
+                {
+                    if ( desktopActionLabels.length() == 0 )
+                    {
+                        desktopActionLabels.append( "{ " );
+                    }
+                    else
+                    {
+                        desktopActionLabels.append( ", " );
+                    }
+                    desktopActionLabels.append( DESKTOP_WINDOW_ACTIONS[ i ] ).append( ": \"" ).append( actionLabel ).append( "\"" );
+                }
+            }
+            if ( desktopActionLabels.length() > 0 )
             {
-                hr.setHeaderSectionType( HeaderResource.HEADER_SECTION_DESKTOP_INIT, HeaderResource.HEADER_TYPE_SCRIPT_BLOCK_START );
-                StringBuffer desktopInitScript = new StringBuffer();
-                desktopInitScript.append( "    function jsDesktopInit() {" );
-                desktopInitScript.append( INIT_FUNCTION_NAME ).append( "(\"" );
-                desktopInitScript.append( desktopContext.getDesktopTheme() );
-                desktopInitScript.append( "\", \"");
-                desktopInitScript.append( desktopContext.getDesktopThemeRootUrl() );
-                desktopInitScript.append( "\"); }" ).append( EOL );
-                desktopInitScript.append( "    function doRender(bindArgs,portletEntityId) { " );
-                desktopInitScript.append( "jetspeed.doRender(bindArgs,portletEntityId); }" ).append( EOL );
-                desktopInitScript.append( "    function doAction(bindArgs,portletEntityId) { " );
-                desktopInitScript.append( "jetspeed.doAction(bindArgs,portletEntityId); }" ).append( EOL );
-                desktopInitScript.append( "    dojo.addOnLoad( window.jsDesktopInit );" );
-                hr.addHeaderSectionFragment( "desktop.init", HeaderResource.HEADER_SECTION_DESKTOP_INIT, desktopInitScript.toString() );
+                dojoConfigAddOn = new StringBuffer();
+                dojoConfigAddOn.append( "    " ).append( DOJO_CONFIG_ACTION_LABELS_NAME ).append( " = " ).append( desktopActionLabels.toString() ).append( " };" ).append( EOL );
+                hr.addHeaderSectionFragment( DOJO_CONFIG_ACTION_LABELS_NAME, HeaderResource.HEADER_SECTION_DOJO_CONFIG, dojoConfigAddOn.toString() );
             }
             
             dispatcher.include( request.getRequest(), request.getResponse() );

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/Constants.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/Constants.java?view=diff&rev=472285&r1=472284&r2=472285
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/Constants.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/Constants.java Tue Nov  7 13:32:41 2006
@@ -45,17 +45,20 @@
     public static final String Z = "z";
     public static final String WIDTH = "width";
     public static final String HEIGHT = "height";
+    public static final String DESKTOP_EXTENDED = "jsdesktop";
     public static final String OLD_X = "oldx";
     public static final String OLD_Y = "oldy";
     public static final String OLD_Z = "oldz";
     public static final String OLD_WIDTH = "oldwidth";
     public static final String OLD_HEIGHT = "oldheight";
+    public static final String OLD_DESKTOP_EXTENDED = "oldjsdesktop";
     
     public static final String FILTER = "filter";
     public static final String PORTLETS = "portlets";
     public static final String PAGES = "pages";
     public static final String PAGE = "page";
     public static final String FOLDER = "folder";
+    public static final String FOLDERS = "folders";
     public static final String SIZES = "sizes";
 
     public static final String STANDARD_MENUS = "standardMenus";
@@ -70,6 +73,7 @@
     public static final String LAYOUTS = "layouts";
     public static final String DESKTOP_THEMES = "desktopThemes";
     public static final String LINK = "link";
+    public static final String LINKS = "links";
     public static final String FRAGMENTS = "fragments";
     public static final String TYPE = "type";
     public static final String FORMAT = "format";

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/MovePortletAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/MovePortletAction.java?view=diff&rev=472285&r1=472284&r2=472285
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/MovePortletAction.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/MovePortletAction.java Tue Nov  7 13:32:41 2006
@@ -262,11 +262,25 @@
                     resultMap.put(REASON, "Failed to find fragment to move to another layout for portlet id: " + portletId );
                     return success;                
                 }
+                
+                String posExtended = getActionParameter(requestContext, DESKTOP_EXTENDED);
+                if ( posExtended != null )
+                {
+                    Map fragmentProperties = fragment.getProperties();
+                    if ( fragmentProperties == null )
+                    {
+                        success = false;
+                        resultMap.put(REASON, "Failed to acquire fragment properties map for portlet id: " + portletId );
+                        return success;
+                    }
+                    String oldDeskExt = (String)fragmentProperties.get( DESKTOP_EXTENDED );
+                    resultMap.put( OLD_DESKTOP_EXTENDED, ( (oldDeskExt != null) ? oldDeskExt : "" ) );
+                    fragmentProperties.put( DESKTOP_EXTENDED, posExtended );
+                }
+                
                 placement.remove(fragment);
                 Page page = placement.syncPageFragments();
                 page.removeFragmentById(fragment.getId());
-//                if (pageManager != null)
-//                    pageManager.updatePage(page);
                 
                 // add fragment
                 placement = new PortletPlacementContextImpl(requestContext, moveToLayoutFragment, 1);
@@ -303,12 +317,27 @@
                 {
                     success = false;
                     resultMap.put(REASON, "Failed to find fragment for portlet id: " + portletId );
-                    return success;                
+                    return success;
                 }
                 Coordinate returnCoordinate = null;
                 float oldX = 0f, oldY = 0f, oldZ = 0f, oldWidth = 0f, oldHeight = 0f;
                 float x = -1f, y = -1f, z = -1f, width = -1f, height = -1f;
                 
+                String posExtended = getActionParameter(requestContext, DESKTOP_EXTENDED);
+                if ( posExtended != null )
+                {
+                    Map fragmentProperties = fragment.getProperties();
+                    if ( fragmentProperties == null )
+                    {
+                        success = false;
+                        resultMap.put(REASON, "Failed to acquire fragment properties map for portlet id: " + portletId );
+                        return success;
+                    }
+                    String oldDeskExt = (String)fragmentProperties.get( DESKTOP_EXTENDED );
+                    resultMap.put( OLD_DESKTOP_EXTENDED, ( (oldDeskExt != null) ? oldDeskExt : "" ) );
+                    fragmentProperties.put( DESKTOP_EXTENDED, posExtended );
+                }
+                
                 // Only required for moveabs
                 if (iMoveType == ABS)
                 {
@@ -368,7 +397,6 @@
                         height = Float.parseFloat(sHeight); 
                         fragment.setLayoutHeight(height);
                     }
-                    
                 }
                 // synchronize back to the page layout root fragment
                 Page page = placement.syncPageFragments();

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/desktop/JetspeedDesktopContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/desktop/JetspeedDesktopContext.java?view=diff&rev=472285&r1=472284&r2=472285
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/desktop/JetspeedDesktopContext.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/desktop/JetspeedDesktopContext.java Tue Nov  7 13:32:41 2006
@@ -24,7 +24,7 @@
  * Jetspeed Desktop 
  *
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
+ * @version $Id: JetspeedDesktopContext.java $
  */
 public interface JetspeedDesktopContext
 {

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/headerresource/HeaderResource.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/headerresource/HeaderResource.java?view=diff&rev=472285&r1=472284&r2=472285
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/headerresource/HeaderResource.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/headerresource/HeaderResource.java Tue Nov  7 13:32:41 2006
@@ -21,7 +21,7 @@
  * HeaderResource has tags information to put them into &lt;head&gt; tag.
  * 
  * @author <a href="mailto:shinsuke@yahoo.co.jp">Shinsuke Sugaya</a>
- * @version $Id: PortalReservedParameters.java 188569 2005-05-13 13:35:18Z weaver $
+ * @version $Id: HeaderResource.java 188569 2005-05-13 13:35:18Z weaver $
  */
 public interface HeaderResource
 {
@@ -76,6 +76,29 @@
     public final static String HEADER_INTERNAL_JETSPEED_VAR_NAME = "jetspeed";
     public final static String HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME = "djConfig." + HEADER_INTERNAL_JETSPEED_VAR_NAME;  // internal use - not a configuration entry name
     
+    // header configuration - dojo
+    public final static String HEADER_CONFIG_DOJO_ENABLE = "dojo.enable";
+    public final static String HEADER_CONFIG_DOJO_PATH = "dojo.path";
+    public final static String HEADER_CONFIG_DOJO_PARAM_ISDEBUG = "dojo.parameter.isDebug";
+    public final static String HEADER_CONFIG_DOJO_PARAM_DEBUGALLCOSTS = "dojo.parameter.debugAtAllCosts";
+    public final static String HEADER_CONFIG_DOJO_PARAMS = "dojo.parameters";
+    public final static String HEADER_CONFIG_DOJO_REQUIRES_CORE = "dojo.requires.core";
+    public final static String HEADER_CONFIG_DOJO_MODULES_PATH = "dojo.modules.path";
+    public final static String HEADER_CONFIG_DOJO_MODULES_NAMESPACE = "dojo.modules.namespace";
+    public final static String HEADER_CONFIG_DOJO_REQUIRES_MODULES = "dojo.requires.modules";
+    
+    // header configuration - desktop
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_TILING = "desktop.window.tiling";
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_HEIGHT_EXPAND = "desktop.window.heightexpand";
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_HEIGHT = "desktop.window.height";
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_WIDTH = "desktop.window.width";
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_ACTION_BUTTON_ORDER = "desktop.window.action.button.order";
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_ACTION_NOIMAGE = "desktop.window.action.noimage";
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_ACTION_MENU_ORDER = "desktop.window.action.menu.order";
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_ACTION_BUTTON_HIDE = "desktop.window.action.button.hide";
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_ACTION_BUTTON_MAX = "desktop.window.action.button.maximum";
+    
+    public final static String HEADER_INTERNAL_CONFIG_DESKTOP_WINDOW_ACTION = "desktop.window.action";
     
     /**
      * Output all content (that has not already been output)



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