From 8f71dcbea6d040670815c83d79bbf191dc94cc41 Mon Sep 17 00:00:00 2001 From: PASCALE NOYRET Date: Tue, 13 Oct 2020 17:16:48 +0200 Subject: [PATCH] ajout des userASSD dans le XSD --- Efi2Xsd/AccasXsd.py | 13 ++++++++++++- Efi2Xsd/balisesXSD.py | 5 ++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Efi2Xsd/AccasXsd.py b/Efi2Xsd/AccasXsd.py index 9c3a91b6..02db1d13 100755 --- a/Efi2Xsd/AccasXsd.py +++ b/Efi2Xsd/AccasXsd.py @@ -672,7 +672,7 @@ class X_OPER (X_definitionComposee): def dumpXsd(self, dansFactorisation=False, multiple = False, first=False): X_definitionComposee.dumpXsd(self,dansFactorisation) self.texteComplexe += finTypeCompoSeq - self.texteComplexe += operAttributeName + self.texteComplexe += attributeNameName self.texteComplexe += attributeTypeForASSD self.texteComplexe += attributeTypeUtilisateurName.format(self.sd_prod.__name__) self.texteComplexe += finTypeCompoEtape @@ -802,6 +802,17 @@ class X_SIMP (X_definition): else : self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1) elif first: self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,1,1) + + typeATraduire=self.type[0] + if (isinstance(typeATraduire, Accas.UserASSD) or issubclass(typeATraduire, Accas.UserASSD)) : + nomType = self.type[0].__name__ + self.texteElt = self.texteElt[:-3]+">\n" + self.texteElt += "\t"+attributeNameName + if len(self.type) == 2 and self.type[1]=='createObject' : self.texteElt += attributeTypeForUserASSDCreation + else : self.texteElt += attributeTypeForUserASSDConsommation + self.texteElt += "\t"+attributeTypeUtilisateurName.format(nomType) + self.texteElt += finTexteElt + # self.aCreer est mis a jour ds definitNomDuTypePyxb # ou si elt est le 1er d une liste identique diff --git a/Efi2Xsd/balisesXSD.py b/Efi2Xsd/balisesXSD.py index f745302a..f2d07d9a 100644 --- a/Efi2Xsd/balisesXSD.py +++ b/Efi2Xsd/balisesXSD.py @@ -66,10 +66,13 @@ finUnion = '\t\t\t\n' # User OR ASSD -operAttributeName = '\t\t\n' +attributeNameName = '\t\t\n' attributeTypeForASSD = '\t\t\n' +attributeTypeForUserASSDCreation = '\t\t\t\n' +attributeTypeForUserASSDConsommation = '\t\t\t\n' attributeTypeUtilisateurName = '\t\t\n' producingASSDkeyRefDeclaration='\t\n\t\t\n\t\t\n\t\n' +finTexteElt = '\t\t\t\n' texteFieldUnitaire="./{}:{}/@name |" # CATA -- 2.39.2