You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2011/06/26 13:51:10 UTC

svn commit: r1139763 [10/10] - in /incubator/isis/trunk/viewer: json/ json/applib2/ json/applib2/src/ json/applib2/src/main/ json/applib2/src/main/java/ json/applib2/src/main/java/META-INF/ json/applib2/src/main/java/org/ json/applib2/src/main/java/org...

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/xom/TableColumnAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/xom/TableColumnAbstract.java?rev=1139763&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/xhtml/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/xom/TableColumnAbstract.java (added)
+++ incubator/isis/trunk/viewer/xhtml/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/xom/TableColumnAbstract.java Sun Jun 26 11:51:01 2011
@@ -0,0 +1,94 @@
+/*
+ *  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.restful.viewer.xom;
+
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.oid.stringable.OidStringifier;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.OidGenerator;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
+import org.apache.isis.viewer.restful.viewer.tree.Element;
+import org.apache.isis.viewer.restful.viewer.util.OidUtils;
+
+public abstract class TableColumnAbstract<T> implements TableColumn<T> {
+    private final String headerText;
+
+    protected final ResourceContext resourceContext;
+    protected final XhtmlRenderer xhtmlRenderer;
+
+    protected TableColumnAbstract(final String headerText, final ResourceContext resourceContext) {
+        this.headerText = headerText;
+        this.resourceContext = resourceContext;
+        this.xhtmlRenderer = new XhtmlRenderer();
+    }
+
+    protected ElementBuilder builder() {
+        return new ElementBuilder();
+    }
+
+    protected String getContextPath() {
+        return resourceContext.getHttpServletRequest().getContextPath();
+    }
+
+    @Override
+    public String getHeaderText() {
+        return headerText;
+    }
+
+    @Override
+    public Element th() {
+        final Element th = new Element("th");
+        th.appendChild(headerText);
+        return th;
+    }
+
+    @Override
+    public Element td(final T t) {
+        final Element td = new Element("td");
+        final Element doTd = doTd(t);
+        if (doTd != null) {
+            td.appendChild(doTd);
+        }
+        return td;
+    }
+
+    protected abstract Element doTd(T t);
+
+    protected String getOidStr(final ObjectAdapter adapter) {
+        return OidUtils.getOidStr(adapter, getOidStringifier());
+    }
+
+    // //////////////////////////////////////////////////////////////
+    // Dependencies (from singletons)
+    // //////////////////////////////////////////////////////////////
+
+    private static PersistenceSession getPersistenceSession() {
+        return IsisContext.getPersistenceSession();
+    }
+
+    private static OidGenerator getOidGenerator() {
+        return getPersistenceSession().getOidGenerator();
+    }
+
+    private static OidStringifier getOidStringifier() {
+        return getOidGenerator().getOidStringifier();
+    }
+
+}

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/xom/XhtmlRenderer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/xom/XhtmlRenderer.java?rev=1139763&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/xhtml/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/xom/XhtmlRenderer.java (added)
+++ incubator/isis/trunk/viewer/xhtml/viewer/src/main/java/org/apache/isis/viewer/restful/viewer/xom/XhtmlRenderer.java Sun Jun 26 11:51:01 2011
@@ -0,0 +1,144 @@
+/*
+ *  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.restful.viewer.xom;
+
+import java.util.List;
+
+import org.apache.isis.viewer.restful.viewer.tree.Attribute;
+import org.apache.isis.viewer.restful.viewer.tree.Element;
+
+public class XhtmlRenderer {
+
+    public Element div_p(final String paragraphText, final String htmlClassAttribute) {
+        final Element div = div(htmlClassAttribute);
+        div.appendChild(p(paragraphText, htmlClassAttribute));
+        return div;
+    }
+
+    public Element p(final String paragraphText, final String htmlClassAttribute) {
+        return builder("p").append(paragraphText).classAttr(htmlClassAttribute).build();
+    }
+
+    public Element p(final boolean condition, final String htmlClassAttribute) {
+        return p(condition ? "Y" : "N", htmlClassAttribute);
+    }
+
+    public Element div(final String htmlClassAttribute) {
+        return builder("div").classAttr(htmlClassAttribute).build();
+    }
+
+    public Element ul(final String htmlClassAttribute) {
+        final Element ul = new Element("ul");
+        addClassAttribute(ul, htmlClassAttribute);
+        return ul;
+    }
+
+    public Element li_a(final String uri, final String aHrefText, final String aHrefRel, final String aHrefRev,
+        final String htmlClassAttribute) {
+        final Element li = new Element("li");
+        li.appendChild(aHref(uri, aHrefText, aHrefRel, aHrefRev, htmlClassAttribute));
+        return li;
+    }
+
+    public Element li_p(final String paragraphText, final String htmlClassAttribute) {
+        final Element li = new Element("li");
+        li.appendChild(p(paragraphText, htmlClassAttribute));
+        return li;
+    }
+
+    public Element aHref(final String aHref, final String aHrefText, final String aHrefRel, final String aHrefRev,
+        final String htmlClassAttribute) {
+        final Element a = new Element("a");
+        a.appendChild(aHrefText);
+        a.addAttribute(new Attribute("href", aHref));
+        a.addAttribute(new Attribute("rel", aHrefRel));
+        a.addAttribute(new Attribute("rev", aHrefRev));
+        addClassAttribute(a, htmlClassAttribute);
+        return a;
+    }
+
+    public <T> Element table(final List<TableColumn<T>> columns, final List<T> rows, final String htmlClassAttribute) {
+        final Element table = new Element("table");
+        table.addAttribute(new Attribute("border", "1"));
+        table.appendChild(appendTrTh(columns));
+        appendTrTd(table, columns, rows);
+        return table;
+    }
+
+    private static <T> Element appendTrTh(final List<TableColumn<T>> columns) {
+        final Element tr = new Element("tr");
+        for (final TableColumn<T> column : columns) {
+            tr.appendChild(column.th());
+        }
+        return tr;
+    }
+
+    private static <T> void appendTrTd(final Element table, final List<TableColumn<T>> columns, final List<T> rows) {
+        for (final T row : rows) {
+            final Element tr = new Element("tr");
+            for (final TableColumn<T> column : columns) {
+                tr.appendChild(column.td(row));
+            }
+            table.appendChild(tr);
+        }
+    }
+
+    public Element dl(final String htmlClassAttribute) {
+        final Element dl = new Element("dl");
+        addClassAttribute(dl, htmlClassAttribute);
+        return dl;
+    }
+
+    public DtDd dt_dd(final String dtText, final String ddText, final String htmlClassAttribute) {
+        final Element dt = new Element("dt");
+        dt.appendChild(dtText);
+        final Element dd = new Element("dd");
+        dd.appendChild(ddText);
+        return new DtDd(dt, dd);
+    }
+
+    /**
+     * Creates a POST form.
+     * 
+     * <pre>
+     *   &lt;form name=&quot;[propertyName]&quot; action=&quot;form&quot; method=&quot;POST&quot;&gt;
+     *     &lt;input type=&quot;text&quot; name=&quot;value&quot; value=&quot;&quot; class=&quot;isis-property&quot;&gt;
+     *     &lt;input type=&quot;submit&quot; value=&quot;Modify&quot;&gt;
+     *   &lt;/form&gt;
+     * </pre>
+     * 
+     * @param property
+     * @return
+     */
+    public Element form(final String formName, final String htmlClassAttribute) {
+        return builder("form").attr("name", formName).build();
+    }
+
+    private static void addClassAttribute(final Element el, final String htmlClassAttribute) {
+        if (htmlClassAttribute == null) {
+            return;
+        }
+        el.addAttribute(new Attribute("class", htmlClassAttribute));
+    }
+
+    private ElementBuilder builder(final String elementName) {
+        return new ElementBuilder(elementName);
+    }
+
+}

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/main/resources/isis-rest-support.js
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/main/resources/isis-rest-support.js?rev=1139763&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/xhtml/viewer/src/main/resources/isis-rest-support.js (added)
+++ incubator/isis/trunk/viewer/xhtml/viewer/src/main/resources/isis-rest-support.js Sun Jun 26 11:51:01 2011
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+
+/**
+ * Sends a PUT to /objects/oid/property/propertyId?proposedValue=valueOrOid
+ */
+function modifyProperty(objectUri, propertyId, proposedValue) {
+	modifyAssociation("PUT", objectUri, "property", propertyId, proposedValue);
+}
+
+/**
+ * Sends a DELETE to /objects/oid/property/propertyId
+ */
+function clearProperty(objectUri, propertyId, proposedValue) {
+	modifyAssociation("DELETE", objectUri, "property", propertyId, null);
+}
+
+/**
+ * Sends a PUT to /objects/oid/collection/collectionId?proposedValue=oidToAdd
+ */
+function addToCollection(objectUri, collectionId, proposedValue) {
+	modifyAssociation("PUT", objectUri, "collection", collectionId, proposedValue);
+}
+
+/**
+ * Sends a DELETE to /objects/oid/collection/collectionId?proposedValue=oidToRemove
+ */
+function removeFromCollection(objectUri, collectionId, proposedValue) {
+	modifyAssociation("DELETE", objectUri, "collection", collectionId, proposedValue);
+}
+
+/**
+ * Helper that factors out common functionality in the four functions that modify
+ * either properties or collections.
+ */
+function modifyAssociation(verb, objectUri, associationType, associationId, proposedValue) {
+	var uri = uriOnSuccess(objectUri, associationType, associationId);
+	if (proposedValue) {
+		uri += "?" + "proposedValue=" + proposedValue;
+	}
+	var reasonInvalidDomId = reasonInvalidDomIdOnFailure(associationType, associationId);
+	invokeUri(verb, uri, objectUri, reasonInvalidDomId);
+}
+
+
+
+function uriOnSuccess(objectUri, memberType, memberId) {
+	return objectUri + "/" + memberType + "/" + memberId;
+}
+
+function reasonInvalidDomIdOnFailure(memberType, memberId) {
+	return memberType + "-invalid-" + memberId;
+}
+
+/**
+ * Helper function that does the heavily lifting.
+ * 
+ * <p>
+ * Makes the request, and redirects to the objectUri if successful, or updates the
+ * DOM element with id <tt>association-invalid-xxx</tt> otherwise. 
+ */
+function invokeUri(verb, uri, uriOnSuccess, reasonInvalidDomIdOnFailure) {
+	//debugger;
+	var xhr = jQuery.ajax( {
+	    url: uri,
+	    type: verb,
+	    dataType: 'xml',
+	    success: function(data, textStatus, jqXHR) {
+	        window.location = uriOnSuccess;
+	    },
+	    error: function(jqXHR, textStatus, errorThrown) {
+	        if (jqXHR.status >= 400 && jqXHR.status < 500) {
+                reason = jqXHR.getResponseHeader("isis-reason");
+                if (!reason) {
+                    reason = "invalid (unable to determine reason)";
+                }
+                reasonInvalidPara = document.getElementById(reasonInvalidDomIdOnFailure);
+                if (reasonInvalidPara) {
+                    reasonInvalidPara.innerHTML = reason;
+                }
+	        } else {
+                alert(jqXHR.status)
+	        }
+	    }
+	}
+	);
+}

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/main/test/net/sf/restfulobjects/viewer/util/StringUtilTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/main/test/net/sf/restfulobjects/viewer/util/StringUtilTest.java?rev=1139763&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/xhtml/viewer/src/main/test/net/sf/restfulobjects/viewer/util/StringUtilTest.java (added)
+++ incubator/isis/trunk/viewer/xhtml/viewer/src/main/test/net/sf/restfulobjects/viewer/util/StringUtilTest.java Sun Jun 26 11:51:01 2011
@@ -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 net.sf.restfulobjects.viewer.util;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.io.ByteArrayInputStream;
+import java.util.List;
+
+import org.junit.Test;
+
+
+public class StringUtilTest {
+
+    @Test
+    public void shouldReturnEmptyArrayWhenNull() {
+        final List<String> args = StringUtil.getArgs(null);
+        assertThat(args.size(), is(equalTo(0)));
+    }
+
+    @Test
+    public void shouldReturnEmptyArrayWhenEmptyString() {
+        final List<String> args = StringUtil.getArgs(newInputStream(""));
+        assertThat(args.size(), is(equalTo(0)));
+    }
+
+    @Test
+    public void shouldReturnArrayOfCorrectSizeWhenTwoArgs() {
+        final List<String> args = StringUtil.getArgs(newInputStream("arg0=foo&arg1=bar"));
+        assertThat(args.size(), is(equalTo(2)));
+    }
+
+    private ByteArrayInputStream newInputStream(final String string) {
+        ByteArrayInputStream bais;
+        bais = new ByteArrayInputStream(string.getBytes());
+        return bais;
+    }
+
+    @Test
+    public void shouldReturnFirstArg() {
+        final ByteArrayInputStream bais = new ByteArrayInputStream("arg0=foo&arg1=bar".getBytes());
+        final List<String> args = StringUtil.getArgs(bais);
+        assertThat(args.get(0), is(equalTo("foo")));
+    }
+
+    @Test
+    public void shouldReturnSecondArg() {
+        final ByteArrayInputStream bais = new ByteArrayInputStream("arg0=foo&arg1=bar".getBytes());
+        final List<String> args = StringUtil.getArgs(bais);
+        assertThat(args.get(1), is(equalTo("bar")));
+    }
+
+}

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/META-INF/MANIFEST.MF?rev=1139763&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/META-INF/MANIFEST.MF (added)
+++ incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/META-INF/MANIFEST.MF Sun Jun 26 11:51:01 2011
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Class-Path: asm-3.1.jar 
+ carserv-dom-1.0-SNAPSHOT.jar 
+ carserv-fixture-1.0-SNAPSHOT.jar 
+ carserv-services-nof-1.0-SNAPSHOT.jar 
+ cglib-nodep-2.1_3.jar 
+ commons-cli-1.0.jar 
+ commons-lang-1.0.jar 
+ commons-logging-1.0.jar 
+ crimson-1.1.3.jar 
+ ejb-3.0-public-draft-20060502.jar 
+ hamcrest-core-1.1.jar 
+ hamcrest-library-1.1.jar 
+ jersey-0.7-ea.jar 
+ jsr311-api-0.7.jar 
+ junit-3.8.1.jar 
+ log4j-1.2.8.jar 
+ no-application-library-3.1-SNAPSHOT.jar 
+ no-architecture-3.1-SNAPSHOT.jar 
+ no-core-library-3.1-SNAPSHOT.jar 
+ nof-core-3.1-SNAPSHOT.jar 
+ nof-persistor-3.1-SNAPSHOT.jar 
+ nof-reflector-core-3.1-SNAPSHOT.jar 
+ nof-reflector-java-3.1-SNAPSHOT.jar 
+ nof-utilities-3.1-SNAPSHOT.jar 
+ nos-bootstrap-3.1-SNAPSHOT.jar 
+ nos-viewer-rest-3.1-SNAPSHOT.jar 
+ timeandmoney-0.5.1.jar
+

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/isis.properties
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/isis.properties?rev=1139763&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/isis.properties (added)
+++ incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/isis.properties Sun Jun 26 11:51:01 2011
@@ -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.
+isis.services.prefix=com.pragprog.dddu.carserv.services
+isis.services=CarRepository,CustomerRepository,EmailServiceImpl,ProgrammableClock,SessionServiceImpl
+
+isis.fixtures.prefix=com.pragprog.dddu.carserv.fixture
+isis.fixtures=CustomerCarsMaintenanceFixture
+
+isis.exploration.users=sven:role1|role2|role3, dick, bob
+
+				
+isis.component.persistor=in-memory
+    
+
+
+isis.reflector.java.facets.value.com.domainlanguage.time.CalendarInterval.semanticsProviderName=com.pragprog.dddu.carserv.value.CalendarIntervalValueSemanticsProvider
\ No newline at end of file

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/lib/jstl.jar
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/lib/jstl.jar?rev=1139763&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/lib/jstl.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/lib/standard.jar
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/lib/standard.jar?rev=1139763&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/lib/standard.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/web.xml?rev=1139763&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/isis/trunk/viewer/xhtml/viewer/src/main/webapp/WEB-INF/web.xml Sun Jun 26 11:51:01 2011
@@ -0,0 +1,76 @@
+<?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.
+-->
+<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+	<display-name>carserv-rest</display-name>
+	
+    <display-name>Restful Testing</display-name>
+
+	<context-param>
+		<param-name>javax.ws.rs.Application</param-name>
+		<param-value>org.starobjects.restful.viewer.RestfulApplication</param-value>
+	</context-param>
+	
+	<filter>
+		<filter-name>NakedObjectsSessionFilter</filter-name>
+		<filter-class>org.nakedobjects.webapp.NakedObjectsSessionFilter</filter-class>
+		<init-param>
+			<param-name>authenticationSessionLookupStrategy</param-name>
+			<param-value>org.nakedobjects.webapp.auth.AuthenticationSessionLookupStrategyDefault</param-value>
+		</init-param>
+	</filter>
+
+    <filter-mapping>
+    	<filter-name>NakedObjectsSessionFilter</filter-name>
+    	<url-pattern>/</url-pattern>
+    </filter-mapping>
+    
+    <listener>
+        <listener-class>org.nakedobjects.webapp.NakedObjectsServletContextInitializer</listener-class>
+    </listener>
+
+    <servlet>
+        <servlet-name>RestEasy</servlet-name>
+        <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
+    </servlet>
+
+    <servlet>
+        <servlet-name>Resource</servlet-name>
+        <servlet-class>org.nakedobjects.webapp.servlets.ResourceServlet</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>RestEasy</servlet-name>
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>Resource</servlet-name>
+        <url-pattern>*.js</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>Resource</servlet-name>
+        <url-pattern>*.gif</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>Resource</servlet-name>
+        <url-pattern>*.png</url-pattern>
+    </servlet-mapping>
+		
+</web-app>

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/site/apt/index.apt?rev=1139763&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/xhtml/viewer/src/site/apt/index.apt (added)
+++ incubator/isis/trunk/viewer/xhtml/viewer/src/site/apt/index.apt Sun Jun 26 11:51:01 2011
@@ -0,0 +1,25 @@
+~~  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.
+
+Restful Viewer
+
+  The <viewer> module provides a set of servlets that serve up the domain objects as RESTful resources. 
+
+Further Info
+  
+  See this module's {{{./apidocs/index.html}Javadoc}} and the {{{../docbkx/html/guide/isis-restful-viewer.html}user guide}} for more information.
+  
\ No newline at end of file

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/site/apt/jottings.apt
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/site/apt/jottings.apt?rev=1139763&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/xhtml/viewer/src/site/apt/jottings.apt (added)
+++ incubator/isis/trunk/viewer/xhtml/viewer/src/site/apt/jottings.apt Sun Jun 26 11:51:01 2011
@@ -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.
+
+
+
+Jottings
+ 
+  This page is to capture any random jottings relating to this module prior 
+  to being moved into formal documentation. 
+ 

Added: incubator/isis/trunk/viewer/xhtml/viewer/src/site/site.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/xhtml/viewer/src/site/site.xml?rev=1139763&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/xhtml/viewer/src/site/site.xml (added)
+++ incubator/isis/trunk/viewer/xhtml/viewer/src/site/site.xml Sun Jun 26 11:51:01 2011
@@ -0,0 +1,39 @@
+<?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 name="${project.name}">
+    <version position="right"/>
+	<body>
+		<breadcrumbs>
+			<item name="Viewer" href="index.html"/>
+		</breadcrumbs>
+
+		<menu name="Restful Viewer">
+			<item name="About" href="index.html" />
+            <item name="Jottings" href="jottings.html" />
+		</menu>
+
+        <menu name="Restful Modules">
+            <item name="Applib" href="./applib/index.html" />
+            <item name="Viewer" href="./viewer/index.html" />
+        </menu>
+        
+		<menu name="Maven Reports" ref="reports" />
+	</body>
+</project>