Subversion Repositories DevTools

Rev

Rev 5591 | Rev 6048 | 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
'|          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
' --- Enter Form Validation Rule Changes here... ----
114
'----------------------------------------------------
115
 
116
' --- RUN onPostBack ---
117
If Request("action") <> "" AND objAccessControl.UserLogedIn Then
118
   If objForm.IsValidOnPostBack Then
119
      If canActionControlInProject("BuildConfiguration") Then
120
         If Request("btn") = "Delete" Then
121
             Call DeleteDaemon(Request("rcon_id_list"))
122
         ElseIf Request("btn") = "Unlink" Then
123
             Call RemoveDaemon(Request("rcon_id_list"))
124
        End If
125
      End If
126
 
127
      If objEH.Finally Then
128
         Call OpenInWindow ( "release_config.asp?rtag_id="& parRtagId )
129
      End If
130
 
131
   End If
132
 
133
End If
134
 
135
'----------------------------------------------
136
%>
137
 
138
<html>
139
   <head>
140
      <title>Release Manager</title>
141
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
142
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
143
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
144
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
145
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
146
      <script language="JavaScript" src="images/common.js"></script>
147
      <!--#include file="_jquery_includes.asp"-->
148
      <!-- DROPDOWN MENUS -->
149
      <!--#include file="_menu_def.asp"-->
150
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
151
   </head>
152
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
153
      <!-- MENU LAYERS -------------------------------------->
154
      <div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">
155
      </div>
156
      <!-- TIPS LAYERS -------------------------------------->
157
      <div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
158
      <!----------------------------------------------------->
159
      <!-- HEADER -->
160
      <!--#include file="_header.asp"-->
161
      <!-- BODY ---->
162
 
163
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
164
         <%
165
         '-- FROM START ---------------------------------------------------------------------------------------------------------
166
         objFormComponent.FormName = "FormName"
167
         objFormComponent.Action = ScriptName
168
         Call objFormComponent.FormStart()
169
         %>
170
         <tr>
171
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
172
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
173
               <table width="10" border="0" cellspacing="0" cellpadding="0">
174
                  <tr>
175
                     <td width="1%"></td>
176
                     <td width="100%">
177
                        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
178
                           <tr>
179
                              <td nowrap class="body_txt"></td>
180
                           </tr>
181
                        </table>
182
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
183
                           <tr>
184
                              <td nowrap class="form_ttl">
185
                                 <p>&nbsp;</p>
186
                                 <p>
187
                                    <%If canActionControlInProject("BuildConfiguration") Then%>
188
                                       ADMINISTER
189
                                    <%Else%>
190
                                       VIEW
191
                                    <%End If%>
192
                                    BUILD CONFIGURATION
193
                                 </p>
194
                              </td>
195
                              <td align="right" valign="bottom"></td>
196
                           </tr>
197
                        </table>
198
                     </td>
199
                     <td width="1%"></td>
200
                  </tr>
201
                  <tr>
202
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
203
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
204
                     <td align="right" valign="top"  background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
205
                  </tr>
206
                  <tr>
207
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
208
                     <td bgcolor="#FFFFFF" valign="top">
209
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
210
                        <!--#include file="messages/_msg_inline.asp"-->
211
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
212
                        <br>
213
                        <!-- BUTTONS CONTROL +++++++++++++++++++ -->
214
                        <%
215
                        If canActionControlInProject("BuildConfiguration") Then
216
                           Call Action_Buttons ( "Add Daemon" )
217
                        End If
218
 
219
                        ' Load some action buttons
220
                        Call objBtnControl.LoadActionButtons ( Array("btnEditDaemon", "btnRemoveDaemon", "btnDeleteDaemon"), OraDatabase )
221
                        objBtnControl.ButtonSpacer = 1
222
 
223
                        %>
224
 
225
                        <!-- +++++++++++++++++++++++++++++++++++ -->
226
 
227
                        <table width="100%"  border="0" cellspacing="2" cellpadding="0">
228
                     </td>
229
                     <td width="9%" valign="top"></td>
230
                  </tr>
231
                  <tr>
232
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"></td>
233
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">DAEMON HOST</td>
234
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">GBE_MACHTYPE</td>
235
                     <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">DAEMON MODE</td>
236
                     <td valign="top"   wrap background="images/bg_table_col.gif" class="body_col">GBE_BUILDFILTER</td>
237
                     <%If canActionControlInProject("BuildConfiguration") Then%>
