Skip to content

Commit 7b9b5aa

Browse files
committed
Merge remote-tracking branch 'origin/1.x' into 1.x
2 parents 197d8d2 + 0b77f48 commit 7b9b5aa

110 files changed

Lines changed: 2924 additions & 77 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"league/csv": "^9.22",
2222
"nesbot/carbon": "^3.8.4",
2323
"pimcore/static-resolver-bundle": "2.x-dev",
24-
"pimcore/generic-data-index-bundle": "dev-doctrine-v4-support",
24+
"pimcore/generic-data-index-bundle": "2.x-dev",
2525
"pimcore/pimcore": "^12.x-dev",
2626
"zircote/swagger-php": "^4.8 || ^5.0",
2727
"ext-zip": "*",

config/class.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,5 @@ services:
5454
Pimcore\Bundle\StudioBackendBundle\Class\Hydrator\CustomLayout\CustomLayoutHydratorInterface:
5555
class: Pimcore\Bundle\StudioBackendBundle\Class\Hydrator\CustomLayout\CustomLayoutHydrator
5656

57+
Pimcore\Bundle\StudioBackendBundle\Class\Hydrator\Folder\ClassDefinitionFolderItemHydratorInterface:
58+
class: Pimcore\Bundle\StudioBackendBundle\Class\Hydrator\Folder\ClassDefinitionFolderItemHydrator

config/data_objects.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ services:
5353
Pimcore\Bundle\StudioBackendBundle\DataObject\Service\Data\RelationDataServiceInterface:
5454
class: Pimcore\Bundle\StudioBackendBundle\DataObject\Service\Data\RelationDataService
5555

56-
5756
#
5857
# Legacy Services
5958
#

config/grid.yaml

Lines changed: 153 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ services:
5151
Pimcore\Bundle\StudioBackendBundle\Grid\Service\UpdateConfigurationServiceInterface:
5252
class: Pimcore\Bundle\StudioBackendBundle\Grid\Service\UpdateConfigurationService
5353

54+
Pimcore\Bundle\StudioBackendBundle\Grid\Service\GridSearchServiceInterface:
55+
class: Pimcore\Bundle\StudioBackendBundle\Grid\Service\GridSearchService
56+
5457
#
5558
# Repository
5659
#
@@ -123,8 +126,156 @@ services:
123126
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\Metadata\DataObjectDefinition:
124127
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
125128

126-
Pimcore\Bundle\StudioBackendBundle\Grid\Service\GridSearchServiceInterface:
127-
class: Pimcore\Bundle\StudioBackendBundle\Grid\Service\GridSearchService
129+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\InputDefinition:
130+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
131+
132+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\TextareaDefinition:
133+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
134+
135+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\WysiwygDefinition:
136+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
137+
138+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\PasswordDefinition:
139+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
140+
141+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\InputQuantityValueDefinition:
142+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
143+
144+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\NumericDefinition:
145+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
146+
147+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\NumericRangeDefinition:
148+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
149+
150+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\SliderDefinition:
151+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
152+
153+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\QuantityValueDefinition:
154+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
155+
156+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\QuantityValueRangeDefinition:
157+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
158+
159+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\BooleanSelectDefinition:
160+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
161+
162+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\SelectDefinition:
163+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
164+
165+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\UserDefinition:
166+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
167+
168+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\CountryDefinition:
169+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
170+
171+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\LanguageDefinition:
172+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
173+
174+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\MultiselectDefinition:
175+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
176+
177+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\CountryMultiselectDefinition:
178+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
179+
180+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\LanguageMultiselectDefinition:
181+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
182+
183+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\DateDefinition:
184+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
185+
186+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\DateTimeDefinition:
187+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
188+
189+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\DateRangeDefinition:
190+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
191+
192+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\TimeDefinition:
193+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
194+
195+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\ImageDefinition:
196+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
197+
198+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\HotSpotImageDefinition:
199+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
200+
201+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\ImageGalleryDefinition:
202+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
203+
204+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\ExternalImageDefinition:
205+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
206+
207+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\VideoDefinition:
208+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
209+
210+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\ManyToOneRelationDefinition:
211+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
212+
213+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\ManyToManyRelationDefinition:
214+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
215+
216+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\ManyToManyObjectRelationDefinition:
217+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
218+
219+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\AdvancedManyToManyRelationDefinition:
220+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
221+
222+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\AdvancedManyToManyObjectRelationDefinition:
223+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
224+
225+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\ReverseObjectRelationDefinition:
226+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
227+
228+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\GeopointDefinition:
229+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
230+
231+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\GeoboundsDefinition:
232+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
233+
234+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\GeopolygonDefinition:
235+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
236+
237+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\GeopolylineDefinition:
238+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
239+
240+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\ConsentDefinition:
241+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
242+
243+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\FirstnameDefinition:
244+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
245+
246+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\LastnameDefinition:
247+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
248+
249+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\EmailDefinition:
250+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
251+
252+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\GenderDefinition:
253+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
254+
255+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\TableDefinition:
256+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
257+
258+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\StructuredTableDefinition:
259+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
260+
261+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\RgbaColorDefinition:
262+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
263+
264+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\EncryptedFieldDefinition:
265+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
266+
267+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\UrlSlugDefinition:
268+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
269+
270+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\CheckboxDefinition:
271+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
272+
273+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\LinkDefinition:
274+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
275+
276+
Pimcore\Bundle\StudioBackendBundle\Grid\Column\Definition\DataObject\CalculatedValueDefinition:
277+
tags: [ 'pimcore.studio_backend.grid_column_definition' ]
278+
128279

