Overview | Package | Object Type | Deprecated | Index | Help
| Oracle Application Server Portal PL/SQL API Reference - 10.1.4
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES
SUMMARY: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE | DETAIL: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE

## Package wwsrc_api

This package contains APIs for searching Oracle Portal.

All of the APIs in this package assume that the context has been set for the functions to execute as a specific Oracle Portal user (using wwctx_api procedure - `wwctx_api.set_context()`.

The main search APIs described in this package are:

- `page_search()`
- `item_search()`
- `category_search()`
- `perspective_search()`

Note: You build up search attribute criteria for these APIs using the `specify_attributes()` procedure.

For more information about these APIs and examples of how to use them, refer to the Oracle Application Server Developer's Guide, available on the Oracle Technology Network. (http://www.oracle.com/technology/products/ias/portal).

Scope:
  Public

Exception Summary
`ATTRIBUTE_NOT_INDEXED` Oracle Text returned DRG-10837 : Attribute Not Indexed Error.
`GENERAL_ORACLE_TEXT_ERROR` A general Oracle Text error was reported.
`KNOWLEDGE_BASE_EXCEPTION` Search returned Knowledge base exception.
`NO_SEARCH_VALUE` The search failed as no search terms were provided.
`PERMISSION_DENIED` Permission denied when requesting XML for a given result.
`QUERY_LANGUAGE_SYNTAX_ERROR` Oracle Text returned Syntax Error in Query Language used for Search (usually syntax of p_mainsearch parameter).
`QUERY_TOO_COMPLEX` The Oracle Text query was too complex to process.
`RESOURCE_NOT_FOUND` Resource can no longer be found when requesting XML for a given result.
`SEARCH_FAILURE_EXCEPTION` Unhandled Search API Failure caused by either Portal or Oracle Text.
`WILDCARD_EXPANSION_EXCEPTION` Oracle Text returned DRG-51030: Wildcard expansion resulted in too many terms.

Type Summary
`cats_result_array_type` Array of search result records for categories. | `table`
`cats_result_type` Search result record for categories. | `subtype`
`items_result_array_type` Array of search result records for items. | `table`
`items_result_type` Search result record for items. | `subtype`
`number_list_type` A type used for a list of numbers. | `table`
`pages_result_array_type` Array of search result records for pages. | `table`
`pages_result_type` Search result record for pages. | `subtype`
`perspective_list_type` Type for making a list of perspectives for use with p_perspective_list. | `table`
`perspective_type` Type for making a perspective record for use with perspective_list_type. | `record`
`persps_result_array_type` Array of search result records for perspectives. | `table`
`persps_result_type` Search result record for perspectives. | `subtype`

Constant Summary
`CONTAINS_ALL` | `varchar2(20)`
`CONTAINS_ANY` | `varchar2(20)`
`DATA_TYPE_BOOLEAN` | `varchar2(20)`
`DATA_TYPE_DATE` | `varchar2(20)`
`DATA_TYPE_FILE` | `varchar2(20)`
`DATA_TYPE_NUMBER` | `varchar2(20)`
`DATA_TYPE_PLSQL` | `varchar2(20)`
`DATA_TYPE_TEXT` | `varchar2(20)`
`DATA_TYPE_URL` | `varchar2(20)`
`EQUALS_ANY` | `varchar2(20)`
`EQUALS_TO` | `varchar2(20)`
`FILENAME_LIKE_ALL` | `varchar2(20)`
`FILENAME_LIKE_ANY` | `varchar2(20)`
`FUZZY_ALL` | `varchar2(20)`
`FUZZY_ANY` | `varchar2(20)`
`GREATER_THAN` | `varchar2(20)`
`LESS_THAN` | `varchar2(20)`
`LIKE_ALL` | `varchar2(20)`
`LIKE_ANY` | `varchar2(20)`
`MATCH_ALL` | `varchar2(3)`
`MATCH_ANY` | `varchar2(3)`
`MAX_ROWS` Default value for the maximum number of results returned from the search query. | `number`
`NEAR` | `varchar2(20)`
`ORDERBY_ASCENDING` | `varchar2(20)`
`ORDERBY_DESCENDING` | `varchar2(20)`
`QUERY_LANGUAGE` | `varchar2(20)`
`SOUNDEX_ALL` | `varchar2(20)`
`SOUNDEX_ANY` | `varchar2(20)`
`URL_LIKE_ALL` | `varchar2(20)`
`URL_LIKE_ANY` | `varchar2(20)`

Variable Summary
`empty_number_list` An empty number list of number_list_type. | `number_list_type`
`empty_perspective` An empty perspective record of perspective_type. | `perspective_type`
`empty_perspective_list` An empty perspective record list of perspective_list_type. | `perspective_list_type`

Function/Procedure Summary
`category_search` Searches for categories and returns the category results rows in the form of an array of wwsbr_all_categories records. | `cats_result_array_type`
`get_all_items_xml` Return an XML document describing the given item result set from the search result array of items. | `clob`
`get_all_pages_xml` Return an XML document describing the given page result set from the search result array of pages. | `clob`
`get_item_xml` Returns an XML document describing the given item from the search result record for this resource. | `clob`
`get_page_xml` Returns an XML document describing the given page from the search result record for this resource. | `clob`
`item_search` Searches for items and returns the item results rows in the form of an array of wwsbr_all_items records. | `items_result_array_type`
`page_search` Searches for pages and returns the page results rows in the form of an array of wwsbr_all_folders records. | `pages_result_array_type`
`perspective_search` Searches for perspectives and returns the perspective results rows in the form of an array of wwsbr_all_perspectives records. | `persps_result_array_type`
`specify_attributes` Builds up the search attribute criteria for the search APIs (item_search() , page_search(), etc) by storing the attributes in an array based on wwsrc_runtime_attr_varray() object. | ``

Exception Detail

### ATTRIBUTE_NOT_INDEXED

    ATTRIBUTE_NOT_INDEXED exception

  Oracle Text returned DRG-10837 : Attribute Not Indexed Error. The indexes for one or more attributes need to be updated. The attributes cannot be used in the search until the indexes are next synchronized. To synchronize all the Oracle Text indexes, execute wwv_context.sync().

### GENERAL_ORACLE_TEXT_ERROR

    GENERAL_ORACLE_TEXT_ERROR exception

  A general Oracle Text error was reported.

### KNOWLEDGE_BASE_EXCEPTION

    KNOWLEDGE_BASE_EXCEPTION exception

  Search returned Knowledge base exception. DRG-11446,11422,11432: Supplied knowledge base file is not installed (Oracle Text installation is incomplete).

### NO_SEARCH_VALUE

    NO_SEARCH_VALUE exception

  The search failed as no search terms were provided.

### PERMISSION_DENIED

    PERMISSION_DENIED exception

  Permission denied when requesting XML for a given result.

### QUERY_LANGUAGE_SYNTAX_ERROR

    QUERY_LANGUAGE_SYNTAX_ERROR exception

  Oracle Text returned Syntax Error in Query Language used for Search (usually syntax of p_mainsearch parameter).

### QUERY_TOO_COMPLEX

    QUERY_TOO_COMPLEX exception

  The Oracle Text query was too complex to process.

### RESOURCE_NOT_FOUND

    RESOURCE_NOT_FOUND exception

  Resource can no longer be found when requesting XML for a given result.

### SEARCH_FAILURE_EXCEPTION

    SEARCH_FAILURE_EXCEPTION exception

  Unhandled Search API Failure caused by either Portal or Oracle Text.

### WILDCARD_EXPANSION_EXCEPTION

    WILDCARD_EXPANSION_EXCEPTION exception

  Oracle Text returned DRG-51030: Wildcard expansion resulted in too many terms. Restrict the search and try again.

Type Detail

### cats_result_array_type

    type cats_result_array_type is table of cats_result_type index by binary_integer

  Array of search result records for categories.

### cats_result_type

    subtype cats_result_type is wwsbr_all_categories%rowtype

  Search result record for categories.

### items_result_array_type

    type items_result_array_type is table of items_result_type index by binary_integer

  Array of search result records for items.

### items_result_type

    subtype items_result_type is wwsbr_all_items%rowtype

  Search result record for items.

### number_list_type

    type number_list_type is table of number index by binary_integer

  A type used for a list of numbers. This type is used for listing the page group IDs of all the page groups to be searched and for holding the list of scores.

  Fields:
    `number` - A number in the list

### pages_result_array_type

    type pages_result_array_type is table of pages_result_type index by binary_integer

  Array of search result records for pages.

### pages_result_type

    subtype pages_result_type is wwsbr_all_folders%rowtype

  Search result record for pages.

### perspective_list_type

    type perspective_list_type is table of perspective_type index by binary_integer

  Type for making a list of perspectives for use with p_perspective_list.

  Fields:
    `perspective_type` - A perspective record in the list

### perspective_type

    type perspective_type is record (
        perspective_id number,
        perspective_siteid number
    )

  Type for making a perspective record for use with perspective_list_type.

  Fields:
    `perspective_id` - the ID of the perspective
    `perspective_siteid` - the site ID of the perspective

### persps_result_array_type

    type persps_result_array_type is table of persps_result_type index by binary_integer

  Array of search result records for perspectives.

### persps_result_type

    subtype persps_result_type is wwsbr_all_perspectives%rowtype

  Search result record for perspectives.

Constant Detail

### CONTAINS_ALL

    CONTAINS_ALL constant varchar2(20) := wwsbr_search_constants . CONTAINS_ALL

### CONTAINS_ANY

    CONTAINS_ANY constant varchar2(20) := wwsbr_search_constants . CONTAINS_ANY

### DATA_TYPE_BOOLEAN

    DATA_TYPE_BOOLEAN constant varchar2(20) := wwv_attributedb . DATA_TYPE_BOOLEAN

### DATA_TYPE_DATE

    DATA_TYPE_DATE constant varchar2(20) := wwv_attributedb . DATA_TYPE_DATE

### DATA_TYPE_FILE

    DATA_TYPE_FILE constant varchar2(20) := wwv_attributedb . DATA_TYPE_FILE

### DATA_TYPE_NUMBER

    DATA_TYPE_NUMBER constant varchar2(20) := wwv_attributedb . DATA_TYPE_NUMBER

### DATA_TYPE_PLSQL

    DATA_TYPE_PLSQL constant varchar2(20) := wwv_attributedb . DATA_TYPE_PLSQL

### DATA_TYPE_TEXT

    DATA_TYPE_TEXT constant varchar2(20) := wwv_attributedb . DATA_TYPE_TEXT

### DATA_TYPE_URL

    DATA_TYPE_URL constant varchar2(20) := wwv_attributedb . DATA_TYPE_URL

### EQUALS_ANY

    EQUALS_ANY constant varchar2(20) := wwsbr_search_constants . EQUALS_ANY

### EQUALS_TO

    EQUALS_TO constant varchar2(20) := wwsbr_search_constants . EQUALS_TO

### FILENAME_LIKE_ALL

    FILENAME_LIKE_ALL constant varchar2(20) := wwsbr_search_constants . FILENAME_LIKE_ALL

### FILENAME_LIKE_ANY

    FILENAME_LIKE_ANY constant varchar2(20) := wwsbr_search_constants . FILENAME_LIKE_ANY

### FUZZY_ALL

    FUZZY_ALL constant varchar2(20) := wwsbr_search_constants . FUZZY_ALL

### FUZZY_ANY

    FUZZY_ANY constant varchar2(20) := wwsbr_search_constants . FUZZY_ANY

### GREATER_THAN

    GREATER_THAN constant varchar2(20) := wwsbr_search_constants . GREATER_THAN

### LESS_THAN

    LESS_THAN constant varchar2(20) := wwsbr_search_constants . LESS_THAN

### LIKE_ALL

    LIKE_ALL constant varchar2(20) := wwsbr_search_constants . LIKE_ALL

### LIKE_ANY

    LIKE_ANY constant varchar2(20) := wwsbr_search_constants . LIKE_ANY

### MATCH_ALL

    MATCH_ALL constant varchar2(3) := wwsbr_search_constants . ALL_SEARCH

### MATCH_ANY

    MATCH_ANY constant varchar2(3) := wwsbr_search_constants . ANY_SEARCH

### MAX_ROWS

    MAX_ROWS constant number := 1000

  Default value for the maximum number of results returned from the search query.

### NEAR

    NEAR constant varchar2(20) := wwsbr_search_constants . NEAR

### ORDERBY_ASCENDING

    ORDERBY_ASCENDING constant varchar2(20) := wwsbr_search_constants . ASCENDING

### ORDERBY_DESCENDING

    ORDERBY_DESCENDING constant varchar2(20) := wwsbr_search_constants . DESCENDING

### QUERY_LANGUAGE

    QUERY_LANGUAGE constant varchar2(20) := wwsbr_search_constants . QUERY_LANGUAGE

### SOUNDEX_ALL

    SOUNDEX_ALL constant varchar2(20) := wwsbr_search_constants . SOUNDEX_ALL

### SOUNDEX_ANY

    SOUNDEX_ANY constant varchar2(20) := wwsbr_search_constants . SOUNDEX_ANY

### URL_LIKE_ALL

    URL_LIKE_ALL constant varchar2(20) := wwsbr_search_constants . URL_LIKE_ALL

### URL_LIKE_ANY

    URL_LIKE_ANY constant varchar2(20) := wwsbr_search_constants . URL_LIKE_ANY

Variable Detail

### empty_number_list

    empty_number_list number_list_type

  An empty number list of number_list_type.

### empty_perspective

    empty_perspective perspective_type

  An empty perspective record of perspective_type.

### empty_perspective_list

    empty_perspective_list perspective_list_type

  An empty perspective record list of perspective_list_type.

Function/Procedure Detail

### category_search

    function category_search(
        p_mainoperator in varchar2 default contains_all,
        p_mainsearch in varchar2 default null,
        p_page_groups in number_list_type default empty_number_list,
        p_orderbyid in number default null,
        p_orderbysiteid in number default null,
        p_orderbydir in varchar2 default null,
        p_firsthit in number default 1,
        p_rows in number default max_rows,
        p_out_count out number,
        p_out_scores out number_list_type
    ) return cats_result_array_type

  Searches for categories and returns the category results rows in the form of an array of wwsbr_all_categories records.

  Parameters:
    `p_mainoperator` - keyword operator to be used in the search. Valid Operator values are defined as constants in this package (CONTAINS_ANY, EQUAL_TO, etc - see Search operators constants) Some operators may only be used when Oracle Text is enabled, others may only be used when Oracle Text is disabled Default value is CONTAINS_ALL
    `p_mainsearch` - keyword, or term to search for - this may be any value including an Oracle Text search string
    `p_page_groups` - IDs of the page groups to be searched, use the default value of empty_number_list for all page groups, otherwise, pass an array of ids
    `p_orderById` - ID of the attribute with which to order search results. Only base table attributes can be used
    `p_orderBySiteId` - site ID of the attribute being used to order search results, ignored unless p_orderById is passed
    `p_orderByDir` - indicates whether to order results ascending or descending, ignored unless p_orderById is passed. Valid values are ORDERBY_ASCENDING or ORDERBY_DESCENDING
    `p_firsthit` - starting row in current page, null or 1 to start from the beginning. Defaults to 1 if omitted. This parameter can be used with p_rows to paginate the results
    `p_rows` - maximum number of rows to return, this value defaults to the value of MAX_ROWS
    `p_out_count` - total count of search results
    `p_out_scores` - array of scores for search results, the index of the array matches the index of the results array returned by the function
  Returns:
    Array containing search results. The number of search results returned is less than or equal to the value specified for p_rows
  Exceptions:
    `NO_SEARCH_VALUE` - The search failed as no search terms were provided
    `WILDCARD_EXPANSION_EXCEPTION` - Oracle Text returned. DRG-51030: wildcard query expansion resulted in too many terms
    `KNOWLEDGE_BASE_EXCEPTION` - Oracle Text returned. DRG-11446,11422,11432: Supplied knowledge base file not installed (Oracle Text installation incomplete)
    `ATTRIBUTE_NOT_INDEXED` - Oracle Text returned DRG-10837 : Attribute Not Indexed Error Resync the indexes
    `QUERY_LANGUAGE_SYNTAX_ERROR` - Oracle Text returned Syntax Error in Query Language (usually p_mainsearch)
    `SEARCH_FAILURE_EXCEPTION` - An internal exception was raised by the Portal or Oracle Text code
  Since:
    10.1.4

### get_all_items_xml

    function get_all_items_xml(
        p_item_results in items_result_array_type
    ) return clob

  Return an XML document describing the given item result set from the search result array of items. Note that the user must have view privileges on each resource. The XML Schema documents for the XML produced by this function can be viewed at:

         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_xdb_xsd
         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_ptl_xsd
         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_ctm_xsd

  Example:

       DECLARE
           l_user_name  varchar2(60) := 'GEORGE';
           l_password   varchar2(60) := 'WELCOME1';
           l_company    varchar2(60) := NULL;
           l_results    wwsrc_api.items_result_array_type;
           l_scores     wwsrc_api.number_list_type;
           l_count      number;
           l_clob       clob;
           l_amount     binary_integer := 250;
           l_offset     number := 1;
           l_text       varchar2(32767);
       BEGIN
           wwctx_api.set_context(l_user_name, l_password, l_company);

           -- Perform the search
           l_results := wwsrc_api.item_search(
               p_mainsearch   => 'portal',
               p_max_rows     => 100,
               p_out_count    => l_count,
               p_out_scores   => l_scores
           );

           dbms_output.put_line('Number of Results : ' || l_count);
           dbms_output.put_line('Number of Results in Set : ' || l_results.count);

           l_amount := 255;
           l_offset := 1;
           begin
               l_clob := wwsrc_api.get_all_items_xml(l_results);
               dbms_lob.open(l_clob, dbms_lob.file_readonly);

               loop
                   dbms_lob.read(l_clob, l_amount, l_offset, l_text);
                   dbms_output.put(l_text);
                   l_offset := l_offset+l_amount;
                   exit when l_amount < 250;
               end loop;

               dbms_lob.close(l_clob);
           exception
               when wwsrc_api.RESOURCE_NOT_FOUND then
                   dbms_output.put_line('Resource has been moved/deleted');
               when wwsrc_api.PERMISSION_DENIED then
                   dbms_output.put_line('Unable to access Resource');
           end;

       EXCEPTION
           when wwsrc_api.SEARCH_FAILURE_EXCEPTION then
               dbms_output.put_line('Internal Exception (wwsrc)');
           when wwerr_api_exception.INTERNAL_EXCEPTION then
               dbms_output.put_line('Internal Exception (wwerr)');
           WHEN OTHERS THEN
               dbms_output.put_line(SubStr('Error ' ||
                   TO_CHAR(SQLCODE)||': '||SQLERRM, 1, 255));
               RAISE;
       END;

  Returns:
    A clob containing an XML document describing the item result set
  Exceptions:
    `RESOURCE_NOT_FOUND` - The resource has been moved or deleted since the search was run
    `PERMISSION_DENIED` - The resource is not available to the current user, or is on a template
    `SEARCH_FAILURE_EXCEPTION` - An internal exception
  Since:
    10.1.4

### get_all_pages_xml

    function get_all_pages_xml(
        p_page_results in pages_result_array_type
    ) return clob

  Return an XML document describing the given page result set from the search result array of pages. Note that the user must have view privileges on each resource. The XML Schema documents for the XML produced by this function can be viewed at:

         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_xdb_xsd
         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_ptl_xsd
         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_ctm_xsd

  For an example, see get_all_items_xml().

  Returns:
    A clob containing an XML document describing the page result set
  Exceptions:
    `RESOURCE_NOT_FOUND` - The resource has been moved or deleted since the search was run
    `PERMISSION_DENIED` - The resource is not available to the current user, or is on a template
    `SEARCH_FAILURE_EXCEPTION` - An internal exception
  Since:
    10.1.4

### get_item_xml

    function get_item_xml(
        p_result in items_result_type
    ) return clob

  Returns an XML document describing the given item from the search result record for this resource.

  Note that the user must have View privileges on this resource. The XML schema documents for the XML produced by this function can be viewed at:

         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_xdb_xsd
         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_ptl_xsd
         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_ctm_xsd

  Example:

       DECLARE
           l_user_name  varchar2(60) := 'GEORGE';
           l_password   varchar2(60) := 'WELCOME1';
           l_company    varchar2(60) := NULL;
           l_results    wwsrc_api.items_result_array_type;
           l_count      number;
           l_scores     wwsrc_api.number_list_type;
           l_clob       clob;
           l_amount     binary_integer := 250;
           l_offset     number := 1;
           l_text       varchar2(32767);
       BEGIN
           wwctx_api.set_context(l_user_name, l_password, l_company);

           -- Perform the search
           l_results := wwsrc_api.item_search(
               p_mainsearch   => 'portal',
               p_out_count    => l_count,
               p_out_scores   => l_scores
           );

           dbms_output.put_line('Number of Results : ' || l_count);
           dbms_output.put_line('Number of Results in Set : ' || l_results.count);

           for i in 1..l_results.count loop
               dbms_output.put_line(i || ' - ' || l_results(i).id);
               dbms_output.put_line(' Score = ' || l_scores(i));

               l_amount := 255;
               l_offset := 1;
               begin
                   l_clob := wwsrc_api.get_item_xml(l_results(i));
                   dbms_lob.open(l_clob, dbms_lob.file_readonly);

                   loop
                       dbms_lob.read(l_clob, l_amount, l_offset, l_text);
                       dbms_output.put(l_text);
                       l_offset := l_offset+l_amount;
                       exit when l_amount < 250;
                   end loop;

                   dbms_lob.close(l_clob);
               exception
                   when wwsrc_api.RESOURCE_NOT_FOUND then
                       dbms_output.put_line('Resource has been moved/deleted');
                   when wwsrc_api.PERMISSION_DENIED then
                       dbms_output.put_line('Unable to access Resource');
               end;

               dbms_output.put_line('.');
           end loop;

       EXCEPTION
           when wwsrc_api.SEARCH_FAILURE_EXCEPTION then
               dbms_output.put_line('Internal Exception (wwsrc)');
           when wwerr_api_exception.INTERNAL_EXCEPTION then
               dbms_output.put_line('Internal Exception (wwerr)');
           WHEN OTHERS THEN
               dbms_output.put_line(SubStr('Error ' ||
                   TO_CHAR(SQLCODE)||': '||SQLERRM, 1, 255));
               RAISE;
       END;

  Parameters:
    `p_result` - the search result record for which to return the XML
  Returns:
    a clob containing an XML document describing the resource
  Exceptions:
    `RESOURCE_NOT_FOUND` - The resource has been moved or deleted since the search was run
    `PERMISSION_DENIED` - The resource is not available to the current user, or is on a template
    `SEARCH_FAILURE_EXCEPTION` - An internal exception
  Since:
    10.1.4

### get_page_xml

    function get_page_xml(
        p_result in pages_result_type
    ) return clob

  Returns an XML document describing the given page from the search result record for this resource.

  Note that the user must have View privileges on this resource. The XML schema documents for the XML produced by this function can be viewed at:

         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_xdb_xsd
         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_ptl_xsd
         http://<portal>/portal/pls/<dad>/<schema>.wwsrc_app_xml.get_ctm_xsd

  For an example, see get_item_xml().

  Parameters:
    `p_result` - the search result record for which to return the XML
  Returns:
    a clob containing an XML document describing the resource
  Exceptions:
    `RESOURCE_NOT_FOUND` - The resource has been moved or deleted since the search was run
    `PERMISSION_DENIED` - The resource is not available to the current user, or is on a template
    `SEARCH_FAILURE_EXCEPTION` - An internal exception
  Since:
    10.1.4

### item_search

    function item_search(
        p_mainoperator in varchar2 default contains_all,
        p_mainsearch in varchar2 default null,
        p_page_groups in number_list_type default empty_number_list,
        p_folderid in number default null,
        p_foldersiteid in number default null,
        p_includesubfolder in boolean default true,
        p_categoryid in number default null,
        p_categorysiteid in number default null,
        p_perspectives in perspective_list_type default empty_perspective_list,
        p_perspectivesmatch in varchar2 default match_all,
        p_includesubpersps in boolean default true,
        p_itemtypeid in number default null,
        p_itemtypesiteid in number default null,
        p_attributes in wwsrc_runtime_attr_varray default wwsrc_runtime_attr_varray ( ),
        p_attributesmatch in varchar2 default match_all,
        p_orderbyid in number default null,
        p_orderbysiteid in number default null,
        p_orderbydir in varchar2 default null,
        p_firsthit in number default 1,
        p_rows in number default max_rows,
        p_out_count out number,
        p_out_scores out number_list_type
    ) return items_result_array_type

  Searches for items and returns the item results rows in the form of an array of wwsbr_all_items records.

  Parameters:
    `p_mainoperator` - keyword operator to be used in the search. Valid Operator values are defined as constants in this package (CONTAINS_ANY, EQUAL_TO, etc - see Search operators constants) Some operators may only be used when Oracle Text is enabled, others may only be used when Oracle Text is disabled Default value is CONTAINS_ALL
    `p_mainsearch` - keyword, or term to search for - this may be any value including an Oracle Text search string
    `p_page_groups` - IDs of the page groups to be searched, use the default value of empty_number_list for all page groups, otherwise, pass an array * of ids
    `p_folderid` - ID of the selected page to be searched if any, if specified, then this page is the only page searched (and optionally its sub pages)
    `p_foldersiteid` - site ID of the selected pages to be searched if any, this must be specified if p_folderid is specified
    `p_includesubfolder` - indicates whether to search sub pages, (true or false), only used when p_folderid is specified
    `p_categoryid` - returns results assigned to this category, only, if null, returns all results regardless of category
    `p_categorysiteid` - site ID of category specified above, if any
    `p_perspectives` - return results assigned to all or any of the perspectives listed This is an array of (id, siteid) where id is the perspective ID and siteid is the perspective site ID. See perspective_list_type Only the first perspective in the list is used if Oracle Text is off
    `p_perspectivesmatch` - determines whether to MATCH_ALL perspectives or MATCH_ANY perspectives in the list, the default value is MATCH_ALL. It is ignored if p_perspectives is not passed or if Oracle Text is off
    `p_includesubpersps` - determines whether any sub perspectives of the given list of perspectives stated in p_perspectives are included in the search criteria, ignored if p_perspectives is not passed or if Oracle Text is off
    `p_itemtypeid` - ID of the item subtype to be searched (from wwv_thingsubtype). Note that this is the actual subtype of the item, not the base type
    `p_itemtypesiteid` - site ID of the item type to be searched, ignored unless p_itemtypeid is passed
    `p_attributes` - an array of attributes to search for together with their operator and values. Values for this parameter can be built up by calling specify_attributes(), see Example 3 in the package introduction
    `p_attributesmatch` - indicates how to join all the attribute predicates MATCH_ALL or MATCH_ANY, default value is MATCH_ALL. It is ignored if p_attributes is not passed
    `p_orderById` - ID of the attribute with which to order search results. Only base table attributes can be used
    `p_orderBySiteId` - site ID of the attribute being used to order search results, ignored unless p_orderById is passed
    `p_orderByDir` - indicates whether to order results ascending or descending, ignored unless p_orderById is passed. Valid values are ORDERBY_ASCENDING or ORDERBY_DESCENDING
    `p_firsthit` - starting row in current page, null or 1 to start from the beginning. Defaults to 1 if omitted. This parameter can be used with p_rows to paginate the results
    `p_rows` - maximum number of rows to return, this value defaults to the value of MAX_ROWS
    `p_out_count` - total count of search results
    `p_out_scores` - an array of scores for the results, the index of the array matches the index of the results array returned by the function
  Returns:
    Array containing search results. The number of search results returned is less than or equal to the value specified for p_rows
  Exceptions:
    `NO_SEARCH_VALUE` - The search failed as no search terms were provided
    `WILDCARD_EXPANSION_EXCEPTION` - Oracle Text returned DRG-51030: wildcard query expansion resulted in too many terms
    `KNOWLEDGE_BASE_EXCEPTION` - Oracle Text returned DRG-11446,11422,11432: Supplied knowledge base file not installed (Oracle Text installation incomplete)
    `ATTRIBUTE_NOT_INDEXED` - Oracle Text returned DRG-10837 : Attribute Not Indexed Error Resync the indexes
    `QUERY_LANGUAGE_SYNTAX_ERROR` - Oracle Text returned Syntax Error in Query Language (usually p_mainsearch)
    `SEARCH_FAILURE_EXCEPTION` - An internal exception was raised by the Portal or Oracle Text
  Since:
    10.1.4

### page_search

    function page_search(
        p_mainoperator in varchar2 default contains_all,
        p_mainsearch in varchar2 default null,
        p_page_groups in number_list_type default empty_number_list,
        p_folderid in number default null,
        p_foldersiteid in number default null,
        p_categoryid in number default null,
        p_categorysiteid in number default null,
        p_perspectives in perspective_list_type default empty_perspective_list,
        p_perspectivesmatch in varchar2 default match_all,
        p_includesubpersps in boolean default true,
        p_attributes in wwsrc_runtime_attr_varray default wwsrc_runtime_attr_varray ( ),
        p_attributesmatch in varchar2 default match_all,
        p_orderbyid in number default null,
        p_orderbysiteid in number default null,
        p_orderbydir in varchar2 default null,
        p_firsthit in number default 1,
        p_rows in number default max_rows,
        p_out_count out number,
        p_out_scores out number_list_type
    ) return pages_result_array_type

  Searches for pages and returns the page results rows in the form of an array of wwsbr_all_folders records.

  Parameters:
    `p_mainoperator` - keyword operator to be used in the search. Valid Operator values are defined as constants in this package (CONTAINS_ANY, EQUAL_TO, etc - see Search operators constants) Some operators may only be used when Oracle Text is enabled, others may only be used when Oracle Text is disabled Default value is CONTAINS_ALL
    `p_mainsearch` - keyword, or term to search for - this may be any value including an Oracle Text search string
    `p_page_groups` - IDs of the page groups to be searched, use the default value of empty_number_list for all page groups, otherwise, pass an array of ids
    `p_folderid` - ID of the selected page to be searched if any, if specified, then this page and all of its sub pages are searched
    `p_foldersiteid` - site ID of the selected pages to be searched if any, this must be specified if p_folderid is specified
    `p_categoryid` - returns results assigned to this category only, if null, returns all results regardless of category
    `p_categorysiteid` - site ID of category specified above, if any
    `p_perspectives` - returns results assigned to all or any of the perspectives listed This is an array of (id, siteid) where id is the perspective ID and siteid is the perspective site ID. See perspective_list_type Only the first perspective in the list is used if Oracle Text is off
    `p_perspectivesmatch` - determines whether to MATCH_ALL perspectives or MATCH_ANY perspectives in the list, default value is MATCH_ALL It is ignored if p_perspectives is not passed or if Oracle Text is off
    `p_includesubpersps` - determines whether any sub perspectives of the given list of perspectives stated in p_perspectives are included in the search criteria, ignored if p_perspectives is not passed or if Oracle Text is off
    `p_attributes` - an array of attributes to search for together with their operator and values. Values for this parameter can be built up by calling specify_attributes(), see Example 3 in the package introduction
    `p_attributesmatch` - indicates how to join all the attribute predicates MATCH_ALL or MATCH_ANY, default value is MATCH_ALL It is ignored if p_attributes is not passed
    `p_orderById` - ID of the attribute with which to order search results. Only base table attributes can be used
    `p_orderBySiteId` - site ID of the attribute being used to order search results, ignored unless p_orderById is passed
    `p_orderByDir` - indicates whether to order results ascending or descending, ignored unless p_orderById is passed. Valid values are ORDERBY_ASCENDING or ORDERBY_DESCENDING
    `p_firsthit` - starting row in current page, null or 1 to start from the beginning. Defaults to 1 if omitted. This parameter can be used with p_rows to paginate the results
    `p_rows` - maximum number of rows to return, this value defaults to the value of MAX_ROWS
    `p_out_count` - total count of search results
    `p_out_scores` - an array of scores for search results, the index. of the array matches the index of the results array returned by the function
  Returns:
    Array containing search results. The number of search results returned is less than or equal to the value specified for p_rows
  Exceptions:
    `NO_SEARCH_VALUE` - The search failed as no search terms were provided
    `WILDCARD_EXPANSION_EXCEPTION` - Oracle Text returned DRG-51030: wildcard query expansion resulted in too many terms
    `KNOWLEDGE_BASE_EXCEPTION` - Oracle Text returned DRG-11446,11422,11432: Supplied knowledge base file not installed (Oracle Text installation incomplete)
    `ATTRIBUTE_NOT_INDEXED` - Oracle Text returned DRG-10837 : Attribute Not Indexed Error Resync the indexes.
    `QUERY_LANGUAGE_SYNTAX_ERROR` - Oracle Text returned Syntax Error in Query Language (usually p_mainsearch)
    `SEARCH_FAILURE_EXCEPTION` - An internal exception was raised by Portal or Oracle Text
  Since:
    10.1.4

### perspective_search

    function perspective_search(
        p_mainoperator in varchar2 default contains_all,
        p_mainsearch in varchar2 default null,
        p_page_groups in number_list_type default empty_number_list,
        p_orderbyid in number default null,
        p_orderbysiteid in number default null,
        p_orderbydir in varchar2 default null,
        p_firsthit in number default 1,
        p_rows in number default max_rows,
        p_out_count out number,
        p_out_scores out number_list_type
    ) return persps_result_array_type

  Searches for perspectives and returns the perspective results rows in the form of an array of wwsbr_all_perspectives records.

  Parameters:
    `p_mainoperator` - keyword operator to be used in the search Valid Operator values are defined as constants in this package (CONTAINS_ANY, EQUAL_TO, etc - see Search operators constants) Some operators may only be used when Oracle Text is enabled, others may only be used when Oracle Text is disabled Default value is CONTAINS_ALL
    `p_mainsearch` - keyword, or term to search for - this may be any value including an Oracle Text search string
    `p_page_groups` - IDs of the page groups to be searched, use the default value of empty_number_list for all page groups, otherwise, pass an array of ids
    `p_orderById` - ID of the attribute with which to order search results. Only base table attributes can be used
    `p_orderBySiteId` - site ID of the attribute being used to order search results, ignored unless p_orderById is passed
    `p_orderByDir` - indicates whether to order results ascending or descending, ignored unless p_orderById is passed. Valid values are ORDERBY_ASCENDING or ORDERBY_DESCENDING
    `p_firsthit` - starting row in current page, null or 1 to start from the beginning. Defaults to 1 if omitted. This parameter can be used with p_rows to paginate the results
    `p_rows` - maximum number of rows to return, this value defaults to the value of MAX_ROWS
    `p_out_count` - total count of search results
    `p_out_scores` - an array of scores for search results, the index of the array matches the index of the results array returned by the function
  Returns:
    Array containing search results. The number of search results returned is less than or equal to the value specified for p_rows
  Exceptions:
    `NO_SEARCH_VALUE` - The search failed as no search terms were provided
    `WILDCARD_EXPANSION_EXCEPTION` - Oracle Text returned DRG-51030: wildcard query expansion resulted in too many terms
    `KNOWLEDGE_BASE_EXCEPTION` - Oracle Text returned DRG-11446,11422,11432: Supplied knowledge base file not installed (Oracle Text installation incomplete)
    `ATTRIBUTE_NOT_INDEXED` - Oracle Text returned DRG-10837 : Attribute Not Indexed Error Resync the indexes
    `QUERY_LANGUAGE_SYNTAX_ERROR` - Oracle Text returned Syntax Error in Query Language (usually p_mainsearch)
    `SEARCH_FAILURE_EXCEPTION` - An internal exception was raised by the Portal or Oracle Text
  Since:
    10.1.4

### specify_attributes

    procedure specify_attributes(
        p_id in number,
        p_siteid in number default wwsbr_site_db . shared_siteid,
        p_value in varchar2,
        p_operator in varchar2 default contains_all,
        p_datatype in varchar2 default data_type_text,
        p_in_out_attr_varray in out nocopy wwsrc_runtime_attr_varray
    )

  Builds up the search attribute criteria for the search APIs (item_search() , page_search(), etc) by storing the attributes in an array based on wwsrc_runtime_attr_varray() object.

         declare
           l_attrs wwsrc_runtime_attr_varray;
           l_results results_array_type;
         begin
           wwsrc_api.specify_attributes(
               p_id =>  wwsbr_api.ATTRIBUTE_TITLE,
               p_value =>  'Notes',
               p_in_out_attr_varrary => l_attrs);
           wwsrc_api.specify_attributes(
               p_id =>  wwsbr_api.ATTRIBUTE_PUBLISHDATE,
               p_value =>  '01-JAN-2004',
               p_in_out_attr_varrary => l_attrs);
           wwsrc_api.specify_attributes(
               p_id =>  wwsbr_api.ATTRIBUTE_DESCRIPTION,
               p_value =>  'Summary News',
               p_in_out_attr_varrary => l_attrs);

           l_results := wwsrc_api.search(
               ....,
               p_attributes => l_attrs,
               ....);

         end;

  Parameters:
    `p_id` - attribute ID from wwsbr_attributes
    `p_siteid` - attribute site ID (usually SHARED)
    `p_value` - attribute value to be searched, in text form
    `p_operator` - operator to use (see Search operators constants)
    `p_datatype` - datatype of the attribute value (see DATA_TYPE_* constants)
    `p_in_out_attr_varray` - the existing varray of attributes (if any)
  Exceptions:
    `SEARCH_FAILURE_EXCEPTION` - An internal exception
  Since:
    10.1.4

Overview | Package | Object Type | Deprecated | Index | Help
| Oracle Application Server Portal PL/SQL API Reference - 10.1.4
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES
SUMMARY: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE | DETAIL: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE