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 2016/11/21 14:19:22 UTC

wicket git commit: WICKET-6284 added documentation

Repository: wicket
Updated Branches:
  refs/heads/master e01f5bbb6 -> bc7a60fd1


WICKET-6284 added documentation

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/bc7a60fd
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/bc7a60fd
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/bc7a60fd

Branch: refs/heads/master
Commit: bc7a60fd1864ef1d339a598c5ade8f093e58f1e8
Parents: e01f5bb
Author: Andrea Del Bene <ad...@apache.org>
Authored: Mon Nov 21 15:17:50 2016 +0100
Committer: Andrea Del Bene <ad...@apache.org>
Committed: Mon Nov 21 15:18:35 2016 +0100

----------------------------------------------------------------------
 .../main/asciidoc/resources/resources_12.adoc   |  37 +++----
 .../main/asciidoc/resources/resources_13.adoc   |  40 +++----
 .../main/asciidoc/resources/resources_14.adoc   |  85 +++++----------
 .../main/asciidoc/resources/resources_15.adoc   | 105 ++++++++++---------
 .../main/asciidoc/resources/resources_16.adoc   |  64 +++++++++--
 .../main/asciidoc/resources/resources_17.adoc   |  21 +++-
 .../main/asciidoc/resources/resources_18.adoc   |   8 ++
 wicket-user-guide/src/main/asciidoc/single.adoc |  16 +--
 8 files changed, 203 insertions(+), 173 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/bc7a60fd/wicket-user-guide/src/main/asciidoc/resources/resources_12.adoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/main/asciidoc/resources/resources_12.adoc b/wicket-user-guide/src/main/asciidoc/resources/resources_12.adoc
index ac45594..bece07c 100644
--- a/wicket-user-guide/src/main/asciidoc/resources/resources_12.adoc
+++ b/wicket-user-guide/src/main/asciidoc/resources/resources_12.adoc
@@ -1,33 +1,26 @@
-
-
-
-Resources can be added to a global registry in order to share them at application-level. Shared resources are identified by an application-scoped key and they can be easily retrieved at a later time using reference class _SharedResourceReference_. The global registry can be accessed with _Application_'s method _getSharedResources_. In the following excerpt of code (taken again from project _CustomResourceMounting_) we register an instance of our custom RSS feeds producer as application-shared resource:
+Since interface _IResource_ is marked as functional interface, a custom resource can also be implemented with a simple lambda expression that consumes a _IResource.Attributes_ parameter:
 
 [source,java]
 ----
-  //init application's method
-  @Override
-  public void init(){
-    RSSProducerResource rssResource = new RSSProducerResource();
-    // ...
-    getSharedResources().add("globalRSSProducer", rssResource);    
-  }
+IResource helloWorldRes = (attributes) -> 
+     attributes.getResponse().write("Hello world!");
 ----
 
-Now to use an application-shared resource we can simply retrieve it using class _SharedResourceReference_ and providing the key previously used to register the resource:
+Lambda expressions come in handy also with _ResourceReference_ factory methods _of_ that accept a resource supplier as argument. Let's say we want to mount the resource of the previous example. Using lambdas the code looks like this:
 
 [source,java]
 ----
-add(new ResourceLink("globalRssLink", new SharedResourceReference("globalRSSProducer")));
-----
+@Override
+public void init() {
+  super.init();
 
-The URL generated for application shared resources follows the same pattern seen for package resources:
+  IResource helloWorldRes = (attributes) -> 
+     attributes.getResponse().write("Hello world!");
+     
+  ResourceReference resRef = ResourceReference.of("helloworld", () -> helloWorldRes);        
 
-_./wicket/resource/org.apache.wicket.Application/globalRSSProducer_
-
-The last segment of the URL is the key of the resource while the previous segment contains the scope of the resource. For application-scoped resources the scope is always the fully qualified name of class _Application_. This should not be surprising since global resources are visible at application level (i.e. the scope is the application).
-
-NOTE: Package resources are also application-shared resources but they don't need to be explicitly registered.
-
-NOTE: Remember that we can get the URL of a resource reference using method _urlFor(ResourceReference resourceRef, PageParameters params )_ available with both class _RequestCycle_ and class _Component_.
+  mountResource("/helloworld", resRef);
+}
+----
 
+As first argument for factory methods we can specify the name of the resource reference or a key for it (an instance of _ResourceReference.Key_) 

http://git-wip-us.apache.org/repos/asf/wicket/blob/bc7a60fd/wicket-user-guide/src/main/asciidoc/resources/resources_13.adoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/main/asciidoc/resources/resources_13.adoc b/wicket-user-guide/src/main/asciidoc/resources/resources_13.adoc
index 13d5246..ac45594 100644
--- a/wicket-user-guide/src/main/asciidoc/resources/resources_13.adoc
+++ b/wicket-user-guide/src/main/asciidoc/resources/resources_13.adoc
@@ -1,47 +1,33 @@
 
 
 
-Wicket loads application's resources delegating this task to a resource locator represented by interface _org.apache.wicket.core.util.resource.locator.IResourceStreamLocator_. To retrieve or modify the current resource locator we can use the getter and setter methods defined by setting class _ResourceSettings_:
+Resources can be added to a global registry in order to share them at application-level. Shared resources are identified by an application-scoped key and they can be easily retrieved at a later time using reference class _SharedResourceReference_. The global registry can be accessed with _Application_'s method _getSharedResources_. In the following excerpt of code (taken again from project _CustomResourceMounting_) we register an instance of our custom RSS feeds producer as application-shared resource:
 
 [source,java]
 ----
   //init application's method
   @Override
-  public void init(){   
-    //get the resource locator 
-    getResourceSettings().getResourceStreamLocator();
-    //set the resource locator    
-    getResourceSettings().setResourceStreamLocator(myLocator);
+  public void init(){
+    RSSProducerResource rssResource = new RSSProducerResource();
+    // ...
+    getSharedResources().add("globalRSSProducer", rssResource);    
   }
 ----
 
-The default locator used by Wicket is class _ResourceStreamLocator_ which in turn tries to load a requested resource using a set of implementations of interface _IResourceFinder_. This interface defines method _find(Class class, String pathname)_ which tries to resolve a resource corresponding to the given class and path.
-
-The default implementation of _IResourceFinder_ used by Wicket is _ClassPathResourceFinder_ which searches for resources into the application class path. This is the implementation we have used so far in our examples. However some developers may prefer storing markup files and other resources in a separate folder rather than placing them side by side with Java classes. 
-
-To customize resource loading we can add further resource finders to our application in order to extend the resource-lookup algorithm to different locations. Wicket already comes with two other implementations of IResourceFinder designed to search for resources into a specific folder on the file system. The first is class _Path_ and it's defined in package _org.apache.wicket.util.file_. The constructor of this class takes in input an arbitrary folder that can be expressed as a string path or as an instance of Wicket utility class _Folder_ (in package _org.apache.wicket.util.file_). The second implementation of interface _IResourceFinder_ is class _WebApplicationPath_ which looks into a folder placed inside webapp's root path (but not inside folder WEB-INF).
-
-Project CustomFolder4MarkupExample uses _WebApplicationPath_ to load the markup file and the resource bundle for its home page from a custom folder. The folder is called markupFolder and it is placed in the root path of the webapp. The following picture illustrates the file structure of the project:
-
-image::../img/package-structure-custom-folder.png[]
-
-As we can see in the picture above, we must preserve the package structure also in the custom folder used as resource container. The code used inside application class to configure  WebApplicationPath is the following:
+Now to use an application-shared resource we can simply retrieve it using class _SharedResourceReference_ and providing the key previously used to register the resource:
 
 [source,java]
 ----
-@Override
-public void init()
-{
-	getResourceSettings().getResourceFinders().add(
-			new WebApplicationPath(getServletContext(), "markupFolder"));
-}
+add(new ResourceLink("globalRssLink", new SharedResourceReference("globalRSSProducer")));
 ----
 
-Method getResourceFinders() defined by setting class ResourceSettings returns the list of  resource finders defined in our application. The constructor of WebApplicationPath takes in input also an instance of standard interface javax.servlet.ServletContext which can be retrieved with WebApplication's method getServletContext().
+The URL generated for application shared resources follows the same pattern seen for package resources:
+
+_./wicket/resource/org.apache.wicket.Application/globalRSSProducer_
 
-NOTE: By default, if resource files can not be found inside application classpath, Wicket will search for them inside \u201cresources\u201d folder. You may have noted this folder in the previous picture. It is placed next to the folder \u201cjava\u201d containing our source files:
+The last segment of the URL is the key of the resource while the previous segment contains the scope of the resource. For application-scoped resources the scope is always the fully qualified name of class _Application_. This should not be surprising since global resources are visible at application level (i.e. the scope is the application).
 
-image::../img/package-structure-resource-folder.png[]
+NOTE: Package resources are also application-shared resources but they don't need to be explicitly registered.
 
-This folder can be used to store resource files without writing any configuration code.
+NOTE: Remember that we can get the URL of a resource reference using method _urlFor(ResourceReference resourceRef, PageParameters params )_ available with both class _RequestCycle_ and class _Component_.
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/bc7a60fd/wicket-user-guide/src/main/asciidoc/resources/resources_14.adoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/main/asciidoc/resources/resources_14.adoc b/wicket-user-guide/src/main/asciidoc/resources/resources_14.adoc
index 4b9c6c6..13d5246 100644
--- a/wicket-user-guide/src/main/asciidoc/resources/resources_14.adoc
+++ b/wicket-user-guide/src/main/asciidoc/resources/resources_14.adoc
@@ -1,76 +1,47 @@
 
 
 
-Introduced in Wicket 6.20.0 / Wicket 7.0.0 there is a default way to be used in which the output of all CssHeaderItems / JavaScriptHeaderItems is modified before they are cached and delivered to the client. You can add a so called Compressor by receiving the resource settings and invoke 1.setJavaScriptCompressor(...) / 1.setJavaScriptCompressor(...). If you want to add several Compressors use _org.apache.wicket.resource.CompositeCssCompressor_ or _org.apache.wicket.resource.CompositeJavaScriptCompressor_
+Wicket loads application's resources delegating this task to a resource locator represented by interface _org.apache.wicket.core.util.resource.locator.IResourceStreamLocator_. To retrieve or modify the current resource locator we can use the getter and setter methods defined by setting class _ResourceSettings_:
 
-*Java Code:*
 [source,java]
 ----
-...
-��� public class WicketApplication extends WebApplication
-�� �{
-�� ��� �@Override
-�� ��� �public Class<? extends WebPage> getHomePage()
-�� ��� �{
-�� ��� ��� �return HomePage.class;
-�� ��� �}
-�� �
-�� ��� �@Override
-�� ��� �public void init()
-�� ��� �{
-�� ��� ��� �super.init();
-�� ��� ��� �getResourceSettings().setCssCompressor(new CssUrlReplacer());
-�� ��� �}
-�� �}
-...
+  //init application's method
+  @Override
+  public void init(){   
+    //get the resource locator 
+    getResourceSettings().getResourceStreamLocator();
+    //set the resource locator    
+    getResourceSettings().setResourceStreamLocator(myLocator);
+  }
 ----
 
-In the previous example you see that a _org.apache.wicket.resource.CssUrlReplacer_ is added which does not compress the content, but replaces all urls in CSS files and applies a Wicket representation for them by automatically wrapping them into PackageResourceReferences. Here is an example where you can see what Wicket does with the url representation.
+The default locator used by Wicket is class _ResourceStreamLocator_ which in turn tries to load a requested resource using a set of implementations of interface _IResourceFinder_. This interface defines method _find(Class class, String pathname)_ which tries to resolve a resource corresponding to the given class and path.
 
-HomePage (in package my/company/):
-*Java Code:*
-[source,java]
-----
-...
-response.render(CssReferenceHeaderItem.forReference(new PackageResourceReference(HomePage.class, "res/css/mycss.css")));
-...
-----
+The default implementation of _IResourceFinder_ used by Wicket is _ClassPathResourceFinder_ which searches for resources into the application class path. This is the implementation we have used so far in our examples. However some developers may prefer storing markup files and other resources in a separate folder rather than placing them side by side with Java classes. 
 
-mycss.css (in package my/company/res/css/):
-*CSS:*
-[source,java]
-----
-...
-body{
-��� background-image:url('../images/some.png');
-}
-...
-----
+To customize resource loading we can add further resource finders to our application in order to extend the resource-lookup algorithm to different locations. Wicket already comes with two other implementations of IResourceFinder designed to search for resources into a specific folder on the file system. The first is class _Path_ and it's defined in package _org.apache.wicket.util.file_. The constructor of this class takes in input an arbitrary folder that can be expressed as a string path or as an instance of Wicket utility class _Folder_ (in package _org.apache.wicket.util.file_). The second implementation of interface _IResourceFinder_ is class _WebApplicationPath_ which looks into a folder placed inside webapp's root path (but not inside folder WEB-INF).
 
-some.png (in package my/company/res/images/):
-<blob>
+Project CustomFolder4MarkupExample uses _WebApplicationPath_ to load the markup file and the resource bundle for its home page from a custom folder. The folder is called markupFolder and it is placed in the root path of the webapp. The following picture illustrates the file structure of the project:
 
-Output of mycss.css:
-*CSS:*
-[source,java]
-----
-...
-body{
-��� background-image:url('../images/some-ver-1425904170000.png');
-}
-...
-----
+image::../img/package-structure-custom-folder.png[]
 
-If you add a url which looks like this background-image:url('../images/some.png?embedBase64'); Wicket is going to embed the complete image as base64 string with its corresponding mime type into the css file. It looks like the following code block demonstrates.
+As we can see in the picture above, we must preserve the package structure also in the custom folder used as resource container. The code used inside application class to configure  WebApplicationPath is the following:
 
-Output of mycss.css:
-*CSS:*
 [source,java]
 ----
-...
-body{
-��� background-image: url(data:image/png;base64,R0lGODlh1wATAX....);
+@Override
+public void init()
+{
+	getResourceSettings().getResourceFinders().add(
+			new WebApplicationPath(getServletContext(), "markupFolder"));
 }
-...
 ----
 
+Method getResourceFinders() defined by setting class ResourceSettings returns the list of  resource finders defined in our application. The constructor of WebApplicationPath takes in input also an instance of standard interface javax.servlet.ServletContext which can be retrieved with WebApplication's method getServletContext().
+
+NOTE: By default, if resource files can not be found inside application classpath, Wicket will search for them inside \u201cresources\u201d folder. You may have noted this folder in the previous picture. It is placed next to the folder \u201cjava\u201d containing our source files:
+
+image::../img/package-structure-resource-folder.png[]
+
+This folder can be used to store resource files without writing any configuration code.
+

http://git-wip-us.apache.org/repos/asf/wicket/blob/bc7a60fd/wicket-user-guide/src/main/asciidoc/resources/resources_15.adoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/main/asciidoc/resources/resources_15.adoc b/wicket-user-guide/src/main/asciidoc/resources/resources_15.adoc
index 320890e..4b9c6c6 100644
--- a/wicket-user-guide/src/main/asciidoc/resources/resources_15.adoc
+++ b/wicket-user-guide/src/main/asciidoc/resources/resources_15.adoc
@@ -1,67 +1,76 @@
 
-The FileSystemResourceRenference comes along with the FileSystemResource, FileSystemResourceStreamReference and the FileSystemResourceStream. Those classes provide a simple way to handle resources with Java's NIO API in Wicket starting from JDK version 7.0. (Available since Wicket 7.2.0 / Wicket 8.0.0)
 
-Example: To include a resource which is zipped into a file and located in a specific folder in the file system you can simply write code like this:
 
-Java:
+Introduced in Wicket 6.20.0 / Wicket 7.0.0 there is a default way to be used in which the output of all CssHeaderItems / JavaScriptHeaderItems is modified before they are cached and delivered to the client. You can add a so called Compressor by receiving the resource settings and invoke 1.setJavaScriptCompressor(...) / 1.setJavaScriptCompressor(...). If you want to add several Compressors use _org.apache.wicket.resource.CompositeCssCompressor_ or _org.apache.wicket.resource.CompositeJavaScriptCompressor_
+
+*Java Code:*
 [source,java]
 ----
-URI uri = URI.create("jar:file:///videosFolder/videos.zip!/folderInZip/Video.mp4");
-Path path = FileSystemResourceReference.getPath(uri);
-FileSystemResourceReference ref = new FileSystemResourceReference("video",path);
-Video video = new Video("video",ref);
-add(vide);
+...
+��� public class WicketApplication extends WebApplication
+�� �{
+�� ��� �@Override
+�� ��� �public Class<? extends WebPage> getHomePage()
+�� ��� �{
+�� ��� ��� �return HomePage.class;
+�� ��� �}
+�� �
+�� ��� �@Override
+�� ��� �public void init()
+�� ��� �{
+�� ��� ��� �super.init();
+�� ��� ��� �getResourceSettings().setCssCompressor(new CssUrlReplacer());
+�� ��� �}
+�� �}
+...
 ----
 
-HTML:
+In the previous example you see that a _org.apache.wicket.resource.CssUrlReplacer_ is added which does not compress the content, but replaces all urls in CSS files and applies a Wicket representation for them by automatically wrapping them into PackageResourceReferences. Here is an example where you can see what Wicket does with the url representation.
+
+HomePage (in package my/company/):
+*Java Code:*
 [source,java]
 ----
-<video wicket:id="video"/>
+...
+response.render(CssReferenceHeaderItem.forReference(new PackageResourceReference(HomePage.class, "res/css/mycss.css")));
+...
 ----
 
-Using FileSystemResourceReference mounted:
-
-Java:
+mycss.css (in package my/company/res/css/):
+*CSS:*
 [source,java]
 ----
-mountResource("/filecontent/${name}", new FileSystemResourceReference("filesystem")
-{
-	private static final long serialVersionUID = 1L;
-
-	@Override
-	public IResource getResource()
-	{
-		return new FileSystemResource()
-		{
-			private static final long serialVersionUID = 1L;
-
-			protected ResourceResponse newResourceResponse(Attributes attributes)
-			{
-				try
-				{
-					String name = attributes.getParameters().get("name").toString("");
-					URI uri = URI.create(
-						"jar:file:////folder/example.zip!/zipfolder/" + name);
-					return createResourceResponse(
-						FileSystemResourceReference.getPath(uri));
-				}
-				catch (IOException | URISyntaxException e)
-				{
-					throw new WicketRuntimeException("Error while reading the file.", e);
-				}
-			};
-		};
-	}
-});
+...
+body{
+��� background-image:url('../images/some.png');
+}
+...
 ----
 
-FileSystemResourceReference.getPath(uri) uses a FileSystemPathService to setup a path the resource reference can work on. 
-
-So if you write a custom file system you can easily handle every path by adding a *org.apache.wicket.resource.FileSystemPathService* text file into *META-INF/services* and put in your implementation.
+some.png (in package my/company/res/images/):
+<blob>
 
-A reference implementation can be found in the java class org.apache.wicket.resource.FileSystemJarPathService.
+Output of mycss.css:
+*CSS:*
+[source,java]
+----
+...
+body{
+��� background-image:url('../images/some-ver-1425904170000.png');
+}
+...
+----
 
-Further FileSystemProviders and the corresponding FileSystems can be implemented as described here:
+If you add a url which looks like this background-image:url('../images/some.png?embedBase64'); Wicket is going to embed the complete image as base64 string with its corresponding mime type into the css file. It looks like the following code block demonstrates.
 
-http://docs.oracle.com/javase/7/docs/technotes/guides/io/fsp/filesystemprovider.html[http://docs.oracle.com/javase/7/docs/technotes/guides/io/fsp/filesystemprovider.html]
+Output of mycss.css:
+*CSS:*
+[source,java]
+----
+...
+body{
+��� background-image: url(data:image/png;base64,R0lGODlh1wATAX....);
+}
+...
+----
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/bc7a60fd/wicket-user-guide/src/main/asciidoc/resources/resources_16.adoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/main/asciidoc/resources/resources_16.adoc b/wicket-user-guide/src/main/asciidoc/resources/resources_16.adoc
index 1fc8173..320890e 100644
--- a/wicket-user-guide/src/main/asciidoc/resources/resources_16.adoc
+++ b/wicket-user-guide/src/main/asciidoc/resources/resources_16.adoc
@@ -1,23 +1,67 @@
 
-Another way to receive external image resources is to use the corresponding component with a model which contains the target URL. 
+The FileSystemResourceRenference comes along with the FileSystemResource, FileSystemResourceStreamReference and the FileSystemResourceStream. Those classes provide a simple way to handle resources with Java's NIO API in Wicket starting from JDK version 7.0. (Available since Wicket 7.2.0 / Wicket 8.0.0)
 
-The ExternalImage and ExternalSource components which are available since Wicket 7.2.0 / Wicket 8.0.0 fulfill that task.
-
-The following example demonstrates the usage of a CompoundPropertyModel with the model object  [ImageSrc] The model object, bound to surrounding component / page, contains an attribute named  [url] which is read by the component:
+Example: To include a resource which is zipped into a file and located in a specific folder in the file system you can simply write code like this:
 
 Java:
 [source,java]
 ----
-ImageSrc imageSrc = new ImageSrc();
-imageSrc.setUrl("http://www.google.de/test.jpg");
-setDefaultModel(new CompoundPropertyModel<>(imageSrc));
-add(new ExternalImage("url"));
+URI uri = URI.create("jar:file:///videosFolder/videos.zip!/folderInZip/Video.mp4");
+Path path = FileSystemResourceReference.getPath(uri);
+FileSystemResourceReference ref = new FileSystemResourceReference("video",path);
+Video video = new Video("video",ref);
+add(vide);
 ----
 
 HTML:
 [source,java]
 ----
-<img wicket:id="url" />
+<video wicket:id="video"/>
+----
+
+Using FileSystemResourceReference mounted:
+
+Java:
+[source,java]
+----
+mountResource("/filecontent/${name}", new FileSystemResourceReference("filesystem")
+{
+	private static final long serialVersionUID = 1L;
+
+	@Override
+	public IResource getResource()
+	{
+		return new FileSystemResource()
+		{
+			private static final long serialVersionUID = 1L;
+
+			protected ResourceResponse newResourceResponse(Attributes attributes)
+			{
+				try
+				{
+					String name = attributes.getParameters().get("name").toString("");
+					URI uri = URI.create(
+						"jar:file:////folder/example.zip!/zipfolder/" + name);
+					return createResourceResponse(
+						FileSystemResourceReference.getPath(uri));
+				}
+				catch (IOException | URISyntaxException e)
+				{
+					throw new WicketRuntimeException("Error while reading the file.", e);
+				}
+			};
+		};
+	}
+});
 ----
 
-The ExternalImage can also be constructed by passing in a Model (src) and Model of List (srcSet). For ExternalSource only the srcSet is available.
+FileSystemResourceReference.getPath(uri) uses a FileSystemPathService to setup a path the resource reference can work on. 
+
+So if you write a custom file system you can easily handle every path by adding a *org.apache.wicket.resource.FileSystemPathService* text file into *META-INF/services* and put in your implementation.
+
+A reference implementation can be found in the java class org.apache.wicket.resource.FileSystemJarPathService.
+
+Further FileSystemProviders and the corresponding FileSystems can be implemented as described here:
+
+http://docs.oracle.com/javase/7/docs/technotes/guides/io/fsp/filesystemprovider.html[http://docs.oracle.com/javase/7/docs/technotes/guides/io/fsp/filesystemprovider.html]
+

http://git-wip-us.apache.org/repos/asf/wicket/blob/bc7a60fd/wicket-user-guide/src/main/asciidoc/resources/resources_17.adoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/main/asciidoc/resources/resources_17.adoc b/wicket-user-guide/src/main/asciidoc/resources/resources_17.adoc
index 72c0dc3..1fc8173 100644
--- a/wicket-user-guide/src/main/asciidoc/resources/resources_17.adoc
+++ b/wicket-user-guide/src/main/asciidoc/resources/resources_17.adoc
@@ -1,8 +1,23 @@
 
+Another way to receive external image resources is to use the corresponding component with a model which contains the target URL. 
 
+The ExternalImage and ExternalSource components which are available since Wicket 7.2.0 / Wicket 8.0.0 fulfill that task.
 
-In this chapter we have learnt how to manage resources with the built-in mechanism provided by Wicket. With this mechanism we handle resources from Java code and Wicket will automatically take care of generating a valid URL for them. We have also seen how resources can be bundled as package resources with a component that depends on them to make it self-contained.
+The following example demonstrates the usage of a CompoundPropertyModel with the model object  [ImageSrc] The model object, bound to surrounding component / page, contains an attribute named  [url] which is read by the component:
 
-Then, in the second part of the chapter, we have built a custom resource and we have learnt how to mount it to an arbitrary URL and how to make it globally available as shared resource.
+Java:
+[source,java]
+----
+ImageSrc imageSrc = new ImageSrc();
+imageSrc.setUrl("http://www.google.de/test.jpg");
+setDefaultModel(new CompoundPropertyModel<>(imageSrc));
+add(new ExternalImage("url"));
+----
 
-Finally, in the last part of the paragraph we took a peek at the mechanism provided by the framework to customize the locations where the resource-lookup algorithm searches for resources. 
+HTML:
+[source,java]
+----
+<img wicket:id="url" />
+----
+
+The ExternalImage can also be constructed by passing in a Model (src) and Model of List (srcSet). For ExternalSource only the srcSet is available.

http://git-wip-us.apache.org/repos/asf/wicket/blob/bc7a60fd/wicket-user-guide/src/main/asciidoc/resources/resources_18.adoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/main/asciidoc/resources/resources_18.adoc b/wicket-user-guide/src/main/asciidoc/resources/resources_18.adoc
new file mode 100644
index 0000000..72c0dc3
--- /dev/null
+++ b/wicket-user-guide/src/main/asciidoc/resources/resources_18.adoc
@@ -0,0 +1,8 @@
+
+
+
+In this chapter we have learnt how to manage resources with the built-in mechanism provided by Wicket. With this mechanism we handle resources from Java code and Wicket will automatically take care of generating a valid URL for them. We have also seen how resources can be bundled as package resources with a component that depends on them to make it self-contained.
+
+Then, in the second part of the chapter, we have built a custom resource and we have learnt how to mount it to an arbitrary URL and how to make it globally available as shared resource.
+
+Finally, in the last part of the paragraph we took a peek at the mechanism provided by the framework to customize the locations where the resource-lookup algorithm searches for resources. 

http://git-wip-us.apache.org/repos/asf/wicket/blob/bc7a60fd/wicket-user-guide/src/main/asciidoc/single.adoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/main/asciidoc/single.adoc b/wicket-user-guide/src/main/asciidoc/single.adoc
index f7bc061..f01d53f 100644
--- a/wicket-user-guide/src/main/asciidoc/single.adoc
+++ b/wicket-user-guide/src/main/asciidoc/single.adoc
@@ -465,30 +465,34 @@ include::resources/resources_10.adoc[leveloffset=+1]
 
 include::resources/resources_11.adoc[leveloffset=+1]
 
-=== Shared resources
+=== Lambda support
 
 include::resources/resources_12.adoc[leveloffset=+1]
 
-=== Customizing resource loading
+=== Shared resources
 
 include::resources/resources_13.adoc[leveloffset=+1]
 
-=== CssHeaderItem and JavaScriptHeaderItem compression
+=== Customizing resource loading
 
 include::resources/resources_14.adoc[leveloffset=+1]
 
-=== NIO resources
+=== CssHeaderItem and JavaScriptHeaderItem compression
 
 include::resources/resources_15.adoc[leveloffset=+1]
 
-=== Resourcen derived through models
+=== NIO resources
 
 include::resources/resources_16.adoc[leveloffset=+1]
 
-=== Summary
+=== Resources derived through models
 
 include::resources/resources_17.adoc[leveloffset=+1]
 
+=== Summary
+
+include::resources/resources_18.adoc[leveloffset=+1]
+
 == An example of integration with JavaScript
 
 include::jsintegration.adoc[]