You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2016/06/29 22:44:28 UTC

[30/48] cxf git commit: Updating the services list formatters to drop SOAP or REST text if no relevant endpoints exist

Updating the services list formatters to drop SOAP or REST text if no relevant endpoints exist


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6ba5249f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6ba5249f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6ba5249f

Branch: refs/heads/master-jaxrs-2.1
Commit: 6ba5249f2e42bf5e95652cd580556acbf6fb4fd9
Parents: 0eafb7f
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Mon Jun 27 12:03:08 2016 +0100
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Mon Jun 27 12:03:08 2016 +0100

----------------------------------------------------------------------
 .../servlet/servicelist/FormattedServiceListWriter.java   |  8 ++++++--
 .../servlet/servicelist/UnformattedServiceListWriter.java | 10 +++++++---
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6ba5249f/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
index c26b43f..7903f86 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
@@ -62,8 +62,12 @@ public class FormattedServiceListWriter implements ServiceListWriter {
         writer.write("</head><body>");
 
         if (soapDestinations.length > 0 || restDestinations.length > 0) {
-            writeSOAPEndpoints(writer, basePath, soapDestinations);
-            writeRESTfulEndpoints(writer, basePath, restDestinations);
+            if (soapDestinations.length > 0) {
+                writeSOAPEndpoints(writer, basePath, soapDestinations);
+            }
+            if (restDestinations.length > 0) {
+                writeRESTfulEndpoints(writer, basePath, restDestinations);
+            }
         } else {
             writer.write("<span class=\"heading\">No services have been found.</span>");
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/6ba5249f/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java
index d5a5e2c..5650c92 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java
@@ -36,12 +36,16 @@ public class UnformattedServiceListWriter implements ServiceListWriter {
     }
 
     public void writeServiceList(PrintWriter writer,
-                                 String baseAddress,
+                                 String basePath,
                                  AbstractDestination[] soapDestinations,
                                  AbstractDestination[] restDestinations) throws IOException {
         if (soapDestinations.length > 0 || restDestinations.length > 0) {
-            writeUnformattedSOAPEndpoints(writer, baseAddress, soapDestinations);
-            writeUnformattedRESTfulEndpoints(writer, baseAddress, restDestinations);
+            if (soapDestinations.length > 0) {
+                writeUnformattedSOAPEndpoints(writer, basePath, soapDestinations);
+            }
+            if (restDestinations.length > 0) {
+                writeUnformattedRESTfulEndpoints(writer, basePath, restDestinations);
+            }
         } else {
             writer.write("No services have been found.");
         }