<%@LANGUAGE="VBSCRIPT"%> <% '===================================================== '| | '| MESSAGE | '| | '===================================================== %> <% Option explicit ' Good idea to set when using redirect Response.Expires = 0 ' always load the page, dont store %> <% '------------ Variable Definition ------------- Dim parMsg, reqParam, ERRlog, ERRlogFULL, AdditionalParams Dim MSG, msgFile, i, parArr, parJustemplate, parLinksON '------------ Constants Declaration ----------- '------------ Variable Init ------------------- parMsg = QStrPar("msg") ' message template reqParam = Session("reqParam") ' parameters passed for processing ERRlog = Session("ERRlog") ' pkgs with errors + error type ERRlogFULL = Session("ERRlogFULL") ' full list of submitted packages AdditionalParams = Session("AdditionalParams") ' additional parameters populating message template parJustemplate = QStrPar("justemplate") parLinksON = QStrPar("linksON") '---------------------------------------------- %> <% Function Format_ERRlog( SSerrLog, SSerrFull ) ' SSerrLog = "|pkgn,pkgv,errtype||pkgn,pkgv,errtype||pkgn,pkgv,errtype|" ' SSerrFull = "|pkgn,pkgv||pkgn,pkgv|" contains all submitted items Dim errDetSTR, errlistARR, fullARR, pkgpair, pkgdetailsARR, errDetARR, errItem, errTypesUsed Dim item, i, tempARR, tmpStr, errcolumnsARR, columnDrawn, mypkgname, mypkgversion Set errTypesUsed = CreateObject("Scripting.Dictionary") errlistARR = SplitPipes( SSerrLog ) 'split |pkgn,pkgv,errtype||pkgn,pkgv,errtype| fullARR = SplitPipes( SSerrFull ) 'split |pkgpair1||pkgpair2| errDetSTR = "" errDetSTR = errDetSTR & "" '==== Error Column Names ================ For Each item In errlistARR tempARR = Split (item, ",") 'split pkgn,pkgv,errtype If NOT errTypesUsed.Exists (tempARR(2)) Then errTypesUsed.ADD Cstr(tempARR(2)),"" Next errcolumnsARR = errTypesUsed.Keys Set errTypesUsed = nothing ' draw error columns errDetSTR = errDetSTR & "" For Each item In errcolumnsARR errDetSTR = errDetSTR & "" Next errDetSTR = errDetSTR & "" '==== Error Details ===================== For Each pkgpair In fullARR pkgdetailsARR = Split(pkgpair, ",") 'split pkg_name,pkg_version errItem = Filter(errlistARR, pkgdetailsARR(0) &",", True) errItem = Join(errItem, ",") mypkgname = pkgdetailsARR(0) mypkgversion = pkgdetailsARR(1) If errItem <> "" Then 'error FOUND for pkg_name errDetARR = Split(errItem, ",") 'split pkgn,pkgv,errtype errDetSTR = errDetSTR &_ ""&_ ""&_ "" 'run through all error types if multiple pkgs found columnDrawn = FALSE For Each item In errcolumnsARR For i = 0 To UBound(errDetARR) Step 3 If item = errDetARR(i+2) Then If (parLinksON <> "") AND (item = 4) Then errDetSTR = errDetSTR & "" Else errDetSTR = errDetSTR & "" End If columnDrawn = TRUE Exit For End If Next If NOT columnDrawn Then errDetSTR = errDetSTR & "" columnDrawn = FALSE Next errDetSTR = errDetSTR & "" Else 'error NOT FOUND for pkg_name errDetSTR = errDetSTR &_ ""&_ ""&_ "" For Each item In errcolumnsARR errDetSTR = errDetSTR & "" Next errDetSTR = errDetSTR & "" End If errItem = "" 'clean errItem Next errDetSTR = errDetSTR & "
"& Error_Details ( item ) &"
"& mypkgname &""& mypkgversion &""&_ "xx 
"& mypkgname &""& mypkgversion &" 
" Format_ERRlog = errDetSTR End Function Function Format_reqParam( SSreqParam ) ' SSreqParam = "|parname=parvalue||parname=parvalue|" Dim errReqSTR, reqParamARR, tempARR, item '==== Required Parameters =============== errReqSTR = "" reqParamARR = SplitAmpasans( SSreqParam ) 'split &par=value&&par=value& For Each item In reqParamARR tempARR = Split(item, "=") 'split par=value errReqSTR = errReqSTR & "" & VBNewLine Next Format_reqParam = errReqSTR End Function Private Function Error_Details ( NNerrnum ) Dim errorType Set errorType = CreateObject("Scripting.Dictionary") '--- load error definition ------------------ errorType.ADD "1","VERSION NOT FOUND" errorType.ADD "2","VERSION EXISTS" errorType.ADD "3","DUPLICATE PACKAGE NAME" errorType.ADD "4","CIRCULAR DEPENDENCY" errorType.ADD "5","EXISTS IN THIS RELEASE" 'this must match descriptions in images/_help_tips.js e.g. errorType 1 has decsription err1 '-------------------------------------------- Error_Details = errorType.Item (Cstr( NNerrnum )) End Function %> <% '----------------------- MAIN LINE --------------------------- 'Read the message template MSG = ReadFile( rootPath &"messages\"& parMsg &".html" ) '== $TABLE$ parameter ================ If ERRlog <> "" Then MSG = Replace( MSG, "$TABLE$", Format_ERRlog( ERRlog, ERRlogFULL) ) End If '== $HIDDEN$ ========================= If reqParam <> "" Then MSG = Replace( MSG, "$HIDDEN$", Format_reqParam( reqParam ) ) End If '== AdditionalParams ================= If AdditionalParams <> "" Then parArr = Split(AdditionalParams, ",") For i = 0 To UBound(parArr) Step 2 MSG = Replace( MSG, parArr(i), parArr(i+1) ) Next End If '== Query String parameter =========== MSG = Replace( MSG, "$QSTR$", QSTR_All ) '== Clean the session variables ====== Session("reqParam") = "" Session("ERRlog") = "" Session("ERRlogFULL") = "" Session("AdditionalParams") = "" %> <%If parJustemplate <> "" Then%> <%Response.write MSG%> <%Else%> Release Manager
   
 
 
 
<%Response.Write MSG%>  
<% Call Destroy_All_Objects %> <%End If%>