Subversion Repositories DevTools

Rev

Rev 1281 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
121 hknight 5
'|             SEARCH RESULT                         |
6
'|               PACKAGES                            |
119 ghuddy 7
'|                                                   |
8
'=====================================================
9
%>
10
<%
11
Option explicit
12
' Good idea to set when using redirect
121 hknight 13
Response.Expires = 0   ' always load the page, dont store
119 ghuddy 14
%>
15
<!--#include file="common/conf.asp"-->
16
<!--#include file="common/globals.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
20
<%
21
' Make sure rtag_id is always present
22
If Request("pv_id") = "" AND Request("rtag_id") = "" Then
121 hknight 23
   Response.Redirect("index.asp")
119 ghuddy 24
End If
25
 
26
objPMod.PersistInQryString ( aPersistList(enumPAR_ADD_TYPE) )
27
objPMod.PersistInCookie("pkgfind")
28
%>
29
<%
30
'------------ ACCESS CONTROL ------------------
31
%>
32
<!--#include file="_access_control_login.asp"-->
33
<!--#include file="_access_control_general.asp"-->
34
<%
35
'------------ Variable Definition -------------
36
Dim parAdd_type
37
Dim parPkgfind
38
Dim rsFind
39
Dim parPv_id
40
Dim RecCount
121 hknight 41
 
119 ghuddy 42
'------------ Constants Declaration -----------
43
'------------ Variable Init -------------------
44
parAdd_type = Request("add_type")
45
parPkgfind = Request("pkgfind")
46
parPv_id = Request("pv_id")
47
'----------------------------------------------
48
%>
49
<%
50
Function Page_Title ( NNadd_type )
121 hknight 51
   If NNadd_type = Cstr(enum_ADD_PACKAGES) Then
52
      Page_Title = "ADD package"
53
 
54
   ElseIf NNadd_type = Cstr(enum_ADD_DEPENDENCIES) Then
55
      Page_Title = "ADD dependency"
56
 
57
   ElseIf NNadd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES) Then
58
      Page_Title = "ADD Runtime Dependency"
59
 
60
   Else
61
      Page_Title = ""
62
 
63
   End If
119 ghuddy 64
End Function
65
 
66
Function Search_For_Package_Names ( SSpkgfind )
121 hknight 67
   Dim pkg_name_like, SQLor, pkglistARR
68
 
69
   SQLor = ""
70
   If Len( Replace( SSpkgfind, " ", "" ) ) = 0 Then
71
      ' Show all pkg names
72
      SQLor = " OR pkg.pkg_name LIKE '%'"
73
 
74
   Else
75
      ' Search for ...
76
      pkglistARR = Split( Trim( SSpkgfind ), " ")
77
 
78
      If Ubound( pkglistARR ) > 0 Then
79
         ' Multiple pkg_name search
80
         For Each pkg_name_like In pkglistARR
81
            If pkg_name_like <> "" Then
82
               SQLor = SQLor &" OR UPPER(pkg.pkg_name) LIKE UPPER('%"& pkg_name_like &"%')"
83
            End If
84
         Next
85
 
86
      Else
87
         ' Single pkg_name search
88
         SQLor = " OR UPPER(pkg.pkg_name) LIKE UPPER('%"& Trim( SSpkgfind ) &"%')"
89
      End If
90
 
91
   End If
92
 
93
   ' Search may be restricted to those packages that have versions in the specified release, so alter the
94
   ' query accordingly.
95
   If ( (NOT IsNull(parAdd_type)) AND (NOT IsNull(parRtag_id)) AND (parAdd_type = Cstr(enum_ADD_DEPENDENCIES)) ) Then
96
      ' find all packages matching wildcard, that have versions in the specified release, and that are not already
97
      ' configured as a build dependency, and that is not the actual package we are configuring dependencies for
98
      Search_For_Package_Names = _
99
      " SELECT pkg.*, pv.pv_id, pv.v_ext"&_
