Subversion Repositories DevTools

Rev

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