You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2013/05/30 09:47:53 UTC

[18/28] ISIS-406: fixing up example/application/wrj prior to recreating archetype

http://git-wip-us.apache.org/repos/asf/isis/blob/ef0dbe84/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/about/index.html
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/about/index.html b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/about/index.html
new file mode 100644
index 0000000..cb966e6
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/about/index.html
@@ -0,0 +1,184 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+         http://www.apache.org/licenses/LICENSE-2.0
+         
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+        <title>Apache Isis&trade; QuickStart (Wicket/Restful/JDO/Shiro)</title>
+        
+        <style type="text/css">
+body {
+    background-color: #1A467B;
+    font-family: Verdana, Helvetica, Arial;
+    font-size: 90%;
+}
+
+li {
+    margin-top: 6px;
+    margin-bottom: 6px;
+}
+table {
+    border-collapse: collapse;
+}
+table, th, td {
+    border: 1px;
+    border-style: solid;
+    border-color: lightgray;
+}
+th, td {
+    padding: 10px;
+}
+#wrapper {
+    background-color: #ffffff;
+    width: 900px;
+    margin: 8px auto;
+    padding: 12px;
+}
+        </style>
+    </head>
+    <body>
+        <div id="wrapper">
+            <img alt="Isis Logo" src="about/images/isis-logo.png" />
+             
+            <p>This app has been generated by the <a href="http://isis.apache.org/getting-started/quickstart-archetype.html">quickstart</a> (wicket/restful/jdo/shiro) archetype for 
+            <a href="http://isis.apache.org">Apache Isis</a>&trade;, a framework to let you rapidly develop 
+            domain-driven apps in Java.</p>
+            
+            <p>
+            The app consists of a bare minimum of classes, so that you can easily strip it back and
+            reuse for your own purposes.  It is configured with:
+            </p>
+            
+            <table>
+                <tr>
+                    <th>Component</th>
+                    <th>Access URL</th>
+                    <th>Description</th>
+                    <th>Further info on the Isis website</th>
+                </tr>
+                <tr>
+                    <td>Wicket Viewer</td>
+                    <td><a href="wicket/">wicket/</a></td>
+                    <td>Provides a generic UI for end-users, built with <a href="http://wicket.apache.org">Apache Wicket</a>&trade;</td>
+                    <td><a href="http://isis.apache.org/components/viewers/wicket/about.html">wicket viewer</a></td>
+                </tr>
+                <tr>
+                    <td>RestfulObjects Viewer</td>
+                    <td><a href="restful/">restful/</a></td>
+                    <td>Provides a RESTful API conformant with the <a href="http://restfulobjects.org">Restful Objects</a> spec</td>
+                    <td><a href="http://isis.apache.org/components/viewers/restfulobjects/about.html">restfulobjects viewer</a></td>
+                </tr>
+                <tr>
+                    <td>JDO Object&nbsp;Store</td>
+                    <td>n/a</td>
+                    <td>Persists objects using JDO/DataNucleus; configured to use HSQLDB in-memory database</td>
+                    <td><a href="http://isis.apache.org/components/objectstores/jdo/about.html">jdo&nbsp;objectstore</a></td>
+                </tr>
+                <tr>
+                    <td>Shiro Security</td>
+                    <td>n/a</td>
+                    <td>Provides authentication and authorization, using <a href="http://shiro.apache.org">Apache Shiro</a>&trade;</td>
+                    <td><a href="http://isis.apache.org/components/security/shiro/about.html">shiro security</a></td>
+                </tr>
+            </table>
+    
+            <h2>App contents</h2>
+            <p>The key files in the application are:</p>
+            <!-- the hrefs below are partially URL encoded to prevent them from being modified when the archetype is created -->
+            <ul>
+              <li>Domain classes (todo functionality) (in <tt>dom</tt> module and <tt>objstore-jdo</tt> module)</a>
+                  <ul>
+                  <li><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java"><tt>ToDoItem</tt></a> domain entity
+                  </li>
+                  <li><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItems.java"><tt>ToDoItems</tt></a> domain service (repository/factory)
+                  </li>
+                  <li><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/objstore-jdo/src/main/java/objstore/jdo/todo/ToDoItemsJdo.java"><tt>ToDoItemsJdo</tt></a> domain service (repository methods overridden for JDO)
+                  </li>
+                  </ul>
+              </li>
+              <li>Fixture classes (in <tt>fixture</tt> module)</a>
+                <ul>
+                  <li><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/fixture/src/main/java/fixture/todo/ToDoItemsFixture.java"><tt>ToDoItemsFixture</tt></a> example fixture data (since configured for in-memory HSQLDB)
+                  </li>
+                  <li><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java"><tt>ToDoItemsFixtureService</tt></a> domain service to install fixtures at run-time
+                  </li>
+                </ul>
+              </li>
+              <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/viewer-webapp/src/main/webapp/WEB-INF/web.xml">WEB-INF/web.xml</a></tt> (in <tt>viewer-webapp</tt> module)</a>
+                <ul>
+                  <li><tt>AboutPageFilter</tt> - filter that redirects to this page 
+                  </li>
+                  <li><tt>ResourceCachingFilter</tt> and <tt>ResourceServlet</tt> - filter and servlet for serving up static resources. 
+                  </li>
+                  <li><tt>WicketFilter</tt> - filter for the wicket application, mapped to <tt>/wicket/*</tt> 
+                  </li>
+                  <li><tt>ResteasyBootstrap</tt>, <tt>IsisSessionFilterForRestfulObjects</tt>, <tt>RestfulObjectsRestEasyDispatcher</tt> - listeners, filters and servlets to bootstrap and map restful objects viewer to <tt>/restful/*</tt>. 
+                  </li>
+                  <li>commented out <tt>IsisWebAppBootstrapper</tt> listener; this is NOT required unless wicket viewer config is removed 
+                  </li>
+                </ul>
+              </li>
+              <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/viewer-webapp/src/main/webapp/WEB-INF/isis.properties">WEB-INF/isis.properties</a></tt> (in <tt>viewer-webapp</tt> module)</a>
+                <ul>
+                  <li><tt>isis.services</tt> - specifies the two domain services described above (<tt>ToDoItemsJdo</tt> and <tt>ToDoItemsFixtureService</tt>), appearing on the menu bar in the Wicket viewer, 
+                  along with a number of hidden framework-provided domain services demonstrating Isis' support for publishing, auditing and customizable error handling 
+                  </li>
+                  <li><tt>isis.persistor</tt> - specifies to use the JDO object store
+                  </li>
+                  <li><tt>isis.authentication</tt> and <tt>isis.authorization</tt> - security mechanism to use (<tt>bypass</tt> effectively disables) 
+                  </li>
+                </ul>
+              </li>
+              <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/viewer-webapp/src/main/webapp/WEB-INF/persistor_datanucleus.properties">WEB-INF/persistor_datanucleus.properties</a></tt> (in <tt>viewer-webapp</tt> module)</a>
+                <ul>
+                  <li>configuration for JDO object store 
+                  </li>
+                </ul>
+              </li>
+              <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/viewer-webapp/src/main/webapp/WEB-INF/shiro.ini">WEB-INF/shiro.ini</a></tt> (in <tt>viewer-webapp</tt> module)</a>
+                <ul>
+                  <li>configuration for Shiro security
+                  </li>
+                </ul>
+              </li>
+            </ul>
+    
+            <h2>Next steps</h2>
+            <p>Use the following as a check-list for refactoring towards your own application:
+            <ul>
+              <li>Experiment with users, roles and permissions (in <tt>shiro.ini</tt>)
+              </li>
+              <li>Refactor the <tt>ToDoItem</tt>, <tt>ToDoItems</tt> and <tt>ToDoItemsJdo</tt> towards your own application's functionality; obviously you are likely to introduce many more classes and services
+              </li>
+              <li>Reconfigure <tt>persistor_datanucleus.properties</tt> to specify the JDBC URL to the database you wish to work with; if necessary also update the <tt>pom.xml</tt> in the <tt>viewer-webapp</tt> module to add the JDBC driver to the classpath
+              </li>
+              <li>Assuming you are using a persistent data store, then remove the <tt>ToDoItemsFixtureService</tt> from the <tt>isis.properties</tt> file (<tt>isis.services</tt> key).  Alternatively you could keep but refactor to provide a similar service for your own application's domain.    
+              </li>
+              <li>Replace (or remove) the publishing and auditing service implementations.
+              </li>
+              <li>If you want the wicket viewer but NOT the restful objects viewer, then remove/comment out the <tt>ResteasyBootstrap</tt>, <tt>IsisSessionFilterForRestfulObjects</tt>, <tt>RestfulObjectsRestEasyDispatcher</tt> from <tt>web.xml</tt>
+              </li>
+              <li>If you want the restful objects viewer but NOT the wicket viewer, then remove/comment out the <tt>WicketFilter</tt> filter and uncomment the <tt>IsisWebAppBootstrapper</tt> listener in <tt>web.xml</tt>
+              </li>
+              <li>Update this page (<tt>about/index.html</tt>) as required for your application, and/or remove the <tt>welcome-file-list</tt> from <tt>web.xml</tt>
+              </li>
+            </ul>
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/isis/blob/ef0dbe84/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/css/application.css
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/css/application.css b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/css/application.css
new file mode 100644
index 0000000..1e2caf9
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/css/application.css
@@ -0,0 +1,32 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/*
+uncomment to add a logo (in an ../images directory relative to this file)
+
+#header {
+    height: 48px;
+    background-image: url("../images/logo.png");
+	background-repeat: no-repeat;
+}
+
+#header h1 {
+	display: none;
+}
+*/

http://git-wip-us.apache.org/repos/asf/isis/blob/ef0dbe84/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/scripts/application.js
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/scripts/application.js b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/scripts/application.js
new file mode 100644
index 0000000..d8cf6fe
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/scripts/application.js
@@ -0,0 +1,3 @@
+$(document).ready(function() {
+	/// here...
+});
\ No newline at end of file