-
Notifications
You must be signed in to change notification settings - Fork 84
XRENDERING-803: Add support for overwriting the list of transformations to execute from the transformation context #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ns to execute from the transformation context
xwiki-rendering-api/src/main/java/org/xwiki/rendering/transformation/TransformationContext.java
Outdated
Show resolved
Hide resolved
xwiki-rendering-api/src/main/java/org/xwiki/rendering/transformation/TransformationContext.java
Show resolved
Hide resolved
xwiki-rendering-api/src/main/java/org/xwiki/rendering/transformation/TransformationContext.java
Show resolved
Hide resolved
…ns to execute from the transformation context * Providing an empty list should skip the transformation execution. * Use Optional to make it more clear that the list might not be set on the transformation context.
| * @since 18.1.0RC1 | ||
| */ | ||
| @Unstable | ||
| public Optional<List<String>> getTransformationNames() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the usage of "names" vs "id". AFAIU you'd pass technical id (and more specifically transformation component hints). I consider name to be something more UI-oriented, for users.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong preference, but I wanted to be consistent with the existing RenderingConfiguration#getTransformationNames() that you introduced some years ago :) see 7a396c3#diff-51d5d538d396a9b28f1f6cf6072df259c6d8437a075bf6ee1805c88a7e9d44ae .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hehe touché :)
So indeed we need to decide between consistency or correctness. Hard choice. I personally prefer correctness (so that the software/API improves over time) but I'm also ok to keep the consistency, so I think it's fine to keep it as you did, unless some other devs think we should change it.
Thx
Jira URL
https://jira.xwiki.org/browse/XRENDERING-803
Changes
Description
Adds two methods to the
TransformationContext:Updates the
DefaultTransformationManagerto take into account the new context information.Clarifications
This is needed for the new
$services.rendering.transform()API that will allow specifying the list of transformations to execute.Expected merging strategy