Skip to content
This repository
Browse code

Initial commit of the click version for the books interface.

This version used v2.2.0 of click as the web framework.

The added JOURNAL text file contains my thoughts and updates that have been made to this project.
  • Loading branch information...
commit d90a083ee0455cb71c1e9be1ec507efaef855830 1 parent 23c4fb6
ccorsi authored

Showing 21 changed files with 1,168 additions and 0 deletions. Show diff stats Hide diff stats

  1. 18  persistence/books/web/click/.classpath
  2. 39  persistence/books/web/click/.project
  3. 127  persistence/books/web/click/JOURNAL
  4. 3  persistence/books/web/click/WebContent/META-INF/MANIFEST.MF
  5. 48  persistence/books/web/click/WebContent/WEB-INF/click.xml
  6. BIN  persistence/books/web/click/WebContent/WEB-INF/lib/click-2.2.0.jar
  7. BIN  persistence/books/web/click/WebContent/WEB-INF/lib/click-extras-2.2.0.jar
  8. 20  persistence/books/web/click/WebContent/WEB-INF/web.xml
  9. 11  persistence/books/web/click/WebContent/book.htm
  10. 26  persistence/books/web/click/WebContent/home.htm
  11. 11  persistence/books/web/click/WebContent/redirect.html
  12. 31  persistence/books/web/click/WebContent/style.css
  13. 22  persistence/books/web/click/WebContent/welcome.html
  14. 182  persistence/books/web/click/src/org/books/control/BookManagerControl.java
  15. 61  persistence/books/web/click/src/org/books/control/BookSelect.java
  16. 70  persistence/books/web/click/src/org/books/page/BookPage.java
  17. 39  persistence/books/web/click/src/org/books/page/GenderPage.java
  18. 248  persistence/books/web/click/src/org/books/page/HomePage.java
  19. 39  persistence/books/web/click/src/org/books/page/PersonPage.java
  20. 93  persistence/books/web/click/src/org/books/page/WelcomePage.java
  21. 80  persistence/books/web/click/src/org/books/service/BooksConfigService.java
18  persistence/books/web/click/.classpath
... ...
@@ -0,0 +1,18 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<classpath>
  3
+	<classpathentry kind="src" path="src"/>
  4
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/18">
  5
+		<attributes>
  6
+			<attribute name="owner.project.facets" value="jst.java"/>
  7
+		</attributes>
  8
+	</classpathentry>
  9
+	<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0">
  10
+		<attributes>
  11
+			<attribute name="owner.project.facets" value="jst.web"/>
  12
+		</attributes>
  13
+	</classpathentry>
  14
+	<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
  15
+	<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
  16
+	<classpathentry combineaccessrules="false" kind="src" path="/BooksPersistenceBase"/>
  17
+	<classpathentry kind="output" path="build/classes"/>
  18
+</classpath>
39  persistence/books/web/click/.project
... ...
@@ -0,0 +1,39 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<projectDescription>
  3
+	<name>BooksClick</name>
  4
+	<comment></comment>
  5
+	<projects>
  6
+		<project>BooksXML</project>
  7
+		<project>BooksPersistenceBase</project>
  8
+		<project>BooksCommonWeb</project>
  9
+	</projects>
  10
+	<buildSpec>
  11
+		<buildCommand>
  12
+			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
  13
+			<arguments>
  14
+			</arguments>
  15
+		</buildCommand>
  16
+		<buildCommand>
  17
+			<name>org.eclipse.jdt.core.javabuilder</name>
  18
+			<arguments>
  19
+			</arguments>
  20
+		</buildCommand>
  21
+		<buildCommand>
  22
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
  23
+			<arguments>
  24
+			</arguments>
  25
+		</buildCommand>
  26
+		<buildCommand>
  27
+			<name>org.eclipse.wst.validation.validationbuilder</name>
  28
+			<arguments>
  29
+			</arguments>
  30
+		</buildCommand>
  31
+	</buildSpec>
  32
+	<natures>
  33
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
  34
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
  35
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
  36
+		<nature>org.eclipse.jdt.core.javanature</nature>
  37
+		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
  38
+	</natures>
  39
+</projectDescription>
127  persistence/books/web/click/JOURNAL
... ...
@@ -0,0 +1,127 @@
  1
+
  2
+This file will contain my thoughts on changes that I make during the process of building a web application
  3
+using the Click web framework for the Books persistent layer.
  4
+
  5
+2010-09-17:
  6
+===========
  7
+
  8
+Created a dynamic web project that will be using the Apache Click web framework.  
  9
+
  10
+The Eclipse IDE plugin for Click 2.2.0 has as of this date not been released.  There is a version for the
  11
+Click 2.1.0 release but that is not what I using.  By forcing me to look at how to configure click.xml and
  12
+web.xml files.  It provides will a unique advantage of understanding better how these configuration files are
  13
+setup and why that are setup this way.
  14
+
  15
+After initially creating the click.xml file, I read the Apache Click User Guide.  Click uses Velocity as a
  16
+expression engine but it does not force a developer to use Velocity and is configurable within the click.xml
  17
+configuration file.
  18
+
  19
