isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1229928 - 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/isis/vi...
Date Wed, 11 Jan 2012 08:24:36 GMT
Author: danhaywood
Date: Wed Jan 11 08:24:35 2012
New Revision: 1229928

URL: http://svn.apache.org/viewvc?rev=1229928&view=rev
Log:
ISIS-109: capabilities resource -> version resource, as per v0.56 of spec

Added:
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionRepresentation.java
      - copied, changed from r1229817, 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/version/VersionResource.java
      - copied, changed from r1229817, incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/CapabilitiesResource.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/VersionResourceTest_accept.java
      - copied, changed from r1229817, incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/CapabilitiesResourceTest_accept.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/version/
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/version/VersionReprRenderer.java
      - copied, changed from r1229817, incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/CapabilitiesReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/version/VersionResourceServerside.java
      - copied, changed from r1229817, incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/CapabilitiesResourceServerside.java
Removed:
    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/capabilities/CapabilitiesResource.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/CapabilitiesResourceTest_accept.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/CapabilitiesReprRenderer.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/CapabilitiesResourceServerside.java
Modified:
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/Rel.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RepresentationType.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulClient.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulMediaType.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulRequest.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/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getMediaType_lookup.java
    incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getName_lookup.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/CapabilitiesResourceTest_representationAndHeaders.java
    incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_representationAndHeaders.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-viewer/src/main/java/org/apache/isis/viewer/json/viewer/JsonApplication.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/RendererFactoryRegistry.java
    incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/home/HomePageReprRenderer.java

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/Rel.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/Rel.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/Rel.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/Rel.java Wed Jan 11 08:24:35 2012
@@ -47,7 +47,7 @@ public enum Rel {
     ACTION_PARAM("actionparam"), 
     RETURN_TYPE("returntype"), 
     ELEMENT_TYPE("elementtype"), 
-    CAPABILITIES("capabilities"), 
+    VERSION("version"), 
     USER("user"),
     SERVICES("services"), 
     TYPES("types"),

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RepresentationType.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RepresentationType.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RepresentationType.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RepresentationType.java Wed Jan 11 08:24:35 2012
@@ -20,7 +20,6 @@ package org.apache.isis.viewer.json.appl
 
 import javax.ws.rs.core.MediaType;
 
-import org.apache.isis.viewer.json.applib.capabilities.CapabilitiesRepresentation;
 import org.apache.isis.viewer.json.applib.domainobjects.ActionResultRepresentation;
 import org.apache.isis.viewer.json.applib.domainobjects.DomainObjectRepresentation;
 import org.apache.isis.viewer.json.applib.domainobjects.ListRepresentation;
@@ -39,12 +38,13 @@ import org.apache.isis.viewer.json.appli
 import org.apache.isis.viewer.json.applib.homepage.HomePageRepresentation;
 import org.apache.isis.viewer.json.applib.user.UserRepresentation;
 import org.apache.isis.viewer.json.applib.util.Enums;
+import org.apache.isis.viewer.json.applib.version.VersionRepresentation;
 
 public enum RepresentationType {
     
     HOME_PAGE(RestfulMediaType.APPLICATION_JSON_HOME_PAGE, HomePageRepresentation.class),
     USER(RestfulMediaType.APPLICATION_JSON_USER, UserRepresentation.class),
-    CAPABILITIES(RestfulMediaType.APPLICATION_JSON_CAPABILITIES, CapabilitiesRepresentation.class),
+    VERSION(RestfulMediaType.APPLICATION_JSON_VERSION, VersionRepresentation.class),
     LIST(RestfulMediaType.APPLICATION_JSON_LIST, ListRepresentation.class),
     SCALAR_VALUE(RestfulMediaType.APPLICATION_JSON_SCALAR_VALUE, ScalarValueRepresentation.class),
     DOMAIN_OBJECT(RestfulMediaType.APPLICATION_JSON_DOMAIN_OBJECT, DomainObjectRepresentation.class),

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulClient.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulClient.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulClient.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulClient.java Wed Jan 11 08:24:35 2012
@@ -25,12 +25,12 @@ import javax.ws.rs.core.Response;
 
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.isis.viewer.json.applib.blocks.LinkRepresentation;
-import org.apache.isis.viewer.json.applib.capabilities.CapabilitiesResource;
 import org.apache.isis.viewer.json.applib.domainobjects.DomainObjectResource;
 import org.apache.isis.viewer.json.applib.domainobjects.DomainServiceResource;
 import org.apache.isis.viewer.json.applib.domaintypes.DomainTypeResource;
 import org.apache.isis.viewer.json.applib.homepage.HomePageResource;
 import org.apache.isis.viewer.json.applib.user.UserResource;
+import org.apache.isis.viewer.json.applib.version.VersionResource;
 import org.jboss.resteasy.client.ClientExecutor;
 import org.jboss.resteasy.client.ClientRequest;
 import org.jboss.resteasy.client.ClientRequestFactory;
@@ -41,7 +41,7 @@ public class RestfulClient {
 
     private final HomePageResource homePageResource;
     private final UserResource userResource;
-    private final CapabilitiesResource capabilitiesResource;
+    private final VersionResource versionResource;
     private final DomainObjectResource domainObjectResource;
     private final DomainServiceResource domainServiceResource;
     private final DomainTypeResource domainTypeResource;
@@ -63,7 +63,7 @@ public class RestfulClient {
         this.domainTypeResource = clientRequestFactory.createProxy(DomainTypeResource.class);
         this.domainServiceResource = clientRequestFactory.createProxy(DomainServiceResource.class);
         this.domainObjectResource = clientRequestFactory.createProxy(DomainObjectResource.class);
-        this.capabilitiesResource = clientRequestFactory.createProxy(CapabilitiesResource.class);
+        this.versionResource = clientRequestFactory.createProxy(VersionResource.class);
     }
 
     
@@ -79,8 +79,8 @@ public class RestfulClient {
         return userResource;
     }
 
-    public CapabilitiesResource getCapabilitiesResource() {
-        return capabilitiesResource;
+    public VersionResource getVersionResource() {
+        return versionResource;
     }
 
     public DomainTypeResource getDomainTypeResource() {

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulMediaType.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulMediaType.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulMediaType.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulMediaType.java Wed Jan 11 08:24:35 2012
@@ -33,7 +33,7 @@ public final class RestfulMediaType {
     
     public final static String APPLICATION_JSON_HOME_PAGE = BASE + "homepage";
     public final static String APPLICATION_JSON_USER = BASE + "user";
-    public final static String APPLICATION_JSON_CAPABILITIES = BASE + "capabilities";
+    public final static String APPLICATION_JSON_VERSION = BASE + "version";
     public final static String APPLICATION_JSON_LIST = BASE + "list";
     public final static String APPLICATION_JSON_SCALAR_VALUE = BASE + "scalarvalue";
     public final static String APPLICATION_JSON_DOMAIN_OBJECT = BASE + "domainobject";

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulRequest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulRequest.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulRequest.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/RestfulRequest.java Wed Jan 11 08:24:35 2012
@@ -182,11 +182,11 @@ public final class RestfulRequest {
         try {
             switch (httpMethod) {
             case GET:
-            case PUT:
+            case DELETE:
                 setQueryArgs();
                 break;
             case POST:
-            case DELETE:
+            case PUT:
                 setBody();
                 break;
             }
@@ -202,7 +202,7 @@ public final class RestfulRequest {
     @SuppressWarnings({"unchecked", "rawtypes"})
     private void setQueryArgs() {
         for (RequestParameter requestParam : args.keySet()) {
-            clientRequest.queryParameter(requestParam.getName(), requestParam.parser.asString(args.get(requestParam)));
+            clientRequest.queryParameter(requestParam.getName(), requestParam.parser.asString(args.get(requestParam)));
         }
     }
 

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=1229928&r1=1229927&r2=1229928&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 Wed Jan 11 08:24:35 2012
@@ -34,8 +34,8 @@ public class HomePageRepresentation exte
     public LinkRepresentation getServices() {
         return getLinkWithRel("services");
     }
-    public LinkRepresentation getCapabilities() {
-        return getLinkWithRel("capabilities");
+    public LinkRepresentation getVersion() {
+        return getLinkWithRel("version");
     }
 
 

Copied: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionRepresentation.java (from r1229817, 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/version/VersionRepresentation.java?p2=incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionRepresentation.java&p1=incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/CapabilitiesRepresentation.java&r1=1229817&r2=1229928&rev=1229928&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/version/VersionRepresentation.java Wed Jan 11 08:24:35 2012
@@ -16,20 +16,20 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib.capabilities;
+package org.apache.isis.viewer.json.applib.version;
 
 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 DomainRepresentation  {
+public class VersionRepresentation extends DomainRepresentation  {
 
-    public CapabilitiesRepresentation(JsonNode jsonNode) {
+    public VersionRepresentation(JsonNode jsonNode) {
         super(jsonNode);
     }
 
-    public JsonRepresentation getCapabilities() {
-        return getMap("capabilities");
+    public JsonRepresentation getVersion() {
+        return getMap("version");
     }
 
 }

Copied: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionResource.java (from r1229817, incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/CapabilitiesResource.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionResource.java?p2=incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionResource.java&p1=incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/CapabilitiesResource.java&r1=1229817&r2=1229928&rev=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/capabilities/CapabilitiesResource.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionResource.java Wed Jan 11 08:24:35 2012
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib.capabilities;
+package org.apache.isis.viewer.json.applib.version;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -27,12 +27,12 @@ import javax.ws.rs.core.Response;
 import org.apache.isis.viewer.json.applib.RestfulMediaType;
 import org.jboss.resteasy.annotations.ClientResponseType;
 
-@Path("/capabilities")
-public interface CapabilitiesResource {
+@Path("/version")
+public interface VersionResource {
 
     @GET
-    @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_CAPABILITIES })
+    @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_VERSION })
     @ClientResponseType(entityType=String.class)
-    public Response capabilities();
+    public Response version();
 
 }
\ No newline at end of file

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getMediaType_lookup.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getMediaType_lookup.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getMediaType_lookup.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getMediaType_lookup.java Wed Jan 11 08:24:35 2012
@@ -50,7 +50,7 @@ public class RepresentationTypeTest_getM
 
     @Test
     public void getMediaTypeProfile() {
-        assertThat(RepresentationType.CAPABILITIES.getMediaTypeWithProfile(), is("urn:org.restfulobjects/capabilities"));
+        assertThat(RepresentationType.VERSION.getMediaTypeWithProfile(), is("urn:org.restfulobjects/version"));
         assertThat(RepresentationType.GENERIC.getMediaTypeWithProfile(), is(nullValue()));
     }
 

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getName_lookup.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getName_lookup.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getName_lookup.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getName_lookup.java Wed Jan 11 08:24:35 2012
@@ -28,7 +28,7 @@ public class RepresentationTypeTest_getN
 
     @Test
     public void selectedValues() {
-        assertThat(RepresentationType.CAPABILITIES.getName(), is("capabilities"));
+        assertThat(RepresentationType.VERSION.getName(), is("version"));
         assertThat(RepresentationType.HOME_PAGE.getName(), is("homePage"));
         assertThat(RepresentationType.ACTION_PARAMETER_DESCRIPTION.getName(), is("actionParameterDescription"));
     }

Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/CapabilitiesResourceTest_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/capabilities/CapabilitiesResourceTest_representationAndHeaders.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/CapabilitiesResourceTest_representationAndHeaders.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/CapabilitiesResourceTest_representationAndHeaders.java Wed Jan 11 08:24:35 2012
@@ -47,8 +47,8 @@ import org.apache.isis.viewer.json.appli
 import org.apache.isis.viewer.json.applib.RestfulResponse.Header;
 import org.apache.isis.viewer.json.applib.RestfulResponse.HttpStatusCode;
 import org.apache.isis.viewer.json.applib.blocks.Method;
-import org.apache.isis.viewer.json.applib.capabilities.CapabilitiesRepresentation;
-import org.apache.isis.viewer.json.applib.capabilities.CapabilitiesResource;
+import org.apache.isis.viewer.json.applib.version.VersionRepresentation;
+import org.apache.isis.viewer.json.applib.version.VersionResource;
 import org.apache.isis.viewer.json.tck.IsisWebServerRule;
 import org.codehaus.jackson.JsonParseException;
 import org.codehaus.jackson.map.JsonMappingException;
@@ -63,36 +63,36 @@ public class CapabilitiesResourceTest_re
     public IsisWebServerRule webServerRule = new IsisWebServerRule();
     
     private RestfulClient client;
-    private CapabilitiesResource resource;
+    private VersionResource resource;
 
     @Before
     public void setUp() throws Exception {
         WebServer webServer = webServerRule.getWebServer();
         client = new RestfulClient(webServer.getBase());
         
-        resource = client.getCapabilitiesResource();
+        resource = client.getVersionResource();
     }
 
     @Test
     public void representation() throws Exception {
         
         // given
-        Response servicesResp = resource.capabilities();
+        Response servicesResp = resource.version();
         
         // when
-        RestfulResponse<CapabilitiesRepresentation> restfulResponse = RestfulResponse.ofT(servicesResp);
+        RestfulResponse<VersionRepresentation> restfulResponse = RestfulResponse.ofT(servicesResp);
         assertThat(restfulResponse.getStatus().getFamily(), is(Family.SUCCESSFUL));
         
         // then
         assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
         
-        CapabilitiesRepresentation repr = restfulResponse.getEntity();
+        VersionRepresentation repr = restfulResponse.getEntity();
         assertThat(repr, is(not(nullValue())));
         assertThat(repr, isMap());
 
         assertThat(repr.getSelf(), isLink().method(Method.GET));
 
-        JsonRepresentation capabilities = repr.getCapabilities();
+        JsonRepresentation capabilities = repr.getVersion();
         assertThat(capabilities, isMap());
         
         assertThat(capabilities.getString("specVersion"), is("0.52"));
@@ -114,17 +114,17 @@ public class CapabilitiesResourceTest_re
     @Test
     public void headers() throws Exception {
         // given
-        Response resp = resource.capabilities();
+        Response resp = resource.version();
         
         // when
-        RestfulResponse<CapabilitiesRepresentation> restfulResponse = RestfulResponse.ofT(resp);
+        RestfulResponse<VersionRepresentation> restfulResponse = RestfulResponse.ofT(resp);
         
         // then
         final MediaType contentType = restfulResponse.getHeader(Header.CONTENT_TYPE);
         assertThat(contentType, hasType("application"));
         assertThat(contentType, hasSubType("json"));
         assertThat(contentType, hasParameter("profile", "urn:org.restfulobjects/capabilities"));
-        assertThat(contentType, is(RepresentationType.CAPABILITIES.getMediaType()));
+        assertThat(contentType, is(RepresentationType.VERSION.getMediaType()));
         
         // then
         final CacheControl cacheControl = restfulResponse.getHeader(Header.CACHE_CONTROL);
@@ -136,15 +136,15 @@ public class CapabilitiesResourceTest_re
     @Test
     public void selfIsFollowable() throws Exception {
         // given
-        CapabilitiesRepresentation repr = givenRepresentation();
+        VersionRepresentation repr = givenRepresentation();
 
         // when, then
         assertThat(repr, isFollowableLinkToSelf(client));
     }
 
 
-    private CapabilitiesRepresentation givenRepresentation() throws JsonParseException, JsonMappingException, IOException {
-        RestfulResponse<CapabilitiesRepresentation> jsonResp = RestfulResponse.ofT(resource.capabilities());
+    private VersionRepresentation givenRepresentation() throws JsonParseException, JsonMappingException, IOException {
+        RestfulResponse<VersionRepresentation> jsonResp = RestfulResponse.ofT(resource.version());
         return jsonResp.getEntity();
     }
 

Copied: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/VersionResourceTest_accept.java (from r1229817, incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/CapabilitiesResourceTest_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/capabilities/VersionResourceTest_accept.java?p2=incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/VersionResourceTest_accept.java&p1=incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/CapabilitiesResourceTest_accept.java&r1=1229817&r2=1229928&rev=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/CapabilitiesResourceTest_accept.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/capabilities/VersionResourceTest_accept.java Wed Jan 11 08:24:35 2012
@@ -18,25 +18,25 @@
  */
 package org.apache.isis.viewer.json.tck.resources.capabilities;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.isis.runtimes.dflt.webserver.WebServer;
+import org.apache.isis.viewer.json.applib.HttpMethod;
+import org.apache.isis.viewer.json.applib.RepresentationType;
+import org.apache.isis.viewer.json.applib.RestfulClient;
+import org.apache.isis.viewer.json.applib.RestfulRequest;
+import org.apache.isis.viewer.json.applib.RestfulResponse;
+import org.apache.isis.viewer.json.applib.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.json.applib.version.VersionRepresentation;
+import org.apache.isis.viewer.json.tck.IsisWebServerRule;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
 
-import javax.ws.rs.core.MediaType;
-
-import org.apache.isis.runtimes.dflt.webserver.WebServer;
-import org.apache.isis.viewer.json.applib.HttpMethod;
-import org.apache.isis.viewer.json.applib.RepresentationType;
-import org.apache.isis.viewer.json.applib.RestfulClient;
-import org.apache.isis.viewer.json.applib.RestfulRequest;
-import org.apache.isis.viewer.json.applib.RestfulResponse;
-import org.apache.isis.viewer.json.applib.RestfulResponse.HttpStatusCode;
-import org.apache.isis.viewer.json.applib.capabilities.CapabilitiesRepresentation;
-import org.apache.isis.viewer.json.tck.IsisWebServerRule;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-public class CapabilitiesResourceTest_accept {
+public class VersionResourceTest_accept {
 
     @Rule
     public IsisWebServerRule webServerRule = new IsisWebServerRule();
@@ -54,7 +54,7 @@ public class CapabilitiesResourceTest_ac
 
         final RestfulRequest request = 
                 client.createRequest(HttpMethod.GET, "capabilities").withHeader(RestfulRequest.Header.ACCEPT, MediaType.APPLICATION_JSON_TYPE);
-        final RestfulResponse<CapabilitiesRepresentation> restfulResponse = request.executeT();
+        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();
 
         assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
     }
@@ -63,8 +63,8 @@ public class CapabilitiesResourceTest_ac
     public void applicationJson_profileCapabilities() throws Exception {
 
         final RestfulRequest request = 
-                client.createRequest(HttpMethod.GET, "capabilities").withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.CAPABILITIES.getMediaType());
-        final RestfulResponse<CapabilitiesRepresentation> restfulResponse = request.executeT();
+                client.createRequest(HttpMethod.GET, "capabilities").withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.VERSION.getMediaType());
+        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();
 
         assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
     }
@@ -73,7 +73,7 @@ public class CapabilitiesResourceTest_ac
     public void applicationJson_invalid() throws Exception {
 
         final RestfulRequest request = client.createRequest(HttpMethod.GET, "/").withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.USER.getMediaType());
-        final RestfulResponse<CapabilitiesRepresentation> restfulResponse = request.executeT();
+        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();
 
         assertThat(restfulResponse.getStatus(), is(HttpStatusCode.NOT_ACCEPTABLE));
     }

Modified: incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_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/home/HomePageResourceTest_representationAndHeaders.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_representationAndHeaders.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_representationAndHeaders.java Wed Jan 11 08:24:35 2012
@@ -92,7 +92,7 @@ public class HomePageResourceTest_repres
         assertThat(repr.getSelf(), isLink(client).method(Method.GET));
         assertThat(repr.getUser(), isLink(client).method(Method.GET));
         assertThat(repr.getServices(), isLink(client).method(Method.GET));
-        assertThat(repr.getCapabilities(), isLink(client).method(Method.GET));
+        assertThat(repr.getVersion(), isLink(client).method(Method.GET));
         
         assertThat(repr.getLinks(), isArray());
         assertThat(repr.getExtensions(), isMap());
@@ -136,7 +136,7 @@ public class HomePageResourceTest_repres
         // when, then
         assertThat(repr.getServices(), isLink(client).returning(HttpStatusCode.OK));
         assertThat(repr.getUser(), isLink(client).returning(HttpStatusCode.OK));
-        assertThat(repr.getCapabilities(), isLink(client).returning(HttpStatusCode.OK));
+        assertThat(repr.getVersion(), isLink(client).returning(HttpStatusCode.OK));
     }
 
     private HomePageRepresentation givenRepresentation() throws JsonParseException, JsonMappingException, IOException {

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=1229928&r1=1229927&r2=1229928&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 Wed Jan 11 08:24:35 2012
@@ -64,7 +64,7 @@ public class HomePageResourceTest_xrofol
         
         // given
         assertThat(repr.getUser().getValue(), is(nullValue()));
-        assertThat(repr.getCapabilities().getValue(), is(nullValue()));
+        assertThat(repr.getVersion().getValue(), is(nullValue()));
         assertThat(repr.getServices().getValue(), is(nullValue()));
     }
 
@@ -74,7 +74,7 @@ public class HomePageResourceTest_xrofol
         repr = whenExecuteAndFollowLinksUsing("/", "links[rel=user],links[rel=services],links[rel=capabilities]");
 
         assertThat(repr.getUser(), is(not(nullValue())));
-        assertThat(repr.getCapabilities(), is(not(nullValue())));
+        assertThat(repr.getVersion(), is(not(nullValue())));
         assertThat(repr.getServices(), is(not(nullValue())));
     }
 

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/JsonApplication.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/JsonApplication.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/JsonApplication.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/JsonApplication.java Wed Jan 11 08:24:35 2012
@@ -18,12 +18,12 @@
  */
 package org.apache.isis.viewer.json.viewer;
 
-import org.apache.isis.viewer.json.viewer.resources.capabilities.CapabilitiesResourceServerside;
 import org.apache.isis.viewer.json.viewer.resources.domainobjects.DomainObjectResourceServerside;
 import org.apache.isis.viewer.json.viewer.resources.domainobjects.DomainServiceResourceServerside;
 import org.apache.isis.viewer.json.viewer.resources.domaintypes.DomainTypeResourceServerside;
 import org.apache.isis.viewer.json.viewer.resources.home.HomePageResourceServerside;
 import org.apache.isis.viewer.json.viewer.resources.user.UserResourceServerside;
+import org.apache.isis.viewer.json.viewer.resources.version.VersionResourceServerside;
 
 public class JsonApplication extends AbstractJaxRsApplication {
 
@@ -35,7 +35,7 @@ public class JsonApplication extends Abs
         addClass(UserResourceServerside.class);
         addClass(DomainObjectResourceServerside.class);
         addClass(DomainServiceResourceServerside.class);
-        addClass(CapabilitiesResourceServerside.class);
+        addClass(VersionResourceServerside.class);
         
         addSingleton(new JsonApplicationExceptionMapper());
         addSingleton(new RuntimeExceptionMapper());

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/RendererFactoryRegistry.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/RendererFactoryRegistry.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/RendererFactoryRegistry.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/representations/RendererFactoryRegistry.java Wed Jan 11 08:24:35 2012
@@ -23,7 +23,6 @@ import java.util.Map;
 import javax.ws.rs.core.MediaType;
 
 import org.apache.isis.viewer.json.applib.RepresentationType;
-import org.apache.isis.viewer.json.viewer.resources.capabilities.CapabilitiesReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.domainobjects.ActionResultReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.domainobjects.DomainObjectReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.domainobjects.ListReprRenderer;
@@ -31,15 +30,16 @@ import org.apache.isis.viewer.json.viewe
 import org.apache.isis.viewer.json.viewer.resources.domainobjects.ObjectCollectionReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.domainobjects.ObjectPropertyReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.domainobjects.ScalarValueReprRenderer;
-import org.apache.isis.viewer.json.viewer.resources.domaintypes.TypeActionResultReprRenderer;
-import org.apache.isis.viewer.json.viewer.resources.domaintypes.DomainTypeReprRenderer;
-import org.apache.isis.viewer.json.viewer.resources.domaintypes.TypeListReprRenderer;
-import org.apache.isis.viewer.json.viewer.resources.domaintypes.ActionParameterDescriptionReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.domaintypes.ActionDescriptionReprRenderer;
+import org.apache.isis.viewer.json.viewer.resources.domaintypes.ActionParameterDescriptionReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.domaintypes.CollectionDescriptionReprRenderer;
+import org.apache.isis.viewer.json.viewer.resources.domaintypes.DomainTypeReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.domaintypes.PropertyDescriptionReprRenderer;
+import org.apache.isis.viewer.json.viewer.resources.domaintypes.TypeActionResultReprRenderer;
+import org.apache.isis.viewer.json.viewer.resources.domaintypes.TypeListReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.home.HomePageReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.user.UserReprRenderer;
+import org.apache.isis.viewer.json.viewer.resources.version.VersionReprRenderer;
 
 import com.google.common.collect.Maps;
 
@@ -57,7 +57,7 @@ public class RendererFactoryRegistry {
     private void registerDefaults() {
         register(new HomePageReprRenderer.Factory());
         register(new UserReprRenderer.Factory());
-        register(new CapabilitiesReprRenderer.Factory());
+        register(new VersionReprRenderer.Factory());
         register(new DomainObjectReprRenderer.Factory());
         register(new ObjectPropertyReprRenderer.Factory());
         register(new ObjectCollectionReprRenderer.Factory());

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/home/HomePageReprRenderer.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/home/HomePageReprRenderer.java?rev=1229928&r1=1229927&r2=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/home/HomePageReprRenderer.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/home/HomePageReprRenderer.java Wed Jan 11 08:24:35 2012
@@ -34,11 +34,11 @@ import org.apache.isis.viewer.json.viewe
 import org.apache.isis.viewer.json.viewer.representations.ReprRenderer;
 import org.apache.isis.viewer.json.viewer.representations.ReprRendererAbstract;
 import org.apache.isis.viewer.json.viewer.representations.ReprRendererFactoryAbstract;
-import org.apache.isis.viewer.json.viewer.resources.capabilities.CapabilitiesReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.domainobjects.DomainServiceLinkTo;
 import org.apache.isis.viewer.json.viewer.resources.domainobjects.ListReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.domaintypes.TypeListReprRenderer;
 import org.apache.isis.viewer.json.viewer.resources.user.UserReprRenderer;
+import org.apache.isis.viewer.json.viewer.resources.version.VersionReprRenderer;
 
 public class HomePageReprRenderer extends ReprRendererAbstract<HomePageReprRenderer, Void> {
 
@@ -72,7 +72,7 @@ public class HomePageReprRenderer extend
 
         addLinkToUser();
         addLinkToServices();
-        addLinkToCapabilities();
+        addLinkToVersion();
         addLinkToDomainTypes();
 
         // inks and extensions
@@ -96,14 +96,14 @@ public class HomePageReprRenderer extend
         getLinks().arrayAdd(link);
     }
 
-    private void addLinkToCapabilities() {
-        final JsonRepresentation link = LinkBuilder.newBuilder(getResourceContext(), Rel.CAPABILITIES, RepresentationType.CAPABILITIES, "capabilities").build();
+    private void addLinkToVersion() {
+        final JsonRepresentation link = LinkBuilder.newBuilder(getResourceContext(), Rel.VERSION, RepresentationType.VERSION, "version").build();
         
-        final LinkFollower linkFollower = getLinkFollower().follow("links[rel=capabilities]");
+        final LinkFollower linkFollower = getLinkFollower().follow("links[rel=version]");
         if(linkFollower.matches(link)) {
 
-            final RendererFactory factory = RendererFactoryRegistry.instance.find(RepresentationType.CAPABILITIES);
-            final CapabilitiesReprRenderer renderer = (CapabilitiesReprRenderer) factory.newRenderer(getResourceContext(), linkFollower, JsonRepresentation.newMap());
+            final RendererFactory factory = RendererFactoryRegistry.instance.find(RepresentationType.VERSION);
+            final VersionReprRenderer renderer = (VersionReprRenderer) factory.newRenderer(getResourceContext(), linkFollower, JsonRepresentation.newMap());
             
             link.mapPut("value", renderer.render());
         }

Copied: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/version/VersionReprRenderer.java (from r1229817, incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/CapabilitiesReprRenderer.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/version/VersionReprRenderer.java?p2=incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/version/VersionReprRenderer.java&p1=incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/CapabilitiesReprRenderer.java&r1=1229817&r2=1229928&rev=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/CapabilitiesReprRenderer.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/version/VersionReprRenderer.java Wed Jan 11 08:24:35 2012
@@ -16,8 +16,11 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.viewer.resources.capabilities;
+package org.apache.isis.viewer.json.viewer.resources.version;
 
+import java.io.IOException;
+import java.nio.charset.Charset;
+
 import org.apache.isis.viewer.json.applib.JsonRepresentation;
 import org.apache.isis.viewer.json.applib.RepresentationType;
 import org.apache.isis.viewer.json.viewer.JsonApplication;
@@ -26,26 +29,30 @@ import org.apache.isis.viewer.json.viewe
 import org.apache.isis.viewer.json.viewer.representations.ReprRenderer;
 import org.apache.isis.viewer.json.viewer.representations.ReprRendererAbstract;
 import org.apache.isis.viewer.json.viewer.representations.ReprRendererFactoryAbstract;
+
+import com.google.common.io.Resources;
 
-public class CapabilitiesReprRenderer extends ReprRendererAbstract<CapabilitiesReprRenderer, Void> {
+public class VersionReprRenderer extends ReprRendererAbstract<VersionReprRenderer, Void> {
 
+    private static final String META_INF_POM_PROPERTIES = "/META-INF/maven/org.apache.isis.viewer/json-viewer/pom.properties";
+
     public static class Factory extends ReprRendererFactoryAbstract {
         public Factory() {
-            super(RepresentationType.CAPABILITIES);
+            super(RepresentationType.VERSION);
         }
 
         @Override
         public ReprRenderer<?, ?> newRenderer(ResourceContext resourceContext, LinkFollower linkFollower, JsonRepresentation representation) {
-            return new CapabilitiesReprRenderer(resourceContext, linkFollower, getRepresentationType(), representation);
+            return new VersionReprRenderer(resourceContext, linkFollower, getRepresentationType(), representation);
         }
     }
     
-    private CapabilitiesReprRenderer(ResourceContext resourceContext, LinkFollower linkFollower, RepresentationType representationType, JsonRepresentation representation) {
+    private VersionReprRenderer(ResourceContext resourceContext, LinkFollower linkFollower, RepresentationType representationType, JsonRepresentation representation) {
         super(resourceContext, linkFollower, representationType, representation);
     }
 
     @Override
-    public CapabilitiesReprRenderer with(Void t) {
+    public VersionReprRenderer with(Void t) {
         return this;
     }
 
@@ -53,31 +60,41 @@ public class CapabilitiesReprRenderer ex
     public JsonRepresentation render() {
 
         if(includesSelf) {
-            withSelf("capabilities/");
+            withSelf("version/");
         }
 
-        putCapabilities();
-        putExtensions();
+        representation.mapPut("specVersion", JsonApplication.SPEC_VERSION);
+        representation.mapPut("implVersion", versionFromManifest());
+        
+        putOptionalCapabilities();
+        putExtensions();
         
-        return representation;
+        return representation;
     }
 
-    private void putCapabilities() {
-        JsonRepresentation capabilities = JsonRepresentation.newMap();
-
-        capabilities.mapPut("specVersion", JsonApplication.SPEC_VERSION);
-        capabilities.mapPut("concurrencyChecking", "no");
-        capabilities.mapPut("transientObjects", "yes");
-        capabilities.mapPut("deleteObjects", "no");
-        capabilities.mapPut("simpleArguments", "no");
-        capabilities.mapPut("partialArguments", "no");
-        capabilities.mapPut("followLinks", "yes");
-        capabilities.mapPut("validateOnly", "no");
-        capabilities.mapPut("pagination", "no");
-        capabilities.mapPut("sorting", "no");
-        capabilities.mapPut("domainModel", "rich");
+    private static String versionFromManifest() {
+        try {
+            return Resources.toString(Resources.getResource(META_INF_POM_PROPERTIES), Charset.defaultCharset());
+        } catch (Exception ex) {
+            return "UNKNOWN";
+        }
+    }
+
+    private void putOptionalCapabilities() {
+        final JsonRepresentation optionalCapabilities = JsonRepresentation.newMap();
+
+        optionalCapabilities.mapPut("concurrencyChecking", "no");
+        optionalCapabilities.mapPut("transientObjects", "yes");
+        optionalCapabilities.mapPut("deleteObjects", "no");
+        optionalCapabilities.mapPut("simpleArguments", "no");
+        optionalCapabilities.mapPut("partialArguments", "no");
+        optionalCapabilities.mapPut("followLinks", "yes");
+        optionalCapabilities.mapPut("validateOnly", "no");
+        optionalCapabilities.mapPut("pagination", "no");
+        optionalCapabilities.mapPut("sorting", "no");
+        optionalCapabilities.mapPut("domainModel", "rich");
 
-        representation.mapPut("capabilities", capabilities);
+        representation.mapPut("optionalCapabilities", optionalCapabilities);
     }
     
     private void putExtensions() {

Copied: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/version/VersionResourceServerside.java (from r1229817, incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/CapabilitiesResourceServerside.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/version/VersionResourceServerside.java?p2=incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/version/VersionResourceServerside.java&p1=incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/CapabilitiesResourceServerside.java&r1=1229817&r2=1229928&rev=1229928&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/capabilities/CapabilitiesResourceServerside.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/version/VersionResourceServerside.java Wed Jan 11 08:24:35 2012
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.viewer.resources.capabilities;
+package org.apache.isis.viewer.json.viewer.resources.version;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -29,7 +29,7 @@ import org.apache.isis.viewer.json.appli
 import org.apache.isis.viewer.json.applib.RepresentationType;
 import org.apache.isis.viewer.json.applib.RestfulMediaType;
 import org.apache.isis.viewer.json.applib.RestfulResponse.HttpStatusCode;
-import org.apache.isis.viewer.json.applib.capabilities.CapabilitiesResource;
+import org.apache.isis.viewer.json.applib.version.VersionResource;
 import org.apache.isis.viewer.json.viewer.JsonApplicationException;
 import org.apache.isis.viewer.json.viewer.representations.RendererFactory;
 import org.apache.isis.viewer.json.viewer.resources.ResourceAbstract;
@@ -38,21 +38,21 @@ import org.apache.isis.viewer.json.viewe
  * Implementation note: it seems to be necessary to annotate the implementation with {@link Path} rather than the
  * interface (at least under RestEasy 1.0.2 and 1.1-RC2).
  */
-@Path("/capabilities")
-public class CapabilitiesResourceServerside extends ResourceAbstract implements CapabilitiesResource {
+@Path("/version")
+public class VersionResourceServerside extends ResourceAbstract implements VersionResource {
 
 
     @GET
-    @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_CAPABILITIES})
-    public Response capabilities() {
-        final RepresentationType representationType = RepresentationType.CAPABILITIES;
+    @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_VERSION})
+    public Response version() {
+        final RepresentationType representationType = RepresentationType.VERSION;
         
         init(representationType);
         fakeRuntimeExceptionIfXFail();
 
         final RendererFactory factory = rendererFactoryRegistry.find(representationType);
-        final CapabilitiesReprRenderer renderer = 
-                (CapabilitiesReprRenderer) factory.newRenderer(getResourceContext(), null, JsonRepresentation.newMap());
+        final VersionReprRenderer renderer = 
+                (VersionReprRenderer) factory.newRenderer(getResourceContext(), null, JsonRepresentation.newMap());
         renderer.includesSelf();
         
         return responseOfOk(renderer, Caching.ONE_DAY).build();



Mime
View raw message