Open Monograph Press  3.3.0
PKPPubIdPlugin Class Reference
Inheritance diagram for PKPPubIdPlugin:
LazyLoadPlugin Plugin PubIdPlugin DOIPubIdPlugin URNPubIdPlugin

Public Member Functions

 addJavaScript ($request, $templateMgr)
 
 addToSchema ($hookName, $params)
 
 canBeAssigned ($pubObject)
 
 checkDuplicate ($pubId, $pubObjectType, $excludeId, $contextId)
 
 constructPubId ($pubIdPrefix, $pubIdSuffix, $contextId)
 
 getActions ($request, $actionArgs)
 
 getAdditionalFieldNames ($hookName, $params)
 
 getAssignFormFieldName ()
 
 getContext ($contextId)
 
 getDAOFieldNames ()
 
 getDAOs ()
 
 getFileDAODelegates ()
 
 getFormFieldNames ()
 
 getLinkActions ($pubObject)
 
 getNotUniqueErrorMsg ()
 
 getPrefixFieldName ()
 
 getPubId ($pubObject)
 
 getPubIdAssignFile ()
 
 getPubIdDisplayType ()
 
 getPubIdFullName ()
 
 getPubIdMetadataFile ()
 
 getPubIdType ()
 
 getPubObjectType ($pubObject)
 
 getPubObjectTypes ()
 
 getResolvingURL ($contextId, $pubId)
 
 getSuffixFieldName ()
 
 getSuffixPatternsFieldNames ()
 
 instantiateSettingsForm ($contextId)
 
 isObjectTypeEnabled ($pubObjectType, $contextId)
 
 manage ($args, $request)
 
 register ($category, $path, $mainContextId=null)
 
 setStoredPubId (&$pubObject, $pubId)
 
 validatePubId ($pubId)
 
 verifyData ($fieldName, $fieldValue, $pubObject, $contextId, &$errorMsg)
 
- Public Member Functions inherited from LazyLoadPlugin
 getCanDisable ()
 
 getCanEnable ()
 
 getCurrentContextId ()
 
 getEnabled ($contextId=null)
 
 getName ()
 
 setEnabled ($enabled)
 
- Public Member Functions inherited from Plugin
 __construct ()
 
 _overridePluginTemplates ($hookName, $args)
 
 addLocaleData ($locale=null)
 
 getCategory ()
 
 getContextSpecificPluginSettingsFile ()
 
 getCurrentVersion ()
 
 getDescription ()
 
 getDirName ()
 
 getDisplayName ()
 
 getEnabled ()
 
 getHideManagement ()
 
 getInstallControlledVocabFiles ()
 
 getInstallDataFile ()
 
 getInstallEmailTemplateDataFile ()
 
 getInstallEmailTemplatesFile ()
 
 getInstallFilterConfigFiles ()
 
 getInstallMigration ()
 
 getInstallSchemaFile ()
 
 getInstallSitePluginSettingsFile ()
 
 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)
 
 isSitePlugin ()
 
 smartyPluginUrl ($params, $smarty)
 
 updateSchema ($hookName, $args)
 
 updateSetting ($contextId, $name, $value, $type=null)
 

Additional Inherited Members

- Data Fields inherited from Plugin
 $pluginCategory
 
 $pluginPath
 
 $request
 
- Protected Member Functions inherited from Plugin
 _registerTemplateResource ($inCore=false)
 

Detailed Description

Abstract class for public identifiers plugins.

Definition at line 18 of file PKPPubIdPlugin.inc.php.

Member Function Documentation

◆ addJavaScript()

PKPPubIdPlugin::addJavaScript (   $request,
  $templateMgr 
)

Add JavaScript files to be loaded in the metadata file.

Parameters
$requestPKPRequest
$templateMgrPKPTemplateManager

Reimplemented in URNPubIdPlugin.

Definition at line 166 of file PKPPubIdPlugin.inc.php.

◆ addToSchema()

PKPPubIdPlugin::addToSchema (   $hookName,
  $params 
)

Add properties for this type of public identifier to the entity's list for storage in the database. This is used for SchemaDAO-backed entities only.

See also
PKPPubIdPlugin::getAdditionalFieldNames()
Parameters
$hookNamestring Schema::get::publication
$paramsarray

Definition at line 337 of file PKPPubIdPlugin.inc.php.

References getDAOFieldNames(), and getFormFieldNames().

◆ canBeAssigned()

PKPPubIdPlugin::canBeAssigned (   $pubObject)

Can a pub id be assigned to the object.

Parameters
$pubObjectobject Submission, Representation, SubmissionFile + OJS Issue
Returns
boolean false, if the pub id contains an unresolved pattern i.e. '' or if the custom suffix is empty i.e. the pub id null.

