root/trunk/Wsp_Modeling/spaces/gen/modelBuilder/bs.doss/_common/sm/wspDef/bsWspDef.xml @ 14275

Revision 14275, 15.8 KB (checked in by sam, 10 months ago)

ajout @displayMode sur sm:groop

  • Property svn:mime-type set to text/plain
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3/* LICENCE[[
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1/CeCILL 2.O
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is utc.fr code.
16 *
17 * The Initial Developer of the Original Code is
18 * sylvain.spinelli@kelis.fr on behalf of UTC
19 *
20 * Portions created by the Initial Developer are Copyright (C) 2006
21 * the Initial Developer. All Rights Reserved.
22 *
23 * Contributor(s):
24 *
25 *
26 * Alternatively, the contents of this file may be used under the terms of
27 * either of the GNU General Public License Version 2 or later (the "GPL"),
28 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * or the CeCILL Licence Version 2.0 (http://www.cecill.info/licences.en.html),
30 * in which case the provisions of the GPL, the LGPL or the CeCILL are applicable
31 * instead of those above. If you wish to allow use of your version of this file
32 * only under the terms of either the GPL, the LGPL or the CeCILL, and not to allow
33 * others to use your version of this file under the terms of the MPL, indicate
34 * your decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL, the LGPL or the CeCILL. If you do not
36 * delete the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL, the LGPL or the CeCILL.
38 * ]]LICENCE
39 */
40-->
41<racineimport
42        xmlns:sm="http://www.utc.fr/ics/scenari/v3/modeling"
43        xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
44        xmlns:java="http://xml.apache.org/xslt/java"
45        version="1.0">
46
47        <!--
48                @API class en mode read-only (soft ou hard).
49                arguments : idAgent correspondant à la class concernée.
50        -->
51        <valeur code="isReadOnly">
52                <source type="xpathOnSrc-dynamique">contains(sm:publicClasses//sm:class[getIdFromPath(@sc:refUri) = $vArguments]/@access, 'readOnly')</source>
53        </valeur>
54        <!--
55                @API class en mode read-only hard : lock à l'écriture dans l'éditeur et dans les SS, donc pas de renommage des liens fils possibles.
56                arguments : idAgent correspondant à la class concernée.
57        -->
58        <valeur code="isReadOnlyHard">
59                <source type="xpathOnSrc-dynamique">sm:publicClasses//sm:class[getIdFromPath(@sc:refUri) = $vArguments]/@access='readOnlyHard'</source>
60        </valeur>
61        <!--
62                @API class avec un creator.
63                arguments : idAgent correspondant à la class concernée.
64        -->
65        <valeur code="isWithCreator">
66                <source type="xpathOnSrc-dynamique">not(sm:publicClasses//sm:class[getIdFromPath(@sc:refUri) = $vArguments]/@access!='readWrite')</source>
67        </valeur>
68        <!--
69                @API liste des skins d'un generator : permet à chaque générateur de se copier ses skins.
70                Retourne un jeu de balises [x][xxx code="" sc:refUri=""/][/x]
71                (n'exploiter que ces 2 attributs indépendamment du nom de la balise et autres attrs ou sous-balises)
72                arguments : idAgent correspondant au generator concerné.
73        -->
74        <valeur code="listSkins">
75                <source type="xpathOnSrc-dynamique">sm:generatorSkins/sm:generator[getIdFromPath(@sc:refUri) = $vArguments]</source>
76        </valeur>
77       
78        <!--
79                @API version de SC
80         -->
81         <valeur code="scenari.version">
82                <source type="xpath-dynamique">concat(resultatAgent('major'),'.',resultatAgent('medium'),'.',resultatAgent('minor'))</source>
83                <valeur code="major"><source type="fixe-systemProperties">{scenari.version.major}</source></valeur>
84                <valeur code="medium"><source type="fixe-systemProperties">{scenari.version.medium}</source></valeur>
85                <valeur code="minor"><source type="fixe-systemProperties">{scenari.version.minor}</source></valeur>
86         </valeur>
87         
88         <!--
89                @API version du wsp
90         -->
91         <valeur code="wsp.version">
92                <source type="xpath-statique">concat(@majorVersion,'.',@mediumVersion,'.',@minorVersion)</source>
93                <valeur code="major"><source type="xpath-statique">@majorVersion</source></valeur>
94                <valeur code="medium"><source type="xpath-statique">@mediumVersion</source></valeur>
95                <valeur code="minor"><source type="xpath-statique">@minorVersion</source></valeur>
96         </valeur>
97       
98        <!-- ### -->
99        <!-- # Configuration de la génération  (API du compilateur)-->
100        <!-- # -->
101        <!-- @API Exploité uniquement si modeGen="test". -->
102        <paramText code="buildSS">
103                <intitule>Compilation des feuilles de stockage</intitule>
104                <descriptif>Permet de compiler les feuilles de stockage du modèle.</descriptif>
105                <valDefaut>true</valDefaut>
106        </paramText>
107        <!-- @API Exploité uniquement si modeGen="test". -->
108        <paramText code="buildES">
109                <intitule>Compilation des feuilles d'édition</intitule>
110                <descriptif>Permet de compiler l'interface graphique du modèle dans SCENARI chain.</descriptif>
111                <valDefaut>true</valDefaut>
112        </paramText>
113               
114        <!-- @API Page des options de compilation en mode test.
115        -->
116        <pageParametres code="testOptionsPage">
117                <intitule>Compilation</intitule>
118                <contenu type="xsl-dynamique">
119                        <xsl:stylesheet
120                                        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
121                                        version="1.0">
122                                <xsl:output method="xml" omit-xml-declaration="yes"/>
123                                <xsl:param name="vDialog"/>
124                                <xsl:param name="vAgent"/>
125                                <xsl:template match="*">
126                                        <div style="margin-left:30px;">
127                                                <div><inputCheckBox agent="//buildSS" afterchange="saveChanges();"/></div>
128                                                <div><inputCheckBox agent="//buildES" afterchange="saveChanges();"/></div>
129                                                <xsl:for-each select="listGenerators()">
130                                                        <xsl:sort select="resultatAgent(codeGenerator)"/>
131                                                        <div><inputCheckBox agent="{pathAgent(.)}/buildGen" afterchange="saveChanges();"/></div>
132                                                </xsl:for-each>
133                                        </div>
134                                </xsl:template>
135                        </xsl:stylesheet>
136                </contenu>
137        </pageParametres>
138
139        <!-- ### -->
140        <!-- # Liens vers d'autres modèles -->
141        <!-- # -->
142       
143        <!-- @API links : set de structures définissant les liens vers les primitives. -->
144        <set code="links">
145                <structure code="root" racine="sm:publicClasses//sm:class" codecomposant="getIdFromPath(@sc:refUri)">
146                        <listenoeuds>
147                                <noeud cle="root" type="singleton">
148                                        <ref type="xpath-statique">concat('@', getIdFromPath(@sc:refUri))</ref>
149                                </noeud>
150                        </listenoeuds>
151                </structure>
152        </set>
153       
154        <!-- ### -->
155        <!-- # Migration -->
156        <!-- # -->
157       
158        <valeur code="wspMigration">
159                <actif type="xpath-statique">count(sm:migration/*)&gt;0</actif>
160                <source type="xslOnSrc-dynamique" href="bsco:sm/wspDef/export.migration.xsl"/>
161        </valeur>
162
163        <!-- ### -->
164        <!-- # Feuilles d'edition -->
165        <!-- # -->
166        <affichage code="pack.js">
167                <urlPage>content/pack.js</urlPage>
168                <page>
169                        <zone cle="mainZone" type="inclusion-dynamique">
170                                <source href="bsco:sm/wspDef/pack.js.txt"/>
171                        </zone>
172                        <zone cle="content-type">text/javascript; charset=UTF-8</zone>
173                </page>
174        </affichage>
175       
176        <valeur code="registerModelInPack">
177                <source type="crossModels">agent=//registerModelInPack&amp;filter=standaloneModels&amp;throughAll=true</source>
178        </valeur>
179       
180        <valeur code="addCreatorItemsInPack">
181                <source type="xslOnSrc-dynamique">
182                        <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sm="http://www.utc.fr/ics/scenari/v3/modeling" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" version="1.0">
183                                <xsl:output method="text"/>
184                                <xsl:param name="vAgent"/>
185                                <xsl:param name="vDialog"/>
186                                <xsl:template match="/*">
187                                        <xsl:apply-templates select="sm:publicClasses/*" mode="groups"/>
188vPack.addCreatorItem = function(pModel, pCreatorItemMgr){               
189        var vCreator;
190        var vCreatorList;
191        var vSortKey;
192        switch(pModel){
193        <xsl:apply-templates select="sm:publicClasses/*" mode="switch">
194                <xsl:with-param name="pFolders"/>
195        </xsl:apply-templates>
196        }
197        if(vCreator) {
198                vCreator.fSortKey = vSortKey;
199                pCreatorItemMgr.addCreatorItem(vCreator);
200        }
201        if(vCreatorList) {
202                for(var ii=0;ii&lt;vCreatorList.length;ii++){
203                        vCreatorList[ii].fSortKey = vSortKey;
204                        pCreatorItemMgr.addCreatorItem(vCreatorList[ii]);
205                }
206        }
207}
208                                </xsl:template>
209                                <xsl:template match="sm:group" mode="groups">
210                                        vPack.fFold<xsl:value-of select="generate-id(.)"/> = new CreatorItemFolder("<xsl:value-of select="returnFirst(@sortKey, format-number(count(preceding-sibling::*)+1, '0000'))"/>", "<xsl:value-of select="chaineProtegeJs(@name)"/>", null, null, 1,<xsl:value-of select="si(@displayMode='open','true',si(@displayMode='closed','false','null'))"/>)
211                                        <xsl:apply-templates mode="groups"/>
212                                </xsl:template>
213                                <xsl:template match="*" mode="groups"/>
214                                <xsl:template match="sm:group" mode="switch">
215                                        <xsl:param name="pFolders"/>
216                                        <xsl:apply-templates mode="switch">
217                                                <xsl:with-param name="pFolders">
218                <xsl:value-of select="$pFolders"/>pCreatorItemMgr.gotoChildFolder(this.fFold<xsl:value-of select="generate-id(.)"/>);
219                </xsl:with-param>
220                                        </xsl:apply-templates>
221                                </xsl:template>
222                                <xsl:template match="sm:class" mode="switch">
223                                        <xsl:param name="pFolders"/>
224                                        <xsl:variable name="vModel" select="getIdFromPath(@sc:refUri)"/>       
225                                        <xsl:if test="resultatAgent('@@/isWithCreator', $vModel)='true'">       
226                case "<xsl:value-of select="resultatAgent(concat('@', $vModel, '/codeModel'))"/>" : {
227                        <xsl:value-of select="resultatAgent(concat('@', $vModel, '/creatorItemInPack'))"/>
228                        vSortKey = "<xsl:value-of select="returnFirst(@sortKey, format-number(count(preceding-sibling::*)+1, '0000'))"/>";
229                        <xsl:value-of select="$pFolders"/>break;
230                }</xsl:if>
231                                </xsl:template>
232                                <xsl:template match="*" mode="switch"/>
233                        </xsl:stylesheet>
234                </source>
235        </valeur>
236       
237        <!-- @API en mode export, valeur appelée par le ModelGenerator pour créer le fichier install.rdf -->
238        <valeur code="install.rdf">
239                <source type="inclusion-dynamique">
240                        <source href="bs:install.rdf.txt"/>
241                </source>
242        </valeur>
243       
244        <!-- @API en mode export, valeur appelée par le ModelGenerator pour créer le fichier chrome.manifest -->
245        <valeur code="chrome.manifest">
246                <source type="inclusion-dynamique">
247                        <source href="bsco:sm/wspDef/chrome.manifest.txt"/>
248                </source>
249                <valeur code="declWspTypeAgt"><source type="xpath-dynamique">resultatAgent('@@/createPack','act:')</source></valeur>
250        </valeur>
251       
252        <!-- @API en mode appGen, valeur appelée par le ModelGenerator pour créer le fichier chrome.manifest -->
253        <valeur code="chrome.manifest.appGen">
254                <source type="resultat-dynamique">agent=//chrome.manifest</source>
255        </valeur>
256       
257        <!-- @API en mode export, description du pack -->
258        <valeur code="installpack.xml">
259            <source type="xslOnSrc-dynamique" href="bs:installpack.xml.xsl"/>
260        </valeur>
261       
262        <!-- Création du content/pack.xml dans le chrome -->
263        <affichage code="createPack">
264                <urlPage>content/pack.xml</urlPage>
265                <page>
266                        <zone cle="mainZone" type="inclusion-dynamique">
267                                <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
268<pack code="[![agent=//chromeCode]!]" version="[![agent=//version]!]">
269        [![agent=//wspTypeUi]!]
270        [![agent=//wspType]!]
271</pack>]]></source>
272                        </zone>
273                </page>
274        </affichage>
275       
276        <valeur code="wspType">
277                <source type="xslOnSrc-dynamique" href="bs:export.wsptype.xsl"/>
278        </valeur>
279       
280        <valeur code="wspTypeUi">
281                <source type="xslOnSrc-dynamique" href="bs:export.wsptypeui.xsl"/>
282        </valeur>
283       
284        <!-- @API définition du pack dans les res du serveur (appelé par ModelGenerator.java) -->
285        <groupAffichage code="packageWspType">
286                <affichage code="createWspType">
287                        <urlPage>wsptype.xml</urlPage>
288                        <page>
289                                <zone cle="mainZone" type="inclusion-dynamique">
290                                        <source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
291<pack>
292        [![agent=//wspType]!]
293</pack>]]></source>
294                                </zone>
295                        </page>
296                </affichage>
297                <link>//wspMigration</link>
298        </groupAffichage>
299       
300       
301               
302        <!-- @API Pour le générateur RelaxNG-->
303        <valeur code="publishRelaxNg">
304                <source type="crossModels">agent=//relaxNgFile&amp;filter=standaloneModels&amp;throughAll=true&amp;arguments=act:</source>
305        </valeur>
306
307        <!-- ### -->
308        <!-- # Variables pour le déploiement -->
309        <!-- # -->
310        <!-- @API (utilisable par les freePrim) -->
311        <valeur code="rootSpaceSs">
312                <source type="xpath-dynamique">concat('~param/', resultatAgent('//keyWspNoLang'), '/ss')</source>
313                <resultat cache="*"/>
314        </valeur>
315        <!-- @API -->
316        <valeur code="keyResSs">
317                <source type="xpath-dynamique">concat(resultatAgent('//keyWsp'), '.ss')</source>
318                <resultat cache="*"/>
319        </valeur>
320        <!-- @API -->
321        <valeur code="keyResWsp">
322                <source type="xpath-dynamique">concat(resultatAgent('//keyWsp'), '.wsp')</source>
323                <resultat cache="*"/>
324        </valeur>
325        <!-- @API -->
326    <valeur code="keyResXpi">
327        <source type="xpath-dynamique">concat(resultatAgent('//keyWsp'), '.safe.xpi')</source><!-- NOTE : Pour desquestions de sécurité, la string ".safe." doit être présente dans la key. Seul ce type de key peut etre exploité par adminWsp?cdaction=GetRes -->
328        <resultat cache="*"/>
329    </valeur>
330    <!-- @API -->
331    <valeur code="keyXpiBean">
332        <source type="xpath-dynamique">concat(resultatAgent('//keyWsp'), '_xpi.bean')</source>
333        <resultat cache="*"/>
334    </valeur>
335    <!-- @API -->
336    <valeur code="keyJarBean">
337        <source type="xpath-dynamique">concat(resultatAgent('//keyWsp'), '_jar.bean')</source>
338        <resultat cache="*"/>
339    </valeur>
340        <!-- @API -->
341        <set code="listFreeRes">
342                <valeur racine="sm:wspConfig/sm:freeRes" codecomposant="@key">
343                        <source type="xpath-statique">@sc:refUri</source>
344                </valeur>
345        </set>
346        <!-- @API (utilisable par les freePrim et par les extSkin dans les générateurs) -->
347        <valeur code="rootPathSs">
348                <source type="xpath-dynamique">concat('/~param/', resultatAgent('//keyWspNoLang'), '/ss')</source>
349                <resultat cache="*"/>
350        </valeur>
351        <!-- @API -->
352        <valeur code="chromeCode">
353                <source type="xpath-dynamique">resultatAgent('//keyWsp')</source>
354                <resultat cache="*"/>
355        </valeur>
356        <!-- @API Code du modèle (utilisé pour créer un atelier dans l'environnement de test) -->
357        <valeur code="defaultWspCode">
358                <source type="xpath-statique">si(@defaultWspCode, @defaultWspCode, @keyWsp)</source>
359                <resultat cache="*"/>
360        </valeur>
361        <!-- @API -->
362        <valeur code="version">
363                <source type="xpath-statique">concat(@majorVersion, '.', @mediumVersion, '.', @minorVersion)</source>
364                <valeur code="major"><source type="xpath-statique">@majorVersion</source></valeur>
365                <valeur code="medium"><source type="xpath-statique">@mediumVersion</source></valeur>
366                <valeur code="minor"><source type="xpath-statique">@minorVersion</source></valeur>
367        </valeur>
368
369        <!-- guuid pour install.rdf de l'extension Mozilla -->
370        <valeur code="guid">
371                <source type="xpath-dynamique">concat(resultatAgent('//chromeCode'), '@scenari-platform.org')</source>
372        </valeur>
373       
374       
375        <!-- ### -->
376        <!-- # WSPMETA -->
377        <!-- # -->
378        <!-- WspMeta pour SCENARItest -->
379        <valeur code="test.wspmeta">
380                <source type="xslOnSrc-dynamique" href="bs:test.wspmeta.xsl"/>
381        </valeur>
382       
383
384        <pageParametres code="_pageParametres">
385                <sousPages type="xsl-dynamique">
386                        <xsl:stylesheet
387                                        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
388                                        version="1.0">
389                                <xsl:output method="xml" omit-xml-declaration="yes"/>
390                                <xsl:param name="vDialog"/>
391                                <xsl:param name="vAgent"/>
392                                <xsl:template match="*">
393                                        <listePages>
394                                                <page ref="../checkModels"/>
395                                                <xsl:for-each select="listGenerators()">
396                                                        <page ref="{pathAgent(.)}/checkPage"/>
397                                                </xsl:for-each>
398                                        </listePages>
399                                </xsl:template>
400                        </xsl:stylesheet>
401                </sousPages>
402        </pageParametres>
403        <pageParametres code="checkModels">
404                <intitule>Models</intitule>
405                <contenu type="xslOnSrc-dynamique" href="bs:checkModels.xsl"/>
406        </pageParametres>
407       
408</racineimport>
Note: See TracBrowser for help on using the browser.