DemoResults - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.7
Category
Reference Guide

By default the DemoResults widget displays all the search results.

<div class="AFSWidget" title="DemoResults">
</div>

To display a subset of all the feeds, use the "feeds" configuration parameter like so:

<div class="AFSWidget" title="DemoResults">
<script type="application/json">
{
"feeds": [
{"name": "uriOfReplySetHere"},
{"name": "uriOfAnotherReplySetHere"}
]
}
</script>
</div>

feeds contains a list of objects, whose name is the afs:meta/@uri of the replySet to display. The above example displays the search results for the 2 replySets identified by their URI.

When a feed needs a specific reply configuration, we overload the global configuration in this feed's configuration.

Back to our example, say the global configuration (DemoResults.url, DemoResults.title, DemoResults.abstract) works fine with the feed catalog, but the feed products needs a specific configuration because the url of its replies are located somewhere else, in the afs:clientData/url for instance.

In this case, we need a configuration like this:

<div class="AFSWidget" title="DemoResults">
<script type="application/json">
{
"url": "jpath:$.uri",
"title": "kwic:$.title",
"abstract": "kwic:$.abstract",
"feeds": [
{ "name": "catalog" },
{
"name": "products",
"url": "xpath:/clientData/url"
}
]
}
</script>
</div>

DemoResults - Display the search results in default layout

Parameter

Type

Card

Default

Description

feeds

Array

Optional

[ ]

When feeds is empty or not specified, the widget displays all the feeds. Otherwise it displays only the feeds listed. Each array item is an object describing a feed, that is its name and where to pick things up to build the result's component like the title, url and description. Its is composed of the following properties: name (required: the name of the feed is the replySet URI), url (optional), title (optional), abstract (optional). name contains the replySet URI of the feed. A feed can redefine url, abstract and title when needed.

Example:

"feeds": [

{"name": "feed1"},

{"name": "feed2", "url": "xpath:/clientData/myUrl", "title": "xpath:/clientData/myTitle"}

]

url

String (JPath)

Optional

jpath:$.uri

The expression used to retrieve the URL of a reply (applies to all the feeds, except those which redefine it in feeds).

title

String (Kwic JPath)

Optional

kwic:$.title

The expression used to retrieve the title of reply (applies to all the feeds, except those which redefine it in feeds).

abstract

String (Kwic JPath)

Optional

kwic:$.abstract

The expression used to retrieve the abstract of a reply (applies to all the feeds, except those which redefine it in feeds).

target

String

Optional

(empty string)

Used to build links that needs to open in an other page.