Revision 44762
Added by Katerina Iatropoulou over 7 years ago
SearchRegistry.java | ||
---|---|---|
101 | 101 |
if (tr instanceof XSLTTransformation) { |
102 | 102 |
try { |
103 | 103 |
if (!temp.isEmpty()){ |
104 |
forChaining.add(createTransformer("", locale, temp));
|
|
104 |
forChaining.add(createTransformer(locale, temp)); |
|
105 | 105 |
} |
106 | 106 |
temp.clear(); |
107 |
forChaining.add(createTransformer("",(XSLTTransformation)tr));
|
|
107 |
forChaining.add(createTransformer((XSLTTransformation)tr)); |
|
108 | 108 |
} |
109 | 109 |
catch (Exception e) { |
110 | 110 |
logger.warn("Error creating a transformer with name: "+name+" and locale: "+locale.getDisplayName(), e); |
... | ... | |
117 | 117 |
} |
118 | 118 |
if (!temp.isEmpty()){ |
119 | 119 |
try { |
120 |
forChaining.add(createTransformer("", locale, temp));
|
|
120 |
forChaining.add(createTransformer(locale, temp)); |
|
121 | 121 |
} |
122 | 122 |
catch (Exception e) { |
123 | 123 |
logger.warn("Error creating a transformer with name: " + name + " and locale: "+locale.getDisplayName(), e); |
... | ... | |
127 | 127 |
return new ChainTransformer(name, forChaining); |
128 | 128 |
} |
129 | 129 |
|
130 |
private Transformer createTransformer(String transformerName, XSLTTransformation transformation) throws Exception {
|
|
130 |
private Transformer createTransformer(XSLTTransformation transformation) throws Exception { |
|
131 | 131 |
String xsl_file = transformation.getXslt(); |
132 | 132 |
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(xsl_file); |
133 | 133 |
StringWriter writer = new StringWriter(); |
... | ... | |
142 | 142 |
return OptimusPrime; |
143 | 143 |
} |
144 | 144 |
|
145 |
private Transformer createTransformer(String transformerName, Locale locale, List<XPathTrasformation> transformations) throws Exception {
|
|
145 |
private Transformer createTransformer(Locale locale, List<XPathTrasformation> transformations) throws Exception { |
|
146 | 146 |
VelocityEngine ve = VelocityUtil.getEngine(); |
147 | 147 |
|
148 | 148 |
Template t = ve.getTemplate("/eu/dnetlib/data/search/transform/config/velocity.vm", "UTF-8"); |
Also available in: Unified diff
Enabled APIs for all entities