Subversion Repositories DevTools

Rev

Rev 161 | Rev 165 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%
'===================================================================
'                     Package Common
'===================================================================
%>
<!--#include file="../class/classTemplateManager.asp"-->
<!--#include file="../class/classTabControl.asp"-->
<!--#include file="../class/classActionButtonControl.asp"-->
<!--#include file="daemon_instructions.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim parPv_id
Dim nEnvTab         ' remember environment tab
Dim objBtnControl
Dim aTabBtnsDef
'------------ CONSTANTS DECLARATION -----------
'------------ VARIABLE INIT -------------------
parPv_id = Request("pv_id")
Set objBtnControl = New ActionButtonControl
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------

'--- Make sure rtag_id is always present
If (Request("rtag_id") = "") AND (Request("pv_id") = "") Then Response.Redirect("index.asp")


'--- Rebuild Environment
If (Request("rtag_id") <> "") Then
   Call Rebuild_Environment ( parRtag_id )
End If

'--- Persist following parameters between postbacks
objPMod.PersistInQryString ( aPersistList(enumPAR_RTAG_ID) )
objPMod.PersistInQryString ( aPersistList(enumPAR_PV_ID) )


'--- Get Environment (lefthand side menu) tab
nEnvTab = GetEnvTab ( Request("envtab") )


'--- Get Package General Information
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
If Request("pv_id") <> "" Then
   Call Get_Pkg_Info ( Request("pv_id"), Request("rtag_id") )

   ' Make sure pv_id exists as it may be removed
   If pkgInfoHash.Item("pv_id") = "" Then Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))

Else
   If (ScriptName <> "dependencies.asp") AND (ScriptName <> "find.asp")Then  Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
End If


'----------------------------------------------
%>
<%
'-----------------------------------------------------------------------------------------------------------------------------
Sub RenderPackageProperties ()
%>

   <tr>
      <td background="images/bg_lght_gray.gif"><IMG height="45" src="images/spacer.gif" width=1></td>

      <td valign="bottom" background="images/bg_lght_gray.gif" nowrap class="body_txt">
         <%
         If pkgInfoHash.Item ("is_patch") = "Y" Then
            '--- PATCH ---
            Response.write "<br><a href='patches.asp?pv_id="& pkgInfoHash.Item ("patch_parent_id") &"&rtag_id="& Request("rtag_id") &"' class='txt_linked'><img src='icons/i_caretone.gif' hspace='2' border='0' align='absmiddle'>Back To "& pkgInfoHash.Item ("pkg_name") &"</a><br><br>"

            If pkgInfoHash.Item ("is_obsolete") = "Y" Then
               Dim rsTemp
               Set rsTemp = OraDatabase.DbCreateDynaset( "select patch_obsoleted_by from package_patches where patch_id ="&pkgInfoHash.Item ("pv_id"), cint(0))

               If rsTemp("patch_obsoleted_by") <> "" Then

                  Set rsTemp = OraDatabase.DbCreateDynaset( "select pkg_version from package_versions where pv_id ="&rsTemp("patch_obsoleted_by"), cint(0))
                  Call Messenger ( "<SPAN class='err_alert'><b>Patch Is Obsolete!</b></SPAN><br>"& NewLine_To_BR( "<b>Obsoleted by patch "& rsTemp("pkg_version") & ". </b> " ) & NewLine_To_BR( pkgInfoHash.Item ("obsolete_comments") ), 3, "100%" )

                  rsTemp.Close()
                  Set rsTemp = nothing
               Else
                  Call Messenger ( "<SPAN class='err_alert'><b>Patch Is Obsolete!</b></SPAN><br>"& NewLine_To_BR( pkgInfoHash.Item ("obsolete_comments") ), 3, "100%" )
               End If
               Response.write enum_imgPatchObsolete
            Else
               Response.write enum_imgPatch
            End If


            If pkgInfoHash.Item ("dlocked") = "Y" Then
               Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_version") &"<img src='images/i_locked.gif' width='12' height='14' border='0' hspace='5' align='top'></SPAN>"
            Else
               Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_version") &"</SPAN>"
            End If
         Else
            '--- PACKAGE ---
            If pkgInfoHash.Item ("dlocked") = "Y" Then
               If pkgInfoHash.Item ("deprecated_state") = 6 Then
                  Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") &"<img src='images/i_locked.gif' width='12' height='14' border='0' hspace='5' align='top'>"&enum_imgDeprecated&"</SPAN>"
               ElseIf pkgInfoHash.Item ("product_state") = 4 Then
                  Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") &"<img src='images/i_locked.gif' width='12' height='14' border='0' hspace='5' align='top'>"&enum_imgProductRejected&"</SPAN>"
               Else
                  Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") &"<img src='images/i_locked.gif' width='12' height='14' border='0' hspace='5' align='top'></SPAN>"
               End If
            Else
               Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") &"</SPAN>"
            End If
         End If
         %>
         <br><br>
      </td>

      <td background="images/bg_lght_gray.gif">&nbsp;</td>
   </tr>
   <tr>
      <td background="images/bg_lght_gray.gif"></td>
      <td background="images/bg_lght_gray.gif" style=color:Red>
         <%=GetOpCodeListForRtagIdAndPvId( "NOTE: '", Request("rtag_id"), pkgInfoHash.Item("pv_id"), "' has been requested" )%>
      <td>
   </tr>
