Subversion Repositories DevTools

Rev

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