Skip to content

Feature/meta data placement - #95

Open
hojalatheef wants to merge 52 commits into
mainfrom
feature/meta-data-placement
Open

Feature/meta data placement#95
hojalatheef wants to merge 52 commits into
mainfrom
feature/meta-data-placement

Conversation

@hojalatheef

Copy link
Copy Markdown
Contributor

Adds mandatory file metadata enforcement to jwtools2. Editors can configure a list of metadata columns (e.g. creator, copyright) that every image must have filled in. The extension then enforces this consistently at every point a missing value could otherwise slip through, and gives editors/admins a way to see and fix the current state across the whole install.

…ingFrameworkLoggerHook

- Introduce readonly `ConnectionPool` via constructor.
- Use `JSON_THROW_ON_ERROR` for safer JSON encoding.
- Replace `mb_strpos` with `str_contains` for cleaner string matching.
- Refactor `getConnectionPool` to use the readonly property.
- Replace `fetch()` with `fetchAssociative()` for consistency.
- Remove redundant variable name in exception catch block.
- Ensure `substr()` operates on string type for better type handling.
…Pool in ExecuteQueryTask

- Introduce readonly properties via constructor for dependency injection.
- Replace `GeneralUtility::makeInstance()` calls with readonly properties for better type safety.
- Add `declare(strict_types=1)` to `ext_localconf.php` for better type safety.
- Register `ValidateFileMetaDataOnSaveHook` if configuration allows.
- Simplify existing conditional configurations for clarity and consistency.
- Add readonly `Registry` property via constructor for dependency injection.
- Replace `getRegistry()` method calls with `this->registry`.
- Remove redundant `getRegistry()` method for cleaner code.
- Introduce readonly `Registry` property via constructor for dependency injection.
- Replace `GeneralUtility::makeInstance()` calls with `this->registry` for improved type safety.
…n and improved file metadata validation

- Introduce readonly `FileMetaDataValidationService` and `FlashMessageService` properties via constructor.
- Replace extension configuration-based column validation with `FileMetaDataValidationService`.
- Simplify logic for checking file validity and required metadata columns.
- Remove redundant methods for cleaner and more maintainable code.
- Add translations for file metadata overview, filters, and actions.
- Update XML structure for consistency and better multilingual support.
… and code simplification

- Introduce readonly properties for `ResourceFactory`, `RendererRegistry`, and `ConnectionPool` via constructor.
- Replace `GeneralUtility::makeInstance()` calls with constructor-injected dependencies.
- Simplify exception handling and improve type safety in method calls.
- Use `in_array` with strict comparison for better code clarity and robustness.
…ction and code optimization

- Introduce readonly `ConnectionPool` property via constructor.
- Replace `GeneralUtility::makeInstance()` calls with constructor dependency.
- Simplify syntax by improving null and empty checks.
…extRunViewHelper

- Refactor `catch` block to omit unused exception variable.
- Remove outdated docblock to align with current coding standards.
- Introduce conditional link for FileMetaData overview module based on extension configuration.
- Introduce readonly `ConnectionPool` property via constructor.
- Replace `GeneralUtility::makeInstance()` calls with constructor-injected `ConnectionPool`.
- Introduce readonly `ConnectionPool` property via constructor.
- Replace `GeneralUtility::makeInstance()` calls with constructor-injected dependency.
- Remove redundant `getConnectionPool()` method.
- Eliminate redundant `ConnectionPool` property and `getConnectionPool()` method.
- Simplify constructor and exception handling by removing unused references.
- Refactor code for better maintainability and alignment with coding standards.
… processing

- Register new hooks for handling translated content elements, caching framework logging, and file metadata validation.
- Add event listeners for replacing invalid metadata images and managing records with invalid metadata.
- Introduce readonly `ModuleTemplateFactory` and `ConnectionPool` properties via constructor.
- Replace `GeneralUtility::makeInstance()` calls with constructor-injected `ConnectionPool`.
- Refactor `catch` blocks to omit unused exception variables.
- Align exception handling with current coding standards.
- Introduce readonly `ConnectionPool` property via constructor.
- Replace `GeneralUtility::makeInstance()` calls with constructor-injected `ConnectionPool`.
- Remove redundant `getConnectionPool()` method for simplified code.
- Replace `get_class()` with modern `$file::class` syntax for improved readability and consistency.
…mand

