incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1074240 [1/2] - in /incubator/isis/trunk: ./ alternatives/embedded/src/main/java/org/apache/isis/alternatives/embedded/internal/ alternatives/progmodel/wrapper/applib/src/main/java/org/apache/isis/progmodel/wrapper/applib/ alternatives/pro...
Date Thu, 24 Feb 2011 18:03:36 GMT
Author: danhaywood
Date: Thu Feb 24 18:03:34 2011
New Revision: 1074240

URL: http://svn.apache.org/viewvc?rev=1074240&view=rev
Log:
various fixes related to archetype: fixes for the archetype itself; but also: had to move installer-registry.properties from root into org/apache/isis/core/runtime; renamed 'allow' and 'passwords' to security_file.allow and security_file.passwords; added RedirectServlet and ForwardingServlet into core/webapp; changed wicket-viewer so that picks up application.css from WEB-INF rather than from classpath.  In addition: uploaded site/resources/presentations for download; fixed the build problem from Rob's new aggregatedOid support

Added:
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/IsisInstallerRegistry.java
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemThatUsesInstallersFactory.java
      - copied, changed from r1071637, incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsiSsystemUsingInstallersFactory.java
    incubator/isis/trunk/core/runtime/src/main/resources/org/
    incubator/isis/trunk/core/runtime/src/main/resources/org/apache/
    incubator/isis/trunk/core/runtime/src/main/resources/org/apache/isis/
    incubator/isis/trunk/core/runtime/src/main/resources/org/apache/isis/core/
    incubator/isis/trunk/core/runtime/src/main/resources/org/apache/isis/core/runtime/
    incubator/isis/trunk/core/runtime/src/main/resources/org/apache/isis/core/runtime/installer-registry.properties
      - copied unchanged from r1071637, incubator/isis/trunk/core/runtime/src/main/resources/installer-registry.properties
    incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/ForwardingServlet.java
    incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/RedirectServlet.java
    incubator/isis/trunk/distribution/tarball/src/main/build/security_file.allow
      - copied unchanged from r1071637, incubator/isis/trunk/distribution/tarball/src/main/build/allow
    incubator/isis/trunk/src/site/resources/presentations/
    incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis-notes.pdf   (with props)
    incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis-slides.pdf   (with props)
    incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.odp   (with props)
    incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.ppt   (with props)
    incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.pptx   (with props)
    incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/ConfigDir.java
Removed:
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/help/
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/i18n/
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsiSsystemUsingInstallersFactory.java
    incubator/isis/trunk/core/runtime/src/main/resources/installer-registry.properties
    incubator/isis/trunk/distribution/tarball/src/main/build/allow
    incubator/isis/trunk/viewer/wicket/ui/src/main/java/css/
Modified:
    incubator/isis/trunk/alternatives/embedded/src/main/java/org/apache/isis/alternatives/embedded/internal/RuntimeContextForEmbeddedMetaModel.java
    incubator/isis/trunk/alternatives/progmodel/wrapper/applib/src/main/java/org/apache/isis/progmodel/wrapper/applib/WrapperObject.java
    incubator/isis/trunk/alternatives/progmodel/wrapper/metamodel/src/main/java/org/apache/isis/progmodel/wrapper/metamodel/internal/DomainObjectInvocationHandler.java
    incubator/isis/trunk/alternatives/security/file/src/main/java/org/apache/isis/alternatives/security/file/authentication/FileAuthenticationConstants.java
    incubator/isis/trunk/alternatives/security/file/src/main/java/org/apache/isis/alternatives/security/file/authorization/FileAuthorizationConstants.java
    incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderDefault.java
    incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderFileSystem.java
    incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderResourceStreams.java
    incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/resource/ResourceStreamSourceFileSystem.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/AdapterMapAbstract.java
    incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/AdapterMapDelegator.java
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/installers/InstallerLookupDefault.java
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterManager.java
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/internal/RuntimeContextFromSession.java
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisModule.java
    incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java
    incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/ResourceServlet.java
    incubator/isis/trunk/core/webapp/src/site/apt/jottings.apt
    incubator/isis/trunk/pom.xml
    incubator/isis/trunk/src/site/apt/index.apt
    incubator/isis/trunk/src/site/site.xml
    incubator/isis/trunk/viewer/bdd/common/pom.xml
    incubator/isis/trunk/viewer/bdd/pom.xml
    incubator/isis/trunk/viewer/html/src/main/java/org/apache/isis/viewer/html/HtmlViewerInstaller.java
    incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/IsisTestRunner.java
    incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/internal/IsisSystemUsingInstallersWithinJunit.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/AbstractTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/DefaultAndChoicesTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberDisabledTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberHiddenTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberInvalidTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberModifyTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberReadTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/SaveObjectsTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/TitleTest.java
    incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/ViewObjectTest.java
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/embedded/EmbeddedWebViewerRestful.java
    incubator/isis/trunk/viewer/restful/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/resources/ResourceAbstract.java
    incubator/isis/trunk/viewer/wicket/pom.xml
    incubator/isis/trunk/viewer/wicket/src/docbkx/guide/isis-wicket-viewer.xml
    incubator/isis/trunk/viewer/wicket/ui/pom.xml
    incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuItem.java
    incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuPanel.css
    incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/entitylink/EntityLink.css
    incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/banner.pdn
    incubator/isis/trunk/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/banner.png
    incubator/isis/trunk/viewer/wicket/viewer/pom.xml
    incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
    incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
    incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/login/WicketSignInPage.java
    incubator/isis/trunk/viewer/wicket/viewer/src/main/java/org/apache/isis/viewer/wicket/viewer/login/WicketSignOutPage.java

Modified: incubator/isis/trunk/alternatives/embedded/src/main/java/org/apache/isis/alternatives/embedded/internal/RuntimeContextForEmbeddedMetaModel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/embedded/src/main/java/org/apache/isis/alternatives/embedded/internal/RuntimeContextForEmbeddedMetaModel.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/embedded/src/main/java/org/apache/isis/alternatives/embedded/internal/RuntimeContextForEmbeddedMetaModel.java (original)
+++ incubator/isis/trunk/alternatives/embedded/src/main/java/org/apache/isis/alternatives/embedded/internal/RuntimeContextForEmbeddedMetaModel.java Thu Feb 24 18:03:34 2011
@@ -168,6 +168,12 @@ public class RuntimeContextForEmbeddedMe
 	            return adapterMap.adapterFor(domainObject);
 	        }
 
