You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/10/16 12:43:48 UTC

[isis] 23/26: ISIS-1742: deletes the non-applib ContentMappingService

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch dev/2.0.0/ISIS-1742-remove-deprecations
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 3d16cdcf0e16ac0d2f8464c92439280c97649ea6
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Oct 16 13:18:58 2017 +0100

    ISIS-1742: deletes the non-applib ContentMappingService
---
 .../service/conmap/ContentMappingService.java      | 41 ----------------------
 .../ContentNegotiationServiceXRoDomainType.java    | 23 ++++--------
 2 files changed, 6 insertions(+), 58 deletions(-)

diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conmap/ContentMappingService.java b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conmap/ContentMappingService.java
deleted file mode 100644
index 44f6e77..0000000
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conmap/ContentMappingService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *  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.restfulobjects.rendering.service.conmap;
-
-import java.util.List;
-
-import javax.ws.rs.core.MediaType;
-
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
-
-/**
- * @deprecated - replaced by simplified version, {@link org.apache.isis.applib.services.conmap.ContentMappingService}, in the applib.
- */
-@Deprecated
-public interface ContentMappingService {
-
-    /**
-     * @deprecated - replaced by simplified version, {@link org.apache.isis.applib.services.conmap.ContentMappingService#map(Object, List)}, in the applib.
-     */
-    @Deprecated
-    @Programmatic
-    Object map(Object object, final List<MediaType> acceptableMediaTypes, final RepresentationType representationType);
-
-}
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/ContentNegotiationServiceXRoDomainType.java b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/ContentNegotiationServiceXRoDomainType.java
index 25cfd17..2eb5d39 100644
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/ContentNegotiationServiceXRoDomainType.java
+++ b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/service/conneg/ContentNegotiationServiceXRoDomainType.java
@@ -25,13 +25,13 @@ import javax.ws.rs.core.Response;
 
 import org.apache.isis.applib.annotation.DomainService;
 import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.services.conmap.ContentMappingService;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
 import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
 import org.apache.isis.viewer.restfulobjects.rendering.RestfulObjectsApplicationException;
 import org.apache.isis.viewer.restfulobjects.rendering.domainobjects.ObjectAndActionInvocation;
 import org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationService;
-import org.apache.isis.viewer.restfulobjects.rendering.service.conmap.ContentMappingService;
 
 /**
  * Handles content negotiation for accept headers requiring <code>application/json</code> or <code>application/xml</code>and specifying an x-ro-domain-type; will delegate to
@@ -126,7 +126,7 @@ public class ContentNegotiationServiceXRoDomainType extends ContentNegotiationSe
         final String xRoDomainType = mediaType.getParameters().get(X_RO_DOMAIN_TYPE);
         final Class<?> domainType = loadClass(xRoDomainType);
 
-        final Object mappedDomainObject = map(domainObject, acceptableMediaTypes, representationType);
+        final Object mappedDomainObject = map(domainObject, acceptableMediaTypes);
 
         ensureDomainObjectAssignable(xRoDomainType, domainType, mappedDomainObject);
 
@@ -138,34 +138,23 @@ public class ContentNegotiationServiceXRoDomainType extends ContentNegotiationSe
     }
 
     /**
-     * Delegates to either the applib {@link org.apache.isis.applib.services.conmap.ContentMappingService}, else the
-     * original non-applib {@link ContentMappingService}.
+     * Delegates to either the applib {@link ContentMappingService}.
      */
     protected Object map(
             final Object domainObject,
-            final List<MediaType> acceptableMediaTypes,
-            final RepresentationType representationType) {
+            final List<MediaType> acceptableMediaTypes) {
 
-        for (org.apache.isis.applib.services.conmap.ContentMappingService contentMappingService : contentMappingServices) {
+        for (ContentMappingService contentMappingService : contentMappingServices) {
             Object mappedObject = contentMappingService.map(domainObject, acceptableMediaTypes);
             if(mappedObject != null) {
                 return mappedObject;
             }
         }
 
-        for (ContentMappingService contentMappingService : legacyContentMappingServices) {
-            Object mappedObject = contentMappingService.map(domainObject, acceptableMediaTypes, representationType);
-            if(mappedObject != null) {
-                return mappedObject;
-            }
-        }
-
         return domainObject;
     }
 
     @javax.inject.Inject
-    List<org.apache.isis.applib.services.conmap.ContentMappingService> contentMappingServices;
+    List<ContentMappingService> contentMappingServices;
 
-    @javax.inject.Inject
-    List<ContentMappingService> legacyContentMappingServices;
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.