100
      "  FROM packages pkg, release_content rc, package_versions pv"&_
101
      " WHERE pkg.pkg_id != 0"&_
102
      "   AND pv.pkg_id = pkg.pkg_id"&_
103
      "   AND pv.pv_id = rc.pv_id"&_
104
      "   AND rc.pv_id NOT IN (SELECT pd.dpv_id FROM package_dependencies pd WHERE pd.pv_id = "& parPv_id & ")"&_
105
      "   AND pkg.pkg_id NOT IN (SELECT pvv.pkg_id FROM package_versions pvv WHERE pvv.pv_id = "& parPv_id & ")"&_
106
      "   AND rc.rtag_id = "& parRtag_id &_
107
      "   AND ( pkg.pkg_name = ''"&_
108
      SQLor &_
109
      "       )"&_
110
      "ORDER BY UPPER(pkg.pkg_name)"
111
   Else
112
      If ( (NOT IsNull(parAdd_type)) AND (NOT IsNull(parRtag_id)) AND (parAdd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES)) ) Then
113
         ' find all packages matching wildcard, that have versions in the specified release, and that are not already
114
         ' configured as a runtime dependency, and that is not the actual package we are configuring dependencies for
115
         Search_For_Package_Names = _
116
         " SELECT pkg.*, pv.pv_id, pv.v_ext"&_
117
         "  FROM packages pkg, release_content rc, package_versions pv"&_
118
         " WHERE pkg.pkg_id != 0"&_
119
         "   AND pv.pkg_id = pkg.pkg_id"&_
120
         "   AND pv.pv_id = rc.pv_id"&_
121
         "   AND pv.pv_id NOT IN (SELECT rtd.rtd_id FROM runtime_dependencies rtd WHERE rtd.pv_id = "& parPv_id & ")"&_
122
         "   AND pkg.pkg_id NOT IN (SELECT pvv.pkg_id FROM package_versions pvv WHERE pvv.pv_id = "& parPv_id & ")"&_
123
         "   AND rc.rtag_id = "& parRtag_id &_
124
         "   AND ( pkg.pkg_name = ''"&_
125
         SQLor &_
126
         "       )"&_
127
         "ORDER BY UPPER(pkg.pkg_name)"
128
      Else
129
         ' simply find all packages matching wildcard, regardless of the specified release or any other constraint
130
         ' This is needed when user is adding package versions to a release.
131
         Search_For_Package_Names = _
132
         " SELECT pkg.*"&_
133
         "  FROM packages pkg"&_
134
         " WHERE pkg.pkg_id != 0"&_
135
         "   AND ( pkg.pkg_name = ''"&_
136
         SQLor &_
137
         "       )"&_
138
         "ORDER BY UPPER(pkg.pkg_name)"
139
      End If
140
   End If
141
 
119 ghuddy 142
End Function
143
%>
144
<html>
145
<head>
146
<title>Release Manager</title>
147
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
148
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
149
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
150
<link rel="stylesheet" href="images/navigation.css" type="text/css">
151
<script language="JavaScript" src="images/common.js"></script>
152
<!-- DROPDOWN MENUS -->
153
<!--#include file="_menu_def.asp"-->
154
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
155
 
156
</head>
157
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();document.pkgnames.btnnext.focus();">
158
<!-- MENU LAYERS -------------------------------------->
121 hknight 159
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">
119 ghuddy 160
</div>
161
<!-- TIPS LAYERS -------------------------------------->
162
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
163
<!----------------------------------------------------->
164
<!-- HEADER -->
165
<!--#include file="_header.asp"-->
166
<!-- BODY ---->
167
<table width="100%" height="80%" border="0" cellpadding="0" cellspacing="0">
121 hknight 168
   <tr>
169
      <td align="center" valign="top" background="images/bg_lght_gray.gif">
170
         <!-- MIDDLE ---------------------------------------->
171
         <table width="650" border="0" cellspacing="0" cellpadding="0">
