Browse Source

Merge remote-tracking branch 'origin/closedown-4.2.x'

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 11 years ago
parent
commit
6054a286ae

+ 3 - 1
ecl/ecl-bundle/ecl-bundle.cpp

@@ -1281,13 +1281,15 @@ private:
             splitFilename(thisFile->queryFilename(), NULL, NULL, &tail, &tail);
             StringBuffer destname(destdir);
             destname.append(PATHSEPCHAR).append(tail);
+            Owned<IFile> targetFile = createIFile(destname);
             if (thisFile->isDirectory()==foundYes)
             {
+                if (!optDryRun)
+                    targetFile->createDirectory();
                 copyDirectory(thisFile, destname);
             }
             else
             {
-                Owned<IFile> targetFile = createIFile(destname);
                 if (optDryRun || optVerbose)
                     printf("cp %s %s\n", thisFile->queryFilename(), targetFile->queryFilename());
                 if (!optDryRun)

+ 10 - 8
esp/eclwatch/ws_XSLT/wuid.xslt

@@ -749,18 +749,20 @@
                     }
                     function createZAPInfo(wuid, espIP, thorIP, ESPBuildVersion, problemDesciption, history, timingInfo)
                     {
-                        var href = "/WsWorkunits/WUCreateZAPInfo?WUID=" + wuid;
-                        href += "&ESPIPAddress=" + espIP;
+                        document.getElementById("ESPIPAddress").value=espIP;
                         if (thorIP != '')
-                            href += "&ThorIPAddress=" + thorIP;
-                        href += "&BuildVersion=" + ESPBuildVersion;
+                            document.getElementById("ESPIPAddress").value=thorIP;
+                        document.getElementById("BuildVersion").value=ESPBuildVersion;
                         if (problemDesciption != '')
-                            href += "&ProblemDescription=" + problemDesciption;
+                            document.getElementById("ProblemDescription").value=problemDesciption;
                         if (history != '')
-                            href += "&WhatChanged=" + history;
+                            document.getElementById("WhatChanged").value=history;
                         if (timingInfo != '')
-                            href += "&WhereSlow=" + timingInfo;
-                        document.location.href=href;
+                            document.getElementById("WhereSlow").value=timingInfo;
+
+                        document.forms['protect'].action = "/WsWorkunits/WUCreateZAPInfo";
+                        document.forms['protect'].encType="application/x-www-form-urlencoded";
+                        document.forms['protect'].submit();
                     }
                ]]></xsl:text>
           </script>

+ 6 - 0
esp/eclwatch/ws_XSLT/wuidcommon.xslt

@@ -794,6 +794,12 @@
               <input type="hidden" name="DescriptionOrig" value="{Description}"/>
               <input type="hidden" name="ClusterOrig" value="{Cluster}"/>
               <input type="hidden" name="ProtectedOrig" value="{Protected}"/>
+              <input type="hidden" id="ESPIPAddress" name="ESPIPAddress" value=""/>
+              <input type="hidden" id="ThorIPAddress" name="ThorIPAddress" value=""/>
+              <input type="hidden" id="BuildVersion" name="BuildVersion" value=""/>
+              <input type="hidden" id="ProblemDescription" name="ProblemDescription" value=""/>
+              <input type="hidden" id="WhatChanged" name="WhatChanged" value=""/>
+              <input type="hidden" id="WhereSlow" name="WhereSlow" value=""/>
               <input type="button" name="Type" value="Save" class="sbutton" onclick="updateWorkunit('{$wuid}');">
                         <xsl:if test="number(AccessFlag) &lt; 7">
                           <xsl:attribute name="disabled">disabled</xsl:attribute>

+ 3 - 11
esp/files/scripts/WUDetailsWidget.js

