VuFind API Documentation

MapSelection
in package
implements RecommendInterface, TranslatorAwareInterface Uses TranslatorAwareTrait

MapSelection Recommendations Module

Tags
category

VuFind

author

Vaclav Rosecky xrosecky@gmail.com

author

Leila Gonzales lmg@agiweb.org

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Interfaces, Classes, Traits and Enums

RecommendInterface
Search Recommendations Interface
TranslatorAwareInterface
Lightweight translator aware marker interface (used as an alternative to \Laminas\I18n\Translator\TranslatorAwareInterface, which requires an excessive number of methods to be implemented).

Table of Contents

$basemapOptions  : array<string|int, mixed>
Basemap configuration parameters
$bboxSearchCoords  : array<string|int, mixed>
Bbox search box coordinates
$defaultCoordinates  : array<string|int, mixed>
Default coordinates. Order is WENS
$geoField  : string
The geoField variable name
$height  : string
Height of search map pane
$searchFilters  : ParamBag
Backend Parameters / Search Filters
$searchParams  : object
Search parameters
$searchQuery  : QueryInterface
Query Object
$searchResultCoords  : array<string|int, mixed>
Search Results coordinates
$searchService  : Service
Search service
$selectedCoordinates  : string
Selected coordinates
$translator  : TranslatorInterface
Translator
__construct()  : mixed
Constructor
fetchDataFromSearchService()  : array<string|int, mixed>
Fetch details from search service
getBasemap()  : array<string|int, mixed>
Get the basemap configuration settings.
getDefaultCoordinates()  : array<string|int, mixed>
GetDefaultCoordinates
getGeoField()  : string
GetGeoField
getHeight()  : number
GetHeight
getMapResultCoordinates()  : array<string|int, mixed>
Process search result record coordinate values for Leaflet mapping platform.
getSearchParams()  : string
GetSearchParams
getSearchResultCoordinates()  : array<string|int, mixed>
Get geo field values for all search results
getSelectedCoordinates()  : array<string|int, mixed>
GetSelectedCoordinates
getTranslator()  : TranslatorInterface
Get translator object.
getTranslatorLocale()  : string
Get the locale from the translator.
init()  : void
Called before the Search Results object performs its main search (specifically, in response to \VuFind\Search\SearchRunner::EVENT_CONFIGURED).
process()  : void
Process
setConfig()  : void
SetConfig
setTranslator()  : TranslatorAwareInterface
Set a translator
translate()  : string
Translate a string (or string-castable object)
translateWithPrefix()  : string
Translate a string (or string-castable object) using a prefix, or without the prefix if a prefixed translation is not found.
extractTextDomain()  : array<string|int, mixed>
Given a translation string with or without a text domain, return an array with the raw string and the text domain separated.
getDebugTranslation()  : string
Build a debug-mode translation
sanitizeTranslationKey()  : string
Make sure there are not any illegal characters in the translation key that might prevent successful lookup in language files.
translateString()  : string
Get translation for a string

Properties

$basemapOptions

Basemap configuration parameters

protected array<string|int, mixed> $basemapOptions = []

$bboxSearchCoords

Bbox search box coordinates

protected array<string|int, mixed> $bboxSearchCoords = []

$defaultCoordinates

Default coordinates. Order is WENS

protected array<string|int, mixed> $defaultCoordinates = []

$geoField

The geoField variable name

protected string $geoField = 'long_lat'

$height

Height of search map pane

protected string $height

$searchParams

Search parameters

protected object $searchParams = null

$searchResultCoords

Search Results coordinates

protected array<string|int, mixed> $searchResultCoords = []

$selectedCoordinates

Selected coordinates

protected string $selectedCoordinates = null

Methods

__construct()

Constructor

public __construct(Service $ss, array<string|int, mixed> $basemapOptions, array<string|int, mixed> $mapSelectionOptions) : mixed
Parameters
$ss : Service

Search service

$basemapOptions : array<string|int, mixed>

Basemap Options

$mapSelectionOptions : array<string|int, mixed>

Map Options

Return values
mixed

fetchDataFromSearchService()

Fetch details from search service

public fetchDataFromSearchService() : array<string|int, mixed>
Return values
array<string|int, mixed>

getBasemap()

Get the basemap configuration settings.

public getBasemap() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDefaultCoordinates()

GetDefaultCoordinates

public getDefaultCoordinates() : array<string|int, mixed>

Return default coordinates from configuration

Return values
array<string|int, mixed>

of floats

getGeoField()

GetGeoField

public getGeoField() : string

Return Solr field to use for geographic search

