Skip to content

Commit

Permalink
updated conversion including mei 4 to 5 comprises versoin 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anneferger committed Jan 26, 2024
1 parent 28c97d6 commit 9b259a3
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>de.edirom.meigarage</groupId>
<artifactId>mei-xsl-converter</artifactId>
<version>0.2.3</version>
<version>0.3.0</version>
<name>MEI XSL Converter</name>
<properties>

Expand Down
85 changes: 84 additions & 1 deletion src/main/java/de/edirom/meigarage/mei/Conversion.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,91 @@ public enum Conversion {
true, // "visible as input"
9, // "cost"
new HashMap<String, Property>() {}
),
MEI2MARC(
"mei2marc", // "id"
"text/xml", // "output format id"
"mei21", // "input format id"
"MEI 2.1 (2013) Document", // "input description"
"score", // "output type" (score, audio, image, customization)
"text/xml", // "input mime type"
"marcxml", // "input format id"
"MARC XML Document", // "input description"
"score", // "input type" (score, audio, image, customization)
true, // "visible as input"
9, // "cost"
new HashMap<String, Property>() {}
),
MEI2MODS(
"mei2mods", // "id"
"text/xml", // "output format id"
"mei21", // "input format id"
"MEI 2.1 (2013) Document", // "input description"
"score", // "output type" (score, audio, image, customization)
"text/xml", // "input mime type"
"mods", // "input format id"
"MODS (Metadata Object Description Schema) XML Document", // "input description"
"score", // "input type" (score, audio, image, customization)
true, // "visible as input"
9, // "cost"
new HashMap<String, Property>() {}
),
MEI2MUP(
"mei2mup", // "id"
"text/xml", // "intput format id"
"mei21", // "input format id"
"MEI 2.1 (2013) Document", // "input description"
"score", // "input type" (score, audio, image, customization)
"text/x-mup", // "output mime type"
"mup", // "output format id"
"Mup music publication program", // "output description"
"score", // "output type" (score, audio, image, customization)
true, // "visible as input"
9, // "cost"
new HashMap<String, Property>() {}
),
MEI2MUSICXML(
"mei2musicxml", // "id"
"text/xml", // "intput format id"
"mei21", // "input format id"
"MEI 2.1 (2013) Document", // "input description"
"score", // "input type" (score, audio, image, customization)
"text/xml", // "input mime type"
"musicxml-timewise", // "input format id"
"MusicXML Document (timewise)", // "input description"
"score", // "input type" (score, audio, image, customization)
true, // "visible as input"
9, // "cost"
new HashMap<String, Property>() {}
),
MEI40TO50(
"mei40to50", // "id"
"text/xml", // "input mime type"
"mei40", // "input format id"
"MEI 4.0 (2018) Document", // "input description"
"score", // "input type" (score, audio, image, customization)
"text/xml", // "output format id"
"mei50", // "output format id"
"MEI 5.0 (2023) Document", // "output description"
"score", // "output type" (score, audio, image, customization)
true, // "visible as input"
9, // "cost"
new HashMap<String, Property>() {}
),
MNX2MEI(
"mnx2mei", // "id"
"application/json", // "input mime type"
"mnx", // "input format id"
"MNX JSON Document", // "input description"
"score", // "input type" (score, audio, image, customization)
"text/xml", // "output format id"
"mei40", // "input format id"
"MEI 4.0 (2018) Document", // "input description"
"score", // "output type" (score, audio, image, customization)
true, // "visible as input"
9, // "cost"
new HashMap<String, Property>() {}
)

;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public class ConverterConfiguration {
CONVERSIONS.add(getConversionActionArgument(Conversion.MEI2012TOMEI21));
CONVERSIONS.add(getConversionActionArgument(Conversion.MEI40TOLILYPOND));
CONVERSIONS.add(getConversionActionArgument(Conversion.COMPAREFILES));
CONVERSIONS.add(getConversionActionArgument(Conversion.MEI2MARC));
CONVERSIONS.add(getConversionActionArgument(Conversion.MEI2MODS));
CONVERSIONS.add(getConversionActionArgument(Conversion.MEI2MUP));
CONVERSIONS.add(getConversionActionArgument(Conversion.MEI2MUSICXML));
CONVERSIONS.add(getConversionActionArgument(Conversion.MEI40TO50));
CONVERSIONS.add(getConversionActionArgument(Conversion.MNX2MEI));
}

private static ConversionActionArguments getConversionActionArgument(Conversion format) {
Expand Down
42 changes: 42 additions & 0 deletions src/main/java/de/edirom/meigarage/mei/MEIXSLConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,48 @@ else if(fromDataType.getFormat().equals(Conversion.COMPAREFILES.getIFormatId())
properties.put("base", "data-configuration/scripts/");
performXsltTransformation(inputStream, outputStream, "data-configuration/scripts/compare.files.xsl", properties, tempDir);
}
else if(fromDataType.getFormat().equals(Conversion.MEI2MARC.getIFormatId()) &&
toDataType.getFormat().equals(Conversion.MEI2MARC.getOFormatId())) {

properties.put("extension", "xml");
properties.put("base", "encoding-tools/mei2marc/");
performXsltTransformation(inputStream, outputStream, "encoding-tools/mei2marc/mei2marc.xsl", properties, tempDir);
}
else if(fromDataType.getFormat().equals(Conversion.MEI2MODS.getIFormatId()) &&
toDataType.getFormat().equals(Conversion.MEI2MODS.getOFormatId())) {

properties.put("extension", "xml");
properties.put("base", "encoding-tools/mei2mods/");
performXsltTransformation(inputStream, outputStream, "encoding-tools/mei2mods/mei2mods.xsl", properties, tempDir);
}
else if(fromDataType.getFormat().equals(Conversion.MEI2MUP.getIFormatId()) &&
toDataType.getFormat().equals(Conversion.MEI2MUP.getOFormatId())) {

properties.put("extension", "xml");
properties.put("base", " encoding-tools/mei2mup/");
performXsltTransformation(inputStream, outputStream, "encoding-tools/mei2mup/mei2mup-1.0.3.xsl", properties, tempDir);
}
else if(fromDataType.getFormat().equals(Conversion.MEI2MUSICXML.getIFormatId()) &&
toDataType.getFormat().equals(Conversion.MEI2MUSICXML.getOFormatId())) {

properties.put("extension", "xml");
properties.put("base", " encoding-tools/mei2musicxml/");
performXsltTransformation(inputStream, outputStream, "encoding-tools/mei2musicxml/mei2musicxml.xsl", properties, tempDir);
}
else if(fromDataType.getFormat().equals(Conversion.MEI40TO50.getIFormatId()) &&
toDataType.getFormat().equals(Conversion.MEI40TO50.getOFormatId())) {

properties.put("extension", "xml");
properties.put("base", " encoding-tools/mei40To50/");
performXsltTransformation(inputStream, outputStream, "encoding-tools/mei40To50/mei40To50.xsl", properties, tempDir);
}
else if(fromDataType.getFormat().equals(Conversion.MNX2MEI.getIFormatId()) &&
toDataType.getFormat().equals(Conversion.MNX2MEI.getOFormatId())) {

properties.put("extension", "xml");
properties.put("base", " encoding-tools/mnx2mei/");
performXsltTransformation(inputStream, outputStream, "encoding-tools/mnx2mei/mnx2mei.xsl", properties, tempDir);
}
}

/*
Expand Down

0 comments on commit 9b259a3

Please sign in to comment.