172
            <tr>
173
               <td>
119 ghuddy 174
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
121 hknight 175
                     <tr>
176
                        <td width="1%"></td>
177
                        <td align="right"><img src="images/h_trsp_dot.gif" width="30" height="30"></td>
178
                        <td width="1%"></td>
179
                     </tr>
180
                     <tr>
181
                        <td width="1%"></td>
182
                        <td>
183
                           <table width="100%" border="0" cellspacing="0" cellpadding="0">
184
                              <tr>
185
                                 <td nowrap class="form_ttl"><%=Page_Title ( parAdd_type )%></td>
186
                                 <td align="right" valign="bottom"></td>
187
                              </tr>
188
                           </table>
119 ghuddy 189
                        </td>
121 hknight 190
                        <td width="1%"></td>
191
                     </tr>
192
                     <tr>
193
                        <td align="left" valign="top" width="1%" background="images/lbox_bg_blue.gif">
194
                           <img src="images/lbox_tl_cnr_b.gif" width="13" height="13">
195
                        </td>
196
                        <td background="images/lbox_bg_blue.gif" align="right">
197
                           <!-- Heading --><img src="images/h_trsp_dot.gif" width="1" height="20"><!-- END Heading -->
198
                        </td>
199
                        <td align="right" valign="top" width="1%" background="images/lbox_bg_blue.gif">
200
                           <img src="images/lbox_tr_cnr_b.gif" width="13" height="13">
201
                        </td>
202
                     </tr>
203
                     <tr>
204
                        <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
205
                        <td bgcolor="#FFFFFF" valign="top">
206
                           <!-- Body -->
207
                           <br>
208
                           <table width="100%" border="0" cellspacing="0" cellpadding="0">
209
                              <tr>
210
                                 <td valign="bottom" nowrap>
211
                                    <span class="form_txt">Search result for <strong><%=parPkgfind%></strong></span>
212
                                 </td>
213
                                 <td align="right" valign="top" nowrap>
3889 dpurdie 214
                                    <a href="form_new_version.asp?rtag_id=<%=parRtag_id%>&pkgName=<%=parPkgfind%>" class="body_txt_drk">
121 hknight 215
                                    <strong>Not found what you looking for?</strong>
216
                                    <br>
217
                                    <img src="images/i_new_pkg.gif" width="20" height="21" hspace="3" border="0" align="absmiddle">Create new package name.</a>
218
                                 </td>
219
                              </tr>
220
                           </table>
221
                           <br>
222
                           <table width="100%" border="0" cellspacing="1" cellpadding="2">
223
                              <form name="pkgnames" method="post" action="form_add_pkg_versions.asp?add_type=<%=parAdd_type%>">
224
                                 <tr>
225
                                    <td colspan="2" valign="bottom" nowrap class="form_txt">Select desired packages and click Next.</td>
226
                                 </tr>
227
                                 <tr>
228
                                    <td background="images/bg_form_lightbluedark.gif"></td>
229
                                    <td background="images/bg_form_lightbluedark.gif" class="form_txt"><b>Package Name</b></td>
230
                                 </tr>
231
                                 <%Set rsFind = OraDatabase.DbCreateDynaset( Search_For_Package_Names ( parPkgfind ), cint(0))%>
232
                                 <%RecCount = CInt(rsFind.RecordCount)%>
233
                                 <%While ((NOT rsFind.BOF) AND (NOT rsFind.EOF)) %>
234
                                    <tr>
235
                                       <td background="images/bg_form_lightgray.gif">
236
                                          <%If ( (NOT IsNull(parAdd_type)) AND ((parAdd_type = Cstr(enum_ADD_DEPENDENCIES)) OR (parAdd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES))) ) Then%>
237
                                             <input name="pkg_list" id="pkg_list" type="checkbox" value="<%=rsFind("pv_id")%>" <%If RecCount = 1 Then%>checked<%End If%>>
238
                                          <%Else%>
