request.getParameterMap().put("name", new String[]{file.getName()});
request.getParameterMap().put("desc", new String[]{description});
request.getParameterMap().put("protocol", new String[]{"WWW:DOWNLOAD-1.0-http--download"});
String process = "onlinesrc-add";
XslProcessingReport report = new XslProcessingReport(process);
Element processedMetadata;
try {
final String siteURL = context.getBean(SettingManager.class).getSiteURL(context);
processedMetadata = XslProcessing.get().process(id, process,
true, context.getAppPath(), report, true, siteURL, request);
if (processedMetadata == null) {
throw new BadParameterEx("Processing failed", "Not found:"
+ report.getNotFoundMetadataCount() + ", Not owner:" + report.getNotEditableMetadataCount()
+ ", No process found:" + report.getNoProcessFoundCount() + ".");
}
} catch (Exception e) {
throw e;
}
// -- return the processed metadata id