You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2010/04/11 16:30:32 UTC

svn commit: r932914 - in /click/trunk/click: documentation/docs/ examples/webapp/form/dynamic/ framework/src/org/apache/click/

Author: sabob
Date: Sun Apr 11 14:30:32 2010
New Revision: 932914

URL: http://svn.apache.org/viewvc?rev=932914&view=rev
Log:
doco

Modified:
    click/trunk/click/documentation/docs/roadmap-changes.html
    click/trunk/click/examples/webapp/form/dynamic/dynamic-field-set.htm
    click/trunk/click/examples/webapp/form/dynamic/dynamic-form.htm
    click/trunk/click/examples/webapp/form/dynamic/dynamic-select.htm
    click/trunk/click/framework/src/org/apache/click/PageInterceptor.java

Modified: click/trunk/click/documentation/docs/roadmap-changes.html
URL: http://svn.apache.org/viewvc/click/trunk/click/documentation/docs/roadmap-changes.html?rev=932914&r1=932913&r2=932914&view=diff
==============================================================================
--- click/trunk/click/documentation/docs/roadmap-changes.html (original)
+++ click/trunk/click/documentation/docs/roadmap-changes.html Sun Apr 11 14:30:32 2010
@@ -146,6 +146,12 @@ includes improved Ajax support and @Bind
         [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-591">CLK-591</a>].
       </li>
       <li class="change">
+        Added a <a href="click-api/org/apache/click/PageInterceptor.html">Page Interceptor</a>
+        facility that provides an extension point for code which can listen to
+        key page events and also interrupt normal page processing flow.
+        [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-598">CLK-598</a>].
+      </li>
+      <li class="change">
         Added improved dynamic Form support. Forms can now optionally bypass
         validation for JavaScript based submissions using the new JavaScript
         function <tt>"Click.submit(formName, validate)"</tt>
@@ -153,8 +159,9 @@ includes improved Ajax support and @Bind
       </li>
       <li class="change">
         Added improved dynamic Page and Form behaviour through new helper methods
-        that can bind and validate Fields and Forms during the <tt>"onInit"</tt>
-        page event. The new methods are:
+        that can bind and validate Forms and Fields <tt>before</tt> the onProcess
+        page event e.g. in the Page constructor or <tt>"onInit"</tt> event.
+        The new methods are:
         <a href="click-api/org/apache/click/util/ClickUtils.html#bind(org.apache.click.control.Field)">ClickUtils.bind(Field)</a>,
         <a href="click-api/org/apache/click/util/ClickUtils.html#bind(org.apache.click.control.Form)">ClickUtils.bind(Form)</a>,
         <a href="click-api/org/apache/click/util/ClickUtils.html#bind(org.apache.click.control.AbstractLink)">ClickUtils.bind(AbstractLink)</a>,
@@ -275,6 +282,15 @@ includes improved Ajax support and @Bind
        "-//Apache Software Foundation//DTD Click Menu 2.2//EN"
        "http://click.apache.org/dtds/menu-2.2.dtd"&gt; </pre>
       </li>
+      <li class="change">
+          The new click-2.2.dtd has been published to
+          <a href="http://click.apache.org/dtds/click-2.2.dtd">http://click.apache.org/dtds/click-2.2.dtd</a>.
+          If you want your configuration to conform to the click.dtd, include
+          the following declaration in your click.xml:
+          <pre class="prettyprint">&lt;!DOCTYPE click-app PUBLIC
+       "-//Apache Software Foundation//DTD Click Configuration 2.2//EN"
+       "http://click.apache.org/dtds/click-2.2.dtd"&gt; </pre>
+      </li>
     </ul>
   </dd>
 

Modified: click/trunk/click/examples/webapp/form/dynamic/dynamic-field-set.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/form/dynamic/dynamic-field-set.htm?rev=932914&r1=932913&r2=932914&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/form/dynamic/dynamic-field-set.htm (original)
+++ click/trunk/click/examples/webapp/form/dynamic/dynamic-field-set.htm Sun Apr 11 14:30:32 2010
@@ -1,3 +1,23 @@
+This example demonstrates how to dynamically add fieldsets to a form.
+<ul>
+    <li>
+        The JavaScript function <tt>Click.submit(form, validate)</tt> is set as
+        the checkbox <tt>onclick</tt> handler. Clicking the checkbox will submit
+        the form, but bypass form validation.
+    </li>
+    <li>
+        The utility method <tt>ClickUtils.bindAndValidate(Form)</tt> is used
+        to bind and inspect the checkbox value <tt>before</tt> the page onProcess
+        event.
+    </li>
+    <li>
+        If the checkbox is checked, the address fieldset is added to the form
+    </li>
+
+</ul>
+
+<hr/>
+
 $dynamicForm
 
 #if ($msg)

Modified: click/trunk/click/examples/webapp/form/dynamic/dynamic-form.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/form/dynamic/dynamic-form.htm?rev=932914&r1=932913&r2=932914&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/form/dynamic/dynamic-form.htm (original)
+++ click/trunk/click/examples/webapp/form/dynamic/dynamic-form.htm Sun Apr 11 14:30:32 2010
@@ -1,3 +1,21 @@
+This example demonstrates how to dynamically add fields to a form.
+<ul>
+    <li>
+        The JavaScript function <tt>Click.submit(form, validate)</tt> is set as
+        the checkbox <tt>onclick</tt> handler. Clicking the checkbox will submit
+        the form, but bypass form validation.
+    </li>
+    <li>
+        The utility method <tt>ClickUtils.bind(Control)</tt> is used to bind
+        and inspect the checkbox value <tt>before</tt> the page onProcess event.
+    </li>
+    <li>
+        If the checkbox is checked, the email field is added to the form
+    </li>
+</ul>
+
+<hr/>
+
 $dynamicForm
 
 #if ($msg)

Modified: click/trunk/click/examples/webapp/form/dynamic/dynamic-select.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/form/dynamic/dynamic-select.htm?rev=932914&r1=932913&r2=932914&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/form/dynamic/dynamic-select.htm (original)
+++ click/trunk/click/examples/webapp/form/dynamic/dynamic-select.htm Sun Apr 11 14:30:32 2010
@@ -1,3 +1,23 @@
+This example demonstrates how to dynamically add fieldsets to a form.
+<ul>
+    <li>
+        The JavaScript function <tt>Click.submit(form, validate)</tt> is set as
+        the Select <tt>onchange</tt> handler. Changing the select option will
+        submit the form, but bypass form validation.
+    </li>
+    <li>
+        The utility method <tt>ClickUtils.bind(Form)</tt> is used to bind
+        and inspect the Select value <tt>before</tt> the page onProcess event.
+    </li>
+    <li>
+        If the selected value is "Property" an address fieldset is added to the form.
+        If the selected value is "Stocks" an amount field is added to the form.
+    </li>
+
+</ul>
+
+<hr/>
+
 $dynamicForm
 
 #if ($msg)

Modified: click/trunk/click/framework/src/org/apache/click/PageInterceptor.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/PageInterceptor.java?rev=932914&r1=932913&r2=932914&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/PageInterceptor.java (original)
+++ click/trunk/click/framework/src/org/apache/click/PageInterceptor.java Sun Apr 11 14:30:32 2010
@@ -19,43 +19,43 @@
 package org.apache.click;
 
 /**
- * Provides an Page life cycle interceptor. Classes implementing this interface
- * can be used listen for key page life cycle events and abort further page
+ * Provides a Page life cycle interceptor. Classes implementing this interface
+ * can be used to listen for key page life cycle events and abort further page
  * processing if required.
  * <p/>
- * PageInterceptors can be used many different purposes including:
+ * PageInterceptors can be used for many different purposes including:
  * <ul>
  * <li>enforcing application wide page security policies</li>
  * <li>injecting dependencies into page objects</li>
  * <li>logging and profiling page performance</li>
  * </ul>
  *
- * A Click application can define multiple page interceptors which are invoked in
+ * A Click application can define multiple page interceptors that are invoked in
  * the order in which they are returned by the <tt>ConfigService</tt>.
  *
- * <h3>Scope</h3>
+ * <h3><a name="scope"></a>Scope</h3>
  *
- * Page interceptors can be define with a request level scope, where by a new
+ * Page interceptors can be defined with a request level scope, whereby a new
  * page interceptor will be created with each page request providing a thread
- * safe programming model. This is equivalent to a Spring "prototype" object.
+ * safe programming model.
  * <p/>
- * Please not with as new instances are created with each request, care should
- * be taken to ensure that these objects are light weight and do not introduce a
- * performance bottle neck into your application.
- * <p/>
- * Alternatively page interceptors can be defined with application level scope
- * where by a single instance is created for the application and is used for
- * all requests. This is the equivalent to Spring "singleton" object.
+ * Please note, as new interceptor instances are created with each request, care
+ * should be taken to ensure that these objects are light weight and do not
+ * introduce a performance bottleneck into your application.
+ * <p/>
+ * Alternatively, page interceptors can be defined with application level scope
+ * whereby a single instance is created for the application and is used for
+ * all requests.
  * <p/>
  * Note application scope interceptors are more efficient that request scope
  * interceptors, but you are responsible for ensuring that they are thread safe
  * and support reentrant method invocations as multiple page requests are
  * processed at the same time.
  *
- * <h3>Configuration</h3>
+ * <h3><a name="configuration"></a>Configuration</h3>
  *
  * Application PageInterceptors are configured in the <tt>click.xml</tt>
- * configuration file. PageInterceptors must support a construction using a
+ * configuration file. PageInterceptors must support construction using a
  * no-args public constructor.
  * <p/>
  * Page interceptors can have multiple properties configured with their XML
@@ -73,7 +73,7 @@ package org.apache.click;
  * The default scope for page interceptors is "request", but this can be configured
  * as "application" as is done in the example configuration above.
  *
- * <h3>Example</h3>
+ * <h3><a name="example"></a>Example</h3>
  *
  * <pre class="prettyprint">
  * public class SecurityInterceptor implements PageInterceptor {
@@ -87,9 +87,12 @@ package org.apache.click;
  *    // Public Methods ---------------------------------------------------------
  *
  *    public boolean preCreate(Class<? extends Page> pageClass, Context context) {
+ *
  *       // If authentication required, then ensure user is authenticated
  *       Authentication authentication = pageClass.getAnnotation(Authentication.class);
+ *
  *       // TODO: user context check.
+ *
  *       if (authentication != null && authentication.required()) {
  *          sendRedirect(getNotAuthenticatedPath(), context);
  *          return false;
@@ -157,15 +160,16 @@ package org.apache.click;
  *          throw new RuntimeException(ioe);
  *       }
  *   }
+ * } </pre>
  *
- * }
- *
+ * <pre class="prettyprint">
  * // Page class authentication annotation
  * &#64;Retention(RetentionPolicy.RUNTIME)
  * public @interface Authentication {
  *    boolean required() default true;
- * }
+ * } </pre>
  *
+ * <pre class="prettyprint">
  * // Page class authorization annotation
  * &#64;Retention(RetentionPolicy.RUNTIME)
  * public @interface Authorization {
@@ -196,8 +200,9 @@ public interface PageInterceptor {
      * <p/>
      * If this method returns true then the normal page processing is performed,
      * otherwise if this method returns false the request is considered to have
-     * been handled. Please note the page {@link Page#onDestroy()} method will
-     * still be invoked.
+     * been handled.
+     * <p/>
+     * Please note the page {@link Page#onDestroy()} method will still be invoked.
      *
      * @param page the newly instantiated page instance
      * @return true to continue normal page processing or false whereby the
@@ -211,8 +216,9 @@ public interface PageInterceptor {
      * <p/>
      * If this method returns true then the normal page processing is performed,
      * otherwise if this method returns false request is considered to have been
-     * handled. Please note the page {@link Page#onDestroy()} method will
-     * still be invoked.
+     * handled.
+     * <p/>
+     * Please note the page {@link Page#onDestroy()} method will still be invoked.
      *
      * @param page the newly instantiated page instance
      * @return true to continue normal page processing or false whereby the