+The first step that I needed to do was to configure the web.xml to be able to use the Click framework.  The
  20
+required that I set the servlet and servlet-mapping elements.  The servlet element servlet-class child element
  21
+to org.apache.click.ClickServlet.  The servlet-mapping then just references the servlet element while processing
  22
+requests. 
  23
+
  24
+Click has the concept of a page.  The page concept is realized by having a developer sub-classes the Page class.  
  25
+The developer then needs to associate this Page class to a path that the ClickServlet will map when processing
  26
+requests.  The initialize page classes that I created where different for each of the different actions that
  27
+are required for the web container.  The initial configuration resulted in differnt page instances for the
  28
+different Persons, (Author, Editor, Illustrator and Translator), and the different actions, (New and Edit). The
  29
+generated a total of 12 different Page sub-classes for the processing of the books persistent layer.  This does
  30
+not include the initial welcoming page.
  31
+
  32
+Upon more consideration, it seems that I can use a single Book, Person and Gender page to perform the same 
  33
+number of processing that did my initial implementation.  Going from 12 classes to 3 makes my life much 
  34
+easier thank you.  This only needs to be implemented and tested before considering this option a success.
  35
+
  36
+The next issue that I needed to resolve is the concept of initialize and shutdown process of the underlying book 
  37
+persistent layer during the web container init and destroy callbacks.  My initial understanding was that I needed
  38
+to create a Control instance that is associated with the click framework.  Upon further investigation, this 
  39
+controled onInit and onDestroy methods are not called during the ClickServlet init and destroy callbacks but 
  40
+during every instantiated Page instance.  This would not do since the initialization and shutdown process can
  41
+cause inconsistency of data because of the concurrent processing of servlet requests.
  42
+
  43
+After further investigation, it became apparent that a class that implements the ConfigService interface will
  44
+be called during the ClickServlet init and destroy callbacks.  There is a default implementation, XmlConfigService, 
  45
+that I sub-classes so that I do not need to worry about being without some features that are provided by this
  46
+implementation.  To be able to associate this ConfigService implementation within the Click framework. I needed
  47
+to update the web.xml by adding the following:
  48
+
  49
+  <context-param>
  50
+  	<param-name>config-service-class</param-name>
  51
+  	<param-value>org.books.service.BooksConfigService</param-value>
  52
+  </context-param>
  53
+
  54
+The ClickServlet will look for the config-service-class and use the associated class name for the container else
  55
+it will default to the XmlConfigService class.
  56
+
  57
+Finally, I copied most of the no-ZK specific classes from the BooksZK project to the book click project.  It becomes
  58
+apparent that these classes should be moved into a books common web project that is then referenced by the BooksZK
  59
+and BooksClick projects.
  60
+
  61
+2010-09-18:
  62
+===========
  63
+
  64
+While trying to add logging statements within the different Click specific implementations.  I noticed that the
  65
+ServletContext associated to the ConfigService class was not initialized during the onInit callback but that it 
  66
+was initialized during the onDestroy callback.  When I have time, I will try to determine why this is the case.
  67
+It could be possible that this is a click or tomcat bug.  The logging mechanism should already be enabled during
  68
+this callback.
  69
+
  70
+2010-09-19:
  71
+===========
  72
+
  73
+I started to look at the way that you can create a web page using click.  My objective is to try
  74
+and recreate what I've produced using the ZK framework.  My initial impression is that this is not
  75
+going to be a simple task since both frameworks are different.  The ZK framework provides you with
  76
+expression language that contains many features that in click I need to develop.  My lack of HTML
  77
+experience makes this option a little more difficult to create.  This has lead me to read up on
  78
+HTML different features.  Using the www.w3schools.com website has offered me more insight into
  79
+what I am trying to accomplish.  At the end of the day, the initial web page will not finished
  80
+today.  I was able to see how to define a form using click but I still need to enhance it to be 
  81
+able to submit the select book to edit.
  82
+
  83
+2010-09-20:
  84
+===========
  85
+
  86
+In the process of trying to create a simple table with a hypelink to the book that a user would
  87
+like to edit, I noticed a few things that required my changes.  Some of these hacks can be
  88
+wrong but at this time that is what I was able to do to get my page up and running.  I hope to
  89
+correct this hack and replace it with the correct approach to generate a table to contains page
  90
+link.
  91
+
  92
+My initial attempt to create a selectable list has been replaced with my original idea of creating
  93
+a table with a link to the page that you can click to update/edit the selected book.  I was 
  94
+trying to determine how to add a link to the table.  I initially tried to create my link using
  95
+the ActionLink object but everytime that the table was rendered.  The a tag < and > delimiters 
  96
+were replaced with &lt; and &gt;.  After looking through the documentation and code I noticed
  97
+that you need to create my own Decorator for the column that will contain the link within the
  98
+table object.
  99
+
  100
+That current solution was partly resolving the issue but alas one more problem was still 
  101
+appearing.  This is the case that the link in the link was not correct.  It was correctly
  102
+defining the root of the web application as BooksClick but it was not correctly defining the
  103
+book page.  Initially, it was setting this to "null" instead of /book.htm.  
  104
