incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1188379 [1/2] - in /incubator/isis/trunk/framework/viewer/json: json-applib/src/main/java/org/apache/isis/viewer/json/applib/ json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/ json-applib/src/main/java/org/apache/i...
Date Mon, 24 Oct 2011 21:05:18 GMT
Author: danhaywood
Date: Mon Oct 24 21:05:17 2011
New Revision: 1188379

URL: http://svn.apache.org/viewvc?rev=1188379&view=rev
Log:
ISIS-109: more on sorting out links for v0.48 of spec

Added:
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/AbstractObjectMemberRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/DomainRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/AbstractTypeMemberRepresentation.java
Modified:
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/JsonRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/CapabilitiesRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/DomainObjectRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ListRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectActionRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectCollectionRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectPropertyRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ScalarValueRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/DomainTypeRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/DomainTypesRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeActionParameterRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeActionRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeCollectionRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypePropertyRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/homepage/HomePageRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/user/UserRepresentation.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/invoke/DomainServiceResourceTest_invokeAction.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_accept.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_xrofollowlinks.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkBuilder.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkFollower.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/Rel.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/ReprRendererAbstract.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/AbstractObjectMemberReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainObjectLinkTo.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainObjectReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelper.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainServiceLinkTo.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainServiceResourceServerside.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ListReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ObjectActionReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ObjectAdapterLinkTo.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ObjectCollectionReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ObjectPropertyReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ScalarValueReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/AbstractTypeFeatureReprBuilder.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypeResourceServerside.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/home/HomePageReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/user/UserReprRenderer.java

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/JsonRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/JsonRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/JsonRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/JsonRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,52 +18,50 @@
  */
 package org.apache.isis.viewer.json.applib;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.lang.reflect.Constructor;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import net.sf.json.JSON;
-import net.sf.json.JSONNull;
-import net.sf.json.JSONSerializer;
-import net.sf.json.xml.XMLSerializer;
-
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.apache.isis.viewer.json.applib.util.JsonMapper;
-import org.apache.isis.viewer.json.applib.util.JsonNodeUtils;
-import org.apache.isis.viewer.json.applib.util.UrlEncodingUtils;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.node.ArrayNode;
-import org.codehaus.jackson.node.JsonNodeFactory;
-import org.codehaus.jackson.node.NullNode;
-import org.codehaus.jackson.node.ObjectNode;
-import org.codehaus.jackson.node.POJONode;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.jdom.input.SAXBuilder;
-import org.jdom.output.XMLOutputter;
-import org.jdom.xpath.XPath;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.lang.reflect.Constructor;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import net.sf.json.JSON;
+import net.sf.json.JSONNull;
+import net.sf.json.JSONSerializer;
+import net.sf.json.xml.XMLSerializer;
+
+import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
+import org.apache.isis.viewer.json.applib.util.JsonMapper;
+import org.apache.isis.viewer.json.applib.util.JsonNodeUtils;
+import org.apache.isis.viewer.json.applib.util.UrlEncodingUtils;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.node.ArrayNode;
+import org.codehaus.jackson.node.JsonNodeFactory;
+import org.codehaus.jackson.node.NullNode;
+import org.codehaus.jackson.node.ObjectNode;
+import org.codehaus.jackson.node.POJONode;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.input.SAXBuilder;
+import org.jdom.output.XMLOutputter;
+import org.jdom.xpath.XPath;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 
 
 /**

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/CapabilitiesRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/CapabilitiesRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/CapabilitiesRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/CapabilitiesRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,32 +18,18 @@
  */
 package org.apache.isis.viewer.json.applib.capabilities;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.apache.isis.viewer.json.applib.domainobjects.DomainRepresentation;
+import org.codehaus.jackson.JsonNode;
 
-public class CapabilitiesRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class CapabilitiesRepresentation extends DomainRepresentation  {
 
     public CapabilitiesRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
 
-    public LinkRepresentation getSelf() {
-        return getLink("links[rel=self]");
-    }
-
     public JsonRepresentation getCapabilities() {
         return getMap("capabilities");
     }
 
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 }

Added: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/AbstractObjectMemberRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/AbstractObjectMemberRepresentation.java?rev=1188379&view=auto
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/AbstractObjectMemberRepresentation.java (added)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/AbstractObjectMemberRepresentation.java Mon Oct 24 21:05:17 2011
@@ -0,0 +1,47 @@
+/*
+ *  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.json.applib.domainobjects;
+
+import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
+import org.codehaus.jackson.JsonNode;
+
+
+public abstract class AbstractObjectMemberRepresentation extends DomainRepresentation  {
+
+    public AbstractObjectMemberRepresentation(JsonNode jsonNode) {
+        super(jsonNode);
+    }
+    
+    public String getId() {
+        return getString("id");
+    }
+
+    public String getMemberType() {
+        return getString("memberType");
+    }
+
+    public String getDisabledReason() {
+        return getString("disabledReason");
+    }
+
+    public LinkRepresentation getDetails() {
+        return getLinkWithRel("details");
+    }
+
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/DomainObjectRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/DomainObjectRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/DomainObjectRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/DomainObjectRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,24 +18,16 @@
  */
 package org.apache.isis.viewer.json.applib.domainobjects;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.codehaus.jackson.JsonNode;
 
 
