|
|
|
@ -3,12 +3,9 @@
|
|
|
|
|
namespace Drupal\islandora\Plugin\Action; |
|
|
|
|
|
|
|
|
|
use Drupal\Core\Config\ConfigFactoryInterface; |
|
|
|
|
use Drupal\Core\Entity\EntityInterface; |
|
|
|
|
use Drupal\Core\Entity\EntityTypeManagerInterface; |
|
|
|
|
use Drupal\Core\Form\FormStateInterface; |
|
|
|
|
use Drupal\Core\Messenger\MessengerInterface; |
|
|
|
|
use Drupal\Core\Session\AccountInterface; |
|
|
|
|
use Drupal\Core\Url; |
|
|
|
|
use Drupal\islandora\IslandoraUtils; |
|
|
|
|
use Drupal\islandora\EventGenerator\EmitEvent; |
|
|
|
|
use Drupal\islandora\EventGenerator\EventGeneratorInterface; |
|
|
|
@ -21,75 +18,74 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
|
|
|
/** |
|
|
|
|
* A base class for constructor/creator derivative generators. |
|
|
|
|
*/ |
|
|
|
|
class AbstractGenerateDerivativeBase extends EmitEvent |
|
|
|
|
{ |
|
|
|
|
class AbstractGenerateDerivativeBase extends EmitEvent { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Islandora utility functions. |
|
|
|
|
* |
|
|
|
|
* @var \Drupal\islandora\IslandoraUtils |
|
|
|
|
*/ |
|
|
|
|
protected $utils; |
|
|
|
|
/** |
|
|
|
|
* Islandora utility functions. |
|
|
|
|
* |
|
|
|
|
* @var \Drupal\islandora\IslandoraUtils |
|
|
|
|
*/ |
|
|
|
|
protected $utils; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Media source service. |
|
|
|
|
* |
|
|
|
|
* @var \Drupal\islandora\MediaSource\MediaSourceService |
|
|
|
|
*/ |
|
|
|
|
protected $mediaSource; |
|
|
|
|
/** |
|
|
|
|
* Media source service. |
|
|
|
|
* |
|
|
|
|
* @var \Drupal\islandora\MediaSource\MediaSourceService |
|
|
|
|
*/ |
|
|
|
|
protected $mediaSource; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Token replacement service. |
|
|
|
|
* |
|
|
|
|
* @var \Drupal\token\TokenInterface |
|
|
|
|
*/ |
|
|
|
|
protected $token; |
|
|
|
|
/** |
|
|
|
|
* Token replacement service. |
|
|
|
|
* |
|
|
|
|
* @var \Drupal\token\TokenInterface |
|
|
|
|
*/ |
|
|
|
|
protected $token; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The messenger. |
|
|
|
|
* |
|
|
|
|
* @var \Drupal\Core\Messenger\MessengerInterface |
|
|
|
|
*/ |
|
|
|
|
protected $messenger; |
|
|
|
|
/** |
|
|
|
|
* The messenger. |
|
|
|
|
* |
|
|
|
|
* @var \Drupal\Core\Messenger\MessengerInterface |
|
|
|
|
*/ |
|
|
|
|
protected $messenger; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The system file config. |
|
|
|
|
* |
|
|
|
|
* @var \Drupal\Core\Config\ImmutableConfig |
|
|
|
|
*/ |
|
|
|
|
protected $config; |
|
|
|
|
/** |
|
|
|
|
* The system file config. |
|
|
|
|
* |
|
|
|
|
* @var \Drupal\Core\Config\ImmutableConfig |
|
|
|
|
*/ |
|
|
|
|
protected $config; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Constructs a EmitEvent action. |
|
|
|
|
* |
|
|
|
|
* @param array $configuration |
|
|
|
|
* A configuration array containing information about the plugin instance. |
|
|
|
|
* @param string $plugin_id |
|
|
|
|
* The plugin_id for the plugin instance. |
|
|
|
|
* @param mixed $plugin_definition |
|
|
|
|
* The plugin implementation definition. |
|
|
|
|
* @param \Drupal\Core\Session\AccountInterface $account |
|
|
|
|
* Current user. |
|
|
|
|
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager |
|
|
|
|
* Entity type manager. |
|
|
|
|
* @param \Drupal\islandora\EventGenerator\EventGeneratorInterface $event_generator |
|
|
|
|
* EventGenerator service to serialize AS2 events. |
|
|
|
|
* @param \Stomp\StatefulStomp $stomp |
|
|
|
|
* Stomp client. |
|
|
|
|
* @param \Drupal\jwt\Authentication\Provider\JwtAuth $auth |
|
|
|
|
* JWT Auth client. |
|
|
|
|
* @param \Drupal\islandora\IslandoraUtils $utils |
|
|
|
|
* Islandora utility functions. |
|
|
|
|
* @param \Drupal\islandora\MediaSource\MediaSourceService $media_source |
|
|
|
|
* Media source service. |
|
|
|
|
* @param \Drupal\token\TokenInterface $token |
|
|
|
|
* Token service. |
|
|
|
|
* @param \Drupal\Core\Messenger\MessengerInterface $messenger |
|
|
|
|
* The messenger. |
|
|
|
|
* @param \Drupal\Core\Config\ConfigFactoryInterface $config |
|
|
|
|
* The system file config. |
|
|
|
|
*/ |
|
|
|
|
public function __construct( |
|
|
|
|
/** |
|
|
|
|
* Constructs a EmitEvent action. |
|
|
|
|
* |
|
|
|
|
* @param array $configuration |
|
|
|
|
* A configuration array containing information about the plugin instance. |
|
|
|
|
* @param string $plugin_id |
|
|
|
|
* The plugin_id for the plugin instance. |
|
|
|
|
* @param mixed $plugin_definition |
|
|
|
|
* The plugin implementation definition. |
|
|
|
|
* @param \Drupal\Core\Session\AccountInterface $account |
|
|
|
|
* Current user. |
|
|
|
|
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager |
|
|
|
|
* Entity type manager. |
|
|
|
|
* @param \Drupal\islandora\EventGenerator\EventGeneratorInterface $event_generator |
|
|
|
|
* EventGenerator service to serialize AS2 events. |
|
|
|
|
* @param \Stomp\StatefulStomp $stomp |
|
|
|
|
* Stomp client. |
|
|
|
|
* @param \Drupal\jwt\Authentication\Provider\JwtAuth $auth |
|
|
|
|
* JWT Auth client. |
|
|
|
|
* @param \Drupal\islandora\IslandoraUtils $utils |
|
|
|
|
* Islandora utility functions. |
|
|
|
|
* @param \Drupal\islandora\MediaSource\MediaSourceService $media_source |
|
|
|
|
* Media source service. |
|
|
|
|
* @param \Drupal\token\TokenInterface $token |
|
|
|
|
* Token service. |
|
|
|
|
* @param \Drupal\Core\Messenger\MessengerInterface $messenger |
|
|
|
|
* The messenger. |
|
|
|
|
* @param \Drupal\Core\Config\ConfigFactoryInterface $config |
|
|
|
|
* The system file config. |
|
|
|
|
*/ |
|
|
|
|
public function __construct( |
|
|
|
|
array $configuration, |
|
|
|
|
$plugin_id, |
|
|
|
|
$plugin_definition, |
|
|
|
@ -104,43 +100,43 @@ class AbstractGenerateDerivativeBase extends EmitEvent
|
|
|
|
|
MessengerInterface $messenger, |
|
|
|
|
ConfigFactoryInterface $config |
|
|
|
|
) { |
|
|
|
|
$this->utils = $utils; |
|
|
|
|
$this->mediaSource = $media_source; |
|
|
|
|
$this->token = $token; |
|
|
|
|
$this->messenger = $messenger; |
|
|
|
|
$this->config = $config->get('system.file'); |
|
|
|
|
parent::__construct( |
|
|
|
|
$configuration, |
|
|
|
|
$plugin_id, |
|
|
|
|
$plugin_definition, |
|
|
|
|
$account, |
|
|
|
|
$entity_type_manager, |
|
|
|
|
$event_generator, |
|
|
|
|
$stomp, |
|
|
|
|
$auth, |
|
|
|
|
$messenger |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
$this->utils = $utils; |
|
|
|
|
$this->mediaSource = $media_source; |
|
|
|
|
$this->token = $token; |
|
|
|
|
$this->messenger = $messenger; |
|
|
|
|
$this->config = $config->get('system.file'); |
|
|
|
|
parent::__construct( |
|
|
|
|
$configuration, |
|
|
|
|
$plugin_id, |
|
|
|
|
$plugin_definition, |
|
|
|
|
$account, |
|
|
|
|
$entity_type_manager, |
|
|
|
|
$event_generator, |
|
|
|
|
$stomp, |
|
|
|
|
$auth, |
|
|
|
|
$messenger |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* {@inheritdoc} |
|
|
|
|
*/ |
|
|
|
|
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { |
|
|
|
|
return new static( |
|
|
|
|
$configuration, |
|
|
|
|
$plugin_id, |
|
|
|
|
$plugin_definition, |
|
|
|
|
$container->get('current_user'), |
|
|
|
|
$container->get('entity_type.manager'), |
|
|
|
|
$container->get('islandora.eventgenerator'), |
|
|
|
|
$container->get('islandora.stomp'), |
|
|
|
|
$container->get('jwt.authentication.jwt'), |
|
|
|
|
$container->get('islandora.utils'), |
|
|
|
|
$container->get('islandora.media_source_service'), |
|
|
|
|
$container->get('token'), |
|
|
|
|
$container->get('messenger'), |
|
|
|
|
$container->get('config.factory') |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* {@inheritdoc} |
|
|
|
|
*/ |
|
|
|
|
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) |
|
|
|
|
{ |
|
|
|
|
return new static( |
|
|
|
|
$configuration, |
|
|
|
|
$plugin_id, |
|
|
|
|
$plugin_definition, |
|
|
|
|
$container->get('current_user'), |
|
|
|
|
$container->get('entity_type.manager'), |
|
|
|
|
$container->get('islandora.eventgenerator'), |
|
|
|
|
$container->get('islandora.stomp'), |
|
|
|
|
$container->get('jwt.authentication.jwt'), |
|
|
|
|
$container->get('islandora.utils'), |
|
|
|
|
$container->get('islandora.media_source_service'), |
|
|
|
|
$container->get('token'), |
|
|
|
|
$container->get('messenger'), |
|
|
|
|
$container->get('config.factory') |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|