incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1198645 [2/2] - in /incubator/isis/trunk/framework: applib/src/main/java/org/apache/isis/applib/annotation/ core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/annotation/ core/progmodel/src/test/java/org/apache...
Date Mon, 07 Nov 2011 08:29:01 GMT
Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypeResourceServerside.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/domaintypes/DomainTypeResourceServerside.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypeResourceServerside.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypeResourceServerside.java
Mon Nov  7 08:28:59 2011
@@ -24,6 +24,7 @@ import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
@@ -37,10 +38,13 @@ 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.blocks.LinkRepresentation;
 import org.apache.isis.viewer.json.applib.domaintypes.DomainTypeResource;
 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;
+import org.apache.isis.viewer.json.viewer.resources.domainobjects.QueryStringUtil;
+import org.apache.isis.viewer.json.viewer.util.UrlParserUtils;
 
 /**
  * Implementation note: it seems to be necessary to annotate the implementation with {@link
Path} rather than the
@@ -73,6 +77,7 @@ public class DomainTypeResourceServersid
     @Path("/{domainType}")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_DOMAIN_TYPE
})
     public Response domainType(@PathParam("domainType") final String domainType){
+
         RepresentationType representationType = RepresentationType.DOMAIN_TYPE;
         init(representationType);
 
@@ -89,6 +94,38 @@ public class DomainTypeResourceServersid
     }
 
     @GET
+    @Path("/{domainType}/typeactions/isSubtypeOf/invoke")
+    @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_DOMAIN_TYPE
})
+    public Response domainTypeIsSubtypeOf(
+        @PathParam("domainType") String domainType, 
+        @QueryParam("args") final String argumentsQueryString) {
+        
+        RepresentationType representationType = RepresentationType.DOMAIN_TYPE_IS_SUBTYPE_OF;
+        init();
+
+        JsonRepresentation arguments = QueryStringUtil.parseQueryString(argumentsQueryString,
"Type action", "isSubtypeOf");
+
+        if(!arguments.isLink("supertype")) {
+            throw JsonApplicationException.create(HttpStatusCode.BAD_REQUEST, "Args should
contain a link '%s'", "supertype");
+        }
+        final LinkRepresentation supertypeLink = arguments.getLink("supertype");
+        final String supertypeFullName = UrlParserUtils.domainTypeFromLink(supertypeLink);
+        
+        final ObjectSpecification domainTypeSpec = getSpecificationLoader().loadSpecification(domainType);
+        final ObjectSpecification supertypeSpec = getSpecificationLoader().loadSpecification(supertypeFullName);
+
+        final RendererFactory rendererFactory = 
+                rendererFactoryRegistry.find(representationType);
+
+        final DomainTypeIsSubtypeOfReprRenderer renderer = 
+                (DomainTypeIsSubtypeOfReprRenderer) rendererFactory.newRenderer(getResourceContext(),
null, JsonRepresentation.newMap());
+        final ObjectSpecAndSuperSpec objectSpecAndSuperSpec = new ObjectSpecAndSuperSpec(domainTypeSpec,
supertypeSpec);
+        renderer.with(objectSpecAndSuperSpec).includesSelf();
+
+        return responseOfOk(renderer, Caching.ONE_DAY).build();
+    }
+
+    @GET
     @Path("/{domainType}/properties/{propertyId}")
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_TYPE_PROPERTY
})
     public Response typeProperty(
@@ -212,4 +249,6 @@ public class DomainTypeResourceServersid
         return responseOfOk(renderer, Caching.ONE_DAY).build();
     }
 
+
+
 }
\ 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/domaintypes/DomainTypesReprRenderer.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/domaintypes/DomainTypesReprRenderer.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypesReprRenderer.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/DomainTypesReprRenderer.java
Mon Nov  7 08:28:59 2011
@@ -18,18 +18,18 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.domaintypes;
 
-import java.util.Collection;
-
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-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.Rel;
-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 java.util.Collection;
+
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+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.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.ReprRenderer;
+import org.apache.isis.viewer.json.viewer.representations.ReprRendererAbstract;
+import org.apache.isis.viewer.json.viewer.representations.ReprRendererFactoryAbstract;
 
 public class DomainTypesReprRenderer extends ReprRendererAbstract<DomainTypesReprRenderer,
Collection<ObjectSpecification>> {
 

Added: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ObjectSpecAndSuperSpec.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/domaintypes/ObjectSpecAndSuperSpec.java?rev=1198645&view=auto
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ObjectSpecAndSuperSpec.java
(added)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ObjectSpecAndSuperSpec.java
Mon Nov  7 08:28:59 2011
@@ -0,0 +1,41 @@
+/*
+ *  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.viewer.resources.domaintypes;
+
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+
+public class ObjectSpecAndSuperSpec  {
+    
+    private final ObjectSpecification objectSpecification;
+    private final ObjectSpecification superSpecification;
+
+    public ObjectSpecAndSuperSpec(ObjectSpecification objectSpecification, ObjectSpecification
superSpecification) {
+        this.objectSpecification = objectSpecification;
+        this.superSpecification = superSpecification;
+    }
+    
+    public ObjectSpecification getObjectSpecification() {
+        return objectSpecification;
+    }
+    
+    public ObjectSpecification getSuperSpecification() {
+        return superSpecification;
+    }
+    
+}
\ 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/domaintypes/ParentSpecAndAction.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/domaintypes/ParentSpecAndAction.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndAction.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndAction.java
Mon Nov  7 08:28:59 2011
@@ -18,8 +18,8 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.domaintypes;
 
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 
 public class ParentSpecAndAction extends ParentSpecAndFeature<ObjectAction> {
     

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndActionParam.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/domaintypes/ParentSpecAndActionParam.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndActionParam.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndActionParam.java
Mon Nov  7 08:28:59 2011
@@ -18,8 +18,8 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.domaintypes;
 
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
 
 public class ParentSpecAndActionParam extends ParentSpecAndFeature<ObjectActionParameter>
{
     

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndCollection.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/domaintypes/ParentSpecAndCollection.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndCollection.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndCollection.java
Mon Nov  7 08:28:59 2011
@@ -18,8 +18,8 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.domaintypes;
 
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
 
 public class ParentSpecAndCollection extends ParentSpecAndFeature<OneToManyAssociation>
{
     

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndFeature.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/domaintypes/ParentSpecAndFeature.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndFeature.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndFeature.java
Mon Nov  7 08:28:59 2011
@@ -18,8 +18,8 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.domaintypes;
 
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.ObjectFeature;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.ObjectFeature;
 
 public abstract class ParentSpecAndFeature<T extends ObjectFeature> {
     

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndProperty.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/domaintypes/ParentSpecAndProperty.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndProperty.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/ParentSpecAndProperty.java
Mon Nov  7 08:28:59 2011
@@ -18,8 +18,8 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.domaintypes;
 
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
 
 public class ParentSpecAndProperty extends ParentSpecAndFeature<OneToOneAssociation>
{
     

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/TypeActionParamReprRenderer.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/domaintypes/TypeActionParamReprRenderer.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/TypeActionParamReprRenderer.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/TypeActionParamReprRenderer.java
Mon Nov  7 08:28:59 2011
@@ -16,21 +16,18 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.domaintypes;
 
-import org.apache.isis.core.commons.lang.NameUtils;
 import org.apache.isis.core.metamodel.facets.maxlen.MaxLengthFacet;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
-import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
 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.ReprRenderer;
 import org.apache.isis.viewer.json.viewer.representations.ReprRendererFactoryAbstract;
-import org.apache.isis.viewer.json.viewer.resources.domainobjects.MemberType;
 
 public class TypeActionParamReprRenderer extends AbstractTypeFeatureReprRenderer<TypeActionParamReprRenderer,
ObjectActionParameter> {
 

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/TypeCollectionReprRenderer.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/domaintypes/TypeCollectionReprRenderer.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/TypeCollectionReprRenderer.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/TypeCollectionReprRenderer.java
Mon Nov  7 08:28:59 2011
@@ -21,8 +21,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.ReprRenderer;
 import org.apache.isis.viewer.json.viewer.representations.ReprRendererFactoryAbstract;

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/TypePropertyReprRenderer.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/domaintypes/TypePropertyReprRenderer.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/TypePropertyReprRenderer.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/domaintypes/TypePropertyReprRenderer.java
Mon Nov  7 08:28:59 2011
@@ -22,8 +22,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.ReprRenderer;
 import org.apache.isis.viewer.json.viewer.representations.ReprRendererFactoryAbstract;

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=1198645&r1=1198644&r2=1198645&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
Mon Nov  7 08:28:59 2011
@@ -18,24 +18,24 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.home;
 
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-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.Rel;
-import org.apache.isis.viewer.json.viewer.representations.RendererFactory;
-import org.apache.isis.viewer.json.viewer.representations.RendererFactoryRegistry;
-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.user.UserReprRenderer;
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+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.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;
+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.user.UserReprRenderer;
 
 public class HomePageReprRenderer extends ReprRendererAbstract<HomePageReprRenderer, Void>
{
 

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/util/MapUtils.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/util/MapUtils.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/util/MapUtils.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/util/MapUtils.java
Mon Nov  7 08:28:59 2011
@@ -18,10 +18,10 @@
  */
 package org.apache.isis.viewer.json.viewer.util;
 
