%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|
'| wAddDaemonInstructionSimple.asp
'| Either ripple or test-build the current package
'| This window has few options
'|
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<%
'------------ ACCESS CONTROL ------------------
%>
<%
'------------ VARIABLE DEFINITION -------------
Dim sMessage, sMessageType
Dim parPv_id
Dim parOp_code
Dim parRfile
Dim bPreventSubmit
Dim ripplePresent, rippleDisable
Dim testPresent, testDisable, testChecked
'------------ CONSTANTS DECLARATION -----------
'------------ VARIABLE INIT -------------------
sMessage = NULL
sMessageType = 3
bPreventSubmit = False
' collect all parameters from query string
parPv_id = Request("pv_id")
parOp_code = Request("op_code")
parRfile = Request("rfile")
Set objFormCollector = CreateObject("Scripting.Dictionary")
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'------------------------------------------------------------------------------------------------------------------------------------------
' For the specified Release, get a list of all that release's daemon configurations.
' Return True if at least one daemon configuration was found, else False
'------------------------------------------------------------------------------------------------------------------------------------------
Function DaemonsAvailable(NNrtag_id)
Dim rsTemp, Query_String
DaemonsAvailable = True
Query_String = "SELECT * "&_
" FROM release_config rc"&_
" WHERE rc.rtag_id = "& NNrtag_id
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
If rsTemp.RecordCount = 0 Then
DaemonsAvailable = False
End If
rsTemp.Close
Set rsTemp = nothing
End Function
'
' Add a lineof text to the System Message
'
Sub sMessageAdd(text)
If NOT isNull(sMessage) Then
sMessage = sMessage & " "
End If
sMessage = sMessage & text
End Sub
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
' Make sure we dont have any null strings or empty strings for our parameters
If IsNull(parOp_code) OR parOp_code = "" Then
parOp_code = "-1"
End If
If IsNull(parRtag_id) OR parRtag_id = "" Then
parRtag_id = "0"
End If
If IsNull(parRfile) OR parRfile = "" Then
parRfile = "dependencies.asp"
End If
' Check if form submit is happening
If CBool(Request("action")) Then
If CInt(parOp_code) >= 0 Then
Dim RepeatSeconds
Dim ScheduledDateTime
Dim ReleaseMode
Dim sErrorMsg
ReleaseMode = GetReleaseMode(parRtag_id)
If NOT objAccessControl.UserLogedIn Then
sMessage = "User is no longer logged in"
sMessageType = 1
ElseIf NOT UserCanAddOrEditThisDaemonInst(DB_PROJ_ID, ReleaseMode, parOp_code) Then
sMessage = "You have been denied permission to add/update daemon instructions for the specified release."
sMessageType = 1
End If
If isNull(sMessage) Then
' do daemon instruction validation, continuing only if it passes
If ValidateDaemonInstruction(parOp_code, parRtag_id, parPv_id, sErrorMsg) = True Then
RepeatSeconds = 0
ScheduledDateTime = ORA_SYSDATETIME
' We are adding a new record
objEH.TryORA ( OraSession )
On Error Resume Next
OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_
parRtag_id & ", " &_
parPv_id & ", " &_
ScheduledDateTime & ", " &_
CStr(RepeatSeconds) & ", " &_
ORA_SYSDATETIME & ", " &_
objAccessControl.UserId & "); END;"
objEH.CatchORA ( OraSession )
If objEH.Finally Then
Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
Call Destroy_All_Objects
Response.End
End If
Else
sMessage = sErrorMsg
sMessageType = 1
End If
End If
Else
sMessage = "No action selected."
sMessageType = 1
End If
End If
' Prevent editing if build instruction is already present
testPresent = DaemonInstructionPresent(parRtag_id, parPv_id, 1 )
ripplePresent = DaemonInstructionPresent(parRtag_id, parPv_id, 0 )
If ripplePresent Then
rippleDisable = " disabled"
sMessageAdd "Ripple Instruction already present"
End If
If testPresent Then
testDisable = " disabled"
sMessageAdd "Test Instruction already present"
End If
If ripplePresent AND testPresent Then
bPreventSubmit = true
If sMessageType = 3 Then
sMessageType = 2
End If
End If
'----------------------------------------------
%>
This will cause a new package version to be created. All packages that depend on this package will also be rippled.
<%=testDisable%>> Test Build the current package.
No new version will be created, nor will a build ripple be propagated.
This will simply ensure that the current package can be built with the current build machine configuration.
Log files and test results will be available.
<%
Dim disableText : disableText = ""
If NOT (DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit) Then
disableText = "disabled=""disabled"""
End If
%>
<%=objPMod.ComposeHiddenTags()%>
<%
Call objFormComponent.FormEnd()
'-- FROM END ----------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN AFTER PAGE RENDER -----------
Set objFormCollector = Nothing
'----------------------------------------------
Call Destroy_All_Objects
%>