Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
125 ghuddy 5
'|            RequestProjectRelease.asp              |
119 ghuddy 6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
125 ghuddy 12
Response.Expires = 0   ' always load the page, dont store
119 ghuddy 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
<%
20
'------------ Variable Definition -------------
21
Dim rsTemp
22
Dim PageInfoHash
125 ghuddy 23
Dim Query_String
24
Dim Auto
119 ghuddy 25
'------------ Constants Declaration -----------
26
'------------ Variable Init -------------------
27
Set PageInfoHash = CreateObject("Scripting.Dictionary")
28
'----------------------------------------------
29
%>
30
<%
31
'------------------------------------------------------------------------------------------------------------------------
125 ghuddy 32
' This code is temporary and can be taken out at some point in the future (eg. 3 months from now. ie. Dec2008). Its purpose
33
' is to ensure that the release level metrics are up-to-date when a user expands the project link on the Release Metrics. The
34
' SQL queries and database PK_RMAPI update_release_metrics function have been updated to fix errors in the original solution
35
' but we would have to wait for the build tool to build at least one package in each release in each project before the
36
' release level metrics would be correct. So, instead, we force the re-computation of those metrics now. It doesn't  take long
37
' even on a large project like Stockholm, so it is no big deal.
38
Sub UpdateReleaseMetrics
39
   Dim rsQry
40
   Dim rsQuery_String
41
   Dim rtagid
42
 
43
   OraDatabase.Parameters.Add "PROJ_ID", Request("proj_id"),    ORAPARM_INPUT, ORATYPE_NUMBER
44
 
45
   rsQuery_String = "SELECT rm.rtag_id"&_
46
                    "  FROM projects p,"&_
47
                    "       release_metrics rm,"&_
48
                    "       release_tags rt"&_
49
                    " WHERE p.proj_id = rt.proj_id"&_
50
                    "   AND rm.rtag_id = rt.rtag_id"&_
51
                    "   AND p.proj_id = :PROJ_ID"
52
 
53
   Set rsQry = OraDatabase.DbCreateDynaset( rsQuery_String, cint(0))
54
 
55
   While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
56
      OraDatabase.Parameters.Add "RTAG_ID",         rsQry("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBER
57
 
58
      OraDatabase.ExecuteSQL "BEGIN  PK_RMAPI.UPDATE_RELEASE_METRICS ( :RTAG_ID ); END;"
59
 
60
      OraDatabase.Parameters.Remove "RTAG_ID"
61
      rsQry.MoveNext
62
   WEnd
63
 
64
   OraDatabase.Parameters.Remove "PROJ_ID"
65
 
66
   rsQry.Close
67
   Set rsQry = nothing
68
End Sub
69
 
119 ghuddy 70
'------------------------------------------------------------------------------------------------------------------------
71
%>
72
<%
73
'------------------------ MAIN LINE ---------------------------------
125 ghuddy 74
Call UpdateReleaseMetrics
119 ghuddy 75
'--------------------------------------------------------------------
76
%>
77
<table width="100%" border="0" cellspacing="1" cellpadding="1">
125 ghuddy 78
   <tr>
79
      <td background="images/bg_form_lightbluedark.gif">
80
         <table width="100%" border="0" cellspacing="1" cellpadding="3">
81
            <tr>
82
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Release</td>
83
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Last Autobuild<br>Completed</td>
84
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Autobuilt Packages</td>
85
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Lines Of Code</td>
86
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Unit Tested</td>
87
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Autotested</td>
88
            </tr>
119 ghuddy 89
 
125 ghuddy 90
            <%
91
            OraDatabase.Parameters.Add "PROJ_ID", Request("proj_id"),    ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 92
 
125 ghuddy 93
            Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("ReleaseMetrics.sql"), cint(0))
94
 
95
            OraDatabase.Parameters.Remove "PROJ_ID"
96
 
97
            If rsTemp.RecordCount < 1 Then%>
98
               <tr>
99
                  <td background="images/bg_form_lightgray.gif" nowrap>&nbsp;</td>
100
               </tr>
101
            <%Else
102
 
103
               While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
104
 
105
                  Auto=FormatPercent(rsTemp("autobuilt")/rsTemp("total_packages"), 2)
106
                  %>
107
 
108
                  <tr>
109
                     <td background="images/bg_form_lightgray.gif" nowrap class="body_txt">
110
                        <SPAN id="IMG_EXPAND_RTAG_<%=rsTemp("rtag_id")%>" style="display:block;">
111
                           <a href="javascript:;" class="txt_linked" onClick="RequestReleasePackages('?rtag_id=<%=rsTemp("rtag_id")%>', '<%=rsTemp("rtag_id")%>');">
112
                              <img src="images/bt_plus.gif" border="0" align="absmiddle" hspace="3">
113
                              <img src="images/i_world.gif" border="0" align="absmiddle" hspace="3">
114
                              <%=rsTemp("rtag_name")%>
115
                           </a>
116
                        </SPAN>
117
                        <SPAN id="IMG_COLLAPSE_RTAG_<%=rsTemp("rtag_id")%>" style="display:none;">
118
                           <a href="javascript:;" class="txt_linked" onClick="ToggleDisplay( 'DIVRTAG_<%=rsTemp("rtag_id")%>', 'IMG_EXPAND_RTAG_<%=rsTemp("rtag_id")%>', 'IMG_COLLAPSE_RTAG_<%=rsTemp("rtag_id")%>');">
119
                              <img src="images/bt_minus.gif" border="0" align="absmiddle" hspace="3">
120
                              <img src="images/i_world.gif" border="0" align="absmiddle" hspace="3">
121
                              <%=rsTemp("rtag_name")%>
122
                           </a>
123
                        </SPAN>
124
                     </td>
125
                     <td nowrap class="body_txt" background="images/bg_form_lightgray.gif"><%=rsTemp("last_build_time")%></td>
126
                     <td nowrap class="body_txt" background="images/bg_form_lightgray.gif"><%=rsTemp("autobuilt")%>/<%=rsTemp("total_packages")%> (<%=Auto%>)</td>
127
                     <td nowrap class="body_txt" background="images/bg_form_lightgray.gif"><%=rsTemp("lines_of_code")%></td>
128
                     <td nowrap class="body_txt" background="images/bg_form_lightgray.gif"><%=rsTemp("unit_tested")%></td>
129
                     <td nowrap class="body_txt" background="images/bg_form_lightgray.gif"><%=rsTemp("autotested")%></td>
130
                  </tr>
131
                  <tr>
132
                     <td nowrap class="body_txt" colspan="6">
133
                        <DIV id="DIVRTAG_<%=rsTemp("rtag_id")%>" style="display:none;"><%=enumLOADING%></DIV>
134
                     </td>
135
                  </tr>
136
 
137
                  <%rsTemp.MoveNext
138
               WEnd
139
               rsTemp.Close
140
               Set rsTemp = nothing
141
 
142
            End If%>
143
         </table>
144
    </td>
119 ghuddy 145
  </tr>
146
</table>
147
<br>
125 ghuddy 148
 
119 ghuddy 149
<%
150
Call Destroy_All_Objects
125 ghuddy 151
%>