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

A trait to add create a content context

Properties

protected Service $_localizationService from  BackendUserTranslationTrait
protected UserService $_userService from  BackendUserTranslationTrait
protected ContentContextFactory $_contextFactory from  CreateContentContextTrait
protected SiteRepository $_siteRepository from  CreateContentContextTrait
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

Methods

void
initializeObject()

Set the locale according to the user settings

createContentContext(string $workspaceName, array $dimensions = [])

Create a ContentContext based on the given workspace name

createContextMatchingNodeData(NodeData $nodeData)

Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.

initializeUploadAssetAction()

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

string
uploadAssetAction(Asset $asset, string $metadata, NodeInterface $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
getImageInterfacePreviewData(ImageInterface $image)

Returns important meta data for the given object implementing ImageInterface.

array
getImagePreviewData(Image $image)

No description

array
getImageVariantPreviewData(ImageVariant $imageVariant)

No description

void
string
assetsWithMetadataAction(array $assets)

Fetch the metadata for multiple assets

array
getAssetProperties(Asset $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.

void
emitAssetUploaded(Asset $asset, NodeInterface $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

protected ContentContext createContentContext(string $workspaceName, array $dimensions = [])

Create a ContentContext based on the given workspace name

Parameters

string $workspaceName

Name of the workspace to set for the context

array $dimensions

Optional list of dimensions and their values which should be set

Return Value

ContentContext

protected ContentContext createContextMatchingNodeData(NodeData $nodeData)

Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.

Parameters

NodeData $nodeData

Return Value

ContentContext

initializeUploadAssetAction()

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

Exceptions

NoSuchArgumentException

string uploadAssetAction(Asset $asset, string $metadata, NodeInterface $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")

NodeInterface $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 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

Exceptions

ThumbnailServiceException

protected array getImagePreviewData(Image $image)

No description

Parameters

Image $image

Return Value

array

Exceptions

ThumbnailServiceException

protected array getImageVariantPreviewData(ImageVariant $imageVariant)

No description

Parameters

ImageVariant $imageVariant

Return Value

array

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 getAssetProperties(Asset $asset)

No description

Parameters

Asset $asset

Return Value

array

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

protected void emitAssetUploaded(Asset $asset, NodeInterface $node, string $propertyName)

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

Parameters

Asset $asset

The uploaded asset

NodeInterface $node

The node the asset belongs to

string $propertyName

The node property name the asset is assigned to

Return Value

void