+
  105
+Further digging resulted in my finding that the BooksConfigService class which sub-classes the 
  106
+XmlConfigService class.  The ConfigService instance is used by the table rendering process to
  107
+determine the path of the passed Page, (BookPage), but this would return a null path which is
  108
+wrong.  I tried to determine how to get it to return the correct mapping but alas I was not 
  109
+able at this time.  I then went and implemented the getPagePath method to return the correct
  110
+path for the BookPage class.  This produces the expected generated web page but I still need
  111
+to test this for completeness.  Ultimately, I need to replace this hack with something more
  112
+implicit.  Maybe, I need to update my click.xml configuration file to map the different page
  113
+classes to their respective template page.  After making those changes to the click.xml 
  114
+configuration file.  I tested this and hold and behold that it did work.  I needed to create
  115
+a page element for each of my Page classes.  Upon doing this, I was able to comment out the
  116
+getPagePath method from the BooksConfigService class and it worked!  The terrible hack has 
  117
+been remove which is good.
  118
+
  119
+I've completed the initial book page but currently it only displays information about the 
  120
+type of book page we are displaying, a new or edit book page.  The home page needs to updating
  121
+such that it will contain the ability to create a new book and edit a new book.  The BookPage
  122
+instane will then be used to populate both types of requests depending on the parameters passed
  123
+to the BookPage.  The parameter "action" will determine the type of page.  The paramerer "bookId"
  124
+will be defined a request to edit a book.  This will contain the identification of the book that
  125
+we are going to be updating.
  126
+
  127
+  
3  persistence/books/web/click/WebContent/META-INF/MANIFEST.MF
... ...
@@ -0,0 +1,3 @@
  1
+Manifest-Version: 1.0
  2
+Class-Path: 
  3
+
48  persistence/books/web/click/WebContent/WEB-INF/click.xml
... ...
@@ -0,0 +1,48 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+
  3
+<!DOCTYPE click-app PUBLIC 
  4
+	"-//Apache Software Foundation//DTD Click Configuration 2.2//EN" 
  5
+	"http://click.apache.org/dtds/click-2.2.dtd">
  6
+
  7
+<click-app charset="UTF-8" locale="en">
  8
+
  9
+	<!-- Specify the Java package where Page classes can be found--><!--
  10
+	<pages package="org.books.page" autobinding="annotation">
  11
+		<page classname="HomePage" path="welcome-page.html" />
  12
+		<page classname="BookPage" path="create_book.html" />
  13
+		<page classname="BookPage" path="edit_book.html" />
  14
+		<page classname="PersonPage" path="create_author.html" />
  15
+		<page classname="PersonPage" path="create_editor.html" />
  16
+		<page classname="PersonPage" path="create_illustrator.html" />
  17
+		<page classname="PersonPage" path="create_translator.html" />
  18
+		<page classname="PersonPage" path="edit_author.html" />
  19
+		<page classname="PersonPage" path="edit_editor.html" />
  20
+		<page classname="PersonPage" path="edit_illustrator.html" />
  21
+		<page classname="PersonPage" path="edit_translator.html" />
  22
+		<page classname="GenderPage" path="create_gender.html" />
  23
+		<page classname="GenderPage" path="edit_gender.html" />
  24
+	</pages>
  25
+
  26
+	-->
  27
+	<pages package="org.books.page" autobinding="annotation" >
  28
+		<page classname="BookPage" path="book.htm"/>
  29
+		<page classname="PersonPage" path="person.htm"/>
  30
+		<page classname="GenderPage" path="gender.htm"/>
  31
+	</pages>
  32
+
  33
+	<mode value="debug" />
  34
+	<!--
  35
+	
  36
+	At this time, this is no longer required but it is still possible
  37
+	that in future updates I might need this implementation for other
  38
+	processing procedures that are only part of the Control interface
  39
+	of the click framework.
  40
+	
  41
+	<controls>
  42
+		<control classname="org.books.control.BookManagerControl"/>
  43
+	</controls>
  44
+
  45
+	-->
  46
+</click-app>
  47
+
  48
+
BIN  persistence/books/web/click/WebContent/WEB-INF/lib/click-2.2.0.jar
Binary file not shown
BIN  persistence/books/web/click/WebContent/WEB-INF/lib/click-extras-2.2.0.jar
Binary file not shown
20  persistence/books/web/click/WebContent/WEB-INF/web.xml
... ...
@@ -0,0 +1,20 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  3
+  <display-name>BooksClick</display-name>
  4
+  <welcome-file-list>
  5
+  	<welcome-file>redirect.html</welcome-file>
  6
+  </welcome-file-list>
  7
+  <servlet>
  8
+  	<servlet-name>ClickServlet</servlet-name>
  9
+  	<servlet-class>org.apache.click.ClickServlet</servlet-class>
  10
+  	<load-on-startup>0</load-on-startup>
  11
+  </servlet>
  12
+  <servlet-mapping>
  13
+  	<servlet-name>ClickServlet</servlet-name>
  14
+  	<url-pattern>*.htm</url-pattern>
  15
+  </servlet-mapping>
  16
+  <context-param>
  17
+  	<param-name>config-service-class</param-name>
  18
+  	<param-value>org.books.service.BooksConfigService</param-value>
  19
+  </context-param>
  20
+</web-app>
11  persistence/books/web/click/WebContent/book.htm
... ...
@@ -0,0 +1,11 @@
  1
+<?xml version="1.0" encoding="ISO-8859-1" ?>
  2
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3
+<html xmlns="http://www.w3.org/1999/xhtml">
  4
+<head>
  5
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  6
+<title>$title</title>
  7
+</head>
  8
+<body>
  9
+	$title
  10
+</body>
  11
+</html>
26  persistence/books/web/click/WebContent/home.htm
... ...
@@ -0,0 +1,26 @@
  1
+<html>
  2
+<head>
  3
+	<title>$title</title>
  4
+	<link rel="stylesheet" type="text/css" href="style.css" style="Style" />
  5
+</head>
  6
+<body>
  7
+	<div id="header">
  8
+		<span id="title">$title</span>
  9
+	</div>
  10
+	
  11
+	<div id="container">
  12
+		<b>Welcome</b> to Home page for your application starting point.
  13
+	</div>
  14
+
  15
+	<div id="container">
  16
+		<b>Welcome</b> to Home page for your application starting point.
  17
+	</div>
  18
+
  19
+	<div id="container">msg="$msg"</div>
  20
+	
  21
+	<p>
  22
+	<b>Hello,World!!!!</b>
  23
+	</p>
  24
+	 
  25
+</body>
  26
+</html>
11  persistence/books/web/click/WebContent/redirect.html
... ...
@@ -0,0 +1,11 @@
  1
+<?xml version="1.0" encoding="ISO-8859-1" ?>
  2
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3
+<html xmlns="http://www.w3.org/1999/xhtml">
  4
+<head>
  5
+<meta http-equiv="Refresh" content="0;URL=home.htm" />
  6
+<title>Simple Redirect to the HomePage class</title>
  7
+</head>
  8
+<body>
  9
+
  10
+</body>
  11
+</html>
31  persistence/books/web/click/WebContent/style.css
... ...
@@ -0,0 +1,31 @@
  1
+@CHARSET "ISO-8859-1";
  2
+
  3
+body {
  4
+	font-family: Arial;
  5
+}
  6
+
  7
+#header {
  8
+	background-color: navy;
  9
+}
  10
+
  11
+#title {
  12
+	color: white; 
  13
+	font-size: 18px;
  14
+	font-weight: bolder;
  15
+}
  16
+
  17
+#container { 
  18
+	padding-top: 1em;
  19
+	padding-left: 1.5em;
  20
+	position: relative;
  21
+	z-index: 0;
  22
+}
  23
+
  24
+h3.title {
  25
+	margin-top: 0em;
  26
+	margin-bottom: 1em;
  27
+} 
  28
+
  29
+table.books {
  30
+	width:	150px;
  31
+}
22  persistence/books/web/click/WebContent/welcome.html
... ...
@@ -0,0 +1,22 @@
  1
+<?xml version="1.0" encoding="ISO-8859-1" ?>
  2
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3
+<html xmlns="http://www.w3.org/1999/xhtml">
  4
+<head>
  5
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  6
+<title>$title</title>
  7
+	<link rel="stylesheet" type="text/css" href="style.css" style="Style" />
  8
+</head>
  9
+<body>
  10
+
  11
+	#if ($msg) 
  12
+		<div id="header"> <span id="title">$msg</span></div>
  13
+	#end
  14
+	
  15
+	$table
  16
+	
  17
+	$form
  18
+	
  19
+	$create_book
  20
+	
  21
+</body>
  22
+</html>
182  persistence/books/web/click/src/org/books/control/BookManagerControl.java
... ...
@@ -0,0 +1,182 @@
  1
+/**
  2
+
  3
+ BSD License
  4
+
  5
+ Copyright (c) 2010- , Claudio Corsi
  6
+ All rights reserved.
  7
+
  8
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  9
+
  10
+     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  11
+     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer 
  12
+       in the documentation and/or other materials provided with the distribution.
  13
+     * Neither the name of Claudio Corsi nor the names of its contributors may be used to endorse or promote products derived from 
  14
+       this software without specific prior written permission.
  15
+
  16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  17
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
  18
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
  19
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
  20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
  21
+ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22
+
  23
+ */
  24
+package org.books.control;
  25
+
  26
+import java.util.List;
  27
+import java.util.Map;
  28
+
  29
+import javax.servlet.ServletContext;
  30
+
  31
+import org.apache.click.Context;
  32
+import org.apache.click.Control;
  33
+import org.apache.click.element.Element;
  34
+import org.apache.click.util.HtmlStringBuffer;
  35
+
  36
+/**
  37
+ * @author Claudio Corsi
  38
+ *
  39
+ */
  40
+public class BookManagerControl implements Control {
  41
+
  42
+	/**
  43
+	 * 
  44
+	 */
  45
+	private static final long serialVersionUID = 1L;
  46
+
  47
+	/* (non-Javadoc)
  48
+	 * @see org.apache.click.Control#getContext()
  49
+	 */
  50
+	@Override
  51
+	public Context getContext() {
  52
+		// TODO Auto-generated method stub
  53
+		return null;
  54
+	}
  55
+
  56
+	/* (non-Javadoc)
  57
+	 * @see org.apache.click.Control#getHeadElements()
  58
+	 */
  59
+	@Override
  60
+	public List<Element> getHeadElements() {
  61
+		// TODO Auto-generated method stub
  62
+		return null;
  63
+	}
  64
+
  65
+	/* (non-Javadoc)
  66
+	 * @see org.apache.click.Control#getId()
  67
+	 */
  68
+	@Override
  69
+	public String getId() {
  70
+		// TODO Auto-generated method stub
  71
+		return null;
  72
+	}
  73
+
  74
+	/* (non-Javadoc)
  75
+	 * @see org.apache.click.Control#getMessages()
  76
+	 */
  77
+	@Override
  78
+	public Map<String, String> getMessages() {
  79
+		// TODO Auto-generated method stub
  80
+		return null;
  81
+	}
  82
+
  83
+	/* (non-Javadoc)
  84
+	 * @see org.apache.click.Control#getName()
  85
+	 */
  86
+	@Override
  87
+	public String getName() {
  88
+		// TODO Auto-generated method stub
  89
+		return null;
  90
+	}
  91
+
  92
+	/* (non-Javadoc)
  93
+	 * @see org.apache.click.Control#getParent()
  94
+	 */
  95
+	@Override
  96
+	public Object getParent() {
  97
+		// TODO Auto-generated method stub
  98
+		return null;
  99
+	}
  100
+
  101
+	/* (non-Javadoc)
  102
+	 * @see org.apache.click.Control#onDeploy(javax.servlet.ServletContext)
  103
+	 */
  104
+	@Override
  105
+	public void onDeploy(ServletContext servletContext) {
  106
+		// TODO Auto-generated method stub
  107
+
  108
+	}
  109
+
  110
+	/* (non-Javadoc)
  111
+	 * @see org.apache.click.Control#onDestroy()
  112
+	 */
  113
+	@Override
  114
+	public void onDestroy() {
  115
+		// TODO Auto-generated method stub
  116
+
  117
+	}
  118
+
  119
+	/* (non-Javadoc)
  120
+	 * @see org.apache.click.Control#onInit()
  121
+	 */
  122
+	@Override
  123
+	public void onInit() {
  124
+		// TODO Auto-generated method stub
  125
+
  126
+	}
  127
+
  128
+	/* (non-Javadoc)
  129
+	 * @see org.apache.click.Control#onProcess()
  130
+	 */
  131
+	@Override
  132
+	public boolean onProcess() {
  133
+		// TODO Auto-generated method stub
  134
+		return false;
  135
+	}
  136
+
  137
+	/* (non-Javadoc)
  138
+	 * @see org.apache.click.Control#onRender()
  139
+	 */
  140
+	@Override
  141
+	public void onRender() {
  142
+		// TODO Auto-generated method stub
  143
+
  144
+	}
  145
+
  146
+	/* (non-Javadoc)
  147
+	 * @see org.apache.click.Control#render(org.apache.click.util.HtmlStringBuffer)
  148
+	 */
  149
+	@Override
  150
+	public void render(HtmlStringBuffer buffer) {
  151
+		// TODO Auto-generated method stub
  152
+
  153
+	}
  154
+
  155
+	/* (non-Javadoc)
  156
+	 * @see org.apache.click.Control#setListener(java.lang.Object, java.lang.String)
  157
+	 */
  158
+	@Override
  159
+	public void setListener(Object listener, String method) {
  160
+		// TODO Auto-generated method stub
  161
+
  162
+	}
  163
+
  164
+	/* (non-Javadoc)
  165
+	 * @see org.apache.click.Control#setName(java.lang.String)
  166
+	 */
  167
+	@Override
  168
+	public void setName(String name) {
  169
+		// TODO Auto-generated method stub
  170
+
  171
+	}
  172
+
  173
+	/* (non-Javadoc)
  174
+	 * @see org.apache.click.Control#setParent(java.lang.Object)
  175
+	 */
  176
+	@Override
  177
+	public void setParent(Object parent) {
  178
+		// TODO Auto-generated method stub
  179
+
  180
+	}
  181
+
  182
+}
61  persistence/books/web/click/src/org/books/control/BookSelect.java
... ...
@@ -0,0 +1,61 @@
  1
+/**
  2
+
  3
+ BSD License
  4
+
  5
+ Copyright (c) 2010- , Claudio Corsi
  6
+ All rights reserved.
  7
+
  8
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  9
+
  10
+     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  11
+     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer 
  12
+       in the documentation and/or other materials provided with the distribution.
  13
+     * Neither the name of Claudio Corsi nor the names of its contributors may be used to endorse or promote products derived from 
  14
+       this software without specific prior written permission.
  15
+
  16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  17
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
  18
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
  19
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
  20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
  21
+ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22
+
  23
+ */
  24
+package org.books.control;
  25
+
  26
+import java.util.Collection;
  27
+import java.util.LinkedList;
  28
+import java.util.List;
  29
+
  30
+import org.apache.click.control.Option;
  31
+import org.apache.click.control.Select;
  32
+import org.books.BooksManager;
  33
+import org.books.proxy.BookProxy;
  34
+
  35
+/**
  36
+ * @author Claudio Corsi
  37
+ *
  38
+ */
  39
+public class BookSelect extends Select {
  40
+
  41
+	private List<Option> options;
  42
+
  43
+	public BookSelect(String label) {
  44
+		super();
  45
+		this.setLabel(label);
  46
+		this.setName(label);
  47
+		setUpBookOptions();
  48
+	}
  49
+
  50
+	private void setUpBookOptions() {
  51
+		options = new LinkedList<Option>();
  52
+		BooksManager bookMgr = BooksManager.getInstance();
  53
+		Collection<BookProxy> books = bookMgr.getBookProxies();
  54
+		for (BookProxy book : books) {
  55
+			Option option = new Option(bookMgr.getIdentifier(book),book.getTitle());
  56
+			options.add(option);
  57
+		}
  58
+		this.setOptionList(options);
  59
+	}
  60
+	
  61
+}
70  persistence/books/web/click/src/org/books/page/BookPage.java
... ...
@@ -0,0 +1,70 @@
  1
+/**
  2
+
  3
+ BSD License
  4
+
  5
+ Copyright (c) 2010- , Claudio Corsi
  6
+ All rights reserved.
  7
+
  8
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  9
+
  10
+     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  11
+     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer 
  12
+       in the documentation and/or other materials provided with the distribution.
  13
+     * Neither the name of Claudio Corsi nor the names of its contributors may be used to endorse or promote products derived from 
  14
+       this software without specific prior written permission.
  15
+
  16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  17
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
  18
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
  19
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
  20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
  21
+ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22
+
  23
+ */
  24
+package org.books.page;
  25
+
  26
+import java.util.Map;
  27
+
  28
+import org.apache.click.Page;
  29
+import org.apache.click.util.Bindable;
  30
+import org.books.proxy.BookProxy;
  31
+
  32
+/**
  33
+ * This is a generic book page that will be used to generate a create new book
  34
+ * page or a edit book page.  
  35
+ * 
  36
+ * This will be determined by the query string that is passed to this page.
  37
+ * 
  38
+ * It will redirect the users to the welcome page if the query string does
  39
+ * not contain the action string set to New or Edit.
  40
+ * 
  41
+ * @author Claudio Corsi
  42
+ *
  43
+ */
  44
+public class BookPage extends Page {
  45
+
  46
+	/**
  47
+	 * 
  48
+	 */
  49
+	private static final long serialVersionUID = 1L;
  50
+
  51
+	@Bindable protected String title;
  52
+	
  53
+	public BookPage() {
  54
+		String action = this.getContext().getRequestParameter("action");
  55
+		if ("Edit".equals(action)) {
  56
+			this.title = "Edit Book  Luciano Szekely Corsi";
  57
+			String identifier = this.getContext().getRequestParameter("bookId");
  58
+			Map<String,BookProxy> books = (Map<String,BookProxy>) this.getContext().getSessionAttribute("books");
  59
+			System.out.println("bookId=" + identifier);
  60
+			System.out.println("books=" + books);
  61
+			BookProxy book = books.get(identifier);
  62
+			System.out.println("book=" + book.getBook());
  63
+		} else if ("New".equals(action)) {
  64
+			this.title = "Create Book  Luciano Szekely Corsi";
  65
+		} else {
  66
+			this.title = "Unknown Book Action Type Luciano Szekely Corsi";
  67
+		}
  68
+		this.setTemplate("book.htm");
  69
+	}
  70
+}
39  persistence/books/web/click/src/org/books/page/GenderPage.java
... ...
@@ -0,0 +1,39 @@
  1
+/**
  2
+
  3
+ BSD License
  4
+
  5
+ Copyright (c) 2010- , Claudio Corsi
  6
+ All rights reserved.
  7
+
  8
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  9
+
  10
+     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  11
+     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer 
  12
+       in the documentation and/or other materials provided with the distribution.
  13
+     * Neither the name of Claudio Corsi nor the names of its contributors may be used to endorse or promote products derived from 
  14
+       this software without specific prior written permission.
  15
+
  16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  17
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
  18
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
  19
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
  20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
  21
+ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22
+
  23
+ */
  24
+package org.books.page;
  25
+
  26
+import org.apache.click.Page;
  27
+
  28
+/**
  29
+ * @author Claudio Corsi
  30
+ *
  31
+ */
  32
+public class GenderPage extends Page {
  33
+
  34
+	/**
  35
+	 * 
  36
+	 */
  37
+	private static final long serialVersionUID = 1L;
  38
+
  39
+}
248  persistence/books/web/click/src/org/books/page/HomePage.java
... ...
@@ -0,0 +1,248 @@
  1
+/**
  2
+
  3
+ BSD License
  4
+
  5
+ Copyright (c) 2010- , Claudio Corsi
  6
+ All rights reserved.
  7
+
  8
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  9
+
  10
+     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  11
+     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer 
  12
+       in the documentation and/or other materials provided with the distribution.
  13
+     * Neither the name of Claudio Corsi nor the names of its contributors may be used to endorse or promote products derived from 
  14
+       this software without specific prior written permission.
  15
+
  16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  17
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
  18
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
  19
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
  20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
  21
+ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22
+
  23
+ */
  24
+package org.books.page;
  25
+
  26
+import java.util.Collection;
  27
+import java.util.HashMap;
  28
+import java.util.Iterator;
  29
+import java.util.LinkedList;
  30
+import java.util.List;
  31
+import java.util.Map;
  32
+
  33
+import org.apache.click.Context;
  34
+import org.apache.click.Control;
  35
+import org.apache.click.Page;
  36
+import org.apache.click.control.Button;
  37
+import org.apache.click.control.Column;
  38
+import org.apache.click.control.Decorator;
  39
+import org.apache.click.control.Form;
  40
+import org.apache.click.control.PageLink;
  41
+import org.apache.click.control.Select;
  42
+import org.apache.click.control.Submit;
  43
+import org.apache.click.control.Table;
  44
+import org.apache.click.util.Bindable;
  45
+import org.books.BooksManager;
  46
+import org.books.control.BookSelect;
  47
+import org.books.proxy.BookProxy;
  48
+import org.books.proxy.PersonProxy;
  49
+
  50
+import books.persistence.types.Book;
  51
+import books.persistence.types.Person;
  52
+import books.persistence.types.PersonType;
  53
+
  54
+/**
  55
+ * This is the home page that will displayed whenever a user is looking at their
  56
+ * list of books.
  57
+ * 
  58
+ * @author Claudio Corsi
  59
+ *
  60
+ */
  61
+public class HomePage extends Page {
  62
+
  63
+	/**
  64
+	 * 
  65
+	 */
  66
+	private static final long serialVersionUID = 1L;
  67
+
  68
+	@Bindable protected Collection<Book> books;
  69
+	
  70
+	@Bindable protected String title;
  71
+	
  72
+	@Bindable protected Table table = new Table();
  73
+	
  74
+	@Bindable protected String msg;
  75
+	
  76
+	@Bindable protected Form form = new Form();
  77
+	
  78
+	@Bindable protected Button create = new Button("Create Book");
  79
+	
  80
+	private Select select = new BookSelect("Books");
  81
+	
  82
+	public static class BookTableRow {
  83
+		
  84
+		private BookProxy book;
  85
+		
  86
+		BookTableRow(BookProxy book) {
  87
+			this.book = book;
  88
+		}
  89
+		
  90
+		public String getAuthors() {
  91
+			Collection<PersonProxy> authors =
  92
+				book.getPersons(PersonType.Author);
  93
+			if (authors.isEmpty()) {
  94
+				return "";
  95
+			} else {
  96
+				Iterator<PersonProxy> itr = authors.iterator();
  97
+				PersonProxy author = itr.next();
  98
+				StringBuilder string = new StringBuilder(author.getFullName());
  99
+				while (itr.hasNext()) {
  100
+					author = itr.next();
  101
+					string.append(", ").append(author.getFullName());
  102
+				}
  103
+				return string.toString();
  104
+			}
  105
+		}
  106
+		
  107
+		public String getTitle() {
  108
+			return this.book.getTitle();
  109
+		}
  110
+		
  111
+		public Book getBook() {
  112
+			return this.book.getBook();
  113
+		}
  114
+	}
  115
+	
  116
+	public HomePage() {
  117
+		this.getContext().getServletContext().log("Inside HomePage Construction");
  118
+		// System.out.println("Inside HomePage Construction");
  119
+		
  120
+		this.title = "Welcome Luciano Szekely Corsi";
  121
+		this.msg = "This is where we will be placing the Books Table";
  122
+		
  123
+		table.setClass(Table.CLASS_ITS);
  124
+		table.setAttribute("border", "1");
  125
+		table.setId("books");
  126
+		// table.setStyle("border", "1");
  127
+		
  128
+		Column column = new Column("title");
  129
+		column.setDataStyle("bgcolor", "red");
  130
+		column.setAutolink(false);
  131
+		column.setAttribute("width", "150px");
  132
+		column.setDecorator(new Decorator() {
  133
+
  134
+			@Override
  135
+			public String render(Object object, Context context) {
  136
+				BookProxy book = BookProxy.class.cast(object);
  137
+				PageLink link = new PageLink("bookLink", BookPage.class);
  138
+				link.setParameter("action", "Edit");
  139
+				link.setParameter("bookId", 
  140
+						BooksManager.getInstance().getIdentifier(book.getBook()));
  141
+				link.setLabel(book.getTitle());
  142
+				return link.toString(); 
  143
+			}
  144
+			
  145
+		});
  146
+		
  147
+		table.addColumn(column);
  148
+		
  149
+		column = new Column("authors");
  150
+		column.setAttribute("width", "150px");
  151
+		column.setDecorator(new Decorator() {
  152
+
  153
+			@Override
  154
+			public String render(Object object, Context context) {
  155
+				BookProxy book = BookProxy.class.cast(object);
  156
+				Collection<PersonProxy> authors =
  157
+					book.getPersons(PersonType.Author);
  158
+				if (authors.isEmpty()) {
  159
+					return "";
  160
+				} else {
  161
+					Iterator<PersonProxy> itr = authors.iterator();
  162
+					PersonProxy author = itr.next();
  163
+					StringBuilder string = new StringBuilder(author.getFullName());
  164
+					while (itr.hasNext()) {
  165
+						author = itr.next();
  166
+						string.append(", ").append(author.getFullName());
  167
+					}
  168
+					return string.toString();
  169
+				}
  170
+			}
  171
+		});
  172
+		
  173
+		table.addColumn(column);
  174
+		List<BookProxy> books = createRowList();
  175
+		table.setRowList(books);
  176
+		
  177
+		Map<String,BookProxy> bookMap = new HashMap<String,BookProxy>();
  178
+		for (BookProxy proxy : books) {
  179
+			bookMap.put(BooksManager.getInstance().getIdentifier(
  180
+					proxy.getBook()), proxy);
  181
+		}
  182
+		this.getContext().setSessionAttribute("books", bookMap);
  183
+		
  184
+		this.addModel("title", this.title);
  185
+		this.addModel("table", this.table);
  186
+		this.addModel("msg", this.msg);
  187
+		this.addModel("create_book", this.create);
  188
+	
  189
+		this.select.setMultiple(false);
  190
+		this.form.add(new Submit("Edit Book"));
  191
+		this.form.add(this.select);
  192
+		
  193
+		this.addModel("form", this.select);
  194
+//		this.addModel("Create Book", new Button("Create Book"));
  195
+		
  196
+		
  197
+		this.getContext().getServletContext().log("Exiting HomePage Constructor");
  198
+	}
  199
+
  200
+	private List<BookProxy> createRowList() {
  201
+		return new LinkedList<BookProxy>(BooksManager.getInstance().getBookProxies());
  202
+//		List<BookTableRow> books = new LinkedList<BookTableRow>();
  203
+//		for (BookProxy book : BooksManager.getInstance().getBookProxies()) {
  204
+//			books.add(new BookTableRow(book));
  205
+//		}
  206
+//		
  207
+//		return books;
  208
+	}
  209
+
  210
+	/* (non-Javadoc)
  211
+	 * @see org.apache.click.Page#onInit()
  212
+	 */
  213
+	@Override
  214
+	public void onInit() {
  215
+		this.getContext().getServletContext().log("Calling HomePage onInit method\n");
  216
+		
  217
+		super.onInit();
  218
+	}
  219
+
  220
+	/* (non-Javadoc)
  221
+	 * @see org.apache.click.Page#onDestroy()
  222
+	 */
  223
+	@Override
  224
+	public void onDestroy() {
  225
+		this.getContext().getServletContext().log("Calling HomePage onDestroy method\n");
  226
+		
  227
+		super.onDestroy();
  228
+	}
  229
+
  230
+	/* (non-Javadoc)
  231
+	 * @see org.apache.click.Page#onRender()
  232
+	 */
  233
+	@Override
  234
+	public void onRender() {
  235
+		// table.setRowList(new LinkedList());
  236
+	}
  237
+
  238
+	/**
  239
+	 * Returns the welcome.htm template name.
  240
+	 * 
  241
+	 * @retrun welcome.htm
  242
+	 */
  243
+	@Override
  244
+	public String getTemplate() {
  245
+		return "welcome.html";
  246
+	}
  247
+
  248
+}
39  persistence/books/web/click/src/org/books/page/PersonPage.java
... ...
@@ -0,0 +1,39 @@
  1
+/**
  2
+
  3
+ BSD License
  4
+
  5
+ Copyright (c) 2010- , Claudio Corsi
  6
+ All rights reserved.
  7
+
  8
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  9
+
  10
+     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  11
+     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer 
  12
+       in the documentation and/or other materials provided with the distribution.
  13
+     * Neither the name of Claudio Corsi nor the names of its contributors may be used to endorse or promote products derived from 
  14
+       this software without specific prior written permission.
  15
+
  16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  17
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
  18
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
  19
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
  20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
  21
+ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22
+
  23
+ */
  24
+package org.books.page;
  25
+
  26
+import org.apache.click.Page;
  27
+
  28
+/**
  29
+ * @author Claudio Corsi
  30
+ *
  31
+ */
  32
+public class PersonPage extends Page {
  33
+
  34
+	/**
  35
+	 * 
  36
+	 */
  37
+	private static final long serialVersionUID = 1L;
  38
+
  39
+}
93  persistence/books/web/click/src/org/books/page/WelcomePage.java
... ...
@@ -0,0 +1,93 @@
  1
+/**
  2
+
  3
+ BSD License
  4
+
  5
+ Copyright (c) 2010- , Claudio Corsi
  6
+ All rights reserved.
  7
+
  8
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  9
+
  10
+     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  11
+     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer 
  12
+       in the documentation and/or other materials provided with the distribution.
  13
+     * Neither the name of Claudio Corsi nor the names of its contributors may be used to endorse or promote products derived from 
  14
+       this software without specific prior written permission.