You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/02/06 11:06:33 UTC
[GitHub] [camel-quarkus] DenisIstomin opened a new pull request #3526: #3503 Add xslt.features support
DenisIstomin opened a new pull request #3526:
URL: https://github.com/apache/camel-quarkus/pull/3526
Related to #3503
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] DenisIstomin commented on a change in pull request #3526: #3503 Add xslt.features support
Posted by GitBox <gi...@apache.org>.
DenisIstomin commented on a change in pull request #3526:
URL: https://github.com/apache/camel-quarkus/pull/3526#discussion_r801510132
##########
File path: integration-tests/xml/src/main/resources/application.properties
##########
@@ -24,3 +24,4 @@ quarkus.log.category."org.apache.camel.quarkus.core.deployment".level = INFO
# Quarkus - Camel
#
quarkus.camel.xslt.sources = xslt/classpath-transform.xsl,xslt/html-transform.xsl,xslt/html-to-text.xsl
+quarkus.camel.xslt.features."http\://javax.xml.XMLConstants/feature/secure-processing" = true
Review comment:
Thanks, right now after I added a new integration test it should be `false` to make extension functions work.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] DenisIstomin commented on pull request #3526: #3503 Add xslt.features support
Posted by GitBox <gi...@apache.org>.
DenisIstomin commented on pull request #3526:
URL: https://github.com/apache/camel-quarkus/pull/3526#issuecomment-1032483438
Thanks @ppalaga, added an integration test for the extension functions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] DenisIstomin commented on a change in pull request #3526: #3503 Add xslt.features support
Posted by GitBox <gi...@apache.org>.
DenisIstomin commented on a change in pull request #3526:
URL: https://github.com/apache/camel-quarkus/pull/3526#discussion_r801508893
##########
File path: extensions/xslt/runtime/src/main/java/org/apache/camel/quarkus/component/xslt/CamelXsltRecorder.java
##########
@@ -52,16 +59,27 @@ public void addRuntimeUriResolverEntry(RuntimeValue<RuntimeUriResolver.Builder>
private final String packageName;
private final RuntimeUriResolver uriResolver;
+ private final Map<String, Boolean> features;
- public QuarkusTransformerFactoryConfigurationStrategy(String packageName, RuntimeUriResolver uriResolver) {
+ public QuarkusTransformerFactoryConfigurationStrategy(String packageName, Map<String, Boolean> features,
+ RuntimeUriResolver uriResolver) {
this.uriResolver = uriResolver;
this.packageName = packageName;
+ this.features = features;
}
@Override
public void configure(TransformerFactory tf, XsltEndpoint endpoint) {
final String className = uriResolver.getTransletClassName(endpoint.getResourceUri());
+ for (Map.Entry<String, Boolean> entry : features.entrySet()) {
+ try {
+ tf.setFeature(entry.getKey(), entry.getValue());
+ } catch (TransformerException e) {
+ LOGGER.warn("Unsupported TransformerFactory feature {}", entry.getKey());
Review comment:
Thanks, fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on pull request #3526: #3503 Add xslt.features support
Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #3526:
URL: https://github.com/apache/camel-quarkus/pull/3526#issuecomment-1032501877
Great work, thanks @DenisIstomin !
I am checking locally, whether I can make loading the functions from the current project work.
FWIW, it works in native mode because the classloader there is flat.
I have sent https://github.com/apache/camel-quarkus/pull/3533 to unblock building this and other PRs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga edited a comment on pull request #3526: #3503 Add xslt.features support
Posted by GitBox <gi...@apache.org>.
ppalaga edited a comment on pull request #3526:
URL: https://github.com/apache/camel-quarkus/pull/3526#issuecomment-1032535928
> I am checking locally, whether I can make loading the functions from the current project work.
> FWIW, it works in native mode because the classloader there is flat.
I think this is caused by the fact that TransformerFactory class is resolved using a wrong class loader around here in Camel https://github.com/apache/camel/blob/camel-3.15.0/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java#L372
I'd say this PR is good to go like this with the known limitation.
I have filed a followup issue https://github.com/apache/camel-quarkus/issues/3534 for the class loading problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on pull request #3526: #3503 Add xslt.features support
Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #3526:
URL: https://github.com/apache/camel-quarkus/pull/3526#issuecomment-1032535928
> I am checking locally, whether I can make loading the functions from the current project work.
> FWIW, it works in native mode because the classloader there is flat.
I think this is caused by the fact that TransformerFactory class is resolved using a wrong class loader around here in Camel https://github.com/apache/camel/blob/camel-3.15.0/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java#L372
I'd say this PR is good to go like this with the known limitation and I'll file a followup issue for the class loading problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga merged pull request #3526: #3503 Add xslt.features support
Posted by GitBox <gi...@apache.org>.
ppalaga merged pull request #3526:
URL: https://github.com/apache/camel-quarkus/pull/3526
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #3526: #3503 Add xslt.features support
Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #3526:
URL: https://github.com/apache/camel-quarkus/pull/3526#discussion_r800787974
##########
File path: extensions/xslt/runtime/src/main/java/org/apache/camel/quarkus/component/xslt/CamelXsltRecorder.java
##########
@@ -52,16 +59,27 @@ public void addRuntimeUriResolverEntry(RuntimeValue<RuntimeUriResolver.Builder>
private final String packageName;
private final RuntimeUriResolver uriResolver;
+ private final Map<String, Boolean> features;
- public QuarkusTransformerFactoryConfigurationStrategy(String packageName, RuntimeUriResolver uriResolver) {
+ public QuarkusTransformerFactoryConfigurationStrategy(String packageName, Map<String, Boolean> features,
+ RuntimeUriResolver uriResolver) {
this.uriResolver = uriResolver;
this.packageName = packageName;
+ this.features = features;
}
@Override
public void configure(TransformerFactory tf, XsltEndpoint endpoint) {
final String className = uriResolver.getTransletClassName(endpoint.getResourceUri());
+ for (Map.Entry<String, Boolean> entry : features.entrySet()) {
+ try {
+ tf.setFeature(entry.getKey(), entry.getValue());
+ } catch (TransformerException e) {
+ LOGGER.warn("Unsupported TransformerFactory feature {}", entry.getKey());
Review comment:
I'd vote for re-throwing if the feature cannot be set
```suggestion
throw new RuntimeException("Could not set TransformerFactory feature '"+ entry.getKey() +"' = " + entry.getValue(), e);
```
##########
File path: integration-tests/xml/src/main/resources/application.properties
##########
@@ -24,3 +24,4 @@ quarkus.log.category."org.apache.camel.quarkus.core.deployment".level = INFO
# Quarkus - Camel
#
quarkus.camel.xslt.sources = xslt/classpath-transform.xsl,xslt/html-transform.xsl,xslt/html-to-text.xsl
+quarkus.camel.xslt.features."http\://javax.xml.XMLConstants/feature/secure-processing" = true
Review comment:
This change is not necessary because `true` is the default, no?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus] ppalaga commented on pull request #3526: #3503 Add xslt.features support
Posted by GitBox <gi...@apache.org>.
ppalaga commented on pull request #3526:
URL: https://github.com/apache/camel-quarkus/pull/3526#issuecomment-1032726626
The CI build should work now. Could you please squash your two commits, rebase on top of the recent master and force-push? - That should re-trigger the CI for this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org