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 2011/11/23 23:02:53 UTC

svn commit: r1205627 - in /incubator/isis/trunk/framework: core/commons/src/main/java/org/apache/isis/core/commons/config/ core/commons/src/main/java/org/apache/isis/core/commons/resource/ core/metamodel/src/main/java/org/apache/isis/core/metamodel/spe...

Author: danhaywood
Date: Wed Nov 23 22:02:48 2011
New Revision: 1205627

URL: http://svn.apache.org/viewvc?rev=1205627&view=rev
Log:
ISIS-109, 107: add in ObjectActionParameter#getId() (similar to ObjectActionParameter#getName() - for json-viewer; changing the way that the examples and quickstart can be run as standalone WARs (given that the quickrun has been removed); some updates to json-viewer docs and to site docs

Added:
    incubator/isis/trunk/framework/viewer/json/src/docbkx/guide/images/restfulobjects.png   (with props)
Removed:
    incubator/isis/trunk/framework/viewer/dnd-tck/src/main/resources/viewer_html.properties
Modified:
    incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/config/ConfigurationConstants.java
    incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderDefault.java
    incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/resource/ResourceStreamSourceContextLoaderClassPath.java
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectActionSet.java
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java
    incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionImpl.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/runner/IsisRunner.java
    incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/testsystem/TestProxyAction.java
    incubator/isis/trunk/framework/runtimes/dflt/webapp/src/main/java/org/apache/isis/runtimes/dflt/webapp/IsisWebAppBootstrapper.java
    incubator/isis/trunk/framework/tck/pom.xml
    incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/component/html/AbstractHtmlPage.java
    incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/component/html/HtmlComponentFactory.java
    incubator/isis/trunk/framework/viewer/html/src/test/java/org/apache/isis/viewer/html/context/ObjectActionNoop.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelper.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ObjectActionReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypeResourceServerside.java
    incubator/isis/trunk/framework/viewer/json/src/docbkx/guide/isis-json-viewer.xml
    incubator/isis/trunk/framework/viewer/pom.xml
    incubator/isis/trunk/framework/viewer/src/site/apt/index.apt
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
    incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketUnsecuredApplication.java

Modified: incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/config/ConfigurationConstants.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/config/ConfigurationConstants.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/config/ConfigurationConstants.java (original)
+++ incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/config/ConfigurationConstants.java Wed Nov 23 22:02:48 2011
@@ -27,7 +27,8 @@ public final class ConfigurationConstant
     public static final String LIST_SEPARATOR = ",";
     public static final String DELIMITER = ".";
     public static final String DEFAULT_CONFIG_DIRECTORY = "config";
-    public static final String WEBINF_CONFIG_DIRECTORY = "src/main/webapp/WEB-INF";
+    public static final String WEBINF_DIRECTORY = "WEB-INF";
+    public static final String WEBINF_FULL_DIRECTORY = "src/main/webapp/" + WEBINF_DIRECTORY;
 
     public static final String DEFAULT_CONFIG_FILE = "isis.properties";
     public static final String WEB_CONFIG_FILE = "web.properties";

Modified: incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderDefault.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderDefault.java (original)
+++ incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderDefault.java Wed Nov 23 22:02:48 2011
@@ -54,8 +54,12 @@ public class IsisConfigurationBuilderDef
         if (firstDirectory != null) {
             rssList.add(fromFileSystem(firstDirectory));
         }
-        rssList.addAll(Arrays.asList(fromFileSystem(ConfigurationConstants.DEFAULT_CONFIG_DIRECTORY),
-            fromFileSystem(ConfigurationConstants.WEBINF_CONFIG_DIRECTORY), fromClassPath()));
+        rssList.addAll(Arrays.asList(
+                fromFileSystem(ConfigurationConstants.DEFAULT_CONFIG_DIRECTORY),
+                fromFileSystem(ConfigurationConstants.WEBINF_FULL_DIRECTORY), 
+                fromClassPath(), 
+                fromClassPath(ConfigurationConstants.WEBINF_DIRECTORY))
+            );
         return rssList.toArray(new ResourceStreamSource[0]);
     }
 
@@ -64,7 +68,11 @@ public class IsisConfigurationBuilderDef
     }
 
     private static ResourceStreamSource fromClassPath() {
-        return new ResourceStreamSourceContextLoaderClassPath();
+        return ResourceStreamSourceContextLoaderClassPath.create();
+    }
+
+    private static ResourceStreamSource fromClassPath(final String prefix) {
+        return ResourceStreamSourceContextLoaderClassPath.create(prefix);
     }
 
 }

Modified: incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/resource/ResourceStreamSourceContextLoaderClassPath.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/resource/ResourceStreamSourceContextLoaderClassPath.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/resource/ResourceStreamSourceContextLoaderClassPath.java (original)
+++ incubator/isis/trunk/framework/core/commons/src/main/java/org/apache/isis/core/commons/resource/ResourceStreamSourceContextLoaderClassPath.java Wed Nov 23 22:02:48 2011
@@ -21,6 +21,8 @@ package org.apache.isis.core.commons.res
 
 import java.io.InputStream;
 
+import org.apache.isis.core.commons.lang.PathUtils;
+
 /**
  * Loads the properties from the ContextClassLoader.
  * 
@@ -30,10 +32,27 @@ import java.io.InputStream;
  */
 public class ResourceStreamSourceContextLoaderClassPath extends ResourceStreamSourceAbstract {
 
+    
+    public static ResourceStreamSourceContextLoaderClassPath create() {
+        return create("");
+    }
+
+    public static ResourceStreamSourceContextLoaderClassPath create(String prefix) {
+        return new ResourceStreamSourceContextLoaderClassPath(prefix);
+    }
+
+    private final String prefix;
+
+    private ResourceStreamSourceContextLoaderClassPath(final String prefix) {
+        this.prefix = prefix;
+    }
+
+
     @Override
     protected InputStream doReadResource(final String resourcePath) {
         final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-        return classLoader.getResourceAsStream(resourcePath);
+        final String path = PathUtils.combine(prefix, resourcePath);
+        return classLoader.getResourceAsStream(path);
     }
 
     @Override

Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectActionSet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectActionSet.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectActionSet.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectActionSet.java Wed Nov 23 22:02:48 2011
@@ -230,7 +230,12 @@ public class ObjectActionSet implements 
     }
 
     @Override
-    public ObjectActionParameter getParameter(String paramName) {
+    public ObjectActionParameter getParameterById(String paramId) {
+        return null;
+    }
+
+    @Override
+    public ObjectActionParameter getParameterByName(String paramName) {
         return null;
     }
 

Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAction.java Wed Nov 23 22:02:48 2011
@@ -160,9 +160,14 @@ public interface ObjectAction extends Ob
     List<ObjectActionParameter> getParameters(Filter<ObjectActionParameter> filter);
 
     /**
+     * Returns the parameter with provided id.
+     */
+    ObjectActionParameter getParameterById(String paramId);
+
+    /**
      * Returns the parameter with provided name.
      */
-    ObjectActionParameter getParameter(String paramName);
+    ObjectActionParameter getParameterByName(String paramName);
 
     // //////////////////////////////////////////////////////
     // Parameters (per instance)

Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionImpl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionImpl.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionImpl.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionImpl.java Wed Nov 23 22:02:48 2011
@@ -279,7 +279,19 @@ public class ObjectActionImpl extends Ob
     }
 
     @Override
