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/09 03:52:57 UTC
svn commit: r932211 - in /click/trunk/click/documentation/docs:
roadmap-changes.html upgrade-path.html
Author: sabob
Date: Fri Apr 9 01:52:56 2010
New Revision: 932211
URL: http://svn.apache.org/viewvc?rev=932211&view=rev
Log:
roadmap
Modified:
click/trunk/click/documentation/docs/roadmap-changes.html
click/trunk/click/documentation/docs/upgrade-path.html
Modified: click/trunk/click/documentation/docs/roadmap-changes.html
URL: http://svn.apache.org/viewvc/click/trunk/click/documentation/docs/roadmap-changes.html?rev=932211&r1=932210&r2=932211&view=diff
==============================================================================
--- click/trunk/click/documentation/docs/roadmap-changes.html (original)
+++ click/trunk/click/documentation/docs/roadmap-changes.html Fri Apr 9 01:52:56 2010
@@ -76,12 +76,18 @@ includes improved Ajax support and @Bind
<dl>
<dt><a name="2.2.0"></a>
- <div class="release-header">Development Release - Version 2.2.0 RC1 - 31 March 2010</div>
+ <div class="release-header">Development Release - Version 2.2.0 RC1 - ?? April 2010</div>
</dt>
<dd>
<div style="margin-left:-2em;margin-bottom:1em;">
- IMPORTANT be sure to read the <a href="upgrade-path.html">upgrade path</a>
+ <b>IMPORTANT:</b> be sure to read the <a href="upgrade-path.html#2.2.0">upgrade path</a>
when upgrading from previous releases.
+ <p/>
+ Its worth highlighting that in this release we have removed the deprecated methods
+ <tt>Page.getHtmlImports</tt> and <tt>Control.getHtmlImports</tt>. Users
+ will have to migrate their code to use the new <tt>getHeadElements</tt> instead.
+ Please see the section, <a href="upgrade-path.html#migrate-imports">migrating imports</a>,
+ for more details.
</div>
<div style="margin-left: -2em; margin-top: 1.5em; margin-bottom: 1em;">
<b>New examples:</b>
Modified: click/trunk/click/documentation/docs/upgrade-path.html
URL: http://svn.apache.org/viewvc/click/trunk/click/documentation/docs/upgrade-path.html?rev=932211&r1=932210&r2=932211&view=diff
==============================================================================
--- click/trunk/click/documentation/docs/upgrade-path.html (original)
+++ click/trunk/click/documentation/docs/upgrade-path.html Fri Apr 9 01:52:56 2010
@@ -82,6 +82,64 @@ versions please email the Click user gro
<div class="release-header">Version 2.2.0 Upgrade</div></dt>
<dd>
<ul style="padding: 0em; margin-left:0em;margin-bottom: 2em">
+ <li class="change"><a name="migrate-imports"></a>
+ Migrated Click Controls from the old string based
+ <a href="click-api/org/apache/click/Control.html#getHtmlImports()">HTML imports</a>
+ to the new <a href="click-api/org/apache/click/element/Element.html">Element</a>
+ based <a href="click-api/org/apache/click/Control.html#getHeadElements()">HEAD elements</a>.
+ <p/>
+ Unfortunately this change can lead to runtime behavioral errors for
+ applications using the string based <tt>getHtmlImports</tt> approach.
+ <p/>
+ As runtime errors are often more expensive to fix than compile time errors,
+ we have decided to remove the <tt>getHtmlImports</tt> method from the
+ Page and Control classes. In addition we have set <tt>getHtmlImports</tt>
+ to <tt>final</tt> in Page and Control. This ensures existing codebases
+ don't accidentally override this method in custom controls and pages.
+ In a future release of Click these final methods will be removed as well.
+ <p/>
+ This means Click 2.2.0 will force you to migrate from <tt>getHtmlImports</tt>
+ to <tt>getHeadElements</tt>.
+ <p/>
+ Here is a typical example of converting a <tt>getHtmlImports</tt> method
+ to <tt>getHeadElements</tt>.
+ <p/>
+ Before:
+
+ <pre class="prettyprint">
+public class MyPage extends BorderPage {
+ protected static final String HTML_IMPORT =
+ "<link rel=\"stylesheet\" type=\"text/css\" src=\"{0}/js/mylib.css\"/>\n"
+ + "<script type=\"text/javascript\" src=\"{0}/js/mylib.js\"></script>\n"
+ + "<script type=\"text/javascript\">alert('Hello World!');</script>\n";
+
+ public String getHtmlImports() {
+ String[] args = { getContext().getRequest().getContextPath() };
+ return MessageFormat.format(HTML_IMPORTS, args);
+ }
+}
+</pre>
+
+ After:
+ <pre class="prettyprint">
+public class MyPage extends BorderPage {
+
+ public List getHeadElements() {
+ // Cater for stateful pages. If you don't use stateful pages you don't need this check
+ if (headElements == null) {
+ headElements = super.getHeadElements();
+ headElements.add(new CssImport("/js/mylib.css"));
+ headElements.add(new JsImport("/js/mylib.js"));
+
+ JsScript script = new JsScript();
+ script.setContent("alert('Hello World!');");
+ headElements.add(script);
+ }
+ return headElements;
+ }
+}
+</pre>
+ </li>
<li class="change">
Field disabled behavior has changed slightly. In previous versions,
disabled fields were processed and validated which isn't the desired