-public class DomainObjectRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class DomainObjectRepresentation extends DomainRepresentation {
 
     public DomainObjectRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
 
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
     public String getOid() {
         return getString("oid");
     }
@@ -71,13 +63,4 @@ public class DomainObjectRepresentation 
     public JsonRepresentation getAction(final String id) {
         return getRepresentation("members[memberType=action id=%s]", id);
     }
-
-
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 }

Added: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/DomainRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/DomainRepresentation.java?rev=1188379&view=auto
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/DomainRepresentation.java (added)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/DomainRepresentation.java Mon Oct 24 21:05:17 2011
@@ -0,0 +1,50 @@
+/*
+ *  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.json.applib.domainobjects;
+
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
+import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
+import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
+import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
+import org.codehaus.jackson.JsonNode;
+
+public abstract class DomainRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+
+    public DomainRepresentation(JsonNode jsonNode) {
+        super(jsonNode);
+    }
+
+    public LinkRepresentation getSelf() {
+        return getLinkWithRel("self");
+    }
+
+    public JsonRepresentation getLinks() {
+        return getArray("links");
+    }
+
+    public LinkRepresentation getLinkWithRel(String rel) {
+        return getLink(String.format("links[rel=%s]", rel));
+    }
+
+    public JsonRepresentation getExtensions() {
+        return getMap("extensions");
+    }
+
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ListRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ListRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ListRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ListRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,33 +18,18 @@
  */
 package org.apache.isis.viewer.json.applib.domainobjects;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.codehaus.jackson.JsonNode;
 
 