+            @Override
+            public ObjectAdapter createAggregatedInstance(ObjectSpecification spec, ObjectAdapter parent) {
+                throw new UnsupportedOperationException(
+                    "Not yet supported by this implementation of RuntimeContext");
+            }
+
 	        @Override
 	        public void resolve(Object parent) {
 	            context.resolve(parent);

Modified: incubator/isis/trunk/alternatives/progmodel/wrapper/applib/src/main/java/org/apache/isis/progmodel/wrapper/applib/WrapperObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/progmodel/wrapper/applib/src/main/java/org/apache/isis/progmodel/wrapper/applib/WrapperObject.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/progmodel/wrapper/applib/src/main/java/org/apache/isis/progmodel/wrapper/applib/WrapperObject.java (original)
+++ incubator/isis/trunk/alternatives/progmodel/wrapper/applib/src/main/java/org/apache/isis/progmodel/wrapper/applib/WrapperObject.java Thu Feb 24 18:03:34 2011
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.sp
 /**
  * Implemented by all objects that have been viewed as per {@link WrapperFactory#wrap(Object)}.
  */
-public interface WrapperObject<T> {
+public interface WrapperObject {
 
     /**
      * Programmatic equivalent of invoking save for a transient object (that is, like hitting the <i>save</i> button

Modified: incubator/isis/trunk/alternatives/progmodel/wrapper/metamodel/src/main/java/org/apache/isis/progmodel/wrapper/metamodel/internal/DomainObjectInvocationHandler.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/progmodel/wrapper/metamodel/src/main/java/org/apache/isis/progmodel/wrapper/metamodel/internal/DomainObjectInvocationHandler.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/progmodel/wrapper/metamodel/src/main/java/org/apache/isis/progmodel/wrapper/metamodel/internal/DomainObjectInvocationHandler.java (original)
+++ incubator/isis/trunk/alternatives/progmodel/wrapper/metamodel/src/main/java/org/apache/isis/progmodel/wrapper/metamodel/internal/DomainObjectInvocationHandler.java Thu Feb 24 18:03:34 2011
@@ -450,8 +450,8 @@ public class DomainObjectInvocationHandl
     }
 
     private Object underlying(final Object arg) {
-        if (arg instanceof WrapperObject<?>) {
-            final WrapperObject<?> argViewObject = (WrapperObject<?>) arg;
+        if (arg instanceof WrapperObject) {
+            final WrapperObject argViewObject = (WrapperObject) arg;
             return argViewObject.wrapped();
         } else {
             return arg;

Modified: incubator/isis/trunk/alternatives/security/file/src/main/java/org/apache/isis/alternatives/security/file/authentication/FileAuthenticationConstants.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/security/file/src/main/java/org/apache/isis/alternatives/security/file/authentication/FileAuthenticationConstants.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/security/file/src/main/java/org/apache/isis/alternatives/security/file/authentication/FileAuthenticationConstants.java (original)
+++ incubator/isis/trunk/alternatives/security/file/src/main/java/org/apache/isis/alternatives/security/file/authentication/FileAuthenticationConstants.java Thu Feb 24 18:03:34 2011
@@ -22,7 +22,7 @@ package org.apache.isis.alternatives.sec
 
 public class FileAuthenticationConstants {
 	
-	public static final String PASSWORDS_FILE = "passwords";
+	public static final String PASSWORDS_FILE = "security_file.passwords";
 
 	private FileAuthenticationConstants() {}
 

Modified: incubator/isis/trunk/alternatives/security/file/src/main/java/org/apache/isis/alternatives/security/file/authorization/FileAuthorizationConstants.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/security/file/src/main/java/org/apache/isis/alternatives/security/file/authorization/FileAuthorizationConstants.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/security/file/src/main/java/org/apache/isis/alternatives/security/file/authorization/FileAuthorizationConstants.java (original)
+++ incubator/isis/trunk/alternatives/security/file/src/main/java/org/apache/isis/alternatives/security/file/authorization/FileAuthorizationConstants.java Thu Feb 24 18:03:34 2011
@@ -30,7 +30,7 @@ public final class FileAuthorizationCons
 		ConfigurationConstants.ROOT + AuthorizationManagerInstaller.TYPE + "." + FileAuthorizationManagerInstaller.NAME + ".";
 	
 	public static final String WHITELIST_RESOURCE_KEY = ROOT + "whitelist";
-	public static final String WHITELIST_RESOURCE_DEFAULT = "allow";
+	public static final String WHITELIST_RESOURCE_DEFAULT = "security_file.allow";
 	
 	public static final String BLACKLIST_RESOURCE = ROOT + "blacklist";
 	public static final String BLACKLIST_RESOURCE_DEFAULT = "";

Modified: incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderDefault.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderDefault.java (original)
+++ incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderDefault.java Thu Feb 24 18:03:34 2011
@@ -17,35 +17,59 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.commons.config;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+
 import org.apache.log4j.Logger;
 
+import com.google.common.collect.Lists;
+
+import org.apache.isis.core.commons.resource.ResourceStreamSource;
 import org.apache.isis.core.commons.resource.ResourceStreamSourceContextLoaderClassPath;
 import org.apache.isis.core.commons.resource.ResourceStreamSourceFileSystem;
 
 /**
- * Convenience implementation of {@link IsisConfigurationBuilder} that
- * loads configuration resource as per {@link IsisConfigurationBuilderFileSystem}
- * and otherwise from the {@link ResourceStreamSourceContextLoaderClassPath classpath}.
+ * Convenience implementation of {@link IsisConfigurationBuilder} that loads configuration resource as per
+ * {@link IsisConfigurationBuilderFileSystem} and otherwise from the {@link ResourceStreamSourceContextLoaderClassPath
+ * classpath}.
  * 
  * @see ResourceStreamSourceFileSystem
  */
 public class IsisConfigurationBuilderDefault extends IsisConfigurationBuilderResourceStreams {
 
-	@SuppressWarnings("unused")
-	private static final Logger LOG = Logger
-			.getLogger(IsisConfigurationBuilderDefault.class);
-	
-	public IsisConfigurationBuilderDefault() {
-		super(
-				new ResourceStreamSourceFileSystem(ConfigurationConstants.DEFAULT_CONFIG_DIRECTORY),
-				new ResourceStreamSourceFileSystem(ConfigurationConstants.WEBINF_CONFIG_DIRECTORY),
-				new ResourceStreamSourceContextLoaderClassPath()
-			);
-	}
-
+    @SuppressWarnings("unused")
+    private static final Logger LOG = Logger.getLogger(IsisConfigurationBuilderDefault.class);
 
+    public IsisConfigurationBuilderDefault() {
+        super(resourceStreamSources(null));
+    }
+
+    public IsisConfigurationBuilderDefault(String firstDirectory) {
+        super(resourceStreamSources(firstDirectory));
+    }
+
+    
+    private static ResourceStreamSource[] resourceStreamSources(String firstDirectory) {
+        final ArrayList<ResourceStreamSource> rssList = Lists.newArrayList();
+        if(firstDirectory!=null) {
+            rssList.add(fromFileSystem(firstDirectory));
+        }
+        rssList.addAll(
+            Arrays.asList(
+                fromFileSystem(ConfigurationConstants.DEFAULT_CONFIG_DIRECTORY),
+                fromFileSystem(ConfigurationConstants.WEBINF_CONFIG_DIRECTORY), 
+                fromClassPath()));
+        return rssList.toArray(new ResourceStreamSource[0]);
+    }
+    
+    private static ResourceStreamSource fromFileSystem(String directory) {
+        return ResourceStreamSourceFileSystem.create(directory);
+    }
+
+    private static ResourceStreamSource fromClassPath() {
+        return new ResourceStreamSourceContextLoaderClassPath();
+    }
 
 }

Modified: incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderFileSystem.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderFileSystem.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderFileSystem.java (original)
+++ incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderFileSystem.java Thu Feb 24 18:03:34 2011
@@ -49,7 +49,7 @@ public class IsisConfigurationBuilderFil
     }
 
     public IsisConfigurationBuilderFileSystem() {
-        super(new ResourceStreamSourceFileSystem(ConfigurationConstants.DEFAULT_CONFIG_DIRECTORY));
+        super(ResourceStreamSourceFileSystem.create(ConfigurationConstants.DEFAULT_CONFIG_DIRECTORY));
     }
 
 }

Modified: incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderResourceStreams.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderResourceStreams.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderResourceStreams.java (original)
+++ incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/config/IsisConfigurationBuilderResourceStreams.java Thu Feb 24 18:03:34 2011
@@ -88,7 +88,7 @@ public class IsisConfigurationBuilderRes
     // ////////////////////////////////////////////////////////////
 
     public IsisConfigurationBuilderResourceStreams() {
-        this(new ResourceStreamSourceFileSystem(ConfigurationConstants.DEFAULT_CONFIG_DIRECTORY));
+        this(ResourceStreamSourceFileSystem.create(ConfigurationConstants.DEFAULT_CONFIG_DIRECTORY));
     }
 
     public IsisConfigurationBuilderResourceStreams(final ResourceStreamSource resourceStreamSource) {
@@ -99,6 +99,7 @@ public class IsisConfigurationBuilderRes
     public IsisConfigurationBuilderResourceStreams(final ResourceStreamSource... resourceStreamSources) {
         ResourceStreamSourceComposite composite = new ResourceStreamSourceComposite();
         for (ResourceStreamSource rss : resourceStreamSources) {
+            if(rss==null) {continue;}
             composite.addResourceStreamSource(rss);
         }
         this.resourceStreamSource = composite;

Modified: incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/resource/ResourceStreamSourceFileSystem.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/resource/ResourceStreamSourceFileSystem.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/resource/ResourceStreamSourceFileSystem.java (original)
+++ incubator/isis/trunk/core/commons/src/main/java/org/apache/isis/core/commons/resource/ResourceStreamSourceFileSystem.java Thu Feb 24 18:03:34 2011
@@ -20,22 +20,30 @@
 
 package org.apache.isis.core.commons.resource;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
 
 public class ResourceStreamSourceFileSystem extends ResourceStreamSourceAbstract {
-	
+
+    /**
+     * Factory method to guard against nulls
+     */
+    public static ResourceStreamSource create(String directory2) {
+        return directory2!=null?new ResourceStreamSourceFileSystem(directory2):null;
+    }
+
 	private String directory;
 
 	public ResourceStreamSourceFileSystem(String directory) {
 		this.directory = directory;
 	}
 
-	protected InputStream doReadResource(String resourcePath) throws FileNotFoundException {
+	@Override
+    protected InputStream doReadResource(String resourcePath) throws FileNotFoundException {
 		File file = new File(directory, resourcePath);
 		return new FileInputStream(file);
 	}
@@ -50,8 +58,10 @@ public class ResourceStreamSourceFileSys
 		}
 	}
 	
-	public String getName() {
+	@Override
+    public String getName() {
 		return "file system (directory '" + directory + "')";
-	}
+	}
+
 
 }

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/AdapterMapAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/AdapterMapAbstract.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/AdapterMapAbstract.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/AdapterMapAbstract.java Thu Feb 24 18:03:34 2011
@@ -18,6 +18,7 @@ package org.apache.isis.core.metamodel.a
 
 
 
+
 public abstract class AdapterMapAbstract implements AdapterMap {
 
     @Override

Modified: incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/AdapterMapDelegator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/AdapterMapDelegator.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/AdapterMapDelegator.java (original)
+++ incubator/isis/trunk/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/AdapterMapDelegator.java Thu Feb 24 18:03:34 2011
@@ -47,5 +47,4 @@ public abstract class AdapterMapDelegato
     public ObjectAdapter adapterFor(Object pojo, ObjectAdapter ownerAdapter, IdentifiedHolder identifiedHolder) {
         return underlying.adapterFor(pojo, ownerAdapter, identifiedHolder);
     }
-
 }

Added: incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/IsisInstallerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/IsisInstallerRegistry.java?rev=1074240&view=auto
==============================================================================
--- incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/IsisInstallerRegistry.java (added)
+++ incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/IsisInstallerRegistry.java Thu Feb 24 18:03:34 2011
@@ -0,0 +1,31 @@
+package org.apache.isis.core.runtime;
+import java.io.InputStream;
+
+import org.apache.isis.core.runtime.installers.InstallerLookupDefault;
+
+/**
+ *  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.
+ */
+
+public final class IsisInstallerRegistry {
+    
+    private IsisInstallerRegistry(){}
+    
+    public static InputStream getPropertiesAsStream() {
+        return IsisInstallerRegistry.class.getResourceAsStream(InstallerLookupDefault.INSTALLER_REGISTRY_FILE);
+    }
+
+}

Modified: incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/installers/InstallerLookupDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/installers/InstallerLookupDefault.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/installers/InstallerLookupDefault.java (original)
+++ incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/installers/InstallerLookupDefault.java Thu Feb 24 18:03:34 2011
@@ -31,9 +31,13 @@ import java.io.InputStreamReader;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.log4j.Logger;
+
+import com.google.inject.Inject;
+
 import org.apache.isis.core.commons.components.Installer;
-import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
 import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
 import org.apache.isis.core.commons.config.NotFoundPolicy;
 import org.apache.isis.core.commons.ensure.Assert;
 import org.apache.isis.core.commons.ensure.Ensure;
@@ -46,6 +50,7 @@ import org.apache.isis.core.commons.lang
 import org.apache.isis.core.commons.lang.StringUtils;
 import org.apache.isis.core.metamodel.specloader.FacetDecoratorInstaller;
 import org.apache.isis.core.metamodel.specloader.ObjectReflectorInstaller;
+import org.apache.isis.core.runtime.IsisInstallerRegistry;
 import org.apache.isis.core.runtime.about.AboutIsis;
 import org.apache.isis.core.runtime.about.ComponentDetails;
 import org.apache.isis.core.runtime.authentication.AuthenticationManagerInstaller;
@@ -60,9 +65,6 @@ import org.apache.isis.core.runtime.syst
 import org.apache.isis.core.runtime.userprofile.UserProfileStoreInstaller;
 import org.apache.isis.core.runtime.viewer.IsisViewerInstaller;
 import org.apache.isis.core.runtime.web.EmbeddedWebServerInstaller;
-import org.apache.log4j.Logger;
-
-import com.google.inject.Inject;
 
 
 /**
@@ -83,9 +85,11 @@ public class InstallerLookupDefault impl
 
     private static final Logger LOG = Logger.getLogger(InstallerLookupDefault.class);
 
-    public final String INSTALLER_REGISTRY_FILE = "installer-registry.properties";
+    public final static String INSTALLER_REGISTRY_FILE = "installer-registry.properties";
 
     private final List<Installer> installerList = new ArrayList<Installer>();
+    
+    @SuppressWarnings("unused")
     private final Class<?> cls;
 
     /**
@@ -108,7 +112,7 @@ public class InstallerLookupDefault impl
     }
 
     private void loadInstallers() {
-        final InputStream in = getInstallerRegistryStream(INSTALLER_REGISTRY_FILE, cls);
+        final InputStream in = getInstallerRegistryStream(INSTALLER_REGISTRY_FILE);
         final BufferedReader reader = new BufferedReader(new InputStreamReader(in));
         try {
             String line;
@@ -149,6 +153,7 @@ public class InstallerLookupDefault impl
     /**
      * This method (and only this method) may be called prior to {@link #init() initialization}.
      */
+    @Override
     public Installer[] getInstallers(final Class<?> cls) {
         final List<Installer> list = new ArrayList<Installer>();
         for (final Installer comp : installerList) {
@@ -156,13 +161,14 @@ public class InstallerLookupDefault impl
                 list.add(comp);
             }
         }
-        return (Installer[]) list.toArray(new Installer[list.size()]);
+        return list.toArray(new Installer[list.size()]);
     }
 
     // ////////////////////////////////////////////////////////
     // init, shutdown
     // ////////////////////////////////////////////////////////
 
+    @Override
     public void init() {
         ensureDependenciesInjected();
     }
@@ -171,6 +177,7 @@ public class InstallerLookupDefault impl
         Ensure.ensureThatState(isisConfigurationBuilder, is(not(nullValue())));
     }
 