Return values
string

getHeight()

GetHeight

public getHeight() : number

Return height of map in pixels

Return values
number

getMapResultCoordinates()

Process search result record coordinate values for Leaflet mapping platform.

public getMapResultCoordinates() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSearchParams()

GetSearchParams

public getSearchParams() : string

Return search params without filter for geographic search

Return values
string

getSearchResultCoordinates()

Get geo field values for all search results

public getSearchResultCoordinates() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSelectedCoordinates()

GetSelectedCoordinates

public getSelectedCoordinates() : array<string|int, mixed>

Return coordinates selected by user

Return values
array<string|int, mixed>

of floats

getTranslator()

Get translator object.

public getTranslator() : TranslatorInterface
Return values
TranslatorInterface

getTranslatorLocale()

Get the locale from the translator.

public getTranslatorLocale([string $default = 'en' ]) : string
Parameters
$default : string = 'en'

Default to use if translator absent.

Return values
string

init()

Called before the Search Results object performs its main search (specifically, in response to \VuFind\Search\SearchRunner::EVENT_CONFIGURED).

public init(Params $params, Parameters $request) : void

This method is responsible for setting search parameters needed by the recommendation module and for reading any existing search parameters that may be needed.

Parameters
$params : Params

Search parameter object

$request : Parameters

Parameter object representing user request.

Return values
void

process()

Process

public process(Results $results) : void

Called after the Search Results object has performed its main search. This may be used to extract necessary information from the Search Results object or to perform completely unrelated processing.

Parameters
$results : Results

Search results object

Return values
void

setConfig()

SetConfig

public setConfig(string $settings) : void

Store the configuration of the recommendation module.

Parameters
$settings : string

Settings from searches.ini.

Return values
void

translate()

Translate a string (or string-castable object)

public translate(string|object|array<string|int, mixed> $target[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, bool $useIcuFormatter = false ][, array<string|int, string> $fallbackDomains = [] ]) : string
Parameters
$target : string|object|array<string|int, mixed>

String to translate or an array of text domain and string to translate

$tokens : array<string|int, mixed> = []

Tokens to inject into the translated string

$default : string = null

Default value to use if no translation is found (null for no default).

$useIcuFormatter : bool = false

Should we use an ICU message formatter instead of the default behavior?

$fallbackDomains : array<string|int, string> = []

Text domains to check if no match is found in the domain specified in $target

Return values
string

translateWithPrefix()

Translate a string (or string-castable object) using a prefix, or without the prefix if a prefixed translation is not found.

public translateWithPrefix(string $prefix, string|object|array<string|int, mixed> $target[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, bool $useIcuFormatter = false ][, array<string|int, string> $fallbackDomains = [] ]) : string
Parameters
$prefix : string

Translation key prefix

$target : string|object|array<string|int, mixed>

String to translate or an array of text domain and string to translate

$tokens : array<string|int, mixed> = []

Tokens to inject into the translated string

$default : string = null

Default value to use if no translation is found (null for no default).

$useIcuFormatter : bool = false

Should we use an ICU message formatter instead of the default behavior?

$fallbackDomains : array<string|int, string> = []

Text domains to check if no match is found in the domain specified in $target

Return values
string

extractTextDomain()

Given a translation string with or without a text domain, return an array with the raw string and the text domain separated.

protected extractTextDomain(string|object|array<string|int, mixed> $target) : array<string|int, mixed>
Parameters
$target : string|object|array<string|int, mixed>

String to translate or an array of text domain and string to translate

Return values
array<string|int, mixed>

getDebugTranslation()

Build a debug-mode translation

protected getDebugTranslation(string $domain, string $str, array<string|int, mixed> $tokens) : string
Parameters
$domain : string

Text domain

$str : string

String to translate

$tokens : array<string|int, mixed>

Tokens to inject into the translated string

Return values
string

sanitizeTranslationKey()

Make sure there are not any illegal characters in the translation key that might prevent successful lookup in language files.

protected sanitizeTranslationKey(string $key) : string
Parameters
$key : string

Key to sanitize

Return values
string

Sanitized key

translateString()

Get translation for a string

protected translateString(string $rawStr[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, string $domain = 'default' ][, bool $useIcuFormatter = false ]) : string
Parameters
$rawStr : string

String to translate

$tokens : array<string|int, mixed> = []

Tokens to inject into the translated string

$default : string = null

Default value to use if no translation is found (null for no default).

$domain : string = 'default'

Text domain (omit for default)

$useIcuFormatter : bool = false

Should we use an ICU message formatter instead of the default behavior?

Return values
string

Search results