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
'|                 ADMIN Page                        |
6
'|                  Archive                          |
7
'|                                                   |
119 ghuddy 8
'=====================================================
9
%>
10
<%
11
Option explicit
12
' Good idea to set when using redirect
129 ghuddy 13
Response.Expires = 0   ' always load the page, dont store
119 ghuddy 14
Server.ScriptTimeout=600
15
%>
16
<!--#include file="common/conf.asp"-->
17
<!--#include file="common/globals.asp"-->
18
<!--#include file="common/formating.asp"-->
19
<!--#include file="common/qstr.asp"-->
20
<!--#include file="common/common_subs.asp"-->
21
<!--#include file="sec/Crypt.asp"-->
22
<!--#include file="common/_form_window_common.asp"-->
23
<!--#include file="_action_buttons.asp"-->
24
 
25
<!--#include file="class/classActionButtonControl.asp"-->
26
 
27
<%
28
'------------ ACCESS CONTROL ------------------
29
%>
30
<!--#include file="_access_control_general.asp"-->
31
<%
32
'------------ Variable Definition -------------
33
Dim objBtnControl
34
'------------ Constants Declaration -----------
35
'------------ Variable Init -------------------
36
Set objBtnControl = New ActionButtonControl
37
'----------------------------------------------
38
%>
39
 
40
 
41
 
42
<%
43
' Page Access Condition
44
If NOT objAccessControl.IsActive("ConfigureBuildService") Then
129 ghuddy 45
   Response.Redirect("message.asp?msg=401-9")
119 ghuddy 46
End If
47
%>
48
<%
49
'---------------------------------------------------------------------------------------------------------------------------------------------
129 ghuddy 50
Sub   RM2AM ( nRtagId )
119 ghuddy 51
 
129 ghuddy 52
   On Error Resume Next
119 ghuddy 53
 
129 ghuddy 54
   OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
55
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 56
 
129 ghuddy 57
   objEH.TryORA ( OraSession )   ' will do Err.Clear
119 ghuddy 58
 
129 ghuddy 59
   OraDatabase.ExecuteSQL _
60
   "BEGIN PK_ARCHIVE.POPULATE_PACKAGES_TABLE (); END;"
61
 
62
   If Err.Number = 0 Then
63
      OraDatabase.ExecuteSQL _
64
      "BEGIN PK_ARCHIVE.POPULATE_ARCHIVE_DATA_TABLE ( :RTAG_ID ); END;"
65
   End If
66
 
67
   If Err.Number = 0 Then
68
      OraDatabase.ExecuteSQL _
69
      "BEGIN PK_ARCHIVE.MIGRATE_PV_TO_ARCHIVE_SCHEMA ( :RTAG_ID ); END;"
70
   End If
71
 
72
   If Err.Number = 0 Then
73
      OraDatabase.ExecuteSQL _
74
      "BEGIN PK_ARCHIVE.MIGRATE_RTAG_TO_ARCHIVE_SCHEMA ( :RTAG_ID ); END;"
75
   End If
76
 
77
   If Err.Number = 0 Then
78
      OraDatabase.ExecuteSQL _
79
      "BEGIN PK_ARCHIVE.CLEAN_UP_ARCHIVE_DATA_TABLE ( :RTAG_ID ); END;"
80
   End If
81
 
82
   If Err.Number = 0 Then
83
      OraDatabase.ExecuteSQL _
84
      "BEGIN PK_ARCHIVE.WRITE_ACTION_LOG ( :USER_ID, :RTAG_ID ); END;"
85
   End If
86
 
87
   objEH.CatchORA ( OraSession )      ' will do rollback or commit, depending upon Err.Number
88
 
89
   OraDatabase.Parameters.Remove "RTAG_ID"
90
   OraDatabase.Parameters.Remove "USER_ID"
91
 
92
End   Sub
119 ghuddy 93
'---------------------------------------------------------------------------------------------------------------------------------------------
129 ghuddy 94
Sub   AM2RM ( nRtagId )
119 ghuddy 95
 
129 ghuddy 96
   On Error Resume Next
97
   OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
98
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 99
 
129 ghuddy 100
   objEH.TryORA ( OraSession )   ' will do Err.Clear
119 ghuddy 101
 
129 ghuddy 102
   If Err.Number = 0 Then
103
      OraDatabase.ExecuteSQL _
104
      "BEGIN ARCHIVE_MANAGER.PK_ARCHIVE.RESTORE_AND_FLUSH_RELEASE_DATA ( :RTAG_ID ); END;"
105
   End If
119 ghuddy 106
 
129 ghuddy 107
   If Err.Number = 0 Then
108
      OraDatabase.ExecuteSQL _