239
                                             <input name="pkg_list" id="pkg_list" type="checkbox" value="<%=rsFind("pkg_id")%>" <%If RecCount = 1 Then%>checked<%End If%>>
240
                                          <%End If%>
241
                                       </td>
242
                                       <td background="images/bg_form_lightgray.gif" class="form_txt">
243
                                          <%
244
                                          Dim ver_ext
245
                                          ver_ext = ""
246
                                          If ( (NOT IsNull(parAdd_type)) AND (NOT IsNull(parRtag_id)) AND ((parAdd_type = Cstr(enum_ADD_DEPENDENCIES)) OR (parAdd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES))) ) Then
247
                                             ver_ext = rsFind("v_ext")
248
                                             If NOT IsNull(ver_ext) AND ver_ext <> "" Then
249
                                                ' Remove leading dot character, if there is one
250
                                                If Left(ver_ext,1) = "." AND Len(ver_ext) > 1 Then
251
                                                   ver_ext = Mid(ver_ext, 2, Len(ver_ext)-1)
252
                                                Else
253
                                                   ver_ext = ""
254
                                                End If
255
                                             End If
256
                                          End If
257
                                          %>
258
 
259
                                          <%If NOT IsNull(ver_ext) AND Len(ver_ext) > 0 Then%>
260
                                             <%=Highlight_Substring ( rsFind("pkg_name"), parPkgfind )%>&nbsp&nbsp&nbsp&nbsp(<%=ver_ext%>)
261
                                          <%Else%>
262
                                             <%=Highlight_Substring ( rsFind("pkg_name"), parPkgfind )%>
263
                                          <%End If%>
264
                                       </td>
265
                                    </tr>
266
                                    <%rsFind.MoveNext
267
                                 WEnd
268
 
269
                                 rsFind.Close
270
                                 Set rsFind = nothing
271
                                 %>
272
                                 <tr>
273
                                    <td width="1%" nowrap class="form_field">&nbsp; </td>
274
                                    <td nowrap width="100%" class="form_txt">
275
                                       <%If Request("errmsg") <> "" Then Call DisplayInfo( "PKG_NAME_REQUIRED", 200 )%>
276
                                       <input type="reset" name="btn" value="&laquo; Back" class="form_btn" onClick="history.back();">
277
                                       <input type="submit" name="btn" value="Next &raquo;" class="form_btn" id="btnnext">
278
                                       <input type="reset" name="btn" value="Cancel" class="form_btn" onClick="history.go(-2);">
279
                                       <br>
280
                                       <br>
281
                                    </td>
282
                                 </tr>
283
                                 <input type="hidden" name="pv_id" value="<%=parPv_id%>">
284
                                 <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
285
                                 <input type="hidden" name="add_type" value="<%=parAdd_type%>">
286
                                 <input type="hidden" name="pkgfind" value="<%=parPkgfind%>">
287
                              </form>
288
                           </table>
289
                        <!-- END Body-->
290
                        </td>
291
                        <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
292
                     </tr>
293
                     <tr>
294
                        <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom">
295
                           <img src="images/lbox_bl_cnr_b.gif" width="13" height="13">
296
                        </td>
297
                        <td background="images/lbox_bg_blue.gif"></td>
298
                        <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom" align="right">
299
                           <img src="images/lbox_br_cnr_b.gif" width="13" height="13">
300
                        </td>
301
                     </tr>
119 ghuddy 302
                  </table>
121 hknight 303
               </td>
304
            </tr>
305
         </table>
306
         <!-------------------------------------------------->
307
      </td>
308
   </tr>
309
   <tr>
310
      <td valign="bottom" background="images/bg_lght_gray.gif">
311
         <!-- FOOTER -->
312
         <!--#include file="_footer.asp"-->
313
      </td>
314
   </tr>
119 ghuddy 315
</table>
316
</body>
317
</html>
318
<%
319
Call Destroy_All_Objects
121 hknight 320
%>