| 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 rsQry
|
|
|
31 |
Dim parRtagId
|
|
|
32 |
Dim query_string
|
|
|
33 |
Dim objBtnControl
|
|
|
34 |
Dim rcon_id
|
| 6166 |
dpurdie |
35 |
Dim masterCount
|
|
|
36 |
Dim toolsetWarning
|
|
|
37 |
|
| 5357 |
dpurdie |
38 |
'------------ Constants Declaration -----------
|
|
|
39 |
'------------ Variable Init -------------------
|
|
|
40 |
parRtagId = Request("rtag_id")
|
|
|
41 |
objPMod.PersistInQryString("rtag_id")
|
|
|
42 |
Set objBtnControl = New ActionButtonControl
|
|
|
43 |
'----------------------------------------------
|
|
|
44 |
%>
|
|
|
45 |
<%
|
|
|
46 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
47 |
Sub GetFormDetails ( parRtagId, ByRef outobjDetails )
|
|
|
48 |
Dim rsQry, query
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
OraDatabase.Parameters.Add "RTAG_ID", parRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
52 |
|
|
|
53 |
query = _
|
|
|
54 |
" SELECT * "&_
|
|
|
55 |
" FROM RELEASE_TAGS rt"&_
|
|
|
56 |
" WHERE rt.RTAG_ID = :RTAG_ID"
|
|
|
57 |
|
|
|
58 |
Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
|
|
|
59 |
|
|
|
60 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
If rsQry.RecordCount > 0 Then
|
|
|
65 |
outobjDetails.Item ("rtag_id") = rsQry("rtag_id")
|
|
|
66 |
outobjDetails.Item ("rtag_name") = rsQry("rtag_name")
|
|
|
67 |
Else
|
|
|
68 |
Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. parRtagId="& parRtagId
|
|
|
69 |
|
|
|
70 |
End If
|
|
|
71 |
|
|
|
72 |
rsQry.Close
|
|
|
73 |
Set rsQry = Nothing
|
|
|
74 |
End Sub
|
|
|
75 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
76 |
Sub DeleteDaemon(rcon_id_list)
|
|
|
77 |
|
|
|
78 |
OraDatabase.Parameters.Add "RCON_ID_LIST", rcon_id_list, ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
79 |
|
|
|
80 |
On Error Resume Next
|
| 6873 |
dpurdie |
81 |
objEH.ErrorRedirect = FALSE
|
| 5357 |
dpurdie |
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
|
| 6873 |
dpurdie |
96 |
objEH.ErrorRedirect = FALSE
|
| 5357 |
dpurdie |
97 |
objEH.TryORA()
|
|
|
98 |
|
|
|
99 |
OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.REMOVE_DAEMON(:RCON_ID_LIST); END;"
|
|
|
100 |
|
|
|
101 |
objEH.CatchORA ( OraSession )
|
|
|
102 |
|
|
|
103 |
OraDatabase.Parameters.Remove "RCON_ID_LIST"
|
|
|
104 |
End Sub
|
|
|
105 |
'--------------------------------------------------------------------------------------------------------------------------
|
| 6166 |
dpurdie |
106 |
Sub CheckMasterConfig()
|
|
|
107 |
Dim rsQry, query
|
|
|
108 |
OraDatabase.Parameters.Add "RTAG_ID", parRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
109 |
|
|
|
110 |
'
|
|
|
111 |
' Check that there is exacly one master in the build set
|
|
|
112 |
query = _
|
|
|
113 |
"SELECT COUNT (rc.daemon_mode) as masterCount" &_
|
|
|
114 |
" FROM release_manager.release_config rc, release_manager.run_level rl" &_
|
|
|
115 |
" WHERE rc.rtag_id = :RTAG_ID" &_
|
| 6873 |
dpurdie |
116 |
" AND rl.RCON_ID(+) = rc.RCON_ID" &_
|
| 6166 |
dpurdie |
117 |
" AND rc.bmcon_id is not NULL" &_
|
|
|
118 |
" GROUP BY rc.daemon_mode" &_
|
|
|
119 |
" HAVING rc.daemon_mode = 'M'"
|
|
|
120 |
|
|
|
121 |
Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
|
|
|
122 |
|
|
|
123 |
If rsQry.RecordCount > 0 Then
|
|
|
124 |
masterCount = rsQry("masterCount")
|
|
|
125 |
End If
|
|
|
126 |
rsQry.Close
|
|
|
127 |
Set rsQry = Nothing
|
|
|
128 |
|
| 6183 |
dpurdie |
129 |
If bGetApplication("CheckToolset", TRUE) Then
|
|
|
130 |
'
|
|
|
131 |
' Check that each GBE_MACHTYPE has exactly one instance where the BUILDFILTER contains
|
|
|
132 |
' a TOOLSET builder. The test is a bit sloppy
|
|
|
133 |
query = _
|
|
|
134 |
"SELECT * from ( " &_
|
|
|
135 |
"SELECT GBE_ID, COUNT(hasToolset) as ToolsetCount " &_
|
|
|
136 |
"FROM " &_
|
|
|
137 |
" (SELECT bc.GBE_ID, " &_
|
|
|
138 |
" CASE " &_
|
|
|
139 |
" WHEN INSTR(rc.GBE_BUILDFILTER, 'TOOLSET') > 0 " &_
|
|
|
140 |
" THEN 1 " &_
|
|
|
141 |
" ELSE NULL " &_
|
|
|
142 |
" END AS hasToolset " &_
|
|
|
143 |
" FROM release_manager.release_config rc, " &_
|
|
|
144 |
" BUILD_MACHINE_CONFIG bc " &_
|
|
|
145 |
" WHERE rc.rtag_id = :RTAG_ID " &_
|
|
|
146 |
" AND rc.bmcon_id IS NOT NULL " &_
|
|
|
147 |
" AND bc.bmcon_id = rc.bmcon_id " &_
|
|
|
148 |
" ) " &_
|
|
|
149 |
"GROUP BY GBE_ID ) " &_
|
|
|
150 |
"Where ToolsetCount != 1 "
|
| 6166 |
dpurdie |
151 |
|
| 6183 |
dpurdie |
152 |
Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
|
| 6166 |
dpurdie |
153 |
|
| 6183 |
dpurdie |
154 |
toolsetWarning = rsQry.RecordCount > 0
|
|
|
155 |
rsQry.Close
|
|
|
156 |
Set rsQry = Nothing
|
|
|
157 |
End If
|
| 6166 |
dpurdie |
158 |
|
|
|
159 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
160 |
|
|
|
161 |
End Sub
|
| 5357 |
dpurdie |
162 |
%>
|
|
|
163 |
<%
|
|
|
164 |
'------------ RUN BEFORE PAGE RENDER ----------
|
|
|
165 |
' --- Get Form details from DB ---
|
|
|
166 |
Call GetFormDetails ( Request("rtag_id"), objFormCollector )
|
|
|
167 |
|
|
|
168 |
' --- Enter Form Validation Rule Changes here... ----
|
|
|
169 |
'----------------------------------------------------
|
|
|
170 |
|
|
|
171 |
' --- RUN onPostBack ---
|
|
|
172 |
If Request("action") <> "" AND objAccessControl.UserLogedIn Then
|
|
|
173 |
If objForm.IsValidOnPostBack Then
|
|
|
174 |
If canActionControlInProject("BuildConfiguration") Then
|
|
|
175 |
If Request("btn") = "Delete" Then
|
|
|
176 |
Call DeleteDaemon(Request("rcon_id_list"))
|
|
|
177 |
ElseIf Request("btn") = "Unlink" Then
|
|
|
178 |
Call RemoveDaemon(Request("rcon_id_list"))
|
|
|
179 |
End If
|
|
|
180 |
End If
|
|
|
181 |
|
|
|
182 |
If objEH.Finally Then
|
|
|
183 |
Call OpenInWindow ( "release_config.asp?rtag_id="& parRtagId )
|
|
|
184 |
End If
|
|
|
185 |
|
|
|
186 |
End If
|
|
|
187 |
|
|
|
188 |
End If
|
| 6166 |
dpurdie |
189 |
Call CheckMasterConfig()
|
| 5357 |
dpurdie |
190 |
'----------------------------------------------
|
| 6548 |
dpurdie |
191 |
Sub ShowBuildConfig
|
|
|
192 |
'-- FROM START ---------------------------------------------------------------------------------------------------------
|
|
|
193 |
objFormComponent.FormName = "FormName"
|
|
|
194 |
objFormComponent.Action = ScriptName
|
|
|
195 |
Call objFormComponent.FormStart()
|
| 5357 |
dpurdie |
196 |
%>
|
| 6874 |
dpurdie |
197 |
<div class=panel>
|
|
|
198 |
<div class=rounded_box_caption>
|
|
|
199 |
<%=IIf( canActionControlInProject("BuildConfiguration"),"ADMINISTER","VIEW")%> BUILD CONFIGURATION
|
|
|
200 |
</div>
|
|
|
201 |
<div class="rounded_box" >
|
|
|
202 |
<div class='controlPanel'>
|
|
|
203 |
<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
204 |
<!--#include file="messages/_msg_inline.asp"-->
|
|
|
205 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
206 |
<!-- BUTTONS CONTROL +++++++++++++++++++ -->
|
|
|
207 |
<%
|
|
|
208 |
If canActionControlInProject("BuildConfiguration") Then
|
|
|
209 |
Call Action_Buttons ( "Add Daemon" )
|
|
|
210 |
End If
|
| 5357 |
dpurdie |
211 |
|
| 6874 |
dpurdie |
212 |
' Load some action buttons
|
|
|
213 |
Call objBtnControl.LoadActionButtons ( Array("btnEditDaemon", "btnRemoveDaemon", "btnDeleteDaemon"), OraDatabase )
|
|
|
214 |
objBtnControl.ButtonSpacer = 1
|
|
|
215 |
%>
|
|
|
216 |
</div>
|
|
|
217 |
<div class=listPanel>
|
|
|
218 |
<!-- +++++++++++++++++++++++++++++++++++ -->
|
|
|
219 |
<table class=embedded_table style='width:640px'>
|
|
|
220 |
<thead>
|
|
|
221 |
<th></th>
|
|
|
222 |
<th>DAEMON HOST</th>
|
|
|
223 |
<th>GBE_MACHTYPE</th>
|
|
|
224 |
<th>DAEMON MODE</th>
|
|
|
225 |
<th>GBE_BUILDFILTER</th>
|
|
|
226 |
<%If canActionControlInProject("BuildConfiguration") Then%>
|
|
|
227 |
<th>ACTION</th>
|
|
|
228 |
<%End If%>
|
|
|
229 |
</thead>
|
|
|
230 |
<%
|
|
|
231 |
query_string = "select rcon_id, display_name, rc.bmcon_id, daemon_mode, gbe_value, gbe_buildfilter, NVL(active, 'U') as ACTIVE " &_
|
|
|
232 |
" from release_manager.release_config rc," &_
|
|
|
233 |
" release_manager.build_machine_config bm," &_
|
|
|
234 |
" release_manager.gbe_machtype gbe" &_
|
|
|
235 |
" where rc.rtag_id=" & parRtagId &_
|
|
|
236 |
" and rc.bmcon_id=bm.bmcon_id(+)" &_
|
|
|
237 |
" and rc.gbe_id=gbe.gbe_id" &_
|
|
|
238 |
" order by daemon_mode, bm.display_name"
|
|
|
239 |
Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
|
|
|
240 |
Dim daemon_mode, daemon, cbtype, bActive, bInactiveMachine, dClass
|
|
|
241 |
bInactiveMachine = false
|
| 6548 |
dpurdie |
242 |
|
| 6874 |
dpurdie |
243 |
cbtype = "hidden"
|
|
|
244 |
If canActionControlInProject("BuildConfiguration") Then
|
|
|
245 |
cbtype = "checkbox"
|
|
|
246 |
End If
|
| 6548 |
dpurdie |
247 |
|
| 6874 |
dpurdie |
248 |
'--- Render rows ---
|
|
|
249 |
Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
|
|
|
250 |
rcon_id = rsQry("rcon_id")
|
|
|
251 |
daemon = rsQry("display_name")
|
|
|
252 |
If IsNull(daemon) Then
|
|
|
253 |
daemon = ""
|
|
|
254 |
End If
|
| 6548 |
dpurdie |
255 |
|
| 6874 |
dpurdie |
256 |
If rsQry("daemon_mode") = "M" Then
|
|
|
257 |
daemon_mode = "MASTER"
|
|
|
258 |
Else
|
|
|
259 |
daemon_mode = "SLAVE"
|
|
|
260 |
End If
|
| 6548 |
dpurdie |
261 |
|
| 6874 |
dpurdie |
262 |
bActive = rsQry("active")
|
|
|
263 |
dClass = ""
|
|
|
264 |
If bActive = "N" Then
|
|
|
265 |
bInactiveMachine = true
|
|
|
266 |
dClass = " err_alert strike"
|
|
|
267 |
End If
|
| 6548 |
dpurdie |
268 |
|
| 6874 |
dpurdie |
269 |
%>
|
|
|
270 |
<tr class=border>
|
|
|
271 |
<td class=center><input type=<%=cbtype%> name="rcon_id_list" value="<%=rsQry("rcon_id")%>"></td>
|
|
|
272 |
<td <%=dClass%>"><%=daemon%></td>
|
|
|
273 |
<td><%=rsQry("gbe_value")%></td>
|
|
|
274 |
<td><%=daemon_mode%></td>
|
|
|
275 |
<td class=wrap><%=rsQry("gbe_buildfilter")%></td>
|
|
|
276 |
<%If canActionControlInProject("BuildConfiguration") Then%>
|
|
|
277 |
<td>
|
|
|
278 |
<%Call objBtnControl.Render ( Array("btnEditDaemon", "btnRemoveDaemon", "btnDeleteDaemon"), objAccessControl )%>
|
|
|
279 |
</td>
|
| 6548 |
dpurdie |
280 |
<%End If%>
|
| 6874 |
dpurdie |
281 |
</tr>
|
|
|
282 |
<%
|
|
|
283 |
rsQry.MoveNext
|
|
|
284 |
Loop
|
|
|
285 |
rsQry.Close()
|
|
|
286 |
Set rsQry = nothing
|
|
|
287 |
%>
|
|
|
288 |
</table>
|
|
|
289 |
</div>
|
|
|
290 |
<div>
|
|
|
291 |
<%If masterCount <> 1 OR toolsetWarning OR bInactiveMachine Then %>
|
|
|
292 |
<div class='errorPanel'>
|
|
|
293 |
<table class="full_table">
|
|
|
294 |
<%If masterCount <> 1 Then %>
|
|
|
295 |
<tr>
|
|
|
296 |
<td nowrap class="err_alert">Error
|
|
|
297 |
<td> The set of Build Machines must have exactly one Master.
|
|
|
298 |
</tr>
|
|
|
299 |
<%End If%>
|
|
|
300 |
<%If bInactiveMachine Then %>
|
|
|
301 |
<tr>
|
|
|
302 |
<td nowrap class="err_alert">Error
|
|
|
303 |
<td>One or more of the Build Machines have been deprecated and no longer available for use.
|
|
|
304 |
</tr>
|
|
|
305 |
<%End If%>
|
|
|
306 |
<%If toolsetWarning Then %>
|
|
|
307 |
<tr>
|
|
|
308 |
<td nowrap class="err_alert">Warning
|
|
|
309 |
<td>There should be one TOOLSET builder within each set of machines with the same GBE_MACHTYPE.
|
|
|
310 |
</tr>
|
|
|
311 |
<%End If%>
|
|
|
312 |
</table>
|
|
|
313 |
</div>
|
|
|
314 |
<%End If%>
|
|
|
315 |
<div class='buttonPanel'>
|
|
|
316 |
<!-- ACTION BUTTONS ---------------------------------------------->
|
|
|
317 |
<%=objFormComponent.CancelButton ( "OK", "", "build_status.asp?rtag_id="& parRtagId )%>
|
|
|
318 |
<%=objPMod.ComposeHiddenTags()%>
|
|
|
319 |
<%If canActionControlInProject("BuildConfiguration") Then%>
|
|
|
320 |
<input name="btn" type="submit" value="Unlink">
|
|
|
321 |
<input name="btn" type="submit" value="Delete">
|
|
|
322 |
<%End If%>
|
|
|
323 |
<input type="hidden" name="rcon_id_list" value="<%=Request("rcon_id_list")%>">
|
|
|
324 |
<input type="hidden" name="action" value="true">
|
|
|
325 |
<!-- ACTION BUTTONS END ------------------------------------------></td>
|
|
|
326 |
</div>
|
|
|
327 |
</div>
|
|
|
328 |
</div>
|
| 6548 |
dpurdie |
329 |
<%
|
|
|
330 |
Call objFormComponent.FormEnd()
|
|
|
331 |
'-- FROM END ----------------------------------------------------------------------------------------------------------------
|
|
|
332 |
End Sub
|
|
|
333 |
'---------------------------------------------------------------------
|
|
|
334 |
%>
|
| 5357 |
dpurdie |
335 |
<html>
|
| 6873 |
dpurdie |
336 |
<!-- StyleSheet Extensions -->
|
| 5357 |
dpurdie |
337 |
<head>
|
|
|
338 |
<title>Release Manager</title>
|
|
|
339 |
<link rel="shortcut icon" href="<%=FavIcon%>"/>
|
|
|
340 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
341 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
| 6579 |
dpurdie |
342 |
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
|
|
|
343 |
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
|
|
|
344 |
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
|
| 5357 |
dpurdie |
345 |
<!--#include file="_jquery_includes.asp"-->
|
|
|
346 |
<!-- DROPDOWN MENUS -->
|
|
|
347 |
<!--#include file="_menu_def.asp"-->
|
| 6579 |
dpurdie |
348 |
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
|
| 5357 |
dpurdie |
349 |
</head>
|
|
|
350 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
|
|
|
351 |
<!-- HEADER -->
|
|
|
352 |
<!--#include file="_header.asp"-->
|
|
|
353 |
<!-- BODY ---->
|
| 6548 |
dpurdie |
354 |
<table class="full_table">
|
| 5357 |
dpurdie |
355 |
<tr>
|
| 6876 |
dpurdie |
356 |
<td width="146px" class="bg_panel" valign="top">
|
| 6548 |
dpurdie |
357 |
<%Call BuildMenuPane%>
|
|
|
358 |
</td>
|
| 5357 |
dpurdie |
359 |
<td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
|
| 6548 |
dpurdie |
360 |
<%Call ShowBuildConfig%>
|
| 5357 |
dpurdie |
361 |
</td>
|
|
|
362 |
</tr>
|
|
|
363 |
<tr>
|
| 6876 |
dpurdie |
364 |
<td class="bg_panel" valign="bottom" align="center" height="350">
|
| 6548 |
dpurdie |
365 |
<img src="images/img_gears.png" vspace="20" hspace="30"></td>
|
| 5357 |
dpurdie |
366 |
</tr>
|
|
|
367 |
</table>
|
| 6548 |
dpurdie |
368 |
<!-- FOOTER -->
|
|
|
369 |
<!--#include file="_footer.asp"-->
|
|
|
370 |
</body>
|
| 5357 |
dpurdie |
371 |
</html>
|