Просмотр исходного кода

HPCC-18142 Unbound DESDL based ESP services should report unbound state

- Add a method to base and DESDL binding classes to indicate
  if the binding is dynamic binding
- Set the isDynamicBinding attribute in navigation data retrieved
- Show "Unbound DESDL Service" when there are no methods and the binding
  is dynamic.

Signed-off-by: mayx <yanrui.ma@lexisnexisrisk.com>
mayx 7 лет назад
Родитель
Сommit
e99ec24ad5

+ 1 - 1
esp/platform/espbinding.hpp

@@ -106,7 +106,7 @@ public:
     virtual bool isValidServiceName(IEspContext & context, const char * name){return false;}
     virtual bool qualifyServiceName(IEspContext & context, const char * servname, const char * methname, StringBuffer & servQName, StringBuffer * methQName){return false;}
     virtual IRpcRequestBinding *createReqBinding(IEspContext &context, IHttpMessage *request, const char *service, const char *method){return NULL;}
-
+    virtual bool isDynamicBinding() const { return false; }
 };
 
 #endif

+ 2 - 0
esp/platform/espprotocol.cpp

@@ -492,6 +492,8 @@ void CEspBinding::getNavigationData(IEspContext &context, IPropertyTree & data)
         if (params.length())
             params.setCharAt(0,'&'); //the entire params string will follow the initial param: "?form"
 
+        folder->addPropBool("@isDynamicBinding", isDynamicBinding());
+
         MethodInfoArray methods;
         wsdl->getQualifiedNames(context, methods);
         ForEachItemIn(idx, methods)

+ 1 - 0
esp/services/esdl_svc_engine/esdl_binding.hpp

@@ -377,6 +377,7 @@ public:
 
     bool usesESDLDefinition(const char * name, int version);
     bool usesESDLDefinition(const char * id);
+    virtual bool isDynamicBinding() const override { return true; }
 
 private:
     int onGetRoxieBuilder(CHttpRequest* request, CHttpResponse* response, const char *serv, const char *method);

+ 19 - 2
esp/xslt/nav.xsl

@@ -112,7 +112,8 @@
                  </xsl:if>      
             </td>
         </tr>
-        <xsl:if test="*">
+        <xsl:choose>
+        <xsl:when test="*">
             <tr>
                 <td>
                     <table border="0" cellspacing="0" cellpadding="0">
@@ -130,7 +131,23 @@
                     </table>
                 </td>
             </tr>
-        </xsl:if>
+        </xsl:when>
+        <xsl:when test="@isDynamicBinding=1">
+            <tr>
+                <td>
+                    <table border="0" cellspacing="0" cellpadding="0">
+                        <xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
+                        <tr>
+                        <td colspan="2">
+                            <xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;</xsl:text>
+                            <font size="-2" color="gray">Unbound DESDL Service</font>
+                        </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </xsl:when>
+        </xsl:choose>
     </xsl:template>
         
     <xsl:template match="Link">