Subversion Repositories DevTools

Rev

Rev 6175 | Rev 6183 | 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
'|                                                   |
5
'|          Edit/View Build Configuration            |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
12
Response.Expires = 0   ' always load the page, dont store
13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/_form_window_common.asp"-->
20
<!--#include file="_action_buttons.asp"-->
21
<!--#include file="class/classActionButtonControl.asp"-->
6175 dpurdie 22
<!--#include file="common/common_daemon.asp"-->
6052 dpurdie 23
<% objPMod.PersistInQryString("proj_id") %>
24
<% '------------ ACCESS CONTROL ------------------ %>
6181 dpurdie 25
<!--#include file="_access_control_login_optional.asp"-->
6070 dpurdie 26
<!--#include file="_access_control_general.asp"-->
6052 dpurdie 27
<!--#include file="_access_control_action_project.asp"-->
5357 dpurdie 28
<%
29
'------------ Variable Definition -------------
30
Dim objSortHelper
31
Dim rsQry
32
Dim parRtagId
33
Dim query_string
34
Dim objBtnControl
35
Dim rcon_id
6166 dpurdie 36
Dim masterCount
37
Dim toolsetWarning
38
 
5357 dpurdie 39
'------------ Constants Declaration -----------
40
'------------ Variable Init -------------------
41
parRtagId = Request("rtag_id")
42
objPMod.PersistInQryString("rtag_id")
43
Set objBtnControl = New ActionButtonControl
44
'----------------------------------------------
45
%>
46
<%
47
'--------------------------------------------------------------------------------------------------------------------------
48
Sub GetFormDetails ( parRtagId, ByRef outobjDetails )
49
   Dim rsQry, query
50
 
51
 
52
   OraDatabase.Parameters.Add "RTAG_ID",    parRtagId,      ORAPARM_INPUT, ORATYPE_NUMBER
53
 
54
   query = _
55
   " SELECT * "&_
56
   "  FROM RELEASE_TAGS rt"&_
57
   " WHERE rt.RTAG_ID = :RTAG_ID"
58
 
59
   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
60
 
61
   OraDatabase.Parameters.Remove "RTAG_ID"
62
 
63
 
64
 
65
   If rsQry.RecordCount > 0 Then
66
      outobjDetails.Item ("rtag_id") = rsQry("rtag_id")
67
      outobjDetails.Item ("rtag_name") = rsQry("rtag_name")
68
   Else
69
      Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. parRtagId="& parRtagId
70
 
71
   End If
72
 
73
   rsQry.Close
74
   Set rsQry = Nothing
75
End Sub
76
'--------------------------------------------------------------------------------------------------------------------------
77
Sub DeleteDaemon(rcon_id_list)
78
 
79
   OraDatabase.Parameters.Add "RCON_ID_LIST",   rcon_id_list,    ORAPARM_INPUT, ORATYPE_VARCHAR2
80
 
81
   On Error Resume Next
82
   objEH.TryORA()
83
 
84
   OraDatabase.ExecuteSQL "BEGIN  PK_BUILDAPI.DELETE_DAEMON(:RCON_ID_LIST);  END;"
85
 
86
   objEH.CatchORA ( OraSession )
87
 
88
   OraDatabase.Parameters.Remove "RCON_ID_LIST"
89
End Sub
90
'--------------------------------------------------------------------------------------------------------------------------
91
Sub RemoveDaemon(rcon_id_list)
92
 
93
   OraDatabase.Parameters.Add "RCON_ID_LIST",   rcon_id_list,    ORAPARM_INPUT, ORATYPE_VARCHAR2
94
 
95
   On Error Resume Next
96
   objEH.TryORA()
97
 
98
   OraDatabase.ExecuteSQL "BEGIN  PK_BUILDAPI.REMOVE_DAEMON(:RCON_ID_LIST);  END;"
99
 
100
   objEH.CatchORA ( OraSession )
101
 
102
   OraDatabase.Parameters.Remove "RCON_ID_LIST"
103
End Sub
104
'--------------------------------------------------------------------------------------------------------------------------
6166 dpurdie 105
Sub CheckMasterConfig()
106
    Dim rsQry, query