+    @Override
     public void shutdown() {
     // nothing to do.
     }
@@ -179,26 +186,31 @@ public class InstallerLookupDefault impl
     // Type-safe Lookups
     // ////////////////////////////////////////////////////////
 
+    @Override
     public AuthenticationManagerInstaller authenticationManagerInstaller(String requested, final DeploymentType deploymentType) {
         return getInstaller(AuthenticationManagerInstaller.class, requested, SystemConstants.AUTHENTICATION_INSTALLER_KEY, 
                deploymentType.isExploring() ? SystemConstants.AUTHENTICATION_EXPLORATION_DEFAULT : SystemConstants.AUTHENTICATION_DEFAULT );
     }
 
+    @Override
     public AuthorizationManagerInstaller authorizationManagerInstaller(String requested, final DeploymentType deploymentType) {
         return getInstaller(AuthorizationManagerInstaller.class, requested, SystemConstants.AUTHORIZATION_INSTALLER_KEY,
                 !deploymentType.isProduction() ? SystemConstants.AUTHORIZATION_NON_PRODUCTION_DEFAULT : SystemConstants.AUTHORIZATION_DEFAULT);
     }
 
+    @Override
     public FixturesInstaller fixturesInstaller(String requested) {
         return getInstaller(FixturesInstaller.class, requested, SystemConstants.FIXTURES_INSTALLER_KEY,
                 SystemConstants.FIXTURES_INSTALLER_DEFAULT);
     }
 
