Using webapp directory for HTML pages as NetBeans IDE recognizes such directory automatically and gives it special treatment.
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 25 Jul 2013 16:42:20 +0200
changeset 206f7e2abe1bc38
parent 204 d03faa1feaca
child 207 89aefa5591e4
Using webapp directory for HTML pages as NetBeans IDE recognizes such directory automatically and gives it special treatment.
ko-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
ko-archetype/src/main/resources/archetype-resources/pom.xml
ko-archetype/src/main/resources/archetype-resources/src/main/assembly/html.java.net.xml
ko-archetype/src/main/resources/archetype-resources/src/main/web/pages/index.html
ko-archetype/src/main/resources/archetype-resources/src/main/web/pages/twitterExample.css
ko-archetype/src/main/resources/archetype-resources/src/main/webapp/pages/index.html
ko-archetype/src/main/resources/archetype-resources/src/main/webapp/pages/twitterExample.css
     1.1 --- a/ko-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml	Thu Jul 18 16:11:14 2013 +0200
     1.2 +++ b/ko-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml	Thu Jul 25 16:42:20 2013 +0200
     1.3 @@ -8,7 +8,7 @@
     1.4        </includes>
     1.5      </fileSet>
     1.6      <fileSet filtered="true" packaged="false">
     1.7 -      <directory>src/main/web/pages</directory>
     1.8 +      <directory>src/main/webapp/pages</directory>
     1.9        <includes>
    1.10          <include>**/*.xhtml</include>
    1.11          <include>**/*.html</include>
     2.1 --- a/ko-archetype/src/main/resources/archetype-resources/pom.xml	Thu Jul 18 16:11:14 2013 +0200
     2.2 +++ b/ko-archetype/src/main/resources/archetype-resources/pom.xml	Thu Jul 25 16:42:20 2013 +0200
     2.3 @@ -73,7 +73,7 @@
     2.4                    <systemProperties>
     2.5                        <systemProperty>
     2.6                            <key>browser.rootdir</key>
     2.7 -                          <value>\${basedir}/src/main/web/</value>
     2.8 +                          <value>\${basedir}/src/main/webapp/</value>
     2.9                        </systemProperty>
    2.10                    </systemProperties>
    2.11                    <mainClass>\${package}.Main</mainClass>
     3.1 --- a/ko-archetype/src/main/resources/archetype-resources/src/main/assembly/html.java.net.xml	Thu Jul 18 16:11:14 2013 +0200
     3.2 +++ b/ko-archetype/src/main/resources/archetype-resources/src/main/assembly/html.java.net.xml	Thu Jul 25 16:42:20 2013 +0200
     3.3 @@ -22,7 +22,7 @@
     3.4    </files>
     3.5    <fileSets>
     3.6      <fileSet>
     3.7 -       <directory>src/main/web/</directory>
     3.8 +       <directory>src/main/webapp/</directory>
     3.9         <outputDirectory>/</outputDirectory>
    3.10         <includes>
    3.11            <include>pages/**</include>
     4.1 --- a/ko-archetype/src/main/resources/archetype-resources/src/main/web/pages/index.html	Thu Jul 18 16:11:14 2013 +0200
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,79 +0,0 @@
     4.4 -<?xml version="1.0" encoding="UTF-8"?>
     4.5 -
     4.6 -<!--
     4.7 -    Copied from knockout.js Twitter example:
     4.8 -    http://knockoutjs.com/examples/twitter.html
     4.9 --->
    4.10 -
    4.11 -<!DOCTYPE html>
    4.12 -<html xmlns="http://www.w3.org/1999/xhtml">
    4.13 -    <head>
    4.14 -        <title>Knockout in Java Twitter</title>
    4.15 -    </head>
    4.16 -    <body>
    4.17 -        <link href='twitterExample.css' rel='Stylesheet' ></link>
    4.18 -        
    4.19 -        <style type='text/css'>
    4.20 -           .liveExample select { height: 1.7em; }
    4.21 -           .liveExample button { height: 2em; }
    4.22 -        </style>
    4.23 -        
    4.24 -        
    4.25 -        <h2>Knockout in Java Twitter</h2>
    4.26 -        
    4.27 -        <p>
    4.28 -        This code is based on original 
    4.29 -        <a href="http://knockoutjs.com/examples/twitter.html">knockout.js
    4.30 -        Twitter example</a> and
    4.31 -        uses almost unmodified HTML page. It just changes the model. The model
    4.32 -        is written in Java language with the help of 
    4.33 -        <a href="http://bck2brwsr.apidesign.org/javadoc/net.java.html.json/">
    4.34 -            Knockout/Java binding library
    4.35 -        </a>. The Java source code has about 180 lines and seems more 
    4.36 -        dense and shorter than the original JavaScript model.
    4.37 -        </p>
    4.38 -        <p>
    4.39 -        The project executes in real Java virtual
    4.40 -        machine and renders using JavaFX's WebView.
    4.41 -        </p>
    4.42 -        
    4.43 -        <div class='liveExample'>
    4.44 -            <div class='configuration'>
    4.45 -                <div class='listChooser'>
    4.46 -                    <button data-bind='click: deleteList, enable: activeTweetersName'>Delete</button>
    4.47 -                    <button data-bind='click: saveChanges, enable: hasUnsavedChanges'>Save</button> 
    4.48 -                    <select data-bind='options: savedLists, optionsValue: "name", value: activeTweetersName'> </select>
    4.49 -                </div>
    4.50 -
    4.51 -                <p>Currently viewing <span data-bind='text: activeTweetersCount'> </span> user(s):</p>
    4.52 -                <div class='currentUsers' >
    4.53 -                    <ul data-bind='foreach: activeTweeters'>
    4.54 -                        <li>
    4.55 -                            <button data-bind='click: $root.removeUser'>Remove</button>
    4.56 -                            <div data-bind='text: $data'> </div>
    4.57 -                        </li>
    4.58 -                    </ul>
    4.59 -                </div>
    4.60 -
    4.61 -                <form data-bind='submit: addUser'>
    4.62 -                    <label>Add user:</label>
    4.63 -                    <input data-bind='value: userNameToAdd, valueUpdate: "keyup", css: { invalid: !userNameToAddIsValid() }' />
    4.64 -                    <button data-bind='enable: userNameToAddIsValid' type='submit'>Add</button>
    4.65 -                </form>
    4.66 -            </div>
    4.67 -            <div class='tweets'>
    4.68 -                <div class='loadingIndicator' data-bind="visible: loading">Loading...</div>
    4.69 -                <table data-bind='foreach: currentTweets' width='100%'>
    4.70 -                    <tr>
    4.71 -                        <td><img data-bind='attr: { src: profile_image_url }' /></td>
    4.72 -                        <td>
    4.73 -                            <a class='twitterUser' data-bind='attr: { href: userUrl }, text: from_user'> </a>
    4.74 -                            <span data-bind='html: html'> </span>
    4.75 -                            <div class='tweetInfo' data-bind='text: created_at'> </div>
    4.76 -                        </td>
    4.77 -                    </tr>
    4.78 -                </table>
    4.79 -            </div>
    4.80 -        </div>
    4.81 -    </body>
    4.82 -</html>
     5.1 --- a/ko-archetype/src/main/resources/archetype-resources/src/main/web/pages/twitterExample.css	Thu Jul 18 16:11:14 2013 +0200
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,32 +0,0 @@
     5.4 -/*
     5.5 -    Copied from knockout.js Twitter example:
     5.6 -    http://knockoutjs.com/examples/twitter.html
     5.7 -*/
     5.8 -
     5.9 -.configuration, .tweets, .tweets td { font-family: Verdana; font-size: 13px; }
    5.10 -.configuration { background-color: #DEDEDE; border: 2px solid gray; float:left; height: 40em; width: 40%; padding: 0.5em; border-right-width:0; }
    5.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; }
    5.12 -.tweets table { border-width: 0;}
    5.13 -.tweets tr { vertical-align: top; }
    5.14 -.tweets td { padding: 0.4em 0.3em 1em 0.4em; border-width: 0; }
    5.15 -.tweets img { width: 4em; }
    5.16 -.tweetInfo { color: Gray; font-size: 0.9em; }
    5.17 -.twitterUser { color: #77AAFF; text-decoration: none; font-size: 1.1em; font-weight: bold; }
    5.18 -input.invalid { border: 1px solid red !important; background-color: #FFAAAA !important; }
    5.19 -
    5.20 -.listChooser select, .listChooser button { vertical-align:top; }
    5.21 -.listChooser select { width: 60%; font-size:1.2em; height:1.4em; }
    5.22 -.listChooser button { width: 19%; height:1.68em; float:right; }
    5.23 -
    5.24 -.currentUsers { height: 28em; overflow-y: auto; overflow-x: hidden; }
    5.25 -.currentUsers button { float: right; height: 2.5em; margin: 0.1em; padding-left: 1em; padding-right: 1em; }
    5.26 -.currentUsers ul, .configuration li { list-style: none; margin: 0; padding: 0 }
    5.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; }
    5.28 -.currentUsers li div { padding: 0.6em; }
    5.29 -.currentUsers li:hover { background-color: #EEC; }
    5.30 -
    5.31 -.configuration form label { width: 25%; display: inline-block; text-align:right; overflow: hidden; }
    5.32 -.configuration form input { width:40%; font-size: 1.3em; border:1px solid silver; background-color: White; padding: 0.1em; }
    5.33 -.configuration form button { width: 20%; margin-left: 0.3em; height: 2em; }
    5.34 -
    5.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; }
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/ko-archetype/src/main/resources/archetype-resources/src/main/webapp/pages/index.html	Thu Jul 25 16:42:20 2013 +0200
     6.3 @@ -0,0 +1,79 @@
     6.4 +<?xml version="1.0" encoding="UTF-8"?>
     6.5 +
     6.6 +<!--
     6.7 +    Copied from knockout.js Twitter example:
     6.8 +    http://knockoutjs.com/examples/twitter.html
     6.9 +-->
    6.10 +
    6.11 +<!DOCTYPE html>
    6.12 +<html xmlns="http://www.w3.org/1999/xhtml">
    6.13 +    <head>
    6.14 +        <title>Knockout in Java Twitter</title>
    6.15 +    </head>
    6.16 +    <body>
    6.17 +        <link href='twitterExample.css' rel='Stylesheet' ></link>
    6.18 +        
    6.19 +        <style type='text/css'>
    6.20 +           .liveExample select { height: 1.7em; }
    6.21 +           .liveExample button { height: 2em; }
    6.22 +        </style>
    6.23 +        
    6.24 +        
    6.25 +        <h2>Knockout in Java Twitter</h2>
    6.26 +        
    6.27 +        <p>
    6.28 +        This code is based on original 
    6.29 +        <a href="http://knockoutjs.com/examples/twitter.html">knockout.js
    6.30 +        Twitter example</a> and
    6.31 +        uses almost unmodified HTML page. It just changes the model. The model
    6.32 +        is written in Java language with the help of 
    6.33 +        <a href="http://bck2brwsr.apidesign.org/javadoc/net.java.html.json/">
    6.34 +            Knockout/Java binding library
    6.35 +        </a>. The Java source code has about 180 lines and seems more 
    6.36 +        dense and shorter than the original JavaScript model.
    6.37 +        </p>
    6.38 +        <p>
    6.39 +        The project executes in real Java virtual
    6.40 +        machine and renders using JavaFX's WebView.
    6.41 +        </p>
    6.42 +        
    6.43 +        <div class='liveExample'>
    6.44 +            <div class='configuration'>
    6.45 +                <div class='listChooser'>
    6.46 +                    <button data-bind='click: deleteList, enable: activeTweetersName'>Delete</button>
    6.47 +                    <button data-bind='click: saveChanges, enable: hasUnsavedChanges'>Save</button> 
    6.48 +                    <select data-bind='options: savedLists, optionsValue: "name", value: activeTweetersName'> </select>
    6.49 +                </div>
    6.50 +
    6.51 +                <p>Currently viewing <span data-bind='text: activeTweetersCount'> </span> user(s):</p>
    6.52 +                <div class='currentUsers' >
    6.53 +                    <ul data-bind='foreach: activeTweeters'>
    6.54 +                        <li>
    6.55 +                            <button data-bind='click: $root.removeUser'>Remove</button>
    6.56 +                            <div data-bind='text: $data'> </div>
    6.57 +                        </li>
    6.58 +                    </ul>
    6.59 +                </div>
    6.60 +
    6.61 +                <form data-bind='submit: addUser'>
    6.62 +                    <label>Add user:</label>
    6.63 +                    <input data-bind='value: userNameToAdd, valueUpdate: "keyup", css: { invalid: !userNameToAddIsValid() }' />
    6.64 +                    <button data-bind='enable: userNameToAddIsValid' type='submit'>Add</button>
    6.65 +                </form>
    6.66 +            </div>
    6.67 +            <div class='tweets'>
    6.68 +                <div class='loadingIndicator' data-bind="visible: loading">Loading...</div>
    6.69 +                <table data-bind='foreach: currentTweets' width='100%'>
    6.70 +                    <tr>
    6.71 +                        <td><img data-bind='attr: { src: profile_image_url }' /></td>
    6.72 +                        <td>
    6.73 +                            <a class='twitterUser' data-bind='attr: { href: userUrl }, text: from_user'> </a>
    6.74 +                            <span data-bind='html: html'> </span>
    6.75 +                            <div class='tweetInfo' data-bind='text: created_at'> </div>
    6.76 +                        </td>
    6.77 +                    </tr>
    6.78 +                </table>
    6.79 +            </div>
    6.80 +        </div>
    6.81 +    </body>
    6.82 +</html>
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/ko-archetype/src/main/resources/archetype-resources/src/main/webapp/pages/twitterExample.css	Thu Jul 25 16:42:20 2013 +0200
     7.3 @@ -0,0 +1,32 @@
     7.4 +/*
     7.5 +    Copied from knockout.js Twitter example:
     7.6 +    http://knockoutjs.com/examples/twitter.html
     7.7 +*/
     7.8 +
     7.9 +.configuration, .tweets, .tweets td { font-family: Verdana; font-size: 13px; }
    7.10 +.configuration { background-color: #DEDEDE; border: 2px solid gray; float:left; height: 40em; width: 40%; padding: 0.5em; border-right-width:0; }
    7.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; }
    7.12 +.tweets table { border-width: 0;}
    7.13 +.tweets tr { vertical-align: top; }
    7.14 +.tweets td { padding: 0.4em 0.3em 1em 0.4em; border-width: 0; }
    7.15 +.tweets img { width: 4em; }
    7.16 +.tweetInfo { color: Gray; font-size: 0.9em; }
    7.17 +.twitterUser { color: #77AAFF; text-decoration: none; font-size: 1.1em; font-weight: bold; }
    7.18 +input.invalid { border: 1px solid red !important; background-color: #FFAAAA !important; }
    7.19 +
    7.20 +.listChooser select, .listChooser button { vertical-align:top; }
    7.21 +.listChooser select { width: 60%; font-size:1.2em; height:1.4em; }
    7.22 +.listChooser button { width: 19%; height:1.68em; float:right; }
    7.23 +
    7.24 +.currentUsers { height: 28em; overflow-y: auto; overflow-x: hidden; }
    7.25 +.currentUsers button { float: right; height: 2.5em; margin: 0.1em; padding-left: 1em; padding-right: 1em; }
    7.26 +.currentUsers ul, .configuration li { list-style: none; margin: 0; padding: 0 }
    7.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; }
    7.28 +.currentUsers li div { padding: 0.6em; }
    7.29 +.currentUsers li:hover { background-color: #EEC; }
    7.30 +
    7.31 +.configuration form label { width: 25%; display: inline-block; text-align:right; overflow: hidden; }
    7.32 +.configuration form input { width:40%; font-size: 1.3em; border:1px solid silver; background-color: White; padding: 0.1em; }
    7.33 +.configuration form button { width: 20%; margin-left: 0.3em; height: 2em; }
    7.34 +
    7.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; }