Skip to content

Commit

Permalink
Fix/improvements for documentation. Now the external URLs can be cent…
Browse files Browse the repository at this point in the history
…ralized into Config.groovy
  • Loading branch information
bitstorm committed Jun 17, 2016
1 parent 24c3a72 commit fc87a84
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -126,7 +126,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/8.x:

learn Wicket from scratch reading its userguide which gradually
introduces you to the various features of the framework with
Expand Down
2 changes: 2 additions & 0 deletions wicket-user-guide/grails-app/conf/Config.groovy
Expand Up @@ -95,6 +95,8 @@ def basePath = System.properties['base.dir']

grails.doc.title = "Apache Wicket User Guide"
grails.doc.version = "8.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")
Expand Down
13 changes: 1 addition & 12 deletions wicket-user-guide/pom.xml
Expand Up @@ -184,18 +184,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>
Expand Down
51 changes: 48 additions & 3 deletions 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()
}*/
}

4 changes: 2 additions & 2 deletions wicket-user-guide/src/docs/guide/ajax/ajax_2.gdoc
Expand Up @@ -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!

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc
Expand Up @@ -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} .
2 changes: 1 addition & 1 deletion 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
Expand Down
2 changes: 1 addition & 1 deletion 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.

Expand Down
Expand Up @@ -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.
Expand Down

0 comments on commit fc87a84

Please sign in to comment.