portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r578924 - /portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
Date Mon, 24 Sep 2007 19:22:02 GMT
Author: smilek
Date: Mon Sep 24 12:22:01 2007
New Revision: 578924

URL: http://svn.apache.org/viewvc?rev=578924&view=rev
Log:
changes to automatically add dojo.requires statement when debug is enabled

Modified:
    portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java?rev=578924&r1=578923&r2=578924&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
Mon Sep 24 12:22:01 2007
@@ -688,8 +688,29 @@
         headerDynamicConfigurationDefault.put( HeaderResource.HEADER_CONFIG_DOJO_PATH, dojoPath
);
         
         // dojo parameters - djConfig parameters
+        boolean dojoDebugEnabled = false;
         String dojoParamDebug = (String)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_PARAM_ISDEBUG
);
-        String dojoParamDebugAtAllCosts = (String)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_PARAM_DEBUGALLCOSTS
);
+        String dojoParamDebugAtAllCosts = null;
+        if ( dojoParamDebug != null )
+        	dojoParamDebug = dojoParamDebug.toLowerCase();
+        if ( dojoParamDebug == null || dojoParamDebug.length() == 0 || dojoParamDebug.equals(
"false" ) )
+        {
+        	dojoParamDebug = null;
+        }
+        else if ( dojoParamDebug.equals( "true" ) )
+        {
+        	dojoDebugEnabled = true;
+        	dojoParamDebugAtAllCosts = (String)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_PARAM_DEBUGALLCOSTS
);
+        	if ( dojoParamDebugAtAllCosts != null )
+        	{
+        		dojoParamDebugAtAllCosts = dojoParamDebugAtAllCosts.toLowerCase();
+        		if ( ! dojoParamDebugAtAllCosts.equals( "true") )
+        		{
+        			dojoParamDebugAtAllCosts = null;
+        		}
+        	}
+        }
+        
         String dojoParamPreventBackBtnFix = (String)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_PARAM_PREVENT_BACKBUTTON_FIX
);
         String dojoParams = (String)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_PARAMS
);
         if ( dojoParamDebug != null || dojoParamDebugAtAllCosts != null || dojoParamPreventBackBtnFix
!= null || dojoParams != null )
@@ -878,6 +899,9 @@
         List dojoRequiresModules = (List)dojoConfigMap.get( HeaderResource.HEADER_CONFIG_DOJO_REQUIRES_MODULES
);
         if ( dojoRequiresModules != null && dojoRequiresModules.size() > 0 )
         {
+        	HashMap addedReqs = null;
+        	if ( dojoDebugEnabled )
+        		addedReqs = new HashMap();
             StringBuffer dojoRequiresContent = new StringBuffer();
             Iterator dojoRequiresModulesIter = dojoRequiresModules.iterator();
             while ( dojoRequiresModulesIter.hasNext() )
@@ -898,10 +922,19 @@
                         else
                         {
                             dojoRequiresContent.append( "    dojo.require(\"").append( dojoReq
).append( "\");" ).append( EOL );
+                            if ( dojoDebugEnabled )
+                            	addedReqs.put( dojoReq, dojoReq ); 
                         }
                     }
                 }
             }
+            if ( dojoDebugEnabled )
+            {
+            	if ( addedReqs.get( HeaderResource.HEADER_DEBUG_REQUIRES ) == null )
+            	{
+            		dojoRequiresContent.append( "    dojo.require(\"").append( HeaderResource.HEADER_DEBUG_REQUIRES
).append( "\");" ).append( EOL );
+            	}
+            }            
             namedResourcesDefault.put( HeaderResource.HEADER_SECTION_DOJO_REQUIRES_MODULES,
dojoRequiresContent.toString() );
             registerAndOrderNamedHeaderResource( HeaderResource.HEADER_SECTION_DOJO_REQUIRES_MODULES,
null, dojoEnableName, headerDynamicConfigurationDefault );
         }



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