From 554cc57d314e603b8b71c0b45ea4247a5775000c Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Mon, 9 Dec 2019 11:11:07 +0100 Subject: [PATCH] maj du 09/12 keyref --- Efi2Xsd/AccasXsd.py | 32 +++++++++++++++++++++++++++----- Efi2Xsd/balisesXSD.py | 11 ++++++++++- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/Efi2Xsd/AccasXsd.py b/Efi2Xsd/AccasXsd.py index 90f9e4d7..2262ee79 100755 --- a/Efi2Xsd/AccasXsd.py +++ b/Efi2Xsd/AccasXsd.py @@ -68,7 +68,6 @@ class X_definition: self.aCreer = False if nom == 'T_Consigne' : return nom listePossible=cata.dictTypesXSD[nom] - print (listePossible) indice=0 while (indice < len(listePossible)) : objAComparer=listePossible[indice] @@ -309,9 +308,17 @@ class X_SIMP (X_definition): typeATraduire=self.type[0] if not (typeATraduire in list(dictNomsDesTypes.keys())) : if (isinstance(typeATraduire, Accas.ASSD) or issubclass(typeATraduire, Accas.ASSD)) : + # cas d une creation cata = CONTEXT.getCurrentCata() - cata.dictTypesASSDorUserASSDUtilises[typeATraduire]=self - if typeATraduire not in list(cata.dictTypesASSDorUserASSDCrees) : + if len(self.type) == 2 and self.type[1]=='createObject' : + if typeATraduire.__name__ not in list(cata.dictTypesASSDorUserASSDCrees) : + cata.dictTypesASSDorUserASSDCrees[typeATraduire.__name__]=[self,] + else : + cata.dictTypesASSDorUserASSDCrees[typeATraduire.__name__].append(self) + return 'xs:string' + + # cas d une consommation + if typeATraduire not in list(cata.dictTypesASSDorUserASSDUtilises) : cata.dictTypesASSDorUserASSDUtilises[typeATraduire]=[self,] else : cata.dictTypesASSDorUserASSDUtilises[typeATraduire].append(self,) @@ -392,18 +399,33 @@ class X_JDC_CATA : texteKeyRef = "" for clef in self.dictTypesASSDorUserASSDCrees: + print ('---- En creation', clef, '__________________') + existeASSD=0 texteDesFields="" for unOper in self.dictTypesASSDorUserASSDCrees[clef]: + if not(isinstance(unOper, Accas.OPER)) : continue + existeASSD=1 texteDesFields+=texteFieldUnitaire.format(self.code, unOper.nom) - texteDesFields=texteDesFields[0:-2] + if existeASSD : texteDesFields=texteDesFields[0:-2] + texteDesUserASSD='' + existeunUserASSD=0 + for unSimp in self.dictTypesASSDorUserASSDCrees[clef]: + if not (isinstance(unSimp, Accas.SIMP)) : continue + texteDesUserASSD +="\n\t\t\n\t\t"+texteDesUserASSD + else: texteDesFields = texteDesUserASSD[19:] + #print (texteDesUserASSD) + #print (texteDesFields) if texteDesFields != "" : + #print (texteDesFields) texteKeyRef += producingASSDkeyRefDeclaration.format( clef ,texteDesFields) for clef in self.dictTypesASSDorUserASSDUtilises: for unSimp in self.dictTypesASSDorUserASSDUtilises[clef]: # il faut la genealogie - print (unSimp.getXPath()) texteKeyRef += UsingASSDkeyRefDeclaration.format(unSimp.nom, unSimp.type[0].__name__,self.code, unSimp.type[0].__name__,unSimp.getXPath() ) if texteKeyRef != '' : diff --git a/Efi2Xsd/balisesXSD.py b/Efi2Xsd/balisesXSD.py index eff5d568..e4c6059a 100644 --- a/Efi2Xsd/balisesXSD.py +++ b/Efi2Xsd/balisesXSD.py @@ -21,6 +21,13 @@ maxLengthTypeSimple = '\t\t\t\n' minLengthTypeSimple = '\t\t\t\n' eltDsSequence = '\t\t\t\n' eltWithDefautDsSequence = '\t\t\t\n' +UsingASSDkeyRefDeclaration ='\n\t \n\t\t\n\t\t\n\t\n' + + # + # + + + # COMPO debutTypeCompo = '\t\n' @@ -40,7 +47,8 @@ substDsSequence = '\t\t\t\ operAttributeName = '\t\t\n' attributeTypeForASSD = '\t\t\n' attributeTypeUtilisateurName = '\t\t\n' -#keyRefDeclaration ='\n\t \n\t\t\n\t\t\n\t\n' +producingASSDkeyRefDeclaration='\t\n\t\t\n\t\t\n\t\n' +texteFieldUnitaire="./{}:{}/@name |" # CATA debutTypeCata = '\t\n\t\t\n' @@ -50,6 +58,7 @@ finSchema = '' eltCata = '\t\n' EltCodeSpecDsCata='\t\t\t\n' includeCata = '\n\n' +fermeEltCata = '\t\n' # EXTENSION debutExtension = '\t\t\n\t\t\n\t\t\n' -- 2.39.2