Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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