<%
End Sub
'-----------------------------------------------------------------------------------------------------------------------------
Sub RenderPackageState ()
   If (pkgInfoHash.Item ("dlocked") = "Y") Then
      Response.write "<b>Status:</b>&nbsp;Released<br>"
   Else
      Response.write "<b>Status:&nbsp;</b>Not released<br>"
   End If
End Sub

'---------------------------------------------------------------
Sub Config_Spec (NNRtag_id, NNPv_id)
   OraDatabase.Parameters.Add "RTAG_ID", NNRtag_id,   ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "PV_ID", NNPv_id,   ORAPARM_INPUT, ORATYPE_NUMBER



   If NNRtag_id <> "" Then
      If pkgInfoHash.Item ("dlocked") <> "Y" Then
         Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("config_spec.sql"), cint(0))
      Else
         Set rsQry = OraDatabase.DbCreateDynaset( Replace(GetQuery("config_spec.sql"), "PV.LAST_PV_ID", "PV.PV_ID"), cint(0))
      End If
   Else
      If pkgInfoHash.Item ("dlocked") <> "Y" Then
         Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("config_spec_nortag.sql"), cint(0))
      Else
         Set rsQry = OraDatabase.DbCreateDynaset( Replace(GetQuery("config_spec_nortag.sql"), "PV.LAST_PV_ID", "PV.PV_ID"), cint(0))
      End If
   End If

   OraDatabase.Parameters.Remove "RTAG_ID"
   OraDatabase.Parameters.Remove "PV_ID"

End Sub

'---------------------------------------------------------------
' Function: Config_Spec_Template
'
' Purpose:  Generates HTML to display the config spec to use
'           to create a view loaded with the particular package version.
'
' Arguments: dlocked       : dlocked state of the package version
'            config_branch : The branch, or null
'            pkg_label     : The package label
'            src_path      : The source path for the package
' Notes:
'
Sub Config_Spec_Template (dlocked, config_branch, pkg_label, src_path)

   Dim Template

   If (pkg_label <> "" AND src_path <> "") Then
      If (dlocked <> "Y" AND NOT IsNull(config_branch) AND config_branch <> "" ) Then
         Template = "element * CHECKEDOUT <br>" & _
         "element .../lost+found -none <br>" & _
         "element * .../" & config_branch & "/LATEST <br>" & _
         "element * " & pkg_label & " -mkbranch " & config_branch & "<br>" & _
         "element * /main/0 -mkbranch " & config_branch & "<br>"  & _
         "load " & chr(34) & src_path & chr(34)
      Else
         Template = "element * CHECKEDOUT <br>" & _
         "element .../lost+found -none <br>" & _
         "element * " & pkg_label &"<br>" & _
         "load " & chr(34) & src_path & chr(34)
      End If
   Else
      Template = "UNAVAILABLE - missing label and/or source path"
   End If

   Response.write "<tr>"
   Response.write "<td nowrap class='body_txt'><b>Config Specs:&nbsp;</b></td>"
   Response.write "<td nowrap class='body_txt'>"& Template &"</td>"
   Response.write "<td nowrap class='body_txt'></td>"
   Response.write "</tr>"

End Sub

'---------------------------------------------------------------
' Function: Jats_Commands
'
' Purpose:  Generates HTML for displaying the JATS commands for extracting
'           a view for the package version, and for building the targets
'           within a previously extracted view for the package version.
'
' Arguments: dlocked       : dlocked state of the package version
'            config_branch : The branch, or null
'            pkg_label     : The package label
'            src_path      : The source path for the package
' Notes:
'
Sub Jats_Commands (dlocked, config_branch, pkg_label, src_path)

   Dim Template1, Template2

   If (pkg_label <> "" AND src_path <> "") Then
      If (dlocked <> "Y" AND NOT IsNull(config_branch) AND config_branch <> "" ) Then
         Template1 = "jats release -extract " & pkg_label & " -path " & chr(34) & Replace(src_path, "\", "/") & chr(34) &" -branch "& config_branch
      Else
         Template1 = "jats release -extract " & pkg_label & " -path " & chr(34) & Replace(src_path, "\", "/") & chr(34)
      End If
      Template2 = "jats release -test " & pkgInfoHash.Item("pkg_label") & " -path " & chr(34) & Replace(src_path, "\", "/") & chr(34)
   Else
      Template1 = "UNAVAILABLE - missing label and/or source path"
      Template2 = "UNAVAILABLE - missing label and/or source path"
   End If

   Response.write "<tr>"
   Response.write "<td nowrap class='body_txt'><b>JATS Extract:&nbsp;</b></td>"
   Response.write "<td nowrap class='body_txt'>" & Template1 & "</td>"
   Response.write "<td nowrap class='body_txt'></td>"
   Response.write "</tr>"
   Response.write "<tr>"
   Response.write "<td nowrap class='body_txt'><b>JATS Test:&nbsp;</b></td>"
   Response.write "<td nowrap class='body_txt'>" & Template2 & "</td>"
   Response.write "<td nowrap class='body_txt'></td>"
   Response.write "</tr>"

End Sub

'-----------------------------------------------------------------------------------------------------------------------------
%>