Subversion Repositories DevTools

Rev

Rev 119 | Blame | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                 ADMIN Page                        |
'|                  Archive                          |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0   ' always load the page, dont store
Server.ScriptTimeout=600
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="sec/Crypt.asp"-->
<!--#include file="common/_form_window_common.asp"-->
<!--#include file="_action_buttons.asp"-->

<!--#include file="class/classActionButtonControl.asp"-->

<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim objBtnControl
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
Set objBtnControl = New ActionButtonControl
'----------------------------------------------
%>



<%
' Page Access Condition
If NOT objAccessControl.IsActive("ConfigureBuildService") Then
   Response.Redirect("message.asp?msg=401-9")
End If
%>
<%
'---------------------------------------------------------------------------------------------------------------------------------------------
Sub   RM2AM ( nRtagId )

   On Error Resume Next

   OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER

   objEH.TryORA ( OraSession )   ' will do Err.Clear

   OraDatabase.ExecuteSQL _
   "BEGIN PK_ARCHIVE.POPULATE_PACKAGES_TABLE (); END;"

   If Err.Number = 0 Then
      OraDatabase.ExecuteSQL _
      "BEGIN PK_ARCHIVE.POPULATE_ARCHIVE_DATA_TABLE ( :RTAG_ID ); END;"
   End If

   If Err.Number = 0 Then
      OraDatabase.ExecuteSQL _
      "BEGIN PK_ARCHIVE.MIGRATE_PV_TO_ARCHIVE_SCHEMA ( :RTAG_ID ); END;"
   End If

   If Err.Number = 0 Then
      OraDatabase.ExecuteSQL _
      "BEGIN PK_ARCHIVE.MIGRATE_RTAG_TO_ARCHIVE_SCHEMA ( :RTAG_ID ); END;"
   End If

   If Err.Number = 0 Then
      OraDatabase.ExecuteSQL _
      "BEGIN PK_ARCHIVE.CLEAN_UP_ARCHIVE_DATA_TABLE ( :RTAG_ID ); END;"
   End If

   If Err.Number = 0 Then
      OraDatabase.ExecuteSQL _
      "BEGIN PK_ARCHIVE.WRITE_ACTION_LOG ( :USER_ID, :RTAG_ID ); END;"
   End If

   objEH.CatchORA ( OraSession )      ' will do rollback or commit, depending upon Err.Number

   OraDatabase.Parameters.Remove "RTAG_ID"
   OraDatabase.Parameters.Remove "USER_ID"

End   Sub
'---------------------------------------------------------------------------------------------------------------------------------------------
Sub   AM2RM ( nRtagId )

   On Error Resume Next
   OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER

   objEH.TryORA ( OraSession )   ' will do Err.Clear

   If Err.Number = 0 Then
      OraDatabase.ExecuteSQL _
      "BEGIN ARCHIVE_MANAGER.PK_ARCHIVE.RESTORE_AND_FLUSH_RELEASE_DATA ( :RTAG_ID ); END;"
   End If

   If Err.Number = 0 Then
      OraDatabase.ExecuteSQL _
      "BEGIN ARCHIVE_MANAGER.PK_ARCHIVE.WRITE_ACTION_LOG ( :USER_ID, :RTAG_ID ); END;"
   End If

   objEH.CatchORA ( OraSession )      ' will do rollback or commit, depending upon Err.Number

   OraDatabase.Parameters.Remove "RTAG_ID"
   OraDatabase.Parameters.Remove "USER_ID"

End   Sub
'---------------------------------------------------------------------------------------------------------------------------------------------
%>
<%
If (Request("btn") = "--->") Then
   'Code to Migrate From Release Manager to Archive Manager
   Call RM2AM ( Request("rtagA") )
   If objEH.Finally Then
      Response.Redirect("admin_archive.asp")
   End If
End If

If (Request("btn") = "<---") Then
   'Code to Migrate From Archive Manager to Release Manager
   Call AM2RM ( Request("rtagB") )
   If objEH.Finally Then
      Response.Redirect("admin_archive.asp")
   End If
End If

%>
<html>
<head>

<title>Archive Administration</title>

<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
<link rel="stylesheet" href="images/navigation.css" type="text/css">
<script language="JavaScript" src="images/common.js"></script>
<!-- DROPDOWN MENUS -->
<!--#include file="_menu_def.asp"-->
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
<!-- MENU LAYERS -------------------------------------->
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">
</div>
<!-- TIPS LAYERS -------------------------------------->
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
<!-- HEADER -->
<!--#include file="_header.asp"-->
<form name="FormName" method="post" action="<%=ScriptName%>">
   <br>
   <table width="100%"  border="0" cellspacing="10" cellpadding="0">
      <tr>
         <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>
         <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>
      </tr>
      <tr>
         <td align="left">

            <%
            Dim rsQry
            Set rsQry = OraDatabase.DbCreateDynaset( "select * from "&_
            " release_tags rt, projects prj where rt.official ='A' and prj.proj_id = rt.proj_id and "&_
            " rt.rtag_id not in (select rtag_id from archive_manager.release_tags) order by rt.rtag_id desc", cint(0))

            If ((rsQry.BOF) AND (rsQry.EOF)) Then%>
               <select name="rtagA" id="rtagA" class="form_item" disabled>
                  <option>No releases to be archived</option>
               </select>
            <%Else%>
               <select name="rtagA" id="rtagA" class="form_item">
                  <%While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
                     <option value="<%=rsQry("rtag_id")%>"><%=rsQry("proj_name")%> - <%=rsQry("rtag_name")%></option>
                     <%rsQry.MoveNext
                  WEnd%>
               </select>
               <input type="submit" name="btn" value="--->" class="form_btn_comp">
            <%End If

            rsQry.Close
            Set rsQry = Nothing
            %>
         </td>
         <td align="right">
            <input type="submit" name="btn" value="<---" class="form_btn_comp">
            <select name="rtagB" id="rtagB" class="form_item">
               <%
               Set rsQry = OraDatabase.DbCreateDynaset( "select * from "&_
               " archive_manager.release_tags rt, projects prj where prj.proj_id = rt.proj_id "&_
               " order by rt.rtag_id desc", cint(0))

               While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))%>
                  <option value="<%=rsQry("rtag_id")%>"><%=rsQry("proj_name")%> - <%=rsQry("rtag_name")%></option>
                  <%rsQry.MoveNext
               WEnd

               rsQry.Close
               Set rsQry = Nothing
               %>
            </select>

         </td>
      </tr>
   </table>
</form>
</body>
</html>
<!-- FOOTER -->
<!--#include file="_footer.asp"-->
<%
Call Destroy_All_Objects
%>