[jira] [Commented] (CAMEL-9600) camel-fop - Upgrade fop to 2.1

2016-04-07 Thread Sergey Yakimovich (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-9600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15230001#comment-15230001
 ] 

Sergey Yakimovich commented on CAMEL-9600:
--

I can work on this issue. In version 1.1 you could configure FopFactory 
programmatically, now you can't do that but you can programmatically configure 
FopFactoryBuilder which creates FopFactory 
https://xmlgraphics.apache.org/fop/2.1/embedding.html#config-internal. Maybe 
just forbid to specify both parameters by throwing something like 
FopConfigException with "More than one configuration. You can configure fop 
either by config file or by supplying FopFactory but not both." to avoid 
confusions. 

> camel-fop - Upgrade fop to 2.1
> --
>
> Key: CAMEL-9600
> URL: https://issues.apache.org/jira/browse/CAMEL-9600
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-fop
>Reporter: Claus Ibsen
>Priority: Minor
> Fix For: 2.18.0
>
>
> We should upgrade camel-fop to use fop 2.1. It uses 1.1 today.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-9549) camel-schematron - More fine grained error messages when compiling the schema

2016-04-03 Thread Sergey Yakimovich (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-9549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15223235#comment-15223235
 ] 

Sergey Yakimovich commented on CAMEL-9549:
--

I looked into it and the wrong error is shown because of the following. Rules 
first searched in the classpath. If there is an exception, for example, parsing 
error, file system is searched and FileNotFoundException is thrown. I propose 
the following change. Change this:
{code:title=SchematronEndpoint.java|borderStyle=solid}

try {
// Attempt to read the schematron rules  from the class path first.
LOG.debug("Reading schematron rules from class path {}", path);
InputStream schRules = 
ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), path);
rules = TemplatesFactory.newInstance().getTemplates(schRules, 
transformerFactory);
} catch (Exception e) {
// Attempts from the file system.
LOG.debug("Schamatron rules not found in class path, attempting file 
system {}", path);
InputStream schRules = FileUtils.openInputStream(new File(path));
rules = TemplatesFactory.newInstance().getTemplates(schRules, 
transformerFactory);
}
{code}

to this:

{code:title=SchematronEndpoint.java|borderStyle=solid}

try {
// Attempt to read the schematron rules  from the class path first.
LOG.debug("Reading schematron rules from class path {}", path);
InputStream schRules = 
ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), path);
rules = TemplatesFactory.newInstance().getTemplates(schRules, 
transformerFactory);
} catch (Exception classPathException) {
// Attempts from the file system.
LOG.debug("Error loading schematron rules from class path, attempting 
file system {}", path);
try{
InputStream schRules = FileUtils.openInputStream(new 
File(path));
rules = TemplatesFactory.newInstance().getTemplates(schRules, 
transformerFactory);
} catch (FileNotFoundException e) {
LOG.debug("Schematron rules not found in the file system {}", 
path);
throw classPathException; // Can be more meaningful, for 
example, xslt compilation error.
}
}
{code}

I will create a pull request if this is ok.

> camel-schematron - More fine grained error messages when compiling the schema
> -
>
> Key: CAMEL-9549
> URL: https://issues.apache.org/jira/browse/CAMEL-9549
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-schematron
>Affects Versions: 2.15.3
>Reporter: Johan Mörén
>Priority: Minor
>
> When pre-compiling the schematron rules files. Errors such as 
> xslt-compilation errors, includes not found etc. are always caught and 
> presented with an error message saying incorrectly that the schematron rules 
> file could not be found. 
> In the two errors above the file has been found but compilation of it has 
> failed. 
> To make troubleshooting easier i think that a more fine grained error 
> handling could provide the user with a better view of what the underlying 
> error really is. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)