Subversion Repositories DevTools

Rev

Rev 5560 | Rev 5957 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|
5590 dpurdie 5
'|  wAddDaemonInstructionSimple.asp
5560 dpurdie 6
'|      Either ripple or test-build the current package
5357 dpurdie 7
'|      This window has few options
8
'|
9
'=====================================================
10
%>
11
<%
12
Option explicit
13
Response.Expires = 0
14
%>
15
<!--#include file="common/conf.asp"-->
16
<!--#include file="common/globals.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
20
<!--#include file="common/_form_window_common.asp"-->
21
<!--#include file="common/common_dbedit.asp"-->
22
<!--#include file="common/daemon_instructions.asp"-->
23
<%
24
'------------ ACCESS CONTROL ------------------
25
%>
26
<!--#include file="_access_control_general.asp"-->
27
<%
28
'------------ VARIABLE DEFINITION -------------
5560 dpurdie 29
Dim sMessage, sMessageType
5357 dpurdie 30
Dim parPv_id
31
Dim parOp_code
32
Dim parRfile
33
Dim bPreventSubmit
5590 dpurdie 34
Dim ripplePresent, rippleDisable
5357 dpurdie 35
Dim testPresent, testDisable, testChecked
36
 
37
'------------ CONSTANTS DECLARATION -----------
38
 
39
 
40
'------------ VARIABLE INIT -------------------
41
sMessage = NULL
5560 dpurdie 42
sMessageType = 3
5357 dpurdie 43
bPreventSubmit = False
44
 
45
' collect all parameters from query string
46
parPv_id = Request("pv_id")
47
parOp_code = Request("op_code")
48
parRfile = Request("rfile")
49
Set objFormCollector = CreateObject("Scripting.Dictionary")
50
 
51
'------------ CONDITIONS ----------------------
52
'----------------------------------------------
53
%>
54
<%
55
'------------------------------------------------------------------------------------------------------------------------------------------
56
' For the specified Release, get a list of all that release's daemon configurations.
57
' Return True if at least one daemon configuration was found, else False
58
'------------------------------------------------------------------------------------------------------------------------------------------
59
Function DaemonsAvailable(NNrtag_id)
60
   Dim rsTemp, Query_String
61
 
62
   DaemonsAvailable = True
63
   Query_String = "SELECT * "&_
64
                  "  FROM release_config rc"&_
65
                  " WHERE rc.rtag_id = "& NNrtag_id
66
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
67
   If rsTemp.RecordCount = 0 Then
68
      DaemonsAvailable = False
69
   End If
70
 
71
   rsTemp.Close
72
   Set rsTemp = nothing
73
End Function
5560 dpurdie 74
'
75
' Add a lineof text to the System Message
76
'
77
Sub sMessageAdd(text)
78
    If NOT isNull(sMessage) Then
79
        sMessage = sMessage & "<br>"
80
    End If
81
    sMessage = sMessage & text
82
End Sub
5357 dpurdie 83
%>
84
<%
85
'------------ RUN BEFORE PAGE RENDER ----------
86
 
87
' Make sure we dont have any null strings or empty strings for our parameters
88
If IsNull(parOp_code) OR parOp_code = "" Then
89
   parOp_code = "-1"
90
End If
91
If IsNull(parRtag_id) OR parRtag_id = "" Then
92
   parRtag_id = "0"
93
End If
94
If IsNull(parRfile) OR parRfile = "" Then
95
   parRfile = "dependencies.asp"
96
End If
97
 
98
' Check if form submit is happening
99
If CBool(Request("action")) Then
5560 dpurdie 100
    If CInt(parOp_code) >= 0 Then
5357 dpurdie 101
 
102
       Dim RepeatSeconds
103
       Dim ScheduledDateTime
104
       Dim ReleaseMode
105
 
106
       ReleaseMode = GetReleaseMode(parRtag_id)
107
 
5560 dpurdie 108
       If NOT objAccessControl.UserLogedIn Then
109
            sMessage = "User is no longer logged in"
110
            sMessageType = 1
111
       ElseIf NOT UserCanAddOrEditThisDaemonInst(DB_PROJ_ID, ReleaseMode, parOp_code) Then
112
            sMessage = "You have been denied permission to add/update daemon instructions for the specified release."
113
            sMessageType = 1
5357 dpurdie 114
       End If
115
 
5560 dpurdie 116
       If isNull(sMessage) Then
5357 dpurdie 117
 
5560 dpurdie 118
           ' do daemon instruction validation, continuing only if it passes
119
           If ValidateDaemonInstruction(parOp_code, parRtag_id, parPv_id) = True Then
5357 dpurdie 120
 
5560 dpurdie 121
             RepeatSeconds = 0
122
             ScheduledDateTime = ORA_SYSDATETIME
5357 dpurdie 123
 
5560 dpurdie 124
            ' We are adding a new record
125
             objEH.TryORA ( OraSession )
126
             On Error Resume Next
127
 
128
             OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_
129
                                                                            parRtag_id & ", " &_
130
                                                                            parPv_id & ", " &_
131
                                                                            ScheduledDateTime & ", " &_
132
                                                                            CStr(RepeatSeconds) & ", " &_
