You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2013/03/28 11:35:27 UTC

[03/20] ISIS-381: mothballing HTML viewer, SQL security, LDAP security

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/MonitorServlet.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/MonitorServlet.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/MonitorServlet.java
new file mode 100644
index 0000000..1642a84
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/MonitorServlet.java
@@ -0,0 +1,87 @@
+/*
+ *  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.html.monitoring;
+
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.net.URLDecoder;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.isis.viewer.html.monitoring.servermonitor.MonitorListenerImpl;
+
+public class MonitorServlet extends HttpServlet {
+    private static final long serialVersionUID = 1L;
+    private MonitorListenerImpl monitor;
+
+    @Override
+    protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
+        final String queryString = request.getQueryString();
+        final String query = queryString == null ? "Overview" : URLDecoder.decode(queryString, "UTF-8");
+        response.setContentType("text/html");
+        final PrintWriter writer = new PrintWriter(new OutputStreamWriter(response.getOutputStream()));
+        if (query.equals("Sessions")) {
+            writer.println("<HTML><HEAD><TITLE>NOF System Monitor - " + "Sessions" + "</TITLE></HEAD>");
+            writer.println("<BODY>");
+
+            writer.println("<h1>" + "Sessions" + "</h1>");
+            writer.println("<pre>");
+            writer.println(listSessions());
+            writer.println("</pre>");
+            writer.println("</BODY></HTML>");
+        } else {
+            monitor.writeHtmlPage(query, writer);
+        }
+        writer.flush();
+    }
+
+    private static String listSessions() {
+        final StringBuffer str = new StringBuffer();
+        /*
+         * final Iterator<?> it = SessionAccess.getSessions().iterator(); while
+         * (it.hasNext()) { final HttpSession session = (HttpSession) it.next();
+         * final String id = session.getId(); str.append(id); str.append(" \t");
+         * 
+         * final long creationTime = session.getCreationTime(); str.append(new
+         * Date(creationTime)); str.append(" \t");
+         * 
+         * final long lastAccessedTime = session.getLastAccessedTime();
+         * str.append(new Date(lastAccessedTime)); str.append(" \t");
+         * 
+         * final AuthenticationSession nofSession = (AuthenticationSession)
+         * session.getAttribute("NOF_SESSION_ATTRIBUTE"); if (nofSession !=
+         * null) { str.append(nofSession.getUserName()); }
+         * 
+         * str.append("\n"); }
+         */
+        return str.toString();
+    }
+
+    @Override
+    public void init(final ServletConfig servletConfig) throws ServletException {
+        super.init(servletConfig);
+        monitor = new MonitorListenerImpl();
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/WebServerMonitorInstaller.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/WebServerMonitorInstaller.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/WebServerMonitorInstaller.java
new file mode 100644
index 0000000..bf2d9d2
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/WebServerMonitorInstaller.java
@@ -0,0 +1,45 @@
+/*
+ *  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.html.monitoring;
+
+import org.apache.isis.core.runtime.installerregistry.installerapi.IsisViewerInstallerAbstract;
+import org.apache.isis.core.runtime.viewer.IsisViewer;
+import org.apache.isis.core.runtime.viewer.web.WebAppSpecification;
+import org.apache.isis.core.runtime.web.EmbeddedWebViewer;
+
+public class WebServerMonitorInstaller extends IsisViewerInstallerAbstract {
+
+    public WebServerMonitorInstaller() {
+        super("web-monitor");
+    }
+
+    @Override
+    public IsisViewer doCreateViewer() {
+        return new EmbeddedWebViewer() {
+            @Override
+            public WebAppSpecification getWebAppSpecification() {
+                final WebAppSpecification requirements = new WebAppSpecification();
+                requirements.addServletSpecification(MonitorServlet.class, "/monitor/*");
+                return requirements;
+            }
+        };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/AbstractServerMonitor.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/AbstractServerMonitor.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/AbstractServerMonitor.java
new file mode 100644
index 0000000..ad1e1f1
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/AbstractServerMonitor.java
@@ -0,0 +1,99 @@
+/*
+ *  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.html.monitoring.servermonitor;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketTimeoutException;
+import java.net.UnknownHostException;
+
+import org.apache.log4j.Logger;
+
+import org.apache.isis.core.commons.config.ConfigurationConstants;
+import org.apache.isis.core.runtime.services.InitialisationException;
+import org.apache.isis.core.runtime.system.IsisSystem;
+import org.apache.isis.core.runtime.system.context.IsisContext;
+
+public abstract class AbstractServerMonitor {
+    private static final Logger LOG = Logger.getLogger(AbstractServerMonitor.class);
+    private static final String ADDRESS = ConfigurationConstants.ROOT + "monitor.address";
+    private boolean acceptConnection = true;
+
+    public void listen() {
+        final String hostAddress = IsisContext.getConfiguration().getString(ADDRESS);
+        InetAddress address;
+        try {
+            address = hostAddress == null ? null : InetAddress.getByName(hostAddress);
+            final int port = getPort();
+            final ServerSocket serverSocket = new ServerSocket(port, 2, address);
+            serverSocket.setSoTimeout(5000);
+            LOG.info("waiting for monitor connection on " + serverSocket);
+            while (acceptConnection) {
+                Socket client = null;
+                try {
+                    client = serverSocket.accept();
+                    LOG.info("client connection on " + client);
+                } catch (final SocketTimeoutException ignore) {
+                    // ignore
+                    continue;
+                } catch (final IOException e) {
+                    LOG.error("request failed", e);
+                    continue;
+                }
+                try {
+                    handleRequest(client);
+                } catch (final Exception e) {
+                    LOG.error("request failed", e);
+                }
+            }
+        } catch (final UnknownHostException e) {
+            throw new InitialisationException(e);
+        } catch (final IOException e) {
+            throw new InitialisationException(e);
+        }
+    }
+
+    protected abstract int getPort();
+
+    private void handleRequest(final Socket socket) throws IOException {
+        final BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
+        final PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));
+        String request;
+        do {
+            request = reader.readLine();
+        } while (handleRequest(writer, request));
+        writer.close();
+        reader.close();
+    }
+
+    public abstract void setTarget(IsisSystem system);
+
+    public void shutdown() {
+        acceptConnection = false;
+    }
+
+    protected abstract boolean handleRequest(PrintWriter writer, String request) throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/HttpServerMonitor.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/HttpServerMonitor.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/HttpServerMonitor.java
new file mode 100644
index 0000000..94a15a1
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/HttpServerMonitor.java
@@ -0,0 +1,104 @@
+/*
+ *  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.html.monitoring.servermonitor;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URLDecoder;
+import java.util.StringTokenizer;
+
+import org.apache.log4j.Logger;
+
+import org.apache.isis.core.commons.config.ConfigurationConstants;
+import org.apache.isis.core.runtime.system.IsisSystem;
+import org.apache.isis.core.runtime.system.context.IsisContext;
+
+public class HttpServerMonitor extends AbstractServerMonitor {
+    private static final Logger LOG = Logger.getLogger(HttpServerMonitor.class);
+    private static final int DEFAULT_PORT = 8081;
+    private static final String PORT = ConfigurationConstants.ROOT + "monitor.http.port";
+    private final MonitorListenerImpl monitor = new MonitorListenerImpl();
+
+    @Override
+    protected int getPort() {
+        return IsisContext.getConfiguration().getInteger(PORT, DEFAULT_PORT);
+    }
+
+    @Override
+    protected boolean handleRequest(final PrintWriter writer, final String request) throws IOException {
+        if (request == null || request.length() == 0) {
+            LOG.info("Connection dropped");
+            return false;
+        }
+        final StringTokenizer st = new StringTokenizer(request);
+        if (st.countTokens() != 3) {
+            httpErrorResponse(writer, 444, "Unparsable input " + request);
+            return false;
+        }
+
+        final String type = st.nextToken();
+        if (!type.equals("GET")) {
+            httpErrorResponse(writer, 400, "Invalid method " + type);
+            return false;
+        }
+
+        String query = st.nextToken();
+        query = URLDecoder.decode(query, "UTF-8");
+
+        if (query.equals("/")) {
+            query = "/monitor";
+        }
+
+        if (query.startsWith("/monitor")) {
+            query = query.substring("/monitor".length());
+
+            if (query.startsWith("?")) {
+                query = query.substring(1);
+            }
+
+            monitor.writeHtmlPage(query, writer);
+        } else {
+            httpErrorResponse(writer, 404, "Failed to find " + query);
+
+            writer.println("[Request: HTTP/1.0 200");
+            writer.println("Content-Type: text/html");
+            writer.println("]");
+        }
+        return false;
+    }
+
+    private void httpErrorResponse(final PrintWriter writer, final int errorNo, final String response) {
+        writer.println("HTTP/1.0 " + errorNo + " " + response);
+        writer.println("Content-Type: text/html");
+        writer.println("");
+
+        writer.println("<HTML><HEAD><TITLE>Error " + errorNo + " - " + response + "</TITLE></HEAD>");
+        writer.println("<BODY><h1>" + errorNo + " - " + response + "</h1>");
+        writer.println("</BODY></HTML>");
+
+        writer.flush();
+    }
+
+    @Override
+    public void setTarget(final IsisSystem system) {
+        // monitor.setTarget(system);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/Monitor.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/Monitor.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/Monitor.java
new file mode 100644
index 0000000..9f794d1
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/Monitor.java
@@ -0,0 +1,56 @@
+/*
+ *  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.html.monitoring.servermonitor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.apache.isis.core.commons.debug.DebuggableWithTitle;
+
+public class Monitor {
+    private static final Logger LOG = Logger.getLogger(Monitor.class);
+    private static List<MonitorListener> listeners = new ArrayList<MonitorListener>();
+
+    public static void addListener(final MonitorListener listener) {
+        listeners.add(listener);
+    }
+
+    public static void removeListener(final MonitorListener listener) {
+        listeners.remove(listener);
+    }
+
+    public static void addEvent(final String category, final String message) {
+        addEvent(category, message, null);
+    }
+
+    public static void addEvent(final String category, final String message, final DebuggableWithTitle[] debug) {
+        final MonitorEvent event = new MonitorEvent(category, message, debug);
+        LOG.info(event);
+        dispatchEvent(event);
+    }
+
+    private static void dispatchEvent(final MonitorEvent event) {
+        for (final MonitorListener listener : listeners) {
+            listener.postEvent(event);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorEvent.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorEvent.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorEvent.java
new file mode 100644
index 0000000..a1ebe62
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorEvent.java
@@ -0,0 +1,70 @@
+/*
+ *  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.html.monitoring.servermonitor;
+
+import org.apache.isis.core.commons.debug.DebugString;
+import org.apache.isis.core.commons.debug.DebuggableWithTitle;
+
+public class MonitorEvent {
+    private static int nextSerialId = 1;
+    private final int serialId = nextSerialId++;
+    private final String message;
+    private final String category;
+    private final DebugString debug;
+
+    public MonitorEvent(final String category, final String message, final DebuggableWithTitle[] debugDetails) {
+        this.message = message;
+        this.category = category;
+        debug = new DebugString();
+        try {
+            if (debugDetails != null) {
+                for (final DebuggableWithTitle info : debugDetails) {
+                    debug.appendTitle(info.debugTitle());
+                    debug.indent();
+                    info.debugData(debug);
+                    debug.unindent();
+                }
+            }
+        } catch (final RuntimeException e) {
+            debug.appendException(e);
+        }
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public int getSerialId() {
+        return serialId;
+    }
+
+    public String getDebug() {
+        return debug.toString();
+    }
+
+    @Override
+    public String toString() {
+        return category + ": " + message;
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorListener.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorListener.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorListener.java
new file mode 100644
index 0000000..981e297
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorListener.java
@@ -0,0 +1,24 @@
+/*
+ *  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.html.monitoring.servermonitor;
+
+public interface MonitorListener {
+    void postEvent(MonitorEvent event);
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorListenerImpl.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorListenerImpl.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorListenerImpl.java
new file mode 100644
index 0000000..9f70741
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/MonitorListenerImpl.java
@@ -0,0 +1,150 @@
+/*
+ *  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.html.monitoring.servermonitor;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.isis.core.commons.debug.DebugString;
+import org.apache.isis.core.commons.debug.DebuggableWithTitle;
+import org.apache.isis.core.commons.ensure.Assert;
+import org.apache.isis.core.runtime.system.context.IsisContext;
+
+public class MonitorListenerImpl implements MonitorListener {
+    private final List<MonitorEvent> requests = new ArrayList<MonitorEvent>();
+
+    public MonitorListenerImpl() {
+        org.apache.isis.viewer.html.monitoring.servermonitor.Monitor.addListener(this);
+    }
+
+    @Override
+    public void postEvent(final MonitorEvent event) {
+        // TODO use a stack of limited size so we have FIFO list
+        if (requests.size() > 50) {
+            requests.remove(0);
+        }
+        requests.add(event);
+    }
+
+    public void writeHtmlPage(final String section, final PrintWriter writer) throws IOException {
+        Assert.assertNotNull(section);
+        Assert.assertNotNull(writer);
+        final String sectionName = section.equals("") ? "Overview" : section;
+
+        writer.println("<HTML><HEAD><TITLE>NOF System Monitor - " + sectionName + "</TITLE></HEAD>");
+        writer.println("<BODY>");
+
+        writer.println("<h1>" + sectionName + "</h1>");
+
+        final StringBuffer navigation = new StringBuffer("<p>");
+        // final String[] options = target.debugSectionNames();
+        final DebuggableWithTitle[] infos = IsisContext.debugSystem();
+        for (int i = 0; i < infos.length; i++) {
+            final String name = infos[i].debugTitle();
+            appendNavigationLink(navigation, name, i > 0);
+        }
+        appendNavigationLink(navigation, "Requests", true);
+        navigation.append("</p>");
+
+        writer.println(navigation);
+        writer.println("<pre>");
+        if (sectionName.equals("Requests")) {
+            int i = 1;
+            for (final MonitorEvent event : requests) {
+                writer.print("<a href=\"monitor?request=" + event.getSerialId() + "\">");
+                writer.print(i++ + ". " + event);
+                writer.println("</a>");
+            }
+        } else if (sectionName.startsWith("request=")) {
+            final int requestId = Integer.valueOf(sectionName.substring("request=".length())).intValue();
+            for (final MonitorEvent request : requests) {
+                if (request.getSerialId() == requestId) {
+                    writer.println(request.getDebug());
+                    break;
+                }
+            }
+        } else {
+            for (final DebuggableWithTitle info : infos) {
+                if (info.debugTitle().equals(sectionName)) {
+                    // TODO use an HTML debug string
+                    final DebugString debug = new DebugString();
+                    info.debugData(debug);
+                    writer.println(debug.toString());
+                    break;
+                }
+            }
+        }
+        writer.println("</pre>");
+
+        writer.println(navigation);
+        writer.println("</BODY></HTML>");
+    }
+
+    private void appendNavigationLink(final StringBuffer navigation, final String name, final boolean appendDivider) throws UnsupportedEncodingException {
+        if (appendDivider) {
+            navigation.append(" | ");
+        }
+        navigation.append("<a href=\"monitor?");
+        navigation.append(URLEncoder.encode(name, "UTF-8"));
+        navigation.append("\">");
+        navigation.append(name);
+        navigation.append("</a>");
+    }
+
+    public void writeTextPage(final String section, final PrintWriter writer) throws IOException {
+        Assert.assertNotNull(section);
+        Assert.assertNotNull(writer);
+        final String sectionName = section.equals("") ? "Overview" : section;
+
+        writer.println(sectionName);
+
+        final DebuggableWithTitle[] infos = IsisContext.debugSystem();
+        if (sectionName.equals("Events")) {
+            int i = 1;
+            for (final MonitorEvent event : requests) {
+                writer.println(i++ + ". " + event);
+            }
+            // TODO add clause for request
+        } else {
+            for (final DebuggableWithTitle info : infos) {
+                if (info.debugTitle().equals(sectionName)) {
+                    final DebugString debug = new DebugString();
+                    info.debugData(debug);
+                    writer.println(debug.toString());
+                }
+            }
+        }
+
+        writer.print("[Options: ");
+        // final String[] options = target.debugSectionNames();
+        for (final DebuggableWithTitle info : infos) {
+            writer.print(info.debugTitle() + " ");
+        }
+        // writer.println();
+    }
+    /*
+     * public void setTarget(final DebugSelection debugInfo2) { target =
+     * debugInfo2; }
+     */
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/SocketServerMonitor.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/SocketServerMonitor.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/SocketServerMonitor.java
new file mode 100644
index 0000000..0ff6ab7
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/servermonitor/SocketServerMonitor.java
@@ -0,0 +1,71 @@
+/*
+ *  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.html.monitoring.servermonitor;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URLDecoder;
+
+import org.apache.isis.core.commons.config.ConfigurationConstants;
+import org.apache.isis.core.runtime.system.IsisSystem;
+import org.apache.isis.core.runtime.system.context.IsisContext;
+
+public class SocketServerMonitor extends AbstractServerMonitor {
+    private static final int DEFAULT_PORT = 8009;
+    private static final String PORT = ConfigurationConstants.ROOT + "monitor.telnet.port";
+
+    private final MonitorListenerImpl monitor = new MonitorListenerImpl();
+    private IsisSystem system;
+
+    @Override
+    protected int getPort() {
+        return IsisContext.getConfiguration().getInteger(PORT, DEFAULT_PORT);
+    }
+
+    @Override
+    protected boolean handleRequest(final PrintWriter writer, final String request) throws IOException {
+        final String query = URLDecoder.decode(request, "UTF-8");
+
+        if (query.equalsIgnoreCase("bye")) {
+            writer.println("Disconnecting...");
+            return false;
+        } else if (query.equalsIgnoreCase("shutdown")) {
+            writer.println("Shutting down system...");
+            system.shutdown();
+            exitSystem();
+            return false;
+        }
+
+        monitor.writeTextPage(query, writer);
+        writer.print("shutdown bye]\n#");
+        writer.flush();
+        return true;
+    }
+
+    @SuppressWarnings(value = "DM_EXIT")
+    private void exitSystem() {
+        System.exit(0);
+    }
+
+    @Override
+    public void setTarget(final IsisSystem system) {
+        this.system = system;
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/AWTConsole.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/AWTConsole.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/AWTConsole.java
new file mode 100644
index 0000000..5c4a6c3
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/AWTConsole.java
@@ -0,0 +1,201 @@
+/*
+ *  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.html.monitoring.systemconsole;
+
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Insets;
+import java.awt.Panel;
+import java.awt.Rectangle;
+import java.awt.TextArea;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import org.apache.log4j.Logger;
+
+import org.apache.isis.core.runtime.system.context.IsisContext;
+
+public class AWTConsole extends Frame implements ServerConsole {
+    private static final long serialVersionUID = 1L;
+    private final static Logger LOG = Logger.getLogger(AWTConsole.class);
+    public static final String WIDTH = "isis.awt-console.width";
+    public static final String HEIGHT = "isis.awt-console.height";
+    public static final int DEFAULT_WIDTH = 600;
+    public static final int DEFAULT_HEIGHT = 350;
+    private Server server;
+    private TextArea log;
+    private Button quit;
+
+    public AWTConsole() {
+        super("Object Server Console");
+        buildGUI();
+        setVisible(true);
+        ;
+    }
+
+    /**
+     *
+     */
+    private void addButtons() {
+        final Panel p = new Panel();
+
+        p.setLayout(new java.awt.GridLayout(1, 0, 10, 0));
+        add(p, BorderLayout.SOUTH);
+        Button b;
+
+        p.add(b = new Button("Blank"));
+        b.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(final ActionEvent e) {
+                clearLog();
+            }
+        });
+
+        // debug
+        p.add(b = new Button("Classes"));
+        b.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(final ActionEvent e) {
+                listClasses();
+            }
+        });
+
+        p.add(b = new Button("Cache"));
+        b.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(final ActionEvent e) {
+                listCachedObjects();
+            }
+        });
+
+        p.add(b = new Button("C/Cache"));
+        b.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(final ActionEvent e) {
+                clearCache();
+            }
+        });
+
+        // quit
+        p.add(quit = new Button("Quit"));
+        quit.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(final ActionEvent e) {
+                quit();
+            }
+        });
+    }
+
+    /**
+     * LogWindow constructor comment.
+     */
+    private void buildGUI() {
+        add(log = new TextArea());
+        addButtons();
+        final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        final Dimension frameSize = new Dimension();
+        final Insets insets = getInsets();
+
+        frameSize.width = IsisContext.getConfiguration().getInteger(WIDTH, DEFAULT_WIDTH);
+        frameSize.height = IsisContext.getConfiguration().getInteger(HEIGHT, DEFAULT_HEIGHT);
+        final Rectangle bounds = new Rectangle(frameSize);
+
+        bounds.x = screenSize.width - frameSize.width - insets.right;
+        bounds.y = 0 + insets.top;
+        setBounds(bounds);
+    }
+
+    private void clearCache() {
+    }
+
+    /**
+     * 
+     * @param message
+     *            java.lang.String
+     */
+    private void clearLog() {
+        log.setText("");
+    }
+
+    /**
+     *
+     */
+    @Override
+    public void close() {
+        dispose();
+    }
+
+    @Override
+    public void init(final Server server) {
+        this.server = server;
+        log("Console in control of " + server);
+    }
+
+    private void listCachedObjects() {
+        /*
+         * Enumeration e = server.getObjectStore().cache();
+         * 
+         * log("Cached objects:-"); while (e.hasMoreElements()) { ObjectAdapter
+         * object = (ObjectAdapter) e.nextElement();
+         * 
+         * log(" " + object.getClassName() + "[" + (object.isResolved() ? "" :
+         * "~") + object.getOid() + "] " + object.title()); } log();
+         */
+    }
+
+    private void listClasses() {
+        /*
+         * try { Enumeration e = server.getObjectStore().classes();
+         * 
+         * log("Loaded classes:-"); while (e.hasMoreElements()) {
+         * ObjectSpecification object = (ObjectSpecification) e.nextElement();
+         * 
+         * log(" " + object); } log(); } catch (ObjectStoreException e) {
+         * LOG.error("Error listing classes " + e.getMessage()); }
+         */
+    }
+
+    @Override
+    public void log() {
+        log.append("\n");
+    }
+
+    @Override
+    public void log(final String message) {
+        log.append(message + '\n');
+        LOG.info(message);
+    }
+
+    /**
+     *
+     */
+    public void quit() {
+        server.shutdown();
+        close();
+        exitSystem();
+    }
+
+    private void exitSystem() {
+        System.exit(0);
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/FileConsole.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/FileConsole.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/FileConsole.java
new file mode 100644
index 0000000..9e5c325
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/FileConsole.java
@@ -0,0 +1,57 @@
+/*
+ *  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.html.monitoring.systemconsole;
+
+import java.io.DataOutputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Date;
+
+import org.apache.log4j.Logger;
+
+public class FileConsole implements ServerConsole {
+    final static Logger LOG = Logger.getLogger(FileConsole.class);
+    private DataOutputStream dos;
+
+    @Override
+    public void close() {
+    }
+
+    @Override
+    public void init(final Server server) {
+    }
+
+    @Override
+    public void log() {
+        log("");
+    }
+
+    @Override
+    public void log(final String message) {
+        try {
+            LOG.info(message);
+            dos = new DataOutputStream(new FileOutputStream("log.xxx"));
+            dos.writeBytes(new Date() + " " + message + '\n');
+            dos.close();
+        } catch (final IOException e) {
+            LOG.error(e.getMessage(), e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/QuitListener.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/QuitListener.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/QuitListener.java
new file mode 100644
index 0000000..1bb2994
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/QuitListener.java
@@ -0,0 +1,32 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.viewer.html.monitoring.systemconsole;
+
+public interface QuitListener {
+    public void classes();
+
+    public void clear();
+
+    public void collections();
+
+    public void objects();
+
+    public void shutdown();
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/Server.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/Server.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/Server.java
new file mode 100644
index 0000000..9f2a181
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/Server.java
@@ -0,0 +1,26 @@
+/*
+ *  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.html.monitoring.systemconsole;
+
+public interface Server {
+
+    void shutdown();
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/ServerConsole.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/ServerConsole.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/ServerConsole.java
new file mode 100644
index 0000000..216796e
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/ServerConsole.java
@@ -0,0 +1,31 @@
+/*
+ *  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.html.monitoring.systemconsole;
+
+public interface ServerConsole {
+
+    void close();
+
+    void init(Server server);
+
+    void log();
+
+    void log(String message);
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/ServerResponse.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/ServerResponse.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/ServerResponse.java
new file mode 100644
index 0000000..97b6cd5
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/ServerResponse.java
@@ -0,0 +1,26 @@
+/*
+ *  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.html.monitoring.systemconsole;
+
+import java.io.Serializable;
+
+public abstract class ServerResponse implements Serializable {
+    final static long serialVersionUID = 1L;
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/TerminalConsole.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/TerminalConsole.java b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/TerminalConsole.java
new file mode 100644
index 0000000..7080ddb
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/main/java/org/apache/isis/viewer/html/monitoring/systemconsole/TerminalConsole.java
@@ -0,0 +1,126 @@
+/*
+ *  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.html.monitoring.systemconsole;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Marked as final because starts a thread in the {@link #TerminalConsole()
+ * constructor}.
+ */
+public final class TerminalConsole implements ServerConsole, Runnable {
+    private static final Logger LOG = Logger.getLogger(TerminalConsole.class);
+    private Server server;
+    private boolean running = true;
+
+    public TerminalConsole() {
+        new Thread(this).start();
+    }
+
+    public void clear() {
+    }
+
+    @Override
+    public void close() {
+        running = false;
+    }
+
+    public void collections() {
+    }
+
+    @Override
+    public void init(final Server server) {
+        this.server = server;
+        log("Control of " + server);
+    }
+
+    public void listClasses() {
+        /*
+         * try { Enumeration e = server.getObjectStore().classes();
+         * 
+         * log("Loaded classes:-"); while (e.hasMoreElements()) {
+         * ObjectSpecification object = (ObjectSpecification) e.nextElement();
+         * 
+         * log(" " + object); } } catch (ObjectStoreException e) {
+         * LOG.error("Error listing classes " + e.getMessage()); }
+         */
+    }
+
+    @Override
+    public void log() {
+        log("");
+    }
+
+    @Override
+    public void log(final String message) {
+        LOG.info(message);
+        System.out.println("> " + message);
+    }
+
+    public void objects() {
+    }
+
+    public void quit() {
+        server.shutdown();
+        server = null;
+        running = false;
+    }
+
+    @Override
+    public void run() {
+        final BufferedReader dis = new BufferedReader(new InputStreamReader(System.in));
+
+        try {
+            while (running) {
+                final String readLine = dis.readLine();
+                if (readLine == null) {
+                    quit();
+                    continue;
+                }
+                final String s = readLine.toLowerCase();
+
+                if (s.equals("")) {
+                    continue;
+                } else if (s.equals("quit")) {
+                    quit();
+                } else if (s.equals("classes")) {
+                    listClasses();
+                } else {
+                    System.out.println("Commands: classes, quit");
+                }
+            }
+        } catch (final IOException e) {
+            quit();
+        }
+        exitSystem();
+    }
+
+    private void exitSystem() {
+        System.exit(0);
+    }
+
+    public void start() {
+        new Thread(this).start();
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/site/apt/index.apt
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/site/apt/index.apt b/mothballed/component/viewer/html/monitoring/src/site/apt/index.apt
new file mode 100644
index 0000000..80756ec
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/site/apt/index.apt
@@ -0,0 +1,31 @@
+~~  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.
+
+
+
+Monitoring Support
+ 
+ The <monitoring> module is a small module that provides monitoring tools
+ for the <default runtime>.
+ 
+ []
+ 
+Documentation
+
+ See the {{{../index.html}default runtime}} documentation 
+ ({{{../docbkx/html/guide/isis-default-runtime.html}HTML}} or 
+ {{{../docbkx/pdf/isis-default-runtime.pdf}PDF}}).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/site/apt/jottings.apt
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/site/apt/jottings.apt b/mothballed/component/viewer/html/monitoring/src/site/apt/jottings.apt
new file mode 100644
index 0000000..7920f56
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/site/apt/jottings.apt
@@ -0,0 +1,43 @@
+~~  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.
+
+
+
+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

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/monitoring/src/site/site.xml
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/monitoring/src/site/site.xml b/mothballed/component/viewer/html/monitoring/src/site/site.xml
new file mode 100644
index 0000000..ec82d2b
--- /dev/null
+++ b/mothballed/component/viewer/html/monitoring/src/site/site.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project>
+
+	<body>
+		<breadcrumbs>
+			<item name="Monitoring" href="index.html"/>
+		</breadcrumbs>
+
+		<menu name="Monitoring">
+			<item name="About" href="index.html" />
+            <item name="Jottings" href="jottings.html" />
+		</menu>
+
+        <menu name="Default Runtime">
+            <item name="Implementation" href="../runtime/index.html" />
+            <item name="Objectstores" href="../objectstores/index.html" />
+            <item name="Profilestores" href="../profilestores/index.html" />
+            <item name="Bytecode" href="../bytecode/index.html" />
+            <item name="Monitoring" href="../monitoring/index.html" />
+            <item name="Webapp Support" href="../webapp/index.html" />
+            <item name="Webserver" href="../webserver/index.html" />
+            <item name="Remoting" href="../remoting/index.html" />
+        </menu>
+        
+		<menu name="Maven Reports" ref="reports" />
+	</body>
+</project>

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/pom.xml b/mothballed/component/viewer/html/pom.xml
new file mode 100644
index 0000000..42672af
--- /dev/null
+++ b/mothballed/component/viewer/html/pom.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.isis.core</groupId>
+		<artifactId>isis</artifactId>
+        <version>1.1.1-SNAPSHOT</version>
+		<relativePath>../../../core/pom.xml</relativePath>
+	</parent>
+
+	<groupId>org.apache.isis.viewer</groupId>
+	<artifactId>isis-viewer-html</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+
+	<name>Isis Html Viewer</name>
+	<packaging>pom</packaging>
+
+	<properties>
+        <siteBaseDir>.</siteBaseDir>
+		<relativeUrl/>
+
+		<docbkxGuideTitle>Apache Isis HTML Viewer</docbkxGuideTitle>
+        <docbkxGuideSubTitle>Configuration, Customization and Deployment Guide</docbkxGuideSubTitle>
+		<docbkxGuideName>isis-html-viewer</docbkxGuideName>
+    </properties>
+
+    <!-- used in Site generation for relative references. -->
+    <url>http://isis.apache.org/${relativeUrl}</url>
+
+	<build>
+		<pluginManagement>
+			<plugins>
+                <!-- Apache Release Audit Tool -->
+                <plugin>
+                    <groupId>org.apache.rat</groupId>
+                    <artifactId>apache-rat-plugin</artifactId>
+                    <version>0.8</version>
+	                <configuration>
+	                    <excludes>
+	                    	<!-- 
+	                    	overriding inherited excludes from oia.core:isis 
+	                    	with a more specific set for this component
+	                    	 -->
+	                        <exclude>**/target/**</exclude>
+	                        <exclude>**/target-ide/**</exclude>
+
+	                        <exclude>**/*.project</exclude>
+	                        <exclude>**/.classpath</exclude>
+	                        <exclude>**/.settings/**</exclude>
+	                    </excludes>
+                    </configuration>
+	            </plugin>
+			</plugins>
+		</pluginManagement>
+		<plugins>
+            <plugin>
+                <groupId>com.agilejava.docbkx</groupId>
+                <artifactId>docbkx-maven-plugin</artifactId>
+				<inherited>false</inherited>
+            </plugin>
+		</plugins>
+	</build>
+
+	<dependencyManagement>
+	    <dependencies>
+	    
+
+	    	<!-- also for benefit of application developers, using scope=import -->
+	    
+			<!-- for this module -->
+		    <dependency>
+			    <groupId>org.apache.isis.viewer</groupId>
+			    <artifactId>isis-viewer-html-impl</artifactId>
+                <version>1.0.0-SNAPSHOT</version>
+		    </dependency>
+
+		    <dependency>
+			    <groupId>org.apache.isis.viewer</groupId>
+			    <artifactId>isis-viewer-html-monitoring</artifactId>
+                <version>1.0.0-SNAPSHOT</version>
+		    </dependency>
+
+	   </dependencies>
+	</dependencyManagement>
+
+	<modules>
+		<module>impl</module>
+		<module>monitoring</module>
+		<module>tck</module>
+	</modules>
+
+</project>

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/src/main/appended-resources/supplemental-models.xml
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/src/main/appended-resources/supplemental-models.xml b/mothballed/component/viewer/html/src/main/appended-resources/supplemental-models.xml
new file mode 100644
index 0000000..ecd3906
--- /dev/null
+++ b/mothballed/component/viewer/html/src/main/appended-resources/supplemental-models.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 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. -->
+<supplementalDataModels xmlns="http://maven.apache.org/supplemental-model/1.0.0"
+                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                        xsi:schemaLocation="http://maven.apache.org/supplemental-model/1.0.0 http://maven.apache.org/xsd/supplemental-model-1.0.0.xsd">
+
+  <supplement>
+    <project>
+      <groupId>aopalliance</groupId>
+      <artifactId>aopalliance</artifactId>
+      <version>1.0</version>
+      <licenses>
+          <license>
+              <name>Public Domain</name>
+          </license>
+      </licenses>
+    </project>
+  </supplement>
+
+  <supplement>
+   	<!-- not quite sure why licenses:download-license flags this, since license info seems to be in its POM -->
+    <project>
+		<groupId>org.datanucleus</groupId>
+	    <artifactId>datanucleus-jodatime</artifactId>
+	    <version>3.1.1</version>
+          <licenses>
+			<license>
+	            <name>The Apache Software License, Version 2.0</name>
+	            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+	        </license>
+	    </licenses>
+    </project>
+  </supplement>
+
+  <supplement>
+    <project>
+      <groupId>org.scannotation</groupId>
+      <artifactId>scannotation</artifactId>
+      <version>1.0.3</version>
+      <licenses>
+        <license>
+            <name>The Apache Software License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+            <distribution>repo</distribution>          
+        </license>
+      </licenses>
+    </project>
+  </supplement>
+    
+  <supplement>
+    <project>
+      <groupId>dom4j</groupId>
+      <artifactId>dom4j</artifactId>
+      <version>1.6.1</version>
+      <licenses>
+        <license>
+            <name>BSD License</name>
+            <url>http://dom4j.sourceforge.net/dom4j-1.6.1/license.html</url>
+            <distribution>repo</distribution>          
+        </license>
+      </licenses>
+    </project>
+  </supplement>
+
+  <supplement>
+    <project>
+      <groupId>net.jcip</groupId>
+      <artifactId>jcip-annotations</artifactId>
+      <version>1.0</version>
+      <licenses>
+        <license>
+            <name>Creative Commons Attribution 2.5 License</name>
+            <url>http://creativecommons.org/licenses/by/2.5/</url>
+            <distribution>repo</distribution>          
+        </license>
+      </licenses>
+    </project>
+  </supplement>
+  
+
+  <supplement>
+    <project>
+      <groupId>xalan</groupId>
+      <artifactId>xalan</artifactId>
+      <version>2.7.0</version>
+      <licenses>
+        <license>
+            <name>The Apache Software License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+            <distribution>repo</distribution>          
+        </license>
+      </licenses>
+    </project>
+  </supplement>
+
+ 
+</supplementalDataModels>

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/tck/ide/eclipse/launch/viewer-html-tck.launch
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/tck/ide/eclipse/launch/viewer-html-tck.launch b/mothballed/component/viewer/html/tck/ide/eclipse/launch/viewer-html-tck.launch
new file mode 100644
index 0000000..13af8ed
--- /dev/null
+++ b/mothballed/component/viewer/html/tck/ide/eclipse/launch/viewer-html-tck.launch
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.apache.isis.runtimes.dflt.webserver/src/main/java/org/apache/isis/WebServer.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
+<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+<mapEntry key="[run]" value="org.eclipse.jdt.launching.localJavaApplication"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
+<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.isis.WebServer"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="isis-viewer-html-tck"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
+</launchConfiguration>

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/tck/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/tck/pom.xml b/mothballed/component/viewer/html/tck/pom.xml
new file mode 100644
index 0000000..466dac3
--- /dev/null
+++ b/mothballed/component/viewer/html/tck/pom.xml
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.isis.core</groupId>
+        <artifactId>isis-core-tck</artifactId>
+        <version>1.1.1-SNAPSHOT</version>
+        <relativePath>../../../../core/tck/pom.xml</relativePath>
+    </parent>
+
+    <groupId>org.apache.isis.viewer</groupId>
+	<artifactId>isis-viewer-html-tck</artifactId>
+	<name>Isis Html Viewer TCK tests</name>
+
+    <properties>
+        <isis-viewer-html.version>1.0.0-SNAPSHOT</isis-viewer-html.version>
+
+		<siteBaseDir>..</siteBaseDir>
+		<relativeUrl>html-tck/</relativeUrl>
+		<!-- until someone comes up with a better solution -->
+                <distMgmtSiteUrl>file:///tmp/m2-sites/isis/viewer/html</distMgmtSiteUrl>
+    </properties>
+
+	
+	<packaging>war</packaging>
+
+	<build>
+		<plugins>
+            <plugin>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>maven-jetty-plugin</artifactId>
+            </plugin>
+
+			<!-- mvn package -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-shade-plugin</artifactId>
+				<executions>
+					<execution>
+						<phase>package</phase>
+						<goals>
+							<goal>shade</goal>
+						</goals>
+						<configuration>
+							<transformers>
+								<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+									<mainClass>org.apache.isis.WebServer</mainClass>
+								</transformer>
+							</transformers>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+
+	<dependencies>
+	
+        <!-- other modules in this project -->
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-tck-dom</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-tck-fixture</artifactId>
+        </dependency>
+
+
+        <!-- isis viewer -->
+		<dependency>
+	        <groupId>org.apache.isis.viewer</groupId>
+			<artifactId>isis-viewer-html-impl</artifactId>
+            <version>${isis-viewer-html.version}</version>
+		</dependency>
+        
+
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-bytecode-cglib</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-objectstore</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-profilestore</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-security</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-core-webserver</artifactId>
+            <scope>runtime</scope>
+            <optional>true</optional>
+        </dependency>
+
+        
+        <dependency>
+            <groupId>org.apache.isis.security</groupId>
+            <artifactId>isis-security-file</artifactId>
+            <version>1.0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.isis.objectstore</groupId>
+            <artifactId>isis-objectstore-xml</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.isis.profilestore</groupId>
+            <artifactId>isis-profilestore-xml</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        
+	</dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/tck/src/main/resources/images/Default.png
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/tck/src/main/resources/images/Default.png b/mothballed/component/viewer/html/tck/src/main/resources/images/Default.png
new file mode 100644
index 0000000..8409e46
Binary files /dev/null and b/mothballed/component/viewer/html/tck/src/main/resources/images/Default.png differ

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/isis.properties b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/isis.properties
new file mode 100644
index 0000000..c3e2f11
--- /dev/null
+++ b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/isis.properties
@@ -0,0 +1,57 @@
+#  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.
+isis.services.prefix = org.apache.isis.tck.objstore.dflt
+isis.services =\
+    scalars.ApplibValuedEntityRepositoryDefault,\
+    scalars.JdkValuedEntityRepositoryDefault,\
+    scalars.PrimitiveValuedEntityRepositoryDefault,\
+    scalars.WrapperValuedEntityRepositoryDefault, \
+    simples.SimpleEntityRepositoryDefault,\
+    assocs.ParentEntityRepositoryDefault
+
+isis.fixtures.prefix= org.apache.isis.tck.fixture
+isis.fixtures=\
+    LogonAsSvenFixture,\
+    scalars.ApplibValuedEntityFixture,\
+    scalars.JdkValuedEntityFixture,\
+    scalars.PrimitiveValuedEntityFixture,\
+    scalars.WrapperValuedEntityFixture,\
+    simples.SimpleEntityFixture,\
+    assocs.ParentAndChildEntityFixture
+
+isis.exploration.users=sven, dick, bob
+
+
+isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.dflt.classsubstitutor.CglibClassSubstitutor
+#isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.javassist.classsubstitutor.JavassistClassSubstitutor
+#isis.reflector.class-substitutor=org.apache.isis.runtimes.dflt.bytecode.identity.classsubstitutor.ClassSubstitutorIdentity
+
+isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.dflt.objectfactory.CglibObjectFactory
+#isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.javassist.objectfactory.JavassistObjectFactory
+#isis.persistor.object-factory=org.apache.isis.runtimes.dflt.bytecode.identity.objectfactory.ObjectFactoryBasic
+
+
+isis.persistor.domain-object-container=org.apache.isis.core.metamodel.services.container.DomainObjectContainerDefault
+#isis.persistor.domain-object-container=org.apache.isis.progmodel.wrapper.metamodel.DomainObjectContainerWrapperFactory
+
+
+#isis.reflector.facets.include=org.apache.isis.runtimes.dflt.runtime.authorization.standard.AuthorizationFacetFactoryImpl
+#isis.authorization.learn=true
+
+isis.user-profile-store=in-memory
+isis.persistor=in-memory
+#isis.xmlos.dir=/tmp/xml
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/logging.properties
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/logging.properties b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/logging.properties
new file mode 100644
index 0000000..f2d65e6
--- /dev/null
+++ b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/logging.properties
@@ -0,0 +1,30 @@
+#  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.
+# apache's log4j is used to provide system logging.
+log4j.rootCategory=INFO, Console
+
+# The console appender
+log4j.appender.Console=org.apache.log4j.ConsoleAppender
+log4j.appender.Console.target=System.out
+log4j.appender.Console.layout=org.apache.log4j.PatternLayout
+log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE}  [%-20c{1} %-10t %-5p]  %m%n
+
+log4j.appender.File=org.apache.log4j.RollingFileAppender
+log4j.appender.File.file=isis.log
+log4j.appender.File.append=false
+log4j.appender.File.layout=org.apache.log4j.PatternLayout
+log4j.appender.File.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p]  %m%n

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/security_file.allow
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/security_file.allow b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/security_file.allow
new file mode 100644
index 0000000..928983a
--- /dev/null
+++ b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/security_file.allow
@@ -0,0 +1,16 @@
+#  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.

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/security_file.passwords
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/security_file.passwords b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/security_file.passwords
new file mode 100644
index 0000000..7f07af5
--- /dev/null
+++ b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/security_file.passwords
@@ -0,0 +1,20 @@
+#  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.
+sven:pass
+dick:pass
+bob:pass
+joe:pass

http://git-wip-us.apache.org/repos/asf/isis/blob/91a8000b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/viewer_html.properties
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/viewer_html.properties b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/viewer_html.properties
new file mode 100644
index 0000000..29b4425
--- /dev/null
+++ b/mothballed/component/viewer/html/tck/src/main/webapp/WEB-INF/viewer_html.properties
@@ -0,0 +1,19 @@
+#  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.
+isis.viewer.html.header=<div id="site-header"><div id="site-logo">&nbsp;</div></div>
+isis.viewer.html.footer=<div id="page-footer"><small>Powered by Apache Isis</small></div>
+isis.viewer.html.port=8080