Definition at line 315 of file PKPPubIdPlugin.inc.php.

References getPubId(), and getPubIdType().

◆ checkDuplicate()

PKPPubIdPlugin::checkDuplicate (   $pubId,
  $pubObjectType,
  $excludeId,
  $contextId 
)

Check for duplicate public identifiers.

Checks to see if a pubId has already been assigned to any object in the context.

Parameters
$pubIdstring
$pubObjectTypestring Class name of the pub object being checked
$excludeIdinteger This object id will not be checked for duplicates
$contextIdinteger
Returns
boolean

Reimplemented in PubIdPlugin.

Definition at line 414 of file PKPPubIdPlugin.inc.php.

References DAORegistry\getDAO(), and Application\getRepresentationDAO().

Referenced by verifyData().

◆ constructPubId()

PKPPubIdPlugin::constructPubId (   $pubIdPrefix,
  $pubIdSuffix,
  $contextId 
)
abstract

Construct the public identifier from its prefix and suffix.

Parameters
$pubIdPrefixstring
$pubIdSuffixstring
$contextIdinteger
Returns
string

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

Referenced by PubIdPlugin\getPubId(), and verifyData().

◆ getActions()

PKPPubIdPlugin::getActions (   $request,
  $actionArgs 
)

Get a list of link actions for plugin management.

Parameters
requestPKPRequest
$actionArgsarray The list of action args to be included in request URLs.
Returns
array List of LinkActions

Reimplemented from Plugin.

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

References Plugin\$request, and Plugin\getEnabled().

◆ getAdditionalFieldNames()

PKPPubIdPlugin::getAdditionalFieldNames (   $hookName,
  $params 
)

Add properties for this type of public identifier to the entity's list for storage in the database. This is used for non-SchemaDAO-backed entities only.

See also
PKPPubIdPlugin::addToSchema()
Parameters
$hookNamestring
$paramsarray

Definition at line 357 of file PKPPubIdPlugin.inc.php.

◆ getAssignFormFieldName()

PKPPubIdPlugin::getAssignFormFieldName ( )
abstract

Get the assign option form field name.

Returns
string

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

◆ getContext()

PKPPubIdPlugin::getContext (   $contextId)

Get the context object.

Parameters
$contextIdinteger
Returns
object Context

Definition at line 437 of file PKPPubIdPlugin.inc.php.

References PKPApplication\get(), and Application\getContextDAO().

Referenced by PubIdPlugin\getPubId().

◆ getDAOFieldNames()

PKPPubIdPlugin::getDAOFieldNames ( )
abstract

Get additional field names to be considered for storage.

Returns
array

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

Referenced by addToSchema().

◆ getDAOs()

PKPPubIdPlugin::getDAOs ( )

Return an array of publication object types and the corresponding DAOs.

Returns
array

Reimplemented in PubIdPlugin.

Definition at line 290 of file PKPPubIdPlugin.inc.php.

References DAORegistry\getDAO(), and Application\getRepresentationDAO().

Referenced by register().

◆ getFileDAODelegates()

PKPPubIdPlugin::getFileDAODelegates ( )

Get the possible submission file DAO delegates.

Returns
array

Definition at line 303 of file PKPPubIdPlugin.inc.php.

Referenced by register().

◆ getFormFieldNames()

PKPPubIdPlugin::getFormFieldNames ( )
abstract

Get the additional form field names, for metadata, e.g. suffix field name.

Returns
array

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

Referenced by addToSchema().

◆ getLinkActions()

PKPPubIdPlugin::getLinkActions (   $pubObject)
abstract

Get the link actions used in the pub id forms, e.g. clear pub id.

Returns
array

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

◆ getNotUniqueErrorMsg()

PKPPubIdPlugin::getNotUniqueErrorMsg ( )
abstract

Get the error message for not unique pub id

Returns
string

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

Referenced by verifyData().

◆ getPrefixFieldName()

PKPPubIdPlugin::getPrefixFieldName ( )
abstract

Get the the prefix form field name.

Returns
string

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

Referenced by PubIdPlugin\getPubId(), and verifyData().

◆ getPubId()

PKPPubIdPlugin::getPubId (   $pubObject)
abstract

Get the public identifier.

Parameters
$pubObjectobject Submission, Representation, SubmissionFile + OJS Issue
Returns
string

Reimplemented in PubIdPlugin.

Referenced by canBeAssigned().

◆ getPubIdAssignFile()

PKPPubIdPlugin::getPubIdAssignFile ( )
abstract

