AssetController
class AssetController extends ActionController (View source)
Controller for asset handling
Traits
A trait to add create a content context
A trait to add backend translation based on the backend users settings
A trait to add backend translation based on the backend users settings
Constants
protected TAG_GIVEN |
|
protected TAG_ALL |
|
protected TAG_NONE |
|
protected COLLECTION_GIVEN |
|
protected COLLECTION_ALL |
|
Properties
protected ContentContextFactory | $_contextFactory | from CreateContentContextTrait | |
protected SiteRepository | $_siteRepository | from CreateContentContextTrait | |
protected Service | $_localizationService | from BackendUserTranslationTrait | |
protected UserService | $_userService | from BackendUserTranslationTrait | |
protected Translator | $_translator | from AddTranslatedFlashMessageTrait | |
protected array | $viewFormatToObjectNameMap | ||
protected SiteRepository | $siteRepository | ||
protected DomainRepository | $domainRepository | ||
protected AssetRepository | $assetRepository | ||
protected TagRepository | $tagRepository | ||
protected AssetCollectionRepository | $assetCollectionRepository | ||
protected PackageManager | $packageManager | ||
protected BrowserState | $browserState | ||
protected AssetService | $assetService | ||
protected AssetSourceService | $assetSourceService | ||
protected AssetVariantGenerator | $assetVariantGenerator | ||
protected AssetSourceInterface[] | $assetSources | ||
protected array | $imageProfilesConfiguration |
Methods
Create a ContentContext based on the given workspace name
Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.
No description
No description
No description
Set common variables on the view
List existing assets
New asset form
Show an asset
Edit an asset
Display variants of an asset
Create missing variants for the given image
No description
Initialization for createAction
Initialization for uploadAction
Upload a new asset. No redirection and no response body, for use by plupload (or similar).
Adds an asset to an asset collection
Update the resource on an asset.
No description
No description
This custom errorAction adds FlashMessages for validation results to give more information in the
Individual error FlashMessage that hides which action fails in production.
Details
protected ContentContext
createContentContext(string $workspaceName, array $dimensions = [])
Create a ContentContext based on the given workspace name
protected ContentContext
createContextMatchingNodeData(NodeData $nodeData)
Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.
void
initializeObject()
No description
void
addTranslatedFlashMessage(string $messageBodyTranslationId, string $severity = Message::SEVERITY_OK, array $messageArguments = [], int|null $messageCode = null)
No description
protected void
initializeAction()
No description
protected void
initializeView(ViewInterface $view)
Set common variables on the view
void
indexAction(string $view = null, string $sortBy = null, string $sortDirection = null, string $filter = null, int $tagMode = self::TAG_GIVEN, Tag $tag = null, string $searchTerm = null, int $collectionMode = self::COLLECTION_GIVEN, AssetCollection $assetCollection = null, string $assetSourceIdentifier = null)
List existing assets
void
newAction()
New asset form
void
replaceAssetResourceAction(Asset $asset)
No description
void
showAction(string $assetSourceIdentifier, string $assetProxyIdentifier)
Show an asset
void
editAction(string $assetSourceIdentifier, string $assetProxyIdentifier)
Edit an asset
void
variantsAction(string $assetSourceIdentifier, string $assetProxyIdentifier, string $overviewAction)
Display variants of an asset
void
createVariantsAction(string $assetSourceIdentifier, string $assetProxyIdentifier, string $overviewAction)
Create missing variants for the given image
protected void
initializeUpdateAction()
No description
void
updateAction(Asset $asset)
Update an asset
protected void
initializeCreateAction()
Initialization for createAction
void
createAction(Asset $asset)
Create a new asset
protected void
initializeUploadAction()
Initialization for uploadAction
string
uploadAction(Asset $asset)
Upload a new asset. No redirection and no response body, for use by plupload (or similar).
void
tagAssetAction(Asset $asset, Tag $tag)
Tags an asset with a tag.
No redirection and no response body, no flash message, for use by plupload (or similar).
void
addAssetToCollectionAction(Asset $asset, AssetCollection $assetCollection)
Adds an asset to an asset collection
void
deleteAction(Asset $asset)
Delete an asset
void
updateAssetResourceAction(AssetInterface $asset, PersistentResource $resource, array $options = [])
Update the resource on an asset.
void
relatedNodesAction(AssetInterface $asset)
Get Related Nodes for an asset (proxy action)
void
createTagAction(string $label)
No description
void
editTagAction(Tag $tag)
No description
void
updateTagAction(Tag $tag)
No description
void
deleteTagAction(Tag $tag)
No description
void
createAssetCollectionAction(string $title)
No description
void
editAssetCollectionAction(AssetCollection $assetCollection)
No description
void
updateAssetCollectionAction(AssetCollection $assetCollection)
No description
void
deleteAssetCollectionAction(AssetCollection $assetCollection)
No description
protected string
errorAction()
This custom errorAction adds FlashMessages for validation results to give more information in the
protected Message|bool
getErrorFlashMessage()
Individual error FlashMessage that hides which action fails in production.