Repository: wicket Updated Branches: refs/heads/wicket-7.x 2e6713edd -> e0bfaf72f
Fix/improvements for documentation. Now the external URLs can be centralized into Config.groovy Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/e0bfaf72 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/e0bfaf72 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/e0bfaf72 Branch: refs/heads/wicket-7.x Commit: e0bfaf72f98989a3cc16132d0da3ea028bcccf60 Parents: 2e6713e Author: Andrea Del Bene <[email protected]> Authored: Fri Jun 17 13:14:02 2016 +0200 Committer: Andrea Del Bene <[email protected]> Committed: Fri Jun 17 13:18:01 2016 +0200 ---------------------------------------------------------------------- README | 2 +- wicket-user-guide/grails-app/conf/Config.groovy | 2 + wicket-user-guide/pom.xml | 13 +---- wicket-user-guide/scripts/_Events.groovy | 51 ++++++++++++++++++-- .../src/docs/guide/ajax/ajax_2.gdoc | 4 +- .../src/docs/guide/forms2/forms2_8.gdoc | 2 +- .../src/docs/guide/howToSource.gdoc | 2 +- .../src/docs/guide/introduction.gdoc | 2 +- .../src/docs/guide/repeaters/repeaters_4.gdoc | 2 +- 9 files changed, 58 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/e0bfaf72/README ---------------------------------------------------------------------- diff --git a/README b/README index 74a44db..11c0ccd 100644 --- a/README +++ b/README @@ -127,7 +127,7 @@ Getting started The Wicket project has several resources and projects where you can learn from, and get started quickly: - - The Wicket user guide - http://wicket.apache.org/start/userguide.html: + - The Wicket user guide - https://ci.apache.org/projects/wicket/guide/7.x: learn Wicket from scratch reading its userguide which gradually introduces you to the various features of the framework with http://git-wip-us.apache.org/repos/asf/wicket/blob/e0bfaf72/wicket-user-guide/grails-app/conf/Config.groovy ---------------------------------------------------------------------- diff --git a/wicket-user-guide/grails-app/conf/Config.groovy b/wicket-user-guide/grails-app/conf/Config.groovy index 7190c2d..a1ae40f 100644 --- a/wicket-user-guide/grails-app/conf/Config.groovy +++ b/wicket-user-guide/grails-app/conf/Config.groovy @@ -95,6 +95,8 @@ def basePath = System.properties['base.dir'] grails.doc.title = "Apache Wicket User Guide" grails.doc.version = "7.x" +wicket.examples.url = "http://examples7x.wicket.apache.org" +wicket.tutorial.examples.url = "http://examples-wickettutorial.rhcloud.com" grails.doc.subtitle = "Free Online Guide for Apache Wicket framework" grails.doc.authors = "Andrea Del Bene, Martin Grigorov, Carsten Hufe, Christian Kroemer, Daniel Bartl, Paul BorÈ, Tobias Soloschenko, Igor Vaynberg , Joachim Rohde" grails.doc.images = new File("${basePath}/src/docs/img") http://git-wip-us.apache.org/repos/asf/wicket/blob/e0bfaf72/wicket-user-guide/pom.xml ---------------------------------------------------------------------- diff --git a/wicket-user-guide/pom.xml b/wicket-user-guide/pom.xml index 97fe0da..eaa2867 100644 --- a/wicket-user-guide/pom.xml +++ b/wicket-user-guide/pom.xml @@ -183,18 +183,7 @@ <grailsVersion>${grails.version}</grailsVersion> </configuration> <executions> - <!-- HTML guide --> - <execution> - <id>doc</id> - <phase>package</phase> - <goals> - <goal>exec</goal> - </goals> - <configuration> - <command>doc</command> - </configuration> - </execution> - <!-- PDF guide --> + <!-- HTML & PDF guide --> <execution> <id>pdf</id> <phase>package</phase> http://git-wip-us.apache.org/repos/asf/wicket/blob/e0bfaf72/wicket-user-guide/scripts/_Events.groovy ---------------------------------------------------------------------- diff --git a/wicket-user-guide/scripts/_Events.groovy b/wicket-user-guide/scripts/_Events.groovy index fddcd7b..34fa4f6 100644 --- a/wicket-user-guide/scripts/_Events.groovy +++ b/wicket-user-guide/scripts/_Events.groovy @@ -1,10 +1,55 @@ +import grails.util.Holders + eventDocStart = { kind -> println "Started $kind" + + if (kind == "refdocs") { + //the purpose of this custom macro is to centralize external URLs + //into Config.groovy Usage: + //{externalink:urlPropertyId@additional/path} + //If no content is provide the generated URL is used in its place. + + org.radeox.macro.MacroLoader.newInstance().add( + org.radeox.macro.MacroRepository.instance, + new org.radeox.macro.Preserved() { + + @Override + String getName() { + 'externalink' + } + + @Override + void setInitialContext(org.radeox.api.engine.context.InitialRenderContext context) { + super.setInitialContext(context) + } + + @Override + void execute(Writer writer, org.radeox.macro.parameter.MacroParameter params) { + def content = params.content + def tagValue = params.get("0") + def tagSplitted = tagValue.split("@") + def propertyId = tagSplitted[0] + def urlSegments = tagSplitted.length > 1 ? tagSplitted[1] : '' + def baseUrl = Holders.config.flatten().get(propertyId) + + if (content == null) { + content = baseUrl + "/" + urlSegments + } + + writer << "<span class=\"nobr\">" + writer << "<a href=\"" + writer << baseUrl + "/" + urlSegments + writer << "\" target=\"blank\">" + writer << content + writer << "</a></span>" + } + }) + + println "macro externalink added" + } } eventDocEnd = { kind -> println "Completed $kind" - /*new File("../img").eachFile() { file -> - println file.getName() - }*/ } + http://git-wip-us.apache.org/repos/asf/wicket/blob/e0bfaf72/wicket-user-guide/src/docs/guide/ajax/ajax_2.gdoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/docs/guide/ajax/ajax_2.gdoc b/wicket-user-guide/src/docs/guide/ajax/ajax_2.gdoc index 99f56e9..27ad749 100644 --- a/wicket-user-guide/src/docs/guide/ajax/ajax_2.gdoc +++ b/wicket-user-guide/src/docs/guide/ajax/ajax_2.gdoc @@ -35,7 +35,7 @@ Base component AjaxEditableLabel exposes the following set of AJAX-aware methods * *onError(AjaxRequestTarget target)*: called when the new inserted input has failed validation. * *onCancel(AjaxRequestTarget target)*: called when user has exited from editing mode pressing escape key. The default implementation brings back the label to its initial state hiding the editor component. -Wicket module wicket-examples contains page class @EditableLabelPage.java@ which shows all these three components together. You can see this page in action at "http://www.wicket-library.com/wicket-examples-6.0.x/ajax/editable-label":http://www.wicket-library.com/wicket-examples-6.0.x/ajax/editable-label : +Wicket module wicket-examples contains page class @EditableLabelPage.java@ which shows all these three components together. You can see this page in action at {externalink:wicket.examples.url@ajax/editable-label}: !edit-label-example-screenshot.png! @@ -69,7 +69,7 @@ AutoCompleteTextField field = new AutoCompleteTextField<T>("field", model) { }; {code} -Wicket module wicket-examples contains page class @AutoCompletePagePage.java@ which shows an example of autocomplete text field. The running example is available at "http://www.wicket-library.com/wicket-examples-6.0.x/ajax/autocomplete":http://www.wicket-library.com/wicket-examples-6.0.x/ajax/autocomplete . +Wicket module wicket-examples contains page class @AutoCompletePagePage.java@ which shows an example of autocomplete text field. The running example is available at {externalink:wicket.examples.url@ajax/autocomplete} . h3. Modal window http://git-wip-us.apache.org/repos/asf/wicket/blob/e0bfaf72/wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc b/wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc index 9543c29..8d9cc20 100644 --- a/wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc +++ b/wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc @@ -78,4 +78,4 @@ public void init() h3. Upload multiple files If we need to upload multiple files at once and our clients support HTML5, we can still use FileUploadField adding attribute "multiple" to its tag. If we can not rely on HTML5, we can use the MultiFileUploadField component which allows the user to upload an arbitrary number of files using a JavaScript-based solution. -An example showing how to use this component can be found in Wicket module wicket-examples in file MultiUploadPage.java. The live example is hosted at "http://www.wicket-library.com/wicket-examples-6.0.x/upload/multi":http://www.wicket-library.com/wicket-examples-6.0.x/upload/multi . +An example showing how to use this component can be found in Wicket module wicket-examples in file MultiUploadPage.java. The live example is hosted at {externalink:wicket.examples.url@upload/multi} . http://git-wip-us.apache.org/repos/asf/wicket/blob/e0bfaf72/wicket-user-guide/src/docs/guide/howToSource.gdoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/docs/guide/howToSource.gdoc b/wicket-user-guide/src/docs/guide/howToSource.gdoc index 8d5db51..99004aa 100644 --- a/wicket-user-guide/src/docs/guide/howToSource.gdoc +++ b/wicket-user-guide/src/docs/guide/howToSource.gdoc @@ -1,4 +1,4 @@ -Most of the code you will find in this document is available as a "Git repository":https://github.com/bitstorm/Wicket-tutorial-examples and is licensed under the ASF 2.0. To get a local copy of the repository you can run the clone command from shell: +Most of the code you will find in this document is available as a "Git repository":https://github.com/bitstorm/Wicket-tutorial-examples and is licensed under the ASF 2.0. Examples are hosted live at {externalink:wicket.tutorial.examples.url}. To get a local copy of the repository you can run the clone command from shell: {code} git clone https://github.com/bitstorm/Wicket-tutorial-examples.git http://git-wip-us.apache.org/repos/asf/wicket/blob/e0bfaf72/wicket-user-guide/src/docs/guide/introduction.gdoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/docs/guide/introduction.gdoc b/wicket-user-guide/src/docs/guide/introduction.gdoc index 28badd5..43ea7dd 100644 --- a/wicket-user-guide/src/docs/guide/introduction.gdoc +++ b/wicket-user-guide/src/docs/guide/introduction.gdoc @@ -1,7 +1,7 @@ Wicket has been around since 2004 and it has been an Apache project since 2007. During these years it has proved to be a solid and valuable solution for building enterprise web applications. Wicket core developers have done a wonderful job with this framework and they continue to improve it release after release. -However Wicket never provided a freely available documentation and even if you can find on Internet many live examples and many technical articles on it (most of them at "Wicket Library":http://www.wicket-library.com/ and at "Wicket in Action":http://wicketinaction.com ), the lack of an organized and freely available documentation has always been a sore point for this framework. +However Wicket never provided a freely available documentation and even if you can find on Internet many live examples and many technical articles on it (most of them at {externalink:wicket.examples.url}Wicket Examples Site{externalink} and at "Wicket in Action":http://wicketinaction.com ), the lack of an organized and freely available documentation has always been a sore point for this framework. That's quite an issue because many other popular frameworks (like Spring, Hibernate or Struts) offer a vast and very good documentation which substantially contributed to their success. http://git-wip-us.apache.org/repos/asf/wicket/blob/e0bfaf72/wicket-user-guide/src/docs/guide/repeaters/repeaters_4.gdoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/docs/guide/repeaters/repeaters_4.gdoc b/wicket-user-guide/src/docs/guide/repeaters/repeaters_4.gdoc index 9424115..946ea09 100644 --- a/wicket-user-guide/src/docs/guide/repeaters/repeaters_4.gdoc +++ b/wicket-user-guide/src/docs/guide/repeaters/repeaters_4.gdoc @@ -105,7 +105,7 @@ public HomePage(final PageParameters parameters) { The data of a single country (ISO code, name, long name, capital and population) are handled with an array of strings. The usage of PagingNavigator is quite straightforward as we need to simply pass the pageable repeater to its constructor. -To explore the other pageable repeaters shipped with Wicket you can visit the page at "http://www.wicket-library.com/wicket-examples/repeater/":http://www.wicket-library.com/wicket-examples/repeater/ where you can find live examples of these components. +To explore the other pageable repeaters shipped with Wicket you can visit the page at {externalink:wicket.examples.url@repeater} where you can find live examples of these components. {note} Wicket provides also component PageableListView which is a sublcass of ListView that implements interface IPageable, hence it can be considered a pageable repeater even if it doesn't use interface IDataProvider as data source.
