Subversion Repositories DevTools

Rev

Rev 5983 | Rev 6289 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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