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 2014/03/30 19:25:47 UTC

svn commit: r1583162 [4/4] - in /wicket/common/site/trunk/_site/guide: ./ gapi/ gapi/DefaultPackage/ gapi/spring/ guide/ guide/pages/ guide/src/docs/guide/ guide/src/docs/guide/resources/

Modified: wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_7.gdoc
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_7.gdoc?rev=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_7.gdoc (original)
+++ wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_7.gdoc Sun Mar 30 17:25:43 2014
@@ -1,12 +1,12 @@
-Some web developers prefer to put their <script> tags at the end of page body instead of inside the <header> tags:
+Some web developers prefer to put their <script> tags at the end of page body instead of inside the <head> tags:
 
 {code:html}
 
 <html>
 
-<header>
+<head>
 //no <script> tag here...
-</header>
+</head>
 
 <body>
 ...

Modified: wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_8.gdoc
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_8.gdoc?rev=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_8.gdoc (original)
+++ wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_8.gdoc Sun Mar 30 17:25:43 2014
@@ -1,48 +1,15 @@
+Starting from version 6.15.0 we can specify where header contributors must be rendered inside <head> tag using the placeholder tag @<wicket:header-items/>@: 
 
-
-In Wicket the best way to add dynamic functionalities to our application (such as csv export, a pdf generated on the fly, etc...) is implementing a custom resource. In this paragraph as example of custom resource we will build a basic RSS feeds generator which can be used to publish feeds on our site (project CustomResourceMounting). Instead of generating a RSS feed by hand we will use Rome framework and its utility classes. 
-
-As hinted above in paragraph 13.1, class @AbstractResource@ can be used as base class to implement new resources. This class defines abstract method @newResourceResponse@ which is invoked when the resource is requested. The following is the code of our RSS feeds generator:
-
-{code}
-public class RSSProducerResource extends AbstractResource {
-
-  @Override
-  protected ResourceResponse newResourceResponse(Attributes attributes) {
-    ResourceResponse resourceResponse = new ResourceResponse();
-    resourceResponse.setContentType("text/xml");
-    resourceResponse.setTextEncoding("utf-8");
-    
-    resourceResponse.setWriteCallback(new WriteCallback()
-    {
-      @Override
-      public void writeData(Attributes attributes) throws IOException
-      {
-        OutputStream outputStream = attributes.getResponse().getOutputStream();
-        Writer writer = new OutputStreamWriter(outputStream);
-        SyndFeedOutput output = new SyndFeedOutput();
-            try {
-          output.output(getFeed(), writer);
-        } catch (FeedException e) {
-          throw new WicketRuntimeException("Problems writing feed to response...");
-        }
-      }      
-    });
-    
-    return resourceResponse;
-  }
-  // method getFeed()...
-}
+{code:html}
+<head>
+  <meta chartset="UTF-8"/>
+  <wicket:header-items/>
+  <script src="my-monkey-patch-of-wicket-ajax.js"></script>
+</head>
 {code}
 
-Method @newResourceResponse@ returns an instance of @ResourceResponse@ representing the response generated by the custom resource. Since RSS feeds are based on XML, in the code above we have set the type of the response to text/xml and the text encoding to utf-8.
+With the code above all header contributions done by using IHeaderResponse in your Java code or the special @<wicket:head>@ tag will be put between the <meta> and <script> elements, i.e. in the place of @<wicket:header-items/>@.
 
-To specify the content that will be returned by our resource we must also provide an implementation of inner class @WriteCallback@ which is responsible for writing content data to response's output stream. In our project we used class SyndFeedOutput from Rome framework to write our feed to response. Method @getFeed()@ is just an utility method that generates a sample RSS feed (which is an instance of interface @com.sun.syndication.feed.synd.SyndFeed@).
-
-Now that we have our custom resource in place, we can use it in the home page of the project. The easiest way to make a resource available to users is to expose it with link component @ResourceLink@: 
-
-{code}
-add(new ResourceLink("rssLink", new RSSProducerResource()));
-{code}
+This way you can make sure that some header item is always before or after the header items managed by Wicket.
 
-In the next paragraphs we will see how to register a resource at application-level and how to mount it to an arbitrary URL.
\ No newline at end of file
+@<wicket:header-items/>@ can be used only in the page's <head> element and there could be at most one instance of it.

Modified: wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_9.gdoc
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_9.gdoc?rev=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_9.gdoc (original)
+++ wicket/common/site/trunk/_site/guide/guide/src/docs/guide/resources/resources_9.gdoc Sun Mar 30 17:25:43 2014
@@ -1,37 +1,17 @@
 
 
-Just like pages also resources can be mounted to a specific path. Class @WebApplication@ provides method @mountResource@ which is almost identical to @mountPage@ seen in paragraph 8.6.1:
+Starting from version 6.15.0 we can specify where header contributors must be rendered inside <head> tag using the placeholder tag @<wicket:header-items/>@: 
 
-{code}
-@Override
-public void init() {
-  super.init();
-  //resource mounted to path /foo/bar
-  ResourceReference resourceReference = new ResourceReference("rssProducer"){
-     RSSReaderResource rssResource = new RSSReaderResource();
-     @Override
-     public IResource getResource() {
-	return rssResource;
-  }};
-  mountResource("/foo/bar", resourceReference);
-}
+{code:html}
+<head>
+  <meta chartset="UTF-8"/>
+  <wicket:header-items/>
+  <script src="my-monkey-patch-of-wicket-ajax.js"></script>
+</head>
 {code}
 
