You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by ad...@apache.org on 2015/04/10 15:38:43 UTC
svn commit: r1672662 [3/3] - in /wicket/common/site/trunk/_site/guide/guide:
./ pages/ target/classes/
Modified: wicket/common/site/trunk/_site/guide/guide/pages/versioningCaching_4.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/versioningCaching_4.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/versioningCaching_4.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/versioningCaching_4.html Fri Apr 10 13:38:40 2015
@@ -192,7 +192,7 @@ function addJsClass() {
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_1.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_1.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_1.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_1.html Fri Apr 10 13:38:40 2015
@@ -193,7 +193,7 @@ However, none of these frameworks offers
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_2.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_2.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_2.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_2.html Fri Apr 10 13:38:40 2015
@@ -199,7 +199,7 @@ This approach is very similar to what GU
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_3.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_3.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_3.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_3.html Fri Apr 10 13:38:40 2015
@@ -198,7 +198,7 @@ Let's quickly review the main advantages
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_4.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_4.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_4.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/whyLearn_4.html Fri Apr 10 13:38:40 2015
@@ -199,7 +199,7 @@ Wicket is not the only component oriente
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_1.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_1.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_1.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_1.html Fri Apr 10 13:38:40 2015
@@ -197,7 +197,7 @@ Every WicketStuff module can be download
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_2.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_2.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_2.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_2.html Fri Apr 10 13:38:40 2015
@@ -216,7 +216,7 @@ textArea.add(<span class="java-keywo
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_3.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_3.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_3.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_3.html Fri Apr 10 13:38:40 2015
@@ -207,7 +207,7 @@ function addJsClass() {
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_4.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_4.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_4.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_4.html Fri Apr 10 13:38:40 2015
@@ -201,7 +201,7 @@ add(<span class="java-keyword">new</
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_5.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_5.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_5.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_5.html Fri Apr 10 13:38:40 2015
@@ -200,7 +200,7 @@ add(grid);</pre></div><p class="paragrap
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_6.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_6.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_6.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_6.html Fri Apr 10 13:38:40 2015
@@ -216,7 +216,7 @@ To write/read objects to response/from r
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_7.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_7.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_7.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/pages/wicketstuff_7.html Fri Apr 10 13:38:40 2015
@@ -194,7 +194,7 @@ A short introduction to this module can
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/redirects.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/redirects.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/redirects.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/redirects.html Fri Apr 10 13:38:40 2015
@@ -227,7 +227,7 @@ Quite a few teams have already got stuck
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/repeaters.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/repeaters.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/repeaters.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/repeaters.html Fri Apr 10 13:38:40 2015
@@ -353,7 +353,7 @@ Wicket provides also component PageableL
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/requestProcessing.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/requestProcessing.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/requestProcessing.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/requestProcessing.html Fri Apr 10 13:38:40 2015
@@ -332,7 +332,7 @@ processing of an Ajax request Wicket wil
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/resources.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/resources.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/resources.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/resources.html Fri Apr 10 13:38:40 2015
@@ -242,8 +242,41 @@ One of the biggest challenge for a web f
}
}</pre></div><p class="paragraph"/>Wicket will take care of generating a valid URL for file calendar.jpg. URLs for package resources have the following structure:<p class="paragraph"/><code><path to application root>/wicket/resource/<fully qualified classname>/<resource file name>-<ver-<id>>(.file extension)</code><p class="paragraph"/>In our example the URL for our picture file calendar.jpg is the following:<p class="paragraph"/><code>./wicket/resource/org.wicketTutorial.CustomPanel/calendar-ver-1297887542000.jpg</code><p class="paragraph"/>The first part of the URL is the relative path to the application root. In our example our page is already at the application's root so we have only a single-dotted segment. The next two segments, wicket and resource, are respectively the namespace and the identifier for resources seen in paragraph 8.6.4.<p class="paragraph"/>The fourth segment is the fully qualified name of the class used to locate t
he resource and it is the scope of the package resource. In the last segment of the URL we can find the name of the resource (the file name).<p class="paragraph"/>As you can see Wicket has automatically appended to the file name a version identifier (ver-1297887542000). When Wicket runs in DEVELOPMENT mode this identifier contains the timestamp in millisecond indicating the last time the resource file was modified. This can be useful when we are developing our application and resource files are frequently modified. Appending the timestamp to the original name we are sure that our browser will use always the last version of the file and not an old, out of date, cached version.<p class="paragraph"/>When instead Wicket is running in DEPLOYMENT mode, the version identifier will contain the MD5 digest of the file instead of the timestamp. The digest is computed only the first time the resource is requested. This perfectly makes sense as static resources don't change so often when our app
lication runs into production environment and when this appends the application is redeployed.<p class="paragraph"/><blockquote class="note">
Package resources can be localized following the same rules seen for resource bundles and markup files:<p class="paragraph"/><img border="0" class="center" src="../img/package-resource-localization.png"></img><p class="paragraph"/>In the example illustrated in the picture above, if we try to retrieve package resource calendar.jpg when the current locale is set to French, the actual file returned will be calendar_fr.jpg.
-</blockquote><p class="paragraph"/>
-<h3>Using package resources with tag <wicket:link></h3><p class="paragraph"/>In paragraph 8.3 we have used tag <wicket:link> to automatically create links to bookmarkable pages. The same technique can be used also for package resources in order to use them directly from markup file. Let's assume for example that we have a picture file called icon.png placed in the same package of the current page. Under these conditions we can display the picture file using the following markup fragment:<p class="paragraph"/><div class="code"><pre><wicket:link>
+</blockquote><p class="paragraph"/><h3>Responsive images - multiple resource references use in one component</h3><p class="paragraph"/>Since Wicket 7.0.0 the build-in component <code>org.apache.wicket.markup.html.image.Image</code> allows you to add several ResourceReferences via varargs and to provide sizes for each image so that the browser is able to pick the best image source.<p class="paragraph"/><strong class="bold">HTML:</strong>
+<div class="code"><pre>…
+ Package resource image: <img wicket:id=<span class="java-quote">"packageResPicture"</span>/>
+...</pre></div><p class="paragraph"/><strong class="bold">Java Code:</strong>
+<div class="code"><pre>…
+ Image image = <span class="java-keyword">new</span> Image(<span class="java-quote">"packageResPicture"</span>,
+ <span class="java-keyword">new</span> PackageResourceReference(getClass(),<span class="java-quote">"small.jpg"</span>),
+ <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"large.jpg"</span>),
+ <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"medium.jpg"</span>),
+ <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"small.jpg"</span>));
+ image.setXValues(<span class="java-quote">"1024w"</span>, <span class="java-quote">"640w"</span>, <span class="java-quote">"320w"</span>);
+ image.setSizes(<span class="java-quote">"(min-width: 36em) 33.3vw"</span>, <span class="java-quote">"100vw"</span>);<p class="paragraph"/> <span class="java-keyword">this</span>.add(image);
+...</pre></div><p class="paragraph"/>The component <code>org.apache.wicket.markup.html.image.Picture</code> is used to provide a fallback image <code>org.apache.wicket.markup.html.image.Image</code> and several source components <code>org.apache.wicket.markup.html.image.Source</code> which gives a developer the control as to when and if those images are presented to the user.<p class="paragraph"/><strong class="bold">HTML:</strong>
+<div class="code"><pre>…
+ <picture wicket:id=<span class="java-quote">"picture"</span>>
+ <source wicket:id=<span class="java-quote">"big"</span> />
+ <source wicket:id=<span class="java-quote">"small"</span> />
+ <img wicket:id=<span class="java-quote">"fallback"</span> />
+ </picture>
+...</pre></div><p class="paragraph"/><strong class="bold">Java Code:</strong>
+<div class="code"><pre>…
+ Picture picture = <span class="java-keyword">new</span> Picture(<span class="java-quote">"picture"</span>);<p class="paragraph"/> Source big = <span class="java-keyword">new</span> Source(<span class="java-quote">"big"</span>, <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"big.jpg"</span>), <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"big-hd.jpg"</span>);
+ big.setXValues(<span class="java-quote">"1x"</span>,<span class="java-quote">"2x"</span>);
+ big.setMedia(<span class="java-quote">"(min-width: 40em)"</span>);
+ picture.add(big);<p class="paragraph"/> Source small = <span class="java-keyword">new</span> Source(<span class="java-quote">"small"</span>, <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"small.jpg"</span>), <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"small-hd.jpg"</span>);
+ small.setXValues(<span class="java-quote">"1x"</span>,<span class="java-quote">"2x"</span>);
+ picture.add(small);<p class="paragraph"/> Image image = <span class="java-keyword">new</span> Image(<span class="java-quote">"fallback"</span>, <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"fallback.jpg"</span>));
+ picture.add(image);<p class="paragraph"/> <span class="java-keyword">this</span>.add(picture);
+...</pre></div><p class="paragraph"/><h3>Media tags - resource references with content range support</h3><p class="paragraph"/>Since Wicket 7.0.0 the PackageResource and the PackageResourceReference support "Range" HTTP header for the request and "Content-Range" / "Accept-Range" HTTP headers for the response, which are used for videos / audio tags. The "Range" header allows the client to only request a specific byte range of the resource. The server provides the "Content-Range" and tells the client which bytes are going to be send.<p class="paragraph"/><strong class="bold">HTML:</strong>
+<div class="code"><pre>…
+ <video wicket:id=<span class="java-quote">"video"</span> />
+...</pre></div><p class="paragraph"/><strong class="bold">Java Code:</strong>
+<div class="code"><pre>…
+ Video video = <span class="java-keyword">new</span> Video(<span class="java-quote">"video"</span>, <span class="java-keyword">new</span> PackageResourceReference(getClass(),<span class="java-quote">"video.mp4"</span>));
+...</pre></div><p class="paragraph"/><h3>Using package resources with tag <wicket:link></h3><p class="paragraph"/>In paragraph 8.3 we have used tag <wicket:link> to automatically create links to bookmarkable pages. The same technique can be used also for package resources in order to use them directly from markup file. Let's assume for example that we have a picture file called icon.png placed in the same package of the current page. Under these conditions we can display the picture file using the following markup fragment:<p class="paragraph"/><div class="code"><pre><wicket:link>
<img src=<span class="java-quote">"icon.png"</span>/>
</wicket:link></pre></div><p class="paragraph"/>In the example above Wicket will populate the attribute src with the URL corresponding to the package resource icon.png. <wicket:link> supports also tag <link> for CSS files and tag <script> for JavaScript files.
@@ -516,7 +549,7 @@ body{
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/security.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/security.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/security.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/security.html Fri Apr 10 13:38:40 2015
@@ -497,7 +497,7 @@ implementation of <code>ICryptFactory</c
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/single.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/single.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/single.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/single.html Fri Apr 10 13:38:40 2015
@@ -514,10 +514,7 @@ The various Wicket-related topics are gr
<h1 id="howToSource">2 How to use the example code</h1>
-Most of the code you will find in this document is available as a <a href="https://github.com/bitstorm/Wicket-tutorial-examples" target="blank">Git repository</a> and is licensed under the ASF 2.0. To get a local copy of the repository you can run the clone command from shell:<p class="paragraph"/><div class="code"><pre>git clone https://github.com/bitstorm/Wicket-tutorial-examples.git</pre></div><p class="paragraph"/><blockquote class="note">
-If you are using Wicket 6.x remeber to switch to branch <code>wicket-6.x</code>
-</blockquote><p class="paragraph"/>If you aren't used to Git, you can simply download the whole source as a zip archive:<p class="paragraph"/><img border="0" class="center" src="../img/gitRepo.png"></img><p class="paragraph"/>The repository contains a multi-module Maven project. Every subproject is contained in the relative folder of the repository:<p class="paragraph"/><img border="0" class="center" src="../img/gitMavenPrj.png"></img><p class="paragraph"/>When the example code is used in the document, you will find the name of the subproject it belongs to. If you don't have any experience with Maven, you can read Appendix A where you can learn the basic commands needed to work with the example projects and to import them into your favourite IDE (NetBeans, IDEA or Eclipse).
-
+Most of the code you will find in this document is available as a <a href="https://github.com/bitstorm/Wicket-tutorial-examples" target="blank">Git repository</a> and is licensed under the ASF 2.0. To get a local copy of the repository you can run the clone command from shell:<p class="paragraph"/><div class="code"><pre>git clone https://github.com/bitstorm/Wicket-tutorial-examples.git</pre></div><p class="paragraph"/>If you aren't used to Git, you can simply download the whole source as a zip archive:<p class="paragraph"/><img border="0" class="center" src="../img/gitRepo.png"></img><p class="paragraph"/>The repository contains a multi-module Maven project. Every subproject is contained in the relative folder of the repository:<p class="paragraph"/><img border="0" class="center" src="../img/gitMavenPrj.png"></img><p class="paragraph"/>When the example code is used in the document, you will find the name of the subproject it belongs to. If you don't have any experience with
Maven, you can read Appendix A where you can learn the basic commands needed to work with the example projects and to import them into your favourite IDE (NetBeans, IDEA or Eclipse).
<h1 id="whyLearn">3 Why should I learn Wicket?</h1>
@@ -2610,8 +2607,41 @@ One of the biggest challenge for a web f
}
}</pre></div><p class="paragraph"/>Wicket will take care of generating a valid URL for file calendar.jpg. URLs for package resources have the following structure:<p class="paragraph"/><code><path to application root>/wicket/resource/<fully qualified classname>/<resource file name>-<ver-<id>>(.file extension)</code><p class="paragraph"/>In our example the URL for our picture file calendar.jpg is the following:<p class="paragraph"/><code>./wicket/resource/org.wicketTutorial.CustomPanel/calendar-ver-1297887542000.jpg</code><p class="paragraph"/>The first part of the URL is the relative path to the application root. In our example our page is already at the application's root so we have only a single-dotted segment. The next two segments, wicket and resource, are respectively the namespace and the identifier for resources seen in paragraph 8.6.4.<p class="paragraph"/>The fourth segment is the fully qualified name of the class used to locate t
he resource and it is the scope of the package resource. In the last segment of the URL we can find the name of the resource (the file name).<p class="paragraph"/>As you can see Wicket has automatically appended to the file name a version identifier (ver-1297887542000). When Wicket runs in DEVELOPMENT mode this identifier contains the timestamp in millisecond indicating the last time the resource file was modified. This can be useful when we are developing our application and resource files are frequently modified. Appending the timestamp to the original name we are sure that our browser will use always the last version of the file and not an old, out of date, cached version.<p class="paragraph"/>When instead Wicket is running in DEPLOYMENT mode, the version identifier will contain the MD5 digest of the file instead of the timestamp. The digest is computed only the first time the resource is requested. This perfectly makes sense as static resources don't change so often when our app
lication runs into production environment and when this appends the application is redeployed.<p class="paragraph"/><blockquote class="note">
Package resources can be localized following the same rules seen for resource bundles and markup files:<p class="paragraph"/><img border="0" class="center" src="../img/package-resource-localization.png"></img><p class="paragraph"/>In the example illustrated in the picture above, if we try to retrieve package resource calendar.jpg when the current locale is set to French, the actual file returned will be calendar_fr.jpg.
-</blockquote><p class="paragraph"/>
-<h3>Using package resources with tag <wicket:link></h3><p class="paragraph"/>In paragraph 8.3 we have used tag <wicket:link> to automatically create links to bookmarkable pages. The same technique can be used also for package resources in order to use them directly from markup file. Let's assume for example that we have a picture file called icon.png placed in the same package of the current page. Under these conditions we can display the picture file using the following markup fragment:<p class="paragraph"/><div class="code"><pre><wicket:link>
+</blockquote><p class="paragraph"/><h3>Responsive images - multiple resource references use in one component</h3><p class="paragraph"/>Since Wicket 7.0.0 the build-in component <code>org.apache.wicket.markup.html.image.Image</code> allows you to add several ResourceReferences via varargs and to provide sizes for each image so that the browser is able to pick the best image source.<p class="paragraph"/><strong class="bold">HTML:</strong>
+<div class="code"><pre>…
+ Package resource image: <img wicket:id=<span class="java-quote">"packageResPicture"</span>/>
+...</pre></div><p class="paragraph"/><strong class="bold">Java Code:</strong>
+<div class="code"><pre>…
+ Image image = <span class="java-keyword">new</span> Image(<span class="java-quote">"packageResPicture"</span>,
+ <span class="java-keyword">new</span> PackageResourceReference(getClass(),<span class="java-quote">"small.jpg"</span>),
+ <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"large.jpg"</span>),
+ <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"medium.jpg"</span>),
+ <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"small.jpg"</span>));
+ image.setXValues(<span class="java-quote">"1024w"</span>, <span class="java-quote">"640w"</span>, <span class="java-quote">"320w"</span>);
+ image.setSizes(<span class="java-quote">"(min-width: 36em) 33.3vw"</span>, <span class="java-quote">"100vw"</span>);<p class="paragraph"/> <span class="java-keyword">this</span>.add(image);
+...</pre></div><p class="paragraph"/>The component <code>org.apache.wicket.markup.html.image.Picture</code> is used to provide a fallback image <code>org.apache.wicket.markup.html.image.Image</code> and several source components <code>org.apache.wicket.markup.html.image.Source</code> which gives a developer the control as to when and if those images are presented to the user.<p class="paragraph"/><strong class="bold">HTML:</strong>
+<div class="code"><pre>…
+ <picture wicket:id=<span class="java-quote">"picture"</span>>
+ <source wicket:id=<span class="java-quote">"big"</span> />
+ <source wicket:id=<span class="java-quote">"small"</span> />
+ <img wicket:id=<span class="java-quote">"fallback"</span> />
+ </picture>
+...</pre></div><p class="paragraph"/><strong class="bold">Java Code:</strong>
+<div class="code"><pre>…
+ Picture picture = <span class="java-keyword">new</span> Picture(<span class="java-quote">"picture"</span>);<p class="paragraph"/> Source big = <span class="java-keyword">new</span> Source(<span class="java-quote">"big"</span>, <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"big.jpg"</span>), <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"big-hd.jpg"</span>);
+ big.setXValues(<span class="java-quote">"1x"</span>,<span class="java-quote">"2x"</span>);
+ big.setMedia(<span class="java-quote">"(min-width: 40em)"</span>);
+ picture.add(big);<p class="paragraph"/> Source small = <span class="java-keyword">new</span> Source(<span class="java-quote">"small"</span>, <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"small.jpg"</span>), <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"small-hd.jpg"</span>);
+ small.setXValues(<span class="java-quote">"1x"</span>,<span class="java-quote">"2x"</span>);
+ picture.add(small);<p class="paragraph"/> Image image = <span class="java-keyword">new</span> Image(<span class="java-quote">"fallback"</span>, <span class="java-keyword">new</span> PackageResourceReference(getClass(), <span class="java-quote">"fallback.jpg"</span>));
+ picture.add(image);<p class="paragraph"/> <span class="java-keyword">this</span>.add(picture);
+...</pre></div><p class="paragraph"/><h3>Media tags - resource references with content range support</h3><p class="paragraph"/>Since Wicket 7.0.0 the PackageResource and the PackageResourceReference support "Range" HTTP header for the request and "Content-Range" / "Accept-Range" HTTP headers for the response, which are used for videos / audio tags. The "Range" header allows the client to only request a specific byte range of the resource. The server provides the "Content-Range" and tells the client which bytes are going to be send.<p class="paragraph"/><strong class="bold">HTML:</strong>
+<div class="code"><pre>…
+ <video wicket:id=<span class="java-quote">"video"</span> />
+...</pre></div><p class="paragraph"/><strong class="bold">Java Code:</strong>
+<div class="code"><pre>…
+ Video video = <span class="java-keyword">new</span> Video(<span class="java-quote">"video"</span>, <span class="java-keyword">new</span> PackageResourceReference(getClass(),<span class="java-quote">"video.mp4"</span>));
+...</pre></div><p class="paragraph"/><h3>Using package resources with tag <wicket:link></h3><p class="paragraph"/>In paragraph 8.3 we have used tag <wicket:link> to automatically create links to bookmarkable pages. The same technique can be used also for package resources in order to use them directly from markup file. Let's assume for example that we have a picture file called icon.png placed in the same package of the current page. Under these conditions we can display the picture file using the following markup fragment:<p class="paragraph"/><div class="code"><pre><wicket:link>
<img src=<span class="java-quote">"icon.png"</span>/>
</wicket:link></pre></div><p class="paragraph"/>In the example above Wicket will populate the attribute src with the URL corresponding to the package resource icon.png. <wicket:link> supports also tag <link> for CSS files and tag <script> for JavaScript files.
@@ -4878,20 +4908,25 @@ Quite a few teams have already got stuck
You can contribute to this guide by following these steps:
<ul class="star">
<li>The guide uses Grails GDoc to generate the final HTML/PDF so you should consult with its <a href="http://grails.org/WikiSyntax" target="blank">syntax</a>.</li>
-<li>Clone Apache Wicket's GIT repository <a href="https://github.com/apache/wicket.git" target="blank">site</a></li>
-</ul><p class="paragraph"/><div class="code"><pre>git clone https://github.com/apache/wicket.git</pre></div>
+<li>Checkout Apache Wicket's <a href="https://svn.apache.org/repos/asf/wicket/common/site/trunk/_site/" target="blank">site</a></li>
+</ul><p class="paragraph"/><div class="code"><pre>svn checkout https://svn.apache.org/repos/asf/wicket/common/site/trunk/_site/</pre></div>
+<ul class="star">
+<li>Edit the <em class="italic">.gdoc</em> files in <em class="italic">_site/guide/guide/src/docs/guide</em> folder</li>
+<li>To preview your changes you should have <a href="http://grails.org/" target="blank">Grails</a> installed.</li>
<ul class="star">
-<li>Edit the <em class="italic">.gdoc</em> files in <em class="italic">wicket/wicket-user-guide/src/docs/guide</em> folder</li>
-<li>To preview your changes run "mvn clean package -P guide" in the <em class="italic">wicket/wicket-user-guide</em> folder (in eclipse use a run configuration)</li>
-<li>Navigate to <em class="italic">wicket/wicket-user-guide/target/doc</em> and open one of the following files a browser / pdf viewer:</li>
-<ul class="star">
-<li> <em class="italic">index.html</em> (multi page version)</li>
-<li> <em class="italic">guide/single.html</em> (single page version)</li>
-<li> <em class="italic">guide/single.pdf</em> (single page pdf version)</li>
+<li>Download it from <a href="http://grails.org/download" target="blank">here</a>.</li>
+</ul></ul><p class="paragraph"/><strong class="bold">Note</strong>: Download version <strong class="bold">2.2.4</strong>. Newer versions are not supported at the moment.
+<ul class="star">
+<ul class="star">
+<li>Install it by following these <a href="http://grails.org/doc/latest/guide/gettingStarted.html#requirements" target="blank">instructions</a></li>
</ul>
-<li>Create a ticket in Apache Wicket's <a href="https://issues.apache.org/jira/browse/WICKET" target="blank">JIRA</a></li>
-<li><strong class="bold">Commit and push the changes</strong> to your forked Apacke Wicket's GIT repository and <strong class="bold">create a pull request</strong> on github</li>
-</ul><p class="paragraph"/><strong class="bold">Thank you!</strong>
+<li>Navigate to <em class="italic">_site/guide/guide</em> folder and execute</li>
+</ul><p class="paragraph"/><div class="code"><pre>grails doc</pre></div>
+<ul class="star">
+<li>To preview your changes open <em class="italic">_site/guide/index.html</em> in a browser</li>
+<li>Create a patch with</li>
+</ul><p class="paragraph"/><div class="code"><pre>svn diff > my.patch</pre></div>
+and attach it to a ticket in Apache Wicket's <a href="https://issues.apache.org/jira/browse/WICKET" target="blank">JIRA</a><p class="paragraph"/><strong class="bold">Thank you!</strong>
</div>
</td>
@@ -4912,7 +4947,7 @@ You can contribute to this guide by foll
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/single.pdf
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/single.pdf?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
Binary files - no diff available.
Modified: wicket/common/site/trunk/_site/guide/guide/target/classes/ApplicationResources.class
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/target/classes/ApplicationResources.class?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
Binary files - no diff available.
Modified: wicket/common/site/trunk/_site/guide/guide/target/classes/BootStrap.class
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/target/classes/BootStrap.class?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
Binary files - no diff available.
Modified: wicket/common/site/trunk/_site/guide/guide/target/classes/BuildConfig.class
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/target/classes/BuildConfig.class?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
Binary files - no diff available.
Modified: wicket/common/site/trunk/_site/guide/guide/target/classes/Config.class
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/target/classes/Config.class?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
Binary files - no diff available.
Modified: wicket/common/site/trunk/_site/guide/guide/target/classes/DataSource.class
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/target/classes/DataSource.class?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
Binary files - no diff available.
Modified: wicket/common/site/trunk/_site/guide/guide/target/classes/UrlMappings.class
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/target/classes/UrlMappings.class?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
Binary files - no diff available.
Modified: wicket/common/site/trunk/_site/guide/guide/target/classes/resources.class
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/target/classes/resources.class?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
Binary files - no diff available.
Modified: wicket/common/site/trunk/_site/guide/guide/testing.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/testing.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/testing.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/testing.html Fri Apr 10 13:38:40 2015
@@ -430,7 +430,7 @@ formTester.submit(<span class="java-
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/testingspring.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/testingspring.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/testingspring.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/testingspring.html Fri Apr 10 13:38:40 2015
@@ -324,7 +324,7 @@ Since the development of many web applic
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/urls.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/urls.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/urls.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/urls.html Fri Apr 10 13:38:40 2015
@@ -372,7 +372,7 @@ By default <code>CryptoMapper</code> enc
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/versioningCaching.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/versioningCaching.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/versioningCaching.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/versioningCaching.html Fri Apr 10 13:38:40 2015
@@ -293,7 +293,7 @@ Page '<page class>' is not state
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/whyLearn.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/whyLearn.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/whyLearn.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/whyLearn.html Fri Apr 10 13:38:40 2015
@@ -247,7 +247,7 @@ Wicket is not the only component oriente
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>
Modified: wicket/common/site/trunk/_site/guide/guide/wicketstuff.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/wicketstuff.html?rev=1672662&r1=1672661&r2=1672662&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/wicketstuff.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/wicketstuff.html Fri Apr 10 13:38:40 2015
@@ -333,7 +333,7 @@ A short introduction to this module can
<div id="footer">
Copyright © 2013-2015 â <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>
- â <b style="color:#E8590A !important;">(Generated on: 2015-04-08)</b>
+ â <b style="color:#E8590A !important;">(Generated on: 2015-04-10)</b>
</div>