- Add `string` type declarations for constants.
- Enable `JSON_THROW_ON_ERROR` in `json_decode()` for better error handling.
…and strict type handling

- Use constructor property promotion for `ResourceFactory` and `GraphicalFunctions`.
- Add strict type casting for variables in `updateFileMetadataAction`.
…php file

- Enable `strict_types` mode for improved type safety and consistency.
- Remove unnecessary strict comparison in `$composerMode` assignment.
…ted settings

- Introduce `FileMetaDataController` with initial `list` action in backend module configuration.
- Add new TypoScript settings for handling files with invalid metadata, including placeholder image and automatic record handling.
- Update `ext_conf_template.txt` and `ExtConf.xlf` to reflect new functionality.
- Introduced extensive German translations for `ExtConf.xlf`, backend module labels, and metadata-related features.
- Added localized strings to support improved multilingual functionality.
- Introduced `DisableRecordsWithInvalidFileMetaDataEventListener` to handle events for invalid file metadata.
- Automatically disables or re-enables referencing records based on metadata validation.
- Includes registry-based record tracking and page cache flushing for consistency.
…agination

- Added `FileMetaDataController` to manage file metadata with robust filtering and pagination functionality.
- Includes methods for metadata validation, reference resolution, and query building.
… metadata

- Introduced `FileMetaDataValidationService` to validate file metadata against required columns from extension configuration.
- Provides methods to check missing metadata, validate file types, and improve metadata handling.
- Introduced a new Fluid template to display file metadata in a list format with advanced filtering, pagination, and reference handling.
- Includes support for localized strings, user-friendly filtering controls, and status badges.
- Enhances backend module functionality for managing file metadata dynamically.
- Introduced `FileReferenceResolverService` to handle file reference lookups via `sys_file_reference` and `sys_refindex` tables.
- Includes methods for retrieving direct and indexed file references with support for hidden state filtering.
- Enhances file reference management with robust data resolution.
- Introduced `PlaceholderImageService` to manage dynamic placeholder image generation and caching.
- Handles API requests, file storage, fallback logic, and content type validation.
- Enhances placeholder image handling with robust configuration and error management.
…lid image metadata

- Introduced `ReplaceInvalidMetaDataImageEventListener` to replace frontend images with invalid metadata using placeholder images.
- Validates metadata, replaces invalid images, and processes placeholders with configurable dimensions.
- Ensures functionality is enabled only for frontend requests and configurable via extension settings.
…invalid metadata

- Introduced `ValidateFileMetaDataOnSaveHook` to handle post-save operations in the DataHandler.
- Automatically validates file references' metadata and disables those with invalid metadata.
- Includes detailed logging and extension configuration support for enabling or disabling the functionality.
…tion

- Added TypoScript configuration to display page IDs alongside titles in the page tree.
- Improves clarity and identification of pages in the backend.
…le classes

- Removed unnecessary `string`, `int`, and `array` type declarations for constants in various classes to comply with PHP syntax rules.
- Simplifies code and enhances readability while maintaining functionality.
…multiple classes

- Cleaned up trailing commas in parameter lists, array definitions, and method calls.
- Merged single-line and empty-line constructors for consistency.
- Enhanced code readability and adherence to coding standards.
- Removed `final` keyword from multiple service classes to enhance extensibility.
- Merged metadata properties with file properties in `FileMetaDataValidationService` for comprehensive validation.
- Updated `Services.yaml` to include task definitions for scheduler module support.
…n and test coverage

- Migrated `ExecuteQueryTask` to use constructor injection for `FlashMessageService` and `ConnectionPool`.
- Refactored test setup to mock dependencies directly through the constructor.
- Added new test cases to improve coverage for scenarios like no queries and failing statements.
- Removed outdated use of `GeneralUtility::addInstance`.
…ionService, and PlaceholderImageService

- Introduced unit tests for `FileMetaDataController` to validate helper methods like `getStatus`, `getReferenceScope`, and `getFilters`.
- Added comprehensive tests for `FileMetaDataValidationService` to ensure robust metadata validation logic.
- Implemented tests for `PlaceholderImageService` to verify placeholder image generation, caching, and API integration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant