[jira] [Comment Edited] (FOP-3084) Override baseURI per FOP instance

2022-07-22 Thread Markus Karg (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569828#comment-17569828
 ] 

Markus Karg edited comment on FOP-3084 at 7/22/22 6:19 AM:
---

No I cannot. The user must be free to choose the XSL-FO editor of his own 
choice. The one most of our customer use does not allow to type in arbitrary 
protocols. The reason is that it is a WYSIWYG editor which loads the image to 
show it. That will horribly fail when using an arbitrary schema, so it is a 
no-go.

 

Please do not further try to find quirky workarounds. The idea of this issue is 
to provide a clean and trick-free FOP API.


was (Author: mkarg):
No I cannot. The user must be free to choose the XSL-FO editor of his own 
choice. The one most of our customer use does not allow to type in arbitrary 
protocols.

 

Please do not further try to find quirky workarounds. The idea of this issue is 
to provide a clean and trick-free FOP API.

> Override baseURI per FOP instance
> -
>
> Key: FOP-3084
> URL: https://issues.apache.org/jira/browse/FOP-3084
> Project: FOP
>  Issue Type: Improvement
>Affects Versions: 2.7
>Reporter: Markus Karg
>Priority: Major
>
> There is a best practice to reuse FOP Factory instances for optimal 
> performance. But doing so effectively applies the same baseURI (the one used 
> at factory creation) to all FOP instances, hence to all rendered XSL 
> templates.
>  
> Given the case one needs to render XSL template `/a/A.xfo` referring to a 
> picture file `./A.png` (hence effectively located at `/a/A.png`), and then 
> needs to render XSL template `/b/B.xfo`, referring to a picture file 
> `./B.png` (hence effectively found at `/b/B.png`), then there is no other 
> solution but to create a new FOP Instance per template: On instance for 
> `baseURI=.../a/` and a second instance for `baseURI=.../b/`. This effectively 
> results in rather bad performance!
>  
> To support this use case while keeping optimal performance (hence: use a 
> single FOP factory), there should be a way to pass the baseURI of the 
> rendered XSL template to the FOP Factory, so creating a new FOP instances 
> effectively use different baseURIs to resolve images. In the past, there had 
> been a `FOP.setBaseURI(baseURI)` method for this. Clearly that method was a 
> very bad idea, as concurrent callers ended up in a race condition. So 
> reintroducing `FOP.setBaseURI(baseURI)` is *definitively not* a viable 
> solution!
>  
> Proposed solutions could be to either add an optional parameter baseURI to 
> `FOPFactory.newFOP(..., baseURI)`, _or_ to add a new method 
> `FOP.setBaseURI(baseURI)` to FOP, _or_ to add a new method 
> `FOUserAgent.setBaseURI(baseURI)`.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3084) Override baseURI per FOP instance

2022-07-21 Thread Simon Steiner (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569630#comment-17569630
 ] 

Simon Steiner edited comment on FOP-3084 at 7/21/22 6:16 PM:
-

in the external-graphic src you can use your own protocol, xyz://path/my.jpg ?


was (Author: ssteiner1):
in the FO you can use your own protocol, xyz://path/my.jpg ?

> Override baseURI per FOP instance
> -
>
> Key: FOP-3084
> URL: https://issues.apache.org/jira/browse/FOP-3084
> Project: FOP
>  Issue Type: Improvement
>Affects Versions: 2.7
>Reporter: Markus Karg
>Priority: Major
>
> There is a best practice to reuse FOP Factory instances for optimal 
> performance. But doing so effectively applies the same baseURI (the one used 
> at factory creation) to all FOP instances, hence to all rendered XSL 
> templates.
>  
> Given the case one needs to render XSL template `/a/A.xfo` referring to a 
> picture file `./A.png` (hence effectively located at `/a/A.png`), and then 
> needs to render XSL template `/b/B.xfo`, referring to a picture file 
> `./B.png` (hence effectively found at `/b/B.png`), then there is no other 
> solution but to create a new FOP Instance per template: On instance for 
> `baseURI=.../a/` and a second instance for `baseURI=.../b/`. This effectively 
> results in rather bad performance!
>  
> To support this use case while keeping optimal performance (hence: use a 
> single FOP factory), there should be a way to pass the baseURI of the 
> rendered XSL template to the FOP Factory, so creating a new FOP instances 
> effectively use different baseURIs to resolve images. In the past, there had 
> been a `FOP.setBaseURI(baseURI)` method for this. Clearly that method was a 
> very bad idea, as concurrent callers ended up in a race condition. So 
> reintroducing `FOP.setBaseURI(baseURI)` is *definitively not* a viable 
> solution!
>  
> Proposed solutions could be to either add an optional parameter baseURI to 
> `FOPFactory.newFOP(..., baseURI)`, _or_ to add a new method 
> `FOP.setBaseURI(baseURI)` to FOP, _or_ to add a new method 
> `FOUserAgent.setBaseURI(baseURI)`.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3084) Override baseURI per FOP instance

2022-07-21 Thread Markus Karg (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17569369#comment-17569369
 ] 

Markus Karg edited comment on FOP-3084 at 7/21/22 11:41 AM:


How should that work in a multithreaded environment? As the same resolver 
instance is attached with the singleton factory, two concurrent threads would 
run into a race condition, just as they did with the former 
`FOPFactory.setBaseURI(baseURI)` method.


was (Author: mkarg):
How should that work in a multithreaded environment? As the same resolver 
instance is attached with the singleton factory, two concurrent threads would 
run into a race condition, just as they did with the former 
`FOPFactory.setBaseURI(baseURI` method.

> Override baseURI per FOP instance
> -
>
> Key: FOP-3084
> URL: https://issues.apache.org/jira/browse/FOP-3084
> Project: FOP
>  Issue Type: Improvement
>Affects Versions: 2.7
>Reporter: Markus Karg
>Priority: Major
>
> There is a best practice to reuse FOP Factory instances for optimal 
> performance. But doing so effectively applies the same baseURI (the one used 
> at factory creation) to all FOP instances, hence to all rendered XSL 
> templates.
>  
> Given the case one needs to render XSL template `/a/A.xfo` referring to a 
> picture file `./A.png` (hence effectively located at `/a/A.png`), and then 
> needs to render XSL template `/b/B.xfo`, referring to a picture file 
> `./B.png` (hence effectively found at `/b/B.png`), then there is no other 
> solution but to create a new FOP Instance per template: On instance for 
> `baseURI=.../a/` and a second instance for `baseURI=.../b/`. This effectively 
> results in rather bad performance!
>  
> To support this use case while keeping optimal performance (hence: use a 
> single FOP factory), there should be a way to pass the baseURI of the 
> rendered XSL template to the FOP Factory, so creating a new FOP instances 
> effectively use different baseURIs to resolve images. In the past, there had 
> been a `FOP.setBaseURI(baseURI)` method for this. Clearly that method was a 
> very bad idea, as concurrent callers ended up in a race condition. So 
> reintroducing `FOP.setBaseURI(baseURI)` is *definitively not* a viable 
> solution!
>  
> Proposed solutions could be to either add an optional parameter baseURI to 
> `FOPFactory.newFOP(..., baseURI)`, _or_ to add a new method 
> `FOP.setBaseURI(baseURI)` to FOP, _or_ to add a new method 
> `FOUserAgent.setBaseURI(baseURI)`.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)