Subversion Repositories DevTools

Rev

Rev 5590 | Rev 6048 | 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)
5957 dpurdie 138
                Call Destroy_All_Objects
5560 dpurdie 139
                Response.End
140
             End If
141
           Else
142
            sMessage = "Invalid Request."
143
            sMessageType = 1
144
           End If
5357 dpurdie 145
       End If
146
    Else
5560 dpurdie 147
        sMessage = "No action selected."
148
        sMessageType = 1
5357 dpurdie 149
    End If
150
End If
151
 
152
' Prevent editing if build instruction is already present
153
testPresent   = DaemonInstructionPresent(parRtag_id, parPv_id, 1 )
154
ripplePresent = DaemonInstructionPresent(parRtag_id, parPv_id, 0 )
155
 
156
If ripplePresent Then
157
    rippleDisable = " disabled"
5560 dpurdie 158
    sMessageAdd "Ripple Instruction already present"
5357 dpurdie 159
End If
160
 
161
If testPresent Then
162
    testDisable = " disabled"
5560 dpurdie 163
    sMessageAdd "Test Instruction already present"
5357 dpurdie 164
End If
165
 
166
If ripplePresent AND testPresent Then
167
    bPreventSubmit = true
5560 dpurdie 168
    If sMessageType = 3 Then
169
        sMessageType = 2
170
    End If
5357 dpurdie 171
End If
172
'----------------------------------------------
173
%>
174
<html>
175
   <head>
176
      <title>Release Manager</title>
177
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
178
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
179
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
180
      <link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
181
      <script language="JavaScript" src="scripts/common.js"></script>
182
   </head>
183
 
5590 dpurdie 184
   <body leftmargin="0" topmargin="0">
185
      <table width="600px"  border="0" cellspacing="0" cellpadding="5">
5357 dpurdie 186
         <%
187
         '-- FROM START --------------------------------------------------------------------------------------------------------------
188
         objFormComponent.FormName = "DaemonInstruction"
5590 dpurdie 189
         objFormComponent.FormClass = "form_tight"
5357 dpurdie 190
         objFormComponent.Action = ScriptName &_
191
                                   "?proj_id="& DB_PROJ_ID &_
192
                                   "&rtag_id="& parRtag_id &_
193
                                   "&pv_id="  & parPv_id &_
194
                                   "&rfile="  & parRfile
195
         objFormComponent.OnSubmit = "ShowProgress();"
196
         Call objFormComponent.FormStart()
197
         %>
198
         <tr>
199
            <td>
5560 dpurdie 200
               <!-- MESSAGE ++++++++++++++++++++++++++++++++++++++++++++++ -->
201
               <%Call Messenger ( sMessage , sMessageType, "100%" )%>
5357 dpurdie 202
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
203
               <!--#include file="messages/_msg_inline.asp"-->
5590 dpurdie 204
               <table class="full_table form_item form_field_bg" style="padding: 5;">
5357 dpurdie 205
                  <tr>
206
                      <td class="nowrap form_align" >
5590 dpurdie 207
                        <input type="radio" name="op_code" value="0" <%=rippleDisable%>> Ripple the current package. 
5560 dpurdie 208
                      <td>This will cause a new package version to be created.<br>All packages that depend on this package will also be rippled.
209
                  </tr>
210
                  <tr>
211
                    <td colspan=2><hr width=80%>
212
                  </tr>
213
                  <tr>
5357 dpurdie 214
                      <td class="nowrap form_align">
5590 dpurdie 215
                        <input type="radio" name="op_code" value="1" <%=testChecked%><%=testDisable%>> Test Build the current package. 
5560 dpurdie 216
                       <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 217
                  </tr>
218
               </table>
219
            </td>
5590 dpurdie 220
          <%
221
              Dim disableText : disableText = ""
222
              If NOT (DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit) Then
223
                  disableText = "disabled=""disabled"""
224
              End If
225
          %>
226
          <tr>
227
             <td>
228
                <span  style="float:left"><%=ProgressBar()%></span>
229
                <button name="btn"  style="float:right" type="reset" onclick="parent.closeIFrame();">Cancel</button>
230
                <button name="btn"  style="float:right;margin-right: 5px;" type="submit" <%=disableText%> >Add/Update</button>
231
          </tr>
5357 dpurdie 232
         <%=objPMod.ComposeHiddenTags()%>
233
         <input type="hidden" name="action" value="true">
5590 dpurdie 234
         <input type="hidden" id="rtag_id"     name="rtag_id"      value="<%=parRtag_id%>">
235
         <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
236
         <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
5357 dpurdie 237
         <%
238
         Call objFormComponent.FormEnd()
239
         '-- FROM END ----------------------------------------------------------------------------------------------------------------
240
         %>
241
      </table>
242
   </body>
243
</html>
244
<%
245
'------------ RUN AFTER PAGE RENDER -----------
246
Set objFormCollector = Nothing
247
'----------------------------------------------
248
Call Destroy_All_Objects
249
%>
250
 
251