Get the file (path + filename) for the pub id assignment to be included into other pages.

Returns
string

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

◆ getPubIdDisplayType()

PKPPubIdPlugin::getPubIdDisplayType ( )
abstract

Public identifier type that will be displayed to the reader.

Returns
string

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

◆ getPubIdFullName()

PKPPubIdPlugin::getPubIdFullName ( )
abstract

Full name of the public identifier.

Returns
string

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

◆ getPubIdMetadataFile()

PKPPubIdPlugin::getPubIdMetadataFile ( )
abstract

Get the file (path + filename) to be included into the object's identifiers tab, e.g. for suffix editing.

Returns
string

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

◆ getPubIdType()

PKPPubIdPlugin::getPubIdType ( )
abstract

◆ getPubObjectType()

PKPPubIdPlugin::getPubObjectType (   $pubObject)

Return the object type.

Parameters
$pubObjectobject
Returns
string?

Definition at line 370 of file PKPPubIdPlugin.inc.php.

Referenced by PubIdPlugin\getPubId().

◆ getPubObjectTypes()

PKPPubIdPlugin::getPubObjectTypes ( )

Get the possible publication object types.

Returns
array

Reimplemented in PubIdPlugin.

Definition at line 231 of file PKPPubIdPlugin.inc.php.

◆ getResolvingURL()

PKPPubIdPlugin::getResolvingURL (   $contextId,
  $pubId 
)
abstract

Get the whole resolving URL.

Parameters
$contextIdinteger
$pubIdstring
Returns
string resolving URL

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

◆ getSuffixFieldName()

PKPPubIdPlugin::getSuffixFieldName ( )
abstract

Get the the suffix form field name.

Returns
string

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

Referenced by PubIdPlugin\getPubId(), and verifyData().

◆ getSuffixPatternsFieldNames()

PKPPubIdPlugin::getSuffixPatternsFieldNames ( )
abstract

Get the suffix patterns form field names for all objects.

Returns
array (pub object type => suffix pattern field name)

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

Referenced by PubIdPlugin\getPubId().

◆ instantiateSettingsForm()

PKPPubIdPlugin::instantiateSettingsForm (   $contextId)
abstract

Get the settings form.

Parameters
$contextIdinteger
Returns
object Settings form

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

Referenced by manage().

◆ isObjectTypeEnabled()

PKPPubIdPlugin::isObjectTypeEnabled (   $pubObjectType,
  $contextId 
)
abstract

Is this object type enabled in plugin settings

Parameters
$pubObjectTypeobject
$contextIdinteger
Returns
boolean

Reimplemented in URNPubIdPlugin, and DOIPubIdPlugin.

Referenced by PubIdPlugin\getPubId().

◆ manage()

PKPPubIdPlugin::manage (   $args,
  $request 
)

Perform a management function.

Parameters
$argsarray
$requestPKPRequest
Returns
JSONMessage A JSON-encoded response

Reimplemented from Plugin.

Definition at line 77 of file PKPPubIdPlugin.inc.php.

References Plugin\$request, Application\getContextDAO(), and instantiateSettingsForm().

◆ register()

PKPPubIdPlugin::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.

Reimplemented in DOIPubIdPlugin, and URNPubIdPlugin.

Definition at line 26 of file PKPPubIdPlugin.inc.php.

References Plugin\addLocaleData(), getDAOs(), Plugin\getEnabled(), getFileDAODelegates(), HookRegistry\register(), and strtolower_codesafe().

◆ setStoredPubId()

PKPPubIdPlugin::setStoredPubId ( $pubObject,
  $pubId 
)

Set and store a public identifier.

Parameters
$pubObjectobject
$pubIdstring

Definition at line 392 of file PKPPubIdPlugin.inc.php.

◆ validatePubId()

PKPPubIdPlugin::validatePubId (   $pubId)

Check whether the given pubId is valid.

Parameters
$pubIdstring
Returns
boolean

Reimplemented in DOIPubIdPlugin.

Definition at line 281 of file PKPPubIdPlugin.inc.php.

◆ verifyData()

PKPPubIdPlugin::verifyData (   $fieldName,
  $fieldValue,
  $pubObject,
  $contextId,
$errorMsg 
)

Verify form data.

Parameters
$fieldNamestring The form field to be checked.
$fieldValuestring The value of the form field.
$pubObjectobject
$contextIdinteger
$errorMsgstring Return validation error messages here.
Returns
boolean

Definition at line 258 of file PKPPubIdPlugin.inc.php.

References checkDuplicate(), constructPubId(), getNotUniqueErrorMsg(), getPrefixFieldName(), Plugin\getSetting(), and getSuffixFieldName().


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