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 2020/09/15 11:44:29 UTC

[GitHub] [camel-quarkus] JiriOndrusek opened a new pull request #1793: FOP native support #1642

JiriOndrusek opened a new pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793


   Issue: https://github.com/apache/camel-quarkus/issues/1642
   
   @oscerd There is a true type font among files (integration-tests/fop/src/test/resources/Freedom-10eM.ttf ), downloaded from https://www.fontspace.com/freedom-font-f14832 Font is free and is used only as a test resource. This should be acceptable from licence POV. Do you agree?
   
   @ppalaga Fop extension supports only transformation into PDF. As you can see in  extensions/fop/runtime/src/main/doc/limitations.adoc, sRGB color space is disabled and font cache has to be disabled for custom fonts. These two limitations are caused by following issues: 
   
   - Problem with sRGB color space is caused by https://github.com/oracle/graal/issues/2850
   - Problem with font cache is caused by https://github.com/oracle/graal/issues/460
   
   
   [ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
   [ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
   [ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
   [ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
   [ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
   [ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r489234363



##########
File path: extensions/fop/deployment/src/main/java/org/apache/camel/quarkus/component/fop/deployment/FopProcessor.java
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.fop.deployment;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.pdf.PDFDocumentHandlerMaker;
+import org.apache.fop.render.pdf.extensions.PDFExtensionHandlerFactory;
+import org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry;
+import org.jboss.jandex.IndexView;
+
+class FopProcessor {
+
+    private static final String FEATURE = "camel-fop";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        List<String> dtos = index.getKnownClasses().stream()
+                .map(ci -> ci.name().toString())
+                .filter(n -> n.endsWith("ElementMapping"))
+                .sorted()
+                .collect(Collectors.toList());
+
+        dtos.add(PDFExtensionHandlerFactory.class.getCanonicalName());
+        dtos.add(PDFDocumentHandlerMaker.class.getCanonicalName());
+        dtos.add(RendererEventProducer.class.getCanonicalName());
+        dtos.add(IOException.class.getCanonicalName());
+        dtos.add(Integer.class.getCanonicalName());
+
+        return new ReflectiveClassBuildItem(false, false, dtos.toArray(new String[dtos.size()]));
+    }
+
+    @BuildStep
+    void addDependencies(BuildProducer<IndexDependencyBuildItem> indexDependency) {
+        indexDependency.produce(new IndexDependencyBuildItem("org.apache.xmlgraphics", "fop"));
+    }
+
+    @BuildStep
+    NativeImageResourceBuildItem initResources() {
+        return new NativeImageResourceBuildItem(
+                "META-INF/services/org.apache.fop.fo.ElementMapping",
+                "META-INF/services/org.apache.fop.render.intermediate.IFDocumentHandler",
+                "org/apache/fop/render/event-model.xml");
+    }
+
+    @BuildStep
+    NativeImageResourceBundleBuildItem initBundles() {
+        return new NativeImageResourceBundleBuildItem(
+                "com.sun.org.apache.xerces.internal.impl.msg.SAXMessages");

Review comment:
       @ppalaga I've noticed, that this bundle was used only during an exception, which was happening during my investigation. It is not necessary. I've removed it. 
   But I'd like to add this resource via https://github.com/apache/camel-quarkus/issues/1796 into cq jaxp component, because it could help a much during implementation. (without this bundle proper error message is not visible)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r489232353



##########
File path: extensions/fop/runtime/src/main/doc/limitations.adoc
##########
@@ -0,0 +1,12 @@
+While you can use any of the available output types in JVM mode, only PDF output type is supported
+in native mode. PDF output type in native mode has several limitations:
+
+* Default sRGB color space is disabled because of https://github.com/oracle/graal/issues/2850[Graal VM issue #2850]. This limitation makes configuration property
+`disable-srgb-colorspace` ignored. You can see more about sRGB color space in
+https://xmlgraphics.apache.org/fop/2.1/configuration.html[FOP configuration].

Review comment:
       done




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r488607574



##########
File path: extensions/fop/runtime/src/main/resources/META-INF/native-image/proxy-config.json
##########
@@ -0,0 +1,3 @@
+[
+  ["org.apache.fop.render.RendererEventProducer"]

Review comment:
       @jamesnetherton I was looking for a build Item, with this functionality, I'll refactor it.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r488611692



##########
File path: extensions/fop/deployment/src/main/java/org/apache/camel/quarkus/component/fop/deployment/FopProcessor.java
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.fop.deployment;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.pdf.PDFDocumentHandlerMaker;
+import org.apache.fop.render.pdf.extensions.PDFExtensionHandlerFactory;
+import org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry;
+import org.jboss.jandex.IndexView;
+
+class FopProcessor {
+
+    private static final String FEATURE = "camel-fop";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        List<String> dtos = index.getKnownClasses().stream()
+                .map(ci -> ci.name().toString())
+                .filter(n -> n.endsWith("ElementMapping"))
+                .sorted()
+                .collect(Collectors.toList());
+
+        dtos.add(PDFExtensionHandlerFactory.class.getCanonicalName());
+        dtos.add(PDFDocumentHandlerMaker.class.getCanonicalName());
+        dtos.add(RendererEventProducer.class.getCanonicalName());
+        dtos.add(IOException.class.getCanonicalName());
+        dtos.add(Integer.class.getCanonicalName());
+
+        return new ReflectiveClassBuildItem(false, false, dtos.toArray(new String[dtos.size()]));
+    }
+
+    @BuildStep
+    void addDependencies(BuildProducer<IndexDependencyBuildItem> indexDependency) {
+        indexDependency.produce(new IndexDependencyBuildItem("org.jboss.logging", "commons-logging-jboss-logging"));

Review comment:
       Good catch. It seems to be unwanted relic from some of my test runs. I'll check it.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r489232046



##########
File path: extensions/fop/runtime/src/main/doc/limitations.adoc
##########
@@ -0,0 +1,12 @@
+While you can use any of the available output types in JVM mode, only PDF output type is supported
+in native mode. PDF output type in native mode has several limitations:
+
+* Default sRGB color space is disabled because of https://github.com/oracle/graal/issues/2850[Graal VM issue #2850]. This limitation makes configuration property
+`disable-srgb-colorspace` ignored. You can see more about sRGB color space in
+https://xmlgraphics.apache.org/fop/2.1/configuration.html[FOP configuration].
+
+* If custom fonts are used, font cache has to be disabled because of https://github.com/oracle/graal/issues/460[Graal VM issue #460].
+Please use property `<use-cache>false</use-cache>` (more information in https://xmlgraphics.apache.org/fop/2.1/configuration.html[FOP configuration].)

Review comment:
       done

##########
File path: extensions/fop/runtime/src/main/doc/limitations.adoc
##########
@@ -0,0 +1,12 @@
+While you can use any of the available output types in JVM mode, only PDF output type is supported
+in native mode. PDF output type in native mode has several limitations:
+
+* Default sRGB color space is disabled because of https://github.com/oracle/graal/issues/2850[Graal VM issue #2850]. This limitation makes configuration property
+`disable-srgb-colorspace` ignored. You can see more about sRGB color space in
+https://xmlgraphics.apache.org/fop/2.1/configuration.html[FOP configuration].
+
+* If custom fonts are used, font cache has to be disabled because of https://github.com/oracle/graal/issues/460[Graal VM issue #460].
+Please use property `<use-cache>false</use-cache>` (more information in https://xmlgraphics.apache.org/fop/2.1/configuration.html[FOP configuration].)

Review comment:
       done




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r488749919



##########
File path: extensions/fop/deployment/src/main/java/org/apache/camel/quarkus/component/fop/deployment/FopProcessor.java
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.fop.deployment;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.pdf.PDFDocumentHandlerMaker;
+import org.apache.fop.render.pdf.extensions.PDFExtensionHandlerFactory;
+import org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry;
+import org.jboss.jandex.IndexView;
+
+class FopProcessor {
+
+    private static final String FEATURE = "camel-fop";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        List<String> dtos = index.getKnownClasses().stream()
+                .map(ci -> ci.name().toString())
+                .filter(n -> n.endsWith("ElementMapping"))
+                .sorted()
+                .collect(Collectors.toList());
+
+        dtos.add(PDFExtensionHandlerFactory.class.getCanonicalName());
+        dtos.add(PDFDocumentHandlerMaker.class.getCanonicalName());
+        dtos.add(RendererEventProducer.class.getCanonicalName());
+        dtos.add(IOException.class.getCanonicalName());
+        dtos.add(Integer.class.getCanonicalName());
+
+        return new ReflectiveClassBuildItem(false, false, dtos.toArray(new String[dtos.size()]));
+    }
+
+    @BuildStep
+    void addDependencies(BuildProducer<IndexDependencyBuildItem> indexDependency) {
+        indexDependency.produce(new IndexDependencyBuildItem("org.apache.xmlgraphics", "fop"));
+    }
+
+    @BuildStep
+    NativeImageResourceBuildItem initResources() {
+        return new NativeImageResourceBuildItem(
+                "META-INF/services/org.apache.fop.fo.ElementMapping",
+                "META-INF/services/org.apache.fop.render.intermediate.IFDocumentHandler",
+                "org/apache/fop/render/event-model.xml");
+    }
+
+    @BuildStep
+    NativeImageResourceBundleBuildItem initBundles() {
+        return new NativeImageResourceBundleBuildItem(
+                "com.sun.org.apache.xerces.internal.impl.msg.SAXMessages");

Review comment:
       I have filed a follow up: https://github.com/apache/camel-quarkus/issues/1796 Could you please pick it @JiriOndrusek ?

##########
File path: extensions/fop/deployment/src/main/java/org/apache/camel/quarkus/component/fop/deployment/FopProcessor.java
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.fop.deployment;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.pdf.PDFDocumentHandlerMaker;
+import org.apache.fop.render.pdf.extensions.PDFExtensionHandlerFactory;
+import org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry;
+import org.jboss.jandex.IndexView;
+
+class FopProcessor {
+
+    private static final String FEATURE = "camel-fop";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        List<String> dtos = index.getKnownClasses().stream()
+                .map(ci -> ci.name().toString())
+                .filter(n -> n.endsWith("ElementMapping"))
+                .sorted()
+                .collect(Collectors.toList());
+
+        dtos.add(PDFExtensionHandlerFactory.class.getCanonicalName());

Review comment:
       `class.getCanonicalName()` is not wrong here where it is called on a non-inner class. We should stick to `class.getName()` that is correct also for inner classes. I mean when ppl will copy-paste from here, it may not work for them in all situations.

##########
File path: extensions/fop/runtime/src/main/doc/limitations.adoc
##########
@@ -0,0 +1,12 @@
+While you can use any of the available output types in JVM mode, only PDF output type is supported
+in native mode. PDF output type in native mode has several limitations:
+
+* Default sRGB color space is disabled because of https://github.com/oracle/graal/issues/2850[Graal VM issue #2850]. This limitation makes configuration property
+`disable-srgb-colorspace` ignored. You can see more about sRGB color space in
+https://xmlgraphics.apache.org/fop/2.1/configuration.html[FOP configuration].
+
+* If custom fonts are used, font cache has to be disabled because of https://github.com/oracle/graal/issues/460[Graal VM issue #460].
+Please use property `<use-cache>false</use-cache>` (more information in https://xmlgraphics.apache.org/fop/2.1/configuration.html[FOP configuration].)

Review comment:
       ```suggestion
   Please set the https://xmlgraphics.apache.org/fop/2.1/configuration.html[FOP configuration property] `use-cache` to `false`.
   ```

##########
File path: extensions/fop/runtime/src/main/doc/limitations.adoc
##########
@@ -0,0 +1,12 @@
+While you can use any of the available output types in JVM mode, only PDF output type is supported
+in native mode. PDF output type in native mode has several limitations:
+
+* Default sRGB color space is disabled because of https://github.com/oracle/graal/issues/2850[Graal VM issue #2850]. This limitation makes configuration property
+`disable-srgb-colorspace` ignored. You can see more about sRGB color space in
+https://xmlgraphics.apache.org/fop/2.1/configuration.html[FOP configuration].

Review comment:
       ```suggestion
   * Default sRGB color space is always disabled because of https://github.com/oracle/graal/issues/2850[Graal VM issue #2850] and `disable-srgb-colorspace` https://xmlgraphics.apache.org/fop/2.1/configuration.html[FOP configuration property] is ignored.
   ```

##########
File path: extensions/fop/runtime/src/main/java/org/apache/camel/quarkus/component/fop/PDFRendererOptionsConfigSubstitution.java
##########
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.fop;
+
+import com.oracle.svm.core.annotate.Substitute;
+import com.oracle.svm.core.annotate.TargetClass;
+import org.apache.fop.render.pdf.PDFRendererOptionsConfig;
+
+@TargetClass(value = PDFRendererOptionsConfig.class)
+final class PDFRendererOptionsConfigSubstitution {
+
+    @Substitute
+    public Boolean getDisableSRGBColorSpace() {
+        //sRGB color space has to be disabled because of https://github.com/oracle/graal/issues/2850

Review comment:
       I appreciate the comment!




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r488743617



##########
File path: extensions/fop/runtime/src/main/resources/META-INF/native-image/proxy-config.json
##########
@@ -0,0 +1,3 @@
+[
+  ["org.apache.fop.render.RendererEventProducer"]

Review comment:
       @JiriOndrusek you may want to upvote https://github.com/quarkusio/quarkus/issues/9945 :)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#issuecomment-692677618


   @oscerd @ppalaga Should I mention somewhere, where the font comes from?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r489234532



##########
File path: extensions/fop/runtime/src/main/java/org/apache/camel/quarkus/component/fop/PDFRendererOptionsConfigSubstitution.java
##########
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.fop;
+
+import com.oracle.svm.core.annotate.Substitute;
+import com.oracle.svm.core.annotate.TargetClass;
+import org.apache.fop.render.pdf.PDFRendererOptionsConfig;
+
+@TargetClass(value = PDFRendererOptionsConfig.class)
+final class PDFRendererOptionsConfigSubstitution {
+
+    @Substitute
+    public Boolean getDisableSRGBColorSpace() {
+        //sRGB color space has to be disabled because of https://github.com/oracle/graal/issues/2850

Review comment:
       thanks




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r488603111



##########
File path: extensions/fop/deployment/src/main/java/org/apache/camel/quarkus/component/fop/deployment/FopProcessor.java
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.fop.deployment;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.pdf.PDFDocumentHandlerMaker;
+import org.apache.fop.render.pdf.extensions.PDFExtensionHandlerFactory;
+import org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry;
+import org.jboss.jandex.IndexView;
+
+class FopProcessor {
+
+    private static final String FEATURE = "camel-fop";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        List<String> dtos = index.getKnownClasses().stream()
+                .map(ci -> ci.name().toString())
+                .filter(n -> n.endsWith("ElementMapping"))
+                .sorted()
+                .collect(Collectors.toList());
+
+        dtos.add(PDFExtensionHandlerFactory.class.getCanonicalName());
+        dtos.add(PDFDocumentHandlerMaker.class.getCanonicalName());
+        dtos.add(RendererEventProducer.class.getCanonicalName());
+        dtos.add(IOException.class.getCanonicalName());
+        dtos.add(Integer.class.getCanonicalName());
+
+        return new ReflectiveClassBuildItem(false, false, dtos.toArray(new String[dtos.size()]));
+    }
+
+    @BuildStep
+    void addDependencies(BuildProducer<IndexDependencyBuildItem> indexDependency) {
+        indexDependency.produce(new IndexDependencyBuildItem("org.jboss.logging", "commons-logging-jboss-logging"));

Review comment:
       Just curious - why do we need to index `commons-logging-jboss-logging`?

##########
File path: extensions/fop/runtime/src/main/resources/META-INF/native-image/proxy-config.json
##########
@@ -0,0 +1,3 @@
+[
+  ["org.apache.fop.render.RendererEventProducer"]

Review comment:
       Could `NativeImageProxyDefinitionBuildItem` be used here instead of `proxy-config.json`.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r489233081



##########
File path: extensions/fop/deployment/src/main/java/org/apache/camel/quarkus/component/fop/deployment/FopProcessor.java
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.fop.deployment;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.pdf.PDFDocumentHandlerMaker;
+import org.apache.fop.render.pdf.extensions.PDFExtensionHandlerFactory;
+import org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry;
+import org.jboss.jandex.IndexView;
+
+class FopProcessor {
+
+    private static final String FEATURE = "camel-fop";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        List<String> dtos = index.getKnownClasses().stream()
+                .map(ci -> ci.name().toString())
+                .filter(n -> n.endsWith("ElementMapping"))
+                .sorted()
+                .collect(Collectors.toList());
+
+        dtos.add(PDFExtensionHandlerFactory.class.getCanonicalName());

Review comment:
       done




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r488619232



##########
File path: extensions/fop/runtime/src/main/resources/META-INF/native-image/proxy-config.json
##########
@@ -0,0 +1,3 @@
+[
+  ["org.apache.fop.render.RendererEventProducer"]

Review comment:
       Done

##########
File path: extensions/fop/deployment/src/main/java/org/apache/camel/quarkus/component/fop/deployment/FopProcessor.java
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.fop.deployment;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.pdf.PDFDocumentHandlerMaker;
+import org.apache.fop.render.pdf.extensions.PDFExtensionHandlerFactory;
+import org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry;
+import org.jboss.jandex.IndexView;
+
+class FopProcessor {
+
+    private static final String FEATURE = "camel-fop";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        List<String> dtos = index.getKnownClasses().stream()
+                .map(ci -> ci.name().toString())
+                .filter(n -> n.endsWith("ElementMapping"))
+                .sorted()
+                .collect(Collectors.toList());
+
+        dtos.add(PDFExtensionHandlerFactory.class.getCanonicalName());
+        dtos.add(PDFDocumentHandlerMaker.class.getCanonicalName());
+        dtos.add(RendererEventProducer.class.getCanonicalName());
+        dtos.add(IOException.class.getCanonicalName());
+        dtos.add(Integer.class.getCanonicalName());
+
+        return new ReflectiveClassBuildItem(false, false, dtos.toArray(new String[dtos.size()]));
+    }
+
+    @BuildStep
+    void addDependencies(BuildProducer<IndexDependencyBuildItem> indexDependency) {
+        indexDependency.produce(new IndexDependencyBuildItem("org.jboss.logging", "commons-logging-jboss-logging"));

Review comment:
       Done




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga merged pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
ppalaga merged pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#discussion_r489234363



##########
File path: extensions/fop/deployment/src/main/java/org/apache/camel/quarkus/component/fop/deployment/FopProcessor.java
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.fop.deployment;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.pdf.PDFDocumentHandlerMaker;
+import org.apache.fop.render.pdf.extensions.PDFExtensionHandlerFactory;
+import org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry;
+import org.jboss.jandex.IndexView;
+
+class FopProcessor {
+
+    private static final String FEATURE = "camel-fop";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        List<String> dtos = index.getKnownClasses().stream()
+                .map(ci -> ci.name().toString())
+                .filter(n -> n.endsWith("ElementMapping"))
+                .sorted()
+                .collect(Collectors.toList());
+
+        dtos.add(PDFExtensionHandlerFactory.class.getCanonicalName());
+        dtos.add(PDFDocumentHandlerMaker.class.getCanonicalName());
+        dtos.add(RendererEventProducer.class.getCanonicalName());
+        dtos.add(IOException.class.getCanonicalName());
+        dtos.add(Integer.class.getCanonicalName());
+
+        return new ReflectiveClassBuildItem(false, false, dtos.toArray(new String[dtos.size()]));
+    }
+
+    @BuildStep
+    void addDependencies(BuildProducer<IndexDependencyBuildItem> indexDependency) {
+        indexDependency.produce(new IndexDependencyBuildItem("org.apache.xmlgraphics", "fop"));
+    }
+
+    @BuildStep
+    NativeImageResourceBuildItem initResources() {
+        return new NativeImageResourceBuildItem(
+                "META-INF/services/org.apache.fop.fo.ElementMapping",
+                "META-INF/services/org.apache.fop.render.intermediate.IFDocumentHandler",
+                "org/apache/fop/render/event-model.xml");
+    }
+
+    @BuildStep
+    NativeImageResourceBundleBuildItem initBundles() {
+        return new NativeImageResourceBundleBuildItem(
+                "com.sun.org.apache.xerces.internal.impl.msg.SAXMessages");

Review comment:
       @ppalaga I've noticed, that this bundle was used only during an exception, which was happening during my investigation. It is not necessary. I've removed it. 
   But I'd like to add this resource via https://github.com/apache/camel-quarkus/issues/1796 into cq jaxp component, because it could help a much during implementation. (without this bundle there is another error message in log)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] oscerd commented on pull request #1793: FOP native support #1642

Posted by GitBox <gi...@apache.org>.
oscerd commented on pull request #1793:
URL: https://github.com/apache/camel-quarkus/pull/1793#issuecomment-692794999


   > @oscerd @ppalaga Should I mention somewhere, where the font comes from?
   
   If it's only for tests, there is no need to add notes


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org