Mapped Mime type names
This commit is contained in:
parent
d4cfd38ae1
commit
0fee651114
|
@ -1,10 +1,10 @@
|
||||||
package net.codinux.invoicing.model.codes
|
package net.codinux.invoicing.model.codes
|
||||||
|
|
||||||
enum class Mime(val code: String) {
|
enum class Mime(val code: String) {
|
||||||
application_pdf("application/pdf"),
|
PDF("application/pdf"),
|
||||||
image_png("image/png"),
|
PNG("image/png"),
|
||||||
image_jpeg("image/jpeg"),
|
JPEG("image/jpeg"),
|
||||||
text_csv("text/csv"),
|
CSV("text/csv"),
|
||||||
application_vnd_openxmlformats_officedocument_spreadsheetml_sheet("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),
|
ExcelSpreadsheet("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),
|
||||||
application_vnd_oasis_opendocument_spreadsheet("application/vnd.oasis.opendocument.spreadsheet"),
|
OpenDocumentSpreadsheet("application/vnd.oasis.opendocument.spreadsheet"),
|
||||||
}
|
}
|
|
@ -137,6 +137,15 @@ class CodeGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getEnumName(columns: List<Column>, row: List<Any?>): String {
|
private fun getEnumName(columns: List<Column>, row: List<Any?>): String {
|
||||||
|
// Mime types
|
||||||
|
val firstColumn = row[0]
|
||||||
|
if (firstColumn == "application/pdf") return "PDF"
|
||||||
|
else if (firstColumn == "image/png") return "PNG"
|
||||||
|
else if (firstColumn == "image/jpeg") return "JPEG"
|
||||||
|
else if (firstColumn == "text/csv") return "CSV"
|
||||||
|
else if (firstColumn == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") return "ExcelSpreadsheet"
|
||||||
|
else if (firstColumn == "application/vnd.oasis.opendocument.spreadsheet") return "OpenDocumentSpreadsheet"
|
||||||
|
|
||||||
val column = if (columns.first().name == "Scheme ID") row[1] // ISO 6523 Scheme Identifier codes
|
val column = if (columns.first().name == "Scheme ID") row[1] // ISO 6523 Scheme Identifier codes
|
||||||
else if (columns.first().name == "English Name") row[1] // Country codes
|
else if (columns.first().name == "English Name") row[1] // Country codes
|
||||||
else if (columns.first().name == "Country") row[2] // Currency codes, but does not work yet due to duplicate Keys / Alpha3-Codes
|
else if (columns.first().name == "Country") row[2] // Currency codes, but does not work yet due to duplicate Keys / Alpha3-Codes
|
||||||
|
|
Loading…
Reference in New Issue