Skip to content

Commit 6485efc

Browse files
committed
MEI Customization Service
1 parent e4dcf38 commit 6485efc

File tree

2 files changed

+38
-13
lines changed

2 files changed

+38
-13
lines changed

src/main/java/pl/psnc/dl/ege/EGEImpl.java

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,31 +232,55 @@ public ValidationResult performValidation(final InputStream inputData,
232232
/**
233233
* <p>Method performs customization using all loaded through extension mechanism
234234
* {@link Customization} implementations.</p>
235-
* If there is no customization that supports specified data type, then
235+
* If there is no customization that supports specified customization request, then
236236
* CustomizationException will be throw.<br/>
237237
* If some unexpected errors occurs during customization, method will throw
238238
* EGEException.
239239
*
240-
* @param inputData
241-
* input stream that contains necessary data
242240
* @param customizationSetting
243-
* customization argument
241+
* customization setting
242+
* @param sourceInputType
243+
* source
244+
* @param customizationInputType
245+
* customization
246+
* @param outputFormat
247+
* outputFormat
248+
* @param outputStream
249+
* outputStream
244250
* @throws IOException
245251
* @throws {@link CustomizationException}
246252
* @throws {@link EGEException}
247253
*/
248-
public void performCustomization(final InputStream inputData,
249-
final CustomizationSetting customizationSetting)
250-
throws IOException, CustomizationException, EGEException
254+
public void performCustomization(final CustomizationSetting customizationSetting,
255+
final CustomizationSourceInputType sourceInputType,
256+
final CustomizationSourceInputType customizationInputType,
257+
final String outputFormat, final OutputStream outputStream,
258+
final File localSourceFile, final File localCustomizationFile)
259+
throws IOException, EGEException
251260
{
252-
for (Customization c : customizations) {
253-
for (CustomizationSetting cs : c.getSupportedCustomizationSettings()) {
254-
if (cs.equals(customizationSetting)) {
255-
c.customize(inputData, customizationSetting);
261+
try {
262+
263+
for (Customization c : customizations) {
264+
for (CustomizationSetting cs : c.getSupportedCustomizationSettings()) {
265+
if (cs.equals(customizationSetting)) {
266+
c.customize(customizationSetting, sourceInputType, customizationInputType,
267+
outputFormat, outputStream, localSourceFile, localCustomizationFile);
268+
}
256269
}
257270
}
258271
}
259-
throw new CustomizationException(customizationSetting);
272+
catch (CustomizationException ex) {
273+
LOGGER.error(ex.getMessage(), ex);
274+
throw ex;
275+
}
276+
catch (IOException ex) {
277+
LOGGER.error(ex.getMessage(), ex);
278+
throw ex;
279+
}
280+
catch (Exception ex) {
281+
LOGGER.error(ex.getMessage(), ex);
282+
throw new EGEException(ex.getMessage());
283+
}
260284
}
261285

262286
/**

src/main/java/pl/psnc/dl/ege/configuration/EGEConfigurationManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ private List<PluginWrapper> getAllComponents(ExtensionPoint ep)
388388
List<Extension> extensions = new ArrayList(ep.getConnectedExtensions());
389389
if(ep.getId().equals("XslConverter")) {
390390
// search for all plugin.xml files in stylesheets and add the extensions
391-
getXslExtensions(extensions, ep);
391+
if(extensions.size() > 0)
392+
getXslExtensions(extensions, ep);
392393
}
393394
for (Iterator iter = extensions.iterator(); iter.hasNext();) {
394395
Extension element = (Extension) iter.next();

0 commit comments

Comments
 (0)