Skip to content

Adds conditional templates as well as parametrized callable templates (TEDEFO-4370)#115

Merged
rousso merged 2 commits intodevelopfrom
TEDEFO-4370-callable-templates
Jun 2, 2025
Merged

Adds conditional templates as well as parametrized callable templates (TEDEFO-4370)#115
rousso merged 2 commits intodevelopfrom
TEDEFO-4370-callable-templates

Conversation

@rousso
Copy link
Copy Markdown
Contributor

@rousso rousso commented Jun 1, 2025

New features:

  • LET template:name(params) DISPLAY syntax for definitions
  • INVOKE template-name(args) syntax for calls
  • WHEN condition DISPLAY/INVOKE template OTHERWISE ...
  • Deprecates/replaces some members of the MarkupGenerator

… (TEDEFO-4370)

New features:
- LET template:name(params) DISPLAY syntax for definitions
- INVOKE template-name(args) syntax for calls
- WHEN condition DISPLAY/INVOKE template OTHERWISE ...
- Deprecates/replaces some members of the MarkupGenerator
@rousso rousso requested a review from rouschr June 1, 2025 22:29
@rousso rousso self-assigned this Jun 1, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for conditional templates and parameterized callable templates while refactoring the underlying model to use the new variables and parsed parameter/argument classes. Key changes include:

  • Introduction of TemplateInvocation and TemplateDefinition classes that extend ContentBlock with new rendering semantics.
  • Refactoring ContentBlock and related classes to use ParsedParameters, ParsedArguments, and Updated Variables.
  • Improvements to exception handling and deprecation of outdated methods in MarkupGenerator and related modules.

Reviewed Changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/eu/europa/ted/efx/model/templates/TemplateInvocation.java New implementation for template invocations using new argument handling.
src/main/java/eu/europa/ted/efx/model/templates/TemplateDefinition.java New template definition implementation that integrates with the refactored ContentBlock.
src/main/java/eu/europa/ted/efx/model/templates/Markup.java Added an isEmpty() helper method.
src/main/java/eu/europa/ted/efx/model/templates/ContentBlockStack.java Updated child/sibling push methods to use the new Variables and Conditionals.
src/main/java/eu/europa/ted/efx/model/templates/ContentBlock.java Major refactoring to incorporate ParsedParameters, ParsedArguments and updates to rendering methods.
Others (Conditionals, Conditional, Exception classes, interfaces, SdkSymbolResolver, ComponentFactory) Adjustments for updated error handling, naming consistency, and SDK symbol resolution.

Comment thread src/main/java/eu/europa/ted/efx/model/templates/ContentBlock.java
Comment thread src/main/java/eu/europa/ted/efx/interfaces/MarkupGenerator.java Outdated
Comment thread src/main/java/eu/europa/ted/efx/model/variables/ParsedArgument.java Outdated
Comment thread src/main/java/eu/europa/ted/efx/model/templates/ContentBlockStack.java Outdated
Copy link
Copy Markdown
Contributor

@rouschr rouschr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments, cosmetic

@rousso rousso merged commit b1a093f into develop Jun 2, 2025
1 check passed
@rousso rousso deleted the TEDEFO-4370-callable-templates branch June 2, 2025 09:09
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.

3 participants