self.aCreer = False
if nom == 'T_Consigne' : return nom
listePossible=cata.dictTypesXSD[nom]
- print (listePossible)
indice=0
while (indice < len(listePossible)) :
objAComparer=listePossible[indice]
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,)
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<xs:field xpath="+self.code+":"+unSimp.getXPath()
+ existeunUserASSD=1
+ if existeunUserASSD:
+ if existeASSD : texteDesFields = texteDesFields + "/>\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 != '' :
minLengthTypeSimple = '\t\t\t<xs:minLength value = "{}"/>\n'
eltDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
eltWithDefautDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}" default="{}"/>\n'
+UsingASSDkeyRefDeclaration ='\n\t<xs:keyref name="{}_Name_ref_a{}" refer="{}:Key_Name_For_{}"> \n\t\t<xs:selector xpath="{}"/>\n\t\t<xs:field xpath="."/>\n\t</xs:keyref>\n'
+
+ #<xs:keyref name="MyField_Ref_A_CreateMesh" refer="Test1:Key_Name_In_ReadMesh_CreateMesh">
+ #<xs:selector xpath="./Test1:MyField/Test1:onMesh"/>
+
+
+
# COMPO
debutTypeCompo = '\t<xs:complexType name="{}" >\n'
operAttributeName = '\t\t<xs:attribute name="name" type="xs:string"/>\n'
attributeTypeForASSD = '\t\t<xs:attribute name="accasType" type="xs:string" fixed="ASSD"/>\n'
attributeTypeUtilisateurName = '\t\t<xs:attribute name="typeUtilisateur" type="xs:string" fixed="{}"/>\n'
-#keyRefDeclaration ='\n\t<xs:keyref name="{}_Name_ref" refer="Key_Name_In_{}"> \n\t\t<xs:selector xpath="{}:{}_Name"/>\n\t\t<xs:field xpath="."/>\n\t</xs:keyref>\n'
+producingASSDkeyRefDeclaration='\t<xs:key name="Key_Name_For_{}">\n\t\t<xs:selector xpath="."/>\n\t\t<xs:field xpath="{}"/>\n\t</xs:key>\n'
+texteFieldUnitaire="./{}:{}/@name |"
# CATA
debutTypeCata = '\t<xs:complexType name="T_{}">\n\t\t<xs:choice minOccurs="0" maxOccurs="unbounded">\n'
eltCata = '\t<xs:element name="{}" type="{}:{}"/>\n'
EltCodeSpecDsCata='\t\t\t<xs:element ref="{}_Abstract" minOccurs="0" maxOccurs="1"/>\n'
includeCata = '<xs:include schemaLocation="cata_{}_genere.xsd" />\n\n'
+fermeEltCata = '\t</xs:element>\n'
# EXTENSION
debutExtension = '\t\t<xs:complexContent>\n\t\t<xs:extension base="{}:T_{}_Abstract">\n\t\t<xs:choice minOccurs="0" maxOccurs="unbounded">\n'