1116N/A## The contents of this file are subject to the terms of the
1116N/A## Common Development and Distribution License (the "License").
1116N/A## You may not use this file except in compliance with the License.
1116N/A## See the License for the specific language governing permissions
1116N/A## and limitations under the License.
1116N/A## When distributing Covered Code, include this CDDL HEADER in each
1116N/A## If applicable, add the following below this CDDL HEADER, with the
1116N/A## fields enclosed by brackets "[]" replaced with your own identifying
1116N/A## information: Portions Copyright [yyyy] [name of copyright owner]
2603N/A## Copyright 2009, 2011 Oracle
and/or its affiliates. All rights reserved.
1116N/A catalog = g_vars["catalog"]
1116N/A request = g_vars["request"]
1116N/A<%def name="page_title(g_vars)"><%
1116N/A return "Advanced Package Search"
1116N/A<%def name="get_search_criteria(request)"><%
1116N/A # Based on the request parameters, return a dict representing the
1116N/A # Add an "All" selection to be used as the default.
1116N/A # The string value representing the user's selection.
1116N/A # The version object matching the string value of the user's selection.
1116N/A if versions and selected_val and not selected_ver:
1116N/A # The version provided didn't match a valid one, so default to
1116N/A # the first one in the list.
1116N/A selected_ver = versions[0][0]
1116N/A selected_val = versions[0][1]
1116N/A criteria["versions"] = versions
1116N/A criteria["selected_ver"] = selected_ver
1116N/A criteria["selected_val"] = selected_val
1116N/A<%def name="display_search_form(criteria, request)"><%
1116N/A rpp_values = (10, 20, 30, 50, 100, 250, 500)
1116N/A token_val = criteria["token"]
2603N/A <table role="presentation" summary="Additional criteria to alter how search results are
1116N/A <input id="search-field" type="text" size="80"
1116N/A maxlength="512" name="token"
2603N/A value="${token_val | h}" title="search field"/>
1116N/A <td class="label">Show results as:</td>
1116N/A% for val, label in return_types:
1116N/A <input id="show-${val}" type="radio"
1116N/A name="show" value="${val}"/>
1116N/A <label for="show-${val}">${label}</label>
1116N/A <span class="tip" title="You can return packages
1116N/A in standard search by enclosing your entire query within '<>'.">tip</span>
1116N/A <label for="show-all-versions">Show all
1116N/A <input id="show-all-versions" type="checkbox"
1116N/A <span class="tip" title="By default, only the
1116N/A latest versions of packages are shown. To show all versions, check this
1116N/A checkbox. This option is ignored when results are shown as Actions.">
1116N/A <label for="case-sensitive">Perform case-sensitive search:</label>
1116N/A <input id="case-sensitive" type="checkbox"
1116N/A <span class="tip" title="By default, searches
1116N/A are not case-sensitive. To perform a case-sensitive search, check this
1116N/A <label for="rpp">Results per page:</label>
1116N/A <select id="rpp" name="rpp">
1116N/A value="${val}">${val}</option>
1116N/A versions = criteria["versions"]
1116N/A selected_val = criteria["selected_val"]
1116N/A selected_ver = criteria["selected_ver"]
1116N/A <label for="version">Release and Branch:</label>
1116N/A <select id="version" name="v">
1116N/A attrs = 'selected="selected" '
1116N/A <input id="submit-search" type="submit"
1116N/A name="action" value="Advanced Search"/>