129280
#
130281
# Column Resolver
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* Pimcore
6+
*
7+
* This source file is available under two different licenses:
8+
* - GNU General Public License version 3 (GPLv3)
9+
* - Pimcore Commercial License (PCL)
10+
* Full copyright and license information is available in
11+
* LICENSE.md which is distributed with this source code.
12+
*
13+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+
* @license http://www.pimcore.org/license GPLv3 and PCL
15+
*/
16+
17+
namespace Pimcore\Bundle\StudioBackendBundle\Class\Controller\Folder;
18+
19+
use OpenApi\Attributes\Get;
20+
use Pimcore\Bundle\StudioBackendBundle\Class\Schema\Folder\ClassDefinitionFolderItem;
21+
use Pimcore\Bundle\StudioBackendBundle\Class\Service\ClassDefinitionServiceInterface;
22+
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;
23+
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\ElementSavingFailedException;
24+
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\ForbiddenException;
25+
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\InvalidElementTypeException;
26+
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\NotFoundException;
27+
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\UserNotFoundException;
28+
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Parameter\Path\IdParameter;
29+
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Property\GenericCollection;
30+
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\Content\CollectionJson;
31+
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\DefaultResponses;
32+
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\SuccessResponse;
33+
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Config\Tags;
34+
use Pimcore\Bundle\StudioBackendBundle\Util\Constant\ElementTypes;
35+
use Pimcore\Bundle\StudioBackendBundle\Util\Constant\HttpResponseCodes;
36+
use Pimcore\Bundle\StudioBackendBundle\Util\Constant\UserPermissions;
37+
use Pimcore\Bundle\StudioBackendBundle\Util\Trait\PaginatedResponseTrait;
38+
use Symfony\Component\HttpFoundation\JsonResponse;
39+
use Symfony\Component\Routing\Attribute\Route;
40+
use Symfony\Component\Security\Http\Attribute\IsGranted;
41+
use Symfony\Component\Serializer\SerializerInterface;
42+
use function count;
43+
44+
/**
45+
* @internal
46+
*/
47+
final class CollectionController extends AbstractApiController
48+
{
49+
use PaginatedResponseTrait;
50+
51+
public function __construct(
52+
SerializerInterface $serializer,
53+
private readonly ClassDefinitionServiceInterface $classDefinitionService,
54+
55+
) {
56+
parent::__construct($serializer);
57+
}
58+
59+
/**
60+
* @throws ElementSavingFailedException
61+
* @throws ForbiddenException
62+
* @throws InvalidElementTypeException
63+
* @throws UserNotFoundException
64+
* @throws NotFoundException
65+
*/
66+
#[Route(
67+
'/class/folder/{folderId}',
68+
name: 'pimcore_studio_api_classes_folder_collection',
69+
requirements: ['folderId' => '\d+'],
70+
methods: ['GET']
71+
)]
72+
#[IsGranted(UserPermissions::DATA_OBJECTS->value)]
73+
#[Get(
74+
path: self::PREFIX . '/class/folder/{folderId}',
75+
operationId: 'class_definition_folder_collection',
76+
description: 'class_definition_folder_collection_description',
77+
summary: 'class_definition_folder_collection_summary',
78+
tags: [Tags::ClassDefinition->value],
79+
)]
80+
#[SuccessResponse(
81+
description: 'class_definition_folder_collection_success_response',
82+
content: new CollectionJson(new GenericCollection(ClassDefinitionFolderItem::class))
83+
)]
84+
#[IdParameter(type: ElementTypes::TYPE_DATA_OBJECT, name: 'folderId')]
85+
#[DefaultResponses([
86+
HttpResponseCodes::FORBIDDEN,
87+
HttpResponseCodes::INTERNAL_SERVER_ERROR,
88+
HttpResponseCodes::UNAUTHORIZED,
89+
HttpResponseCodes::NOT_FOUND,
90+
])]
91+
public function getFolderClassList(
92+
int $folderId
93+
): JsonResponse {
94+
$collection = $this->classDefinitionService->getClassDefinitionIdsInsideFolder($folderId);
95+
96+
return $this->getPaginatedCollection(
97+
$this->serializer,
98+
$collection,
99+
count($collection)
100+
);
101+
}
102+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* Pimcore
6+
*
7+
* This source file is available under two different licenses:
8+
* - GNU General Public License version 3 (GPLv3)
9+
* - Pimcore Commercial License (PCL)
10+
* Full copyright and license information is available in
11+
* LICENSE.md which is distributed with this source code.
12+
*
13+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+
* @license http://www.pimcore.org/license GPLv3 and PCL
15+
*/
16+
17+
namespace Pimcore\Bundle\StudioBackendBundle\Class\Event;
18+
19+
use Pimcore\Bundle\StudioBackendBundle\Class\Schema\Folder\ClassDefinitionFolderItem;
20+
use Pimcore\Bundle\StudioBackendBundle\Event\AbstractPreResponseEvent;
21+
22+
final class ClassDefinitionFolderListEvent extends AbstractPreResponseEvent
23+
{
24+
public const string EVENT_NAME = 'pre_response.class_definition.folder.collection';
25+
26+
public function __construct(private readonly ClassDefinitionFolderItem $classDefinition)
27+
{
28+
parent::__construct($this->classDefinition);
29+
}
30+
31+
public function getClassDefinition(): ClassDefinitionFolderItem
32+
{
33+
return $this->classDefinition;
34+
}
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* Pimcore
6+
*
7+
* This source file is available under two different licenses:
8+
* - GNU General Public License version 3 (GPLv3)
9+
* - Pimcore Commercial License (PCL)
10+
* Full copyright and license information is available in
11+
* LICENSE.md which is distributed with this source code.
12+
*
13+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+
* @license http://www.pimcore.org/license GPLv3 and PCL
15+
*/
16+
17+
namespace Pimcore\Bundle\StudioBackendBundle\Class\Hydrator\Folder;
18+
19+
use Pimcore\Bundle\StudioBackendBundle\Class\Schema\Folder\ClassDefinitionFolderItem;
20+
use Pimcore\Model\DataObject\ClassDefinition;
21+
22+
/**
23+
* @internal
24+
*/
25+
final class ClassDefinitionFolderItemHydrator implements ClassDefinitionFolderItemHydratorInterface
26+
{
27+
public function hydrate(ClassDefinition $cd): ClassDefinitionFolderItem
28+
{
29+
return new ClassDefinitionFolderItem(
30+
$cd->getId(),
31+
$cd->getName(),
32+
$cd->getAllowInherit()
33+
);
34+
}
35+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* Pimcore
6+
*
7+
* This source file is available under two different licenses:
8+
* - GNU General Public License version 3 (GPLv3)
9+
* - Pimcore Commercial License (PCL)
10+
* Full copyright and license information is available in
11+
* LICENSE.md which is distributed with this source code.
12+
*
13+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
14+
* @license http://www.pimcore.org/license GPLv3 and PCL
15+
*/
16+
17+
namespace Pimcore\Bundle\StudioBackendBundle\Class\Hydrator\Folder;
18+
19+
use Pimcore\Bundle\StudioBackendBundle\Class\Schema\Folder\ClassDefinitionFolderItem;
20+
use Pimcore\Model\DataObject\ClassDefinition;
21+
22+
/**
23+
* @internal
24+
*/
25+
interface ClassDefinitionFolderItemHydratorInterface
26+
{
27+
public function hydrate(ClassDefinition $cd): ClassDefinitionFolderItem;
28+
}

0 commit comments

Comments
 (0)