From: Eric Fayolle Date: Wed, 4 Dec 2019 09:42:10 +0000 (+0100) Subject: MAJ docCatawriter MultipleCata X-Git-Tag: V200520bis~90^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=973dbecd71fa6829bb884cae6351b29aa90be0b3;p=tools%2Feficas.git MAJ docCatawriter MultipleCata --- diff --git a/Tests/MappingAccasXsd/MultipleCata/Makefile b/Tests/MappingAccasXsd/MultipleCata/Makefile new file mode 100755 index 00000000..a0830328 --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/Makefile @@ -0,0 +1,53 @@ +SUFFIXES= .xsd + +PYXB=pyxbgen + +#$(PYXB) -m $(basename $@) -u $< --location-prefix-rewrite http://chercheurs.edf.com/logiciels/vimmp= --write-for-customization \ +# L'utilisation de $? ne fonctionne pas dans le cas de catalogues multiple. +# En effet, si on modifie un seul catalogue, $? donne uniquement le fichier modifié et pyxb détecte +# que notre génération dépend du fichier non modifié qui n'est pas passé en paramètre et qui n'est pas regénéré. +# Une solution constiste à utiliser $^ + +#xmllint ne semble pas vérifier les includes... + +.SUFFIXES: _genere.xsd _genere.py .py + +.py_genere.xsd: + python2 ./generateXSD.py -c ./$< + +_genere.xsd_genere.py: + xmllint --schema XMLSchema11_local.xsd --xinclude --noout $^ + $(PYXB) -m $(basename $@) -u $^ --write-for-customization + + + +all: xsdAll driverAll + +xsdAll: xsdTestMutlipleCata +driverAll: pyTestMutlipleCata + +#Ecrire une génération des dépendences à partir des includes xsd +cata_MDCommun_genere.xsd: cata_modeleCommun_genere.xsd +cata_CFDCommun_genere.xsd: cata_modeleCommun_genere.xsd +cata_MD1_genere.xsd: cata_MDCommun_genere.xsd cata_modeleCommun_genere.xsd +cata_MD2_genere.xsd: cata_MDCommun_genere.xsd cata_modeleCommun_genere.xsd +cata_CFD1_genere.xsd: cata_CFDCommun_genere.xsd cata_modeleCommun_genere.xsd +cata_CFD2_genere.xsd: cata_CFDCommun_genere.xsd cata_modeleCommun_genere.xsd + +xsdTestMutlipleCata: cata_CFD1_genere.xsd cata_CFD2_genere.xsd cata_CFDCommun_genere.xsd cata_MD1_genere.xsd cata_MD2_genere.xsd cata_MDCommun_genere.xsd cata_modeleCommun_genere.xsd + +pyTestMutlipleCata: cata_CFD1_genere.py cata_CFD2_genere.py cata_CFDCommun_genere.py cata_MD1_genere.py cata_MD2_genere.py cata_MDCommun_genere.py cata_modeleCommun_genere.py + + +xml: + @echo "Reminder: a .comm file is needed for this step" + ./generateXML.py -c cata_1.py cata_1_test_1.comm + +clean: + rm -f *.pyc *~ + rm -rf *_genere.py raw __pycache__ + rm -f *_genere.xsd + +check: + xmllint --schema XMLSchema11.xsd cata_1_genere.xsd + diff --git a/Tests/MappingAccasXsd/MultipleCata/XMLSchema11_local.xsd b/Tests/MappingAccasXsd/MultipleCata/XMLSchema11_local.xsd new file mode 120000 index 00000000..db58cd92 --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/XMLSchema11_local.xsd @@ -0,0 +1 @@ +../XMLSchema11_local.xsd \ No newline at end of file diff --git a/Tests/MappingAccasXsd/MultipleCata/cata_CFD1.py b/Tests/MappingAccasXsd/MultipleCata/cata_CFD1.py new file mode 100755 index 00000000..93837630 --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/cata_CFD1.py @@ -0,0 +1,20 @@ +autonome = 0 +#autonome = 1 + +if autonome : + from Accas import * + JdC = JDC_CATA ( + code = 'CFD1', + ) + importedBy=() +else : + from cata_CFDCommun import * + implement='CFD1:CFDCommun' + importedBy=() + +Proc1DuCFD1=PROC(nom='Proc1DuCFD1', + S1DuCFD1= SIMP(statut='o', typ='I', defaut = 91), +) +Proc2DuCFD1=PROC(nom='Proc2DuCFD1', + S2DuCFD1= SIMP(statut='o', typ='I', defaut = 92), +) diff --git a/Tests/MappingAccasXsd/MultipleCata/cata_CFD2.py b/Tests/MappingAccasXsd/MultipleCata/cata_CFD2.py new file mode 100755 index 00000000..d743819f --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/cata_CFD2.py @@ -0,0 +1,19 @@ +autonome = 0 +autonome = 1 + +if autonome : + from Accas import * + JdC = JDC_CATA ( + code = 'CFD2', + ) +else : + from cata_CFDCommun import * + implement = 'CFD2:CFDCommun' + importedBy=() + +Proc1DuCFD2=PROC(nom='Proc1DuCFD2', + S1DuCFD2= SIMP(statut='o', typ='I', defaut = 91), +) +Proc2DuCFD2=PROC(nom='Proc2DuCFD2', + S2DuCFD2= SIMP(statut='o', typ='I', defaut = 92), +) diff --git a/Tests/MappingAccasXsd/MultipleCata/cata_CFDCommun.py b/Tests/MappingAccasXsd/MultipleCata/cata_CFDCommun.py new file mode 100755 index 00000000..53880187 --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/cata_CFDCommun.py @@ -0,0 +1,20 @@ +autonome = 0 +autonome = 1 + +if autonome : + from Accas import * + JdC = JDC_CATA ( + code = 'CFDCommun', + ) + importedBy=('CFD1','CFD2','CFDSpecific') +else : + from cata_modeleCommun import * + importedBy=('CFD1','CFD2','CFDSpecific') + implement='CFDCommun:modeleCommun' + +Proc1DuCFDCommun=PROC(nom='Proc1DuCFDCommun', + S1DuCFDCommun= SIMP(statut='o', typ='I', defaut = 91), +) +Proc2DuCFDCommun=PROC(nom='Proc2DuCFDCommun', + S2DuCFDCommun= SIMP(statut='o', typ='I', defaut = 92), +) diff --git a/Tests/MappingAccasXsd/MultipleCata/cata_MD1.py b/Tests/MappingAccasXsd/MultipleCata/cata_MD1.py new file mode 100755 index 00000000..fc7764b7 --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/cata_MD1.py @@ -0,0 +1,19 @@ +autonome = 0 +#import traceback;traceback.print_stack() + +if autonome : + from Accas import * + JdC = JDC_CATA ( + code = 'MD1', + ) +else : + from cata_MDCommun import * + implement='MD1:MDCommun' + importedBy=() + +Proc1DuMD1=PROC(nom='Proc1DuMD1', + S1DuMD1= SIMP(statut='o', typ='I', defaut = 111), +) +Proc2DuMD1=PROC(nom='Proc2DuMD1', + S2DuMD1= SIMP(statut='o', typ='I', defaut = 112), +) diff --git a/Tests/MappingAccasXsd/MultipleCata/cata_MD2.py b/Tests/MappingAccasXsd/MultipleCata/cata_MD2.py new file mode 100755 index 00000000..cad6a7ab --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/cata_MD2.py @@ -0,0 +1,20 @@ +autonome = 0 +autonome = 1 + + +if autonome : + from Accas import * + JdC = JDC_CATA ( + code = 'MD2', + ) +else : + from cata_MDCommun import * + implement='MD2' + importedBy=() + +Proc1DuMD2=PROC(nom='Proc1DuMD2', + S1DuMD2= SIMP(statut='o', typ='I', defaut = 121), +) +Proc2DuMD2=PROC(nom='Proc2DuMD2', + S2DuMD1= SIMP(statut='o', typ='I', defaut = 122), +) diff --git a/Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.py b/Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.py new file mode 100755 index 00000000..ab29397d --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.py @@ -0,0 +1,20 @@ +autonome = 0 + +if autonome : + from Accas import * + JdC = JDC_CATA ( + code = 'MDCommun', + ) + importedBy=('MD1','MD2') +else : + from cata_modeleCommun import * + implement = 'MDCommun:modeleCommun' + importedBy=('MD1','MD2','MDSpecific') + +Proc1DuMDCommun=PROC(nom='Proc1DuMDCommun', + S1DuMDCommun= SIMP(statut='o', typ='I', defaut = 11), +) +Proc2DuMDCommun=PROC(nom='Proc2DuMDCommun', + S2DuMDCommun= SIMP(statut='o', typ='I', defaut = 12), +) + diff --git a/Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.py b/Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.py new file mode 100755 index 00000000..c562edbb --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.py @@ -0,0 +1,13 @@ + +from Accas import * +JdC = JDC_CATA ( + code = 'modeleCommun', +) +importedBy=('MDCommun', 'CFDCommun', 'DomainSpecific') + +Proc1DuModeleCommun=PROC(nom='Proc1DuModeleCommun', + S1DuModeleCommun= SIMP(statut='o', typ='I', defaut = 1), +) +Proc2DuModeleCommun=PROC(nom='Proc2DuModeleCommun', + S2DuModeleCommun= SIMP(statut='o', typ='I', defaut = 2), +) diff --git a/Tests/MappingAccasXsd/MultipleCata/generateXSD.py b/Tests/MappingAccasXsd/MultipleCata/generateXSD.py new file mode 100755 index 00000000..5d92d5ef --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/generateXSD.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" + Ce module sert a lancer EFICAS configure pour Meteo +""" +# Modules Python +# Modules Eficas +import prefs +name='prefs_'+prefs.code +__import__(name) + +import sys +import os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../../..')) + +import prefs +from InterfaceQT4 import eficas_go +eficas_go.genereXSD(code=prefs.code) diff --git a/Tests/MappingAccasXsd/MultipleCata/prefs.py b/Tests/MappingAccasXsd/MultipleCata/prefs.py new file mode 100644 index 00000000..d809d651 --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/prefs.py @@ -0,0 +1,22 @@ +# Copyright (C) 2007-2012 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +code="TestMultipleCata" +import sys, os +if os.path.dirname(os.path.abspath(__file__)) not in sys.path : + sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) diff --git a/Tests/MappingAccasXsd/MultipleCata/prefs_Test.py b/Tests/MappingAccasXsd/MultipleCata/prefs_Test.py new file mode 100644 index 00000000..6b05827f --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/prefs_Test.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# maConfiguration MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +import os,sys +# repIni sert a localiser le fichier editeur.ini +# Obligatoire +repIni=os.path.dirname(os.path.abspath(__file__)) +INSTALLDIR=os.path.join(repIni,'..') +sys.path[:0]=[INSTALLDIR] + + +# lang indique la langue utilisee pour les chaines d'aide : fr ou ang +lang='ang' + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' + +# +#typeDeCata='XML' +catalogues=( +# ('VimmpEssai','VimmpEssai',os.path.join(repIni,'cata_Vimmp_2304.py'),'python','python'), + ('Test1','Test1',os.path.join(repIni,'cata_1.py'),'xml','python'), +# ('Vimmp','Vimmp',os.path.join(repIni,'cata_Vimmp.py'),'xml','python'), +# ('MD','VimmpG',os.path.join(repIni,'cata_gromacs.py'),'xml','python'), +# ('VimmpEN','VimmpEN',os.path.join(repIni,'cata_en.py'),'python','python'), +) +nombreDeBoutonParLigne=4 +#simpleClic=True +closeFrameRechercheCommande=False +closeFrameRechercheCommandeSurPageDesCommandes=True +#boutonDsMenuBar=False +#closeArbre=True +#afficheListesPliees=False +#afficheCommandesPliees = False +afficheCommandesPliees=True +enleverActionStructures = True +enleverParametres = True +enleverSupprimer = True +#ajoutExecution = True +#translatorFichier = os.path.join(repIni,'Meteo') +#withXSD=True +#dumpXSD=True +#afficheIhm=False diff --git a/Tests/MappingAccasXsd/MultipleCata/prefs_TestMultipleCata.py b/Tests/MappingAccasXsd/MultipleCata/prefs_TestMultipleCata.py new file mode 100644 index 00000000..eb2ad270 --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/prefs_TestMultipleCata.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +# maConfiguration MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +import os,sys +# repIni sert a localiser le fichier editeur.ini +# Obligatoire +repIni=os.path.dirname(os.path.abspath(__file__)) +INSTALLDIR=os.path.join(repIni,'..') +sys.path[:0]=[INSTALLDIR] + + +# lang indique la langue utilisee pour les chaines d'aide : fr ou ang +lang='ang' + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' + +# +#typeDeCata='XML' +catalogues=( + ('CFD1' ,'CFD1' ,os.path.join(repIni,'cata_CFD1.py') ,'xml','python'), + ('CFD2' ,'CFD2' ,os.path.join(repIni,'cata_CFD2.py') ,'xml','python'), + ('CFDCommun' ,'CFDCommun' ,os.path.join(repIni,'cata_CFDCommun.py') ,'xml','python'), + ('MD1' ,'MD1' ,os.path.join(repIni,'cata_MD1.py') ,'xml','python'), + ('MD2' ,'MD2' ,os.path.join(repIni,'cata_MD2.py') ,'xml','python'), + ('MDCommun' ,'MDCommun' ,os.path.join(repIni,'cata_MDCommun.py') ,'xml','python'), + ('modeleCommun','modeleCommun' ,os.path.join(repIni,'cata_modeleCommun.py'),'xml','python'), +) + +nombreDeBoutonParLigne=4 +#simpleClic=True +closeFrameRechercheCommande=False +closeFrameRechercheCommandeSurPageDesCommandes=True +#boutonDsMenuBar=False +#closeArbre=True +#afficheListesPliees=False +#afficheCommandesPliees = False +afficheCommandesPliees=True +enleverActionStructures = True +enleverParametres = True +enleverSupprimer = True +#ajoutExecution = True +#translatorFichier = os.path.join(repIni,'Meteo') +#withXSD=True +#dumpXSD=True +#afficheIhm=False diff --git a/Tests/MappingAccasXsd/MultipleCata/qtEficasTest.py b/Tests/MappingAccasXsd/MultipleCata/qtEficasTest.py new file mode 100755 index 00000000..7f785dc4 --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/qtEficasTest.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" + Ce module sert a lancer EFICAS configure pour TEST +""" +# Modules Python +# Modules Eficas +import prefs +name='prefs_'+prefs.code +__import__(name) + +import sys +import os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../../..')) + +import prefs +from InterfaceQT4 import eficas_go +eficas_go.lanceEficas(code=prefs.code) diff --git a/Tests/MappingAccasXsd/MultipleCata/xml.xsd b/Tests/MappingAccasXsd/MultipleCata/xml.xsd new file mode 120000 index 00000000..1216c3fd --- /dev/null +++ b/Tests/MappingAccasXsd/MultipleCata/xml.xsd @@ -0,0 +1 @@ +../xml.xsd \ No newline at end of file diff --git a/Tests/MappingAccasXsd/TestMultipleCata/Makefile b/Tests/MappingAccasXsd/TestMultipleCata/Makefile deleted file mode 100755 index a0830328..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -SUFFIXES= .xsd - -PYXB=pyxbgen - -#$(PYXB) -m $(basename $@) -u $< --location-prefix-rewrite http://chercheurs.edf.com/logiciels/vimmp= --write-for-customization \ -# L'utilisation de $? ne fonctionne pas dans le cas de catalogues multiple. -# En effet, si on modifie un seul catalogue, $? donne uniquement le fichier modifié et pyxb détecte -# que notre génération dépend du fichier non modifié qui n'est pas passé en paramètre et qui n'est pas regénéré. -# Une solution constiste à utiliser $^ - -#xmllint ne semble pas vérifier les includes... - -.SUFFIXES: _genere.xsd _genere.py .py - -.py_genere.xsd: - python2 ./generateXSD.py -c ./$< - -_genere.xsd_genere.py: - xmllint --schema XMLSchema11_local.xsd --xinclude --noout $^ - $(PYXB) -m $(basename $@) -u $^ --write-for-customization - - - -all: xsdAll driverAll - -xsdAll: xsdTestMutlipleCata -driverAll: pyTestMutlipleCata - -#Ecrire une génération des dépendences à partir des includes xsd -cata_MDCommun_genere.xsd: cata_modeleCommun_genere.xsd -cata_CFDCommun_genere.xsd: cata_modeleCommun_genere.xsd -cata_MD1_genere.xsd: cata_MDCommun_genere.xsd cata_modeleCommun_genere.xsd -cata_MD2_genere.xsd: cata_MDCommun_genere.xsd cata_modeleCommun_genere.xsd -cata_CFD1_genere.xsd: cata_CFDCommun_genere.xsd cata_modeleCommun_genere.xsd -cata_CFD2_genere.xsd: cata_CFDCommun_genere.xsd cata_modeleCommun_genere.xsd - -xsdTestMutlipleCata: cata_CFD1_genere.xsd cata_CFD2_genere.xsd cata_CFDCommun_genere.xsd cata_MD1_genere.xsd cata_MD2_genere.xsd cata_MDCommun_genere.xsd cata_modeleCommun_genere.xsd - -pyTestMutlipleCata: cata_CFD1_genere.py cata_CFD2_genere.py cata_CFDCommun_genere.py cata_MD1_genere.py cata_MD2_genere.py cata_MDCommun_genere.py cata_modeleCommun_genere.py - - -xml: - @echo "Reminder: a .comm file is needed for this step" - ./generateXML.py -c cata_1.py cata_1_test_1.comm - -clean: - rm -f *.pyc *~ - rm -rf *_genere.py raw __pycache__ - rm -f *_genere.xsd - -check: - xmllint --schema XMLSchema11.xsd cata_1_genere.xsd - diff --git a/Tests/MappingAccasXsd/TestMultipleCata/XMLSchema11_local.xsd b/Tests/MappingAccasXsd/TestMultipleCata/XMLSchema11_local.xsd deleted file mode 120000 index db58cd92..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/XMLSchema11_local.xsd +++ /dev/null @@ -1 +0,0 @@ -../XMLSchema11_local.xsd \ No newline at end of file diff --git a/Tests/MappingAccasXsd/TestMultipleCata/cata_CFD1.py b/Tests/MappingAccasXsd/TestMultipleCata/cata_CFD1.py deleted file mode 100755 index 93837630..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/cata_CFD1.py +++ /dev/null @@ -1,20 +0,0 @@ -autonome = 0 -#autonome = 1 - -if autonome : - from Accas import * - JdC = JDC_CATA ( - code = 'CFD1', - ) - importedBy=() -else : - from cata_CFDCommun import * - implement='CFD1:CFDCommun' - importedBy=() - -Proc1DuCFD1=PROC(nom='Proc1DuCFD1', - S1DuCFD1= SIMP(statut='o', typ='I', defaut = 91), -) -Proc2DuCFD1=PROC(nom='Proc2DuCFD1', - S2DuCFD1= SIMP(statut='o', typ='I', defaut = 92), -) diff --git a/Tests/MappingAccasXsd/TestMultipleCata/cata_CFD2.py b/Tests/MappingAccasXsd/TestMultipleCata/cata_CFD2.py deleted file mode 100755 index d743819f..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/cata_CFD2.py +++ /dev/null @@ -1,19 +0,0 @@ -autonome = 0 -autonome = 1 - -if autonome : - from Accas import * - JdC = JDC_CATA ( - code = 'CFD2', - ) -else : - from cata_CFDCommun import * - implement = 'CFD2:CFDCommun' - importedBy=() - -Proc1DuCFD2=PROC(nom='Proc1DuCFD2', - S1DuCFD2= SIMP(statut='o', typ='I', defaut = 91), -) -Proc2DuCFD2=PROC(nom='Proc2DuCFD2', - S2DuCFD2= SIMP(statut='o', typ='I', defaut = 92), -) diff --git a/Tests/MappingAccasXsd/TestMultipleCata/cata_CFDCommun.py b/Tests/MappingAccasXsd/TestMultipleCata/cata_CFDCommun.py deleted file mode 100755 index 53880187..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/cata_CFDCommun.py +++ /dev/null @@ -1,20 +0,0 @@ -autonome = 0 -autonome = 1 - -if autonome : - from Accas import * - JdC = JDC_CATA ( - code = 'CFDCommun', - ) - importedBy=('CFD1','CFD2','CFDSpecific') -else : - from cata_modeleCommun import * - importedBy=('CFD1','CFD2','CFDSpecific') - implement='CFDCommun:modeleCommun' - -Proc1DuCFDCommun=PROC(nom='Proc1DuCFDCommun', - S1DuCFDCommun= SIMP(statut='o', typ='I', defaut = 91), -) -Proc2DuCFDCommun=PROC(nom='Proc2DuCFDCommun', - S2DuCFDCommun= SIMP(statut='o', typ='I', defaut = 92), -) diff --git a/Tests/MappingAccasXsd/TestMultipleCata/cata_MD1.py b/Tests/MappingAccasXsd/TestMultipleCata/cata_MD1.py deleted file mode 100755 index fc7764b7..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/cata_MD1.py +++ /dev/null @@ -1,19 +0,0 @@ -autonome = 0 -#import traceback;traceback.print_stack() - -if autonome : - from Accas import * - JdC = JDC_CATA ( - code = 'MD1', - ) -else : - from cata_MDCommun import * - implement='MD1:MDCommun' - importedBy=() - -Proc1DuMD1=PROC(nom='Proc1DuMD1', - S1DuMD1= SIMP(statut='o', typ='I', defaut = 111), -) -Proc2DuMD1=PROC(nom='Proc2DuMD1', - S2DuMD1= SIMP(statut='o', typ='I', defaut = 112), -) diff --git a/Tests/MappingAccasXsd/TestMultipleCata/cata_MD2.py b/Tests/MappingAccasXsd/TestMultipleCata/cata_MD2.py deleted file mode 100755 index cad6a7ab..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/cata_MD2.py +++ /dev/null @@ -1,20 +0,0 @@ -autonome = 0 -autonome = 1 - - -if autonome : - from Accas import * - JdC = JDC_CATA ( - code = 'MD2', - ) -else : - from cata_MDCommun import * - implement='MD2' - importedBy=() - -Proc1DuMD2=PROC(nom='Proc1DuMD2', - S1DuMD2= SIMP(statut='o', typ='I', defaut = 121), -) -Proc2DuMD2=PROC(nom='Proc2DuMD2', - S2DuMD1= SIMP(statut='o', typ='I', defaut = 122), -) diff --git a/Tests/MappingAccasXsd/TestMultipleCata/cata_MDCommun.py b/Tests/MappingAccasXsd/TestMultipleCata/cata_MDCommun.py deleted file mode 100755 index 626e498e..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/cata_MDCommun.py +++ /dev/null @@ -1,20 +0,0 @@ -autonome = 0 - -if autonome : - from Accas import * - JdC = JDC_CATA ( - code = 'MDCommun', - ) - importedBy=('MD1','MD2','MDSpecific') -else : - from cata_modeleCommun import * - implement = 'MDCommun:modeleCommun' - importedBy=('MD1','MD2','MDSpecific') - -Proc1DuMDCommun=PROC(nom='Proc1DuMDCommun', - S1DuMDCommun= SIMP(statut='o', typ='I', defaut = 11), -) -Proc2DuMDCommun=PROC(nom='Proc2DuMDCommun', - S2DuMDCommun= SIMP(statut='o', typ='I', defaut = 12), -) - diff --git a/Tests/MappingAccasXsd/TestMultipleCata/cata_modeleCommun.py b/Tests/MappingAccasXsd/TestMultipleCata/cata_modeleCommun.py deleted file mode 100755 index 06b44dd0..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/cata_modeleCommun.py +++ /dev/null @@ -1,13 +0,0 @@ - -from Accas import * -JdC = JDC_CATA ( - code = 'modeleCommun', -) -importedBy=('MDCommun', 'CFDCommun', 'DomainSpecfic') - -Proc1DuModeleCommun=PROC(nom='Proc1DuModeleCommun', - S1DuModeleCommun= SIMP(statut='o', typ='I', defaut = 1), -) -Proc2DuModeleCommun=PROC(nom='Proc2DuModeleCommun', - S2DuModeleCommun= SIMP(statut='o', typ='I', defaut = 2), -) diff --git a/Tests/MappingAccasXsd/TestMultipleCata/generateXSD.py b/Tests/MappingAccasXsd/TestMultipleCata/generateXSD.py deleted file mode 100755 index 5d92d5ef..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/generateXSD.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2013 EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -""" - Ce module sert a lancer EFICAS configure pour Meteo -""" -# Modules Python -# Modules Eficas -import prefs -name='prefs_'+prefs.code -__import__(name) - -import sys -import os -sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../../..')) - -import prefs -from InterfaceQT4 import eficas_go -eficas_go.genereXSD(code=prefs.code) diff --git a/Tests/MappingAccasXsd/TestMultipleCata/prefs.py b/Tests/MappingAccasXsd/TestMultipleCata/prefs.py deleted file mode 100644 index d809d651..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/prefs.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2007-2012 EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -code="TestMultipleCata" -import sys, os -if os.path.dirname(os.path.abspath(__file__)) not in sys.path : - sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) diff --git a/Tests/MappingAccasXsd/TestMultipleCata/prefs_Test.py b/Tests/MappingAccasXsd/TestMultipleCata/prefs_Test.py deleted file mode 100644 index 6b05827f..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/prefs_Test.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*- coding: utf-8 -*- -# maConfiguration MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. -# -# -# ====================================================================== - -import os,sys -# repIni sert a localiser le fichier editeur.ini -# Obligatoire -repIni=os.path.dirname(os.path.abspath(__file__)) -INSTALLDIR=os.path.join(repIni,'..') -sys.path[:0]=[INSTALLDIR] - - -# lang indique la langue utilisee pour les chaines d'aide : fr ou ang -lang='ang' - -# Codage des strings qui accepte les accents (en remplacement de 'ascii') -encoding='iso-8859-1' - -# -#typeDeCata='XML' -catalogues=( -# ('VimmpEssai','VimmpEssai',os.path.join(repIni,'cata_Vimmp_2304.py'),'python','python'), - ('Test1','Test1',os.path.join(repIni,'cata_1.py'),'xml','python'), -# ('Vimmp','Vimmp',os.path.join(repIni,'cata_Vimmp.py'),'xml','python'), -# ('MD','VimmpG',os.path.join(repIni,'cata_gromacs.py'),'xml','python'), -# ('VimmpEN','VimmpEN',os.path.join(repIni,'cata_en.py'),'python','python'), -) -nombreDeBoutonParLigne=4 -#simpleClic=True -closeFrameRechercheCommande=False -closeFrameRechercheCommandeSurPageDesCommandes=True -#boutonDsMenuBar=False -#closeArbre=True -#afficheListesPliees=False -#afficheCommandesPliees = False -afficheCommandesPliees=True -enleverActionStructures = True -enleverParametres = True -enleverSupprimer = True -#ajoutExecution = True -#translatorFichier = os.path.join(repIni,'Meteo') -#withXSD=True -#dumpXSD=True -#afficheIhm=False diff --git a/Tests/MappingAccasXsd/TestMultipleCata/prefs_TestMultipleCata.py b/Tests/MappingAccasXsd/TestMultipleCata/prefs_TestMultipleCata.py deleted file mode 100644 index eb2ad270..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/prefs_TestMultipleCata.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -# maConfiguration MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. -# -# -# ====================================================================== - -import os,sys -# repIni sert a localiser le fichier editeur.ini -# Obligatoire -repIni=os.path.dirname(os.path.abspath(__file__)) -INSTALLDIR=os.path.join(repIni,'..') -sys.path[:0]=[INSTALLDIR] - - -# lang indique la langue utilisee pour les chaines d'aide : fr ou ang -lang='ang' - -# Codage des strings qui accepte les accents (en remplacement de 'ascii') -encoding='iso-8859-1' - -# -#typeDeCata='XML' -catalogues=( - ('CFD1' ,'CFD1' ,os.path.join(repIni,'cata_CFD1.py') ,'xml','python'), - ('CFD2' ,'CFD2' ,os.path.join(repIni,'cata_CFD2.py') ,'xml','python'), - ('CFDCommun' ,'CFDCommun' ,os.path.join(repIni,'cata_CFDCommun.py') ,'xml','python'), - ('MD1' ,'MD1' ,os.path.join(repIni,'cata_MD1.py') ,'xml','python'), - ('MD2' ,'MD2' ,os.path.join(repIni,'cata_MD2.py') ,'xml','python'), - ('MDCommun' ,'MDCommun' ,os.path.join(repIni,'cata_MDCommun.py') ,'xml','python'), - ('modeleCommun','modeleCommun' ,os.path.join(repIni,'cata_modeleCommun.py'),'xml','python'), -) - -nombreDeBoutonParLigne=4 -#simpleClic=True -closeFrameRechercheCommande=False -closeFrameRechercheCommandeSurPageDesCommandes=True -#boutonDsMenuBar=False -#closeArbre=True -#afficheListesPliees=False -#afficheCommandesPliees = False -afficheCommandesPliees=True -enleverActionStructures = True -enleverParametres = True -enleverSupprimer = True -#ajoutExecution = True -#translatorFichier = os.path.join(repIni,'Meteo') -#withXSD=True -#dumpXSD=True -#afficheIhm=False diff --git a/Tests/MappingAccasXsd/TestMultipleCata/qtEficasTest.py b/Tests/MappingAccasXsd/TestMultipleCata/qtEficasTest.py deleted file mode 100755 index 7f785dc4..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/qtEficasTest.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2013 EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -""" - Ce module sert a lancer EFICAS configure pour TEST -""" -# Modules Python -# Modules Eficas -import prefs -name='prefs_'+prefs.code -__import__(name) - -import sys -import os -sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../../..')) - -import prefs -from InterfaceQT4 import eficas_go -eficas_go.lanceEficas(code=prefs.code) diff --git a/Tests/MappingAccasXsd/TestMultipleCata/xml.xsd b/Tests/MappingAccasXsd/TestMultipleCata/xml.xsd deleted file mode 120000 index 1216c3fd..00000000 --- a/Tests/MappingAccasXsd/TestMultipleCata/xml.xsd +++ /dev/null @@ -1 +0,0 @@ -../xml.xsd \ No newline at end of file diff --git a/docCataWriter/xsd_mapping.rst b/docCataWriter/xsd_mapping.rst index 5b07ef71..7016b675 100644 --- a/docCataWriter/xsd_mapping.rst +++ b/docCataWriter/xsd_mapping.rst @@ -757,7 +757,7 @@ The element declaration is : Understanding the XSD mapping for BLOC ______________________________________ -As explain in :ref:`bloc-label` section, the *BLOC* keyword provides a conditional way to make appear a group of elements. Apart of the *condition* eficas attribute, it's quite the same as the *FACT* keyword. +As explain in :ref:`bloc-label` section, the *BLOC* keyword provides a conditional way to activate a group of elements. Apart from the *condition* eficas attribute, it's quite the same as the *FACT* keyword. If we review the following catalog from the :ref:`fact-label` section : @@ -765,8 +765,8 @@ If we review the following catalog from the :ref:`fact-label` section : :language: python :start-after: Test_proc_5 :end-before: #Test_proc_5 - -You get the two xsd complex types using the **** xsd element : + +The xsd mapping provides two **** elements : .. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd :language: xml @@ -777,10 +777,8 @@ You get the two xsd complex types using the **** xsd element : :language: xml :start-at: name="T_frequ_not_every" :end-at: /xs:group - -The content of these groups may appear or not in the parent structure. If they appear, they will appear "as is", without any additionnal element definition. This mecanism comes from the use of the **group ref** xsd statement : - -The **group ref** declarations are : + +The parent xsd type uses **group ref** declarations : .. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd :language: xml @@ -788,9 +786,11 @@ The **group ref** declarations are : :start-after: name="T_Test_proc_5" :end-before: /xs:complexType -.. note:: Note that **minOccurs** is always 0 and **maxOccurs** is always 1. This is because *BLOC* does not have *min*,*max* eficas attributes. +The content of these groups may appear or not in the parent structure. +Using **group ref** allows the apparition of group content without any additionnal element level. +Considering the *BLOC* semantic, the **minOccurs** attribute is always 0 and **maxOccurs** is always 1. -.. note:: A ambiguity problem may appear if the an element with the same name is present in different group's content. +.. note:: An ambiguity problem may appear if an element with the same name is present in different group's contents. .. todo:: The *BLOC* xsd mapping must be refine. We may use **key**, **keyref** xsd element to restrict the possibility of activating only one branch of the conditional. However, the semantic of the *BLOC* keyword is wide. @@ -805,8 +805,153 @@ We may have that kind of usescases : Understanding the XSD mapping for included catalogs ___________________________________________________ +Eficas offers the possibility to include one catalog from an other. There will be a main catalog from which the *JdC* keyword is defined and non-main catalogs from which there is no *JdC* keyword. A catalog may be included mutiple times in different catalogs. Whatever the catalog is (main/non-main), it is mandatory to declare : + * from which the current catalog may be included using the *importedBy* keyword + * the code name for which the data model is implemented by the current catalog. This is done thanks to the *code* keyword in the *JdC* of the main catalog and thanks to the *implement* keyword non-main catalog. + +Here is an exemple with three levels of catalogs. + +First, the main common catalog : +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.py + :language: python + +The *JdC* definition declares the main property of this catalog. + + +The given values in the *importedBy* keyword declare middle level/domain specific catalogs that may import this catalog. + +For each catalog declared in the *importedBy* keyword **one global xsd type and one global element declaration** are produced : + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd + :language: xml + :start-at: name="T_MDCommun_Abstract" + :end-at: name="T_MDCommun_Abstract" + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd + :language: xml + :start-at: name="MDCommun_Abstract" + :end-at: name="MDCommun_Abstract" + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd + :language: xml + :start-at: name="T_CFDCommun_Abstract" + :end-at: name="T_CFDCommun_Abstract" + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd + :language: xml + :start-at: name="CFDCommun_Abstract" + :end-at: name="CFDCommun_Abstract" + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd + :language: xml + :start-at: name="T_DomainSpecific_Abstract" + :end-at: name="T_DomainSpecific_Abstract" + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd + :language: xml + :start-at: name="DomainSpecific_Abstract" + :end-at: name="DomainSpecific_Abstract" + +The **abstract="true"** attribute implies that the xsd type have be be derivated in subsequent catalogs to be concretly defined. + +The abstract complex type says nothing about what will be the concrete type. + +.. note:: If *importedBy* keyword is not defined, there will be no generation of xsd abstract types. + +The root xsd is element type is : + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd + :language: xml + :start-at: name="T_modeleCommun" + :end-at: /xs:complexType + +.. note:: The three *importedBy* catalogs appear as optional **element ref**. This give the possibility to complete the main root catalog with elements coming from subsequent catalogs knowing nothing about them. + +Second, the intermediate/domain specific catalog : +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This catalog finality is to gather common informations from a class of code. For example, it could be a "domain specific catalog". + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.py + :language: python + +* Since a catalog is a python script, it is possible to define an *autonome* variable to easily switch between a main/non-main catalog. +* A main catalog must declare a *JdC = JDC_CATA* definition as explained in :ref:`Defining-steps-in-a-catalog` (in our example, if *autonome* is True). +* In this example, the *importedBy* values declare the specific/final catalogs 'MD1', 'MD2' and 'MDSpecific' that may use this catalog. +* The *implement* keyword declares the abstract typename it implements and from which catalog. In this example, it implements the **T_MDCommun_Abstract** type from the *modeleCommun* catalog. + +For each catalog declared in the *importedBy* keyword we get global xsd types and global element declaration production (as for the upper level before) : + + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd + :language: xml + :start-at: name="T_MD1_Abstract" + :end-at: name="T_MD1_Abstract" + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd + :language: xml + :start-at: name="MD1_Abstract" + :end-at: name="MD1_Abstract" + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd + :language: xml + :start-at: name="T_MD2_Abstract" + :end-at: name="T_MD2_Abstract" + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd + :language: xml + :start-at: name="MD2_Abstract" + :end-at: name="MD2_Abstract" + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd + :language: xml + :start-at: name="T_MDSpecific_Abstract" + :end-at: name="T_MDSpecific_Abstract" + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd + :language: xml + :start-at: name="MDSpecific_Abstract" + :end-at: name="MDSpecific_Abstract" + +As in the main catalog, the **abstract="true"** attribute implies that the xsd type must be derivated in subsequent catalogs to be concretly defined. +The abstract complex type still says nothing about what will be the concrete type. + +The root xsd element type is : + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd + :language: xml + :start-at: name="T_MDCommun" + :end-at: /xs:complexType + +.. note:: Notice the presence of our three *importedBy* catalogs that appear as optional **element ref**. This give the possibility to complete the intermediate root catalog with elements coming from subsequent catalogs. Since the root main common catalog hosts itself intermediate elements, we have a sort of transitivity which allows to produce a unique xsd file combining different levels of description. + +Third, the final/specific catalog : +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In our three level exemple, this level is the final/fully specialized catalog. + + +Nobody includes it since *importedBy* is empty. + +This catalog finality is to describe all the informations that are not in the scope of the common model or domain specific codes but are specfic to a code. +Many code specific catalogs may use the same intermediate catalog or even directly the common catalog. + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MD1.py + :language: python + +* The *importedBy* keyword is empty. It could be absent only in standalone catalogs. In this example, if the *importedBy* keyword is omitted, since the catalog imports (in the python way) the intermediate one, *importedBy* keyword would have the value defined in the intermediate catalog. +* The *implement* keyword still declares the abstract typename it implements and from which catalog. In this example, it implements the **T_MD1_Abstract** type from the *MDCommun* catalog. + +Since the *importedBy* keyword is empty, there is no abstract type production. + +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MD1_genere.xsd + :language: xml + :start-at: name="T_MD1" + :end-at: /xs:complexType - Understanding the XSD mapping for RULES _______________________________________ +.. todo:: Not implemented yet.