Search Sources

A search source is the definition of a set of searchable documents, including both a form for entering the search criteria and a definition of the result output.

Search sources can apply to both regular iKnowBase documents and external data sources.

To accomplish a search feature in your iKnowBase application, perform the following:

  1. Create a presentation style to be used for the search result, if you don�t already have an appropriate presentation style which can be reused.
  2. Create a search source component associated with the previously created presentation style.
  3. Use a Search source portlet to display the configured search source.

You can use the Build search dialog portlet together with one or more configured search sources. The Build search dialog portlet will display a search dialog to the user where he can perform a free text search using one of the associated search sources.

The Search Source is a specialized form of a Viewer, with the addition of the input search form.

Properties

This section describes the properties of a search source, as shown on the corresponding Edit pane tabs.

Edit Tab

Property Description
Subsystem

Select the appropriate subsystem.

Name

Type a name for this viewer.

Display title

Type a title for this viewer. This may be presented to the end-user by a Presentation Style.

The title supports multiple languages.

External key

Type the appropriate external key.

SQL Hint

For advanced users only, type the appropriate SQL hint. The syntax is the name of the hint, like FIRST_ROWS.

The hint will be inserted into the SQL-query; using the appropriate hint may help speed up query execution.

Custom access control

Type the name of the appropriate database procedure to use a special access control, if you want to extend the default access control. Note: You should use this carefully, as controlled security model may be set aside.

The following signature must be used for the database procedure:

PROCEDURE <package>.<procedure name> (
  site_id in number,
  user_id in number,
  reference_path in varchar2,
  result out
);

The returned result must be an SQL fragment which fits into the SQL WHERE clause generated by the Viewer. For example, the function could return

or oi1.owner_id = 125

and the query would then be

