ServiceCloudConsumerExternalUrlNotifierMiddlewareImpl
extends ServiceCloudConsumerExternalUrlNotifierMiddleware
in package
Uses
UtilsProvider
See `ServiceCloudConsumerExternalUrlNotifierMiddleware`.
Table of Contents
Constants
- THRESHOLD_AUTOMATIC_SCAN = 200
- The threshold for automatic scanning. Otherwise, a notice is shown that the user has to scan the URLs manually.
Properties
- $consumer : mixed
- $suspended : mixed
Methods
- __construct() : mixed
- C'tor.
- afterDownloadAndPersistFromDataSource() : void
- Teardown of `beforeDownloadAndPersistFromDataSource`. This is also invoked when the database throws the `AbortDataSourceDownloadException` exception.
- afterUseTemplate() : void
- Teardown of `beforeDownloadAndPersistFromDataSource`.
- alreadyNotified() : array<string|int, string>
- Check if the external URL is already notified. It should return a list of hostnames which are already notified so we do never notify twice.
- beforeDownloadAndPersistFromDataSource() : void
- Before downloading from specified datasources. This allows you to e.g. change the language of the context to make translations work as expected.
- beforeUseTemplate() : void
- Before using a template and running all the middlewares of `AbstractTemplateMiddleware`.
- configure() : mixed
- Configure the headless content blocker before it gets `setup()`.
- failedDownloadAndPersistFromDataSource() : void
- The download from a data source failed with an exception.
- fetchExternalUrls() : array<string|int, array<string|int, mixed>>
- Fetch external URLs which got found by your scanner.
- getConsumer() : mixed
- Getter.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- getVariableResolver() : mixed
- Getter.
- isSuspended() : mixed
- Check if the middleware is suspended.
- notify() : mixed
- Notify the external URL which is now covered by a blocker template.
- suspend() : mixed
- Allows to suspend or resume the middleware to take effect. This is efficient if a middleware could be called recursively.
- applyAcknowledgementMode() : mixed
- Disallow the creation of a service in the scanner. Additionally, you can add a message to the consumer data which is shown to the user. The user can only acknowledge to the message and not create the service.
Constants
THRESHOLD_AUTOMATIC_SCAN
The threshold for automatic scanning. Otherwise, a notice is shown that the user has to scan the URLs manually.
public
mixed
THRESHOLD_AUTOMATIC_SCAN
= 200
Properties
$consumer
private
mixed
$consumer
$suspended
private
mixed
$suspended
= false
Methods
__construct()
C'tor.
public
__construct(ServiceCloudConsumer $consumer) : mixed
Parameters
- $consumer : ServiceCloudConsumer
afterDownloadAndPersistFromDataSource()
Teardown of `beforeDownloadAndPersistFromDataSource`. This is also invoked when the database throws the `AbortDataSourceDownloadException` exception.
public
abstract afterDownloadAndPersistFromDataSource(Exception $exception, array<string|int, AbstractTemplate> $templates) : void
Parameters
- $exception : Exception
-
null
when persist worked as expected, otherwise anException
- $templates : array<string|int, AbstractTemplate>
-
The persisted templates within this consumer
afterUseTemplate()
Teardown of `beforeDownloadAndPersistFromDataSource`.
public
abstract afterUseTemplate(AbstractTemplate $template) : void
Parameters
- $template : AbstractTemplate
alreadyNotified()
Check if the external URL is already notified. It should return a list of hostnames which are already notified so we do never notify twice.
public
alreadyNotified() : array<string|int, string>
Return values
array<string|int, string>beforeDownloadAndPersistFromDataSource()
Before downloading from specified datasources. This allows you to e.g. change the language of the context to make translations work as expected.
public
abstract beforeDownloadAndPersistFromDataSource() : void
beforeUseTemplate()
Before using a template and running all the middlewares of `AbstractTemplateMiddleware`.
public
abstract beforeUseTemplate(AbstractTemplate $template) : void
Parameters
- $template : AbstractTemplate
configure()
Configure the headless content blocker before it gets `setup()`.
public
configure(mixed $headlessContentBlocker) : mixed
Parameters
- $headlessContentBlocker : mixed
failedDownloadAndPersistFromDataSource()
The download from a data source failed with an exception.
public
failedDownloadAndPersistFromDataSource(Exception $exception) : void
Parameters
- $exception : Exception
fetchExternalUrls()
Fetch external URLs which got found by your scanner.
public
fetchExternalUrls() : array<string|int, array<string|int, mixed>>
Return an array of objects with the following properties:
-
identifier
(string): The identifier of the external URL. -
externalUrl
(string): The external URL. -
markup
(string): The markup of the external URL. (optional)
Return values
array<string|int, array<string|int, mixed>>getConsumer()
Getter.
public
getConsumer() : mixed
Tags
getPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringgetVariableResolver()
Getter.
public
getVariableResolver() : mixed
Tags
isSuspended()
Check if the middleware is suspended.
public
isSuspended() : mixed
notify()
Notify the external URL which is now covered by a blocker template.
public
notify(mixed $externalUrls) : mixed
Parameters
- $externalUrls : mixed
suspend()
Allows to suspend or resume the middleware to take effect. This is efficient if a middleware could be called recursively.
public
suspend(bool $state) : mixed
Parameters
- $state : bool
applyAcknowledgementMode()
Disallow the creation of a service in the scanner. Additionally, you can add a message to the consumer data which is shown to the user. The user can only acknowledge to the message and not create the service.
protected
applyAcknowledgementMode(AbstractTemplate $template[, array<string|int, string> $paragraphs = [] ][, array<string|int, string> $accordion = null ][, string $buttonLabel = null ][, string $buttonAction = null ]) : mixed
Parameters
- $template : AbstractTemplate
- $paragraphs : array<string|int, string> = []
- $accordion : array<string|int, string> = null
-
A list of accordions with key as headline and value as message.
- $buttonLabel : string = null
-
The label of the button.
- $buttonAction : string = null
-
The action of the button, can be "ignore", "create" or "close".