Author: andyhot
Date: Fri Sep 21 17:02:24 2007
New Revision: 578330

URL: http://svn.apache.org/viewvc?rev=578330&view=rev
Log:
TAPESTRY-1430: allow searchIds in Shell and AjaxShellDelegate

Modified:
    
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/AjaxShellDelegate.java
    
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
    
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc
    
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/dojo/AjaxShellDelegateTest.java

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/AjaxShellDelegate.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/AjaxShellDelegate.java?rev=578330&r1=578329&r2=578330&view=diff
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/AjaxShellDelegate.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/AjaxShellDelegate.java
 Fri Sep 21 17:02:24 2007
@@ -65,6 +65,8 @@
     private boolean _preventBackButtonFix;
 
     private boolean _debugAtAllCosts;
+    
+    private String _searchIds;
 
     /** Default list of pre-bundled dojo supported locales */
     protected String[] SUPPORTED_LOCALES = { "en-us", "de-de", "de", "en-gb",
@@ -105,7 +107,10 @@
         {
             dojoConfig.put("preventBackButtonFix", _preventBackButtonFix);
         }
+        
         dojoConfig.put("parseWidgets", _parseWidgets);
+        if (_searchIds != null)
+            dojoConfig.put("searchIds", _searchIds);
 
         // Supports setting up locale in dojo environment to match the 
requested page locale.
         // (for things that use these settings, like DropdownDatePicker / date 
parsing / etc..
@@ -316,6 +321,17 @@
     public void setParseWidgets(boolean parseWidgets)
     {
         _parseWidgets = parseWidgets;
+    }
+    
+    /**
+     * Provides a way to have dojo automatically parse a known set of page 
+     * widgets without enabling full automatic parsing.
+     * 
+     * @param searchIds the html ids within which to search for widgets
+     */ 
+    public void setSearchIds(String searchIds) 
+    {
+        _searchIds = searchIds;
     }
 
     /**

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java?rev=578330&r1=578329&r2=578330&view=diff
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
 Fri Sep 21 17:02:24 2007
@@ -351,6 +351,12 @@
     
     /** @since 4.1.1 */
     
-    public abstract void setContentBuffer(StringBuffer buffer);    
+    public abstract void setContentBuffer(StringBuffer buffer); 
+    
+    /** @since 4.1.4 */
+    public abstract String getSearchIds();
+    
+    /** @since 4.1.4 */
+    public abstract void setSearchIds(String ids);
 
 }

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc?rev=578330&r1=578329&r2=578330&view=diff
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc
 Fri Sep 21 17:02:24 2007
@@ -138,6 +138,14 @@
             document. It is highly reccomended that you keep this at its 
default value of false.
         </description>
     </parameter>
+    
+    <parameter name="searchIds">
+        <description>
+            Provides a way to have dojo automatically parse a known set of 
page 
+            widgets without enabling full automatic parsing - which is not 
desirable
+            due to performance reasons, see parseWidgets.
+        </description>
+    </parameter>    
 
     <parameter name="tapestrySource" 
default-value="asset:defaultTapestrySource">
         <description>
@@ -196,6 +204,7 @@
         <set name="consoleEnabled" value="consoleEnabled" />
         <set name="preventBackButtonFix" value="preventBackButtonFix" />
         <set name="parseWidgets" value="parseWidgets" />
+        <set name="searchIds" value="searchIds" />
     </bean>
 
     <asset name="defaultDojoSource" path="classpath:/dojo-0.4.3/dojo.js" />

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/dojo/AjaxShellDelegateTest.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/dojo/AjaxShellDelegateTest.java?rev=578330&r1=578329&r2=578330&view=diff
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/dojo/AjaxShellDelegateTest.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/dojo/AjaxShellDelegateTest.java
 Fri Sep 21 17:02:24 2007
@@ -146,6 +146,7 @@
         d.setDebug(true);
         d.setLogLevel(AjaxShellDelegate.BROWSER_LOG_DEBUG);
         d.setConsoleEnabled(true);
+        d.setSearchIds("treeId");
         
         replay();
         
@@ -154,7 +155,7 @@
         verify();
         
         assertBuffer("<script type=\"text/javascript\">djConfig = 
{\"isDebug\":true,\"baseRelativePath\":\"http:///dojo/path\","; +
-                     "\"parseWidgets\":false,\"locale\":\"en-gb\"} </script>" 
+ SYSTEM_NEWLINE +
+                     
"\"parseWidgets\":false,\"searchIds\":\"treeId\",\"locale\":\"en-gb\"} 
</script>" + SYSTEM_NEWLINE +
                      SYSTEM_NEWLINE +
                      "<script type=\"text/javascript\" 
src=\"http:///dojo/path/dojo.js\";></script>" + SYSTEM_NEWLINE +
                      "<script type=\"text/javascript\">" + SYSTEM_NEWLINE +


Reply via email to