Subversion Repositories DevTools

Rev

Rev 5506 | Rev 5590 | 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
'|
5560 dpurdie 5
'|  wAddDaemonInstruction.asp
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
34
Dim ripplePresent, rippleDisable, rippleChecked
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
137
                Call OpenInParentWindowFromIFrame (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
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
Else
159
    rippleChecked = " checked"
160
End If
161
 
162
If testPresent Then
163
    testDisable = " disabled"
5560 dpurdie 164
    sMessageAdd "Test Instruction already present"
5357 dpurdie 165
End If
166
 
167
If ripplePresent AND testPresent Then
168
    bPreventSubmit = true
5560 dpurdie 169
    If sMessageType = 3 Then
170
        sMessageType = 2
171
    End If
5357 dpurdie 172
End If
173
'----------------------------------------------
174
%>
175
<html>
176
   <head>
177
      <title>Release Manager</title>
178
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
179
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
180
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
181
      <link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
182
      <script language="JavaScript" src="scripts/common.js"></script>
5560 dpurdie 183
      <!--#include file="_jquery_includes.asp"-->
184
      <script language="javascript">
185
        $(document).ready(function () {
186
            //  Cancel button must close this iFrame using a function provided by the parent
187
            $('#btn_cancel').on('click', function (e) {parent.closeIFrame()});
188
        });
189
 
190
   </script>
5357 dpurdie 191
   </head>
192
 
5560 dpurdie 193
   <body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0">
194
      <table width="600px"  border="0" cellspacing="0" cellpadding="10">
5357 dpurdie 195
         <tr>
196
            <td bgcolor="#FFFFFF" class="body_txt">
197
                <span class="body_h1">
198
                    <img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">
199
                        &nbsp;Ripple or Test Build current Package
200
                </span>
201
                <br>Add a new Daemon Instruction to Ripple or Test Build current Package
202
            </td>
203
         </tr>
204
         <%
205
         '-- FROM START --------------------------------------------------------------------------------------------------------------
206
         objFormComponent.FormName = "DaemonInstruction"
207
         objFormComponent.Action = ScriptName &_
208
                                   "?proj_id="& DB_PROJ_ID &_
209
                                   "&rtag_id="& parRtag_id &_
210
                                   "&pv_id="  & parPv_id &_
211
                                   "&rfile="  & parRfile
212
         objFormComponent.OnSubmit = "ShowProgress();"
213
         Call objFormComponent.FormStart()
214
 
215
 
216
         %>
217
         <tr>
218
            <td background="images/bg_login.gif">
5560 dpurdie 219
               <table class="full_table">
5357 dpurdie 220
                  <tr>
221
                     <td><%=ProgressBar()%></td>
222
                  </tr>
223
               </table>
224
            </td>
225
         </tr>
226
         <tr>
227
            <td>
5560 dpurdie 228
               <!-- MESSAGE ++++++++++++++++++++++++++++++++++++++++++++++ -->
229
               <%Call Messenger ( sMessage , sMessageType, "100%" )%>
5357 dpurdie 230
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
231
               <!--#include file="messages/_msg_inline.asp"-->
5560 dpurdie 232
               <table class="full_table form_item">
5357 dpurdie 233
                  <tr>
234
                      <td class="nowrap form_align" >
235
                        <input type="radio" name="op_code" value="0" <%=rippleChecked%><%=rippleDisable%>>
236
                            Ripple the current package. 
5560 dpurdie 237
                      <td>This will cause a new package version to be created.<br>All packages that depend on this package will also be rippled.
238
                  </tr>
239
                  <tr>
240
                    <td colspan=2><hr width=80%>
241
                  </tr>
242
                  <tr>
5357 dpurdie 243
                      <td class="nowrap form_align">
244
                        <input type="radio" name="op_code" value="1" <%=testChecked%><%=testDisable%>>
245
                            Test Build the current package. 
5560 dpurdie 246
                       <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 247
                  </tr>
5560 dpurdie 248
                  <tr>
5357 dpurdie 249
                     <td align="right" colspan=2 class=top_border background="images/bg_login.gif">
250
                      <p>&nbsp;<p>
5560 dpurdie 251
                        <%
252
                            Dim disableText : disableText = ""
253
                            If NOT (DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit) Then
254
                                disableText = "disabled=""disabled"""
255
                            End If
256
                        %>
257
                        <button name="btn" type="submit" <%=disableText%> >Add/Update</button>
258
                        <button name="btn" type="reset" id="btn_cancel">Cancel</button>
5357 dpurdie 259
                  </tr>
260
                  <tr>
261
                     <td>
262
                        <input type="hidden" id="rtag_id"     name="rtag_id"      value="<%=parRtag_id%>">
263
                        <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
264
                        <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
265
                     </td>
266
                  </tr>
267
               </table>
268
            </td>
269
         </tr>
270
         <%=objPMod.ComposeHiddenTags()%>
271
         <input type="hidden" name="action" value="true">
272
 
273
         <%
274
         Call objFormComponent.FormEnd()
275
         '-- FROM END ----------------------------------------------------------------------------------------------------------------
276
         %>
277
      </table>
278
   </body>
279
</html>
280
<%
281
'------------ RUN AFTER PAGE RENDER -----------
282
Set objFormCollector = Nothing
283
'----------------------------------------------
284
Call Destroy_All_Objects
285
%>
286
 
287