107
    OraDatabase.Parameters.Add "RTAG_ID",    parRtagId,      ORAPARM_INPUT, ORATYPE_NUMBER
108
 
109
    '
110
    '   Check that there is exacly one master in the build set
111
    query = _
112
        "SELECT COUNT (rc.daemon_mode) as masterCount" &_
113
        " FROM release_manager.release_config rc, release_manager.run_level rl" &_
114
        " WHERE rc.rtag_id   = :RTAG_ID" &_
115
        " AND rl.RCON_ID = rc.RCON_ID" &_
116
        " AND   rc.bmcon_id is not NULL" &_
117
        " GROUP BY rc.daemon_mode" &_
118
        " HAVING rc.daemon_mode = 'M'"
119
 
120
    Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
121
 
122
    If rsQry.RecordCount > 0 Then
123
       masterCount = rsQry("masterCount")
124
    End If
125
    rsQry.Close
126
    Set rsQry = Nothing
127
 
128
    '
129
    '   Check that each GBE_MACHTYPE has exactly one insatnce where the BUILDFILTER contains
130
    '   a TOOLSET builder. The test is a bit sloppy
131
    query = _
132
        "SELECT * from ( " &_
133
        "SELECT GBE_ID, COUNT(hasToolset) as ToolsetCount " &_
134
        "FROM  " &_
135
        "  (SELECT bc.GBE_ID, " &_
136
        "    CASE " &_
137
        "      WHEN INSTR(rc.GBE_BUILDFILTER, 'TOOLSET') > 0 " &_
138
        "      THEN 1 " &_
139
        "      ELSE NULL " &_
140
        "    END AS hasToolset " &_
141
        "  FROM release_manager.release_config rc, " &_
142
        "    BUILD_MACHINE_CONFIG bc " &_
6175 dpurdie 143
        "  WHERE rc.rtag_id = :RTAG_ID " &_
6166 dpurdie 144
        "  AND rc.bmcon_id IS NOT NULL " &_
145
        "  AND bc.bmcon_id  = rc.bmcon_id " &_
146
        "  ) " &_
147
        "GROUP BY GBE_ID ) " &_
148
        "Where  ToolsetCount != 1 "
149
 
150
    Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
151
 
152
    toolsetWarning =  rsQry.RecordCount > 0 
153
    rsQry.Close
154
    Set rsQry = Nothing
155
 
156
 
157
    OraDatabase.Parameters.Remove "RTAG_ID"
158
 
159
End Sub
5357 dpurdie 160
%>
161
<%
162
'------------ RUN BEFORE PAGE RENDER ----------
163
' --- Get Form details from DB ---
164
Call GetFormDetails ( Request("rtag_id"), objFormCollector )
165
 
166
' --- Enter Form Validation Rule Changes here... ----
167
'----------------------------------------------------
168
 
169
' --- RUN onPostBack ---
170
If Request("action") <> "" AND objAccessControl.UserLogedIn Then
171
   If objForm.IsValidOnPostBack Then
172
      If canActionControlInProject("BuildConfiguration") Then
173
         If Request("btn") = "Delete" Then
174
             Call DeleteDaemon(Request("rcon_id_list"))
175
         ElseIf Request("btn") = "Unlink" Then
176
             Call RemoveDaemon(Request("rcon_id_list"))
177
        End If
178
      End If
179
 
180
      If objEH.Finally Then
181
         Call OpenInWindow ( "release_config.asp?rtag_id="& parRtagId )
182
      End If
183
 
184
   End If
185
 
186
End If
6166 dpurdie 187
Call CheckMasterConfig()
5357 dpurdie 188
'----------------------------------------------
189
%>
190
 
191
<html>
192
   <head>
193
      <title>Release Manager</title>
194
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
195
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
196
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
197
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
198
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
199
      <script language="JavaScript" src="images/common.js"></script>
200
      <!--#include file="_jquery_includes.asp"-->
201
      <!-- DROPDOWN MENUS -->
202
      <!--#include file="_menu_def.asp"-->
203
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
204
   </head>
205
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
206
      <!-- HEADER -->
207
      <!--#include file="_header.asp"-->
208
      <!-- BODY ---->
209
 
