Procházet zdrojové kódy

HPCC-2942 Configmgr - Add custom attributes

- Changes based on feedback
  - Extra error check
  - Fix error message

Signed-off-by: Gleb Aronsky <gleb.aronsky@lexisnexis.com>
Gleb Aronsky před 12 roky
rodič
revize
aadc68aefd

+ 1 - 1
esp/files/scripts/configmgr/configmgr.js

@@ -1842,7 +1842,7 @@ function createEnvXmlView(allrows, compName, subRecordIndex) {
              YAHOO.util.UserAction.click(top.document.rightDT.getFirstTrEl());
            },
           failure: function(o) {
-            alert("Failed to delete attribute.  (XPath maybe ambiguous. A manual edit of the XML configuration file maybe required to delete this attribute.) ");
+            alert("Failed to add attribute.  (XPath maybe ambiguous. A manual edit of the XML configuration file maybe required to add this attribute.) ");
             },
           scope: this
         },

+ 3 - 0
esp/services/WsDeploy/WsDeployService.cpp

@@ -4187,6 +4187,9 @@ bool CWsDeployFileInfo::handleAttributeAdd(IEspContext &context, IEspHandleAttri
   StringBuffer xpath =  pSetting->queryProp(XML_ATTR_PARAMS);
   StringBuffer attribName = pSetting->queryProp(XML_ATTR_ATTRIB);
 
+  if (attribName.length() == 0)
+    throw MakeStringException(-1,"Attribute name can't be empty!");
+
   IPropertyTree* pComp =  pEnvRoot->getPropTree(xpath.str());
 
   if (pComp != NULL)