Package wwsbr_search_page
This package contains the public rendering utilities to render the
search results for all search portlets aftering calling the back
end search engine to run the search.
This package also contains the rendering routines for the
Save Search form, the delete saved search action and the
Advanced Search Smartlink.
This package is granted execute to public
- Scope:
-
Public
| Exception Summary |
INVALID_DATEVALUE
Exception raised when an invalid data is specified for
a date attribute. |
INVALID_NUMBERVALUE
Exception raised when an invalid number is specified for
a numeric attribute. |
| Variable Summary |
errorattribute
Package variable to contain the attribute which has caused an error. | varchar2(200) |
max_search_term_size
Constant for the maximum size of a search term. | number |
| Function/Procedure Summary |
appendattributeinfotourl
This method is used to append attribute information specified in the
array of attribute records to the url which is used for the Save Search
and Bulk Action links. | |
deletesearch
Deletes a saved search. | |
form
This procedure accepts search criteria, invokes search routine in
searchdb or wwsrc_portlet_repos_search (when in add portlet screen)
and then displays the results using the region rendering code. | |
render_inline_error
Renders error messages to the end user in a nice way. | |
savesearchform
Renders the save search form
| |
smartlink
This procedure redirects the browser to the Advanced Search Screen as
specified in the Search Global Settings. | |
INVALID_DATEVALUE
INVALID_DATEVALUE exception
-
Exception raised when an invalid data is specified for
a date attribute.
INVALID_NUMBERVALUE
INVALID_NUMBERVALUE exception
-
Exception raised when an invalid number is specified for
a numeric attribute.
errorattribute
errorattribute varchar2(200) := null
-
Package variable to contain the attribute which has caused an error.
max_search_term_size
max_search_term_size number := 200
-
Constant for the maximum size of a search term.
| Function/Procedure Detail |
appendattributeinfotourl
procedure appendattributeinfotourl(
p_url in out varchar2,
p_attributes in wwsrc_runtime_attr_varray
) -
This method is used to append attribute information specified in the
array of attribute records to the url which is used for the Save Search
and Bulk Action links.
This method serializes the contents of the attribute records and only
appends some of the fields to the url (the ID and Datatype are not
appended)
- Parameters:
p_url - the url to append top_attributes - the array of search attributes to search for
deletesearch
procedure deletesearch(
name_array in owa.vc_arr,
value_array in owa.vc_arr
) -
Deletes a saved search.
- Parameters:
name_array - List of the names of parameters submitted to this proc via modplsql.value_array - Corresponding list of values.
form
procedure form(
p_preference in wwsbr_search_preference,
p_persistent_page_param_names in owa.vc_arr,
p_persistent_page_param_values in owa.vc_arr,
p_page_url in varchar2 default null,
p_referencepath in varchar2 default null,
p_return_type in varchar2 default wwsbr_search_constants . items,
p_action in varchar2 default wwsbr_search_constants . old_search,
p_firsthit in number default 1,
p_lasthit in number default 10,
p_countarray in wwsbr_type.array default wwsbr_type . empty,
p_direction in varchar2 default null,
p_searchtype in varchar2 default wwsbr_search_constants . simple,
p_queryid in wwv_searches.id%type default null,
p_pgs_to_search in wwsbr_site_array default wwsbr_site_array ( ),
p_selected_pgs in wwsbr_site_array default wwsbr_site_array ( ),
p_orig_submit_pg in wwsbr_site_array default wwsbr_site_array ( ),
p_orig_submit_edpg in wwsbr_site_array default wwsbr_site_array ( ),
p_mainoperator in varchar2 default wwsbr_search_constants . contains_all,
p_mainsearch in varchar2 default null,
p_orderby_id in number default null,
p_orderby_siteid in number default null,
p_orderby_dir in varchar2 default null,
p_folderid in number default null,
p_foldersiteid in number default null,
p_includesubfolder in number default 0,
p_itemtypeid in number default null,
p_itemtypesiteid in number default null,
p_categoryid in number default null,
p_categorysiteid in number default null,
p_perspectives in wwsrc_att_value_set,
p_search_atts in wwsrc_runtime_attr_varray,
p_selected_atts_str in varchar2 default null,
p_hidden_atts_str in varchar2 default null,
p_attributetype in varchar2 default wwsbr_search_constants . all_search,
p_max_return_num in number,
p_num_results in number,
p_results_style_id in number default 1,
p_results_style_site_id in number default wwsbr_site_db . shared_siteid,
p_calledfrom in number default wwpob_page . calledfrom_search,
p_pagecalledfrom in number default null,
p_advice_msg in varchar2 default null
) -
This procedure accepts search criteria, invokes search routine in
searchdb or wwsrc_portlet_repos_search (when in add portlet screen)
and then displays the results using the region rendering code.
This is invoked from the render portlet method of the search portlet,
this passes it the search criteria. The procedure then passes these
criteria to searchdb.search which returns it the results. The results
are then displayed.
Note: Two parameters are required for the page groups to distinguish
between the page groups the user has selected and those that will be
searched. These are not always the same. If the user has not selected
any page groups but the page builder has limited the portlet to search
a few page groups, then the search should only search all the page groups
the page builder selected as opposed to all page groups in portal.
When the user next uses the popup no page groups should be selected
therefore we can use the l_selected_pgs variable to store those that
will be searched as if we did in the case illustrated above when the user
next used the popup all the page groups the page builder had selected
would be selected, this is not what the user would expect.
There are 2 other page group parameters (p_orig_submit_pg, p_orig_submit_edpg)
but these are purely for the links that are in the saved search portlet and
are not used anywhere else. These are required so that saved searches display
the same messages as if it were run from a portlet. They contains the original
values from the submitting portlet prior to any resolving. Also a thing to note
is the the p_orig_submit_edpg will always have a value. If no page groups
were selected in the edit defaults of the submitting portlet it will have the
value wwsbr_search_constants.NO_EDIT_DEFAULT_PGS. This is also the case if
the portlet was submitting to itself (in this case the submitted page groups
is null so it is replaced with the constant.)
- Parameters:
p_preference - the search portlet preferences for the portlet
being rendered.p_persistent_page_param_names - URL parameter names that are not related
to this portlet but should be persisted
in links that refresh the portlet page.p_persistent_page_param_values - Values for the same.p_page_url - the url of the target results pagep_referencepath - the reference path of this portlet instancep_return_type - return type to be seached for, this is the
return type resolved from the user
selection and the portlets edit
defaults selected return typep_action - the type of search, OLD, SUBMIT or SEARCH_NPp_firsthit - the rownumber in the result set of the first
record displayedp_lasthit - the rownumber in the result set of the last
record displayedp_countarray - the array of size four containing the number
of results returned of each typep_direction - whether to display the NEXT or PREVIOUS set of
results when action is SEARCH_NPp_searchtype - simple or advancedp_queryid - the identifier of this searchp_pgs_to_search - the array of pagegroups which are to be searchedp_selected_pgs - the users selected page groupsp_orig_submit_pg - needed for Saved Searches ONLY,
the original value of the submitting portlets
selected page groupsp_orig_submit_edpg - needed for Saved Searches ONLY,
the original value of the submitting portlets
edit defaults page groupsp_mainoperator - contains all/contains any applied to the search term(s)p_mainsearch - search term(s)p_orderby_id - id of attribute to order search byp_orderby_siteid - pagegroup id of attribute to order search byp_orderby_dir - whether to order by ascending or descending
(not implemented yet)p_Folderid - the id of the folder (page) to search inp_Foldersiteid - the pagegroup id of the folder (page) to search inp_Includesubfolder - whether to search in subfolders or notp_itemtypeid - the id of the item type to search forp_itemtypesiteid - the pagegroup id of the item type to search forp_categoryid - the id of the category to search forp_categorysiteid - the pagegroup id of the category to search forp_perspectives - The selected perspectivesp_search_atts - the attributes on the search form
(visible and hidden)p_selected_atts_str - the string of selected attributesp_hidden_atts_str - the string of hidden attributesp_attributetype - match any/all to apply to search criteriap_max_return_num - maximum number of results to get from searchp_num_results - number of results to show on pagep_results_style_id - the id of the style to use when rendering resultsp_results_style_site_id - the site id of the style to use when
rendering resultsp_calledfrom - indicates where the search results were called from- See Also:
-
wwsbr_search_results.render_portlet (routine calling form)
-
searchdb.search (form calls this routine)
render_inline_error
procedure render_inline_error
-
Renders error messages to the end user in a nice way.
We have to render style info to work around B2141061
savesearchform
procedure savesearchform(
p_name in varchar2 default null,
p_queryurlparams in varchar2 default null,
p_searchtype in varchar2 default wwsbr_search_constants . simple,
p_page_url in varchar2 default null,
p_action in varchar2 default null,
p_request in varchar2 default null,
p_srcparams in wwsbr_type.array default wwsbr_type . empty
) -
Renders the save search form
- Parameters:
p_name - name of the search to savep_QueryUrlParams - parameters used to return user to previous pagep_searchType - basic/advanced searchp_page_url - url of the search page to return top_action - indicated if the OK or CANCEL button was used to submit the formp_request - value of the button (not used in this method, has
to be added as a parameter as this method is called
direcly and it is one of the parameters of the form)p_srcparams - array of name-value pairs separated by an =
to include as parameters in the page when returning
smartlink
procedure smartlink
-
This procedure redirects the browser to the Advanced Search Screen as
specified in the Search Global Settings.