private Context addDataverseJsonMetadataFormat(Context context) { MetadataFormat metadataFormat = MetadataFormat.metadataFormat(DATAVERSE_EXTENDED_METADATA_FORMAT); metadataFormat.withNamespace(DATAVERSE_EXTENDED_METADATA_INFO); metadataFormat.withSchemaLocation(DATAVERSE_EXTENDED_METADATA_SCHEMA); context.withMetadataFormat(metadataFormat); return context; }
public Context withMetadataFormat(String prefix, Transformer transformer) { withMetadataFormat(new MetadataFormat().withNamespace(prefix).withPrefix(prefix).withSchemaLocation(prefix).withTransformer(transformer)); return this; }
public Context withMetadataFormat(String prefix, Transformer transformer, Condition condition) { withMetadataFormat( new MetadataFormat() .withNamespace(prefix) .withPrefix(prefix) .withSchemaLocation(prefix) .withTransformer(transformer) .withCondition(condition) ); return this; }
private void addSupportedMetadataFormats(Context context) { for (String[] provider : ExportService.getInstance(settingsService).getExportersLabels()) { String formatName = provider[1]; Exporter exporter; try { exporter = ExportService.getInstance(settingsService).getExporter(formatName); } catch (ExportException ex) { exporter = null; } if (exporter != null && exporter.isXMLFormat() && exporter.isHarvestable()) { MetadataFormat metadataFormat; try { metadataFormat = MetadataFormat.metadataFormat(formatName); metadataFormat.withNamespace(exporter.getXMLNameSpace()); metadataFormat.withSchemaLocation(exporter.getXMLSchemaLocation()); } catch (ExportException ex) { metadataFormat = null; } if (metadataFormat != null) { context.withMetadataFormat(metadataFormat); } } } //return context; }