238
                        <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">ACTION</td>
239
                     <%End If%>
240
                     <td valign="top">
241
                  </tr>
242
                  <%
243
 
244
                  query_string = "select rcon_id, display_name, rc.bmcon_id, daemon_mode, gbe_value, gbe_buildfilter " &_
245
                                 " from release_manager.release_config rc," &_
246
                                 "      release_manager.build_machine_config bm," &_
247
                                 "      release_manager.gbe_machtype gbe" &_
248
                                 " where rc.rtag_id=" & parRtagId &_
249
                                 "      and rc.bmcon_id=bm.bmcon_id(+)" &_
250
                                 "      and rc.gbe_id=gbe.gbe_id" &_
251
                                 " order by daemon_mode, bm.display_name"
252
                  Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
253
                  Dim daemon_mode, daemon, cbtype
254
 
255
                  cbtype = "hidden"
256
                  If canActionControlInProject("BuildConfiguration") Then
257
                     cbtype = "checkbox"
258
                  End If
259
 
260
                  '--- Render rows ---
261
                  Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
262
                     rcon_id = rsQry("rcon_id")
263
                     daemon  = rsQry("display_name")
264
                     If IsNull(daemon) Then
265
                         daemon = ""
266
                     End If
267
 
268
                     If rsQry("daemon_mode") = "M" Then
269
                        daemon_mode = "MASTER"
270
                     Else
271
                        daemon_mode = "SLAVE"
272
                     End If
273
                     %>
274
                     <tr>
275
                        <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
276
                     </tr>
277
                     <tr>
278
                        <td valign="top" align="center"><input type=<%=cbtype%> name="rcon_id_list" value="<%=rsQry("rcon_id")%>"></td>
279
                        <td valign="top"    nowrap class="body_rowg"><%=daemon%></td>
280
                        <td valign="top"    nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
281
                        <td valign="top"    nowrap class="body_rowg"><%=daemon_mode%></td>
282
                        <td valign="top"      wrap class="body_rowg"><%=rsQry("gbe_buildfilter")%></td>
283
                        <%If canActionControlInProject("BuildConfiguration") Then%>
284
                           <td valign="top" nowrap class="body_rowg"><%Call objBtnControl.Render  ( Array("btnEditDaemon", "btnRemoveDaemon", "btnDeleteDaemon"), objAccessControl )%></td>
285
                        <%End If%>
286
                     </tr>
287
                     <%
288
                     rsQry.MoveNext
289
                  Loop
290
                  rsQry.Close()
291
                  Set rsQry = nothing
292
                  %>
293
 
294
                  <tr>
295
                     <td class="form_iname">&nbsp;</td>
296
                     <td>&nbsp;</td>
297
                     <td class="val_err"></td>
298
                  </tr>
299
               </table>
300
 
301
 
302
            </td>
303
            <td background="images/lbox_bgside_white.gif">&nbsp;</td>
304
         </tr>
305
         <tr>
306
            <td background="images/bg_action_norm.gif" ></td>
307
            <td align="right" background="images/bg_action_norm.gif" >
308
 
309
               <%=objFormComponent.CancelButton ( "OK", "class='form_btn'", "build_status.asp?rtag_id="& parRtagId )%>
310
               <%=objPMod.ComposeHiddenTags()%>
311
               <%If canActionControlInProject("BuildConfiguration") Then%>
312
                  <input name="btn" type="submit" class="form_btn" value="Unlink">
313
                  <input name="btn" type="submit" class="form_btn" value="Delete">
314
               <%End If%>
315
               <input type="hidden" name="rcon_id_list" value="<%=Request("rcon_id_list")%>">
316
               <input type="hidden" name="action" value="true">
317
            </td>
318
            <td background="images/bg_action_norm.gif" ><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
319
         </tr>
320
         <tr>
321
            <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
322
            <td background="images/lbox_bg_blue.gif"></td>
323
            <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
324
         </tr>
325
      </table>
326
 
327
      <!-- ACTION BUTTONS ---------------------------------------------->
328
      <!-- ACTION BUTTONS END  ------------------------------------------></td>
329
      <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
330
  </tr>
331
  <tr>
332
    <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>
333
    <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="500"></td>
334
  </tr>
335
<%
336
Call objFormComponent.FormEnd()
337
'-- FROM END ----------------------------------------------------------------------------------------------------------------
338
%>
339
</table>
340
<!-- FOOTER -->
341
<!--#include file="_footer.asp"-->
342
</body>
343
</html>