Velocity Context for SiteSeeker Search Templates


Table of Contents

Global response objects
Types

This document describes the objects within the Velocity Context that are available from the Search Templates included with the SiteSeeker Search module for SiteVision.

Global response objects

In addition to the objects listed below, the GenericTools are available. Documentaion can be found at the Apache Velocity Project home page.

Table 1. 

ObjectTypeDescription
$agesAge[]Age filter: List of available options. The age filter narrows down the query by modification date, e.g. "last week".
$bestBetsBestBet[]List of Best Bets. Best Bets are hits that are similar to "sponsored links" and are added by SiteSeeker administrators.
$categoryGroupsCategoryGroup[]Category filter: List of available options, divided by category group. Each category group contains a list of categories; Category[]
$fileFormatsFileFormat[]File format filter: List of available options. The file format filter narrows down the query by file format, e.g. "html" or "pdf".
$hitsHit[]List of hits.
$langLanguageResourceLocalisation manager. Provides a localised version of a text string for display on the search page.
$languagesLanguage[]Language filter: List of available options. The language filter narrows down the query by language, e.g. "English".
$messageStringA natural language message describing the interpreted query and the number of results, to be displayed to the user, e.g. "45 hits for annual report in Press Room".
$pageLinksPageLink[]Pagination links. Use this list of links to implement a pagination widget.
$portletIdStringIdentifier of this portlet instance.
$queryStringSearch query.
$requestParametersRequestParametersThe names of the request parameters handled by the SiteSeeker search portlet.
$searchPageIdStringThe SiteVision identifier of the current page.
$sessionIdStringThe current user's browser session identifier.
$sortOrdersSortOrder[] The following predefined sort orders:
  • $sortOrders.Relevance
  • $sortOrders.Title
  • $sortOrders.Date
  • $sortOrders.Category
  • $sortOrders.Random
$spellingSuggestionsSpellingSuggestion[]List of spelling suggestions.
$uiLanguageStringContains the language code for this page, which will either be the empty string or a lowercase ISO 639 code.
$urlStringThe URL for the portlet. Use this in the action attribute of the HTML form.
$utilSearchPortletUtil[]Collection of methods for (un)escaping XML and encode/decode URL strings.

Types

Table 2. Age

Represents an age filter option.

PropertyTypeDescription
.ClickUrlStringURL to the search page with this filter option applied.
.GroupNameStringSymbolic name of this filter, i.e. "age". The symbolic name may be used as a key for localisation.
.IdIntegerThe identifier of this filter option.
.IsSelectedBooleanReturns true if this option is currently applied. False otherwise.
.NameStringSymbolic name of this filter option (e.g. "yesterday", "week" or "any"). The symbolic name may be used as a key for localisation.
.NHitsIntegerNumber of hits matching this filter option.
.NPagesIntegerTotal number of pages matching this filter option (regardless of the query).

Table 3. BestBet

PropertyTypeDescription
.DescriptionStringThe description of the current best bet. May contain HTML code.
.IsExternalBooleanTrue if best bet is referring to an external location, false if it is a local reference.
.KeywordsString[]List of keywords matching this best bet.
.NumberIntegerOrdinal number of this best bet.
.TitleStringTitle of the best bet, with formatting.
.TitleNoFormattingStringTitle of the best bet, without formatting (HTML tags).
.UrlStringThe URL to the content of this best bet.

Table 4. Category

Represents a category filter option.

PropertyTypeDescription
.ClickUrlStringURL to the search page with this filter option applied.
.GroupNameStringThe localised name for the category group.
.IdIntegerThe identifier of this filter option.
.IsSelectedBooleanReturns true if this option is currently applied. False otherwise.
.NameStringThe localised name for the category.
.NHitsIntegerNumber of hits matching this filter option.
.NPagesIntegerTotal number of pages matching this filter option (regardless of the query).

Table 5. CategoryGroup

PropertyTypeDescription
.IdIntegerAn identifier of the category group.
.NameStringThe name of the category group.
.CategoriesCategory[]The category objects of this group.
.NCategoriesWithHitsInteger Returns the number of categories in this group that contains one or more hits. This is useful when listing the category groups, if you want to exclude groups which do not contain any categories with hits that match the current search.

Table 6. FileFormat

Represents a file format filter option.

PropertyTypeDescription
.ClickUrlStringURL to the search page with this filter option applied.
.GroupNameStringSymbolic name of this filter, i.e. "doctype". The symbolic name may be used as a key for localisation.
.IdIntegerThe identifier of this filter option.
.IsSelectedBooleanReturns true if this option is currently applied. False otherwise.
.NameStringSymbolic name of this filter option (e.g. "doc", "pdf" or "html"). The symbolic name may be used as a key for localisation.
.NHitsIntegerNumber of hits matching this filter option.
.NPagesIntegerTotal number of pages matching this filter option (regardless of the query).