-    public ObjectActionParameter getParameter(String paramName) {
+    public ObjectActionParameter getParameterById(String paramId) {
+        final List<ObjectActionParameter> allParameters = getParameters();
+        for (int i = 0; i < allParameters.size(); i++) {
+            final ObjectActionParameter param = allParameters.get(i);
+            if (Objects.equal(paramId, param.getId())) {
+                return param;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public ObjectActionParameter getParameterByName(String paramName) {
         final List<ObjectActionParameter> allParameters = getParameters();
         for (int i = 0; i < allParameters.size(); i++) {
             final ObjectActionParameter param = allParameters.get(i);

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/runner/IsisRunner.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/runner/IsisRunner.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/runner/IsisRunner.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/runner/IsisRunner.java Wed Nov 23 22:02:48 2011
@@ -98,8 +98,8 @@ public class IsisRunner {
     }
 
     private String determineConfigDirectory() {
-        if (new File(ConfigurationConstants.WEBINF_CONFIG_DIRECTORY).exists()) {
-            return ConfigurationConstants.WEBINF_CONFIG_DIRECTORY;
+        if (new File(ConfigurationConstants.WEBINF_FULL_DIRECTORY).exists()) {
+            return ConfigurationConstants.WEBINF_FULL_DIRECTORY;
         } else {
             return ConfigurationConstants.DEFAULT_CONFIG_DIRECTORY;
         }

Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/testsystem/TestProxyAction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/testsystem/TestProxyAction.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/testsystem/TestProxyAction.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/test/java/org/apache/isis/runtimes/dflt/runtime/testsystem/TestProxyAction.java Wed Nov 23 22:02:48 2011
@@ -92,7 +92,12 @@ public class TestProxyAction extends Fac
     }
 
     @Override
-    public ObjectActionParameter getParameter(String paramName) {
+    public ObjectActionParameter getParameterById(String paramId) {
+        return null;
+    }
+
+    @Override
+    public ObjectActionParameter getParameterByName(String paramName) {
         return null;
     }
 

Modified: incubator/isis/trunk/framework/runtimes/dflt/webapp/src/main/java/org/apache/isis/runtimes/dflt/webapp/IsisWebAppBootstrapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/webapp/src/main/java/org/apache/isis/runtimes/dflt/webapp/IsisWebAppBootstrapper.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/webapp/src/main/java/org/apache/isis/runtimes/dflt/webapp/IsisWebAppBootstrapper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/webapp/src/main/java/org/apache/isis/runtimes/dflt/webapp/IsisWebAppBootstrapper.java Wed Nov 23 22:02:48 2011
@@ -79,7 +79,7 @@ public class IsisWebAppBootstrapper impl
             // will load either from WEB-INF or from the classpath.
             final IsisConfigurationBuilder isisConfigurationBuilder =
                 new IsisConfigurationBuilderResourceStreams(new ResourceStreamSourceForWebInf(servletContext),
-                    new ResourceStreamSourceContextLoaderClassPath());
+                    ResourceStreamSourceContextLoaderClassPath.create());
 
             primeConfigurationBuilder(isisConfigurationBuilder, servletContext);
 

Modified: incubator/isis/trunk/framework/tck/pom.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/tck/pom.xml?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/tck/pom.xml (original)
+++ incubator/isis/trunk/framework/tck/pom.xml Wed Nov 23 22:02:48 2011
@@ -460,23 +460,6 @@
                 <version>${isis.version}</version>
             </dependency>
 
-            <!-- isis: viewer: xhtml -->
-            <dependency>
-                <groupId>org.apache.isis.viewer</groupId>
-                <artifactId>xhtml</artifactId>
-                <version>${isis.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.isis.viewer</groupId>
-                <artifactId>xhtml-applib</artifactId>
-                <version>${isis.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.isis.viewer</groupId>
-                <artifactId>xhtml-viewer</artifactId>
-                <version>${isis.version}</version>
-            </dependency>
-
             <!-- isis: viewer: json -->
             <dependency>
                 <groupId>org.apache.isis.viewer</groupId>

Modified: incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/component/html/AbstractHtmlPage.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/component/html/AbstractHtmlPage.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/component/html/AbstractHtmlPage.java (original)
+++ incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/component/html/AbstractHtmlPage.java Wed Nov 23 22:02:48 2011
@@ -87,7 +87,7 @@ public abstract class AbstractHtmlPage i
             if (i++ > 0) {
                 writer.print("alternate ");
             }
-            writer.print("stylesheet\" title=\"Style " + i + "\" href=\"./");
+            writer.print("stylesheet\" title=\"Style " + i + "\" href=\"");
             writer.print(style);
             writer.println("\" type=\"text/css\" media=\"all\"/>");
         }

Modified: incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/component/html/HtmlComponentFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/component/html/HtmlComponentFactory.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/component/html/HtmlComponentFactory.java (original)
+++ incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/component/html/HtmlComponentFactory.java Wed Nov 23 22:02:48 2011
@@ -53,7 +53,7 @@ public class HtmlComponentFactory implem
     protected final String styleSheet;
 
     public HtmlComponentFactory() {
-        final IsisConfiguration configuration = IsisContext.getConfiguration();
+        final IsisConfiguration configuration = getConfiguration();
         styleSheet = configuration.getString(STYLE_SHEET);
         String file = configuration.getString(HEADER_FILE);
         header = file == null ? configuration.getString(HEADER) : loadFile(file);
@@ -223,4 +223,9 @@ public class HtmlComponentFactory implem
         }
         return content.toString();
     }
+    
+    protected IsisConfiguration getConfiguration() {
+        return IsisContext.getConfiguration();
+    }
+    
 }

Modified: incubator/isis/trunk/framework/viewer/html/src/test/java/org/apache/isis/viewer/html/context/ObjectActionNoop.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/html/src/test/java/org/apache/isis/viewer/html/context/ObjectActionNoop.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/html/src/test/java/org/apache/isis/viewer/html/context/ObjectActionNoop.java (original)
+++ incubator/isis/trunk/framework/viewer/html/src/test/java/org/apache/isis/viewer/html/context/ObjectActionNoop.java Wed Nov 23 22:02:48 2011
@@ -166,7 +166,12 @@ public class ObjectActionNoop implements
     }
 
     @Override
-    public ObjectActionParameter getParameter(String paramName) {
+    public ObjectActionParameter getParameterById(String paramId) {
+        return null;
+    }
+
+    @Override
+    public ObjectActionParameter getParameterByName(String paramName) {
         return null;
     }
 

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelper.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelper.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelper.java Wed Nov 23 22:02:48 2011
@@ -576,7 +576,7 @@ public final class DomainResourceHelper 
         // ensure that we have no arguments that are not parameters
         for(Entry<String, JsonRepresentation> arg: arguments.mapIterable()) {
             final String argName = arg.getKey();
-            if(action.getParameter(argName) == null) {
+            if(action.getParameterById(argName) == null) {
                 throw JsonApplicationException.create(
                         HttpStatusCode.BAD_REQUEST,
                         "Action '%s' does not have a parameter %s but an argument of that name was provided",
@@ -587,13 +587,13 @@ public final class DomainResourceHelper 
         // ensure that an argument value has been provided for all non-optional parameters 
         final List<ObjectActionParameter> parameters = action.getParameters();
         for (ObjectActionParameter param : parameters) {
-            final String paramName = param.getName();
-            final JsonRepresentation argRepr = arguments.getRepresentation(paramName);
+            final String paramId = param.getId();
+            final JsonRepresentation argRepr = arguments.getRepresentation(paramId);
             if(argRepr == null && !param.isOptional()) {
                 throw JsonApplicationException.create(
                         HttpStatusCode.BAD_REQUEST,
                         "Action '%s', no argument found for (mandatory) parameter '%s'",
-                        action.getId(), paramName);
+                        action.getId(), paramId);
             }
             argList.add(argRepr);
         }

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ObjectActionReprRenderer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ObjectActionReprRenderer.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ObjectActionReprRenderer.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ObjectActionReprRenderer.java Wed Nov 23 22:02:48 2011
@@ -131,7 +131,7 @@ public class ObjectActionReprRenderer ex
         JsonRepresentation argMap = JsonRepresentation.newMap();
         List<ObjectActionParameter> parameters = objectMember.getParameters();
         for(int i=0; i<objectMember.getParameterCount(); i++) {
-            argMap.mapPut(parameters.get(i).getName(), argValueFor(i)); 
+            argMap.mapPut(parameters.get(i).getId(), argValueFor(i)); 
         }
         return argMap;
     }
@@ -164,8 +164,9 @@ public class ObjectActionReprRenderer ex
 
 	private Object paramDetails(ObjectActionParameter param) {
 		final JsonRepresentation paramRep = JsonRepresentation.newMap();
-		paramRep.mapPut("name", param.getName());
 		paramRep.mapPut("num", param.getNumber());
+		paramRep.mapPut("id", param.getId());
+		paramRep.mapPut("name", param.getName());
 		paramRep.mapPut("description", param.getDescription());
 		Object paramChoices = choicesFor(param);
 		if(paramChoices != null) {

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypeResourceServerside.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypeResourceServerside.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypeResourceServerside.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypeResourceServerside.java Wed Nov 23 22:02:48 2011
@@ -210,7 +210,7 @@ public class DomainTypeResourceServersid
         }
         ObjectAction parentAction = (ObjectAction) objectMember;
         
-        ObjectActionParameter actionParam = parentAction.getParameter(paramName);
+        ObjectActionParameter actionParam = parentAction.getParameterByName(paramName);
 
         final RendererFactory rendererFactory = 
                 rendererFactoryRegistry.find(representationType);

Added: incubator/isis/trunk/framework/viewer/json/src/docbkx/guide/images/restfulobjects.png
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/src/docbkx/guide/images/restfulobjects.png?rev=1205627&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/isis/trunk/framework/viewer/json/src/docbkx/guide/images/restfulobjects.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/isis/trunk/framework/viewer/json/src/docbkx/guide/isis-json-viewer.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/src/docbkx/guide/isis-json-viewer.xml?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/src/docbkx/guide/isis-json-viewer.xml (original)
+++ incubator/isis/trunk/framework/viewer/json/src/docbkx/guide/isis-json-viewer.xml Wed Nov 23 22:02:48 2011
@@ -32,45 +32,29 @@
     <title>Preface</title>
 
     <para><emphasis>Apache Isis</emphasis> is designed to allow programmers
-    rapidly develop domain-driven applications following the <ulink
-    url="http://en.wikipedia.org/wiki/Naked_Objects">Naked Objects</ulink>
-    pattern. It is made up of a core framework that supports supports variouys
-    viewers, along with <acronym>API</acronym>s and implementations relating
-    to security, the programming model, the runtime (persistence) and profile
-    stores (user preferences). <emphasis>Apache Isis</emphasis> is hosted at
-    the <ulink url="http://incubator.apache.org/isis">Apache
-    Foundation</ulink>, and is licensed under <ulink
+    rapidly prototype, develop and deploy domain-driven applications. It is
+    made up of a core framework that supports supports variouys viewers, along
+    with <acronym>API</acronym>s and implementations relating to security, the
+    programming model, the runtime (persistence) and profile stores (user
+    preferences). <emphasis>Apache Isis</emphasis> is hosted at the <ulink
+    url="http://incubator.apache.org/isis">Apache Foundation</ulink>, and is
+    licensed under <ulink
     url="http://www.apache.org/licenses/LICENSE-2.0.html">Apache Software
     License v2</ulink>.</para>
 
     <para><emphasis>Isis</emphasis>' <emphasis>json</emphasis> viewer
-    <package>[oai.viewer:json]</package> renders each domain objects as <ulink
-    url="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful</ulink>
-    resources. Each domain object is exposed as an <acronym>JSON</acronym>
-    (<emphasis>J</emphasis>ava<emphasis>S</emphasis>cript
-    <emphasis>O</emphasis>bject <emphasis>N</emphasis>otation) resource
-    through <acronym>HTTP GET</acronym> and can be used to access other
-    related objects by following links that represent the associations of the
-    domain object. The domain object can be interacted with by modifying its
-    state (through <acronym>HTTP PUT</acronym>) or by invoking its actions
-    (through <acronym>HTTP POST</acronym>).</para>
-
-    <para>One of the appeals of <acronym>JSON</acronym> is that it is
-    increasingly being used as a data exchange protocol independent of any
-    particular technology. A JSON string is directly serializable as a graph
-    of <acronym>JSON</acronym> objects, but there are also libraries for all
-    the main stream platforms (Java, .NET, Ruby, Python) to consume and create
-    JSON. The JSON viewer therefore opens up a domain objects model for
-    consumption in other languages.</para>
-
-    <para>Conversely, it is feasible for frameworks other than
-    <emphasis>Isis</emphasis> to generate <acronym>JSON</acronym>
-    representations (so long as they have a similar concept of what makes up a
-    domain object model). To support this, the <ulink
-    url="http://restfulobjects.org">Restful Objects</ulink> specification
-    (hosted at <ulink
-    url="http://restfulobjects.org">http://restfulobjects.org</ulink>) has
-    been created. </para>
+    <package>[oai.viewer:json]</package> is an implementation of the the
+    <ulink url="http://restfulobjects.org">Restful Objects</ulink>
+    specification (hosted at <ulink
+    url="http://restfulobjects.org">http://restfulobjects.org</ulink>). This
+    defines a set of RESTful resources, and corresponding JSON
+    representations, for accessing and manipulating a domain object
+    model.</para>
+
+    <para>The Restful Objects specification defines a means by which
+    implementations can indicate which of its optional features have been
+    implemented (the "version" resource). Isis implements the majority of the
+    spec.</para>
 
     <sect1>
       <title>Who this Guide is For</title>
@@ -138,35 +122,942 @@
 
   <!-- main content -->
 
+  <chapter id="chp.Introduction">
+    <title>Introduction</title>
+
+    <abstract>
+      <para>An introduction to <acronym>REST</acronym> and how it maps onto an
+      <emphasis>Apache Isis</emphasis> domain model.</para>
+    </abstract>
+
+    <para>This chapter briefly explains what <acronym>REST</acronym> is, and
+    why you might want to use it. It then explains how the <emphasis>json
+    viewer</emphasis> exposes your domain model using
+    <acronym>REST</acronym>.</para>
+
+    <sect1>
+      <title>REST 101</title>
+
+      <para>Web services were introduced as a means for different computer
+      systems to interact by network even though they may be implemented in
+      different technologies and with different implied domain models.
+      <acronym>SOAP</acronym> is probably the best well-known protocol for
+      doing this, though there have been others. These days there is a whole
+      bunch of specifications over and above those for SOAP; together these
+      are typically called <acronym>WS-*</acronym>.</para>
+
+      <para>Whatever; what characterizes the <acronym>WS-*</acronym>
+      implementations is that they expose only a single endpoint to be
+      invoked; in effect just another way of doing a remote procedure call.
+      Put another way, <acronym>WS-*</acronym> -style web services provide an
+      for a verb - "do this for me". In fact, this <acronym>RPC</acronym>
+      endpoint usually accepts many different message types, and uses some
+      sort of dispatcher to route the message so it can be processed
+      correctly.</para>
+
+      <para><acronym>REST</acronym> (standing for <ulink
+      url="http://en.wikipedia.org/wiki/Representational_State_Transfer"><emphasis>REpresentational
+      State Transfer</emphasis></ulink>) in contrast is a style of designing
+      web services that is modelled on the human web sites. Rather than expose
+      a single endpoint, it exposes multiple endpoints. And these endpoints
+      don't represent verbs, they represent things (or nouns). But
+      <acronym>REST</acronym> goes further than this, because it also
+      restricts what we can do with those resources to the standard
+      <acronym>HTTP</acronym> verbs: <acronym>GET</acronym> (read),
+      <acronym>PUT</acronym> (update), <acronym>DELETE</acronym> (er, delete)
+      and <acronym>POST</acronym> (invoke, or change in some way). The first
+      three of these are idempotent (can be invoked multiple times with no
+      side effects). This is an important characteristic for building scalable
+      systems, and is not one that the <acronym>RPC</acronym> approach towards
+      web services supports at all well.</para>
+
+      <para>What happens if we perform an <acronym>HTTP</acronym>
+      <acronym>GET</acronym> on a resource? Well, we get a representation of
+      that resource. <acronym>REST</acronym> doesn't mandate what that
+      representation is, but typical choices are <acronym>JSON</acronym>,
+      <acronym>XHTML</acronym> or a custom <acronym>XML</acronym> dialect. The
+      json-viewer of course uses <acronym>JSON</acronym>
+      (<emphasis>J</emphasis>ava<emphasis>S</emphasis>cript
+      <emphasis>O</emphasis>bject <emphasis>N</emphasis>otation) as its
+      representation media type.</para>
+
+      <para>Moreover, <acronym>REST</acronym> emphasises that these resources
+      should be linked together, again analogous to the way that the human web
+      works with hyperlinks. This is sometimes given the (horrible) acronym
+      <acronym>HATEOAS</acronym>: hypertext as the engine of application
+      state.</para>
+
+      <para>So <acronym>REST</acronym> is much more closely associated with
+      the web - and <acronym>HTTP</acronym> in particular - than
+      <acronym>WS-*</acronym> -style web services ever were. But - so the
+      thinking goes - the vast majority of web services are deployed over the
+      web, so why disregard the web's semantics?</para>
+    </sect1>
+
+    <sect1>
+      <title>The Restful Objects Specification</title>
+
+      <para>The <ulink url="http://restfulobjects.org">Restful Objects</ulink>
+      specification defines a set of RESTful resources, and corresponding
+      <acronym>JSON</acronym> representations, for accessing and manipulating
+      a domain object model. Because it is a specification, it allows for
+      multiple implementations. Apache Isis' <emphasis>json viewer</emphasis>
+      is one such implementation; another is <ulink
+      url="http://nakedobjects.net">Restful Objects for .NET</ulink>.</para>
+
+      <screenshot>
+        <screeninfo>Restful Objects resources</screeninfo>
+
+        <mediaobject>
+          <imageobject>
+            <imagedata fileref="images/restfulobjects.png" scale="40" />
+          </imageobject>
+        </mediaobject>
+      </screenshot>
+
+      <para>One of the appeals of <acronym>JSON</acronym> is that it is
+      increasingly being used as a data exchange protocol independent of any
+      particular technology. A <acronym>JSON</acronym> string is directly
+      serializable as a graph of <acronym>JSON</acronym> objects, but there
+      are also libraries for all the main stream platforms (Java, .NET, Ruby,
+      Python) to consume and create <acronym>JSON</acronym>. The
+      <emphasis>json viewer</emphasis> therefore opens up a domain objects
+      model for consumption in other languages.</para>
+
+      <para>We do recommend that you download the <emphasis>Restful
+      Objects</emphasis> spec and at least review its introductory chapters
+      (part A). However, given that the spec is pretty close to 200 pages,
+      please don't consider that a mandatory first step. You can get a pretty
+      good idea of what the Isis json viewer does just by playing with Isis'
+      quickstart archetype, discussed later.</para>
+    </sect1>
+
+    <sect1 id="sec.IntroducingRestfulObjects">
+      <title>The JSON viewer as an RO implementation</title>
+
+      <para></para>
+
+      <para>* capabilites</para>
+
+      <para></para>
+    </sect1>
+  </chapter>
+
   <chapter>
-    <title>JSON Viewer</title>
+    <title id="chp.Prototyping">Using the QuickStart Archetype and the JSON
+    Viewer</title>
 
-    <para>TODO.</para>
+    <abstract>
+      <para>How to get started prototyping with <emphasis>json
+      viewer.</emphasis></para>
+    </abstract>
 
     <para></para>
 
-    <para>Topics to discuss:</para>
+    <para>*** using Chrome plugins</para>
+
+    <para></para>
+
+    <para></para>
 
-    <para>* configuring the json viewer to run (no-op ... use the maven
-    archetype)</para>
+    <para>The easiest way to get started is to run the
+    <emphasis>Isis</emphasis> quickstart archetype (eg as documented on
+    <emphasis>Isis</emphasis>' website). Once you've done this, you'll end up
+    with an set of modules that allow the application to be booted using the
+    <emphasis>xhtml viewer</emphasis>. It includes the following
+    modules:</para>
+
+    <programlisting>myapp/pom.xml
+    myapp-dom/pom.xml             # domain object model
+    myapp-fixture/pom.xml         # fixtures for seeding object store
+    myapp-objstore-dflt/pom.xml   # repository implementations for the default object store
+    myapp-quickrun/pom.xml        # run the application during development/prototyping
+    myapp-viewer-restful/pom.xml  # run the application as a webapp using the xhtml viewer</programlisting>
+
+    <para>where 'myapp' is the artifactId specified when you ran the <code>mvn
+    archetype:generate</code> goal.</para>
+
+    <para>This chapter describes in more detail the contents of these modules,
+    and then describes how to get started with running the <emphasis>xhtml
+    viewer</emphasis> for prototyping purposes.</para>
+
+    <sect1 id="sec.ParentModule">
+      <title>Understanding the Generated Modules</title>
+
+      <para>Before we run the application, let's look at the modules generated
+      for us by the archetype.</para>
+
+      <sect2>
+        <title>The Parent Module</title>
+
+        <para>The parent module includes as an import a reference to the
+        Apache Isis <emphasis>release</emphasis> artifact
+        <package>[oai:release]</package>:</para>
+
+        <programlisting>&lt;dependencyManagement&gt;
+  &lt;dependencies&gt;
+
+    &lt;!-- Apache Isis --&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.isis&lt;/groupId&gt;
+      &lt;artifactId&gt;release&lt;/artifactId&gt;
+      &lt;version&gt;x.x.x&lt;/version&gt;
+      &lt;type&gt;pom&lt;/type&gt;
+      &lt;scope&gt;import&lt;/scope&gt;
+    &lt;/dependency&gt;
+    ...
+
+  &lt;/dependencies&gt;
+&lt;/dependencyManagement&gt;</programlisting>
+
+        <para>where <emphasis>x.x.x</emphasis> is the version of
+        <emphasis>Isis</emphasis> that you are using. The <code>scope</code>
+        of <emphasis>import</emphasis> means that all
+        <code>&lt;properties&gt;</code> of this artifact are imported, and any
+        <code>&lt;dependencyManagement&gt;/&lt;dependencies&gt;</code> are
+        imported also.</para>
+
+        <para>If you locate the <acronym>POM</acronym> for this artifact (eg
+        by looking in <filename>~/.m2/repository</filename>) then you'll see
+        that it defines:</para>
+
+        <programlisting>&lt;properties&gt;
+    &lt;isis.viewer-restful.version&gt;y.y.y&lt;/isis.viewer-restful.version&gt;
+    ....
+&lt;/properties&gt;</programlisting>
+
+        <para>where y.y.y is the corresponding version of the json
+        viewer.</para>
+
+        <para>In the <emphasis>release</emphasis> artifact's
+        <code>&lt;dependencyManagement&gt;</code> section you'll also find the
+        following:</para>
+
+        <programlisting>&lt;dependencyManagement&gt;
+  &lt;dependencies&gt;
+    ...
+    &lt;!-- viewer: json --&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.isis.viewer&lt;/groupId&gt;
+      &lt;artifactId&gt;json&lt;/artifactId&gt;
+      &lt;version&gt;${isis.viewer-restful.version}&lt;/version&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.isis.viewer&lt;/groupId&gt;
+      &lt;artifactId&gt;restful-applib&lt;/artifactId&gt;
+      &lt;version&gt;${isis.viewer-restful.version}&lt;/version&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.isis.viewer&lt;/groupId&gt;
+      &lt;artifactId&gt;restful-viewer&lt;/artifactId&gt;
+      &lt;version&gt;${isis.viewer-restful.version}&lt;/version&gt;
+    &lt;/dependency&gt;
+    ...
+  &lt;/dependencies&gt;
+&lt;/dependencyManagement&gt;</programlisting>
+
+        <para>The <package>[oai.viewer:restful]</package> module is the parent
+        for <emphasis>xhtml viewer</emphasis>
+        (<code>&lt;packaging&gt;pom&lt;/packaging&gt;</code>). That means that
+        it doesn't provide any Java classesper se. The <emphasis>xhtml
+        viewer</emphasis> module
+        <package>[oai.viewer.restful:viewer]</package> on the other hand does
+        provide a <acronym>JAR</acronym> artifact, being the main
+        implementation of the viewer. The <emphasis>restful applib</emphasis>
+        module <package>[oai.viewer.restful:applib]</package> meanwhile is
+        used for writing client-side applications that use an exposed Isis
+        module, the topic of <xref
+        linkend="chp.WritingClientSideApps" />.</para>
+      </sect2>
+
+      <sect2 id="sec.TheQuickRunModule">
+        <title>The QuickRun Module</title>
+
+        <para>First, the <emphasis>quickrun</emphasis> module's parent is the
+        parent module of the previous section, so all of the definitions in
+        the parent <acronym>POM</acronym> are inherited. Delving further, If
+        you look at the <classname>&lt;dependencies&gt;</classname> for the
+        generated quickrun module, then you'll see a dependency on the
+        <emphasis>xhtml viewer</emphasis>'s <emphasis>viewer</emphasis>
+        module:</para>
+
+        <programlisting>&lt;dependencies&gt;
+  ...
+  &lt;!-- viewer: restful --&gt;
+  &lt;dependency&gt;
+    &lt;groupId&gt;org.apache.isis.viewer&lt;/groupId&gt;
+    &lt;artifactId&gt;restful-viewer&lt;/artifactId&gt;
+  &lt;/dependency&gt;
+    ...
+&lt;/dependencyManagement&gt;</programlisting>
+
+        <para>It also includes a <classname>&lt;profile&gt;</classname> to
+        allow the application to be run as a standalone JAR, with an embedded
+        Jetty viewer.</para>
+
+        <programlisting>&lt;profiles&gt;
+  ...
+  &lt;profile&gt;
+    &lt;!-- prereqs: mvn package --&gt;
+    &lt;!-- mvn antrun:run -D exec=restful --&gt;
+    &lt;id&gt;exec-restful&lt;/id&gt;
+    &lt;activation&gt;
+      &lt;property&gt;
+        &lt;name&gt;exec&lt;/name&gt;
+        &lt;value&gt;restful&lt;/value&gt;
+      &lt;/property&gt;
+    &lt;/activation&gt;
+    ...
+  &lt;/profile&gt;
+  ...
+&lt;/profiles&gt;</programlisting>
+
+        <para>This profile defines a goal for the antrun plugin to execute the
+        generated <acronym>JAR</acronym><footnote>
+            <para>The generated JAR uses the maven-shade-plugin to package up
+            all dependencies.</para>
+          </footnote> from the command line using:</para>
+
+        <para><programlisting>java -jar xxx.jar -type exploration -viewer org.apache.isis.viewer.restful.viewer.embedded.RestfulViewerInstaller</programlisting></para>
+
+        <para>The installer specified by the <code>-viewer</code> flag acts as
+        a bridge to the embedded Jetty viewer.</para>
+
+        <para>Taking all the above together, it allows us to run the
+        application from the command line if we wish (discussed further in
+        <xref linkend="sec.RunningFromTheQuickRunModule" />). Moreover, the
+        generated <acronym>JAR</acronym> is built using the <ulink
+        url="http://maven.apache.org/plugins/maven-shade-plugin/">Maven shade
+        plugin</ulink>, so that it also packages up all dependencies. This
+        means that you can distribute this <acronym>JAR</acronym> - eg to your
+        project's stakeholders for review - as a self-contained entity.</para>
+
+        <para>Finally, the <emphasis>quickrun</emphasis> module also includes
+        a <filename>.launch</filename> configuration (in
+        <filename>ide/eclipse/launch</filename>) which lets us run the
+        application from within the Eclipse <acronym>IDE</acronym>. This is
+        equivalent to the <acronym>POM</acronym> profile described
+        above.</para>
+      </sect2>
+
+      <sect2 id="sec.TheViewerRestfulModule">
+        <title>The Viewer-Json Module</title>
+
+        <para>Although the <emphasis>quickrun</emphasis> module is convenient
+        for prototyping, it isn't intended for runtime deployment. Instead,
+        you'll want a module that follows the webapp conventions and generates
+        a <acronym>WAR</acronym> file. This is the point of the generated
+        <emphasis>viewer-restful</emphasis> module.</para>
+
+        <para>Like the <emphasis>quickrun</emphasis> module, the
+        <emphasis>viewer-restful</emphasis> module inherits from the parent
+        module and so inherits the various definitions of the parent module.
+        And, not surprisingly, its <code>&lt;dependencies&gt;</code> section
+        includes a reference to the
+        <package>[oai.viewer.restful:viewer]</package> module.</para>
+
+        <para>More significantly, the <emphasis>viewer-restful</emphasis> has
+        the standard directory structure for a webapp, with
+        <filename>src/main/webapp/WEB-INF</filename> holding the
+        <filename>web.xml</filename> along with <emphasis>Isis</emphasis>' own
+        configuration files (<filename>isis.properties</filename> and
+        others).</para>
+
+        <para>The following sections look at the <filename>web.xml</filename>
+        in more detail</para>
+
+        <sect3>
+          <title>JAX-RS Configuration</title>
+
+          <para>The <filename>web.xml</filename> defines the following context
+          parameter:</para>
+
+          <programlisting>&lt;context-param&gt;
+  &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
+  &lt;param-value&gt;org.apache.isis.viewer.json.viewer.JsonApplication&lt;/param-value&gt;
+&lt;/context-param&gt;</programlisting>
+
+          <para>This is used by <emphasis>RestEasy</emphasis> (the underlying
+          <acronym>JAX-RS</acronym> reference implementation) to define the
+          resources to be exposed. (These resources are discussed further in
+          <xref linkend="chp.Resources" />). <emphasis>RestEasy</emphasis>
+          itself is loaded through a context listener:</para>
+
+          <programlisting>&lt;listener&gt;
+  &lt;listener-class&gt;org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap&lt;/listener-class&gt;
+&lt;/listener&gt;</programlisting>
+
+          <para><emphasis>RestEasy</emphasis> also requires that its servlet
+          is registered:<programlisting>&lt;servlet&gt;
+  &lt;servlet-name&gt;RestEasy&lt;/servlet-name&gt;
+  &lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher&lt;/servlet-class&gt;
+&lt;/servlet&gt;
+...
+&lt;servlet-mapping&gt;
+  &lt;servlet-name&gt;RestEasy&lt;/servlet-name&gt;
+  &lt;url-pattern&gt;/&lt;/url-pattern&gt;
+&lt;/servlet-mapping&gt;</programlisting></para>
+        </sect3>
+
+        <sect3>
+          <title>Isis Session handling (using the <emphasis>Default
+          Runtime</emphasis>)</title>
+
+          <para>An <emphasis>Isis</emphasis> session is required in order for
+          the <emphasis>xhtml viewer</emphasis> to interact with the
+          <emphasis>Isis</emphasis> runtime and interrogate the
+          metamodel/retrieve domain objects.</para>
+
+          <para>The first part of the required configuration is to set up an
+          <emphasis>Isis</emphasis> "context"; basically a set of factories
+          that are used to create a session for each subsequent request. This
+          is done using a context listener (defined in the <emphasis>default
+          runtime</emphasis>,
+          <package>[oai.runtimes.dflt:webapp]</package>):</para>
+
+          <programlisting>&lt;listener&gt;
+  &lt;listener-class&gt;org.apache.isis.runtimes.dflt.webapp.IsisWebAppBootstrapper&lt;/listener-class&gt;
+&lt;/listener&gt;</programlisting>
+
+          <para>The session is created for each request using the
+          <classname>IsisSessionFilter</classname>:</para>
+
+          <programlisting>&lt;filter&gt;
+  &lt;filter-name&gt;IsisSessionFilter&lt;/filter-name&gt;
+  &lt;filter-class&gt;org.apache.isis.runtimes.dflt.webapp.IsisSessionFilter&lt;/filter-class&gt;
+  &lt;init-param&gt;
+    &lt;param-name&gt;authenticationSessionLookupStrategy&lt;/param-name&gt;
+    &lt;param-value&gt;org.apache.isis.viewer.restful.viewer.authentication.AuthenticationSessionLookupStrategyTrusted&lt;/param-value&gt;
+  &lt;/init-param&gt;
+&lt;/filter&gt;
+...
+&lt;filter-mapping&gt;
+  &lt;filter-name&gt;IsisSessionFilter&lt;/filter-name&gt;
+  &lt;url-pattern&gt;*&lt;/url-pattern&gt;
+&lt;/filter-mapping&gt;</programlisting>
+
+          <para>Note the <code>&lt;init-param&gt;</code> for the filter, which
+          defines a strategy for obtaining the authenticationSession (that is,
+          the user's credentials). In the architect specifies a strategy
+          whereby the caller is effectively trusted. However, other strategies
+          can be plugged in as required. This is discussed further in <xref
+          linkend="chp.DeployingRestfulObjectsWebapps" />.</para>
+        </sect3>
+
+        <sect3>
+          <title>Resources</title>
+
+          <para>Finally, the <filename>web.xml</filename> also declares a
+          servlet and a filter which are used for serving up and caching
+          certain supporting resources, most notably Javascript. The
+          Javascript is referenced by the generated <acronym>XHTML</acronym>
+          resources, and allow the web browser to submit RESTful requests
+          using HTTP PUT and HTTP DELETE (as well as the usual HTTP GET and
+          HTTP POST).</para>
+
+          <para>The <classname>ResourceServlet</classname> (defined by
+          <package>[oai.core:webapp]</package>) is used serve up static
+          content from either the classpath or file:</para>
+
+          <programlisting>&lt;servlet&gt;
+  &lt;servlet-name&gt;Resource&lt;/servlet-name&gt;
+  &lt;servlet-class&gt;org.apache.isis.core.webapp.content.ResourceServlet&lt;/servlet-class&gt;
+&lt;/servlet&gt;
+...
+&lt;servlet-mapping&gt;
+  &lt;servlet-name&gt;Resource&lt;/servlet-name&gt;
+  &lt;url-pattern&gt;*.js&lt;/url-pattern&gt;
+&lt;/servlet-mapping&gt;
+&lt;servlet-mapping&gt;
+  &lt;servlet-name&gt;Resource&lt;/servlet-name&gt;
+  &lt;url-pattern&gt;*.gif&lt;/url-pattern&gt;
+&lt;/servlet-mapping&gt;
+&lt;servlet-mapping&gt;
+  &lt;servlet-name&gt;Resource&lt;/servlet-name&gt;
+  &lt;url-pattern&gt;*.png&lt;/url-pattern&gt;
+&lt;/servlet-mapping&gt;</programlisting>
+
+          <para>The <classname>ResourceCachingFilter</classname> (also defined
+          by <package>[oai.core:webapp]</package>) is used to decorate any
+          static resources (Javascript, CSS or images) so that they are cached
+          client-side:</para>
+
+          <programlisting>&lt;filter&gt;
+  &lt;filter-name&gt;ResourceCachingFilter&lt;/filter-name&gt;
+  &lt;filter-class&gt;org.apache.isis.core.webapp.content.ResourceCachingFilter&lt;/filter-class&gt;
+  &lt;init-param&gt;
+    &lt;param-name&gt;CacheTime&lt;/param-name&gt;
+    &lt;param-value&gt;86400&lt;/param-value&gt;
+  &lt;/init-param&gt;
+&lt;/filter&gt;
+...
+&lt;filter-mapping&gt;
+  &lt;filter-name&gt;ResourceCachingFilter&lt;/filter-name&gt;
+  &lt;url-pattern&gt;*.js&lt;/url-pattern&gt;
+&lt;/filter-mapping&gt;
+&lt;filter-mapping&gt;
+  &lt;filter-name&gt;ResourceCachingFilter&lt;/filter-name&gt;
+  &lt;url-pattern&gt;*.css&lt;/url-pattern&gt;
+&lt;/filter-mapping&gt;
+&lt;filter-mapping&gt;
+  &lt;filter-name&gt;ResourceCachingFilter&lt;/filter-name&gt;
+  &lt;url-pattern&gt;*.jpg&lt;/url-pattern&gt;
+&lt;/filter-mapping&gt;
+&lt;filter-mapping&gt;
+  &lt;filter-name&gt;ResourceCachingFilter&lt;/filter-name&gt;
+  &lt;url-pattern&gt;*.png&lt;/url-pattern&gt;
+&lt;/filter-mapping&gt;
+&lt;filter-mapping&gt;
+  &lt;filter-name&gt;ResourceCachingFilter&lt;/filter-name&gt;
+  &lt;url-pattern&gt;*.gif&lt;/url-pattern&gt;
+&lt;/filter-mapping&gt;</programlisting>
+        </sect3>
+      </sect2>
+    </sect1>
 
-    <para>* templated URIs vs walker representations</para>
+    <sect1>
+      <title>Running the Viewer</title>
 
-    <para>* following links (format of body)</para>
+      <para>The viewer can be run in a number of ways.</para>
 
-    <para>* use of annotation to indicate whether an action returns a
-    persisted object or not (and configuration of corresponding
-    FacetFactory)</para>
+      <sect2 id="sec.RunningFromTheQuickRunModule">
+        <title>Running from the QuickRun Module</title>
 
-    <para>* requirement of nu.xom in order to use XPATH support of
-    JsonRepresentation</para>
+        <para>To run the viewer in a prototyping mode (that is, using the
+        standalone <acronym>JAR</acronym> and embedded Jetty webserver), you
+        can either:</para>
 
-    <para></para>
+        <itemizedlist>
+          <listitem>
+            <para>run from the command-line using Maven:</para>
+
+            <programlisting>cd viewer-json
+mvn antrun:run -D exec=json</programlisting>
+          </listitem>
+
+          <listitem>
+            <para>import into your <acronym>IDE</acronym> and use its in-built
+            support for running Maven goals, and run the above-mentioned
+            goal</para>
+
+            <para>In the case of Eclipse, this support is provided through the
+            <emphasis>m2eclipse</emphasis> plugin.</para>
+          </listitem>
+
+          <listitem>
+            <para>import into the Eclipse <acronym>IDE</acronym> and run using
+            the <filename>.launch</filename> configuration</para>
+
+            <para>Navigate to the <emphasis>quickrun</emphasis> module's
+            <filename>ide/eclipse/launch</filename> directory, select the
+            <filename>quickstart-quickrun-restful.launch</filename>
+            configuration, and use Run &gt; Run As &gt;
+            quickstart-quickrun-restful to launch in regular mode (or Debug
+            &gt; Debug As &gt; quickstart-quickrun-restful to launch in debug
+            mode).</para>
+          </listitem>
+        </itemizedlist>
+      </sect2>
+
+      <sect2>
+        <title>Running from the Viewer-Restful Module</title>
+
+        <para>To run the viewer as a webapp (that is, by hosting the
+        <acronym>WAR</acronym> in an separate instance of a Jetty web server),
+        you can either:</para>
+
+        <itemizedlist>
+          <listitem>
+            <para>run from the command-line using Maven:</para>
+
+            <programlisting>cd viewer-json
+mvn jetty:run</programlisting>
+          </listitem>
+
+          <listitem>
+            <para>import into your <acronym>IDE</acronym> and use its in-built
+            support for running Maven goals, and run the asbove-mentioned
+            goal</para>
+
+            <para>In the case of Eclipse, this support is provided through the
+            <emphasis>m2eclipse</emphasis> plugin.</para>
+          </listitem>
+
+          <listitem>
+            <para>import into the Eclipse <acronym>IDE</acronym> and run using
+            the <filename>.launch</filename> configuration</para>
+
+            <para>Navigate to the <emphasis>viewer-restful</emphasis> module's
+            <filename>ide/eclipse/launch</filename> directory, select the
+            <filename>quickstart-viewer-restful.launch</filename>
+            configuration, and use Run &gt; Run As &gt;
+            quickstart-viewer-restful to launch in regular mode (or Debug &gt;
+            Debug As &gt; quickstart-viewer-restful to launch in debug
+            mode).</para>
+
+            <note>
+              <para>It's confusing perhaps, but this isn't quite the same as
+              running from the quickrun module: this launch configuration runs
+              the <classname>oai.WebServer</classname> utility class provided
+              by <emphasis>Isis</emphasis> which simply runs up the webapp
+              defined by <filename>web.xml</filename>. The quickrun module, on
+              the other hand, uses the special bridge class discussed in <xref
+              linkend="sec.TheQuickRunModule" />.</para>
+            </note>
+          </listitem>
+
+          <listitem>
+            <para>import into your <acronym>IDE</acronym> and use your
+            <acronym>IDE</acronym>'s native support for running
+            webapps.</para>
+
+            <para>In the case of Eclipse, this is its <acronym>WTP</acronym>
+            support (in the enterprise editions).</para>
+          </listitem>
+        </itemizedlist>
+      </sect2>
+    </sect1>
+
+    <sect1>
+      <title>Testing the Viewer</title>
+
+      <para>The point of xhtml viewer is to allow the domain objects to be
+      interacted with programmatically through <acronym>HTTP</acronym>, which
+      implies writing a custom client that submits the relevant
+      <acronym>HTTP</acronym> requests. Indeed, this is the topic of <xref
+      linkend="chp.WritingClientSideApps" />.</para>
+
+      <para>However, it is also useful to be able to browse the resources
+      directly, and because they are exposed using XHTML, this is possible to
+      do using a web browser. Therefore, boot up Firefox and browse to <ulink
+      url="http://localhost:8080">http://localhost:8080</ulink>. You should
+      either immediately be connected to the site, or see a link to the
+      context where the site is hosted.</para>
+
+      <note>
+        <para>Firefox is currently the only supported web browser for testing
+        in this way.</para>
+      </note>
+
+      <para>From the site, you should see links to access the services; these
+      are (representations of) the registered services (typically
+      repositories) in <filename>isis.properties</filename> configuration
+      file.</para>
+
+      <para>These structure of the resources is discussed further in <xref
+      linkend="chp.Resources" />.</para>
+    </sect1>
+  </chapter>
+
+  <chapter id="chp.WritingClientSideApps">
+    <title>Writing Client-side Applications</title>
+
+    <abstract>
+      <para>How to write custom client-side applications to consume the
+      RESTful resources.</para>
+    </abstract>
+
+    <para>The point of the <emphasis>json viewer</emphasis> is to provide our
+    domain objects as <acronym>REST</acronym>ful resources so that they can be
+    used by any other client application. These applications can be written in
+    any language; so long as they can submit <acronym>HTTP </acronym>requests
+    and can parse <acronym>JSONL</acronym>, they can interact with the
+    resources provided by the viewer.</para>
+
+    <para>That said, if you are writing Java applications, then there is also
+    an application library (applib) to simplify the task. To reference this
+    applib, add the following to your Maven pom's
+    <sgmltag>&lt;dependencies&gt;</sgmltag> section:</para>
+
+    <programlisting>
+&lt;dependencies&gt;
+  ...
+  &lt;dependency&gt;
+    &lt;groupId&gt;org.apache.isis.viewer&lt;/groupId&gt;
+    &lt;artifactId&gt;json-applib&lt;/artifactId&gt;
+    &lt;version&gt;${isis.version}&lt;/version&gt;
+  &lt;/dependency&gt;
+  ...
+&lt;/dependencies&gt;</programlisting>
+
+    <para>You then have a choice of approaches.</para>
+
+    <sect1>
+      <title><classname>AbstractRestfulClient</classname></title>
+
+      <para>To get you started you might want to use the adapter,
+      <classname>AbstractRestfulClient</classname>, available in the
+      <emphasis>xhtml viewer</emphasis>' applib. This exposes some of the
+      <acronym>HTTP</acronym> methods, including <acronym>GET</acronym> and
+      <acronym>POST</acronym>, and serves up resources as
+      <acronym>XML</acronym> documents (using Elliot Rusty Harold's <ulink
+      url="http://www.xom.nu/">XOM</ulink> library). There is also a
+      <classname>XomUtils</classname> class, that provides some
+      pretty-printing support and a couple of other helper methods.</para>
+
+      <note>
+        <para><classname>AbstractRestfulClient</classname> is not particularly
+        comprehensive (at the time of writing it doesn't include support for
+        <acronym>PUT</acronym> or <acronym>DELETE</acronym>, for example). It
+        may well gain extra methods in future releases, however.</para>
+      </note>
+    </sect1>
+
+    <sect1 id="sec.CodingApproaches">
+      <title><emphasis>RestEasy</emphasis>'s Client-side Framework</title>
+
+      <para>Alternatively, you might want to look into JBoss
+      <emphasis>RestEasy</emphasis>, which provides a <ulink
+      url="http://www.jboss.org/file-access/default/members/resteasy/freezone/docs/1.0.2.GA/userguide/html_single/index.html#RESTEasy_Client_Framework">client-side
+      framework</ulink> to eliminate some of the boilerplate. This uses the
+      resource interfaces (see <xref linkend="chp.Resources" />) to create
+      client-side stubs.</para>
+
+      <note>
+        <para>Due to a fact that <classname>@Path</classname> is annotated on
+        the implementations - not the interfaces - of
+        <classname>ObjectResource</classname>,
+        <classname>ServiceResource</classname>,
+        <classname>SpecsResource</classname> and
+        <classname>UserResource</classname>, it's possible that this approach
+        will not work until we upgrade the version of
+        <emphasis>RestEasy</emphasis>.</para>
+      </note>
+    </sect1>
+
+    <sect1>
+      <title>The Json Viewer AppLib</title>
+
+      <para></para>
+
+      <para>* following links</para>
+
+      <para>* templated URIs vs walker representations</para>
+
+      <para>* following links (format of body)</para>
+
+      <para></para>
+
+      <para>* @Idempotent, @QueryOnly</para>
+
+      <para></para>
+    </sect1>
+  </chapter>
+
+  <chapter>
+    <title>The AppLib</title>
+
+    <para>TODO.</para>
 
     <para></para>
 
+    <para>Topics to discuss:</para>
+
     <para></para>
 
     <para></para>
   </chapter>
+
+  <chapter id="chp.DeployingRestfulObjectsWebapps">
+    <title>Deploying XHTML Viewer Webapps</title>
+
+    <abstract>
+      <para>Guidance on how to deploy Isis using the <emphasis>xhtml
+      viewer</emphasis>.</para>
+    </abstract>
+
+    <para>At some point you'll presumably want to deploy your domain object
+    using <emphasis>xhtml viewer</emphasis> as a webapp. The quickstart
+    archetype already sets up the <package>viewer-restful</package> module
+    that will generate a <acronym>WAR</acronym> file; however, you may want to
+    adjust its configuration in terms of two areas: authentication, and
+    persistence. This chapter discusses these points.</para>
+
+    <para><note>
+        <para>These instructions assume that the xhtml viewer is being
+        deployed using the <emphasis>default runtime</emphasis>
+        <package>(oai.runtimes:dflt)</package>. At the time of writing this is
+        the only runtime available; in the future there may be other runtimes
+        which will have their own specific deployment requirements</para>
+      </note></para>
+
+    <sect1 id="sec.DeploymentType">
+      <title>Deployment Modes</title>
+
+      <para>By default the <classname>IsisWebAppBootstrapper</classname>
+      context listener (described in <xref
+      linkend="sec.TheViewerRestfulModule" />) will bootstrap Isis in the
+      "SERVER" deployment type. This means that an authentication is required,
+      that the sessions will be bound as thread-locals, and that the
+      persistence mechanism will be defaulted appropriately.</para>
+
+      <para>The deployment type can be changed to other settings, though; most
+      notably you may wish to change to SERVER_EXPLORATION or
+      SERVER_PROTOTYPE. This is done using a context parameter:</para>
+
+      <programlisting>&lt;context-param&gt;
+  &lt;param-name&gt;deploymentType&lt;/param-name&gt;
+  &lt;param-value&gt;SERVER_EXPLORATION&lt;/param-value&gt;
+&lt;/context-param&gt;</programlisting>
+    </sect1>
+
+    <sect1 id="sec.Authentication">
+      <title>Authentication</title>
+
+      <para>The RESTful architecture doesn't have too much to say about
+      authentication, and (at the time of writing) there are no supplementary
+      standards to define how authentication should be implemented. And
+      because <acronym>REST</acronym> runs over <acronym>HTTP</acronym> we
+      don't get any particular support from the network stack either. In fact,
+      because <acronym>HTTP</acronym> is stateless we don't even get the
+      notion of a session or a connection.</para>
+
+      <para>The <emphasis>xhtml viewer</emphasis> therefore uses
+      <emphasis>Isis</emphasis>' own authentication mechanism, with
+      authentication performed for each RESTful call. What this means depends
+      on the deployment type (see <xref
+      linkend="sec.DeploymentType" />):</para>
+
+      <itemizedlist>
+        <listitem>
+          <para>if running in SERVER_EXPLORATION mode, then authentication is
+          in effect switched off; no credentials are supplied, and the
+          framework will use the first exploration user defined in
+          <emphasis>isis.properties</emphasis>, or a fallback "exploration"
+          user otherwise</para>
+
+          <para>For example, if running in SERVER_EXPLORATION mode, then you
+          can specify the user using:</para>
+
+          <programlisting>isis.exploration.users=sven:role1, dick:role2, bob:role1|role2</programlisting>
+        </listitem>
+
+        <listitem>
+          <para>otherwise (if running SERVER_PROTOTYPE or SERVER), then
+          authentication credentials are needed.</para>
+        </listitem>
+      </itemizedlist>
+
+      <note>
+        <para>You can if you want run in EXPLORATION (or PROTOTYPE) mode
+        rather than SERVER_EXPLORATION (or SERVER_PROTOTYPE) mode. The
+        difference is that former only support single-users, while SERVER_*
+        supports multiple concurrent users.</para>
+      </note>
+
+      <para>Running the Restful Objects in SERVER mode with no credentials
+      will result in an exception:</para>
+
+      <screenshot>
+        <screeninfo>Server mode, no credentials</screeninfo>
+
+        <mediaobject>
+          <imageobject>
+            <imagedata fileref="images/server-mode-no-credentials.png"
+                       scale="40" />
+          </imageobject>
+        </mediaobject>
+      </screenshot>
+
+      <para>On the other hand, if user and password parameters are supplied,
+      then we can login:</para>
+
+      <screenshot>
+        <screeninfo>Server mode, with credentials</screeninfo>
+
+        <mediaobject>
+          <imageobject>
+            <imagedata fileref="images/server-mode-with-credentials.png"
+                       scale="40" />
+          </imageobject>
+        </mediaobject>
+      </screenshot>
+
+      <para>This behaviour is pluggable however, at two levels:</para>
+
+      <itemizedlist>
+        <listitem>
+          <para><classname>IsisSessionFilter</classname> uses the
+          <varname>authenticationManagerLookupStrategy</varname> property to
+          specify a strategy for both finding credentials and for validating
+          them against the <emphasis>Apache Isis</emphasis> authentication
+          manager.</para>
+
+          <para>The <emphasis>xhtml viewer</emphasis> provides two additional
+          implementations of this that you can use:</para>
+
+          <itemizedlist>
+            <listitem>
+              <para>The
+              <classname>oai.viewer.restful.viewer.authentication.AuthenticationSessionLookupStrategyParams</classname>
+              implementation extends the default behaviour by also looking up
+              credentials using the username and password parameters. Once
+              validated, it also binds the results to the
+              <classname>HttpSession</classname> so that future interactions
+              do not credentials.</para>
+            </listitem>
+
+            <listitem>
+              <para>The
+              <classname>oai.viewer.restful.viewer.authentication.AuthenticationSessionLookupStrategyTrusted</classname>
+              implementation ensures that an (exploration) session is always
+              present (if a session isn't available from the default
+              implementation).</para>
+            </listitem>
+          </itemizedlist>
+
+          <para>-
+          <classname>AuthenticationSessionLookupStrategyParams</classname> in
+          the package
+          <classname>org.starobjects.restful.viewer.authentication</classname>
+          -</para>
+
+          <para>In both cases these can be configured using:</para>
+
+          <programlisting>&lt;filter&gt;
+  &lt;filter-name&gt;IsisSessionFilter&lt;/filter-name&gt;
+  &lt;filter-class&gt;org.apache.isis.runtimes.dflt.webapp.IsisSessionFilter&lt;/filter-class&gt;
+  &lt;init-param&gt;
+    &lt;param-name&gt;authenticationSessionLookupStrategy&lt;/param-name&gt;
+    &lt;param-value&gt;org.apache.isis.viewer.restful.viewer.authentication.AuthenticationSessionLookupStrategyTrusted&lt;/param-value&gt;
+  &lt;/init-param&gt;
+&lt;/filter&gt;</programlisting>
+        </listitem>
+
+        <listitem>
+          <para>Alternatively, you can change the implementation of
+          <classname>AuthenticationManager</classname> that
+          <emphasis>Isis</emphasis>' delegates to. This is done using the
+          <varname>isis.authentication</varname> key in
+          <filename>isis.properties</filename>:</para>
+
+          <programlisting>isis.authentication=com.mycompany.isis.authentication.MyAuthenticationManagerInstaller</programlisting>
+        </listitem>
+      </itemizedlist>
+
+      <para>In the future there will doubtless be standardized (WS-* style)
+      approaches for RESTful authenticatication, but the above should provide
+      enough flexibility in the meantime.</para>
+
+      <note>
+        <para>Note that the archetype explicitly specifies the authentication
+        mechanism as no-op.</para>
+      </note>
+    </sect1>
+
+    <sect1>
+      <title>Runtime / Persistence</title>
+
+      <para>The persistence mechanism (aka object store) is determined using
+      isis.persistence key in isis.properties. For example, to use the XML
+      object store, you would specify:</para>
+
+      <programlisting>isis.persistor=xml</programlisting>
+
+      <para><note>
+          <para>Note that the archetype explicitly specifies the object store
+          as in-memory.</para>
+        </note></para>
+    </sect1>
+  </chapter>
 </book>

Modified: incubator/isis/trunk/framework/viewer/pom.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/pom.xml?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/pom.xml (original)
+++ incubator/isis/trunk/framework/viewer/pom.xml Wed Nov 23 22:02:48 2011
@@ -46,7 +46,6 @@
 		<module>html-tck</module>
 		<module>scimpi</module>
 		<module>wicket</module>
-	<!--	<module> xhtml</module> -->
 		<module>json</module>
 		<module>bdd</module>
 		<module>junit</module>

Modified: incubator/isis/trunk/framework/viewer/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/src/site/apt/index.apt?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/src/site/apt/index.apt (original)
+++ incubator/isis/trunk/framework/viewer/src/site/apt/index.apt Wed Nov 23 22:02:48 2011
@@ -19,34 +19,30 @@
 
 Viewers
  
- The <viewer> module is the parent of the different viewer implementations:
+ The <viewer> module is the parent of the different viewer implementations.
 
- * {{{./dnd/index.html}Drag-n-Drop viewer}}
-
- The Drag and Drop (DnD) viewer is non-web graphical user interface that employs a desktop metaphor for interacting with domain objects
+ * {{{./json/index.html}JSON (Restful) viewer}}
 
+  The <json> viewer provides the RESTful API to the domain object model, 
+  providing JSON representations of domain objects.  This is great as a back-end
+  where the client is either a custom UI (written using JQuery, say), or for
+  data integration scenarios.
+  
  * {{{./html/index.html}HTML viewer}}
 
-  The HTML viewer provides a simple, minimally customizable webapp interface for interacting with an Isis domain model.
-
- * {{{./scimpi/index.html}Scimpi}}
-
-  The <scimpi> viewer is a webapp viewer that out-of-the-box provides a similar interface to that provided by the {{{./html/index.html}HTML viewer}}.
-  However, unlike the HTML viewer it allows the user interface to be extensively customized. 
-
- * {{{./wicket/index.html}Wicket viewer}}
-
-  The <wicket> viewer is a customizable webapp viewer for an Isis domain model, implemented using the {{{http://wicket.apache.org}Apache Wicket}} web framework.
-
- * {{{./xhtml/index.html}XHTML (Restful) viewer}}
-
-  The <xhtml> viewer provides a RESTful interface to the domain object model, 
-  providing XHTML representations of domain objects.  It is implemented as a webapp.
-
- * {{{./json/index.html}JSON (Restful) viewer}}
-
-  The <json> viewer provides a RESTful interface to the domain object model, 
-  providing JSON representations of domain objects.  It is implemented as a webapp.
+  The HTML viewer provides a simple, minimally customizable webapp interface
+  for interacting with an Isis domain model.  We find it's great for prototyping,
+  or for exploring the REST API.  Or, if your user base are "experts" in the
+  domain then you may also consider deploying it directly into production.
+
+Testing Support
+
+ Isis' testing support is also provided by viewer implementations.  That may seem
+ slightly odd terminology, but consider the test as a client of the domain model, 
+ and exposing through its API a representation of the domain model.  This is
+ basically the same role as the other viewers; there just isn't a GUI.
+ 
+ Isis supports testing in two different ways:
 
  * {{{./bdd/index.html}BDD Framework Integration}}
 
@@ -64,4 +60,35 @@ Viewers
   allowing unit tests to be written exercising business rules by catching the 
   exceptions thrown by proxied domain objects.
  
+
+Other Viewers
+
+ There are a number of other viewers that are of alpha-quality.  That means that they are 
+ either incomplete implementations, inadequately documented, or just requiring a little
+ attention (ie are broken).
+ 
+ That said, you are welcome to use them.  If you do, let us know of any shortcomings 
+ and we'll endeavour to fix them.
+  
+ * {{{./dnd/index.html}Drag-n-Drop viewer}}
+
+   The Drag and Drop (DnD) viewer is non-web graphical user interface that employs a 
+   desktop metaphor for interacting with domain objects.
+
+ * {{{./scimpi/index.html}Scimpi}}
+
+  The <scimpi> viewer is a webapp viewer that out-of-the-box provides a similar 
+  interface to that provided by the {{{./html/index.html}HTML viewer}}.  However, unlike the
+  HTML viewer it allows the user interface to be extensively customized.
+  
+  The scimpi viewer works reasonably well, however its documentation is somewhat lacking.  
+
+ * {{{./wicket/index.html}Wicket viewer}}
+
+  The <wicket> viewer is a customizable webapp viewer for an Isis domain model, implemented 
+  using the {{{http://wicket.apache.org}Apache Wicket}} web framework.
+  
+  This implementation is incomplete in a number of areas (though its documentation is 
+  reasonably complete).
+
  []

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java Wed Nov 23 22:02:48 2011
@@ -196,7 +196,7 @@ public class IsisWicketApplication exten
 
     private IsisConfigurationBuilder createConfigBuilder() {
         final ResourceStreamSource rssServletContext = new ResourceStreamSourceForWebInf(getServletContext());
-        final ResourceStreamSource rssTcl = new ResourceStreamSourceContextLoaderClassPath();
+        final ResourceStreamSource rssTcl = ResourceStreamSourceContextLoaderClassPath.create();
         final ResourceStreamSource rssClasspath = new ResourceStreamSourceCurrentClassClassPath();
         IsisConfigurationBuilder isisConfigurationBuilder = new IsisConfigurationBuilderResourceStreams(rssTcl, rssClasspath, rssServletContext);
         return isisConfigurationBuilder;

Modified: incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketUnsecuredApplication.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketUnsecuredApplication.java?rev=1205627&r1=1205626&r2=1205627&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketUnsecuredApplication.java (original)
+++ incubator/isis/trunk/framework/viewer/wicket/wicket-viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketUnsecuredApplication.java Wed Nov 23 22:02:48 2011
@@ -156,7 +156,7 @@ public class IsisWicketUnsecuredApplicat
 
     private IsisConfigurationBuilder createConfigBuilder() {
         final ResourceStreamSource rssServletContext = new ResourceStreamSourceForWebInf(getServletContext());
-        final ResourceStreamSource rssTcl = new ResourceStreamSourceContextLoaderClassPath();
+        final ResourceStreamSource rssTcl = ResourceStreamSourceContextLoaderClassPath.create();
         final ResourceStreamSource rssClasspath = new ResourceStreamSourceCurrentClassClassPath();
         final IsisConfigurationBuilder isisConfigurationBuilder =
             new IsisConfigurationBuilderResourceStreams(rssTcl, rssClasspath, rssServletContext);