+    @Override
     public TemplateImageLoaderInstaller templateImageLoaderInstaller(String requested) {
         return getInstaller(TemplateImageLoaderInstaller.class, requested, SystemConstants.IMAGE_LOADER_KEY,
                 SystemConstants.IMAGE_LOADER_DEFAULT);
     }
 
+    @Override
     public PersistenceMechanismInstaller persistenceMechanismInstaller(final String requested, final DeploymentType deploymentType) {
         String persistorDefault = deploymentType.isExploring() || deploymentType.isPrototyping() ? SystemConstants.OBJECT_PERSISTOR_NON_PRODUCTION_DEFAULT
                 : SystemConstants.OBJECT_PERSISTOR_PRODUCTION_DEFAULT;
@@ -206,6 +218,7 @@ public class InstallerLookupDefault impl
                 persistorDefault);
     }
 
+    @Override
     public UserProfileStoreInstaller userProfilePersistenceMechanismInstaller(String requested, DeploymentType deploymentType) {
         String profileStoreDefault = deploymentType.isExploring() || deploymentType.isPrototyping() ? SystemConstants.USER_PROFILE_STORE_NON_PRODUCTION_DEFAULT
                 : SystemConstants.USER_PROFILE_STORE_PRODUCTION_DEFAULT;
@@ -213,11 +226,13 @@ public class InstallerLookupDefault impl
                 profileStoreDefault);
     }
 
+    @Override
     public ObjectReflectorInstaller reflectorInstaller(final String requested) {
         return getInstaller(ObjectReflectorInstaller.class, requested, SystemConstants.REFLECTOR_KEY,
                 SystemConstants.REFLECTOR_DEFAULT);
     }
 
