Open Journal Systems  3.3.0
PKPUsageEventPlugin Class Reference
Inheritance diagram for PKPUsageEventPlugin:
GenericPlugin LazyLoadPlugin Plugin UsageEventPlugin

Public Member Functions

 getDescription ()
 
 getDisplayName ()
 
 getEnabled ($contextId=null)
 
 getInstallSitePluginSettingsFile ()
 
 getName ()
 
 getUniqueSiteId ()
 
 getUsageEvent ($hookName, $args)
 
 isSitePlugin ()
 
 register ($category, $path, $mainContextId=null)
 
- Public Member Functions inherited from LazyLoadPlugin
 getCanDisable ()
 
 getCanEnable ()
 
 getCurrentContextId ()
 
 setEnabled ($enabled)
 
- Public Member Functions inherited from Plugin
 __construct ()
 
 _overridePluginTemplates ($hookName, $args)
 
 addLocaleData ($locale=null)
 
 getActions ($request, $actionArgs)
 
 getCategory ()
 
 getContextSpecificPluginSettingsFile ()
 
 getCurrentVersion ()
 
 getDirName ()
 
 getEnabled ()
 
 getHideManagement ()
 
 getInstallControlledVocabFiles ()
 
 getInstallDataFile ()
 
 getInstallEmailTemplateDataFile ()
 
 getInstallEmailTemplatesFile ()
 
 getInstallFilterConfigFiles ()
 
 getInstallMigration ()
 
 getInstallSchemaFile ()
 
 getLocaleFilename ($locale)
 
 getPluginPath ()
 
getRequest ()
 
 getSeq ()
 
 getSetting ($contextId, $name)
 
 getTemplatePath ($inCore=false)
 
 getTemplateResource ($template=null, $inCore=false)
 
 import ($class)
 
 installContextSpecificSettings ($hookName, $args)
 
 installControlledVocabs ($hookName, $args)
 
 installData ($hookName, $args)
 
 installEmailTemplateData ($hookName, $args)
 
 installEmailTemplates ($hookName, $args)
 
 installFilters ($hookName, $args)
 
 installLocale ($hookName, $args)
 
 installSiteSettings ($hookName, $args)
 
 manage ($args, $request)
 
 smartyPluginUrl ($params, $smarty)
 
 updateSchema ($hookName, $args)
 
 updateSetting ($contextId, $name, $value, $type=null)
 

Protected Member Functions

 buildUsageEvent ($hookName, $args)
 
 getDownloadFinishedEventHooks ()
 
 getEventHooks ()
 
 getHtmlPageAssocTypes ()
 
 getUsageEventData ($hookName, $hookArgs, $request, $router, $templateMgr, $context)
 
 isPubIdObjectType ($pubObject)
 
- Protected Member Functions inherited from Plugin
 _registerTemplateResource ($inCore=false)
 

Additional Inherited Members

- Data Fields inherited from Plugin
 $pluginCategory
 
 $pluginPath
 
 $request
 

Detailed Description

Base class for usage event plugin. Provide usage events to other statistics plugins.

Definition at line 24 of file PKPUsageEventPlugin.inc.php.

Member Function Documentation

◆ buildUsageEvent()

PKPUsageEventPlugin::buildUsageEvent (   $hookName,
  $args 
)
protected

◆ getDescription()

PKPUsageEventPlugin::getDescription ( )

Get a description of this plugin.

Returns
string

Reimplemented from Plugin.

Definition at line 69 of file PKPUsageEventPlugin.inc.php.

◆ getDisplayName()

PKPUsageEventPlugin::getDisplayName ( )

Get the display name for this plugin.

Returns
string

Reimplemented from Plugin.

Definition at line 62 of file PKPUsageEventPlugin.inc.php.

◆ getDownloadFinishedEventHooks()

PKPUsageEventPlugin::getDownloadFinishedEventHooks ( )
protected

Get all hooks that define the finished file download.

Returns
array

Reimplemented in UsageEventPlugin.

Definition at line 137 of file PKPUsageEventPlugin.inc.php.

Referenced by buildUsageEvent().

◆ getEnabled()

PKPUsageEventPlugin::getEnabled (   $contextId = null)

Determine whether the plugin is enabled.

Returns
boolean

Reimplemented from LazyLoadPlugin.

Definition at line 76 of file PKPUsageEventPlugin.inc.php.

◆ getEventHooks()

