Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Actions\SubmitEntityAction Class Reference

Handles the submit action for Wikibase entities. More...

+ Inheritance diagram for Wikibase\Repo\Actions\SubmitEntityAction:
+ Collaboration diagram for Wikibase\Repo\Actions\SubmitEntityAction:

Public Member Functions

 __construct (Article $article, IContextSource $context, PermissionManager $permissionManager, RevisionLookup $revisionLookup, TempUserCreator $tempUserCreator, UserOptionsLookup $userOptionsLookup, WatchlistManager $watchlistManager, WikiPageFactory $wikiPageFactory, AnonymousEditWarningBuilder $anonymousEditWarningBuilder, EditFilterHookRunner $editFilterHookRunner, EntityDiffVisualizerFactory $entityDiffVisualizerFactory, SummaryFormatter $summaryFormatter)
 
 getName ()
 
 doesWrites ()
 
 show ()
 Show the entity using parent::show(), unless an undo operation is requested.
 
 execute ()
 
- Public Member Functions inherited from Wikibase\Repo\Actions\EditEntityAction
 __construct (Article $article, IContextSource $context, PermissionManager $permissionManager, RevisionLookup $revisionLookup, AnonymousEditWarningBuilder $anonymousEditWarningBuilder, EntityDiffVisualizerFactory $entityDiffVisualizerFactory, SummaryFormatter $summaryFormatter)
 
 requiresUnblock ()
 
 requiresWrite ()
 

Public Attributes

const SPEC
 ObjectFactory specification for this class, to be returned by EntityHandler::getActionOverrides() implementations.
 
- Public Attributes inherited from Wikibase\Repo\Actions\EditEntityAction
const SPEC
 ObjectFactory specification for this class, to be returned by EntityHandler::getActionOverrides() implementations.
 

Private Member Functions

 attemptSave (Title $title, EntityContent $content, string $summary, int $undidRevId, int $originalRevId, string $editToken)
 
 getEditTokenStatus (string $editToken)
 Checks that the given token is valid.
 
 getTempUserStatus ()
 
 doWatch (Title $title)
 Update watchlist.
 
 redirectToEntityPage (SubmitEntityStatus $status)
 Redirect to the page of the entity that was successfully edited.
 

Private Attributes

TempUserCreator $tempUserCreator
 
UserOptionsLookup $userOptionsLookup
 
WatchlistManager $watchlistManager
 
WikiPageFactory $wikiPageFactory
 
EditFilterHookRunner $editFilterHookRunner
 

Additional Inherited Members

- Static Public Member Functions inherited from Wikibase\Repo\Actions\ViewEntityAction
static onBeforeDisplayNoArticleText (Article $article)
 Handler for the BeforeDisplayNoArticleText called by Article.
 
- Protected Member Functions inherited from Wikibase\Repo\Actions\EditEntityAction
 showPermissionError (string $action)
 Show an error page if the user is not allowed to perform the given action.
 
 loadRevisions ()
 Loads the revisions specified by the web request and returns them as a three element array wrapped in a Status object.
 
 showUndoErrorPage (Status $status)
 Output an error page showing the given status.
 
 makeSummary (string $actionName, RevisionRecord $revision, string $userSummary)
 
- Protected Member Functions inherited from Wikibase\Repo\Actions\ViewEntityAction
 getDescription ()
 
- Protected Attributes inherited from Wikibase\Repo\Actions\EditEntityAction
PermissionManager $permissionManager
 

Detailed Description

Handles the submit action for Wikibase entities.

This performs the undo and restore operations when requested. Otherwise it will just show the normal entity view.

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Jens Ohlig
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Actions\SubmitEntityAction::__construct ( Article $article,
IContextSource $context,
PermissionManager $permissionManager,
RevisionLookup $revisionLookup,
TempUserCreator $tempUserCreator,
UserOptionsLookup $userOptionsLookup,
WatchlistManager $watchlistManager,
WikiPageFactory $wikiPageFactory,
AnonymousEditWarningBuilder $anonymousEditWarningBuilder,
EditFilterHookRunner $editFilterHookRunner,
EntityDiffVisualizerFactory $entityDiffVisualizerFactory,
SummaryFormatter $summaryFormatter )

Member Function Documentation

◆ attemptSave()

Wikibase\Repo\Actions\SubmitEntityAction::attemptSave ( Title $title,
EntityContent $content,
string $summary,
int $undidRevId,
int $originalRevId,
string $editToken )
private

◆ doesWrites()

Wikibase\Repo\Actions\SubmitEntityAction::doesWrites ( )

◆ doWatch()

Wikibase\Repo\Actions\SubmitEntityAction::doWatch ( Title $title)
private

Update watchlist.

◆ execute()

Wikibase\Repo\Actions\SubmitEntityAction::execute ( )

◆ getEditTokenStatus()

Wikibase\Repo\Actions\SubmitEntityAction::getEditTokenStatus ( string $editToken)
private

Checks that the given token is valid.

◆ getName()

Wikibase\Repo\Actions\SubmitEntityAction::getName ( )

◆ getTempUserStatus()

Wikibase\Repo\Actions\SubmitEntityAction::getTempUserStatus ( )
private

◆ redirectToEntityPage()

Wikibase\Repo\Actions\SubmitEntityAction::redirectToEntityPage ( SubmitEntityStatus $status)
private

Redirect to the page of the entity that was successfully edited.

Parameters
SubmitEntityStatus$statusA status as returned by self::attemptSave(). The status must be OK.

◆ show()

Wikibase\Repo\Actions\SubmitEntityAction::show ( )

Show the entity using parent::show(), unless an undo operation is requested.

In that case $this->undo(); is called to perform the action after a permission check.

Reimplemented from Wikibase\Repo\Actions\EditEntityAction.

Member Data Documentation

◆ $editFilterHookRunner

EditFilterHookRunner Wikibase\Repo\Actions\SubmitEntityAction::$editFilterHookRunner
private

◆ $tempUserCreator

TempUserCreator Wikibase\Repo\Actions\SubmitEntityAction::$tempUserCreator
private

◆ $userOptionsLookup

UserOptionsLookup Wikibase\Repo\Actions\SubmitEntityAction::$userOptionsLookup
private

◆ $watchlistManager

WatchlistManager Wikibase\Repo\Actions\SubmitEntityAction::$watchlistManager
private

◆ $wikiPageFactory

WikiPageFactory Wikibase\Repo\Actions\SubmitEntityAction::$wikiPageFactory
private

◆ SPEC

const Wikibase\Repo\Actions\SubmitEntityAction::SPEC
Initial value:
= [
'class' => self::class,
'services' => [
'PermissionManager',
'RevisionLookup',
'TempUserCreator',
'UserOptionsLookup',
'WatchlistManager',
'WikiPageFactory',
'WikibaseRepo.AnonymousEditWarningBuilder',
'WikibaseRepo.EditFilterHookRunner',
'WikibaseRepo.EntityDiffVisualizerFactory',
'WikibaseRepo.SummaryFormatter',
],
]

ObjectFactory specification for this class, to be returned by EntityHandler::getActionOverrides() implementations.


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