VuFind API Documentation

SummonrecordController extends AbstractRecord
in package

Summon Record Controller

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

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

link

Main Site

Table of Contents

$accessDeniedBehavior  : string
Behavior when access is denied (used unless overridden through permissionBehavior.ini). Valid values are 'promptLogin' and 'exception'.
$accessPermission  : string|bool|null
Permission that must be granted to access this module (false for no restriction, null to use configured default (which is usually the same as false)).
$allTabs  : array<string|int, mixed>
Array of available tab options
$backgroundTabs  : array<string|int, mixed>
Array of background tabs
$defaultTab  : string
Default tab to display (configured at record driver level)
$driver  : AbstractBase
Record driver
$fallbackDefaultTab  : string
Default tab to display (fallback used if no record driver configuration)
$serviceLocator  : ServiceLocatorInterface
Service manager
$sourceId  : string
Type of record to display
$tabsExtraScripts  : array<string|int, mixed>
Array of extra scripts for tabs
$translator  : TranslatorInterface
Translator
__construct()  : mixed
Constructor
addcommentAction()  : mixed
Add a comment
addtagAction()  : mixed
Add a tag
ajaxtabAction()  : mixed
AJAX tab action -- render a tab without surrounding context.
captcha()  : Captcha
citeAction()  : ViewModel
Show citations for the current record.
confirm()  : mixed
Confirm an action.
dbUpgrade()  : DbUpgrade
deletecommentAction()  : mixed
Delete a comment
deletetagAction()  : mixed
Delete a tag
emailAction()  : ViewModel
Email action - Allows the email form to appear.
explainAction()  : mixed
Show explanation for why a record was found and how its relevancy is computed
exportAction()  : mixed
Export the record
flashMessenger()  : FlashMessenger
followup()  : Followup
forceLogin()  : mixed
Redirect the user to the login screen.
forwardTo()  : mixed
Convenience method to make invocation of forward() helper less verbose.
getAccessPermission()  : string|bool|null
Getter for access permission (string for required permission name, false for no permission required, null to use default permission).
getConfig()  : Config
Get a VuFind configuration.
getDbService()  : T
Get a database service object.
getILS()  : Connection
Get the ILS connection.
getRecordCache()  : Cache
Get the record cache
getRecordLoader()  : Loader
Get the record loader
getRecordRouter()  : Router
Get the record router.
getRequest()  : Request
Get request object
getSearchMemory()  : Memory
Get the search memory
getServerUrl()  : string
Get the full URL to one of VuFind's routes.
getTable()  : Gateway
Get a database table object.
getTranslator()  : TranslatorInterface
Get translator object.
getTranslatorLocale()  : string
Get the locale from the translator.
holds()  : Holds
homeAction()  : mixed
Home (default) action -- forward to requested (or default) tab.
ILLRequests()  : ILLRequests
ilsRecords()  : IlsRecords
injectSummonMessage()  : void
Use preDispatch event to add Summon message.
newItems()  : NewItems
permalinkAction()  : ViewModel
Show permanent link for the current record.
permission()  : Permission
ratingAction()  : mixed
Display and add ratings
rdfAction()  : mixed
Special action for RDF export
renewals()  : Renewals
reserves()  : Reserves
resultScroller()  : ResultScroller
saveAction()  : mixed
Save action - Allows the save template to appear, passes containingLists & nonContainingLists
setAccessPermission()  : void
Getter for access permission.
setTranslator()  : TranslatorAwareInterface
Set a translator
smsAction()  : ViewModel
SMS action - Allows the SMS form to appear.
storageRetrievalRequests()  : StorageRetrievalRequests
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.
validateAccessPermission()  : void
Use preDispatch event to block access when appropriate.
attachDefaultListeners()  : void
Register the default events for this controller
catalogLogin()  : bool|array<string|int, mixed>|ViewModel
Does the user have catalog credentials available? Returns associative array of patron data if so, otherwise forwards to appropriate login prompt and returns false. If there is an ILS exception, a flash message is added and a newly created ViewModel is returned.
clearFollowupUrl()  : void
Sometimes we need to unset the followup to trigger default behaviors
commentsEnabled()  : bool
Are comments enabled?
createEmailViewModel()  : ViewModel
Create a new ViewModel to use as an email form.
createViewModel()  : ViewModel
Create a new ViewModel.
disableSessionWrites()  : void
Prevent session writes -- this is designed to be called prior to time- consuming AJAX operations to help reduce the odds of a timing-related bug that causes the wrong version of session data to be written to disk (see VUFIND-716 for more details).
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.
formWasSubmitted()  : bool
Check to see if a form was submitted from its post value Also validate the Captcha, if it's activated
getAllTabs()  : array<string|int, mixed>
Get all tab information for a given driver.
getAndClearFollowupUrl()  : string
Retrieve a referer to keep post-login redirect pointing to an appropriate location.
getAuthManager()  : Manager
Get the account manager object.
getAuthorizationService()  : AuthorizationService
Get the authorization service (note that we're doing this on-demand rather than through injection with the AuthorizationServiceAwareInterface to minimize expensive initialization when authorization is not needed.
getBackgroundTabs()  : array<string|int, mixed>
Get names of tabs to be loaded in the background.
getDebugTranslation()  : string
Build a debug-mode translation
getDefaultTab()  : string
Get default tab for a given driver
getILSAuthenticator()  : ILSAuthenticator
Get the ILS authenticator.
getILSLoginMethod()  : string
What login method does the ILS use (password, email, vufind)
getILSLoginSettings()  : array<string|int, mixed>
Get settings required for displaying the catalog login form
getRecordTabManager()  : TabManager
Get the tab configuration for this controller.
getRefreshResponse()  : Response
Construct an HTTP 205 (refresh) response. Useful for reporting success in the lightbox without actually rendering content.
getTabsExtraScripts()  : array<string|int, mixed>
Get extra scripts required by tabs.
getUser()  : UserEntityInterface|null
Get the user object if logged in, false otherwise.
getViewRenderer()  : RendererInterface
Get the view renderer
hasFollowupUrl()  : bool
Checks if a followup url is set
inLightbox()  : bool
Are we currently in a lightbox context?
isLocalUrl()  : bool
Is the provided URL local to this instance?
listsEnabled()  : bool
Are lists enabled?
loadRecord()  : AbstractBase
Load the record requested by the user; note that this is not done in the init() method since we don't want to perform an expensive search twice when homeAction() forwards to another method.
loadTabDetails()  : void
Support method to load tab information from the RecordTab PluginManager.
normalizeUrlForComparison()  : string
Normalize the referer URL so that inconsistencies in protocol and trailing slashes do not break comparisons.
processSave()  : mixed
ProcessSave -- store the results of the Save action.
redirectToRecord()  : mixed
Redirect the user to the main record view.
resultScrollerActive()  : bool
Is the result scroller active?
sanitizeTranslationKey()  : string
Make sure there are not any illegal characters in the translation key that might prevent successful lookup in language files.
setFollowupUrlToReferer()  : void
Store a referer (if appropriate) to keep post-login redirect pointing to an appropriate location. This is used when the user clicks the log in link from an arbitrary page or when a password is mistyped; separate logic is used for storing followup information when VuFind forces the user to log in from another context.
showTab()  : mixed
Display a particular tab.
smsEnabled()  : bool
Is SMS enabled?
tagsEnabled()  : bool
Are tags enabled?
translateString()  : string
Get translation for a string

Properties

$accessDeniedBehavior

Behavior when access is denied (used unless overridden through permissionBehavior.ini). Valid values are 'promptLogin' and 'exception'.

protected string $accessDeniedBehavior = null

Leave at null to use the defaultDeniedControllerBehavior set in permissionBehavior.ini (normally 'promptLogin' unless changed).

$accessPermission

Permission that must be granted to access this module (false for no restriction, null to use configured default (which is usually the same as false)).

protected string|bool|null $accessPermission = null

$allTabs

Array of available tab options

protected array<string|int, mixed> $allTabs = null

$backgroundTabs

Array of background tabs

protected array<string|int, mixed> $backgroundTabs = null

$defaultTab

Default tab to display (configured at record driver level)

protected string $defaultTab = null

$fallbackDefaultTab

Default tab to display (fallback used if no record driver configuration)

protected string $fallbackDefaultTab = 'Holdings'

$serviceLocator

Service manager

protected ServiceLocatorInterface $serviceLocator

$sourceId

Type of record to display

protected string $sourceId = 'Solr'

$tabsExtraScripts

Array of extra scripts for tabs

protected array<string|int, mixed> $tabsExtraScripts = null

Methods

__construct()

Constructor

public __construct(ServiceLocatorInterface $sm) : mixed
Parameters
$sm : ServiceLocatorInterface

Service locator

Return values
mixed

addcommentAction()

Add a comment

public addcommentAction() : mixed
Return values
mixed

addtagAction()

Add a tag

public addtagAction() : mixed
Return values
mixed

ajaxtabAction()

AJAX tab action -- render a tab without surrounding context.

public ajaxtabAction() : mixed
Return values
mixed

citeAction()

Show citations for the current record.

public citeAction() : ViewModel
Return values
ViewModel

confirm()

Confirm an action.

public confirm(string $title, string $yesTarget, string $noTarget[, string|array<string|int, mixed> $messages = [] ][, array<string|int, mixed> $extras = [] ]) : mixed
Parameters
$title : string

Title of confirm dialog

$yesTarget : string

Form target for "confirm" action

$noTarget : string

Form target for "cancel" action

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

Info messages for confirm dialog

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

Extra details to include in form

Return values
mixed

deletecommentAction()

Delete a comment

public deletecommentAction() : mixed
Return values
mixed

deletetagAction()

Delete a tag

public deletetagAction() : mixed
Return values
mixed

emailAction()

Email action - Allows the email form to appear.

public emailAction() : ViewModel
Return values
ViewModel

explainAction()

Show explanation for why a record was found and how its relevancy is computed

public explainAction() : mixed
Return values
mixed

exportAction()

Export the record

public exportAction() : mixed
Return values
mixed

flashMessenger()

public flashMessenger() : FlashMessenger

FlashMessenger plugin

Return values
FlashMessenger

forceLogin()

Redirect the user to the login screen.

public forceLogin([string $msg = null ][, array<string|int, mixed> $extras = [] ][, bool $forward = true ]) : mixed
Parameters
$msg : string = null

Flash message to display on login screen

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

Associative array of extra fields to store

$forward : bool = true

True to forward, false to redirect

Return values
mixed

forwardTo()

Convenience method to make invocation of forward() helper less verbose.

public forwardTo(string $controller, string $action[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
$controller : string

Controller to invoke

$action : string

Action to invoke

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

Extra parameters for the RouteMatch object (no need to provide action here, since $action takes care of that)

Return values
mixed

getAccessPermission()

Getter for access permission (string for required permission name, false for no permission required, null to use default permission).

public getAccessPermission() : string|bool|null
Return values
string|bool|null

getConfig()

Get a VuFind configuration.

public getConfig([string $id = 'config' ]) : Config
Parameters
$id : string = 'config'

Configuration identifier (default = main VuFind config)

Return values
Config

getDbService()

Get a database service object.

public getDbService(class-string<\VuFind\Controller\T> $name) : T
Parameters
$name : class-string<\VuFind\Controller\T>

Name of service to retrieve

Tags
template

T

Return values
T

getServerUrl()

Get the full URL to one of VuFind's routes.

public getServerUrl([bool|string $route = true ]) : string
Parameters
$route : bool|string = true

Boolean true for current URL, otherwise name of route to render as URL

Return values
string

getTable()

Get a database table object.

public getTable(string $table) : Gateway
Parameters
$table : string

Name of table to retrieve

Return values
Gateway

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

homeAction()

Home (default) action -- forward to requested (or default) tab.

public homeAction() : mixed
Return values
mixed

injectSummonMessage()

Use preDispatch event to add Summon message.

public injectSummonMessage(MvcEvent $e) : void
Parameters
$e : MvcEvent

Event object

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
void

permalinkAction()

Show permanent link for the current record.

public permalinkAction() : ViewModel
Return values
ViewModel

ratingAction()

Display and add ratings

public ratingAction() : mixed
Return values
mixed

rdfAction()

Special action for RDF export

public rdfAction() : mixed
Return values
mixed

saveAction()

Save action - Allows the save template to appear, passes containingLists & nonContainingLists

public saveAction() : mixed
Return values
mixed

setAccessPermission()

Getter for access permission.

public setAccessPermission(string|false $ap) : void
Parameters
$ap : string|false

Permission to require for access to the controller (false for no requirement)

Return values
void

smsAction()

SMS action - Allows the SMS form to appear.

public smsAction() : ViewModel
Return values
ViewModel

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

validateAccessPermission()

Use preDispatch event to block access when appropriate.

public validateAccessPermission(MvcEvent $e) : void
Parameters
$e : MvcEvent

Event object

Return values
void

attachDefaultListeners()

Register the default events for this controller

protected attachDefaultListeners() : void
Return values
void

catalogLogin()

Does the user have catalog credentials available? Returns associative array of patron data if so, otherwise forwards to appropriate login prompt and returns false. If there is an ILS exception, a flash message is added and a newly created ViewModel is returned.

protected catalogLogin() : bool|array<string|int, mixed>|ViewModel
Return values
bool|array<string|int, mixed>|ViewModel

clearFollowupUrl()

Sometimes we need to unset the followup to trigger default behaviors

protected clearFollowupUrl() : void
Return values
void

commentsEnabled()

Are comments enabled?

protected commentsEnabled() : bool
Return values
bool

createEmailViewModel()

Create a new ViewModel to use as an email form.

protected createEmailViewModel([array<string|int, mixed> $params = null ][, string $defaultSubject = null ]) : ViewModel
Parameters
$params : array<string|int, mixed> = null

Parameters to pass to ViewModel constructor.

$defaultSubject : string = null

Default subject line to use.

Return values
ViewModel

createViewModel()

Create a new ViewModel.

protected createViewModel([array<string|int, mixed> $params = null ]) : ViewModel
Parameters
$params : array<string|int, mixed> = null

Parameters to pass to ViewModel constructor.

Return values
ViewModel

disableSessionWrites()

Prevent session writes -- this is designed to be called prior to time- consuming AJAX operations to help reduce the odds of a timing-related bug that causes the wrong version of session data to be written to disk (see VUFIND-716 for more details).

protected disableSessionWrites() : void
Return values
void

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>

formWasSubmitted()

Check to see if a form was submitted from its post value Also validate the Captcha, if it's activated

protected formWasSubmitted([string|array<string|int, string>|null $submitElements = null ][, bool $useCaptcha = false ]) : bool
Parameters
$submitElements : string|array<string|int, string>|null = null

Name of the post field(s) to check to indicate a form submission (or null for default)

$useCaptcha : bool = false

Are we using captcha in this situation?

Return values
bool

getAllTabs()

Get all tab information for a given driver.

protected getAllTabs() : array<string|int, mixed>
Return values
array<string|int, mixed>

getAndClearFollowupUrl()

Retrieve a referer to keep post-login redirect pointing to an appropriate location.

protected getAndClearFollowupUrl([bool $checkRedirect = false ]) : string

Unset the followup before returning.

Parameters
$checkRedirect : bool = false

Whether the query should be checked for param 'redirect'

Return values
string

getAuthorizationService()

Get the authorization service (note that we're doing this on-demand rather than through injection with the AuthorizationServiceAwareInterface to minimize expensive initialization when authorization is not needed.

protected getAuthorizationService() : AuthorizationService
Return values
AuthorizationService

getBackgroundTabs()

Get names of tabs to be loaded in the background.

protected getBackgroundTabs() : array<string|int, mixed>
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

getDefaultTab()

Get default tab for a given driver

protected getDefaultTab() : string
Return values
string

getILSLoginMethod()

What login method does the ILS use (password, email, vufind)

protected getILSLoginMethod([string $target = '' ]) : string
Parameters
$target : string = ''

Login target (MultiILS only)

Return values
string

getILSLoginSettings()

Get settings required for displaying the catalog login form

protected getILSLoginSettings() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRefreshResponse()

Construct an HTTP 205 (refresh) response. Useful for reporting success in the lightbox without actually rendering content.

protected getRefreshResponse() : Response
Return values
Response

getTabsExtraScripts()

Get extra scripts required by tabs.

protected getTabsExtraScripts(array<string|int, mixed> $tabs) : array<string|int, mixed>
Parameters
$tabs : array<string|int, mixed>

Tab names to consider

Return values
array<string|int, mixed>

getViewRenderer()

Get the view renderer

protected getViewRenderer() : RendererInterface
Return values
RendererInterface

hasFollowupUrl()

Checks if a followup url is set

protected hasFollowupUrl() : bool
Return values
bool

inLightbox()

Are we currently in a lightbox context?

protected inLightbox() : bool
Return values
bool

isLocalUrl()

Is the provided URL local to this instance?

protected isLocalUrl(string $url) : bool
Parameters
$url : string

URL to check

Return values
bool

listsEnabled()

Are lists enabled?

protected listsEnabled() : bool
Return values
bool

loadRecord()

Load the record requested by the user; note that this is not done in the init() method since we don't want to perform an expensive search twice when homeAction() forwards to another method.

protected loadRecord([ParamBag $params = null ][, bool $force = false ]) : AbstractBase
Parameters
$params : ParamBag = null

Search backend parameters

$force : bool = false

Set to true to force a reload of the record, even if already loaded (useful if loading a record using different parameters)

Return values
AbstractBase

loadTabDetails()

Support method to load tab information from the RecordTab PluginManager.

protected loadTabDetails() : void
Return values
void

normalizeUrlForComparison()

Normalize the referer URL so that inconsistencies in protocol and trailing slashes do not break comparisons.

protected normalizeUrlForComparison(string $url) : string
Parameters
$url : string

URL to normalize

Return values
string

processSave()

ProcessSave -- store the results of the Save action.

protected processSave() : mixed
Return values
mixed

redirectToRecord()

Redirect the user to the main record view.

protected redirectToRecord([string $params = '' ][, string $tab = null ]) : mixed
Parameters
$params : string = ''

Parameters to append to record URL.

$tab : string = null

Record tab to display (null for default).

Return values
mixed

resultScrollerActive()

Is the result scroller active?

protected resultScrollerActive() : bool
Return values
bool

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

setFollowupUrlToReferer()

Store a referer (if appropriate) to keep post-login redirect pointing to an appropriate location. This is used when the user clicks the log in link from an arbitrary page or when a password is mistyped; separate logic is used for storing followup information when VuFind forces the user to log in from another context.

protected setFollowupUrlToReferer([bool $allowCurrentUrl = true ][, array<string|int, mixed> $extras = [] ]) : void
Parameters
$allowCurrentUrl : bool = true

Whether the current URL is valid for followup

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

Extra data for the followup

Return values
void

showTab()

Display a particular tab.

protected showTab(string $tab[, bool $ajax = false ]) : mixed
Parameters
$tab : string

Name of tab to display

$ajax : bool = false

Are we in AJAX mode?

Return values
mixed

smsEnabled()

Is SMS enabled?

protected smsEnabled() : bool
Return values
bool

tagsEnabled()

Are tags enabled?

protected tagsEnabled() : bool
Return values
bool

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