-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
2,804 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
services: | ||
_defaults: | ||
autowire: true | ||
autoconfigure: true | ||
public: false | ||
|
||
# controllers are imported separately to make sure they're public | ||
# and have a tag that allows actions to type-hint services | ||
Pimcore\Bundle\StudioBackendBundle\Version\Controller\: | ||
resource: '../src/Version/Controller' | ||
public: true | ||
tags: [ 'controller.service_arguments' ] | ||
|
||
Pimcore\Bundle\StudioBackendBundle\Version\RepositoryInterface: | ||
class: Pimcore\Bundle\StudioBackendBundle\Version\Repository | ||
|
||
Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\VersionHydratorInterface: | ||
class: Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\VersionHydrator | ||
|
||
# Hydrators | ||
Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\AssetVersionHydratorInterface: | ||
class: Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\AssetVersionHydrator | ||
|
||
Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\DataObjectVersionHydratorInterface: | ||
class: Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\DataObjectVersionHydrator | ||
|
||
Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\DocumentVersionHydratorInterface: | ||
class: Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\DocumentVersionHydrator | ||
|
||
# Publishers | ||
Pimcore\Bundle\StudioBackendBundle\Version\Publisher\AssetVersionPublisherInterface: | ||
class: Pimcore\Bundle\StudioBackendBundle\Version\Publisher\AssetVersionPublisher | ||
|
||
Pimcore\Bundle\StudioBackendBundle\Version\Publisher\DataObjectVersionPublisherInterface: | ||
class: Pimcore\Bundle\StudioBackendBundle\Version\Publisher\DataObjectVersionPublisher | ||
|
||
Pimcore\Bundle\StudioBackendBundle\Version\Publisher\DocumentVersionPublisherInterface: | ||
class: Pimcore\Bundle\StudioBackendBundle\Version\Publisher\DocumentVersionPublisher | ||
|
||
# Services | ||
Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\VersionHydratorServiceInterface: | ||
class: Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\VersionHydratorService | ||
arguments: | ||
$versionHydratorLocator: '@listing.version_hydrator.service_locator' | ||
|
||
Pimcore\Bundle\StudioBackendBundle\Version\Publisher\VersionPublisherServiceInterface: | ||
class: Pimcore\Bundle\StudioBackendBundle\Version\Publisher\VersionPublisherService | ||
arguments: | ||
$versionPublisherLocator: '@version.element_publisher.service_locator' | ||
|
||
#Service Locator | ||
listing.version_hydrator.service_locator: | ||
class: Symfony\Component\DependencyInjection\ServiceLocator | ||
tags: [ 'container.service_locator' ] | ||
arguments: | ||
- Pimcore\Model\Asset: '@Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\AssetVersionHydratorInterface' | ||
Pimcore\Model\DataObject: '@Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\DataObjectVersionHydratorInterface' | ||
Pimcore\Model\Document: '@Pimcore\Bundle\StudioBackendBundle\Version\Hydrator\DocumentVersionHydratorInterface' | ||
|
||
version.element_publisher.service_locator: | ||
class: Symfony\Component\DependencyInjection\ServiceLocator | ||
tags: [ 'container.service_locator' ] | ||
arguments: | ||
- Pimcore\Model\Asset: '@Pimcore\Bundle\StudioBackendBundle\Version\Publisher\AssetVersionPublisherInterface' | ||
Pimcore\Model\DataObject: '@Pimcore\Bundle\StudioBackendBundle\Version\Publisher\DataObjectVersionPublisherInterface' | ||
Pimcore\Model\Document: '@Pimcore\Bundle\StudioBackendBundle\Version\Publisher\DocumentVersionPublisherInterface' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Commercial License (PCL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PCL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\StudioBackendBundle\Exception; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class ElementProcessingNotCompletedException extends AbstractApiException | ||
{ | ||
public function __construct(int $id) | ||
{ | ||
parent::__construct( | ||
202, | ||
sprintf('Element with ID %d was not processed yet', $id) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Commercial License (PCL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PCL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\StudioBackendBundle\Exception; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class ElementPublishingFailedException extends AbstractApiException | ||
{ | ||
public function __construct(int $id, ?string $error = null) | ||
{ | ||
parent::__construct(500, sprintf( | ||
'Failed to publish element with ID %s: %s', | ||
$id, | ||
$error ?? 'Unknown error' | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Commercial License (PCL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PCL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\StudioBackendBundle\Exception; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class ElementUnsafeException extends AbstractApiException | ||
{ | ||
public function __construct(int $id) | ||
{ | ||
parent::__construct( | ||
200, | ||
sprintf('Element with ID %d is not safe to preview', $id) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under following license: | ||
* - Pimcore Commercial License (PCL) | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license PCL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\StudioBackendBundle\Exception; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class InvalidElementTypeException extends AbstractApiException | ||
{ | ||
public function __construct(string $type) | ||
{ | ||
parent::__construct(400, sprintf( | ||
'Invalid element type: %s', | ||
$type | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/OpenApi/Attributes/Parameters/Query/ElementTypeParameter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Commercial License (PCL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PCL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Parameters\Query; | ||
|
||
use Attribute; | ||
use OpenApi\Attributes\QueryParameter; | ||
use OpenApi\Attributes\Schema; | ||
use Pimcore\Bundle\StudioBackendBundle\Util\Constants\ElementTypes; | ||
|
||
#[Attribute(Attribute::TARGET_METHOD)] | ||
final class ElementTypeParameter extends QueryParameter | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct( | ||
name: 'elementType', | ||
description: 'Filter elements by matching element type.', | ||
in: 'query', | ||
required: true, | ||
schema: new Schema( | ||
type: 'string', | ||
enum: [ | ||
ElementTypes::TYPE_OBJECT, | ||
ElementTypes::TYPE_ASSET, | ||
ElementTypes::TYPE_DOCUMENT, | ||
], | ||
example: ElementTypes::TYPE_OBJECT, | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.