-With the configuration above (taken from project @CustomResourceMounting@) every request to /foo/bar will be served by the custom resource built in the previous paragraph. 
+With the code above all header contributions done by using IHeaderResponse in your Java code or the special @<wicket:head>@ tag will be put between the <meta> and <script> elements, i.e. in the place of @<wicket:header-items/>@.
 
-Parameter placeholders are supported as well:
+This way you can make sure that some header item is always before or after the header items managed by Wicket.
 
-{code}
-@Override
-public void init() {
-  super.init();
-  //resource mounted to path /foo with a required indexed parameter
-  ResourceReference resourceReference = new ResourceReference("rssProducer"){
-     RSSReaderResource rssResource = new RSSReaderResource();
-     @Override
-     public IResource getResource() {
-	return rssResource;
-  }};
-  mountResource("/bar/${baz}", resourceReference);
-}
-{code}
\ No newline at end of file
+@<wicket:header-items/>@ can be used only in the page's <head> element and there could be at most one instance of it.
\ No newline at end of file

Modified: wicket/common/site/trunk/_site/guide/guide/src/docs/guide/toc.yml
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/guide/src/docs/guide/toc.yml?rev=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/src/docs/guide/toc.yml (original)
+++ wicket/common/site/trunk/_site/guide/guide/src/docs/guide/toc.yml Sun Mar 30 17:25:43 2014
@@ -114,11 +114,12 @@ resources:
   resources_5: Resource dependencies
   resources_6: Aggregate multiple risources with resource bundles
   resources_7: Put JavaScript inside page body
-  resources_8: Custom resources
-  resources_9: Mounting resources
-  resources_10: Shared resources
-  resources_11: Customizing resource loading
-  resources_12: Summary
+  resources_8: Header contributors positioning
+  resources_9: Custom resources
+  resources_10: Mounting resources
+  resources_11: Shared resources
+  resources_12: Customizing resource loading
+  resources_13: Summary
 jsintegration:
   title: An example of integration with JavaScript
   jsintegration_1: What we want to do...

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=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/testing.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/testing.html Sun Mar 30 17:25:43 2014
@@ -427,7 +427,7 @@ formTester.submit(<span class="java&#45;
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-30)</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=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/testingspring.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/testingspring.html Sun Mar 30 17:25:43 2014
@@ -321,7 +321,7 @@ Since the development of many web applic
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-30)</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=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/urls.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/urls.html Sun Mar 30 17:25:43 2014
@@ -366,7 +366,7 @@ setResponsePage(MountedPageWithPlacehold
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-30)</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=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/versioningCaching.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/versioningCaching.html Sun Mar 30 17:25:43 2014
@@ -291,7 +291,7 @@ Page '&#60;page class&#62;' is not state
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-30)</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=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/whyLearn.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/whyLearn.html Sun Mar 30 17:25:43 2014
@@ -244,7 +244,7 @@ Wicket is not the only component oriente
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-30)</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=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/guide/wicketstuff.html (original)
+++ wicket/common/site/trunk/_site/guide/guide/wicketstuff.html Sun Mar 30 17:25:43 2014
@@ -321,7 +321,7 @@ To write/read objects to response/from r
 <div id="footer">
     
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-30)</b>
 
     
 </div>

Modified: wicket/common/site/trunk/_site/guide/index.html
URL: http://svn.apache.org/viewvc/wicket/common/site/trunk/_site/guide/index.html?rev=1583162&r1=1583161&r2=1583162&view=diff
==============================================================================
--- wicket/common/site/trunk/_site/guide/index.html (original)
+++ wicket/common/site/trunk/_site/guide/index.html Sun Mar 30 17:25:43 2014
@@ -320,15 +320,17 @@ function addJsClass(el) {
                             
                             <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_7"><strong>15.7</strong><span>Put JavaScript inside page body</span></a></div>
                             
-                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_8"><strong>15.8</strong><span>Custom resources</span></a></div>
+                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_8"><strong>15.8</strong><span>Header contributors positioning</span></a></div>
                             
-                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_9"><strong>15.9</strong><span>Mounting resources</span></a></div>
+                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_9"><strong>15.9</strong><span>Custom resources</span></a></div>
                             
-                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_10"><strong>15.10</strong><span>Shared resources</span></a></div>
+                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_10"><strong>15.10</strong><span>Mounting resources</span></a></div>
                             
-                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_11"><strong>15.11</strong><span>Customizing resource loading</span></a></div>
+                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_11"><strong>15.11</strong><span>Shared resources</span></a></div>
                             
-                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_12"><strong>15.12</strong><span>Summary</span></a></div>
+                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_12"><strong>15.12</strong><span>Customizing resource loading</span></a></div>
+                            
+                            <div class="toc-item" style="margin-left:10px"><a href="./guide/resources.html#resources_13"><strong>15.13</strong><span>Summary</span></a></div>
                             
                             <div class="toc-item" style="margin-left:0px"><a href="./guide/jsintegration.html"><strong>16</strong><span>An example of integration with JavaScript</span></a></div>
                             
@@ -505,7 +507,7 @@ function addJsClass(el) {
         <div id="footer">
             
 Copyright &copy; 2013-2014 — <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a> 
-                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-05)</b>
+                      — <b style="color:#E8590A !important;">(Generated on: 2014-03-30)</b>
 
             
         </div>