-import java.util.Collections;
-import java.util.Map;
-
-import com.google.common.collect.Maps;
+import java.util.Collections;
+import java.util.Map;
+
+import com.google.common.collect.Maps;
 
 public final class MapUtils {
     

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/util/UrlParserUtils.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/util/UrlParserUtils.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/util/UrlParserUtils.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/util/UrlParserUtils.java
Mon Nov  7 08:28:59 2011
@@ -26,6 +26,7 @@ import org.apache.isis.viewer.json.appli
 public final class UrlParserUtils {
 
     private final static Pattern OBJECT_OID = Pattern.compile(".*objects\\/(.+)");;
+    private final static Pattern DOMAIN_TYPE = Pattern.compile(".*domainTypes\\/([^/]+).*");;
 
 	public final static String oidFromLink(final JsonRepresentation link) {
 		String href = link.getString("href");
@@ -36,4 +37,14 @@ public final class UrlParserUtils {
 		return matcher.group(1);
     }
 
+
+    public final static String domainTypeFromLink(final JsonRepresentation link) {
+        String href = link.getString("href");
+        Matcher matcher = DOMAIN_TYPE.matcher(href);
+        if(!matcher.matches()) {
+            return null;
+        }
+        return matcher.group(1);
+    }
+
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/webapp/PreProcessInterceptorForIsisSession.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/webapp/PreProcessInterceptorForIsisSession.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/webapp/PreProcessInterceptorForIsisSession.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/main/java/org/apache/isis/viewer/json/viewer/webapp/PreProcessInterceptorForIsisSession.java
Mon Nov  7 08:28:59 2011
@@ -18,15 +18,15 @@
  */
 package org.apache.isis.viewer.json.viewer.webapp;
 
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.ext.Provider;
-
-import org.jboss.resteasy.annotations.interception.ServerInterceptor;
-import org.jboss.resteasy.core.ResourceMethod;
-import org.jboss.resteasy.core.ServerResponse;
-import org.jboss.resteasy.spi.Failure;
-import org.jboss.resteasy.spi.HttpRequest;
-import org.jboss.resteasy.spi.interception.PreProcessInterceptor;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.ext.Provider;
+
+import org.jboss.resteasy.annotations.interception.ServerInterceptor;
+import org.jboss.resteasy.core.ResourceMethod;
+import org.jboss.resteasy.core.ServerResponse;
+import org.jboss.resteasy.spi.Failure;
+import org.jboss.resteasy.spi.HttpRequest;
+import org.jboss.resteasy.spi.interception.PreProcessInterceptor;
 
 @Provider
 @ServerInterceptor

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/ResourceContextTest_ensureCompatibleAcceptHeader.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/ResourceContextTest_ensureCompatibleAcceptHeader.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/ResourceContextTest_ensureCompatibleAcceptHeader.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/ResourceContextTest_ensureCompatibleAcceptHeader.java
Mon Nov  7 08:28:59 2011
@@ -18,20 +18,20 @@
  */
 package org.apache.isis.viewer.json.viewer;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-
-import org.apache.isis.viewer.json.applib.RepresentationType;
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.junit.Before;
-import org.junit.Test;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.isis.viewer.json.applib.RepresentationType;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.Before;
+import org.junit.Test;
 
 public class ResourceContextTest_ensureCompatibleAcceptHeader {
 

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/ResourceContextTest_getArg.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/ResourceContextTest_getArg.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/ResourceContextTest_getArg.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/ResourceContextTest_getArg.java
Mon Nov  7 08:28:59 2011
@@ -18,20 +18,20 @@
  */
 package org.apache.isis.viewer.json.viewer;
 
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.isis.viewer.json.applib.RepresentationType;
-import org.apache.isis.viewer.json.applib.RestfulRequest.QueryParameter;
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.jmock.lib.legacy.ClassImposteriser;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.isis.viewer.json.applib.RepresentationType;
+import org.apache.isis.viewer.json.applib.RestfulRequest.QueryParameter;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.jmock.lib.legacy.ClassImposteriser;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class ResourceContextTest_getArg {

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/representations/GraphTest_asGraph.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/representations/GraphTest_asGraph.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/representations/GraphTest_asGraph.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/representations/GraphTest_asGraph.java
Mon Nov  7 08:28:59 2011
@@ -18,15 +18,15 @@
  */
 package org.apache.isis.viewer.json.viewer.representations;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.isis.viewer.json.applib.Parser;
-import org.apache.isis.viewer.json.applib.PathNode;
-import org.junit.Test;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.isis.viewer.json.applib.Parser;
+import org.apache.isis.viewer.json.applib.PathNode;
+import org.junit.Test;
 
 @SuppressWarnings({"rawtypes", "unchecked"})
 public class GraphTest_asGraph {

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/representations/LinkFollowerTest_follow.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/representations/LinkFollowerTest_follow.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/representations/LinkFollowerTest_follow.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/representations/LinkFollowerTest_follow.java
Mon Nov  7 08:28:59 2011
@@ -18,15 +18,15 @@
  */
 package org.apache.isis.viewer.json.viewer.representations;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.Parser;
-import org.junit.Test;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.apache.isis.viewer.json.applib.Parser;
+import org.junit.Test;
 
 public class LinkFollowerTest_follow {
 

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/JsonApplicationExceptionMapperTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/JsonApplicationExceptionMapperTest.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/JsonApplicationExceptionMapperTest.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/JsonApplicationExceptionMapperTest.java
Mon Nov  7 08:28:59 2011
@@ -18,21 +18,21 @@
  */
 package org.apache.isis.viewer.json.viewer.resources;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.hamcrest.Matchers.greaterThan;
-import static org.junit.Assert.assertThat;
-
-import javax.ws.rs.core.Response;
-
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.RestfulResponse.HttpStatusCode;
-import org.apache.isis.viewer.json.applib.util.JsonMapper;
-import org.apache.isis.viewer.json.viewer.JsonApplicationException;
-import org.apache.isis.viewer.json.viewer.JsonApplicationExceptionMapper;
-import org.junit.Before;
-import org.junit.Test;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.Matchers.greaterThan;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.core.Response;
+
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.apache.isis.viewer.json.applib.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.json.applib.util.JsonMapper;
+import org.apache.isis.viewer.json.viewer.JsonApplicationException;
+import org.apache.isis.viewer.json.viewer.JsonApplicationExceptionMapper;
+import org.junit.Before;
+import org.junit.Test;
 
 public class JsonApplicationExceptionMapperTest {
 

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelperTest_readBodyAsMap.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelperTest_readBodyAsMap.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelperTest_readBodyAsMap.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/DomainResourceHelperTest_readBodyAsMap.java
Mon Nov  7 08:28:59 2011
@@ -18,14 +18,12 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.domainobjects;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import javax.ws.rs.WebApplicationException;
-
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.viewer.JsonApplicationException;
-import org.junit.Test;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.apache.isis.viewer.json.viewer.JsonApplicationException;
+import org.junit.Test;
 
 public class DomainResourceHelperTest_readBodyAsMap {
 

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/JsonValueEncoderTest_asAdapter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/JsonValueEncoderTest_asAdapter.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/JsonValueEncoderTest_asAdapter.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/JsonValueEncoderTest_asAdapter.java
Mon Nov  7 08:28:59 2011
@@ -18,31 +18,31 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.domainobjects;
 
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.codehaus.jackson.node.BigIntegerNode;
-import org.codehaus.jackson.node.BooleanNode;
-import org.codehaus.jackson.node.DecimalNode;
-import org.codehaus.jackson.node.DoubleNode;
-import org.codehaus.jackson.node.IntNode;
-import org.codehaus.jackson.node.LongNode;
-import org.codehaus.jackson.node.TextNode;
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.codehaus.jackson.node.BigIntegerNode;
+import org.codehaus.jackson.node.BooleanNode;
+import org.codehaus.jackson.node.DecimalNode;
+import org.codehaus.jackson.node.DoubleNode;
+import org.codehaus.jackson.node.IntNode;
+import org.codehaus.jackson.node.LongNode;
+import org.codehaus.jackson.node.TextNode;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class JsonValueEncoderTest_asAdapter {

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/JsonValueEncoderTest_asObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/JsonValueEncoderTest_asObject.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/JsonValueEncoderTest_asObject.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/resources/domainobjects/JsonValueEncoderTest_asObject.java
Mon Nov  7 08:28:59 2011
@@ -18,24 +18,24 @@
  */
 package org.apache.isis.viewer.json.viewer.resources.domainobjects;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class JsonValueEncoderTest_asObject {

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/util/MapUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/util/MapUtilsTest.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/util/MapUtilsTest.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/util/MapUtilsTest.java
Mon Nov  7 08:28:59 2011
@@ -17,12 +17,12 @@
  *  under the License.
  */
 package org.apache.isis.viewer.json.viewer.util;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.Map;
-
-import org.junit.Test;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.Map;
+
+import org.junit.Test;
 
 
 public class MapUtilsTest {

Modified: incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/util/UrlParserUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/util/UrlParserUtilsTest.java?rev=1198645&r1=1198644&r2=1198645&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/util/UrlParserUtilsTest.java
(original)
+++ incubator/isis/trunk/framework/viewer/json/json-viewer/src/test/java/org/apache/isis/viewer/json/viewer/util/UrlParserUtilsTest.java
Mon Nov  7 08:28:59 2011
@@ -16,21 +16,45 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.viewer.util;
-import static org.junit.Assert.assertEquals;
-
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.junit.Test;
-
-
-public class UrlParserUtilsTest {
-
-	@Test
-	public void test() throws Exception {
-	    JsonRepresentation link = JsonRepresentation.newMap();
-		link.mapPut("href", "http://localhost/objects/OID:1");
-		String oidFromHref = UrlParserUtils.oidFromLink(link);
-		assertEquals("OID:1", oidFromHref);
-	}
-
-}
+package org.apache.isis.viewer.json.viewer.util;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
+import org.junit.Test;
+
+public class UrlParserUtilsTest {
+
+    @Test
+    public void oidFromLink() throws Exception {
+        JsonRepresentation link = JsonRepresentation.newMap();
+        link.mapPut("href", "http://localhost/objects/OID:1");
+        String oidFromHref = UrlParserUtils.oidFromLink(link);
+        assertEquals("OID:1", oidFromHref);
+    }
+
+    @Test
+    public void domainTypeFromLink() throws Exception {
+        JsonRepresentation link = JsonRepresentation.newMap();
+        link.mapPut("href", "http://localhost/domainTypes/com.mycompany.myapp.Customer");
+        String oidFromHref = UrlParserUtils.domainTypeFromLink(link);
+        assertEquals("com.mycompany.myapp.Customer", oidFromHref);
+    }
+
+    @Test
+    public void domainTypeFromLinkTrailingSlash() throws Exception {
+        JsonRepresentation link = JsonRepresentation.newMap();
+        link.mapPut("href", "http://localhost/domainTypes/com.mycompany.myapp.Customer/");
+        String oidFromHref = UrlParserUtils.domainTypeFromLink(link);
+        assertEquals("com.mycompany.myapp.Customer", oidFromHref);
+    }
+
+    @Test
+    public void domainTypeFromLinkFollowingStuff() throws Exception {
+        JsonRepresentation link = JsonRepresentation.newMap();
+        link.mapPut("href", "http://localhost/domainTypes/com.mycompany.myapp.Customer/otherStuffHere");
+        String oidFromHref = UrlParserUtils.domainTypeFromLink(link);
+        assertEquals("com.mycompany.myapp.Customer", oidFromHref);
+    }
+
+}



Mime
View raw message