You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2006/11/03 21:39:24 UTC

svn commit: r470981 - in /myfaces/tomahawk/trunk/core/src: main/java/org/apache/myfaces/custom/dojo/ main/tld/tomahawk-entities/ site/xdoc/

Author: werpu
Date: Fri Nov  3 12:39:23 2006
New Revision: 470981

URL: http://svn.apache.org/viewvc?view=rev&rev=470981
Log:
added the development attribute which originally was planned but slipped through before the promotion

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoConfig.java
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoInitializer.java
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java
    myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_dojo_initializer_attributes.xml
    myfaces/tomahawk/trunk/core/src/site/xdoc/dojoInitializer.xml

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoConfig.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoConfig.java?view=diff&rev=470981&r1=470980&r2=470981
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoConfig.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoConfig.java Fri Nov  3 12:39:23 2006
@@ -60,7 +60,8 @@
     Boolean                     _parseWidgets         = null;
     Boolean                     _preventBackButtonFix = null;
     String                      _searchIds            = null;
-
+    Boolean                     _development           = null;
+    
     //getters and setters for the djconfig
     public Boolean getAllowQueryConfig() {
         return _allowQueryConfig;
@@ -200,6 +201,14 @@
         if(isStringValue)
             target.append("'");
 
+    }
+
+    public Boolean getDevelopment() {
+        return _development;
+    }
+
+    public void setDevelopment(Boolean development) {
+        this._development = development;
     }
 
 }

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoInitializer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoInitializer.java?view=diff&rev=470981&r1=470980&r2=470981
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoInitializer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoInitializer.java Fri Nov  3 12:39:23 2006
@@ -18,6 +18,7 @@
 
 import javax.faces.component.UIOutput;
 import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
 
 
 /**
@@ -36,7 +37,8 @@
     Boolean                    _expanded             = null;
     String                     _provide              = null;
     String                     _require              = null;
-
+    Boolean                    _development          = null;
+    
     //we handle that specifically to speed things up (we do not want an NxN runtime complexity via enforced
     //reflection in the utils
     boolean dojoConfigParamSet = false;
@@ -148,10 +150,11 @@
         _debugConsole = (Boolean) values[13];
         _dojoConfig.setDebugAtAllCosts((Boolean) values[14]);
         _expanded = (Boolean) values[15];
+        _development = (Boolean) values[16];
     }
 
     public Object saveState(FacesContext context) {
-        Object[] values = new Object[16];
+        Object[] values = new Object[17];
         values[0]  = super.saveState(context);
         values[1]  = _dojoConfig.getAllowQueryConfig();
         values[2]  = _dojoConfig.getBaseScriptUri();
@@ -168,7 +171,8 @@
         values[13] = _debugConsole;
         values[14] = _dojoConfig.getDebugAtAllCosts();
         values[15] = _expanded;
-
+        values[16] = _development;
+        
         return values;
     }
 
@@ -312,4 +316,15 @@
         _dojoConfig.setSearchIds(searchIds);
     }
 
+ 
+     public void setDevelopment(Boolean development)
+    {
+         if (development != null) {
+             dojoConfigParamSet = true;
+             DojoUtils.getDjConfigInstance(FacesContext.getCurrentInstance()).setDevelopment(development);
+         }
+         _development = development;
+    }
+
+ 
 }

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java?view=diff&rev=470981&r1=470980&r2=470981
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/dojo/DojoUtils.java Fri Nov  3 12:39:23 2006
@@ -392,9 +392,14 @@
      * @return
      */
     public static Boolean getExpanded(FacesContext facesContext) {
+        //either the development attribute set or a special request key
         HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
         Boolean devStatus = (Boolean) request.getAttribute(INCL_TYPE_REQ_KEY);
-
+        DojoConfig config = getDjConfigInstance(facesContext);
+        if(devStatus == null)
+            devStatus = new Boolean(false);
+        devStatus = new Boolean (devStatus.booleanValue() || (config.getDevelopment() != null && config.getDevelopment().booleanValue()));
+        
         return devStatus;
     }
 

Modified: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_dojo_initializer_attributes.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_dojo_initializer_attributes.xml?view=diff&rev=470981&r1=470980&r2=470981
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_dojo_initializer_attributes.xml (original)
+++ myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_dojo_initializer_attributes.xml Fri Nov  3 12:39:23 2006
@@ -90,3 +90,9 @@
 	<rtexprvalue>false</rtexprvalue>
 	<type>java.lang.String</type>
 </attribute>
+<attribute>
+	<name>development</name>
+	<required>false</required>
+	<rtexprvalue>false</rtexprvalue>
+	<type>java.lang.Boolean</type>
+</attribute>

Modified: myfaces/tomahawk/trunk/core/src/site/xdoc/dojoInitializer.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/site/xdoc/dojoInitializer.xml?view=diff&rev=470981&r1=470980&r2=470981
==============================================================================
--- myfaces/tomahawk/trunk/core/src/site/xdoc/dojoInitializer.xml (original)
+++ myfaces/tomahawk/trunk/core/src/site/xdoc/dojoInitializer.xml Fri Nov  3 12:39:23 2006
@@ -92,6 +92,8 @@
 			[provide="&lt;dojo class with package&gt;"]
 			[require="&lt;dojo class with package&gt;"]
 			[searchIds="&lt;some id of an existing defined container &gt;"]
+			[development="true|false"]
+
 			&lt;/s:dojoInitializer&gt;
 			</source>
 		</section>
@@ -353,6 +355,13 @@
 					usage is xmlhttprequest, hence setting this encoding
 					will not change too much. But different encodings
 					like iframe are planned for the future.
+				</p>
+				<p>
+					<b>development</b>
+					<br />
+					If this parameter is set to true. The expanded
+					debuggable version of dojo is included
+					if set to false the compressed one is included.
 				</p>