-public class ListRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class ListRepresentation extends DomainRepresentation {
 
     public ListRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
 
-    public LinkRepresentation getSelf() {
-        return getLink("links[rel=self]");
-    }
-
     public JsonRepresentation getValues() {
         return getArray("values");
     }
 
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectActionRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectActionRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectActionRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectActionRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,49 +18,18 @@
  */
 package org.apache.isis.viewer.json.applib.domainobjects;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
+import org.codehaus.jackson.JsonNode;
 
 
-public class ObjectActionRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class ObjectActionRepresentation extends AbstractObjectMemberRepresentation {
 
     public ObjectActionRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
     
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
-    public String getDisabledReason() {
-        return getString("disabledReason");
-    }
-
-    public String getMemberType() {
-        return getString("memberType");
-    }
-
     public LinkRepresentation getInvoke() {
-        return getLink("invoke");
-    }
-
-    public String getActionId() {
-        return getString("actionId");
-    }
-
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
-    public LinkRepresentation getActionDetails() {
-        return getLink("actionDetails");
+        return getLinkWithRel("invoke");
     }
 
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectCollectionRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectCollectionRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectCollectionRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectCollectionRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,30 +18,13 @@
  */
 package org.apache.isis.viewer.json.applib.domainobjects;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonNode;
 
 
-public class ObjectCollectionRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class ObjectCollectionRepresentation extends AbstractObjectMemberRepresentation {
 
     public ObjectCollectionRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
-    
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
-
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
 
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectPropertyRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectPropertyRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectPropertyRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ObjectPropertyRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,30 +18,13 @@
  */
 package org.apache.isis.viewer.json.applib.domainobjects;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonNode;
 
 
-public class ObjectPropertyRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class ObjectPropertyRepresentation extends AbstractObjectMemberRepresentation {
 
     public ObjectPropertyRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
-    
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ScalarValueRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ScalarValueRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ScalarValueRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domainobjects/ScalarValueRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,33 +18,18 @@
  */
 package org.apache.isis.viewer.json.applib.domainobjects;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.codehaus.jackson.JsonNode;
 
 
-public class ScalarValueRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class ScalarValueRepresentation extends DomainRepresentation {
 
     public ScalarValueRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
     
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
     public JsonRepresentation getValue() {
         return getRepresentation("value");
     }
 
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 }

Added: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/AbstractTypeMemberRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/AbstractTypeMemberRepresentation.java?rev=1188379&view=auto
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/AbstractTypeMemberRepresentation.java (added)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/AbstractTypeMemberRepresentation.java Mon Oct 24 21:05:17 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.
+ */
+package org.apache.isis.viewer.json.applib.domaintypes;
+
+import org.apache.isis.viewer.json.applib.domainobjects.DomainRepresentation;
+import org.codehaus.jackson.JsonNode;
+
+public abstract class AbstractTypeMemberRepresentation extends DomainRepresentation  {
+
+    public AbstractTypeMemberRepresentation(JsonNode jsonNode) {
+        super(jsonNode);
+    }
+
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/DomainTypeRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/DomainTypeRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/DomainTypeRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/DomainTypeRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,28 +18,13 @@
  */
 package org.apache.isis.viewer.json.applib.domaintypes;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.apache.isis.viewer.json.applib.domainobjects.DomainRepresentation;
+import org.codehaus.jackson.JsonNode;
 
-public class DomainTypeRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class DomainTypeRepresentation extends DomainRepresentation {
 
     public DomainTypeRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
 
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/DomainTypesRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/DomainTypesRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/DomainTypesRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/DomainTypesRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,28 +18,13 @@
  */
 package org.apache.isis.viewer.json.applib.domaintypes;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.apache.isis.viewer.json.applib.domainobjects.DomainRepresentation;
+import org.codehaus.jackson.JsonNode;
 
-public class DomainTypesRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class DomainTypesRepresentation extends DomainRepresentation {
 
     public DomainTypesRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
 
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeActionParameterRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeActionParameterRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeActionParameterRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeActionParameterRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,28 +18,12 @@
  */
 package org.apache.isis.viewer.json.applib.domaintypes;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonNode;
 
-public class TypeActionParameterRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class TypeActionParameterRepresentation extends AbstractTypeMemberRepresentation {
 
     public TypeActionParameterRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
 
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeActionRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeActionRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeActionRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeActionRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,28 +18,16 @@
  */
 package org.apache.isis.viewer.json.applib.domaintypes;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonNode;
 
-public class TypeActionRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class TypeActionRepresentation extends AbstractTypeMemberRepresentation  {
 
     public TypeActionRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
-
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
+
+    public String getId() {
+        return getString("id");
+    }
 
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeCollectionRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeCollectionRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeCollectionRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypeCollectionRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,28 +18,12 @@
  */
 package org.apache.isis.viewer.json.applib.domaintypes;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonNode;
 
-public class TypeCollectionRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class TypeCollectionRepresentation extends AbstractTypeMemberRepresentation {
 
     public TypeCollectionRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
 
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypePropertyRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypePropertyRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypePropertyRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/domaintypes/TypePropertyRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,28 +18,12 @@
  */
 package org.apache.isis.viewer.json.applib.domaintypes;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonNode;
 
-public class TypePropertyRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class TypePropertyRepresentation extends AbstractTypeMemberRepresentation  {
 
     public TypePropertyRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
 
-    public LinkRepresentation getSelf() {
-        return getLink("self");
-    }
-
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/homepage/HomePageRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/homepage/HomePageRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/homepage/HomePageRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/homepage/HomePageRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,37 +18,25 @@
  */
 package org.apache.isis.viewer.json.applib.homepage;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
+import org.apache.isis.viewer.json.applib.domainobjects.DomainRepresentation;
+import org.codehaus.jackson.JsonNode;
 
-public class HomePageRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class HomePageRepresentation extends DomainRepresentation {
 
     public HomePageRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
 
-    public LinkRepresentation getSelf() {
-        return getLink("links[rel=self]");
-    }
     public LinkRepresentation getUser() {
-        return getLink("links[rel=user]");
+        return getLinkWithRel("user");
     }
     public LinkRepresentation getServices() {
-        return getLink("links[rel=services]");
+        return getLinkWithRel("services");
     }
     public LinkRepresentation getCapabilities() {
-        return getLink("links[rel=capabilities]");
+        return getLinkWithRel("capabilities");
     }
 
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
 
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/user/UserRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/user/UserRepresentation.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/user/UserRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/user/UserRepresentation.java Mon Oct 24 21:05:17 2011
@@ -18,26 +18,19 @@
  */
 package org.apache.isis.viewer.json.applib.user;
 
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasExtensions;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.HasLinks;
-import org.apache.isis.viewer.json.applib.JsonRepresentation.LinksToSelf;
-import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.codehaus.jackson.JsonNode;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.apache.isis.viewer.json.applib.domainobjects.DomainRepresentation;
+import org.codehaus.jackson.JsonNode;
 
 
-public class UserRepresentation extends JsonRepresentation implements LinksToSelf, HasLinks, HasExtensions {
+public class UserRepresentation extends DomainRepresentation {
 
     public UserRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
     
-    public LinkRepresentation getSelf() {
-        return getLink("links[rel=self]");
-    }
-
-    public String getUsername() {
-        return getString("username");
+    public String getUserName() {
+        return getString("userName");
     }
 
     public String getFriendlyName() {
@@ -52,11 +45,4 @@ public class UserRepresentation extends 
         return getRepresentation("roles");
     }
 
-    public JsonRepresentation getLinks() {
-        return getArray("links");
-    }
-    public JsonRepresentation getExtensions() {
-        return getMap("extensions");
-    }
-
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java Mon Oct 24 21:05:17 2011
@@ -71,7 +71,7 @@ public class HomePageResourceTest_xrofol
     @Test
     public void all() throws Exception {
 
-        repr = whenExecuteWith("/", "user,services,capabilities");
+        repr = whenExecuteAndFollowLinksUsing("/", "links[rel=user],links[rel=services],links[rel=capabilities]");
 
         assertThat(repr.getUser().getValue(), is(not(nullValue())));
         assertThat(repr.getCapabilities().getValue(), is(not(nullValue())));
@@ -81,7 +81,7 @@ public class HomePageResourceTest_xrofol
     @Test
     public void servicesValues() throws Exception {
 
-        repr = whenExecuteWith("/", "services.values");
+        repr = whenExecuteAndFollowLinksUsing("/", "links[rel=services].values");
 
         JsonRepresentation servicesValue = repr.getServices().getValue();
         assertThat(servicesValue, is(not(nullValue())));
@@ -91,21 +91,21 @@ public class HomePageResourceTest_xrofol
         
         JsonRepresentation service;
         
-        service = serviceLinkList.getRepresentation("[key=%s]", "simples");
+        service = serviceLinkList.getRepresentation("[id=%s]", "simples");
         assertThat(service, isMap());
-        assertThat(service.getString("key"), is("simples"));
+        assertThat(service.getString("id"), is("simples"));
         assertThat(service.getRepresentation("value"), is(not(nullValue())));
 
-        service = serviceLinkList.getRepresentation("[key=%s]", "applibValuedEntities");
+        service = serviceLinkList.getRepresentation("[id=%s]", "applibValuedEntities");
         assertThat(service, isMap());
-        assertThat(service.getString("key"), is("applibValuedEntities"));
+        assertThat(service.getString("id"), is("applibValuedEntities"));
         assertThat(service.getRepresentation("value"), is(not(nullValue())));
     }
 
     @Test
     public void servicesValuesWithCriteria() throws Exception {
 
-        repr = whenExecuteWith("/", "services.values[key=simples]");
+        repr = whenExecuteAndFollowLinksUsing("/", "links[rel=services].values[id=simples]");
 
         JsonRepresentation servicesValue = repr.getServices().getValue();
         assertThat(servicesValue, is(not(nullValue())));
@@ -115,16 +115,16 @@ public class HomePageResourceTest_xrofol
         
         JsonRepresentation service;
         
-        service = serviceLinkList.getRepresentation("[key=%s]", "simples");
+        service = serviceLinkList.getRepresentation("[id=%s]", "simples");
         assertThat(service, isMap());
-        assertThat(service.getString("key"), is("simples"));
+        assertThat(service.getString("id"), is("simples"));
         assertThat(service.getRepresentation("value"), is(not(nullValue())));
 
-        service = serviceLinkList.getRepresentation("[key=%s]", "applibValuedEntities");
+        service = serviceLinkList.getRepresentation("[id=%s]", "applibValuedEntities");
         assertThat(service.getRepresentation("value"), is(nullValue()));
     }
 
-    private HomePageRepresentation whenExecuteWith(final String uriTemplate, final String followLinks) throws JsonParseException, JsonMappingException, IOException {
+    private HomePageRepresentation whenExecuteAndFollowLinksUsing(final String uriTemplate, final String followLinks) throws JsonParseException, JsonMappingException, IOException {
         request = client.createRequest(HttpMethod.GET, uriTemplate).withArg(QueryParameter.FOLLOW_LINKS, followLinks);
         restfulResponse = request.executeT();
         return restfulResponse.getEntity();

Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/invoke/DomainServiceResourceTest_invokeAction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/invoke/DomainServiceResourceTest_invokeAction.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/invoke/DomainServiceResourceTest_invokeAction.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/invoke/DomainServiceResourceTest_invokeAction.java Mon Oct 24 21:05:17 2011
@@ -237,23 +237,22 @@ public class DomainServiceResourceTest_i
         final String href = givenHrefToService(serviceId);
         
         final RestfulRequest request = 
-                client.createRequest(HttpMethod.GET, href).withArg(QueryParameter.FOLLOW_LINKS, "members[id=%s].details", actionId);
+                client.createRequest(HttpMethod.GET, href).withArg(QueryParameter.FOLLOW_LINKS, "members[id=%s].links[rel=details]", actionId);
         final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();
 
         assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
         final DomainObjectRepresentation repr = restfulResponse.getEntity();
         
         JsonRepresentation actionLinkRepr = repr.getAction(actionId);
-        return actionLinkRepr.getRepresentation("details.value");
+        return actionLinkRepr.getRepresentation("links[rel=details].value");
     }
 
-
     private String givenHrefToService(String serviceId) throws JsonParseException, JsonMappingException, IOException {
         final DomainServiceResource resource = client.getDomainServiceResource();
         final Response response = resource.services();
         final ListRepresentation services = RestfulResponse.<ListRepresentation>ofT(response).getEntity();
 
-        return services.getRepresentation("values[key=%s]", serviceId).asLink().getHref();
+        return services.getRepresentation("values[id=%s]", serviceId).asLink().getHref();
     }
 
     private LinkRepresentation givenLinkToSimpleEntity(int num) throws JsonParseException, JsonMappingException, IOException, Exception {

Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_accept.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_accept.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_accept.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_accept.java Mon Oct 24 21:05:17 2011
@@ -97,7 +97,7 @@ public class DomainServiceResourceTest_s
         final Response response = resource.services();
         final ListRepresentation services = RestfulResponse.<ListRepresentation>ofT(response).getEntity();
 
-        final String href = services.getRepresentation("values.[key=%s]", "simples").asLink().getHref();
+        final String href = services.getRepresentation("values[id=%s]", "simples").asLink().getHref();
         return href;
     }
 

Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java Mon Oct 24 21:05:17 2011
@@ -121,7 +121,7 @@ public class DomainServiceResourceTest_s
         DomainObjectRepresentation repr = givenRepresentation("simples");
 
         // then
-        assertThat(repr.getLinks().size(), is(1));
+        assertThat(repr.getLinks().size(), is(2));
     }
     
 

Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_xrofollowlinks.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_xrofollowlinks.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_xrofollowlinks.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_xrofollowlinks.java Mon Oct 24 21:05:17 2011
@@ -63,7 +63,7 @@ public class DomainServiceResourceTest_s
         final String href = givenHrefToService("simples");
         
         final RestfulRequest request = 
-                client.createRequest(HttpMethod.GET, href).withArg(QueryParameter.FOLLOW_LINKS, "members[id=%s].details", "list");
+                client.createRequest(HttpMethod.GET, href).withArg(QueryParameter.FOLLOW_LINKS, "members[id=%s].links[rel=details]", "list");
         final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();
 
         assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
@@ -75,12 +75,12 @@ public class DomainServiceResourceTest_s
         JsonRepresentation actionRepr;
         
         actionRepr = membersList.getRepresentation("[id=%s]", "list");
-        assertThat(actionRepr.getRepresentation("details"), is(not(nullValue())));
-        assertThat(actionRepr.getRepresentation("details.value"), is(not(nullValue()))); // followed
+        assertThat(actionRepr.getRepresentation("links[rel=details]"), is(not(nullValue())));
+        assertThat(actionRepr.getRepresentation("links[rel=details].value"), is(not(nullValue()))); // followed
         
         actionRepr = membersList.getRepresentation("[id=%s]", "newTransientEntity");
-        assertThat(actionRepr.getRepresentation("details"), is(not(nullValue())));
-        assertThat(actionRepr.getRepresentation("details.value"), is(nullValue())); // not followed
+        assertThat(actionRepr.getRepresentation("links[rel=details]"), is(not(nullValue())));
+        assertThat(actionRepr.getRepresentation("links[rel=details].value"), is(nullValue())); // not followed
     }
 
 
@@ -89,7 +89,7 @@ public class DomainServiceResourceTest_s
         final Response response = resource.services();
         final ListRepresentation services = RestfulResponse.<ListRepresentation>ofT(response).getEntity();
 
-        return services.getRepresentation("values[key=%s]", serviceId).asLink().getHref();
+        return services.getRepresentation("values[id=%s]", serviceId).asLink().getHref();
     }
 
 

Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java Mon Oct 24 21:05:17 2011
@@ -117,7 +117,7 @@ public class DomainServiceResourceTest_s
             assertThat(followJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));
             
             JsonRepresentation followRepr = followJsonResp.getEntity();
-            LinkRepresentation self = followRepr.getLink("self");
+            LinkRepresentation self = followRepr.getLink("links[rel=self]");
             
             assertThat(self.getHref(), is(link.getHref()));
         }

Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java Mon Oct 24 21:05:17 2011
@@ -90,7 +90,7 @@ public class UserResourceTest_representa
         assertThat(repr.isMap(), is(true));
         
         assertThat(repr.getSelf(), isLink(client).method(Method.GET));
-        assertThat(repr.getUsername(), is(not(nullValue())));
+        assertThat(repr.getUserName(), is(not(nullValue())));
         assertThat(repr.getFriendlyName(), is(nullValue())); // TODO: change fixture so populated
         assertThat(repr.getEmail(), is(nullValue())); // TODO: change fixture so populated
         assertThat(repr.getRoles(), is(not(nullValue()))); // TODO: change fixture so have non-empty list

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkBuilder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkBuilder.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkBuilder.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkBuilder.java Mon Oct 24 21:05:17 2011
@@ -43,7 +43,7 @@ public final class LinkBuilder {
     private String title;
     private JsonRepresentation arguments;
     private JsonRepresentation value;
-    private String key;
+    private String id;
 
     protected LinkBuilder(ResourceContext resourceContext, Rel rel, String href, MediaType mediaType) {
         this.resourceContext = resourceContext;
@@ -63,8 +63,8 @@ public final class LinkBuilder {
         this.arguments = arguments;
         return this;
     }
-    public LinkBuilder withKey(String key) {
-        this.key = key;
+    public LinkBuilder withId(String id) {
+        this.id = id;
         return this;
     }
     public LinkBuilder withValue(JsonRepresentation value) {
@@ -73,7 +73,7 @@ public final class LinkBuilder {
     }
 
     public JsonRepresentation build() {
-        representation.mapPut("key", key);
+        representation.mapPut("id", id);
         representation.mapPut("rel", rel.getName());
         representation.mapPut("href", resourceContext.urlFor(href));
         representation.mapPut("method", method);

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkFollower.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkFollower.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkFollower.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/LinkFollower.java Mon Oct 24 21:05:17 2011
@@ -51,11 +51,12 @@ public final class LinkFollower {
         this.mode = mode;
         this.root = root;
     }
-
+
     /**
      * A little algebra...
      */
-    public LinkFollower follow(String path) {
+    public LinkFollower follow(String pathTemplate, Object... args) {
+        String path = String.format(pathTemplate, args);
         if(path == null) {
             return terminated(PathNode.NULL);
         }

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/Rel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/Rel.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/Rel.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/Rel.java Mon Oct 24 21:05:17 2011
@@ -22,22 +22,36 @@ public enum Rel {
     // IANA registered
     SELF("self"),
     DESCRIBEDBY("describedby"),
+    UP("up"), 
+    HELP("help"), 
+    ICON("icon"), 
     
-    // Restful Objects namespace
+    // Restful Objects namespace
+    ICON16("icon16"),
+    ICON32("icon32"),
     OBJECT("object"), 
     SERVICE("service"), 
+    CHOICE("choice"), 
+    DEFAULT("default"), 
     DETAILS("details"), 
     MODIFY("modify"), 
     CLEAR("clear"), 
-    ADD_TO("addTo"),
-    REMOVE_FROM("removeFrom"), 
+    ADD_TO("addto"),
+    REMOVE_FROM("removefrom"), 
     INVOKE("invoke"), 
+    PERSIST("persist"), 
+    PROPERTY("property"), 
+    COLLECTION("collection"), 
+    ACTION("action"), 
+    ACTIONPARAM("actionparam"), 
+    RETURNTYPE("returntype"), 
+    ELEMENTTYPE("elementtype"), 
     CAPABILITIES("capabilities"), 
-    SERVICES("services"), 
     USER("user"),
+    SERVICES("services"), 
     
     // implementation specific
-    CONTRIBUTED_BY("contributedBy")
+    CONTRIBUTED_BY("contributedby")
     ;
     
     private final String name;

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/ReprRendererAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/ReprRendererAbstract.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/ReprRendererAbstract.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/ReprRendererAbstract.java Mon Oct 24 21:05:17 2011
@@ -42,7 +42,6 @@ public abstract class ReprRendererAbstra
         this.linkFollower = asProvidedElseCreate(linkFollower);
         this.representationType = representationType;
         this.representation = representation;
-        withLinks();
     }
 
     public ResourceContext getResourceContext() {
@@ -60,12 +59,6 @@ public abstract class ReprRendererAbstra
         return LinkFollower.create(resourceContext.getFollowLinks());
     }
 
-    private R withLinks() {
-        JsonRepresentation links = JsonRepresentation.newArray();
-        representation.mapPut("links", links);
-        return cast(this);
-    }
-
 
     @Override
     public RepresentationType getRepresentationType() {
@@ -86,15 +79,31 @@ public abstract class ReprRendererAbstra
         return cast(this);
     }
 
-    
+    
+    /**
+     * Will lazily create links array as required
+     */
     protected JsonRepresentation getLinks() {
-        return representation.getArray("links");
+        JsonRepresentation links = representation.getArray("links");
+        if(links == null) {
+            links = JsonRepresentation.newArray();
+            representation.mapPut("links", links);
+        }
+        return links;
     }
-
-    public R withExtensions() {
-        return withExtensions(JsonRepresentation.newMap());
-    }
-
+
+    /**
+     * Will lazily create extensions map as required
+     */
+    protected JsonRepresentation getExtensions() {
+        JsonRepresentation extensions = representation.getMap("extensions");
+        if(extensions == null) {
+            extensions = JsonRepresentation.newMap();
+            representation.mapPut("extensions", extensions);
+        }
+        return extensions;
+    }
+
     public R withExtensions(JsonRepresentation extensions) {
         if(!extensions.isMap()) {
             throw new IllegalArgumentException("extensions must be a map");

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/AbstractObjectMemberReprRenderer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/AbstractObjectMemberReprRenderer.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/AbstractObjectMemberReprRenderer.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/AbstractObjectMemberReprRenderer.java Mon Oct 24 21:05:17 2011
@@ -50,7 +50,6 @@ public abstract class AbstractObjectMemb
         usingLinkToBuilder(new DomainObjectLinkTo());
 
         // done eagerly so can use as criteria for x-ro-follow-links
-        
         putId();
         putMemberType();
 
@@ -67,7 +66,7 @@ public abstract class AbstractObjectMemb
 
     public R withSelf() {
         final JsonRepresentation links = getLinks();
-        links.mapPut("self", linkToBuilder.linkToMember(Rel.SELF, memberType, objectMember).build());
+        links.arrayAdd(linkToBuilder.linkToMember(Rel.SELF, memberType, objectMember).build());
         return cast(this);
     }
 
@@ -104,9 +103,9 @@ public abstract class AbstractObjectMemb
     public R withDetailsLink() {
         final JsonRepresentation link = 
                 linkToBuilder.linkToMember(memberType.getDetailsRel(), memberType, objectMember).build();
-        representation.mapPut(memberType.getDetailsRel().getName(), link);
+        getLinks().arrayAdd(link);
         final LinkFollower membersLinkFollower = getLinkFollower();
-        final LinkFollower detailsLinkFollower = membersLinkFollower.follow(memberType.getDetailsRel().getName());
+        final LinkFollower detailsLinkFollower = membersLinkFollower.follow("links[rel=%s]", memberType.getDetailsRel().getName());
         if(membersLinkFollower.matches(representation) && detailsLinkFollower.matches(link)) {
             followDetailsLink(link);
         }

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainObjectLinkTo.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainObjectLinkTo.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainObjectLinkTo.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainObjectLinkTo.java Mon Oct 24 21:05:17 2011
@@ -27,6 +27,7 @@ public class DomainObjectLinkTo implemen
 
     protected ResourceContext resourceContext;
     protected ObjectAdapter objectAdapter;
+    protected Rel rel;
 
     @Override
     public final DomainObjectLinkTo usingResourceContext(ResourceContext resourceContext) {
@@ -40,6 +41,7 @@ public class DomainObjectLinkTo implemen
         return this;
     }
 
+    
     @Override
     public LinkBuilder builder() {
         return LinkBuilder.newBuilder(resourceContext, linkRel(), RepresentationType.DOMAIN_OBJECT, linkRef());
@@ -64,9 +66,14 @@ public class DomainObjectLinkTo implemen
      * hook method
      */
     protected Rel linkRel() {
-        return Rel.OBJECT;
+        return rel!=null?rel:Rel.OBJECT;
     }
 
+    @Override
+    public ObjectAdapterLinkTo with(Rel rel) {
+        this.rel = rel;
+        return this;
+    }
 
     @Override
     public final LinkBuilder linkToMember(Rel rel, MemberType memberType, ObjectMember objectMember, String... parts) {

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainObjectReprRenderer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainObjectReprRenderer.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainObjectReprRenderer.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainObjectReprRenderer.java Mon Oct 24 21:05:17 2011
@@ -20,7 +20,6 @@ import java.util.List;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
 import org.apache.isis.core.metamodel.facets.object.title.TitleFacet;
 import org.apache.isis.core.metamodel.facets.object.value.ValueFacet;
 import org.apache.isis.core.metamodel.spec.ObjectActionSet;
@@ -33,8 +32,8 @@ import org.apache.isis.core.metamodel.sp
 import org.apache.isis.viewer.json.applib.JsonRepresentation;
 import org.apache.isis.viewer.json.applib.RepresentationType;
 import org.apache.isis.viewer.json.viewer.ResourceContext;
-import org.apache.isis.viewer.json.viewer.representations.LinkFollower;
 import org.apache.isis.viewer.json.viewer.representations.LinkBuilder;
+import org.apache.isis.viewer.json.viewer.representations.LinkFollower;
 import org.apache.isis.viewer.json.viewer.representations.Rel;
 import org.apache.isis.viewer.json.viewer.representations.RendererFactory;
 import org.apache.isis.viewer.json.viewer.representations.RendererFactoryRegistry;
@@ -90,8 +89,8 @@ public class DomainObjectReprRenderer ex
 
         // self
         if(includesSelf && objectAdapter.isPersistent()) {
-            JsonRepresentation self = linkToBuilder.with(objectAdapter).builder().build();
-            representation.mapPut("self", self);
+            JsonRepresentation self = linkToBuilder.with(Rel.SELF).with(objectAdapter).builder().build();
+            getLinks().arrayAdd(self);
         }
 
         // title
@@ -108,7 +107,7 @@ public class DomainObjectReprRenderer ex
                 DomainTypeReprRenderer.newLinkToBuilder(getResourceContext(), Rel.DESCRIBEDBY, objectAdapter.getSpecification()).build());
         
         // extensions
-        withExtensions();
+        getExtensions();
         
         return representation;
     }

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelper.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelper.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelper.java Mon Oct 24 21:05:17 2011
@@ -242,7 +242,7 @@ public class DomainResourceHelper {
 
         final CollectionFacet collectionFacet = returnedAdapter.getSpecification().getFacet(CollectionFacet.class);
         if (collectionFacet != null) {
-            representation = representationWithSelfFor(objectAdapter, action, arguments);
+            representation = representationWithSelfFor(RepresentationType.LIST, objectAdapter, action, arguments);
             
             final Collection<ObjectAdapter> collectionAdapters = collectionFacet
                     .collection(returnedAdapter);
@@ -257,8 +257,7 @@ public class DomainResourceHelper {
         
         final EncodableFacet encodableFacet = returnedAdapter.getSpecification().getFacet(EncodableFacet.class);
         if(encodableFacet != null) {
-            
-            representation = representationWithSelfFor(objectAdapter, action, arguments);
+            representation = representationWithSelfFor(RepresentationType.SCALAR_VALUE, objectAdapter, action, arguments);
             
             final RendererFactory factory = rendererFactoryRegistry.find(RepresentationType.SCALAR_VALUE);
 
@@ -267,7 +266,6 @@ public class DomainResourceHelper {
             return ResourceAbstract.responseOfOk(renderer, Caching.NONE).build();
         }
 
-        
         final RendererFactory factory = rendererFactoryRegistry.find(RepresentationType.DOMAIN_OBJECT);
         representation = JsonRepresentation.newMap();
         final DomainObjectReprRenderer renderer = (DomainObjectReprRenderer) factory.newRenderer(resourceContext, null, representation);
@@ -283,33 +281,19 @@ public class DomainResourceHelper {
     }
 
 
-
-    private JsonRepresentation representationWithSelfFor(final ObjectAdapter objectAdapter, final ObjectAction action, final String queryArgs) {
-        JsonRepresentation representationWithSelf = representationWithSelfFor(objectAdapter, action);
-        final String href = representationWithSelf.getString("self.href");
-        representationWithSelf.mapPut("self.href", href + "?" + queryArgs);
-        return representationWithSelf;
-    }
-
-    private JsonRepresentation representationWithSelfFor(final ObjectAdapter objectAdapter, final ObjectAction action, final JsonRepresentation bodyArgs) {
-        JsonRepresentation representationWithSelf = representationWithSelfFor(objectAdapter, action);
-        final LinkRepresentation selfLink = representationWithSelf.getLink("self");
-        selfLink.mapPut("args", bodyArgs);
-        return representationWithSelf;
-    }
-    
-    private JsonRepresentation representationWithSelfFor(final ObjectAdapter objectAdapter, final ObjectAction action) {
+    private JsonRepresentation representationWithSelfFor(final RepresentationType representationType, final ObjectAdapter objectAdapter, final ObjectAction action, final JsonRepresentation bodyArgs) {
         JsonRepresentation representation = JsonRepresentation.newMap();
+        final JsonRepresentation links = JsonRepresentation.newArray();
+        representation.mapPut("links", links);
+        
         String oid = OidUtils.getOidStr(resourceContext, objectAdapter);
-        // TODO: review; can't be more specific with the media type because we don't have a media type for action/invoke
-        final JsonRepresentation repBuilder = 
-                LinkBuilder.newBuilder(resourceContext, Rel.SELF, MediaType.APPLICATION_JSON_TYPE, "objects/%s/actions/%s/invoke", oid, action.getId()).build();
-        representation.mapPut("self", repBuilder);
+        final JsonRepresentation selfLink = 
+                LinkBuilder.newBuilder(resourceContext, Rel.SELF, representationType.getMediaType(), "objects/%s/actions/%s/invoke", oid, action.getId()).build();
+        links.arrayAdd(selfLink);
+        selfLink.mapPut("args", bodyArgs);
         return representation;
     }
 
-
-
     
     /**
      * 

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainServiceLinkTo.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainServiceLinkTo.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainServiceLinkTo.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainServiceLinkTo.java Mon Oct 24 21:05:17 2011
@@ -39,12 +39,12 @@ public class DomainServiceLinkTo extends
     
     @Override
     protected Rel linkRel() {
-        return Rel.SERVICE;
+         return rel!=null?rel:Rel.SERVICE;
     }
     
     @Override
     public LinkBuilder builder() {
-        return super.builder().withKey(serviceId);
+        return super.builder().withId(serviceId);
     }
 
 }
\ No newline at end of file

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainServiceResourceServerside.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainServiceResourceServerside.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainServiceResourceServerside.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainServiceResourceServerside.java Mon Oct 24 21:05:17 2011
@@ -85,6 +85,7 @@ public class DomainServiceResourceServer
                     .includesSelf()
                     .with(serviceAdapter);
         
+
         return responseOfOk(renderer, Caching.ONE_DAY).build();
     }
 

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ListReprRenderer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ListReprRenderer.java?rev=1188379&r1=1188378&r2=1188379&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ListReprRenderer.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/ListReprRenderer.java Mon Oct 24 21:05:17 2011
@@ -64,7 +64,7 @@ public class ListReprRenderer extends Re
 
     public JsonRepresentation render() {
         withObjectAdapters();
-        withExtensions();
+        getExtensions();
 
         return representation;
     }



Mime
View raw message