Subversion Repositories DevTools

Rev

Details | 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
 
22
<!--#include file="class/classActionButtonControl.asp"-->
23
<%
24
objPMod.PersistInQryString("proj_id")
25
'------------ ACCESS CONTROL ------------------
26
'Let users view the build configuration without being logged in, but as soon as they try and submit the form, check
27
'their login status.
28
If Request("action") <> "" AND NOT objAccessControl.UserLogedIn Then%>
29
<!--#include file="_access_control_login.asp"-->
30
<!--#include file="_access_control_project.asp"-->
31
<%End If%>
32
<!--#include file="_access_control_general.asp"-->
33
<%
34
'------------ Variable Definition -------------
35
Dim objSortHelper
36
Dim rsQry
37
Dim parRtagId
38
Dim query_string
39
Dim objBtnControl
40
Dim rcon_id
41
'------------ Constants Declaration -----------
42
'------------ Variable Init -------------------
43
parRtagId = Request("rtag_id")
44
objPMod.PersistInQryString("rtag_id")
45
Set objBtnControl = New ActionButtonControl
46
'----------------------------------------------
47
%>
48
<%
49
'--------------------------------------------------------------------------------------------------------------------------
50
Sub GetFormDetails ( parRtagId, ByRef outobjDetails )
51
   Dim rsQry, query
52
 
53
 
54
   OraDatabase.Parameters.Add "RTAG_ID",    parRtagId,      ORAPARM_INPUT, ORATYPE_NUMBER
55
 
56
   query = _
57
   " SELECT * "&_
58
   "  FROM RELEASE_TAGS rt"&_
59
   " WHERE rt.RTAG_ID = :RTAG_ID"
60
 
61
   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
62
 
63
   OraDatabase.Parameters.Remove "RTAG_ID"
64
 
65
 
66
 
67
   If rsQry.RecordCount > 0 Then
68
      outobjDetails.Item ("rtag_id") = rsQry("rtag_id")
69
      outobjDetails.Item ("rtag_name") = rsQry("rtag_name")
70
   Else
71
      Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. parRtagId="& parRtagId
72
 
73
   End If
74
 
75
   rsQry.Close
76
   Set rsQry = Nothing
77
End Sub
78
'--------------------------------------------------------------------------------------------------------------------------
79
Sub DeleteDaemon(rcon_id_list)
80
 
81
   OraDatabase.Parameters.Add "RCON_ID_LIST",   rcon_id_list,    ORAPARM_INPUT, ORATYPE_VARCHAR2
82
 
83
   On Error Resume Next
84
   objEH.TryORA()
85
 
86
   OraDatabase.ExecuteSQL "BEGIN  PK_BUILDAPI.DELETE_DAEMON(:RCON_ID_LIST);  END;"
87
 
88
   objEH.CatchORA ( OraSession )
89
 
90
   OraDatabase.Parameters.Remove "RCON_ID_LIST"
91
End Sub
92
'--------------------------------------------------------------------------------------------------------------------------
93
Sub RemoveDaemon(rcon_id_list)
94
 
95
   OraDatabase.Parameters.Add "RCON_ID_LIST",   rcon_id_list,    ORAPARM_INPUT, ORATYPE_VARCHAR2
96
 
97
   On Error Resume Next
98
   objEH.TryORA()
99
 
100
   OraDatabase.ExecuteSQL "BEGIN  PK_BUILDAPI.REMOVE_DAEMON(:RCON_ID_LIST);  END;"
101
 
102
   objEH.CatchORA ( OraSession )
103
 
104
   OraDatabase.Parameters.Remove "RCON_ID_LIST"
105
End Sub
106
'--------------------------------------------------------------------------------------------------------------------------
107
%>
108
<%
109
'------------ RUN BEFORE PAGE RENDER ----------
110
' --- Get Form details from DB ---
111
Call GetFormDetails ( Request("rtag_id"), objFormCollector )
112
 
113
' --- Load Validation Rules ---
114
'Call objForm.LoadValidationRules ( Array("rtag_name","rtag_description", "config_spec_branch"), OraDatabase )      ' Load Validation Rules
115
 
116
' --- Enter Form Validation Rule Changes here... ----
117
'----------------------------------------------------
118
 
119
' --- RUN onPostBack ---
120
If Request("action") <> "" AND objAccessControl.UserLogedIn Then
121
   If objForm.IsValidOnPostBack Then