133
                                                                            ORA_SYSDATETIME & ", " &_
134
                                                                            objAccessControl.UserId & "); END;"
135
             objEH.CatchORA ( OraSession )
136
             If objEH.Finally Then
5590 dpurdie 137
                Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
5560 dpurdie 138
                Response.End
139
             End If
140
           Else
141
            sMessage = "Invalid Request."
142
            sMessageType = 1
143
           End If
5357 dpurdie 144
       End If
145
    Else
5560 dpurdie 146
        sMessage = "No action selected."
147
        sMessageType = 1
5357 dpurdie 148
    End If
149
End If
150
 
151
' Prevent editing if build instruction is already present
152
testPresent   = DaemonInstructionPresent(parRtag_id, parPv_id, 1 )
153
ripplePresent = DaemonInstructionPresent(parRtag_id, parPv_id, 0 )
154
 
155
If ripplePresent Then
156
    rippleDisable = " disabled"
5560 dpurdie 157
    sMessageAdd "Ripple Instruction already present"
5357 dpurdie 158
End If
159
 
160
If testPresent Then
161
    testDisable = " disabled"
5560 dpurdie 162
    sMessageAdd "Test Instruction already present"
5357 dpurdie 163
End If
164
 
165
If ripplePresent AND testPresent Then
166
    bPreventSubmit = true
5560 dpurdie 167
    If sMessageType = 3 Then
168
        sMessageType = 2
169
    End If
5357 dpurdie 170
End If
171
'----------------------------------------------
172
%>
173
<html>
174
   <head>
175
      <title>Release Manager</title>
176
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
177
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
178
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
179
      <link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
180
      <script language="JavaScript" src="scripts/common.js"></script>
181
   </head>
182
 
5590 dpurdie 183
   <body leftmargin="0" topmargin="0">
184
      <table width="600px"  border="0" cellspacing="0" cellpadding="5">
5357 dpurdie 185
         <%
186
         '-- FROM START --------------------------------------------------------------------------------------------------------------
187
         objFormComponent.FormName = "DaemonInstruction"
5590 dpurdie 188
         objFormComponent.FormClass = "form_tight"
5357 dpurdie 189
         objFormComponent.Action = ScriptName &_
190
                                   "?proj_id="& DB_PROJ_ID &_
191
                                   "&rtag_id="& parRtag_id &_
192
                                   "&pv_id="  & parPv_id &_
193
                                   "&rfile="  & parRfile
194
         objFormComponent.OnSubmit = "ShowProgress();"
195
         Call objFormComponent.FormStart()
196
         %>
197
         <tr>
198
            <td>
5560 dpurdie 199
               <!-- MESSAGE ++++++++++++++++++++++++++++++++++++++++++++++ -->
200
               <%Call Messenger ( sMessage , sMessageType, "100%" )%>
5357 dpurdie 201
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
202
               <!--#include file="messages/_msg_inline.asp"-->
5590 dpurdie 203
               <table class="full_table form_item form_field_bg" style="padding: 5;">
5357 dpurdie 204
                  <tr>
205
                      <td class="nowrap form_align" >
5590 dpurdie 206
                        <input type="radio" name="op_code" value="0" <%=rippleDisable%>> Ripple the current package. 
5560 dpurdie 207
                      <td>This will cause a new package version to be created.<br>All packages that depend on this package will also be rippled.
208
                  </tr>
209
                  <tr>
210
                    <td colspan=2><hr width=80%>
211
                  </tr>
212
                  <tr>
5357 dpurdie 213
                      <td class="nowrap form_align">
5590 dpurdie 214
                        <input type="radio" name="op_code" value="1" <%=testChecked%><%=testDisable%>> Test Build the current package. 
5560 dpurdie 215
                       <td>No new version will be created, nor will a build ripple be propagated.<br>This will simply ensure that the current package can be built with<br>the current build machine configuration.
5357 dpurdie 216
                  </tr>
217
               </table>
218
            </td>
5590 dpurdie 219
          <%
220
              Dim disableText : disableText = ""
221
              If NOT (DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit) Then
222
                  disableText = "disabled=""disabled"""
223
              End If
224
          %>
225
          <tr>
226
             <td>
227
                <span  style="float:left"><%=ProgressBar()%></span>
228
                <button name="btn"  style="float:right" type="reset" onclick="parent.closeIFrame();">Cancel</button>
229
                <button name="btn"  style="float:right;margin-right: 5px;" type="submit" <%=disableText%> >Add/Update</button>
230
          </tr>
5357 dpurdie 231
         <%=objPMod.ComposeHiddenTags()%>
232
         <input type="hidden" name="action" value="true">
5590 dpurdie 233
         <input type="hidden" id="rtag_id"     name="rtag_id"      value="<%=parRtag_id%>">
234
         <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
235
         <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
5357 dpurdie 236
         <%
237
         Call objFormComponent.FormEnd()
238
         '-- FROM END ----------------------------------------------------------------------------------------------------------------
239
         %>
240
      </table>
241
   </body>
242
</html>
243
<%
244
'------------ RUN AFTER PAGE RENDER -----------
245
Set objFormCollector = Nothing
246
'----------------------------------------------
247
Call Destroy_All_Objects
248
%>
249
 
250