+    @Override
     public EmbeddedWebServerInstaller embeddedWebServerInstaller(final String requested) {
         return getInstaller(EmbeddedWebServerInstaller.class, requested, SystemConstants.WEBSERVER_KEY,
                 SystemConstants.WEBSERVER_DEFAULT);
@@ -242,11 +257,13 @@ public class InstallerLookupDefault impl
      * -specific configuration files, this lookup also merges in any
      * {@link ClientConnectionInstaller#getRemoteProperties() remote properties} available.
      */
+    @Override
     public ClientConnectionInstaller clientConnectionInstaller(final String requested) {
         return getInstaller(ClientConnectionInstaller.class, requested, SystemConstants.CLIENT_CONNECTION_KEY,
                 SystemConstants.CLIENT_CONNECTION_DEFAULT);
     }
 
+    @Override
     public IsisViewerInstaller viewerInstaller(final String name, final String defaultName) {
         String viewer;
         if (name == null) {
@@ -260,6 +277,7 @@ public class InstallerLookupDefault impl
         return getInstaller(IsisViewerInstaller.class, viewer);
     }
 
+    @Override
     public IsisViewerInstaller viewerInstaller(final String name) {
         final IsisViewerInstaller installer = getInstaller(IsisViewerInstaller.class, name);
         if (installer == null) {
@@ -268,6 +286,7 @@ public class InstallerLookupDefault impl
         return installer;
     }
 
+    @Override
     public ServicesInstaller servicesInstaller(final String requestedImplementationName) {
         return getInstaller(ServicesInstaller.class, requestedImplementationName, SystemConstants.SERVICES_INSTALLER_KEY,
                 SystemConstants.SERVICES_INSTALLER_DEFAULT);
@@ -277,6 +296,7 @@ public class InstallerLookupDefault impl
     // Generic Lookups
     // ////////////////////////////////////////////////////////
 
+    @Override
     @SuppressWarnings("unchecked")
     public <T extends Installer> T getInstaller(final Class<T> cls, final String implName) {
         Assert.assertNotNull("No name specified", implName);
@@ -290,6 +310,7 @@ public class InstallerLookupDefault impl
         return (T) getInstaller(implName);
     }
 
+    @Override
     @SuppressWarnings("unchecked")
     public Installer getInstaller(final String implClassName) {
         try {
@@ -306,6 +327,7 @@ public class InstallerLookupDefault impl
         }
     }
 
+    @Override
     @SuppressWarnings("unchecked")
     public <T extends Installer> T getInstaller(final Class<T> installerCls) {
         try {
@@ -351,8 +373,8 @@ public class InstallerLookupDefault impl
         }
     }
 
-    private InputStream getInstallerRegistryStream(final String componentFile, Class<?> cls) {
-        final InputStream in = cls.getResourceAsStream("/" + componentFile);
+    private InputStream getInstallerRegistryStream(final String componentFile) {
+        final InputStream in = IsisInstallerRegistry.getPropertiesAsStream();
         if (in == null) {
             throw new IsisException("No resource found: " + componentFile);
         }
@@ -363,6 +385,7 @@ public class InstallerLookupDefault impl
     // Configuration
     // ////////////////////////////////////////////////////////
 
+    @Override
     public IsisConfiguration getConfiguration() {
         return isisConfigurationBuilder.getConfiguration();
     }
@@ -373,6 +396,7 @@ public class InstallerLookupDefault impl
         }
     }
 
+    @Override
     public <T> T injectDependenciesInto(T candidate) {
         injectInto(candidate);
         return candidate;
@@ -382,6 +406,7 @@ public class InstallerLookupDefault impl
     // Injectable
     // ////////////////////////////////////////////////////////////////////
 
+    @Override
     public void injectInto(Object candidate) {
         if (InstallerLookupAware.class.isAssignableFrom(candidate.getClass())) {
             InstallerLookupAware cast = InstallerLookupAware.class.cast(candidate);
@@ -394,10 +419,12 @@ public class InstallerLookupDefault impl
     // Dependencies (injected)
     // ////////////////////////////////////////////////////////
 
+    @Override
     public IsisConfigurationBuilder getConfigurationBuilder() {
         return isisConfigurationBuilder;
     }
 
+    @Override
     @Inject
     public void setConfigurationBuilder(final IsisConfigurationBuilder configurationLoader) {
         this.isisConfigurationBuilder = configurationLoader;

Modified: incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterManager.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterManager.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterManager.java (original)
+++ incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/adaptermanager/AdapterManager.java Thu Feb 24 18:03:34 2011
@@ -41,12 +41,6 @@ import org.apache.isis.core.metamodel.ad
 public interface AdapterManager extends AdapterManagerLookup, Injectable, AdapterMap {
 
     
-    
-    ///////////////////////////////////////////////////////////
-    // lookup/creation
-    ///////////////////////////////////////////////////////////
-
-
 
     ///////////////////////////////////////////////////////////
     // removal

Modified: incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/internal/RuntimeContextFromSession.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/internal/RuntimeContextFromSession.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/internal/RuntimeContextFromSession.java (original)
+++ incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/internal/RuntimeContextFromSession.java Thu Feb 24 18:03:34 2011
@@ -42,11 +42,8 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.map.AdapterMap;
 import org.apache.isis.core.metamodel.adapter.map.AdapterMapAbstract;
 import org.apache.isis.core.metamodel.adapter.oid.AggregatedOid;
-import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.facetapi.IdentifiedHolder;
 import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacetUtils;
-import org.apache.isis.core.metamodel.facets.typeof.ElementSpecificationProviderFromTypeOfFacet;
-import org.apache.isis.core.metamodel.facets.typeof.TypeOfFacet;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjector;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjectorAbstract;
 import org.apache.isis.core.metamodel.runtimecontext.RuntimeContextAbstract;
@@ -55,7 +52,6 @@ import org.apache.isis.core.metamodel.sp
 import org.apache.isis.core.metamodel.spec.ObjectInstantiator;
 import org.apache.isis.core.metamodel.spec.ObjectInstantiatorAbstract;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification.CreationMode;
 import org.apache.isis.core.runtime.context.IsisContext;
 import org.apache.isis.core.runtime.persistence.PersistenceSession;
 import org.apache.isis.core.runtime.persistence.adaptermanager.AdapterManager;
@@ -157,6 +153,7 @@ public class RuntimeContextFromSession e
                 return getPersistenceSession().createInstance(spec);
             }
             
+            @Override
             public ObjectAdapter createAggregatedInstance(ObjectSpecification spec, ObjectAdapter parent) {
                 AggregatedOid oid = new AggregatedOid(parent.getOid(), "*UNKNOWN*");
                 
@@ -166,10 +163,8 @@ public class RuntimeContextFromSession e
                     adapter.changeState(resolveState);
                     adapter.changeState(resolveState.getEndState());
                 }
-                
                 return adapter;
-                
-                // return getPersistenceSession().createAggregatedInstance(spec,parent);
+
             };
 
             @Override

Modified: incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisModule.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisModule.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisModule.java (original)
+++ incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/IsisModule.java Thu Feb 24 18:03:34 2011
@@ -29,7 +29,7 @@ import org.apache.isis.core.commons.conf
 import org.apache.isis.core.runtime.installers.InstallerLookup;
 import org.apache.isis.core.runtime.installers.InstallerLookupDefault;
 import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.IsiSsystemUsingInstallersFactory;
+import org.apache.isis.core.runtime.system.IsisSystemThatUsesInstallersFactory;
 import org.apache.isis.core.runtime.system.IsisSystem;
 import org.apache.isis.core.runtime.system.IsisSystemFactory;
 import org.apache.isis.core.runtime.viewer.IsisViewer;
@@ -151,7 +151,7 @@ public class IsisModule extends Abstract
     @Inject
     @Singleton
     private IsisSystemFactory provideIsisSystemFactory(final InstallerLookup installerLookup) {
-        IsiSsystemUsingInstallersFactory systemFactory = new IsiSsystemUsingInstallersFactory(installerLookup);
+        IsisSystemThatUsesInstallersFactory systemFactory = new IsisSystemThatUsesInstallersFactory(installerLookup);
         systemFactory.init();
         return systemFactory;
     }

Copied: incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemThatUsesInstallersFactory.java (from r1071637, incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsiSsystemUsingInstallersFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemThatUsesInstallersFactory.java?p2=incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemThatUsesInstallersFactory.java&p1=incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsiSsystemUsingInstallersFactory.java&r1=1071637&r2=1074240&rev=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsiSsystemUsingInstallersFactory.java (original)
+++ incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemThatUsesInstallersFactory.java Thu Feb 24 18:03:34 2011
@@ -30,7 +30,7 @@ import com.google.inject.Inject;
  * Implementation of {@link IsisSystemFactory} that uses {@link InstallerLookup} to convert the names
  * of components into actual component instances.
  */
-public class IsiSsystemUsingInstallersFactory implements IsisSystemFactory {
+public class IsisSystemThatUsesInstallersFactory implements IsisSystemFactory {
 
     private final InstallerLookup installerLookup;
 
@@ -39,7 +39,7 @@ public class IsiSsystemUsingInstallersFa
     // //////////////////////////////////////////////////////////
 
     @Inject
-    public IsiSsystemUsingInstallersFactory(final InstallerLookup installerLookup) {
+    public IsisSystemThatUsesInstallersFactory(final InstallerLookup installerLookup) {
         this.installerLookup = installerLookup;
     }
 

Modified: incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java (original)
+++ incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/IsisWebAppBootstrapper.java Thu Feb 24 18:03:34 2011
@@ -28,9 +28,12 @@ import javax.servlet.ServletContextListe
 
 import org.apache.log4j.Logger;
 
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
 import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
-import org.apache.isis.core.commons.config.IsisConfigurationBuilderResourceStreams;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilderPrimer;
+import org.apache.isis.core.commons.config.IsisConfigurationBuilderResourceStreams;
 import org.apache.isis.core.commons.config.NotFoundPolicy;
 import org.apache.isis.core.commons.resource.ResourceStreamSourceContextLoaderClassPath;
 import org.apache.isis.core.runtime.installers.InstallerLookup;
@@ -41,9 +44,6 @@ import org.apache.isis.core.runtime.syst
 import org.apache.isis.core.runtime.system.IsisSystem;
 import org.apache.isis.core.runtime.system.SystemConstants;
 
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-
 
 /**
  * Initialize the {@link IsisSystem} when the web application starts,
@@ -75,6 +75,7 @@ public class IsisWebAppBootstrapper impl
     // Initialization
     // /////////////////////////////////////////////////////
 
+    @Override
     public void contextInitialized(final ServletContextEvent servletContextEvent) {
         try {
         ServletContext servletContext = servletContextEvent.getServletContext();
@@ -96,6 +97,9 @@ public class IsisWebAppBootstrapper impl
         addConfigurationResourcesForWebApps(isisConfigurationBuilder);
         addConfigurationResourcesForDeploymentType(isisConfigurationBuilder,
                 deploymentType);
+        addConfigurationResourcesForViewers(isisConfigurationBuilder,
+            servletContext);
+        
         isisConfigurationBuilder.add(WebAppConstants.WEB_APP_DIR, webappDir);
         isisConfigurationBuilder.add(SystemConstants.NOSPLASH_KEY, "true");
 
@@ -185,10 +189,31 @@ public class IsisWebAppBootstrapper impl
         }
     }
 
+    private void addConfigurationResourcesForViewers(
+        final IsisConfigurationBuilder configurationLoader,
+        final ServletContext servletContext) {
+        addConfigurationResourcesForContextParam(configurationLoader, servletContext, "isis.viewers");
+        addConfigurationResourcesForContextParam(configurationLoader, servletContext, "isis.viewer");
+    }
+
+    private void addConfigurationResourcesForContextParam(final IsisConfigurationBuilder configurationLoader,
+        final ServletContext servletContext, final String name) {
+        final String viewers = servletContext.getInitParameter(name);
+        if(viewers==null) {
+            return;
+        }
+        for (String viewer : viewers.split(",")) {
+            configurationLoader.addConfigurationResource("viewer_" + viewer + ".properties",
+                NotFoundPolicy.CONTINUE);
+        }
+    }
+
+
     // /////////////////////////////////////////////////////
     // Destroy
     // /////////////////////////////////////////////////////
 
+    @Override
     public void contextDestroyed(final ServletContextEvent ev) {
         LOG.info("server shutting down");
         ServletContext servletContext = ev.getServletContext();

Added: incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/ForwardingServlet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/ForwardingServlet.java?rev=1074240&view=auto
==============================================================================
--- incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/ForwardingServlet.java (added)
+++ incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/ForwardingServlet.java Thu Feb 24 18:03:34 2011
@@ -0,0 +1,52 @@
+/*
+ *  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.
+ */
+
+package org.apache.isis.core.webapp.servlets;
+
+import java.io.IOException;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class ForwardingServlet extends HttpServlet {
+
+    private static final long serialVersionUID = 1L;
+    private String forwardTo;
+
+    @Override
+    public void init(ServletConfig config) throws ServletException {
+        forwardTo = enslash(config.getInitParameter("forwardTo"));
+    }
+    
+    private static String enslash(String str) {
+        return str.startsWith("/")?str:"/"+str;
+    }
+
+    @Override
+    protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException,
+        IOException {
+        final RequestDispatcher requestDispatcher = request.getRequestDispatcher(forwardTo);
+        requestDispatcher.forward(request, response);
+    }
+
+}

Added: incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/RedirectServlet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/RedirectServlet.java?rev=1074240&view=auto
==============================================================================
--- incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/RedirectServlet.java (added)
+++ incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/RedirectServlet.java Thu Feb 24 18:03:34 2011
@@ -0,0 +1,46 @@
+/*
+ *  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.
+ */
+
+package org.apache.isis.core.webapp.servlets;
+
+import java.io.IOException;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class RedirectServlet extends HttpServlet {
+
+    private static final long serialVersionUID = 1L;
+    private String redirectTo;
+
+    @Override
+    public void init(ServletConfig config) throws ServletException {
+        redirectTo = config.getInitParameter("redirectTo");
+    }
+
+    @Override
+    protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException,
+        IOException {
+        response.sendRedirect(redirectTo);
+    }
+
+}

Modified: incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/ResourceServlet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/ResourceServlet.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/ResourceServlet.java (original)
+++ incubator/isis/trunk/core/webapp/src/main/java/org/apache/isis/core/webapp/servlets/ResourceServlet.java Thu Feb 24 18:03:34 2011
@@ -29,20 +29,16 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.log4j.Logger;
+
 import org.apache.isis.core.commons.lang.IoUtils;
 import org.apache.isis.core.commons.lang.Resources;
 import org.apache.isis.core.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
 
-/**
- * 
- * @author Dan Haywood
- * 
- */
 public class ResourceServlet extends HttpServlet {
 
+    private static final Logger LOG = Logger.getLogger(ResourceServlet.class);
     private static final long serialVersionUID = 1L;
-    private final Logger LOG = Logger.getLogger(ResourceServlet.class);
 
     @Override
     protected void doPost(final HttpServletRequest request, final HttpServletResponse response)

Modified: incubator/isis/trunk/core/webapp/src/site/apt/jottings.apt
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/webapp/src/site/apt/jottings.apt?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/core/webapp/src/site/apt/jottings.apt (original)
+++ incubator/isis/trunk/core/webapp/src/site/apt/jottings.apt Thu Feb 24 18:03:34 2011
@@ -21,4 +21,23 @@ Jottings
  
   This page is to capture any random jottings relating to this module prior 
   to being moved into formal documentation. 
- 
+
+Support for viewer config files 
+
+  The "Installer" architecture will automatically load configFiles, following 
+  the convention "xxx_yyy.properties".  When run from org.apache.isis.Isis or
+  org.apache.isis.WebServer, a "viewer installer" is also specified, meaning
+  that a config file for this viewer is also loaded (eg viewer_html.properties).
+  However, while IsisWebAppBootstrapper uses the installer architecture for
+  "back-end" components (security, persistor etc), it is not used for the viewers.
+  
+  Therefore, the IsisWebAppBootstrapper will load additional config files for
+  viewers if required, by searching for the "isis.viewers" context-param.
+  
+  For example:
+
+     <context-param>
+        <param-name>isis.viewers</param-name>
+        <param-value>restful</param-value>
+     </context-param>
+ 
\ No newline at end of file

Modified: incubator/isis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/pom.xml?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/pom.xml (original)
+++ incubator/isis/trunk/pom.xml Thu Feb 24 18:03:34 2011
@@ -889,7 +889,7 @@
             <dependency>
                 <groupId>com.google.guava</groupId>
                 <artifactId>guava</artifactId>
-                <version>r06</version>
+                <version>r08</version>
             </dependency>
 
             <!-- Google Guice (dependency injection) -->

Modified: incubator/isis/trunk/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/src/site/apt/index.apt?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/src/site/apt/index.apt (original)
+++ incubator/isis/trunk/src/site/apt/index.apt Thu Feb 24 18:03:34 2011
@@ -64,6 +64,20 @@ Where to Start?
   <Apache Isis>.  To keep things manageable, we've tried to scope information 
   closest to where it's relevant.  To help guide you through the
   framework, we've also prepared a {{{./where-to-start.html}where to start}}.
+  If you want to drill into detail, you can either follow the links in the menu
+  on the left, and/or you can click on the map to the modules.  
+
+Promoting Apache Isis
+
+  If you've spent some time playing with Isis and would like to promote it 
+  within your organization (at a Brown Bag lunch, say) then we have some 
+  presentation material for you to use.  The material includes speaker notes 
+  and is available as a {{{./presentations/IntroducingApacheIsis.pptx}PPTX}} 
+  and {{{./presentations/IntroducingApacheIsis.ppt}PPT}} (Microsoft), an  
+  {{{./presentations/IntroducingApacheIsis.odp}ODP}} (OpenDocument) and also 
+  as a PDF ({{{./presentations/IntroducingApacheIsis-slides.pdf}slides}} and  
+  {{{./presentations/IntroducingApacheIsis-notes.pdf}notes}}).  Feel free to 
+  edit them to your needs.
 
 Disclaimer
   

Added: incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis-notes.pdf
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis-notes.pdf?rev=1074240&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis-notes.pdf
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis-slides.pdf
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis-slides.pdf?rev=1074240&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis-slides.pdf
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.odp
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.odp?rev=1074240&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.odp
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.ppt
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.ppt?rev=1074240&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.ppt
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.pptx
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.pptx?rev=1074240&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/isis/trunk/src/site/resources/presentations/IntroducingApacheIsis.pptx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/isis/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/src/site/site.xml?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/src/site/site.xml (original)
+++ incubator/isis/trunk/src/site/site.xml Thu Feb 24 18:03:34 2011
@@ -44,7 +44,7 @@
             <item name="Twitter (#ApacheIsis)" href="http://search.twitter.com/search?q=%23ApacheIsis" />
             <item name="Wiki" href="https://cwiki.apache.org/confluence/display/ISIS/Index" />
             <item name="JIRA" href="https://issues.apache.org/jira/browse/ISIS" />
-            <item name="Hudson CI" href="https://hudson.apache.org/hudson/job/Isis-trunk-windows" />
+            <item name="CI" href="https://hudson.apache.org/hudson/job/isis-trunk-ubuntu" />
         </menu>
 
         <menu name="The Naked Objects Pattern">
@@ -114,6 +114,15 @@
 				<item name="Richard Pawson's Thesis" href="Pawson-Naked-Objects-thesis.pdf" />
     			<item name="Naked Objects for .NET" href="http://www.nakedobjects.net/" />
 			</item>
+            <item name="Presentation Materials (please reuse)">
+                <item name="Introducing Apache Isis">
+                    <item name="PPTX (Microsoft)" href="./presentations/IntroducingApacheIsis.pptx" />
+                    <item name="PPT (Microsoft)" href="./presentations/IntroducingApacheIsis.ppt" />
+                    <item name="ODP (OpenDocument)" href="./presentations/IntroducingApacheIsis.odp" />
+                    <item name="PDF slides" href="./presentations/IntroducingApacheIsis-slides.pdf" />
+                    <item name="PDF notes" href="./presentations/IntroducingApacheIsis-notes.pdf" />
+                </item>
+            </item>
 		</menu>
 
 

Modified: incubator/isis/trunk/viewer/bdd/common/pom.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/pom.xml?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/pom.xml (original)
+++ incubator/isis/trunk/viewer/bdd/common/pom.xml Thu Feb 24 18:03:34 2011
@@ -36,8 +36,8 @@
             <artifactId>security</artifactId>
         </dependency>
 	    <dependency>
-		    <groupId>com.google.collections</groupId>
-		    <artifactId>google-collections</artifactId>
+		    <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
 	    </dependency>
 	</dependencies>
 </project>      

Modified: incubator/isis/trunk/viewer/bdd/pom.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/pom.xml?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/pom.xml (original)
+++ incubator/isis/trunk/viewer/bdd/pom.xml Thu Feb 24 18:03:34 2011
@@ -99,9 +99,9 @@
             </dependency>
 
 		    <dependency>
-			    <groupId>com.google.collections</groupId>
-			    <artifactId>google-collections</artifactId>
-			    <version>1.0</version>
+			    <groupId>com.google.guava</groupId>
+                <artifactId>guava</artifactId>
+                <version>r08</version>
 		    </dependency>
 
          </dependencies>

Modified: incubator/isis/trunk/viewer/html/src/main/java/org/apache/isis/viewer/html/HtmlViewerInstaller.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/html/src/main/java/org/apache/isis/viewer/html/HtmlViewerInstaller.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/html/src/main/java/org/apache/isis/viewer/html/HtmlViewerInstaller.java (original)
+++ incubator/isis/trunk/viewer/html/src/main/java/org/apache/isis/viewer/html/HtmlViewerInstaller.java Thu Feb 24 18:03:34 2011
@@ -28,6 +28,7 @@ import org.apache.isis.core.runtime.web.
 import org.apache.isis.core.runtime.web.WebAppSpecification;
 import org.apache.isis.core.webapp.IsisSessionFilter;
 import org.apache.isis.core.webapp.StaticContentFilter;
+import org.apache.isis.core.webapp.servlets.RedirectServlet;
 import org.apache.isis.core.webapp.servlets.ResourceServlet;
 import org.apache.isis.viewer.html.servlet.ControllerServlet;
 import org.apache.isis.viewer.html.servlet.HtmlServletConstants;
@@ -50,6 +51,7 @@ public class HtmlViewerInstaller extends
 	
 	private static final String LOGON_PAGE = HtmlServletConstants.LOGON_APP_PAGE;
 	private static final String LOGON_PAGE_MAPPED = "/"+LOGON_PAGE;
+	private static final String ROOT_PAGE_MAPPED = "/";
 	
 	private static final String[] STATIC_CONTENT = new String[]{"*.gif", "*.png", "*.jpg", "*.css"};
 	private static final String DYNAMIC_CONTENT = "*.app";
@@ -63,9 +65,12 @@ public class HtmlViewerInstaller extends
 	@Override
     public IsisViewer doCreateViewer() {
         return new EmbeddedWebViewer() {
+            @Override
             public WebAppSpecification getWebAppSpecification() {
 
                 WebAppSpecification webAppSpec = new WebAppSpecification();
+   
+                webAppSpec.addContextParams("isis.viewers", "html");
                 
                 webAppSpec.addFilterSpecification(
                 		IsisSessionFilter.class, 
@@ -74,9 +79,17 @@ public class HtmlViewerInstaller extends
                 webAppSpec.addServletSpecification(LogonServlet.class, LOGON_PAGE_MAPPED);
                 webAppSpec.addServletSpecification(ControllerServlet.class, DYNAMIC_CONTENT);
                 
-                webAppSpec.addFilterSpecification(StaticContentFilter.class, STATIC_CONTENT);
+                webAppSpec.addFilterSpecification(StaticContentFilter.class, 
+                        MapUtils.asMap("CacheTime", "86400"),
+                        STATIC_CONTENT);
                 webAppSpec.addServletSpecification(ResourceServlet.class, STATIC_CONTENT );
-                
+
+                // this is slightly different from the web.xml in the archetype, and doesn't
+                // redirect from '/', only from '/xxx' (ie need to type something after the '/')  
+                webAppSpec.addServletSpecification(
+                        RedirectServlet.class, 
+                        MapUtils.asMap("redirectTo", LOGON_PAGE),
+                        "/" );
 
                 final String resourceBaseDir = getConfiguration().getString(HtmlViewerConstants.VIEWER_HTML_RESOURCE_BASE_KEY);
                 if (resourceBaseDir != null) {
@@ -86,8 +99,7 @@ public class HtmlViewerInstaller extends
                 webAppSpec.addResourcePath("./src/main/webapp");
                 webAppSpec.addResourcePath("./web");
                 webAppSpec.addResourcePath(".");
-                webAppSpec.addWelcomeFile(LOGON_PAGE);
-                
+
 				webAppSpec.setLogHint("open a web browser and browse to logon.app to connect");
 
                 return webAppSpec;

Added: incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/ConfigDir.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/ConfigDir.java?rev=1074240&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/ConfigDir.java (added)
+++ incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/ConfigDir.java Thu Feb 24 18:03:34 2011
@@ -0,0 +1,38 @@
+/*
+ *  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.
+ */
+
+
+package org.apache.isis.viewer.junit;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * The location of the <tt>config</tt> directory, relative to the base.
+ */
+@Target(ElementType.TYPE)
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ConfigDir {
+    String value();
+}

Modified: incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/IsisTestRunner.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/IsisTestRunner.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/IsisTestRunner.java (original)
+++ incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/IsisTestRunner.java Thu Feb 24 18:03:34 2011
@@ -20,33 +20,31 @@
 
 package org.apache.isis.viewer.junit;
 
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.jmock.Mockery;
-import org.junit.internal.runners.InitializationError;
-import org.junit.internal.runners.JUnit4ClassRunner;
-import org.junit.internal.runners.MethodRoadie;
-import org.junit.internal.runners.TestMethod;
-import org.junit.runner.Description;
-import org.junit.runner.notification.RunNotifier;
-import org.apache.isis.applib.fixtures.LogonFixture;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.jmock.Mockery;
+import org.junit.internal.runners.InitializationError;
+import org.junit.internal.runners.JUnit4ClassRunner;
+import org.junit.internal.runners.MethodRoadie;
+import org.junit.internal.runners.TestClass;
+import org.junit.internal.runners.TestMethod;
+import org.junit.runner.Description;
+import org.junit.runner.notification.RunNotifier;
+
+import org.apache.isis.applib.fixtures.LogonFixture;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
 import org.apache.isis.core.commons.config.IsisConfigurationBuilderDefault;
-import org.apache.isis.core.commons.config.IsisConfigurationBuilderFileSystem;
 import org.apache.isis.core.metamodel.services.ServicesInjector;
 import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
-import org.apache.isis.core.runtime.authentication.standard.SimpleSession;
 import org.apache.isis.core.runtime.authentication.standard.exploration.AuthenticationRequestExploration;
-import org.apache.isis.core.runtime.authentication.standard.exploration.ExplorationSession;
 import org.apache.isis.core.runtime.authentication.standard.fixture.AuthenticationRequestLogonFixture;
 import org.apache.isis.core.runtime.context.IsisContext;
 import org.apache.isis.core.runtime.installers.InstallerLookupDefault;
 import org.apache.isis.core.runtime.persistence.PersistenceSession;
 import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.Splash;
 import org.apache.isis.core.runtime.system.SystemConstants;
 import org.apache.isis.core.runtime.transaction.IsisTransactionManager;
 import org.apache.isis.viewer.junit.internal.IsisSystemUsingInstallersWithinJunit;
@@ -70,13 +68,24 @@ public class IsisTestRunner extends JUni
         // JMock initialization, adapted to allow for no mockery field.
         mockeryField = findFieldAndMakeAccessible(testClass, Mockery.class);
     }
+
+    private static String getConfigDir(Class<?> javaClass) {
+        final ConfigDir fixturesAnnotation = javaClass.getAnnotation(ConfigDir.class);
+        if (fixturesAnnotation != null) {
+            return fixturesAnnotation.value();
+        }
+        return null;
+    }
 
     @Override
     protected void invokeTestMethod(final Method method, final RunNotifier notifier) {
+
+        final TestClass testClass = getTestClass();
+        final String configDirIfAny = getConfigDir(testClass.getJavaClass());
 
     	final Description description = methodDescription(method);
     	
-        IsisConfigurationBuilder isisConfigurationBuilder = new IsisConfigurationBuilderDefault();
+        IsisConfigurationBuilder isisConfigurationBuilder = new IsisConfigurationBuilderDefault(configDirIfAny);
         isisConfigurationBuilder.add(SystemConstants.NOSPLASH_KEY, ""+true); // switch off splash
         
         InstallerLookupDefault installerLookup = new InstallerLookupDefault(getClass());
@@ -91,7 +100,7 @@ public class IsisTestRunner extends JUni
 
             // TODO: replace with regular IsisSystem and remove this subclass.
             system = new IsisSystemUsingInstallersWithinJunit(
-                    deploymentType, installerLookup, getTestClass());
+                    deploymentType, installerLookup, testClass);
 
             system.init();
             

Modified: incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/internal/IsisSystemUsingInstallersWithinJunit.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/internal/IsisSystemUsingInstallersWithinJunit.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/internal/IsisSystemUsingInstallersWithinJunit.java (original)
+++ incubator/isis/trunk/viewer/junit/src/main/java/org/apache/isis/viewer/junit/internal/IsisSystemUsingInstallersWithinJunit.java Thu Feb 24 18:03:34 2011
@@ -20,6 +20,8 @@
 
 package org.apache.isis.viewer.junit.internal;
 
+import org.junit.internal.runners.TestClass;
+
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.runtime.installers.InstallerLookup;
 import org.apache.isis.core.runtime.system.DeploymentType;
@@ -27,12 +29,11 @@ import org.apache.isis.core.runtime.syst
 import org.apache.isis.defaults.profilestore.InMemoryUserProfileStoreInstaller;
 import org.apache.isis.defaults.security.authentication.NoopAuthenticationManagerInstaller;
 import org.apache.isis.defaults.security.authorization.NoopAuthorizationManagerInstaller;
-import org.junit.internal.runners.TestClass;
 
 public class IsisSystemUsingInstallersWithinJunit extends IsisSystemUsingInstallers {
-
+
     private final TestClass testClass;
-
+
     public IsisSystemUsingInstallersWithinJunit(
             final DeploymentType deploymentType, 
             final InstallerLookup installerLookup, 
@@ -44,7 +45,7 @@ public class IsisSystemUsingInstallersWi
         setAuthorizationInstaller(getInstallerLookup().injectDependenciesInto(new NoopAuthorizationManagerInstaller()));
         setPersistenceMechanismInstaller(getInstallerLookup().injectDependenciesInto(new InMemoryPersistenceMechanismInstallerWithinJunit()));
         setUserProfileStoreInstaller(getInstallerLookup().injectDependenciesInto(new InMemoryUserProfileStoreInstaller()));
-
+
         // fixture installer
         FixtureInstallerAnnotatedClass fixtureInstaller = new FixtureInstallerAnnotatedClass();
         try {

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/AbstractTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/AbstractTest.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/AbstractTest.java (original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/AbstractTest.java Thu Feb 24 18:03:34 2011
@@ -44,7 +44,7 @@ import org.junit.runner.RunWith;
 public abstract class AbstractTest {
 
     protected Customer custJsDO;
-    protected Customer custJsVO;
+    protected Customer custJsWO;
 
     protected Product product355DO;
     protected Product product355VO;
@@ -78,7 +78,7 @@ public abstract class AbstractTest {
         countryAusDO = countryRepository.findByCode("AUS");
 
         custJsDO = customerRepository.findByName("Pawson");
-        custJsVO = wrapperFactory.wrap(custJsDO);
+        custJsWO = wrapperFactory.wrap(custJsDO);
     }
 
     @After

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/DefaultAndChoicesTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/DefaultAndChoicesTest.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/DefaultAndChoicesTest.java (original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/DefaultAndChoicesTest.java Thu Feb 24 18:03:34 2011
@@ -31,7 +31,7 @@ public class DefaultAndChoicesTest exten
 
     @Test
     public void defaults() {
-        final Object[] defaultPlaceOrder = custJsVO.defaultPlaceOrder();
+        final Object[] defaultPlaceOrder = custJsWO.defaultPlaceOrder();
         assertThat(defaultPlaceOrder.length, is(2));
     }
 

Modified: incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberDisabledTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberDisabledTest.java?rev=1074240&r1=1074239&r2=1074240&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberDisabledTest.java (original)
+++ incubator/isis/trunk/viewer/junit/src/test/java/org/apache/isis/viewer/junit/MemberDisabledTest.java Thu Feb 24 18:03:34 2011
@@ -40,7 +40,7 @@ public class MemberDisabledTest extends 
     public void whenValueDisabledForValueThenThrowsException() {
         custJsDO.disableFirstName = "cannot alter";
         try {
-            custJsVO.setFirstName("Dick");
+            custJsWO.setFirstName("Dick");
             fail("Should have thrown exception");
         } catch (final DisabledException ex) {
             assertThat(ex.getAdvisorClass(), classEqualTo(DisableForContextFacetViaMethod.class));
@@ -53,7 +53,7 @@ public class MemberDisabledTest extends 
     public void whenValueDisabledForNullThenThrowsException() {
         custJsDO.disableFirstName = "cannot alter";
         try {
-            custJsVO.setFirstName(null);
+            custJsWO.setFirstName(null);
             fail("Should have thrown exception");
         } catch (final DisabledException ex) {
             assertThat(ex.getAdvisorClass(), classEqualTo(DisableForContextFacetViaMethod.class));
@@ -66,7 +66,7 @@ public class MemberDisabledTest extends 
     public void whenAssociationDisabledForReferenceThenThrowsException() {
         custJsDO.disableCountryOfBirth = "cannot alter";
         try {
-            custJsVO.setCountryOfBirth(countryUsaDO);
+            custJsWO.setCountryOfBirth(countryUsaDO);
             fail("Should have thrown exception");
         } catch (final DisabledException ex) {
             assertThat(ex.getAdvisorClass(), classEqualTo(DisableForContextFacetViaMethod.class));
@@ -79,7 +79,7 @@ public class MemberDisabledTest extends 
     public void whenAssociationDisabledForNullThenThrowsException() {
         custJsDO.disableCountryOfBirth = "cannot alter";
         try {
-            custJsVO.setCountryOfBirth(null);
+            custJsWO.setCountryOfBirth(null);
             fail("Should have thrown exception");
         } catch (final DisabledException ex) {
             assertThat(ex.getAdvisorClass(), classEqualTo(DisableForContextFacetViaMethod.class));
@@ -90,10 +90,10 @@ public class MemberDisabledTest extends 
 
     @Test
     public void whenCollectionDisabledThenAddToThrowsException() {
-        List<Order> orders = custJsVO.getOrders();
+        List<Order> orders = custJsWO.getOrders();
 		final Order order = orders.get(0);
         try {
-            custJsVO.addToMoreOrders(order);
+            custJsWO.addToMoreOrders(order);
             fail("Should have thrown exception");
         } catch (final DisabledException ex) {
             assertThat(ex.getAdvisorClass(), classEqualTo(DisabledFacetAnnotation.class));
@@ -107,7 +107,7 @@ public class MemberDisabledTest extends 
         custJsDO.addToVisitedCountries(countryUsaDO);
         custJsDO.disableVisitedCountries = "cannot alter";
         try {
-            custJsVO.removeFromVisitedCountries(countryUsaDO);
+            custJsWO.removeFromVisitedCountries(countryUsaDO);
             fail("Should have thrown exception");
         } catch (final DisabledException ex) {
             assertThat(ex.getAdvisorClass(), classEqualTo(DisableForContextFacetViaMethod.class));
@@ -120,7 +120,7 @@ public class MemberDisabledTest extends 
     public void whenActionDisabledThenThrowsException() {
         custJsDO.disablePlaceOrder = "cannot invoke";
         try {
-            custJsVO.placeOrder(product355DO, 3);
+            custJsWO.placeOrder(product355DO, 3);
             fail("Should have thrown exception");
         } catch (final DisabledException ex) {
             assertThat(ex.getAdvisorClass(), classEqualTo(DisableForContextFacetViaMethod.class));



Mime
View raw message