122
      If canActionControlInProject("BuildConfiguration") Then
123
         If Request("btn") = "Delete" Then
124
             Call DeleteDaemon(Request("rcon_id_list"))
125
         ElseIf Request("btn") = "Unlink" Then
126
             Call RemoveDaemon(Request("rcon_id_list"))
127
        End If
128
      End If
129
 
130
      If objEH.Finally Then
131
         Call OpenInWindow ( "release_config.asp?rtag_id="& parRtagId )
132
      End If
133
 
134
   End If
135
 
136
End If
137
 
138
'----------------------------------------------
139
%>
140
 
141
<html>
142
   <head>
143
      <title>Release Manager</title>
144
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
145
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
146
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
147
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
148
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
149
      <script language="JavaScript" src="images/common.js"></script>
150
      <!--#include file="_jquery_includes.asp"-->
151
      <!-- DROPDOWN MENUS -->
152
      <!--#include file="_menu_def.asp"-->
153
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
154
   </head>
155
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
156
      <!-- MENU LAYERS -------------------------------------->
157
      <div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">
158
      </div>
159
      <!-- TIPS LAYERS -------------------------------------->
160
      <div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
161
      <!----------------------------------------------------->
162
      <!-- HEADER -->
163
      <!--#include file="_header.asp"-->
164
      <!-- BODY ---->
165
 
166
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
167
         <%
168
         '-- FROM START ---------------------------------------------------------------------------------------------------------
169
         objFormComponent.FormName = "FormName"
170
         objFormComponent.Action = ScriptName
171
         Call objFormComponent.FormStart()
172
         %>
173
         <tr>
174
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
175
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
176
               <table width="10" border="0" cellspacing="0" cellpadding="0">
177
                  <tr>
178
                     <td width="1%"></td>
179
                     <td width="100%">
180
                        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
181
                           <tr>
182
                              <td nowrap class="body_txt"></td>
183
                           </tr>
184
                        </table>
185
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
186
                           <tr>
187
                              <td nowrap class="form_ttl">
188
                                 <p>&nbsp;</p>
189
                                 <p>
190
                                    <%If canActionControlInProject("BuildConfiguration") Then%>
191
                                       ADMINISTER
192
                                    <%Else%>
193
                                       VIEW
194
                                    <%End If%>
195
                                    BUILD CONFIGURATION
196
                                 </p>
197
                              </td>
198
                              <td align="right" valign="bottom"></td>
199
                           </tr>
200
                        </table>
201
                     </td>
202
                     <td width="1%"></td>
203
                  </tr>
204
                  <tr>
205
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
206
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
207
                     <td align="right" valign="top"  background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
208
                  </tr>
209
                  <tr>
210
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
211
                     <td bgcolor="#FFFFFF" valign="top">
212
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
213
                        <!--#include file="messages/_msg_inline.asp"-->
214
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
215
                        <br>
216
                        <!-- BUTTONS CONTROL +++++++++++++++++++ -->
217
                        <%
218
                        If canActionControlInProject("BuildConfiguration") Then
219
                           Call Action_Buttons ( "Add Daemon" )
220
                        End If
221
 
222
                        ' Load some action buttons
223
                        Call objBtnControl.LoadActionButtons ( Array("btnEditDaemon", "btnRemoveDaemon", "btnDeleteDaemon"), OraDatabase )
224
                        objBtnControl.ButtonSpacer = 1
225
 
226
                        %>
227
 
228
                        <!-- +++++++++++++++++++++++++++++++++++ -->
229
 
230
                        <table width="100%"  border="0" cellspacing="2" cellpadding="0">
231
                     </td>
232
                     <td width="9%" valign="top"></td>
233
                  </tr>
234
                  <tr>
235
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"></td>
236
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">DAEMON HOST</td>
237
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">GBE_MACHTYPE</td>
238
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">DAEMON MODE</td>
239
                     <td valign="top"   wrap background="images/bg_table_col.gif" class="body_col">GBE_BUILDFILTER</td>
240
                     <%If canActionControlInProject("BuildConfiguration") Then%>
241
                        <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">ACTION</td>
242
                     <%End If%>
243
                     <td valign="top">
244
                  </tr>
245
                  <%
246
 
247
                  query_string = "select rcon_id, display_name, rc.bmcon_id, daemon_mode, gbe_value, gbe_buildfilter " &_