210
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
211
         <%
212
         '-- FROM START ---------------------------------------------------------------------------------------------------------
213
         objFormComponent.FormName = "FormName"
214
         objFormComponent.Action = ScriptName
215
         Call objFormComponent.FormStart()
216
         %>
217
         <tr>
6175 dpurdie 218
            <td width="146px" class="panel_bg" valign="top"><%Call BuildMenuPane%></td>
5357 dpurdie 219
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
220
               <table width="10" border="0" cellspacing="0" cellpadding="0">
221
                  <tr>
222
                     <td width="1%"></td>
223
                     <td width="100%">
224
                        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
225
                           <tr>
226
                              <td nowrap class="body_txt"></td>
227
                           </tr>
228
                        </table>
229
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
230
                           <tr>
231
                              <td nowrap class="form_ttl">
232
                                 <p>&nbsp;</p>
233
                                 <p>
234
                                    <%If canActionControlInProject("BuildConfiguration") Then%>
235
                                       ADMINISTER
236
                                    <%Else%>
237
                                       VIEW
238
                                    <%End If%>
239
                                    BUILD CONFIGURATION
240
                                 </p>
241
                              </td>
242
                              <td align="right" valign="bottom"></td>
243
                           </tr>
244
                        </table>
245
                     </td>
246
                     <td width="1%"></td>
247
                  </tr>
248
                  <tr>
249
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
250
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
251
                     <td align="right" valign="top"  background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
252
                  </tr>
253
                  <tr>
254
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
255
                     <td bgcolor="#FFFFFF" valign="top">
256
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
257
                        <!--#include file="messages/_msg_inline.asp"-->
258
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
259
                        <br>
260
                        <!-- BUTTONS CONTROL +++++++++++++++++++ -->
261
                        <%
262
                        If canActionControlInProject("BuildConfiguration") Then
263
                           Call Action_Buttons ( "Add Daemon" )
264
                        End If
265
 
266
                        ' Load some action buttons
267
                        Call objBtnControl.LoadActionButtons ( Array("btnEditDaemon", "btnRemoveDaemon", "btnDeleteDaemon"), OraDatabase )
268
                        objBtnControl.ButtonSpacer = 1
269
 
270
                        %>
271
 
272
                        <!-- +++++++++++++++++++++++++++++++++++ -->
273
 
274
                        <table width="100%"  border="0" cellspacing="2" cellpadding="0">
275
                     </td>
276
                     <td width="9%" valign="top"></td>
277
                  </tr>
278
                  <tr>
279
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"></td>
280
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">DAEMON HOST</td>
281
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">GBE_MACHTYPE</td>
282
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">DAEMON MODE</td>
283
                     <td valign="top"   wrap background="images/bg_table_col.gif" class="body_col">GBE_BUILDFILTER</td>
284
                     <%If canActionControlInProject("BuildConfiguration") Then%>
285
                        <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">ACTION</td>
286
                     <%End If%>
287
                     <td valign="top">
288
                  </tr>
289
                  <%
290
 
291
                  query_string = "select rcon_id, display_name, rc.bmcon_id, daemon_mode, gbe_value, gbe_buildfilter " &_
292
                                 " from release_manager.release_config rc," &_
293
                                 "      release_manager.build_machine_config bm," &_
294
                                 "      release_manager.gbe_machtype gbe" &_
295
                                 " where rc.rtag_id=" & parRtagId &_
296
                                 "      and rc.bmcon_id=bm.bmcon_id(+)" &_
297
                                 "      and rc.gbe_id=gbe.gbe_id" &_
298
                                 " order by daemon_mode, bm.display_name"
299
                  Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
300
                  Dim daemon_mode, daemon, cbtype
301
 
302
                  cbtype = "hidden"
303
                  If canActionControlInProject("BuildConfiguration") Then
304
                     cbtype = "checkbox"
305
                  End If
306
 
307
                  '--- Render rows ---
308
                  Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
309
                     rcon_id = rsQry("rcon_id")
310
                     daemon  = rsQry("display_name")
311
                     If IsNull(daemon) Then
312
                         daemon = ""
313
                     End If
314
 
315
                     If rsQry("daemon_mode") = "M" Then