PKPUsageEventPlugin::getEventHooks ( )
protected

Get all hooks that must be used to generate usage events.

Returns
array

Reimplemented in UsageEventPlugin.

Definition at line 125 of file PKPUsageEventPlugin.inc.php.

Referenced by register().

◆ getHtmlPageAssocTypes()

PKPUsageEventPlugin::getHtmlPageAssocTypes ( )
abstractprotected

Get all assoc types that have their usage event produced by html page access.

Returns
array

Reimplemented in UsageEventPlugin.

Referenced by buildUsageEvent().

◆ getInstallSitePluginSettingsFile()

PKPUsageEventPlugin::getInstallSitePluginSettingsFile ( )

Get the filename of the settings data for this plugin to install when the system is installed (i.e. site-level plugin settings). Subclasses using default settings should override this.

Returns
string

Reimplemented from Plugin.

Definition at line 55 of file PKPUsageEventPlugin.inc.php.

References Plugin\getPluginPath().

◆ getName()

PKPUsageEventPlugin::getName ( )

See also
Plugin::getName()

Reimplemented from LazyLoadPlugin.

Definition at line 48 of file PKPUsageEventPlugin.inc.php.

◆ getUniqueSiteId()

PKPUsageEventPlugin::getUniqueSiteId ( )

Get the unique site id.

Returns
mixed string or null

Definition at line 95 of file PKPUsageEventPlugin.inc.php.

References Plugin\getSetting().

Referenced by buildUsageEvent().

◆ getUsageEvent()

PKPUsageEventPlugin::getUsageEvent (   $hookName,
  $args 
)

Get usage event and pass it to the registered plugins, if any.

Definition at line 106 of file PKPUsageEventPlugin.inc.php.

References buildUsageEvent(), HookRegistry\call(), and HookRegistry\getHooks().

◆ getUsageEventData()

PKPUsageEventPlugin::getUsageEventData (   $hookName,
  $hookArgs,
  $request,
  $router,
  $templateMgr,
  $context 
)
protected

Get usage event details based on the passed hook. Subclasses should extend to implement application specifics.

Parameters
$hookNamestring
$hookArgsarray
$requestPKPRequest
$routerPageRouter
$templateMgrPKPTemplateManager
$contextContext
Returns
array With the following data: DataObject the published object, boolean download success, integer used published object assoc type, string used published object id foreign keys lookup (all parent associated objects id, preceeded with a single letter to identify the object), string canonical url page, string canonical url operation, array with canonical url parameters.
See also
PKPUsageEventPlugin::buildUsageEvent()

Reimplemented in UsageEventPlugin.

Definition at line 342 of file PKPUsageEventPlugin.inc.php.

References $op, Plugin\$request, and Application\getContextAssocType().

Referenced by buildUsageEvent().

◆ isPubIdObjectType()

PKPUsageEventPlugin::isPubIdObjectType (   $pubObject)
abstractprotected

Whether or not the passed object is of a type that can have different public identifiers, like DOI, URN, etc.

Parameters
$pubObjectDataObject
Returns
boolean

Reimplemented in UsageEventPlugin.

Referenced by buildUsageEvent().

◆ isSitePlugin()

PKPUsageEventPlugin::isSitePlugin ( )

Site-wide plugins should override this function to return true.

Returns
boolean

Reimplemented from Plugin.

Definition at line 83 of file PKPUsageEventPlugin.inc.php.

◆ register()

PKPUsageEventPlugin::register (   $category,
  $path,
  $mainContextId = null 
)

Load and initialize the plug-in and register plugin hooks.

For backwards compatibility this method will be called whenever the plug-in's category is being loaded. If, however, registerOn() returns an array then this method will only be called when the plug-in is enabled and an entry in the result set of registerOn() matches the current request operation. An empty array matches all request operations.

Parameters
$categoryString Name of category plugin was registered to
$pathString The path the plugin was found in
$mainContextIdinteger To identify if the plugin is enabled we need a context. This context is usually taken from the request but sometimes there is no context in the request (e.g. when executing CLI commands). Then the main context can be given as an explicit ID.
Returns
boolean True iff plugin registered successfully; if false, the plugin will not be executed.

Reimplemented from LazyLoadPlugin.

Definition at line 32 of file PKPUsageEventPlugin.inc.php.

References getEventHooks(), and HookRegistry\register().


The documentation for this class was generated from the following file: