Neos.Media.Browser/Classes/Controller/AssetController.php
public function editAction(string $assetSourceIdentifier, string $assetProxyIdentifier): void
    {
        if (!isset($this->assetSources[$assetSourceIdentifier])) {
            throw new \RuntimeException('Given asset source is not configured.', 1509632166);
        }

        $assetSource = $this->assetSources[$assetSourceIdentifier];
        $assetProxyRepository = $assetSource->getAssetProxyRepository();

        try {
            $assetProxy = $assetProxyRepository->getAssetProxy($assetProxyIdentifier);

            $tags = [];
            $contentPreview = 'ContentDefault';
            if ($assetProxyRepository instanceof SupportsTaggingInterface && $assetProxyRepository instanceof SupportsCollectionsInterface) {
                // TODO: For generic implementation (allowing other asset sources to provide asset collections), the following needs to be refactored:

                if ($assetProxy instanceof NeosAssetProxy) {
                    /** @var Asset $asset */
                    $asset = $assetProxy->getAsset();
                    $assetCollections = $asset->getAssetCollections();
                    $tags = $assetCollections->count() > 0 ? $this->tagRepository->findByAssetCollections($assetCollections->toArray()) : $this->tagRepository->findAll();

                    switch ($asset->getFileExtension()) {
                        case 'pdf':
                            $contentPreview = 'ContentPdf';
                            break;
                    }
                }
            }

            $this->view->assignMultiple([
                'tags' => $tags,
                'assetProxy' => $assetProxy,
                'assetCollections' => $this->assetCollectionRepository->findAll(),
                'contentPreview' => $contentPreview,
                'assetSource' => $assetSource,
                'canShowVariants' => ($assetProxy instanceof NeosAssetProxy) && ($assetProxy->getAsset() instanceof VariantSupportInterface)
            ]);
        } catch (AssetNotFoundExceptionInterface $e) {
            $this->throwStatus(404, 'Asset not found');
        } catch (AssetSourceConnectionExceptionInterface $e) {
            $this->view->assign('connectionError', $e);
        }
    }
public function editAction(string $assetSourceIdentifier, string $assetProxyIdentifier): void
    {
        if (!isset($this->assetSources[$assetSourceIdentifier])) {
            throw new \RuntimeException('Given asset source is not configured.', 1509632166);
        }

        $assetSource = $this->assetSources[$assetSourceIdentifier];
        $assetProxyRepository = $assetSource->getAssetProxyRepository();

        try {
            $assetProxy = $assetProxyRepository->getAssetProxy($assetProxyIdentifier);

            $tags = [];
            $contentPreview = 'ContentDefault';
            if ($assetProxyRepository instanceof SupportsTaggingInterface && $assetProxyRepository instanceof SupportsCollectionsInterface) {
                // TODO: For generic implementation (allowing other asset sources to provide asset collections), the following needs to be refactored:

                if ($assetProxy instanceof NeosAssetProxy) {
                    /** @var Asset $asset */
                    $asset = $assetProxy->getAsset();
                    $assetCollections = $asset->getAssetCollections();
                    $tags = $assetCollections->count() > 0 ? $this->tagRepository->findByAssetCollections($assetCollections->toArray()) : $this->tagRepository->findAll();

                    switch ($asset->getFileExtension()) {
                        case 'pdf':
                            $contentPreview = 'ContentPdf';
                            break;
                    }
                }
            }

            $this->view->assignMultiple([
                'tags' => $tags,
                'assetProxy' => $assetProxy,
                'assetCollections' => $this->assetCollectionRepository->findAll(),
                'contentPreview' => $contentPreview,
                'assetSource' => $assetSource,
                'canShowVariants' => ($assetProxy instanceof NeosAssetProxy) && ($assetProxy->getAsset() instanceof VariantSupportInterface)
            ]);
        } catch (AssetNotFoundExceptionInterface $e) {
            $this->throwStatus(404, 'Asset not found');
        } catch (AssetSourceConnectionExceptionInterface $e) {
            $this->view->assign('connectionError', $e);
        }
    }
public function editAction ( string $ assetSourceIdentifier , string $ assetProxyIdentifier ) : void { if ( ! isset ( $ this -> assetSources [ $ assetSourceIdentifier ] ) ) { throw new \ RuntimeException ( 'Given asset source is not configured.' , 1509632166 ) ; } $ assetSource = $ this -> assetSources [ $ assetSourceIdentifier ] ; $ assetProxyRepository = $ assetSource -> getAssetProxyRepository ( ) ; try { $ assetProxy = $ assetProxyRepository -> getAssetProxy ( $ assetProxyIdentifier ) ; $ tags = [ ] ; $ contentPreview = 'ContentDefault' ; if ( $ assetProxyRepository instanceof SupportsTaggingInterface && $ assetProxyRepository instanceof SupportsCollectionsInterface ) { // TODO: For generic implementation (allowing other asset sources to provide asset collections), the following needs to be refactored: if ( $ assetProxy instanceof NeosAssetProxy ) { /** @var Asset $asset */ $ asset = $ assetProxy -> getAsset ( ) ; $ assetCollections = $ asset -> getAssetCollections ( ) ; $ tags = $ assetCollections -> count ( ) > 0 ? $ this -> tagRepository -> findByAssetCollections ( $ assetCollections -> toArray ( ) ) : $ this -> tagRepository -> findAll ( ) ; switch ( $ asset -> getFileExtension ( ) ) { case 'pdf' : $ contentPreview = 'ContentPdf' ; break ; } } } $ this -> view -> assignMultiple ( [ 'tags' => $ tags , 'assetProxy' => $ assetProxy , 'assetCollections' => $ this -> assetCollectionRepository -> findAll ( ) , 'contentPreview' => $ contentPreview , 'assetSource' => $ assetSource , 'canShowVariants' => ( $ assetProxy instanceof NeosAssetProxy ) && ( $ assetProxy -> getAsset ( ) instanceof VariantSupportInterface ) ] ) ; } catch ( AssetNotFoundExceptionInterface $ e ) { $ this -> throwStatus ( 404 , 'Asset not found' ) ; } catch ( AssetSourceConnectionExceptionInterface $ e ) { $ this -> view -> assign ( 'connectionError' , $ e ) ; } }
Edit an asset

@param string $assetSourceIdentifier
@param string $assetProxyIdentifier
@return void
@throws StopActionException
@throws UnsupportedRequestTypeException
Edit an asset