Table 7. Hit

A hit holds dynamic, i.e. query specific, and static information of an indexed page matching the current search request. Hit objects are available in the $hits[] array.

PropertyTypeDescription
.NumberIntegerAn ordinal number of the hit for the current search request.
.TitleStringThe title of the indexed page.
.DynamicSnippetStringA dynamic (query specific) snippet (summary) of the indexed page.
.Meta.<name>StringGet the value of the typed meta data parameter <name>. If the requested meta data parameter does not exist, null will be returned, which can be used for selection. If it does exist, the value is a string, which optionally can be converted into an integer or a float (for logical comparison). To do so, add .Integer or .Float after the meta parameter. For example, #if ( $hit.Meta.Price ) $hit.Meta.Price.Integer #end will print the meta data named Price, if it exists in $hit, converted to an Integer.
.MetaDescriptionStringAn optional meta description of the indexed page. See also: http://www.siteseeker.se/sv/kunskapsdatabas/faq/soksidan/metabeskrivningar/.
.MetaIdentifierIntegerAn optional meta identifier for the indexed page.
.SizeIntegerThe size of the indexed page in bytes.
.StaticSnippetStringThe value of an optional "eri-desc"-section within the indexed page. See also: http://www.siteseeker.se/sv/kunskapsdatabas/faq/soksidan/brodsmulor-i-trafflistan/ a.k.a "eri-desc"-sections.
.HumanReadableSizeStringThe size of the indexed page in bytes, kB, MB or GB, depending of the size in bytes
.UrlStringThe raw URL of the page.
.CacheUrlStringURL of a cached version of the indexed page with the current query terms highlighted.
.SortDateStringThe date and time used for sorting and filtering of the indexed page.
.YearMonthDayStringThe date expressed as YYYY-MM-DD.
.IsInFrameBooleanIndicates whether the indexed page was found in an HTML frame or not.
.RankIntegerThe rank of the hit. Rank is an integer between 0 and 30. Higher value corresponds to higher ranking.
.FileFormatFileFormatThe type of the document, HTML, PDF etc.
.CategoriesCategory[]List of categories.
.AttachmentsHit[]List of other hits attached to this hit.

Table 8. Language

Represents a language filter option.

PropertyTypeDescription
.ClickUrlStringURL to the search page with this filter option applied.
.GroupNameStringSymbolic name of this filter, i.e. "language". The symbolic name may be used as a key for localisation.
.IdIntegerThe identifier of this filter option.
.IsSelectedBooleanReturns true if this option is currently applied. False otherwise.
.NameStringSymbolic name of this filter option (e.g. "sv", "en" or "no"). The symbolic name may be used as a key for localisation.
.NHitsIntegerNumber of hits matching this filter option.
.NPagesIntegerTotal number of pages matching this filter option (regardless of the query).

Table 9. LanguageResource

MethodTypeDescription
.get(String $key)StringReturns the localised text string for the given $key.

Table 10. PageLink

PropertyTypeDescription
.ClickUrlStringThe URL pointing at the result page.
.IsHiddenBooleanDetermines if this page link is hidden in the pager. A hidden page link is usually displayed as dots (...) in the pager view.
.IsSelectedBooleanDetermines if this page link points at the currently viewed/selected page.
.PageNumberIntegerThe ordinal number of the search result page that this link points at. First page has page number 1.

Table 11. RequestParameters

PropertyTypeDescription
.QueryStringThe name of the search query parameter.
.AgeStringThe name of the age filter parameter.
.CategoriesStringThe name of the categories filter parameter.
.FileFormatStringThe name of the file format filter parameter.
.LanguageStringThe name of the language filter parameter.

Table 12. SearchPortletUtil

MethodTypeDescription
.escapeXml(String $xml)String Escapes the characters in a String using XML entities. For example: "bread" & "butter" ⇒ &quot;bread&quot; &amp; &quot;butter&quot;. Supports only the five basic XML entities (gt, lt, quot, amp, apos). Note that unicode characters greater than 0x7f are currently escaped to their numerical \\u equivalent.
.unescapeXml(String $escapedXml)StringUnescapes a string containing XML entity escapes to a string containing the actual Unicode characters corresponding to the escapes.
.urlEncode(String $url)StringTranslates a string into application/x-www-form-urlencoded format.
.urlDecode(String $encodedUrl)StringDecodes an application/x-www-form-urlencoded string.

Table 13. SortOrder

PropertyTypeDescription
.IdIntegerAn identifier of the sort order.
.NameStringThe name of the sort order.
.SelectUrlStringThe URL to be used for selecting the sort order.

Table 14. SpellingSuggestion

PropertyTypeDescription
.TermsStringThe suggested terms.
.TermsNoFormattingStringSame as .Terms but without HTML markup.
.RequestUrlStringThe URL to be used for sending a new search request with the suggested query terms.