From 0ae18ab7656176d609c279d2b17e20669d9462de Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Thu, 22 Jun 2023 17:03:38 +0200 Subject: [PATCH] Code cleanup --- .../main/kotlin/org/jeudego/pairgoth/ext/OpenGotha.kt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/ext/OpenGotha.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/ext/OpenGotha.kt index e9e4bd2..b76a75a 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/ext/OpenGotha.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/ext/OpenGotha.kt @@ -20,21 +20,16 @@ object OpenGotha { fun import(element: Element): Tournament<*> { val context = JAXBContext.newInstance(ObjectFactory::class.java) - val parsed = context.createUnmarshaller()/*.also { unmarshaller -> - val schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI) - val schemaURL = OpenGotha::class.java.getResource("/xsd/opengotha.xsd") ?: throw Error("opengotha.xsd not found") - val schema = schemaFactory.newSchema(schemaURL) - unmarshaller.schema = schema - - }*/.unmarshal(element) as JAXBElement - + val parsed = context.createUnmarshaller().unmarshal(element) as JAXBElement val ogt = parsed.value + // import tournament parameters val genParams = ogt.tournamentParameterSet.generalParameterSet val handParams = ogt.tournamentParameterSet.handicapParameterSet val placmtParams = ogt.tournamentParameterSet.placementParameterSet val pairParams = ogt.tournamentParameterSet.pairingParameterSet + val tournament = StandardTournament( id = Store.nextTournamentId, type = Tournament.Type.INDIVIDUAL, // CB for now, TODO