Subversion Repositories DevTools

Rev

Rev 6181 | Rev 6579 | 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
%>
6181 dpurdie 26
<!--#include file="_access_control_login_optional.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
6184 dpurdie 106
       Dim sErrorMsg
5357 dpurdie 107
 
108
       ReleaseMode = GetReleaseMode(parRtag_id)
109
 
5560 dpurdie 110
       If NOT objAccessControl.UserLogedIn Then
111
            sMessage = "User is no longer logged in"
112
            sMessageType = 1
113
       ElseIf NOT UserCanAddOrEditThisDaemonInst(DB_PROJ_ID, ReleaseMode, parOp_code) Then
114
            sMessage = "You have been denied permission to add/update daemon instructions for the specified release."
115
            sMessageType = 1
5357 dpurdie 116
       End If
117
 
5560 dpurdie 118
       If isNull(sMessage) Then
5357 dpurdie 119
 
5560 dpurdie 120
           ' do daemon instruction validation, continuing only if it passes
6184 dpurdie 121
           If ValidateDaemonInstruction(parOp_code, parRtag_id, parPv_id, sErrorMsg) = True Then
5357 dpurdie 122
 
5560 dpurdie 123
             RepeatSeconds = 0
124
             ScheduledDateTime = ORA_SYSDATETIME
5357 dpurdie 125
 
5560 dpurdie 126
            ' We are adding a new record
127
             objEH.TryORA ( OraSession )
128
             On Error Resume Next
129
 
130
             OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_
131
                                                                            parRtag_id & ", " &_
132
                                                                            parPv_id & ", " &_
133
                                                                            ScheduledDateTime & ", " &_
134
                                                                            CStr(RepeatSeconds) & ", " &_
135
                                                                            ORA_SYSDATETIME & ", " &_
136
                                                                            objAccessControl.UserId & "); END;"
137
             objEH.CatchORA ( OraSession )
138
             If objEH.Finally Then
5590 dpurdie 139
                Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
5957 dpurdie 140
                Call Destroy_All_Objects
5560 dpurdie 141
                Response.End
142
             End If
143
           Else
6184 dpurdie 144
            sMessage = sErrorMsg
5560 dpurdie 145
            sMessageType = 1
146
           End If
5357 dpurdie 147
       End If
148
    Else
5560 dpurdie 149
        sMessage = "No action selected."
150
        sMessageType = 1
5357 dpurdie 151
    End If
152
End If
153
 
154
' Prevent editing if build instruction is already present
155
testPresent   = DaemonInstructionPresent(parRtag_id, parPv_id, 1 )
156
ripplePresent = DaemonInstructionPresent(parRtag_id, parPv_id, 0 )
157
 
158
If ripplePresent Then
159
    rippleDisable = " disabled"
5560 dpurdie 160
    sMessageAdd "Ripple Instruction already present"
5357 dpurdie 161
End If
162
 
163
If testPresent Then
164
    testDisable = " disabled"
5560 dpurdie 165
    sMessageAdd "Test Instruction already present"
5357 dpurdie 166
End If
167
 
168
If ripplePresent AND testPresent Then
169
    bPreventSubmit = true
5560 dpurdie 170
    If sMessageType = 3 Then
171
        sMessageType = 2
172
    End If
5357 dpurdie 173
End If
174
'----------------------------------------------
175
%>
176
<html>
177
   <head>
178
      <title>Release Manager</title>
179
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
180
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
181
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
182
      <link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
183
      <script language="JavaScript" src="scripts/common.js"></script>
184
   </head>
185
 
5590 dpurdie 186
   <body leftmargin="0" topmargin="0">
187
      <table width="600px"  border="0" cellspacing="0" cellpadding="5">
5357 dpurdie 188
         <%
189
         '-- FROM START --------------------------------------------------------------------------------------------------------------
190
         objFormComponent.FormName = "DaemonInstruction"
5590 dpurdie 191
         objFormComponent.FormClass = "form_tight"
5357 dpurdie 192
         objFormComponent.Action = ScriptName &_
193
                                   "?proj_id="& DB_PROJ_ID &_
194
                                   "&rtag_id="& parRtag_id &_
195
                                   "&pv_id="  & parPv_id &_
196
                                   "&rfile="  & parRfile
197
         objFormComponent.OnSubmit = "ShowProgress();"
198
         Call objFormComponent.FormStart()
199
         %>
200
         <tr>
201
            <td>
5560 dpurdie 202
               <!-- MESSAGE ++++++++++++++++++++++++++++++++++++++++++++++ -->
203
               <%Call Messenger ( sMessage , sMessageType, "100%" )%>
5357 dpurdie 204
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
205
               <!--#include file="messages/_msg_inline.asp"-->
5590 dpurdie 206
               <table class="full_table form_item form_field_bg" style="padding: 5;">
5357 dpurdie 207
                  <tr>
208
                      <td class="nowrap form_align" >
5590 dpurdie 209
                        <input type="radio" name="op_code" value="0" <%=rippleDisable%>> Ripple the current package. 
5560 dpurdie 210
                      <td>This will cause a new package version to be created.<br>All packages that depend on this package will also be rippled.
211
                  </tr>
212
                  <tr>
213
                    <td colspan=2><hr width=80%>
214
                  </tr>
215
                  <tr>
5357 dpurdie 216
                      <td class="nowrap form_align">
5590 dpurdie 217
                        <input type="radio" name="op_code" value="1" <%=testChecked%><%=testDisable%>> Test Build the current package. 
5560 dpurdie 218
                       <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 219
                  </tr>
220
               </table>
221
            </td>
5590 dpurdie 222
          <%
223
              Dim disableText : disableText = ""
224
              If NOT (DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit) Then
225
                  disableText = "disabled=""disabled"""
226
              End If
227
          %>
228
          <tr>
229
             <td>
230
                <span  style="float:left"><%=ProgressBar()%></span>
231
                <button name="btn"  style="float:right" type="reset" onclick="parent.closeIFrame();">Cancel</button>
232
                <button name="btn"  style="float:right;margin-right: 5px;" type="submit" <%=disableText%> >Add/Update</button>
233
          </tr>
5357 dpurdie 234
         <%=objPMod.ComposeHiddenTags()%>
235
         <input type="hidden" name="action" value="true">
5590 dpurdie 236
         <input type="hidden" id="rtag_id"     name="rtag_id"      value="<%=parRtag_id%>">
237
         <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
238
         <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
5357 dpurdie 239
         <%
240
         Call objFormComponent.FormEnd()
241
         '-- FROM END ----------------------------------------------------------------------------------------------------------------
242
         %>
243
      </table>
244
   </body>
245
</html>
246
<%
247
'------------ RUN AFTER PAGE RENDER -----------
248
Set objFormCollector = Nothing
249
'----------------------------------------------
250
Call Destroy_All_Objects
251
%>
252
 
253