| 5357 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
|
|
4 |
'| |
|
|
|
5 |
'| wAddDaemon |
|
|
|
6 |
'| |
|
|
|
7 |
'=====================================================
|
|
|
8 |
%>
|
|
|
9 |
<%
|
|
|
10 |
Option explicit
|
|
|
11 |
Response.Expires = 0
|
|
|
12 |
%>
|
|
|
13 |
<!--#include file="common/conf.asp"-->
|
|
|
14 |
<!--#include file="common/globals.asp"-->
|
|
|
15 |
<!--#include file="common/formating.asp"-->
|
|
|
16 |
<!--#include file="common/qstr.asp"-->
|
|
|
17 |
<!--#include file="common/common_subs.asp"-->
|
|
|
18 |
<!--#include file="common/_form_window_common.asp"-->
|
|
|
19 |
<%
|
|
|
20 |
'------------ ACCESS CONTROL ------------------
|
|
|
21 |
%>
|
|
|
22 |
<!--#include file="_access_control_general.asp"-->
|
|
|
23 |
<!--#include file="_access_control_login.asp"-->
|
|
|
24 |
<%
|
|
|
25 |
'------------ VARIABLE DEFINITION -------------
|
|
|
26 |
Dim rsQry, healthTag, cmdInterface, pkgOwner, isInterface, package, procDesc
|
|
|
27 |
Dim sMessage
|
|
|
28 |
Dim Query_String
|
|
|
29 |
Dim RecordCount
|
|
|
30 |
Dim bmcon_id
|
|
|
31 |
Dim gbe_id
|
|
|
32 |
Dim gbe_value
|
|
|
33 |
Dim daemon_mode
|
|
|
34 |
Dim gbe_buildfilter
|
|
|
35 |
Dim bShowEmpty
|
|
|
36 |
'------------ CONSTANTS DECLARATION -----------
|
|
|
37 |
'------------ VARIABLE INIT -------------------
|
|
|
38 |
sMessage = NULL
|
|
|
39 |
|
|
|
40 |
parRtag_id = Request("rtag_id")
|
|
|
41 |
|
|
|
42 |
Set objFormCollector = CreateObject("Scripting.Dictionary")
|
|
|
43 |
'------------ CONDITIONS ----------------------
|
|
|
44 |
'----------------------------------------------
|
|
|
45 |
%>
|
|
|
46 |
<%
|
|
|
47 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
48 |
'-------------------------------------------------
|
|
|
49 |
' Function: GetMachHost
|
|
|
50 |
' Description: Determine the current Display Host Information for a given BMCON_ID
|
|
|
51 |
' Do not show build machines that are no longer 'allowed' unless
|
|
|
52 |
' it is currently selected.
|
|
|
53 |
' Arguments: abmcon_id - A BMCON_ID
|
|
|
54 |
'
|
|
|
55 |
' Returns: An array with 5 elements in it - to be used in creating a multicolum drop down list
|
|
|
56 |
'
|
|
|
57 |
Function GetMachHost (abmcon_id)
|
|
|
58 |
Dim rsQry, query
|
|
|
59 |
|
|
|
60 |
OraDatabase.Parameters.Add "bmcon_id", abmcon_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
61 |
|
|
|
62 |
query = "SELECT bm.bmcon_id," &_
|
|
|
63 |
"display_name," &_
|
|
|
64 |
"gbe_value," &_
|
|
|
65 |
"COALESCE(SUBSTR(description,1,INSTR(description,CHR(10),1,1)),description) as description," &_
|
|
|
66 |
"DECODE(:bmcon_id, bm.bmcon_id, 'selected', NULL) AS SELECTED" &_
|
|
|
67 |
" FROM build_machine_config bm," &_
|
|
|
68 |
" gbe_machtype gb " &_
|
|
|
69 |
" WHERE bm.gbe_id = gb.gbe_id " &_
|
|
|
70 |
" and (bm.active = 'Y' OR bm.bmcon_id = :bmcon_id )" &_
|
|
|
71 |
" ORDER by bm.display_name"
|
|
|
72 |
|
|
|
73 |
Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
|
|
|
74 |
If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
|
|
|
75 |
GetMachHost = rsQry.GetRows()
|
|
|
76 |
Else
|
|
|
77 |
GetMachHost = NULL
|
|
|
78 |
End If
|
|
|
79 |
|
|
|
80 |
rsQry.Close()
|
|
|
81 |
Set rsQry = Nothing
|
|
|
82 |
|
|
|
83 |
OraDatabase.Parameters.Remove "bmcon_id"
|
|
|
84 |
End Function
|
|
|
85 |
|
|
|
86 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
87 |
%>
|
|
|
88 |
<%
|
|
|
89 |
'------------ RUN BEFORE PAGE RENDER ----------
|
|
|
90 |
|
|
|
91 |
If CBool(Request("action")) Then
|
|
|
92 |
|
|
|
93 |
If Request("bmcon_id") = "" Then
|
|
|
94 |
sMessage = "Select a Build Machine before updating the entry"
|
|
|
95 |
Else
|
|
|
96 |
|
|
|
97 |
' Add or Update after the users edit session
|
|
|
98 |
If Request("rcon_id") <> "" Then
|
|
|
99 |
|
|
|
100 |
OraDatabase.Parameters.Add "RCON_ID", Request("rcon_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
101 |
OraDatabase.Parameters.Add "BMCON_ID", Request("bmcon_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
102 |
OraDatabase.Parameters.Add "DAEMON_MODE", Request("daemon_mode"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
103 |
OraDatabase.Parameters.Add "GBE_BUILDFILTER", Request("gbe_buildfilter"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
104 |
|
|
|
105 |
objEH.TryORA ( OraSession )
|
|
|
106 |
On Error Resume Next
|
|
|
107 |
|
|
|
108 |
OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.UPDATE_DAEMON_CONFIG(:RCON_ID, :BMCON_ID, :DAEMON_MODE, :GBE_BUILDFILTER); END;"
|
|
|
109 |
OraSession.CommitTrans
|
|
|
110 |
|
|
|
111 |
objEH.CatchORA ( OraSession )
|
|
|
112 |
|
|
|
113 |
OraDatabase.Parameters.Remove "RCON_ID"
|
|
|
114 |
OraDatabase.Parameters.Remove "BMCON_ID"
|
|
|
115 |
OraDatabase.Parameters.Remove "DAEMON_MODE"
|
|
|
116 |
OraDatabase.Parameters.Remove "GBE_BUILDFILTER"
|
|
|
117 |
|
|
|
118 |
If objEH.Finally Then
|
|
|
119 |
Call OpenInParentWindow ("release_config.asp?rtag_id="&parRtag_id)
|
|
|
120 |
Call CloseWindow()
|
|
|
121 |
End If
|
|
|
122 |
|
|
|
123 |
rsQry.Close
|
|
|
124 |
Set rsQry = nothing
|
|
|
125 |
|
|
|
126 |
Else
|
|
|
127 |
OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
128 |
OraDatabase.Parameters.Add "BMCON_ID", Request("bmcon_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
129 |
OraDatabase.Parameters.Add "DAEMON_MODE", Request("daemon_mode"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
130 |
OraDatabase.Parameters.Add "GBE_BUILDFILTER", Request("gbe_buildfilter"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
131 |
|
|
|
132 |
objEH.TryORA ( OraSession )
|
|
|
133 |
On Error Resume Next
|
|
|
134 |
|
|
|
135 |
OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.ADD_DAEMON_CONFIG(:RTAG_ID, :BMCON_ID, :DAEMON_MODE, :GBE_BUILDFILTER); END;"
|
|
|
136 |
|
|
|
137 |
objEH.CatchORA ( OraSession )
|
|
|
138 |
|
|
|
139 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
140 |
OraDatabase.Parameters.Remove "BMCON_ID"
|
|
|
141 |
OraDatabase.Parameters.Remove "DAEMON_MODE"
|
|
|
142 |
OraDatabase.Parameters.Remove "GBE_BUILDFILTER"
|
|
|
143 |
|
|
|
144 |
If objEH.Finally Then
|
|
|
145 |
Call OpenInParentWindow ("release_config.asp?rtag_id="&parRtag_id)
|
|
|
146 |
Call CloseWindow()
|
|
|
147 |
End If
|
|
|
148 |
|
|
|
149 |
rsQry.Close
|
|
|
150 |
Set rsQry = nothing
|
|
|
151 |
|
|
|
152 |
End If
|
|
|
153 |
End If
|
|
|
154 |
End If
|
|
|
155 |
'----------------------------------------------
|
|
|
156 |
%>
|
|
|
157 |
<html>
|
|
|
158 |
<head>
|
|
|
159 |
<title>Release Manager</title>
|
|
|
160 |
<link rel="shortcut icon" href="<%=FavIcon%>"/>
|
|
|
161 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
162 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
163 |
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
|
|
|
164 |
<script language="JavaScript" src="scripts/common.js"></script>
|
|
|
165 |
</head>
|
|
|
166 |
|
|
|
167 |
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.bmcon_id.focus();">
|
|
|
168 |
<table width="100%" border="0" cellspacing="0" cellpadding="10">
|
|
|
169 |
<tr>
|
|
|
170 |
<td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle"> Add/Update DAEMON</span> <br>
|
|
|
171 |
Add a new DAEMON or edit an existing DAEMON.
|
|
|
172 |
</td>
|
|
|
173 |
</tr>
|
|
|
174 |
|
|
|
175 |
<%
|
|
|
176 |
'-- FROM START --------------------------------------------------------------------------------------------------------------
|
|
|
177 |
objFormComponent.FormName = "FormName"
|
|
|
178 |
objFormComponent.Action = ScriptName
|
|
|
179 |
objFormComponent.OnSubmit = "ShowProgress();"
|
|
|
180 |
Call objFormComponent.FormStart()
|
|
|
181 |
|
|
|
182 |
%>
|
|
|
183 |
<tr>
|
|
|
184 |
<td background="images/bg_login.gif">
|
|
|
185 |
<table width="50%" border="0" cellspacing="0" cellpadding="0">
|
|
|
186 |
<tr>
|
|
|
187 |
<td><%=ProgressBar()%></td>
|
|
|
188 |
<td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update">
|
|
|
189 |
<input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
|
|
|
190 |
</td>
|
|
|
191 |
</tr>
|
|
|
192 |
</table>
|
|
|
193 |
</td>
|
|
|
194 |
</tr>
|
|
|
195 |
<tr>
|
|
|
196 |
<td>
|
|
|
197 |
<!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
198 |
<%Call Messenger ( sMessage , 3, "100%" )%>
|
|
|
199 |
<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
200 |
<!--#include file="messages/_msg_inline.asp"-->
|
|
|
201 |
<%
|
|
|
202 |
' Determine if any daemons have been configured in this release
|
|
|
203 |
' Will be used to determine if a new entry should be a MASTER or a SLAVE
|
|
|
204 |
'
|
|
|
205 |
Query_String = "select * " &_
|
|
|
206 |
" from release_config rc," &_
|
|
|
207 |
" gbe_machtype gbe " &_
|
|
|
208 |
" where rc.rtag_id = "& parRtag_id &_
|
|
|
209 |
" and gbe.gbe_id = rc.gbe_id"
|
|
|
210 |
|
|
|
211 |
Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
212 |
|
|
|
213 |
RecordCount = rsQry.RecordCount
|
|
|
214 |
If RecordCount = 0 Then
|
|
|
215 |
daemon_mode = "M"
|
|
|
216 |
else
|
|
|
217 |
daemon_mode = "S"
|
|
|
218 |
End If
|
|
|
219 |
rsQry.Close()
|
|
|
220 |
|
|
|
221 |
Set rsQry = Nothing
|
|
|
222 |
%>
|
|
|
223 |
<%If Request("rcon_id") <> "" Then%>
|
|
|
224 |
<input type="hidden" name="rcon_id" value="<%=Request("rcon_id")%>">
|
|
|
225 |
<%
|
|
|
226 |
' Edit an existing entry
|
|
|
227 |
' May have a link into the build_machine_config - or it may not
|
|
|
228 |
' Check first
|
|
|
229 |
Dim rsTemp
|
|
|
230 |
bShowEmpty = TRUE
|
|
|
231 |
|
|
|
232 |
Query_String = "SELECT * " &_
|
|
|
233 |
" FROM RELEASE_CONFIG rc," &_
|
|
|
234 |
" gbe_machtype gb" &_
|
|
|
235 |
" WHERE rc.rcon_id = "& Request("rcon_id") &_
|
|
|
236 |
" AND rc.gbe_id = gb.gbe_id"
|
|
|
237 |
|
|
|
238 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
239 |
|
|
|
240 |
If rsTemp.RecordCount > 0 Then
|
|
|
241 |
bmcon_id = rsTemp("bmcon_id")
|
|
|
242 |
daemon_mode = rsTemp("daemon_mode")
|
|
|
243 |
gbe_id = rsTemp("gbe_id")
|
|
|
244 |
gbe_value = rsTemp("gbe_value")
|
|
|
245 |
gbe_buildfilter = rsTemp("gbe_buildfilter")
|
|
|
246 |
End If
|
|
|
247 |
|
|
|
248 |
rsTemp.Close()
|
|
|
249 |
Set rsTemp = Nothing
|
|
|
250 |
|
|
|
251 |
If NOT isNULL(bmcon_id) AND bmcon_id <> "" Then
|
|
|
252 |
|
|
|
253 |
' Extract information from the machine config
|
|
|
254 |
Query_String = "SELECT * " &_
|
|
|
255 |
" FROM build_machine_config bc, " &_
|
|
|
256 |
" gbe_machtype gb " &_
|
|
|
257 |
"WHERE bc.bmcon_id = " & bmcon_id &_
|
|
|
258 |
" AND bc.gbe_id = gb.gbe_id"
|
|
|
259 |
|
|
|
260 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
261 |
|
|
|
262 |
If rsTemp.RecordCount > 0 Then
|
|
|
263 |
bmcon_id = rsTemp("bmcon_id")
|
|
|
264 |
gbe_id = rsTemp("gbe_id")
|
|
|
265 |
gbe_value = rsTemp("gbe_value")
|
|
|
266 |
bShowEmpty = FALSE
|
|
|
267 |
End If
|
|
|
268 |
|
|
|
269 |
rsTemp.Close()
|
|
|
270 |
Set rsTemp = Nothing
|
|
|
271 |
End If
|
|
|
272 |
End If
|
|
|
273 |
%>
|
|
|
274 |
<table width="50%" border="0">
|
|
|
275 |
<tr>
|
|
|
276 |
<td><span class="body_txt">Daemon Host</span></td>
|
|
|
277 |
<td>
|
|
|
278 |
<%=objFormComponent.Combo_Multi ( "bmcon_id", GetMachHost(bmcon_id), bShowEmpty, "class='body_txt'",3,"20,20,50")%>
|
|
|
279 |
</td>
|
|
|
280 |
</tr>
|
|
|
281 |
<tr>
|
|
|
282 |
<td><span class="body_txt">Daemon Mode</span></td>
|
|
|
283 |
<td>
|
|
|
284 |
<select name="daemon_mode" class='body_txt'>
|
|
|
285 |
<option value=M <%=iif(daemon_mode="M","selected","")%>>MASTER</option>
|
|
|
286 |
<option value=S <%=iif(daemon_mode="S","selected","")%>>SLAVE</option>
|
|
|
287 |
</select>
|
|
|
288 |
</td>
|
|
|
289 |
</tr>
|
|
|
290 |
<tr>
|
|
|
291 |
<tr>
|
|
|
292 |
<td><span class="body_txt">GBE_BUILDFILTER</span></td>
|
|
|
293 |
<td><input name="gbe_buildfilter" type="text" class="body_txt" size="80" value="<%=gbe_buildfilter%>"></td>
|
|
|
294 |
</tr>
|
|
|
295 |
</tr>
|
|
|
296 |
<tr>
|
|
|
297 |
<td> </td>
|
|
|
298 |
<td> </td>
|
|
|
299 |
</tr>
|
|
|
300 |
</table>
|
|
|
301 |
</td>
|
|
|
302 |
</tr>
|
|
|
303 |
<%=objPMod.ComposeHiddenTags()%>
|
|
|
304 |
<input type="hidden" name="action" value="true">
|
|
|
305 |
|
|
|
306 |
<%
|
|
|
307 |
Call objFormComponent.FormEnd()
|
|
|
308 |
'-- FROM END ----------------------------------------------------------------------------------------------------------------
|
|
|
309 |
%>
|
|
|
310 |
</table>
|
|
|
311 |
</body>
|
|
|
312 |
</html>
|
|
|
313 |
<%
|
|
|
314 |
'------------ RUN AFTER PAGE RENDER -----------
|
|
|
315 |
Set objFormCollector = Nothing
|
|
|
316 |
'----------------------------------------------
|
|
|
317 |
Call Destroy_All_Objects
|
|
|
318 |
%>
|