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 2021/04/17 15:46:16 UTC

[isis] 01/02: ISIS-2484: adds some sketchy notes on jaxrsclient and restclient

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

danhaywood pushed a commit to branch 2.0.0-M5
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 6975c7d76f87a7034b2510f4b0017c377e238c66
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Apr 16 11:23:59 2021 +0100

    ISIS-2484: adds some sketchy notes on jaxrsclient and restclient
---
 mappings/jaxrsclient/adoc/modules/jaxrsclient/pages/about.adoc    | 8 +++++++-
 .../extensions/jaxrsclient/impl/client/JaxRsClientDefault.java    | 7 +++++--
 mappings/restclient/adoc/modules/restclient/pages/about.adoc      | 5 ++++-
 .../java/org/apache/isis/extensions/restclient/RestfulClient.java | 5 +++++
 4 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/mappings/jaxrsclient/adoc/modules/jaxrsclient/pages/about.adoc b/mappings/jaxrsclient/adoc/modules/jaxrsclient/pages/about.adoc
index 4c58125..891ea36 100644
--- a/mappings/jaxrsclient/adoc/modules/jaxrsclient/pages/about.adoc
+++ b/mappings/jaxrsclient/adoc/modules/jaxrsclient/pages/about.adoc
@@ -2,4 +2,10 @@
 
 :Notice: 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 ag [...]
 
-WARNING: TODO
+
+Consider the use case where an Apache Isis app emits "thin" events to an ESB, for example using the xref:mappings:outbox-publisher:about.adoc[Outbox Publisher].
+The ESB then queries back to the Apache Isis app to get extra info in a canonical DTO form in order to continue processing.
+
+TIP: for more on this use case, try searching on "link:https://www.google.com/search?q=fat+vs+thin+events[fat vs thin events]".
+
+This library, then, provides a bit of code to construct the correct `Accept-Type` headers, in a format that is then interpreted by an application-specific implementation of xref:refguide:applib:index/services/conmap/ContentMappingService.adoc[ContentMappingService].
diff --git a/mappings/jaxrsclient/impl/src/main/java/org/apache/isis/extensions/jaxrsclient/impl/client/JaxRsClientDefault.java b/mappings/jaxrsclient/impl/src/main/java/org/apache/isis/extensions/jaxrsclient/impl/client/JaxRsClientDefault.java
index 548dee1..1c41e67 100644
--- a/mappings/jaxrsclient/impl/src/main/java/org/apache/isis/extensions/jaxrsclient/impl/client/JaxRsClientDefault.java
+++ b/mappings/jaxrsclient/impl/src/main/java/org/apache/isis/extensions/jaxrsclient/impl/client/JaxRsClientDefault.java
@@ -108,6 +108,9 @@ public class JaxRsClientDefault implements JaxRsClient {
     /**
      * Optional hook, eg allow timeouts to be set:
      *
+     * <p>
+     *     for example:
+     * </p>
      * <pre>
      *  HTTPConduit conduit = WebClient.getConfig(webTarget).getHttpConduit();
      *  conduit.getClient().setConnectionTimeout(1000 * 3);
@@ -123,12 +126,12 @@ public class JaxRsClientDefault implements JaxRsClient {
     }
 
     private MediaType mediaTypeFor(final Class<?> dtoClass, final String reprType) {
-        
+
      // application/xml;profile="urn~org.restfulobjects~repr-types/action-result";x-ro-domain-type="org.apache.isis.schema.cmd.v1.CommandsDto"
         val parameters = new HashMap<String,String>();
         parameters.put("profile", "urn:org.restfulobjects:repr-types/" + reprType);
         parameters.put("x-ro-domain-type", dtoClass.getName());
-        
+
         return new MediaType("application", "xml", parameters);
     }
 
diff --git a/mappings/restclient/adoc/modules/restclient/pages/about.adoc b/mappings/restclient/adoc/modules/restclient/pages/about.adoc
index 845cfc1..7d54c6a 100644
--- a/mappings/restclient/adoc/modules/restclient/pages/about.adoc
+++ b/mappings/restclient/adoc/modules/restclient/pages/about.adoc
@@ -2,4 +2,7 @@
 
 :Notice: 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 ag [...]
 
-WARNING: TODO
+This library is for integration scenario to programmatically invoke the xref:vro::about.adoc[REST API (Restful Objects Viewer)] of an Apache Isis application, using the link:http://restfulobjects.org[restfulobjects protocol].
+
+A common use case would be to consume information from some external system, for example uploading a scanned PDF or a representation of an incoming invoice.
+
diff --git a/mappings/restclient/applib/src/main/java/org/apache/isis/extensions/restclient/RestfulClient.java b/mappings/restclient/applib/src/main/java/org/apache/isis/extensions/restclient/RestfulClient.java
index 4db0af5..3043e0e 100644
--- a/mappings/restclient/applib/src/main/java/org/apache/isis/extensions/restclient/RestfulClient.java
+++ b/mappings/restclient/applib/src/main/java/org/apache/isis/extensions/restclient/RestfulClient.java
@@ -44,6 +44,11 @@ import lombok.extern.log4j.Log4j2;
 
 /**
  * Setup the Restful Client with Basic-Auth:
+ *
+ * <p>
+ *     For example:
+ * </p>
+ *
  * <blockquote><pre>
 RestfulClientConfig clientConfig = new RestfulClientConfig();
 clientConfig.setRestfulBase("http://localhost:8080/helloworld/restful/");