...
and (oi1.owner_id = <userid> or ((oi1.acl_guid is null or oi1.owner_id = 125 
or oi1.acl_guid in (select v_acl.acl_guid from v_acl)
...
Presentation style

Select the Presentation style you want to use to format the output.

Override styleset

Select the Styleset you want to apply. If set, this will override the styleset defined on the Presentation style.

Portlet Header style

For Oracle Portal portlets only, if you want to override the Oracle Portal portlet header, select the Portlet header styleset here.

Note: You must enable <show Portlet Header> for the Oracle Portal page region in which the portlet is placed. The HTML code for the portlet header styleset must only contain actions (e.g. ABOUT) that are selected for the Oracle Portal page region.

Target for text

Select the target page to use for link to documents with text content.

Target for links

Select the target page to use for link to documents with file or url content.

Callback function

A function used as callback from Forms when adding new documents or editing existing documents initiated from the viewer.

You can use this property to avoid page redirect upon save from form. The parameter passed to the callback function is a json object with the properties action and documentId. The callback function could for example reload the search source.

Target to show_more page?

Select the target page to use for the “show more” link. Please note that the target definition should have a parameter named p_search_id as Parameter1.

Search source on the show_more page

To reuse a single target page for multiple “show more” pages, select the search source you want to display on the target page.

# records

Type the number of rows that you want to extract at a time. The default value is 10.

Start from record

Type the row number from which you want to display the result set. The default value is 1.

Max records

Type the maximum number of documents that you want to extract. The default value is 100.

Cache interval (0 is none)

Type the time in minutes for which you want to keep content in the cache.

Show total number of rows

Select this check box to display the total number rows on the status line.

Override homeplace mapping

Select this check box to use the targets defined on this Viewer rather than the target selector mechanism.

Use “Target for text” for all content types

Select this check box to use the target defined in the Target for text property for all links to documents, disregarding the content type.

Save dynamic variable

Select this check box to use a session save on all the dynamic parameters. If these values are not in the URL, this property allows iKnowBase to use the saved values. e.g sortinfo.

If you do not save the session variables, no content appears when you enter the page without the necessary dynamic parameters specified on the portlet.

Print header also with no hits

Select this check box to display the title of the portlet if the search finds no documents.

Print portlet decoration

Select this check box to print the portlet decoration that surrounds the content in a portlet.

HTML Filter generator

Select this check box to build the search form using the HTML-based generator. You must enter the appropriate HTML code on the HTML form tab.

If you don�t select this check box, the limited, rule based generator is used.

Save search criteria

Select this check box to save the search statistics of a user.

When you select this check box, the search statistics of the user are logged in the LOG_SEARCH_VALUES table.

Available as select list

Select this check box to use the search source as a list for selection of documents or dimension values. This list may be connected to a form as a new selector of values.

Dynamic attribute selector

Select this check box to allow a user to manually add attributes to the search criteria.

When this is checked, iKnowBase will display a drop down list of all searchable attributes in the search form; selecting one will add that attribute to the search form.

Attributes Tab

You can choose between four types of parameters:

When the parameter is selected, you must save before you can set any values.

Property Description
Actions

Delete the parameter by clicking the icon.

Attribute

Displays the names of the selected attributes to use as conditions for the Search source.

Disabled?

You can for debugging reasons disable attributes.

Sql Clause

Used for performance reasons for advanced users. Will generate a SQL with either IN or EXISTS.

Condition

Select the appropriate conditions for the selected attributes. The conditions depend on the type of attribute.

Note: You cannot select a condition for parameters.

Value

Select or enter the appropriate values for the selected attributes. Available options depends on the attribute/parameter type.

Applicable to SQL parameters only when the parameter is defined with an attribute.

Traverse Tab

The properties on the Traverse tab enable you to define a Search source with traverse features, e.g. possibilities to display subdocuments or versions of the extracted documents. Examples are discussion forums and view all versions of a document.

When running the query will automatically add a condition for selecting sub documents for the current document.

Property Description
Select method

Choose how you want to traverse the document structure. You can choose between :

No traversal: will not retrieve any subdocuments

Traverse down by using a connect-by clause: will fetch all subdocuments for every documents retrieved. It will use the same presentation style as defined on the main viewer definition. When selected, you can enter the number of levels you want to traverse.

Traverse up by using a connect-by clause: will fetch all documents above for every documents retrieved. It will use the same presentation style as defined on the main viewer definition. Suitable for viewers showing only one document where you want to see the top levels. When selected, you can enter the number of levels you want to traverse.

Traverse by using search sources: For each document it will run a new viewer. This is not as efficient (performance) as the above methods, but gives you the flexibility of defining separate conditions and presentation style for each level.

Level

Type the level for the extraction source. Level 1 specifies first level, but you may specify extraction sources that traverse further on level 2 documents, etc.

Select source

Select the appropriate Search source as the base for the extraction of subdocuments. You can vary the style and layout on different levels.

Expand Collapse

To enable the expand/collapse functionality for the subdocuments, click Yes. To display the subdocuments directly, click No.

Icon Expand

Enter the reference to the icon to be used to expand the list of subdocuments.

Note: You must click Yes in the Expand Collapse list.

Icon Collapse

Enter the reference to the icon to be used to collapse the list of subdocuments.

Note: You must click Yes in the Expand Collapse list.

Quick links Tab

The properties on the Quick links tab enable you to generate links to create new documents in the Search source. In order to use the Quick link to create a subdocument, you should define the Quick link to take a document ID as a dynamic parameter, which may be used to set the parent document for the document to be created.

Text elements Tab

The properties on this tab enable you to define texts to be used in the component. The texts are available as FreeMarker model objects from the Template used for the Page. Multiple languages are supported.

Property Description
Id

Type an identifier for the label.

Text

Type the text labels that you want to use in the page. If multiple languages are supported in the solution, each language displays a box, in which you can type the display form name. When you place the cursor in the Text field, the language box appears. The language code is placed behind the field.

Filter tab

You can use the properties on the Filter tab to define how to present the various dynamic parameters.

Property Description
Filter

Displays the selected attributes that makes up the search criteria for the search source.

Style

Select the appropriate styles for the input fields of the search criteria.

Available options for lists of values are radio buttons, check boxes, select box, multiselect box, or <default>. If you define Valid values for a dimension attribute, the input field for this attribute is treated as a list of values.

Length

Type the lengths of the input fields of the search criteria.

Condition

Select the default conditions for the search criteria.

Subset of condition

Select the conditions which will be available for selection in the search form.

If none is selected, all will be available.

Locked condition?

Select the check box to restrict the user from selecting a condition for the given search criterion in the search form. In this case the value given in the Condition will be used.

Note: If you lock the condition, the automatically created HTML code on the HTML form tab will not include the iKnowBase condition-tag. You are able to include it yourself though, and thereby override this property.

Valid values

Select the values which will be available for selection in the search form.

Applicable to value list and dimension attributes.

Style tab

The properties on the Style tab enables you to define labels and styles for the attributes in the search form.

Property Description
Prompt

Type the label you want to use for the dropdown used to manual add attributes to the search criteria. Available when the Dynamic attribute selector property is selected.

If multiple languages are supported in the solution, each language displays a box, in which you can type the prompt. The language code is placed behind the field.

Style prompt

Enter the style class to use for the label for the dropdown used to manual add attributes to the search criteria. Available when the Dynamic attribute selector property is selected.

Style dropdown

Enter the style class to use for the dropdown used to manual add attributes to the search criteria. Available when the Dynamic attribute selector property is selected.

Style prompt

Enter the style class to use for the label for the manually added search criterion. Available when the Dynamic attribute selector property is selected.

Style input-fields

Enter the style class to use for the value input field for the manually added search criterion. Available when the Dynamic attribute selector property is selected.

Style conditions

Enter the style class to use for the condition field for the manually added search criterion. Available when the Dynamic attribute selector property is selected.

Enter prompt and styles for the selected attributes

Filter

Displays the names of the selected filter attributes.

Prompt

Type the labels for the respective filter attributes.

If multiple languages are supported in the solution, each language displays a box, in which you can type the prompt. When you place the cursor in the Prompt field, the language box appears. The language code is placed behind the field.

Style prompt

Enter the style classes to use for the labels of the respective filter attributes.

Style input-fields

Enter the style classes to use for value input fields of the respective filter attributes.

Style conditions

Enter the style classes to use for the condition fields of the respective filter attributes.

HTML Form tab

When using a search source, you typically create a form where the user can enter the desired search criteria.

iKnowBase enables you to design and create the search form layout using your own HTML markup, rather than using the automatically generated search form. The notation in the setup is based on HTML with several extensions to generate dynamic fields for iKnowBase, pretty much the same as for regular Forms.

You can write the HTML template code in the HTML form tab.

Note: If you update the selected attributes in the search form, you must also update the HTML template to reflect the changes. You can generate a new template or manually update the template, and insert IKB tags for new attributes or delete old tags.

There are two action buttons available:

Property Description
HTML code

Type the HTML template code.

Note: Use the action buttons Create new template or Update to automatically create or update HTML template code.

Available parameters

A list of available parameters and their IDs available for use in the HTML template code.

Picklist Tab

If you define the search source to be available as a select list, property Available as select list on the Edit tab, you get access to the Picklist Tab.

Pick lists are used to select one or more values, for example document ID or dimension ID, from a list of iKnowBase documents, and then return those values back to a given dialogue, such as a TinyMCE- or other attribute field in a Form.

When the search source is used as a pick list, the extracted documents are displayed together with check boxes or radio buttons, which enables the end user to select one or more documents. The specified values for the selected documents are returned to the calling dialogue. By default, radio buttons are generated if the calling dialogue only accepts one return value, and check boxes are generated otherwise.

Property Description
Root-level selectable?

Select this checkbox to make documents at the upper most level selectable. Applicable if you have defined the search source with traverse features, e.g. to extract and display subdocuments on one or more sublevels.

Always radio button?

Select this check box to always display a radio button, even though the calling dialogue accepts more than one return value.

Return value

Select which value to return; typically document ID or dimension ID. Available options are decided by the Presentation style associated with the Search source.

The selection must correspond to the value expected from the calling dialogue. If the calling dialogue is a related document or image attribute on a form, a document ID must be returned. If the calling dialogue is a dimension attribute on a form, a dimension ID must be returned.

JavaScript action button

Type the JavaScript code that runs when the end user clicks the radio button in the pick list.

Rather than typing your own code, you can use two pre-defined actions:

  • StartReturnFromPickList (): This can be used where you use the pick list from an attribute field on a Form. It will return the selected value back to the calling dialogue.
  • ReturnToEditor (): This can be used where you use the pick list from a TinyMCE field on a Form.
JavaScript

Type your own JavaScript code if needed, could for example be run using the button.

HTML-code at bottom

Enter the HTML code to be generated at the end of the page, after the extracted data. Examples can be a button which returns the selected values.

Using the StartReturnFromPickList() function

As mentioned above, you can use the StartReturnFromPickList() function to return from a picklist. This works as follows: