Merge of new archetype. Plus passing resourcesDir to maven plugin.
1.1 --- a/ko-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml Thu Jul 18 15:39:56 2013 +0200
1.2 +++ b/ko-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml Thu Jul 18 16:18:58 2013 +0200
1.3 @@ -7,8 +7,8 @@
1.4 <include>**/*.java</include>
1.5 </includes>
1.6 </fileSet>
1.7 - <fileSet filtered="true" packaged="true">
1.8 - <directory>src/main/resources</directory>
1.9 + <fileSet filtered="true" packaged="false">
1.10 + <directory>src/main/web/pages</directory>
1.11 <includes>
1.12 <include>**/*.xhtml</include>
1.13 <include>**/*.html</include>
2.1 --- a/ko-archetype/src/main/resources/archetype-resources/pom.xml Thu Jul 18 15:39:56 2013 +0200
2.2 +++ b/ko-archetype/src/main/resources/archetype-resources/pom.xml Thu Jul 18 16:18:58 2013 +0200
2.3 @@ -71,6 +71,12 @@
2.4 <artifactId>exec-maven-plugin</artifactId>
2.5 <version>1.2.1</version>
2.6 <configuration>
2.7 + <systemProperties>
2.8 + <systemProperty>
2.9 + <key>browser.rootdir</key>
2.10 + <value>\${basedir}/src/main/web/</value>
2.11 + </systemProperty>
2.12 + </systemProperties>
2.13 <mainClass>\${package}.Main</mainClass>
2.14 </configuration>
2.15 </plugin>
2.16 @@ -142,6 +148,7 @@
2.17 <jarfile>\${project.build.directory}/\${project.build.finalName}.jar</jarfile>
2.18 <title>\${project.name}</title>
2.19 <mainclass>\${package}.Main</mainclass>
2.20 + <resourcesDir>src/main/web/</resourcesDir>
2.21 </configuration>
2.22 </plugin>
2.23 <plugin>
3.1 --- a/ko-archetype/src/main/resources/archetype-resources/src/main/assembly/html.java.net.xml Thu Jul 18 15:39:56 2013 +0200
3.2 +++ b/ko-archetype/src/main/resources/archetype-resources/src/main/assembly/html.java.net.xml Thu Jul 18 16:18:58 2013 +0200
3.3 @@ -20,4 +20,13 @@
3.4 <outputDirectory>/</outputDirectory>
3.5 </file>
3.6 </files>
3.7 + <fileSets>
3.8 + <fileSet>
3.9 + <directory>src/main/web/</directory>
3.10 + <outputDirectory>/</outputDirectory>
3.11 + <includes>
3.12 + <include>pages/**</include>
3.13 + </includes>
3.14 + </fileSet>
3.15 + </fileSets>
3.16 </assembly>
3.17 \ No newline at end of file
4.1 --- a/ko-archetype/src/main/resources/archetype-resources/src/main/java/Main.java Thu Jul 18 15:39:56 2013 +0200
4.2 +++ b/ko-archetype/src/main/resources/archetype-resources/src/main/java/Main.java Thu Jul 18 16:18:58 2013 +0200
4.3 @@ -8,7 +8,7 @@
4.4
4.5 public static void main(String... args) throws Exception {
4.6 BrowserBuilder.newBrowser().
4.7 - loadPage("index.html").
4.8 + loadPage("pages/index.html").
4.9 loadClass(TwitterClient.class).
4.10 invoke("initialize", args).
4.11 showAndWait();
5.1 --- a/ko-archetype/src/main/resources/archetype-resources/src/main/resources/index.html Thu Jul 18 15:39:56 2013 +0200
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,79 +0,0 @@
5.4 -<?xml version="1.0" encoding="UTF-8"?>
5.5 -
5.6 -<!--
5.7 - Copied from knockout.js Twitter example:
5.8 - http://knockoutjs.com/examples/twitter.html
5.9 --->
5.10 -
5.11 -<!DOCTYPE html>
5.12 -<html xmlns="http://www.w3.org/1999/xhtml">
5.13 - <head>
5.14 - <title>Knockout in Java Twitter</title>
5.15 - </head>
5.16 - <body>
5.17 - <link href='twitterExample.css' rel='Stylesheet' ></link>
5.18 -
5.19 - <style type='text/css'>
5.20 - .liveExample select { height: 1.7em; }
5.21 - .liveExample button { height: 2em; }
5.22 - </style>
5.23 -
5.24 -
5.25 - <h2>Knockout in Java Twitter</h2>
5.26 -
5.27 - <p>
5.28 - This code is based on original
5.29 - <a href="http://knockoutjs.com/examples/twitter.html">knockout.js
5.30 - Twitter example</a> and
5.31 - uses almost unmodified HTML page. It just changes the model. The model
5.32 - is written in Java language with the help of
5.33 - <a href="http://bck2brwsr.apidesign.org/javadoc/net.java.html.json/">
5.34 - Knockout/Java binding library
5.35 - </a>. The Java source code has about 180 lines and seems more
5.36 - dense and shorter than the original JavaScript model.
5.37 - </p>
5.38 - <p>
5.39 - The project executes in real Java virtual
5.40 - machine and renders using JavaFX's WebView.
5.41 - </p>
5.42 -
5.43 - <div class='liveExample'>
5.44 - <div class='configuration'>
5.45 - <div class='listChooser'>
5.46 - <button data-bind='click: deleteList, enable: activeTweetersName'>Delete</button>
5.47 - <button data-bind='click: saveChanges, enable: hasUnsavedChanges'>Save</button>
5.48 - <select data-bind='options: savedLists, optionsValue: "name", value: activeTweetersName'> </select>
5.49 - </div>
5.50 -
5.51 - <p>Currently viewing <span data-bind='text: activeTweetersCount'> </span> user(s):</p>
5.52 - <div class='currentUsers' >
5.53 - <ul data-bind='foreach: activeTweeters'>
5.54 - <li>
5.55 - <button data-bind='click: $root.removeUser'>Remove</button>
5.56 - <div data-bind='text: $data'> </div>
5.57 - </li>
5.58 - </ul>
5.59 - </div>
5.60 -
5.61 - <form data-bind='submit: addUser'>
5.62 - <label>Add user:</label>
5.63 - <input data-bind='value: userNameToAdd, valueUpdate: "keyup", css: { invalid: !userNameToAddIsValid() }' />
5.64 - <button data-bind='enable: userNameToAddIsValid' type='submit'>Add</button>
5.65 - </form>
5.66 - </div>
5.67 - <div class='tweets'>
5.68 - <div class='loadingIndicator' data-bind="visible: loading">Loading...</div>
5.69 - <table data-bind='foreach: currentTweets' width='100%'>
5.70 - <tr>
5.71 - <td><img data-bind='attr: { src: profile_image_url }' /></td>
5.72 - <td>
5.73 - <a class='twitterUser' data-bind='attr: { href: userUrl }, text: from_user'> </a>
5.74 - <span data-bind='html: html'> </span>
5.75 - <div class='tweetInfo' data-bind='text: created_at'> </div>
5.76 - </td>
5.77 - </tr>
5.78 - </table>
5.79 - </div>
5.80 - </div>
5.81 - </body>
5.82 -</html>
6.1 --- a/ko-archetype/src/main/resources/archetype-resources/src/main/resources/twitterExample.css Thu Jul 18 15:39:56 2013 +0200
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,32 +0,0 @@
6.4 -/*
6.5 - Copied from knockout.js Twitter example:
6.6 - http://knockoutjs.com/examples/twitter.html
6.7 -*/
6.8 -
6.9 -.configuration, .tweets, .tweets td { font-family: Verdana; font-size: 13px; }
6.10 -.configuration { background-color: #DEDEDE; border: 2px solid gray; float:left; height: 40em; width: 40%; padding: 0.5em; border-right-width:0; }
6.11 -.tweets { width: 55%; border: 2px solid gray; height: 40em; overflow: scroll; overflow-x: hidden; background-color: Black; color: White; padding: 0.5em; position: relative; }
6.12 -.tweets table { border-width: 0;}
6.13 -.tweets tr { vertical-align: top; }
6.14 -.tweets td { padding: 0.4em 0.3em 1em 0.4em; border-width: 0; }
6.15 -.tweets img { width: 4em; }
6.16 -.tweetInfo { color: Gray; font-size: 0.9em; }
6.17 -.twitterUser { color: #77AAFF; text-decoration: none; font-size: 1.1em; font-weight: bold; }
6.18 -input.invalid { border: 1px solid red !important; background-color: #FFAAAA !important; }
6.19 -
6.20 -.listChooser select, .listChooser button { vertical-align:top; }
6.21 -.listChooser select { width: 60%; font-size:1.2em; height:1.4em; }
6.22 -.listChooser button { width: 19%; height:1.68em; float:right; }
6.23 -
6.24 -.currentUsers { height: 28em; overflow-y: auto; overflow-x: hidden; }
6.25 -.currentUsers button { float: right; height: 2.5em; margin: 0.1em; padding-left: 1em; padding-right: 1em; }
6.26 -.currentUsers ul, .configuration li { list-style: none; margin: 0; padding: 0 }
6.27 -.currentUsers li { height: 2.4em; font-size: 1.2em; background-color: #A7D0E3; border: 1px solid gray; margin-bottom: 0.3em; -webkit-border-radius: 5px; -moz-border-radius: 5px; -webkit-box-shadow: 0 0.2em 0.5em gray; -moz-box-shadow: 0 0.2em 0.5em gray; }
6.28 -.currentUsers li div { padding: 0.6em; }
6.29 -.currentUsers li:hover { background-color: #EEC; }
6.30 -
6.31 -.configuration form label { width: 25%; display: inline-block; text-align:right; overflow: hidden; }
6.32 -.configuration form input { width:40%; font-size: 1.3em; border:1px solid silver; background-color: White; padding: 0.1em; }
6.33 -.configuration form button { width: 20%; margin-left: 0.3em; height: 2em; }
6.34 -
6.35 -.loadingIndicator { position: absolute; top: 0.1em; left: 0.1em; font: 0.8em Arial; background-color: #229; color: White; padding: 0.2em 0.5em 0.2em 0.5em; }
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/ko-archetype/src/main/resources/archetype-resources/src/main/web/pages/index.html Thu Jul 18 16:18:58 2013 +0200
7.3 @@ -0,0 +1,79 @@
7.4 +<?xml version="1.0" encoding="UTF-8"?>
7.5 +
7.6 +<!--
7.7 + Copied from knockout.js Twitter example:
7.8 + http://knockoutjs.com/examples/twitter.html
7.9 +-->
7.10 +
7.11 +<!DOCTYPE html>
7.12 +<html xmlns="http://www.w3.org/1999/xhtml">
7.13 + <head>
7.14 + <title>Knockout in Java Twitter</title>
7.15 + </head>
7.16 + <body>
7.17 + <link href='twitterExample.css' rel='Stylesheet' ></link>
7.18 +
7.19 + <style type='text/css'>
7.20 + .liveExample select { height: 1.7em; }
7.21 + .liveExample button { height: 2em; }
7.22 + </style>
7.23 +
7.24 +
7.25 + <h2>Knockout in Java Twitter</h2>
7.26 +
7.27 + <p>
7.28 + This code is based on original
7.29 + <a href="http://knockoutjs.com/examples/twitter.html">knockout.js
7.30 + Twitter example</a> and
7.31 + uses almost unmodified HTML page. It just changes the model. The model
7.32 + is written in Java language with the help of
7.33 + <a href="http://bck2brwsr.apidesign.org/javadoc/net.java.html.json/">
7.34 + Knockout/Java binding library
7.35 + </a>. The Java source code has about 180 lines and seems more
7.36 + dense and shorter than the original JavaScript model.
7.37 + </p>
7.38 + <p>
7.39 + The project executes in real Java virtual
7.40 + machine and renders using JavaFX's WebView.
7.41 + </p>
7.42 +
7.43 + <div class='liveExample'>
7.44 + <div class='configuration'>
7.45 + <div class='listChooser'>
7.46 + <button data-bind='click: deleteList, enable: activeTweetersName'>Delete</button>
7.47 + <button data-bind='click: saveChanges, enable: hasUnsavedChanges'>Save</button>
7.48 + <select data-bind='options: savedLists, optionsValue: "name", value: activeTweetersName'> </select>
7.49 + </div>
7.50 +
7.51 + <p>Currently viewing <span data-bind='text: activeTweetersCount'> </span> user(s):</p>
7.52 + <div class='currentUsers' >
7.53 + <ul data-bind='foreach: activeTweeters'>
7.54 + <li>
7.55 + <button data-bind='click: $root.removeUser'>Remove</button>
7.56 + <div data-bind='text: $data'> </div>
7.57 + </li>
7.58 + </ul>
7.59 + </div>
7.60 +
7.61 + <form data-bind='submit: addUser'>
7.62 + <label>Add user:</label>
7.63 + <input data-bind='value: userNameToAdd, valueUpdate: "keyup", css: { invalid: !userNameToAddIsValid() }' />
7.64 + <button data-bind='enable: userNameToAddIsValid' type='submit'>Add</button>
7.65 + </form>
7.66 + </div>
7.67 + <div class='tweets'>
7.68 + <div class='loadingIndicator' data-bind="visible: loading">Loading...</div>
7.69 + <table data-bind='foreach: currentTweets' width='100%'>
7.70 + <tr>
7.71 + <td><img data-bind='attr: { src: profile_image_url }' /></td>
7.72 + <td>
7.73 + <a class='twitterUser' data-bind='attr: { href: userUrl }, text: from_user'> </a>
7.74 + <span data-bind='html: html'> </span>
7.75 + <div class='tweetInfo' data-bind='text: created_at'> </div>
7.76 + </td>
7.77 + </tr>
7.78 + </table>
7.79 + </div>
7.80 + </div>
7.81 + </body>
7.82 +</html>
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/ko-archetype/src/main/resources/archetype-resources/src/main/web/pages/twitterExample.css Thu Jul 18 16:18:58 2013 +0200
8.3 @@ -0,0 +1,32 @@
8.4 +/*
8.5 + Copied from knockout.js Twitter example:
8.6 + http://knockoutjs.com/examples/twitter.html
8.7 +*/
8.8 +
8.9 +.configuration, .tweets, .tweets td { font-family: Verdana; font-size: 13px; }
8.10 +.configuration { background-color: #DEDEDE; border: 2px solid gray; float:left; height: 40em; width: 40%; padding: 0.5em; border-right-width:0; }
8.11 +.tweets { width: 55%; border: 2px solid gray; height: 40em; overflow: scroll; overflow-x: hidden; background-color: Black; color: White; padding: 0.5em; position: relative; }
8.12 +.tweets table { border-width: 0;}
8.13 +.tweets tr { vertical-align: top; }
8.14 +.tweets td { padding: 0.4em 0.3em 1em 0.4em; border-width: 0; }
8.15 +.tweets img { width: 4em; }
8.16 +.tweetInfo { color: Gray; font-size: 0.9em; }
8.17 +.twitterUser { color: #77AAFF; text-decoration: none; font-size: 1.1em; font-weight: bold; }
8.18 +input.invalid { border: 1px solid red !important; background-color: #FFAAAA !important; }
8.19 +
8.20 +.listChooser select, .listChooser button { vertical-align:top; }
8.21 +.listChooser select { width: 60%; font-size:1.2em; height:1.4em; }
8.22 +.listChooser button { width: 19%; height:1.68em; float:right; }
8.23 +
8.24 +.currentUsers { height: 28em; overflow-y: auto; overflow-x: hidden; }
8.25 +.currentUsers button { float: right; height: 2.5em; margin: 0.1em; padding-left: 1em; padding-right: 1em; }
8.26 +.currentUsers ul, .configuration li { list-style: none; margin: 0; padding: 0 }
8.27 +.currentUsers li { height: 2.4em; font-size: 1.2em; background-color: #A7D0E3; border: 1px solid gray; margin-bottom: 0.3em; -webkit-border-radius: 5px; -moz-border-radius: 5px; -webkit-box-shadow: 0 0.2em 0.5em gray; -moz-box-shadow: 0 0.2em 0.5em gray; }
8.28 +.currentUsers li div { padding: 0.6em; }
8.29 +.currentUsers li:hover { background-color: #EEC; }
8.30 +
8.31 +.configuration form label { width: 25%; display: inline-block; text-align:right; overflow: hidden; }
8.32 +.configuration form input { width:40%; font-size: 1.3em; border:1px solid silver; background-color: White; padding: 0.1em; }
8.33 +.configuration form button { width: 20%; margin-left: 0.3em; height: 2em; }
8.34 +
8.35 +.loadingIndicator { position: absolute; top: 0.1em; left: 0.1em; font: 0.8em Arial; background-color: #229; color: White; padding: 0.2em 0.5em 0.2em 0.5em; }