isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1231664 - in /incubator/isis/trunk/framework/viewer/json: json-applib/src/main/java/org/apache/isis/viewer/json/applib/links/ json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/ json-viewer/src/main/java/or...
Date Sun, 15 Jan 2012 12:57:02 GMT
Author: danhaywood
Date: Sun Jan 15 12:57:02 2012
New Revision: 1231664

URL: http://svn.apache.org/viewvc?rev=1231664&view=rev
Log:
ISIS-109: fixes for json viewer (compatibility with spec)

Removed:
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domain/
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domainservices/
Modified:
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/links/LinkRepresentation.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/ListReprRenderer.java

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/links/LinkRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/links/LinkRepresentation.java?rev=1231664&r1=1231663&r2=1231664&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/links/LinkRepresentation.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/links/LinkRepresentation.java
Sun Jan 15 12:57:02 2012
@@ -65,6 +65,14 @@ public final class LinkRepresentation ex
         return getRepresentation("value");
     }
 
+    public String getTitle() {
+        return getString("title");
+    }
+    public LinkRepresentation withTitle(final String title) {
+        asObjectNode().put("title", title);
+        return this;
+    }
+
     public HttpMethod getHttpMethod() {
         String methodStr = asObjectNode().path("method").getTextValue();
         return HttpMethod.valueOf(methodStr);

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=1231664&r1=1231663&r2=1231664&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
Sun Jan 15 12:57:02 2012
@@ -48,7 +48,9 @@ public class DomainObjectLinkTo implemen
 
     @Override
     public LinkBuilder builder(Rel rel) {
-        return LinkBuilder.newBuilder(resourceContext, relElseDefault(rel), RepresentationType.DOMAIN_OBJECT,
linkRef());
+        final LinkBuilder linkBuilder = LinkBuilder.newBuilder(resourceContext, relElseDefault(rel),
RepresentationType.DOMAIN_OBJECT, linkRef());
+        linkBuilder.withTitle(objectAdapter.titleString());
+        return linkBuilder;
     }
 
     /**

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=1231664&r1=1231663&r2=1231664&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
Sun Jan 15 12:57:02 2012
@@ -76,7 +76,7 @@ public class ListReprRenderer extends Re
     }
 
     public JsonRepresentation render() {
-        addValues();
+        addValue();
         
         addLink(Rel.RETURN_TYPE, returnType);
         addLink(Rel.ELEMENT_TYPE, elementType);
@@ -86,13 +86,13 @@ public class ListReprRenderer extends Re
         return representation;
     }
 
-    private void addValues() {
+    private void addValue() {
         if(objectAdapters == null) {
             return;
         }
         
         JsonRepresentation values = JsonRepresentation.newArray();
-        final LinkFollower linkFollower = getLinkFollower().follow("values");
+        final LinkFollower linkFollower = getLinkFollower().follow("value");
 
         for(ObjectAdapter adapter: objectAdapters) {
             JsonRepresentation linkToObject = linkTo.with(adapter).builder().build();
@@ -106,7 +106,7 @@ public class ListReprRenderer extends Re
                 linkToObject.mapPut("value", domainObject);
             }
         }
-        representation.mapPut("values", values);
+        representation.mapPut("value", values);
     }
 
 



Mime
View raw message