109
      "BEGIN ARCHIVE_MANAGER.PK_ARCHIVE.WRITE_ACTION_LOG ( :USER_ID, :RTAG_ID ); END;"
110
   End If
111
 
112
   objEH.CatchORA ( OraSession )      ' will do rollback or commit, depending upon Err.Number
113
 
114
   OraDatabase.Parameters.Remove "RTAG_ID"
115
   OraDatabase.Parameters.Remove "USER_ID"
116
 
117
End   Sub
119 ghuddy 118
'---------------------------------------------------------------------------------------------------------------------------------------------
119
%>
120
<%
129 ghuddy 121
If (Request("btn") = "--->") Then
122
   'Code to Migrate From Release Manager to Archive Manager
123
   Call RM2AM ( Request("rtagA") )
124
   If objEH.Finally Then
125
      Response.Redirect("admin_archive.asp")
126
   End If
119 ghuddy 127
End If
128
 
129 ghuddy 129
If (Request("btn") = "<---") Then
130
   'Code to Migrate From Archive Manager to Release Manager
131
   Call AM2RM ( Request("rtagB") )
132
   If objEH.Finally Then
133
      Response.Redirect("admin_archive.asp")
134
   End If
119 ghuddy 135
End If
136
 
137
%>
138
<html>
139
<head>
140
 
141
<title>Archive Administration</title>
142
 
143
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
144
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
145
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
146
<link rel="stylesheet" href="images/navigation.css" type="text/css">
147
<script language="JavaScript" src="images/common.js"></script>
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 -------------------------------------->
129 ghuddy 154
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">
119 ghuddy 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
<!-- HEADER -->
159
<!--#include file="_header.asp"-->
160
<form name="FormName" method="post" action="<%=ScriptName%>">
129 ghuddy 161
   <br>
162
   <table width="100%"  border="0" cellspacing="10" cellpadding="0">
163
      <tr>
164
         <td align="left" class="body_col"><img src="images/i_rtag_open_mode.gif" border="0" align="absmiddle" width="15" height="13">&nbsp;Release Manager<hr size="1px" color="Olive" noshade></td>
165
         <td align="right" class="body_col"><img src="images/i_rtag_archive_mode.gif" border="0" align="absmiddle" width="15" height="13">&nbsp;Archive Manager<hr size="1px" color="Olive" noshade></td>
166
      </tr>
167
      <tr>
168
         <td align="left">
119 ghuddy 169
 
129 ghuddy 170
            <%
171
            Dim rsQry
172
            Set rsQry = OraDatabase.DbCreateDynaset( "select * from "&_
173
            " release_tags rt, projects prj where rt.official ='A' and prj.proj_id = rt.proj_id and "&_
174
            " rt.rtag_id not in (select rtag_id from archive_manager.release_tags) order by rt.rtag_id desc", cint(0))
175
 
176
            If ((rsQry.BOF) AND (rsQry.EOF)) Then%>
177
               <select name="rtagA" id="rtagA" class="form_item" disabled>
178
                  <option>No releases to be archived</option>
179
               </select>
180
            <%Else%>
181
               <select name="rtagA" id="rtagA" class="form_item">
182
                  <%While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
183
                     <option value="<%=rsQry("rtag_id")%>"><%=rsQry("proj_name")%> - <%=rsQry("rtag_name")%></option>
184
                     <%rsQry.MoveNext
185
                  WEnd%>
186
               </select>
187
               <input type="submit" name="btn" value="--->" class="form_btn_comp">
188
            <%End If
189
 
190
            rsQry.Close
191
            Set rsQry = Nothing
192
            %>
193
         </td>
194
         <td align="right">
195
            <input type="submit" name="btn" value="<---" class="form_btn_comp">
196
            <select name="rtagB" id="rtagB" class="form_item">
197
               <%
198
               Set rsQry = OraDatabase.DbCreateDynaset( "select * from "&_
199
               " archive_manager.release_tags rt, projects prj where prj.proj_id = rt.proj_id "&_
200
               " order by rt.rtag_id desc", cint(0))
201
 
202
               While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
203
                  <option value="<%=rsQry("rtag_id")%>"><%=rsQry("proj_name")%> - <%=rsQry("rtag_name")%></option>
204
                  <%rsQry.MoveNext
205
               WEnd
206
 
207
               rsQry.Close
208
               Set rsQry = Nothing
209
               %>
210
            </select>
211
 
212
         </td>
213
      </tr>
214
   </table>
215
</form>
119 ghuddy 216
</body>
217
</html>
218
<!-- FOOTER -->
219
<!--#include file="_footer.asp"-->
220
<%
221
Call Destroy_All_Objects
129 ghuddy 222
%>