class ContentController extends ActionController (View source)

The Neos ContentModule controller; providing backend functionality for the Content Module.

Traits

A trait to add backend translation based on the backend users settings

Properties

protected Service $localizationService from  BackendUserTranslationTrait
protected UserService $userService from  BackendUserTranslationTrait
protected AssetRepository $assetRepository
protected ImageRepository $imageRepository
protected PersistenceManagerInterface $persistenceManager
protected ResourceManager $resourceManager
protected PluginService $pluginService

The pluginService

protected ImageInterfaceArrayPresenter $imageInterfaceArrayPresenter
protected EntityToIdentityConverter $entityToIdentityConverter
protected ThumbnailService $thumbnailService
protected PropertyMapper $propertyMapper
protected $contentRepositoryRegistry

Methods

void
initializeObject()

Set the locale according to the user settings

void
initializeUploadAssetAction()

Initialize property mapping as the upload usually comes from the Inspector JavaScript

string
uploadAssetAction(Asset $asset, string $metadata, string $node, string $propertyName)

Upload a new image, and return its metadata.

void
initializeCreateImageVariantAction()

Configure property mapping for adding a new image variant.

string
createImageVariantAction(ImageVariant $asset)

Generate a new image variant from given data.

string
imageWithMetadataAction(ImageInterface $image)

Fetch the metadata for a given image

array<string,mixed>
getImageInterfacePreviewData(ImageInterface $image)

Returns important meta data for the given object implementing ImageInterface.

array
getImagePreviewData(Image $image)

No description

array<string,mixed>
getImageVariantPreviewData(ImageVariant $imageVariant)

No description

void
string
assetsWithMetadataAction(array $assets)

Fetch the metadata for multiple assets

array<string,mixed>
getAssetProperties(AssetInterface $asset)

No description

string
pluginViewsAction(string $identifier = null, string $workspaceName = 'live', array $dimensions = [])

Fetch the configured views for the given master plugin

string
masterPluginsAction(string $workspaceName = 'live', array $dimensions = [])

Fetch all master plugins that are available in the current workspace.

Node|null
findClosestDocumentNode(Node $node)

No description

void
emitAssetUploaded(Asset $asset, Node|null $node, string $propertyName)

Signals that a new asset has been uploaded through the Neos Backend

Details

protected void initializeObject()

Set the locale according to the user settings

Return Value

void

void initializeUploadAssetAction()

Initialize property mapping as the upload usually comes from the Inspector JavaScript

Return Value

void

Exceptions

NoSuchArgumentException

string uploadAssetAction(Asset $asset, string $metadata, string $node, string $propertyName)

Upload a new image, and return its metadata.

Depending on the $metadata argument it will return asset metadata for the AssetEditor or image metadata for the ImageEditor

Note: This action triggers the AssetUploaded signal that can be used to adjust the asset based on the (site) node it was attached to.

Parameters

Asset $asset
string $metadata

Type of metadata to return ("Asset" or "Image")

string $node

The node the new asset should be assigned to

string $propertyName

The node property name the new asset should be assigned to

Return Value

string

Exceptions

IllegalObjectTypeException
IllegalObjectTypeException
ThumbnailServiceException

void initializeCreateImageVariantAction()

Configure property mapping for adding a new image variant.

Return Value

void

Exceptions

NoSuchArgumentException
NoSuchArgumentException

string createImageVariantAction(ImageVariant $asset)

Generate a new image variant from given data.

Parameters

ImageVariant $asset

Return Value

string

Exceptions

IllegalObjectTypeException
IllegalObjectTypeException

string imageWithMetadataAction(ImageInterface $image)

Fetch the metadata for a given image

Parameters

ImageInterface $image

Return Value

string

JSON encoded response

Exceptions

ThumbnailServiceException

protected array<string,mixed> getImageInterfacePreviewData(ImageInterface $image)

Returns important meta data for the given object implementing ImageInterface.

Will return an array with the following keys:

"originalImageResourceUri": Uri for the original resource "previewImageResourceUri": Uri for a preview image with reduced size "originalDimensions": Dimensions for the original image (width, height, aspectRatio) "previewDimensions": Dimensions for the preview image (width, height) "object": object properties like the identity and type of the object

Parameters

ImageInterface $image

The image to retrieve meta data for

Return Value

array<string,mixed>

Exceptions

ThumbnailServiceException

protected array getImagePreviewData(Image $image)

No description

Parameters

Image $image

Return Value

array

Exceptions

ThumbnailServiceException

protected array<string,mixed> getImageVariantPreviewData(ImageVariant $imageVariant)

No description

Parameters

ImageVariant $imageVariant

Return Value

array<string,mixed>

Exceptions

ThumbnailServiceException

protected void initializeAssetsWithMetadataAction()

No description

Return Value

void

Exceptions

NoSuchArgumentException

string assetsWithMetadataAction(array $assets)

Fetch the metadata for multiple assets

Parameters

array $assets

Return Value

string

JSON encoded response

Exceptions

ThumbnailServiceException

protected array<string,mixed> getAssetProperties(AssetInterface $asset)

No description

Parameters

AssetInterface $asset

Return Value

array<string,mixed>

Exceptions

ThumbnailServiceException

string pluginViewsAction(string $identifier = null, string $workspaceName = 'live', array $dimensions = [])

Fetch the configured views for the given master plugin

Parameters

string $identifier

Specifies the node to look up

string $workspaceName

Name of the workspace to use for querying the node

array $dimensions

Optional list of dimensions and their values which should be used for querying the specified node

Return Value

string

Exceptions

Exception
MissingActionNameException

string masterPluginsAction(string $workspaceName = 'live', array $dimensions = [])

Fetch all master plugins that are available in the current workspace.

Parameters

string $workspaceName

Name of the workspace to use for querying the node

array $dimensions

Optional list of dimensions and their values which should be used for querying the specified node

Return Value

string

JSON encoded array of node path => label

Exceptions

Exception

final protected Node|null findClosestDocumentNode(Node $node)

No description

Parameters

Node $node

Return Value

Node|null

protected void emitAssetUploaded(Asset $asset, Node|null $node, string $propertyName)

Signals that a new asset has been uploaded through the Neos Backend

Parameters

Asset $asset

The uploaded asset

Node|null $node

The node the asset belongs to

string $propertyName

The node property name the asset is assigned to

Return Value

void