[TASK] Create a REST API Endpoint(s) for Style Properties Management
Description
Implement a REST API endpoint to support the insertion and updating of style properties for Contentlets. The API should provide a clean interface for managing styles while ensuring data consistency and validation against UVE schemas.
-
Create the REST endpoint at /v1/page/{pageId}/styles
Implement PUT endpoint for style properties management Follow dotCMS REST API conventions Ensure proper authentication and authorization
-
Define and implement the request payload structure
Include MultiTree reference attributes:
child - Contentlet identifier parent1 - Container identifier parent2 - Page identifier relation_type - Relationship type personalization - Personalization identifier variant_id - Variant identifier
Include the styles data object Document payload structure with swagger
-
Implement validation for style properties
Validate that styles are consistent with UVE schemas Implement schema validation logic Return appropriate error messages for validation failures
-
Implement business logic for inserting/updating styles
Handle creation of new style entries Handle updates to existing style entries Ensure proper MultiTree reference handling Implement transactional behavior
-
Write comprehensive tests
Unit tests for validation logic Integration tests for API endpoints Test various payload scenarios (valid, invalid, edge cases) Test UVE schema validation Test authentication and authorization
-
Hide this functionality under the feature flag
Ensure endpoint is only active when FEATURE_FLAG_UVE_STYLE_EDITOR feature flag is enabled Return appropriate response when feature is disabled
4.7 Update API documentation
Acceptance Criteria
- [ ] REST endpoint /v1/page/{pageId}/styles is implemented and functional
- [ ] Payload correctly includes all MultiTree reference attributes and styles data
- [ ] Style validation against UVE schemas is working correctly
- [ ] All tests pass (unit and integration)
- [ ] Proper error handling and meaningful error messages are returned
Priority
None
Additional Context
No response
PRs linked to this issue
- Define style properties in a different endpoint by @dario-daza
PRs linked to this issue
- Define style properties in a different endpoint by @dario-daza
- rollback styleProperties changes made in the resource for content definition by @dario-daza
PRs linked to this issue
- 33699 new task create a rest api endpoints for style properties management by @dario-daza
- Define style properties in a different endpoint by @dario-daza
- rollback styleProperties changes made in the resource for content definition by @dario-daza
PRs linked to this issue
- 33699 new task create a rest api endpoints for style properties management by @dario-daza
- Define style properties in a different endpoint by @dario-daza
- implement new styleProperties endpoint in the frontend and fix contai… by @dario-daza
- rollback styleProperties changes made in the resource for content definition by @dario-daza
Passed QA
- dotCMS docker image: [
dotcms/dotcms:trunk]
Video
https://github.com/user-attachments/assets/fc5b6186-5cc9-44fe-a411-6420267f2e2c