Subversion Repositories DevTools

Rev

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