248
                                 " from release_manager.release_config rc," &_
249
                                 "      release_manager.build_machine_config bm," &_
250
                                 "      release_manager.gbe_machtype gbe" &_
251
                                 " where rc.rtag_id=" & parRtagId &_
252
                                 "      and rc.bmcon_id=bm.bmcon_id(+)" &_
253
                                 "      and rc.gbe_id=gbe.gbe_id" &_
254
                                 " order by daemon_mode, bm.display_name"
255
                  Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
256
                  Dim daemon_mode, daemon, cbtype
257
 
258
                  cbtype = "hidden"
259
                  If canActionControlInProject("BuildConfiguration") Then
260
                     cbtype = "checkbox"
261
                  End If
262
 
263
                  '--- Render rows ---
264
                  Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
265
                     rcon_id = rsQry("rcon_id")
266
                     daemon  = rsQry("display_name")
267
                     If IsNull(daemon) Then
268
                         daemon = ""
269
                     End If
270
 
271
                     If rsQry("daemon_mode") = "M" Then
272
                        daemon_mode = "MASTER"
273
                     Else
274
                        daemon_mode = "SLAVE"
275
                     End If
276
                     %>
277
                     <tr>
278
                        <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
279
                     </tr>
280
                     <tr>
281
                        <td valign="top" align="center"><input type=<%=cbtype%> name="rcon_id_list" value="<%=rsQry("rcon_id")%>"></td>
282
                        <td valign="top"    nowrap class="body_rowg"><%=daemon%></td>
283
                        <td valign="top"    nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
284
                        <td valign="top"    nowrap class="body_rowg"><%=daemon_mode%></td>
285
                        <td valign="top"      wrap class="body_rowg"><%=rsQry("gbe_buildfilter")%></td>
286
                        <%If canActionControlInProject("BuildConfiguration") Then%>
287
                           <td valign="top" nowrap class="body_rowg"><%Call objBtnControl.Render  ( Array("btnEditDaemon", "btnRemoveDaemon", "btnDeleteDaemon"), objAccessControl )%></td>
288
                        <%End If%>
289
                     </tr>
290
                     <%
291
                     rsQry.MoveNext
292
                  Loop
293
                  rsQry.Close()
294
                  Set rsQry = nothing
295
                  %>
296
 
297
                  <tr>
298
                     <td class="form_iname">&nbsp;</td>
299
                     <td>&nbsp;</td>
300
                     <td class="val_err"></td>
301
                  </tr>
302
               </table>
303
 
304
 
305
            </td>
306
            <td background="images/lbox_bgside_white.gif">&nbsp;</td>
307
         </tr>
308
         <tr>
309
            <td background="images/bg_action_norm.gif" ></td>
310
            <td align="right" background="images/bg_action_norm.gif" >
311
 
312
               <%=objFormComponent.CancelButton ( "OK", "class='form_btn'", "build_status.asp?rtag_id="& parRtagId )%>
313
               <%=objPMod.ComposeHiddenTags()%>
314
               <%If canActionControlInProject("BuildConfiguration") Then%>
315
                  <input name="btn" type="submit" class="form_btn" value="Unlink">
316
                  <input name="btn" type="submit" class="form_btn" value="Delete">
317
               <%End If%>
318
               <input type="hidden" name="rcon_id_list" value="<%=Request("rcon_id_list")%>">
319
               <input type="hidden" name="action" value="true">
320
            </td>
321
            <td background="images/bg_action_norm.gif" ><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
322
         </tr>
323
         <tr>
324
            <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
325
            <td background="images/lbox_bg_blue.gif"></td>
326
            <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
327
         </tr>
328
      </table>
329
 
330
      <!-- ACTION BUTTONS ---------------------------------------------->
331
      <!-- ACTION BUTTONS END  ------------------------------------------></td>
332
      <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
333
  </tr>
334
  <tr>
335
    <td valign="bottom" align="center" background="images/bg_home_orange.gif"><img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30"></td>
336
    <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="500"></td>
337
  </tr>
338
<%
339
Call objFormComponent.FormEnd()
340
'-- FROM END ----------------------------------------------------------------------------------------------------------------
341
%>
342
</table>
343
 
344
 
345
<!-- FOOTER -->
346
<!--#include file="_footer.asp"-->
347
</body>
348
</html>
349
<%
350
Call Destroy_All_Objects
351
%>