316
                        daemon_mode = "MASTER"
317
                     Else
318
                        daemon_mode = "SLAVE"
319
                     End If
320
                     %>
321
                     <tr>
322
                        <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
323
                     </tr>
324
                     <tr>
325
                        <td valign="top" align="center"><input type=<%=cbtype%> name="rcon_id_list" value="<%=rsQry("rcon_id")%>"></td>
326
                        <td valign="top"    nowrap class="body_rowg"><%=daemon%></td>
327
                        <td valign="top"    nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
328
                        <td valign="top"    nowrap class="body_rowg"><%=daemon_mode%></td>
329
                        <td valign="top"      wrap class="body_rowg"><%=rsQry("gbe_buildfilter")%></td>
330
                        <%If canActionControlInProject("BuildConfiguration") Then%>
331
                           <td valign="top" nowrap class="body_rowg"><%Call objBtnControl.Render  ( Array("btnEditDaemon", "btnRemoveDaemon", "btnDeleteDaemon"), objAccessControl )%></td>
332
                        <%End If%>
333
                     </tr>
334
                     <%
335
                     rsQry.MoveNext
336
                  Loop
337
                  rsQry.Close()
338
                  Set rsQry = nothing
339
                  %>
340
               </table>
341
            </td>
342
            <td background="images/lbox_bgside_white.gif">&nbsp;</td>
343
         </tr>
6166 dpurdie 344
        <%If masterCount <> 1 OR toolsetWarning Then %>
345
          <tr class="form_error form_btn">
346
            <td></td>
347
            <td style="padding: 10px;">
348
            <table class="full_table form_error">
349
                <%If masterCount <> 1 Then %>
350
                 <tr>
351
                    <td nowrap class="err_alert">Error
352
                    <td class="body_rowg"> The set of Build Machines must have exactly one Master.
353
                 </tr>
354
                <%End If%>
355
                <%If toolsetWarning Then %>
356
                 <tr>
357
                    <td nowrap class="err_alert">Warning
358
                    <td class="body_rowg">There should be one TOOLSET builder within each set of machines with the same GBE_MACHTYPE.
359
                 </tr>
360
                <%End If%>
361
                </tr>
362
            </table>
363
         </td>
364
            <td></td>
365
         </tr>
366
        <%End If%>
5357 dpurdie 367
         <tr>
6166 dpurdie 368
            <!-- ACTION BUTTONS ---------------------------------------------->
5357 dpurdie 369
            <td background="images/bg_action_norm.gif" ></td>
370
            <td align="right" background="images/bg_action_norm.gif" >
371
 
372
               <%=objFormComponent.CancelButton ( "OK", "class='form_btn'", "build_status.asp?rtag_id="& parRtagId )%>
373
               <%=objPMod.ComposeHiddenTags()%>
374
               <%If canActionControlInProject("BuildConfiguration") Then%>
375
                  <input name="btn" type="submit" class="form_btn" value="Unlink">
376
                  <input name="btn" type="submit" class="form_btn" value="Delete">
377
               <%End If%>
378
               <input type="hidden" name="rcon_id_list" value="<%=Request("rcon_id_list")%>">
379
               <input type="hidden" name="action" value="true">
380
            </td>
381
            <td background="images/bg_action_norm.gif" ><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
6166 dpurdie 382
         <!-- ACTION BUTTONS END  ------------------------------------------></td>
5357 dpurdie 383
         </tr>
384
         <tr>
385
            <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
386
            <td background="images/lbox_bg_blue.gif"></td>
387
            <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
388
         </tr>
389
      </table>
390
 
391
      <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
392
  </tr>
393
  <tr>
6175 dpurdie 394
    <td valign="bottom" align="center" background="images/bg_home_orange.gif"><img src="images/img_gear.gif" width="86" height="99" vspace="20" hspace="30"></td>
5357 dpurdie 395
    <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="500"></td>
396
  </tr>
397
<%
398
Call objFormComponent.FormEnd()
399
'-- FROM END ----------------------------------------------------------------------------------------------------------------
400
%>
401
</table>
402
<!-- FOOTER -->
403
<!--#include file="_footer.asp"-->
404
</body>
405
</html>