Rev 149 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%'=====================================================' Common Subs for DAEMON INSTRUCTIONS'' NB. Must be included AFTER conf.asp'=====================================================%><%'--------------------------------------------------------------------------------------------' Indicates if the specified daemon instruction is in progress'--------------------------------------------------------------------------------------------Function DaemonInstructionInProgress( nInstId )Dim rsQryDaemonInstructionInProgress = FalseIf NOT IsNull(nInstId) AND nInstId <> "" ThenSet rsQry = OraDatabase.DbCreateDynaset( "SELECT IN_PROGRESS"&_" FROM DAEMON_INSTRUCTIONS "&_" WHERE DAEMON_INSTRUCTIONS_ID = "& nInstId, ORADYN_DEFAULT )If (NOT rsQry.BOF) AND (NOT rsQry.EOF) ThenIf (NOT IsNull(rsQry("IN_PROGRESS"))) AND (rsQry("IN_PROGRESS") = "1") ThenDaemonInstructionInProgress = TrueEnd IfEnd IfrsQry.CloseSet rsQry = nothingEnd IfEnd Function'--------------------------------------------------------------------------------------------' Convert a Daemon Instruction operation code into a meaningful string'--------------------------------------------------------------------------------------------Function DaemonInstructionOperationName(nOpCode)Select Case nOpCodeCase OP_CODE_0_RIPPLE_BUILD_PACKAGEDaemonInstructionOperationName = OP_CODE_0_STR'Case OP_CODE_1_GET_RELEASE_METRICS' DaemonInstructionOperationName = OP_CODE_1_STRCase ElseDaemonInstructionOperationName = "Undefined (" & nOpCode & ")"End SelectEnd Function'--------------------------------------------------------------------------------------------' Convert a Repeat Seconds value into a meaningful string. This takes account of the' daemon instruction op-code too - a repeat seconds value is only relevant for certain' op-codes'--------------------------------------------------------------------------------------------Function DaemonInstructionRepeatString(nOpCode, nRepeatSecs)DaemonInstructionRepeatString = "N/A"' uncomment this when we are ready to introduce the "get release metrics" instruction'Select Case nOpCode'Case OP_CODE_1_GET_RELEASE_METRICS' Select Case nRepeatSecs' Case 86400' DaemonInstructionRepeatString = "24Hrs"' Case Else' DaemonInstructionRepeatString = "NO"' End Select''Case Else' DaemonInstructionRepeatString = "N/A"'End SelectEnd Function'--------------------------------------------------------------------------------------------' Queries the database to get a comma-seperated list of op-codes for a given release, and' converts them into a comma seperated list of operation names for display purposes'--------------------------------------------------------------------------------------------Function GetOpCodeListForRtagId( pretext, nRtag_id, posttext )Dim opCodeListStringDim opCodeListDim opCodeStrGetOpCodeListForRtagId = ""On Error Resume NextobjEH.TryORA ( OraSession )OraDatabase.Parameters.Add "OP_CODE_LIST", NULL, ORAPARM_OUTPUT, ORATYPE_VARCHAR2OraDatabase.ExecuteSQL _"BEGIN :OP_CODE_LIST := PK_BUILDAPI.daemon_ops_for_rtag("& nRtag_id & "); END;"objEH.CatchORA ( OraSession )opCodeListString = OraDatabase.Parameters("OP_CODE_LIST").ValueOraDatabase.Parameters.Remove "OP_CODE_LIST"If NOT IsNull(opCodeListString) AND opCodeListString <> "" ThenopCodeList = Split(opCodeListString, ",")For Each opCodeStr In opCodeListIf NOT IsNull(opCodeStr) AND opCodeStr <> "" ThenGetOpCodeListForRtagId = GetOpCodeListForRtagId + DaemonInstructionOperationName(opCodeStr)End IfNextEnd IfIf GetOpCodeListForRtagId <> "" ThenGetOpCodeListForRtagId = pretext & GetOpCodeListForRtagId + posttextEnd IfEnd Function'--------------------------------------------------------------------------------------------' Queries the database to get a comma-seperated list of op-codes for a given release and package' version, and converts them into a comma seperated list of operation names for display purposes'--------------------------------------------------------------------------------------------Function GetOpCodeListForRtagIdAndPvId( pretext, nRtag_id, nPv_id, posttext )Dim opCodeListStringDim opCodeListDim opCodeStrGetOpCodeListForRtagIdAndPvId = ""On Error Resume NextIf (NOT IsNull(nRtag_id)) AND nRtag_id <> "" ThenobjEH.TryORA ( OraSession )OraDatabase.Parameters.Add "OP_CODE_LIST", NULL, ORAPARM_OUTPUT, ORATYPE_VARCHAR2If (NOT IsNull(nPv_id)) AND nPv_id <> "" ThenOraDatabase.ExecuteSQL _"BEGIN :OP_CODE_LIST := PK_BUILDAPI.daemon_ops_for_rtag_pvid("& nRtag_id & "," & nPv_id & "); END;"ElseOraDatabase.ExecuteSQL _"BEGIN :OP_CODE_LIST := PK_BUILDAPI.daemon_ops_for_rtag("& nRtag_id & "); END;"End IfobjEH.CatchORA ( OraSession )opCodeListString = OraDatabase.Parameters("OP_CODE_LIST").ValueOraDatabase.Parameters.Remove "OP_CODE_LIST"If NOT IsNull(opCodeListString) AND opCodeListString <> "" ThenopCodeList = Split(opCodeListString, ",")For Each opCodeStr In opCodeListIf NOT IsNull(opCodeStr) AND opCodeStr <> "" ThenGetOpCodeListForRtagIdAndPvId = GetOpCodeListForRtagIdAndPvId + DaemonInstructionOperationName(opCodeStr)End IfNextEnd IfEnd IfIf GetOpCodeListForRtagIdAndPvId <> "" ThenGetOpCodeListForRtagIdAndPvId = pretext & GetOpCodeListForRtagIdAndPvId + posttextEnd IfEnd Function'--------------------------------------------------------------------------------------------' Function to inform caller of whether the user is allowed to reset the daemon instructions' in-progress flag'--------------------------------------------------------------------------------------------Function UserAllowedToResetInProgressUserAllowedToResetInProgress = TrueIf objAccessControl.UserLogedIn ThenIf NOT objAccessControl.IsActive("ResetDaemonInstInProgress") ThenUserAllowedToResetInProgress = FalseEnd IfElseUserAllowedToResetInProgress = FalseEnd IfEnd Function%>