self.nomDuCodeDumpe = obj.nomDuCodeDumpe
self.code=obj.code
+ def getXPath(self):
+ obj=self
+ textePath=self.nom
+ while ( hasattr(obj,'pere') ):
+ obj=obj.pere
+ if isinstance(obj, X_BLOC) : continue
+ textePath= obj.nom + '/' + textePath
+ textePath='./'+ self.code + ":" + textePath
+ return textePath
+
#def genealogie(self,n):
# texte=self.nom
# obj=self
class X_OPER (X_definitionComposee):
# ---------------------------------
def dumpXsd(self):
-# X_definitionComposee.dumpXsd(self, inExtension)
X_definitionComposee.dumpXsd(self)
self.texteComplexe += finTypeCompoSeq
self.texteComplexe += operAttributeName
self.texteComplexe += attributeTypeForASSD
self.texteComplexe += attributeTypeUtilisateurName.format(self.sd_prod.__name__)
self.texteComplexe += finTypeCompo
-
+ cata = CONTEXT.getCurrentCata()
+ if self.sd_prod.__name__ not in list(cata.dictTypesASSDorUserASSDCrees) :
+ cata.dictTypesASSDorUserASSDCrees[self.sd_prod.__name__]=[self,]
+ else :
+ cata.dictTypesASSDorUserASSDCrees[self.sd_prod.__name__].append(self)
+
# ----------------------------------
class X_PROC (X_definitionComposee):
else :
typeATraduire=self.type[0]
if not (typeATraduire in list(dictNomsDesTypes.keys())) :
- if (isinstance(typeATraduire, Accas.ASSD) or issubclass(typeATraduire, Accas.ASSD)) : return 'xs:string'
+ if (isinstance(typeATraduire, Accas.ASSD) or issubclass(typeATraduire, Accas.ASSD)) :
+ cata = CONTEXT.getCurrentCata()
+ cata.dictTypesASSDorUserASSDUtilises[typeATraduire]=self
+ if typeATraduire not in list(cata.dictTypesASSDorUserASSDCrees) :
+ cata.dictTypesASSDorUserASSDUtilises[typeATraduire]=[self,]
+ else :
+ cata.dictTypesASSDorUserASSDUtilises[typeATraduire].append(self,)
+ return 'xs:string'
else : return ('YYYYY')
return dictNomsDesTypes[typeATraduire]
if self.texteTypeAbstrait != "" : self.texteXSD += self.texteTypeAbstrait
self.texteXSD += self.texteCata
self.texteXSD += self.texteElt
+
+ texteKeyRef = ""
+ for clef in self.dictTypesASSDorUserASSDCrees:
+ texteDesFields=""
+ for unOper in self.dictTypesASSDorUserASSDCrees[clef]:
+ texteDesFields+=texteFieldUnitaire.format(self.code, unOper.nom)
+ texteDesFields=texteDesFields[0:-2]
+ if 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 != '' :
+ self.texteXSD = self.texteXSD[0:-3]+'>\n'
+ self.texteXSD += texteKeyRef
+ self.texteXSD += fermeEltCata
+
self.texteXSD += texteFin
#if not PourTraduction : print (self.texteXSD)
self.texteSimple += c.texteSimple
self.texteComplexe += c.texteComplexe
c.texteElt=eltCompoDsSequenceInExtension.format(c.nom,self.code,c.nomDuTypePyxb)
- self.texteCata += c.texteElt
+ self.texteCata += c.texteElt