<%@LANGUAGE="VBSCRIPT"%> <% '===================================================== '| | '| SEARCH RESULT | '| PACKAGES | '| | '===================================================== %> <% Option explicit ' Good idea to set when using redirect Response.Expires = 0 ' always load the page, dont store %> <% ' Make sure rtag_id is always present If Request("pv_id") = "" AND Request("rtag_id") = "" Then Call Destroy_All_Objects Response.Redirect("index.asp") End If objPMod.PersistInQryString ( aPersistList(enumPAR_ADD_TYPE) ) objPMod.PersistInCookie("pkgfind") %> <% '------------ ACCESS CONTROL ------------------ %> <% '------------ Variable Definition ------------- Dim parAdd_type Dim parPkgfind Dim rsFind Dim parPv_id Dim RecCount '------------ Constants Declaration ----------- '------------ Variable Init ------------------- parAdd_type = Request("add_type") parPkgfind = Request("pkgfind") parPv_id = Request("pv_id") '---------------------------------------------- %> <% Function Page_Title ( NNadd_type ) If NNadd_type = Cstr(enum_ADD_PACKAGES) Then Page_Title = "ADD package" ElseIf NNadd_type = Cstr(enum_ADD_DEPENDENCIES) Then Page_Title = "ADD dependency" ElseIf NNadd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES) Then Page_Title = "ADD Runtime Dependency" Else Page_Title = "" End If End Function Function Search_For_Package_Names ( SSpkgfind ) Dim pkg_name_like, SQLor, pkglistARR SQLor = "" If Len( Replace( SSpkgfind, " ", "" ) ) = 0 Then ' Show all pkg names SQLor = " OR pkg.pkg_name LIKE '%'" Else ' Search for ... pkglistARR = Split( Trim( SSpkgfind ), " ") If Ubound( pkglistARR ) > 0 Then ' Multiple pkg_name search For Each pkg_name_like In pkglistARR If pkg_name_like <> "" Then SQLor = SQLor &" OR UPPER(pkg.pkg_name) LIKE UPPER('%"& pkg_name_like &"%')" End If Next Else ' Single pkg_name search SQLor = " OR UPPER(pkg.pkg_name) LIKE UPPER('%"& Trim( SSpkgfind ) &"%')" End If End If ' Search may be restricted to those packages that have versions in the specified release, so alter the ' query accordingly. If ( (NOT IsNull(parAdd_type)) AND (NOT IsNull(parRtag_id)) AND (parAdd_type = Cstr(enum_ADD_DEPENDENCIES)) ) Then ' find all packages matching wildcard, that have versions in the specified release, and that are not already ' configured as a build dependency, and that is not the actual package we are configuring dependencies for Search_For_Package_Names = _ " SELECT pkg.*, pv.pv_id, pv.v_ext"&_ " FROM packages pkg, release_content rc, package_versions pv"&_ " WHERE pkg.pkg_id != 0"&_ " AND pv.pkg_id = pkg.pkg_id"&_ " AND pv.pv_id = rc.pv_id"&_ " AND rc.pv_id NOT IN (SELECT pd.dpv_id FROM package_dependencies pd WHERE pd.pv_id = "& parPv_id & ")"&_ " AND pkg.pkg_id NOT IN (SELECT pvv.pkg_id FROM package_versions pvv WHERE pvv.pv_id = "& parPv_id & ")"&_ " AND rc.rtag_id = "& parRtag_id &_ " AND ( pkg.pkg_name = ''"&_ SQLor &_ " )"&_ "ORDER BY UPPER(pkg.pkg_name)" Else If ( (NOT IsNull(parAdd_type)) AND (NOT IsNull(parRtag_id)) AND (parAdd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES)) ) Then ' find all packages matching wildcard, that have versions in the specified release, and that are not already ' configured as a runtime dependency, and that is not the actual package we are configuring dependencies for Search_For_Package_Names = _ " SELECT pkg.*, pv.pv_id, pv.v_ext"&_ " FROM packages pkg, release_content rc, package_versions pv"&_ " WHERE pkg.pkg_id != 0"&_ " AND pv.pkg_id = pkg.pkg_id"&_ " AND pv.pv_id = rc.pv_id"&_ " AND pv.pv_id NOT IN (SELECT rtd.rtd_id FROM runtime_dependencies rtd WHERE rtd.pv_id = "& parPv_id & ")"&_ " AND pkg.pkg_id NOT IN (SELECT pvv.pkg_id FROM package_versions pvv WHERE pvv.pv_id = "& parPv_id & ")"&_ " AND rc.rtag_id = "& parRtag_id &_ " AND ( pkg.pkg_name = ''"&_ SQLor &_ " )"&_ "ORDER BY UPPER(pkg.pkg_name)" Else ' simply find all packages matching wildcard, regardless of the specified release or any other constraint ' This is needed when user is adding package versions to a release. ' Only allow the addition of package names that have versions Search_For_Package_Names = _ " SELECT pkg.*"&_ " FROM packages pkg"&_ " WHERE pkg.pkg_id != 0"&_ " AND ( pkg.pkg_name = ''"&_ SQLor &_ " )"&_ " AND exists (select 1 from PACKAGE_VERSIONS pv where pv.PKG_ID = pkg.PKG_ID)" &_ "ORDER BY UPPER(pkg.pkg_name)" End If End If End Function %> Release Manager
<%=Page_Title ( parAdd_type )%>

Search result for <%=parPkgfind%> Not found what you looking for?
Create new package name.

Select desired packages and click Next.
<%Set rsFind = OraDatabase.DbCreateDynaset( Search_For_Package_Names ( parPkgfind ), cint(0))%> <%RecCount = CInt(rsFind.RecordCount)%> <%While ((NOT rsFind.BOF) AND (NOT rsFind.EOF)) %> <%rsFind.MoveNext WEnd rsFind.Close Set rsFind = nothing %>
Package Name
<%If ( (NOT IsNull(parAdd_type)) AND ((parAdd_type = Cstr(enum_ADD_DEPENDENCIES)) OR (parAdd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES))) ) Then%> " <%If RecCount = 1 Then%>checked<%End If%>> <%Else%> " <%If RecCount = 1 Then%>checked<%End If%>> <%End If%> <% Dim ver_ext ver_ext = "" 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 ver_ext = rsFind("v_ext") If NOT IsNull(ver_ext) AND ver_ext <> "" Then ' Remove leading dot character, if there is one If Left(ver_ext,1) = "." AND Len(ver_ext) > 1 Then ver_ext = Mid(ver_ext, 2, Len(ver_ext)-1) Else ver_ext = "" End If End If End If %> <%If NOT IsNull(ver_ext) AND Len(ver_ext) > 0 Then%> <%=Highlight_Substring ( rsFind("pkg_name"), parPkgfind )%>    (<%=ver_ext%>) <%Else%> <%=Highlight_Substring ( rsFind("pkg_name"), parPkgfind )%> <%End If%>
<%If Request("errmsg") <> "" Then %>
<%Call DisplayInfo( "PKG_NAME_REQUIRED", 200 )%>
<%End If%>