@@ -70,7 +70,6 @@ define([
                 OnDemandGrid, Keyboard, Selection, selector, ColumnResizer, DijitRegistry,
                 _TabContainerWidget, ESPWorkunit, ESPRequest, EclSourceWidget, TargetSelectWidget, GraphsWidget, ResultsWidget, SourceFilesWidget, InfoGridWidget, LogsWidget, TimingPageWidget, ECLPlaygroundWidget, VizWidget, WsWorkunits,
                 template) {
-    var uniqueID = 0;
     return declare("WUDetailsWidget", [_TabContainerWidget], {
         templateString: template,
         baseClass: "WUDetailsWidget",
@@ -157,7 +156,7 @@ define([
 
         _onCancelDialog: function (){
             this.zapDialog.hide();
-        }, 
+        },
 
         //  Hitched actions  ---
         _onSave: function (event) {
@@ -210,21 +209,14 @@ define([
                     context.updateInput("BuildVersion", null, response.WUGetZAPInfoResponse.BuildVersion);
                     context.updateInput("ESPIPAddress", null, response.WUGetZAPInfoResponse.ESPIPAddress);
                     context.updateInput("ThorIPAddress", null, response.WUGetZAPInfoResponse.ThorIPAddress);
-                    
+
                     context.buildVersion = response.WUGetZAPInfoResponse.BuildVersion;
                     context.espIPAddress = response.WUGetZAPInfoResponse.ESPIPAddress;
                     context.thorIPAddress = response.WUGetZAPInfoResponse.ThorIPAddress;
-                }                
+                }
             });
         },
 
-        onZapSubmit: function (event) {
-            var frame = iframe.create("ZapDownload" + uniqueID++);
-            var url = ESPRequest.getBaseURL("WsWorkunits") + "/WUCreateZAPInfo?WUID=" + this.wu.Wuid + "&ESPIPAddress=" + this.espIPAddress + "&ThorIPAddress=" + this.thorIPAddress + "&BuildVersion=" + encodeURIComponent(this.buildVersion) + "&ProblemDescription=" + encodeURIComponent(this.zapDescription.value) + "&WhatChanged=" + encodeURIComponent(this.warnHistory.value) + "&WhereSlow=" + encodeURIComponent(this.warnTimings.value);
-            iframe.setSrc(frame, url, true);
-            this.zapDialog.hide();
-        },
-
         //  Implementation  ---
         init: function (params) {
             if (this.inherited(arguments))

+ 7 - 7
esp/files/templates/WUDetailsWidget.html

@@ -109,18 +109,18 @@
         </div>
     </div>
     <div id="${id}ZapDialog" data-dojo-type="dijit.Dialog" title="Zipped Analysis Package">
-        <div id="${id}ZapForm" style="width:400px" data-dojo-type="dijit.form.Form">
+        <form id="${id}ZapForm" action="/WsWorkunits/WUCreateZAPInfo" style="width:400px" method="post" encType="application/x-www-form-urlencoded">
             <div data-dojo-props="cols:2" data-dojo-type="dojox.layout.TableContainer">
-                <input id="${id}ZapWUID" title="WUID:" name="WUID" colspan="2" data-dojo-props="trim: true, readonly: true," data-dojo-type="dijit.form.TextBox" />
+                <input id="${id}ZapWUID" title="WUID:" name="Wuid" colspan="2" data-dojo-props="trim: true, readonly: true," data-dojo-type="dijit.form.TextBox" />
                 <input id="${id}BuildVersion" title="ESP&nbsp;Build&nbsp;Version:" name="BuildVersion" colspan="2" data-dojo-props="trim: true, readonly: true," data-dojo-type="dijit.form.TextBox" />
                 <input id="${id}ESPIPAddress" title="ESP&nbsp;Network&nbsp;Address:" name="ESPIPAddress" colspan="2" data-dojo-props="trim: true, readonly: true," data-dojo-type="dijit.form.TextBox" />
                 <input id="${id}ThorIPAddress" title="Thor&nbsp;Network&nbsp;Address:" name="ThorIPAddress" colspan="2" data-dojo-props="trim: true, readonly: true," data-dojo-type="dijit.form.TextBox" />
-                <input id="${id}ZapDescription" title="Description:" cols="22" colspan="2" data-dojo-type="dijit.form.SimpleTextarea"/>
-                <input id="${id}WarnHistory" title="History:" cols="22" colspan="2" data-dojo-type="dijit.form.SimpleTextarea"/>
-                <input id="${id}WarnTimings" title="Timings:" cols="22" colspan="2" data-dojo-type="dijit.form.SimpleTextarea"/>
+                <input id="${id}ZapDescription" name="ProblemDescription" title="Description:" cols="22" colspan="2" data-dojo-type="dijit.form.SimpleTextarea"/>
+                <input id="${id}WarnHistory" name="WhatChanged" title="History:" cols="22" colspan="2" data-dojo-type="dijit.form.SimpleTextarea"/>
+                <input id="${id}WarnTimings" name="WhereSlow" title="Timings:" cols="22" colspan="2" data-dojo-type="dijit.form.SimpleTextarea"/>
             </div>
-            <button id="${id}onZapSubmit" class="bottomFormButtons" data-dojo-attach-event="onClick:onZapSubmit" data-dojo-type="dijit.form.Button">Apply</button>
+            <button id="${id}onZapSubmit" data-dojo-attach-event="onClick:_onCancelDialog" class="bottomFormButtons" type="submit" data-dojo-type="dijit.form.Button">Apply</button>
             <button class="bottomFormButtons" data-dojo-attach-event="onClick:_onCancelDialog" data-dojo-type="dijit.form.Button">Cancel</button>
-        </div>
+        </form>
     </div>
 </div>

+ 1 - 1
esp/scm/ws_workunits.ecm

@@ -1430,7 +1430,7 @@ ESPresponse [exceptions_inline] WUGetZAPInfoResponse
 
 ESPrequest [nil_remove] WUCreateZAPInfoRequest
 {
-    string WUID;
+    string Wuid;
     string ESPIPAddress;
     string ThorIPAddress;
     string BuildVersion;

+ 6 - 6
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -3959,16 +3959,16 @@ bool CWsWorkunitsEx::onWUCreateZAPInfo(IEspContext &context, IEspWUCreateZAPInfo
         throw MakeStringException(ECLWATCH_CANNOT_COMPRESS_DATA,"The data cannot be compressed.");
 #else
         Owned<IWorkUnitFactory> factory = getWorkUnitFactory(context.querySecManager(), context.queryUser());
-        Owned<IConstWorkUnit> cwu = factory->openWorkUnit(req.getWUID(), false);
+        Owned<IConstWorkUnit> cwu = factory->openWorkUnit(req.getWuid(), false);
         if(!cwu.get())
-            throw MakeStringException(ECLWATCH_CANNOT_OPEN_WORKUNIT, "Cannot open workunit %s.", req.getWUID());
+            throw MakeStringException(ECLWATCH_CANNOT_OPEN_WORKUNIT, "Cannot open workunit %s.", req.getWuid());
 
         //Create output report file
         StringBuffer zipFile;
         StringBuffer userName;
         if (context.queryUser())
             userName.append(context.queryUser()->getName());
-        zipFile.append("ZAPReport_").append(req.getWUID()).append('_').append(userName.str()).append(".zip");
+        zipFile.append("ZAPReport_").append(req.getWuid()).append('_').append(userName.str()).append(".zip");
         SCMStringBuffer temp;
         StringBuffer sb;
         sb.append("Workunit:     ").append(cwu->getWuid(temp)).append("\r\n");
@@ -4018,7 +4018,7 @@ bool CWsWorkunitsEx::onWUCreateZAPInfo(IEspContext &context, IEspWUCreateZAPInfo
 #endif
             StringBuffer fs;
             //add report file to ZIP
-            fs.append("ZAPReport_").append(req.getWUID()).append('_').append(userName.str()).append(".txt");
+            fs.append("ZAPReport_").append(req.getWuid()).append('_').append(userName.str()).append(".txt");
             zipper->addContentToZIP(sb.length(), (void*)sb.str(), (char*)fs.str(), false);
 
             //add ECL query/archive to zip
@@ -4029,7 +4029,7 @@ bool CWsWorkunitsEx::onWUCreateZAPInfo(IEspContext &context, IEspWUCreateZAPInfo
                 query->getQueryText(temp);
                 if (temp.length())
                 {
-                    fs.clear().append("ZAPReport_").append(req.getWUID()).append('_').append(userName.str()).append(".");
+                    fs.clear().append("ZAPReport_").append(req.getWuid()).append('_').append(userName.str()).append(".");
                     fs.append(isArchiveQuery(temp.str()) ? "archive" : "ecl");
                     ecl.append(temp.str());
                     zipper->addContentToZIP(ecl.length(), (void*)ecl.str(), (char*)fs.str(), true);
@@ -4047,7 +4047,7 @@ bool CWsWorkunitsEx::onWUCreateZAPInfo(IEspContext &context, IEspWUCreateZAPInfo
             //Add Workunit XML file
             MemoryBuffer wuXmlMB;
             winfo.getWorkunitXml(NULL, wuXmlMB);
-            fs.clear().append("ZAPReport_").append(req.getWUID()).append('_').append(userName.str()).append(".xml");
+            fs.clear().append("ZAPReport_").append(req.getWuid()).append('_').append(userName.str()).append(".xml");
             zipper->addContentToZIP(wuXmlMB.length(), (void*)wuXmlMB.toByteArray(), (char*)fs.str(), true);
 
             //Write out ZIP file

+ 1 - 1
plugins/proxies/lib_metaphone.ecllib

@@ -17,7 +17,7 @@
 
 /* Proxy plugin definition for (EE-only) dmetaphone library version DMETAPHONE 1.1.05 */
 
-export MetaphoneLib := SERVICE
+export MetaphoneLib := SERVICE : plugin('metaphonelib')
   string DMetaphone1(const string src) : c,pure,entrypoint='mpDMetaphone1';
   string DMetaphone2(const string src) : c,pure,entrypoint='mpDMetaphone2';
   string DMetaphoneBoth(const string src) : c,pure,entrypoint='mpDMetaphoneBoth';

+ 2 - 3
plugins/proxies/lib_saltlib.ecllib

@@ -17,12 +17,11 @@
 
 /* Proxy service header for (EE-only) saltlib plugin version SALTLIB 1.0.04 */
 
-export SaltLib := SERVICE
+export SaltLib := SERVICE : plugin('saltlib')
   boolean UnicodeLocaleWithinEditN(const unicode left, const unicode right, unsigned4 distance,  const varstring localename) : c, pure,entrypoint='ulUnicodeLocaleWithinEditN', hole;
   unsigned4 UnicodeLocaleHyphenMatch(const unicode left, const unicode right, unsigned4 minlen,  const varstring localename) : c, pure,entrypoint='ulUnicodeLocaleHyphenMatch', hole;
   unsigned4 UnicodeHyphenMatch(const unicode left, const unicode right, unsigned4 minlen) : c, pure,entrypoint='ulUnicodeHyphenMatch', hole;
   integer4 UnicodeLocaleMatchBagofwords(const unicode left, const unicode right, const varstring localename, unsigned4 mode, unsigned4 score_mode) : c, pure,entrypoint='ulUnicodeLocaleMatchBagofwords', hole;
   unicode UnicodeLocaleGetRangeOfWords(const unicode text, unsigned4 s_index, unsigned4 e_index, const varstring localename) : c,pure,entrypoint='ulUnicodeLocaleGetRangeOfWords';
   integer4 StringMatchBagofwords(const string left, const string right, unsigned4 mode, unsigned4 score_mode, unsigned fn, unsigned fn_arg1, unsigned fn_arg2) : c, pure,entrypoint='ulStringMatchBagofwords', hole;
-END;
-
+END;

+ 1 - 0
roxie/ccd/ccd.hpp

@@ -460,6 +460,7 @@ extern void saveTopology();
 #define LOGGING_TRACELEVELSET   0x10
 #define LOGGING_CHECKINGHEAP    0x20
 #define LOGGING_FLAGSPRESENT    0x40
+#define LOGGING_WUID            0x80
 
 class LogItem : public CInterface
 {

+ 14 - 8
roxie/ccd/ccdqueue.cpp

@@ -500,15 +500,18 @@ void SlaveContextLogger::set(IRoxieQueryPacket *packet)
                 traceInfo += debugLen + sizeof(unsigned short);
                 traceLength -= debugLen + sizeof(unsigned short);
             }
-            // Passing the wuid via the logging context is a bit of a hack...
-            unsigned wuidLen = 0;
-            while (wuidLen < traceLength)
+            // Passing the wuid via the logging context prefix is a bit of a hack...
+            if (loggingFlags & LOGGING_WUID)
             {
-                if (traceInfo[wuidLen]=='@')
-                    break;
-                wuidLen++;
+                unsigned wuidLen = 0;
+                while (wuidLen < traceLength)
+                {
+                    if (traceInfo[wuidLen]=='@')
+                        break;
+                    wuidLen++;
+                }
+                wuid.set((const char *) traceInfo, wuidLen);
             }
-            wuid.set((const char *) traceInfo, wuidLen);
         }
         channel = header.channel;
         StringBuffer s(traceLength, (const char *) traceInfo);
@@ -1286,8 +1289,11 @@ public:
             }
             catch(...)
             {
-                LOG(MCinternalError, unknownJob, "Unexpected exception in Roxie worker thread");
                 CriticalBlock b(actCrit);
+                Owned<IException> E = MakeStringException(ROXIE_INTERNAL_ERROR, "Unexpected exception in Roxie worker thread");
+                EXCLOG(E);
+                if (packet)
+                    throwRemoteException(E.getClear(), NULL, packet, false);
                 packet.clear();
             }
         }

+ 2 - 0
roxie/ccd/ccdserver.cpp

@@ -3411,6 +3411,8 @@ private:
                     loggingFlags |= LOGGING_BLIND;
                 if (ctx->queryCheckingHeap())
                     loggingFlags |= LOGGING_CHECKINGHEAP;
+                if (ctx->queryWorkUnit())
+                    loggingFlags |= LOGGING_WUID;
                 if (debugContext)
                 {
                     loggingFlags |= LOGGING_DEBUGGERACTIVE;