Ignore:
Timestamp:
11/23/06 18:21:38 (6 years ago)
Author:
sys
Message:

api Data + AgentLinker

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Jav_Builder/com/scenari/m/builder/gen/HModelGenerator.java

    r7462 r7468  
    7474import com.scenari.m.co.agent.IWADialog; 
    7575import com.scenari.m.co.agent.IWAgent; 
    76 import com.scenari.m.co.agent.IWAgentAvecLiens; 
     76import com.scenari.m.co.agent.IWAgentLinker; 
    7777import com.scenari.m.co.agent.IWAgentComputor; 
    7878import com.scenari.m.co.dialog.IHDialog; 
    7979import com.scenari.m.co.donnee.HADonneeMgr; 
     80import com.scenari.m.co.donnee.HDonneeUtils; 
    8081import com.scenari.m.co.donnee.WDonneeFixeSystemProps; 
    8182import com.scenari.m.co.instance.IWInstFormation; 
     
    403404                public String getCode() throws Exception { 
    404405                        if (fCode == null) { 
    405                                 fCode = ((IWAgentComputor) fAgent.hGetAgentAssoc("codeGenerator")).computeAsData(fRootDialog, null).getString(); 
     406                                fCode = ((IWAgentComputor) fAgent.hGetAgentAssoc("codeGenerator")).computeAsString(fRootDialog, null); 
    406407                        } 
    407408                        return fCode; 
     
    410411                public String getRootPathGen() throws Exception { 
    411412                        if (fRootPathGen == null) { 
    412                                 fRootPathGen = ((IWAgentComputor) fAgent.hGetAgentAssoc("rootPathGen")).computeAsData(fRootDialog, null).getString(); 
     413                                fRootPathGen = ((IWAgentComputor) fAgent.hGetAgentAssoc("rootPathGen")).computeAsString(fRootDialog, null); 
    413414                        } 
    414415                        return fRootPathGen; 
     
    417418                public String getRootSpaceGen() throws Exception { 
    418419                        if (fRootSpaceGen == null) { 
    419                                 fRootSpaceGen = ((IWAgentComputor) fAgent.hGetAgentAssoc("rootSpaceGen")).computeAsData(fRootDialog, null).getString(); 
     420                                fRootSpaceGen = ((IWAgentComputor) fAgent.hGetAgentAssoc("rootSpaceGen")).computeAsString(fRootDialog, null); 
    420421                        } 
    421422                        return fRootSpaceGen; 
     
    424425                public String getKeyResGen() throws Exception { 
    425426                        if (fKeyResGen == null) { 
    426                                 fKeyResGen = ((IWAgentComputor) fAgent.hGetAgentAssoc("keyResGen")).computeAsData(fRootDialog, null).getString(); 
     427                                fKeyResGen = ((IWAgentComputor) fAgent.hGetAgentAssoc("keyResGen")).computeAsString(fRootDialog, null); 
    427428                        } 
    428429                        return fKeyResGen; 
     
    444445                                IWAgentComputor vAgent = ((IWAgentComputor) fAgent.hGetAgentAssoc("pathPublishFilesInSpaceGen")); 
    445446                                if (vAgent != null) { 
    446                                         vPathPublishFileInSpaceGen = vAgent.computeAsData(fRootDialog, null).getString(); 
     447                                        vPathPublishFileInSpaceGen = vAgent.computeAsString(fRootDialog, null); 
    447448                                        if (vPathPublishFileInSpaceGen != null) { 
    448449                                                if (!vPathPublishFileInSpaceGen.startsWith("/")) vPathPublishFileInSpaceGen = "/".concat(vPathPublishFileInSpaceGen); 
     
    507508                                // Génération des SS ? 
    508509                                IWAgent vAg = fRootDialog.hGoToAgent("/@@/buildSS"); 
    509                                 fBuildSS = (vAg == null || ((IWAgentComputor) vAg).computeAsData(fRootDialog, null).getString().equalsIgnoreCase("true") || fFolderSs.hGetStatus() != IHSource.STATUS_FOLDER); 
     510                                fBuildSS = (vAg == null || HDonneeUtils.hGetBooleanEvalTrue(((IWAgentComputor) vAg).computeAsString(fRootDialog, null)) || fFolderSs.hGetStatus() != IHSource.STATUS_FOLDER); 
    510511                                if (fBuildSS) fFolderSs.hRemove(); 
    511512 
    512513                                // Génération des ES ? 
    513514                                vAg = fRootDialog.hGoToAgent("/@@/buildES"); 
    514                                 fBuildES = (vAg == null || ((IWAgentComputor) vAg).computeAsData(fRootDialog, null).getString().equalsIgnoreCase("true") || fFolderEs.hGetStatus() != IHSource.STATUS_FOLDER); 
     515                                fBuildES = (vAg == null || HDonneeUtils.hGetBooleanEvalTrue(((IWAgentComputor) vAg).computeAsString(fRootDialog, null)) || fFolderEs.hGetStatus() != IHSource.STATUS_FOLDER); 
    515516                                if (fBuildES) fFolderEs.hRemove(); 
    516517 
     
    940941                        // Recherche du nom du chrome. 
    941942                        IWAgent vAg = fRootDialog.hGoToAgent("@@/chromeCode"); 
    942                         fChromeCode = ((IWAgentComputor) vAg).computeAsData(fRootDialog, null).getString(); 
     943                        fChromeCode = ((IWAgentComputor) vAg).computeAsString(fRootDialog, null); 
    943944 
    944945                        // Evaluation du mode. 
     
    10441045                // appMake. 
    10451046                // Non testé 
    1046                 String vWspType = ((IWAgentComputor) vWspTypeAgt).computeAsData(fRootDialog, null).getString(); 
     1047                String vWspType = ((IWAgentComputor) vWspTypeAgt).computeAsString(fRootDialog, null); 
    10471048                Writer wspMetaXriter = fFolderAppModelJavaserver.hFindSource(".wspmeta").hGetWriter(); 
    10481049                wspMetaXriter.write(vWspType); 
    10491050                wspMetaXriter.close(); 
    10501051                IWAgent vKeyResWspAgt = fRootDialog.hGoToAgent("@@/keyResWsp"); 
    1051                 vProps.put(((IWAgentComputor) vKeyResWspAgt).computeAsData(fRootDialog, null).getString(), vBaseUri + ".wspmeta"); 
     1052                vProps.put(((IWAgentComputor) vKeyResWspAgt).computeAsString(fRootDialog, null), vBaseUri + ".wspmeta"); 
    10521053                // Création du jar du chrome. 
    10531054                IHSource vJarPack = fFolderAppModelChrome.hFindSource("chrome/" + fChromeCode.concat(".jar")); 
     
    10641065                fFolderAppModelJavaserver.hFindSource("ss").hCopyFrom(fFolderSs); 
    10651066                IWAgent vKeyResSsAgt = fRootDialog.hGoToAgent("@@/keyResSs"); 
    1066                 vProps.put(((IWAgentComputor) vKeyResSsAgt).computeAsData(fRootDialog, null).getString(), vBaseUri + "ss"); 
     1067                vProps.put(((IWAgentComputor) vKeyResSsAgt).computeAsString(fRootDialog, null), vBaseUri + "ss"); 
    10671068                // gen 
    10681069                List vListGen = wGetListGenerators(); 
     
    10901091                IWAgent vVersionAgt = fRootDialog.hGoToAgent("@@/version"); 
    10911092                if (vVersionAgt != null && vVersionAgt instanceof IWAgentComputor) { 
    1092                         vVersion = ((IWAgentComputor) vVersionAgt).computeAsData(fRootDialog, null).getString(); 
     1093                        vVersion = ((IWAgentComputor) vVersionAgt).computeAsString(fRootDialog, null); 
    10931094                } 
    10941095                String vKeyWspVersion; 
    10951096                IWAgent vKeyWspVersionAgt = fRootDialog.hGoToAgent("@@/keyWspVersion"); 
    10961097                if (vKeyWspVersionAgt != null && vKeyWspVersionAgt instanceof IWAgentComputor) { 
    1097                         vKeyWspVersion = ((IWAgentComputor) vKeyWspVersionAgt).computeAsData(fRootDialog, null).getString(); 
     1098                        vKeyWspVersion = ((IWAgentComputor) vKeyWspVersionAgt).computeAsString(fRootDialog, null); 
    10981099                } else { 
    10991100                        vKeyWspVersion = fChromeCode; 
     
    11681169                        try { 
    11691170                                IWAgent vWspTypeAgt = fRootDialog.hGoToAgent("@@/wspType"); 
    1170                                 String vWspType = ((IWAgentComputor) vWspTypeAgt).computeAsData(fRootDialog, null).getString(); 
     1171                                String vWspType = ((IWAgentComputor) vWspTypeAgt).computeAsString(fRootDialog, null); 
    11711172                                /* 
    11721173                                 * IWAgent vExportWspMetaAgt = 
     
    11881189                        IWAgent vKeyResWspAgt = fRootDialog.hGoToAgent("@@/keyResWsp"); 
    11891190                        vXmlWriter.hWriteStartTag("res"); 
    1190                         vXmlWriter.hWriteAttribut("key", ((IWAgentComputor) vKeyResWspAgt).computeAsData(fRootDialog, null).getString()); 
     1191                        vXmlWriter.hWriteAttribut("key", ((IWAgentComputor) vKeyResWspAgt).computeAsString(fRootDialog, null)); 
    11911192                        vXmlWriter.hWriteEndOpenTag(); 
    11921193                        vXmlWriter.hWriteStartTag("version"); 
     
    12101211                        IWAgent vKeyResSsAgt = fRootDialog.hGoToAgent("@@/keyResSs"); 
    12111212                        vXmlWriter.hWriteStartTag("res"); 
    1212                         vXmlWriter.hWriteAttribut("key", ((IWAgentComputor) vKeyResSsAgt).computeAsData(fRootDialog, null).getString()); 
     1213                        vXmlWriter.hWriteAttribut("key", ((IWAgentComputor) vKeyResSsAgt).computeAsString(fRootDialog, null)); 
    12131214                        vXmlWriter.hWriteEndOpenTag(); 
    12141215                        vXmlWriter.hWriteStartTag("version"); 
     
    13011302                fPhase = PHASE_SS; 
    13021303                IWAgent vAg = fRootDialog.hGoToAgent("@@/rootPathSs"); 
    1303                 fRootPathSs = ((IWAgentComputor) vAg).computeAsData(fRootDialog, null).getString(); 
     1304                fRootPathSs = ((IWAgentComputor) vAg).computeAsString(fRootDialog, null); 
    13041305 
    13051306                xListAllSs(new ArrayList(), new ArrayList(), fRootDialog.hGetAgent()); 
     
    13231324                Node vLink = vListLinks.getFirstChild(); 
    13241325                while (vLink != null) { 
    1325                         if (vLink instanceof IWAgentAvecLiens) { 
     1326                        if (vLink instanceof IWAgentLinker) { 
    13261327                                IWAgent vInternalized = ((IWAgent) vLink).hGetAgentAssoc("internalized"); 
    13271328                                // On évalue si ce lien peut pointer un item externe. 
    1328                                 boolean vIsExtrenalLinkAllowed = (vInternalized == null || !((IWAgentComputor) vInternalized).computeAsData(fRootDialog, null).getString().equals("always")); 
    1329                                 IWAgent[] vListModels = ((IWAgentAvecLiens) vLink).hGetAgentsLies(fRootDialog); 
     1329                                boolean vIsExtrenalLinkAllowed = (vInternalized == null || !((IWAgentComputor) vInternalized).computeAsString(fRootDialog, null).equals("always")); 
     1330                                IWAgent[] vListModels = ((IWAgentLinker) vLink).hGetAgentsLies(fRootDialog, null); 
    13301331                                if (vListModels != null) { 
    13311332                                        for (int i = 0; i < vListModels.length; i++) { 
     
    13351336                                                                // On crée la SS 
    13361337                                                                IWAgent vIsStandAloneItemAgent = vListModels[i].hGetAgentAssoc("isStandAloneItem"); 
    1337                                                                 if (vIsStandAloneItemAgent != null && ((IWAgentComputor) vIsStandAloneItemAgent).computeAsData(fRootDialog, null).getString().equals("true")) { 
     1338                                                                if (vIsStandAloneItemAgent != null && ((IWAgentComputor) vIsStandAloneItemAgent).computeAsString(fRootDialog, null).equals("true")) { 
    13381339                                                                        // Le modèle pointé peut bien constituer un 
    13391340                                                                        // item autonome -> on crée sa SS 
     
    13841385                // On cherche les liens vers des générateurs sur pModelAgent 
    13851386                IWAgent vAgLinksGenerators = pModelAgent.hGetAgentAssoc("linksGenerators"); 
    1386                 if (vAgLinksGenerators != null && vAgLinksGenerators instanceof IWAgentAvecLiens) { 
    1387                         IWAgent[] vListGen = ((IWAgentAvecLiens) vAgLinksGenerators).hGetAgentsLies(pRootDialog); 
     1387                if (vAgLinksGenerators != null && vAgLinksGenerators instanceof IWAgentLinker) { 
     1388                        IWAgent[] vListGen = ((IWAgentLinker) vAgLinksGenerators).hGetAgentsLies(pRootDialog, null); 
    13881389                        if (vListGen != null) { 
    13891390                                for (int i = 0; i < vListGen.length; i++) { 
     
    14091410                Node vLink = vListLinks.getFirstChild(); 
    14101411                while (vLink != null) { 
    1411                         if (vLink instanceof IWAgentAvecLiens) { 
    1412                                 IWAgent[] vListModels = ((IWAgentAvecLiens) vLink).hGetAgentsLies(pRootDialog); 
     1412                        if (vLink instanceof IWAgentLinker) { 
     1413                                IWAgent[] vListModels = ((IWAgentLinker) vLink).hGetAgentsLies(pRootDialog, null); 
    14131414                                if (vListModels != null) { 
    14141415                                        for (int i = 0; i < vListModels.length; i++) { 
     
    14531454                        IWADialogExport vDialogGenerator = fCurrentGenerator.getDialog(); 
    14541455                        IWAgent vBuild = fTestMode ? vAgentGenerator.hGetAgentAssoc("buildGen") : null; 
    1455                         if (vBuild == null || ((IWAgentComputor) vBuild).computeAsData(vDialogGenerator, null).getString().equalsIgnoreCase("true")) { 
     1456                        if (vBuild == null || HDonneeUtils.hGetBooleanEvalTrue(((IWAgentComputor) vBuild).computeAsString(vDialogGenerator, null))) { 
    14561457                                // Affectation des variables de déploiement 
    14571458                                IHSource vFolderGen = fCurrentGenerator.getFolder(); 
     
    14721473                                } 
    14731474                                IWAgent vListTransf = vAgentGenerator.hGetAgentAssoc("linksTransf"); 
    1474                                 if (vListTransf != null && vListTransf instanceof IWAgentAvecLiens) { 
    1475                                         IWAgent[] vGens = ((IWAgentAvecLiens) vListTransf).hGetAgentsLies(vDialogGenerator); 
     1475                                if (vListTransf != null && vListTransf instanceof IWAgentLinker) { 
     1476                                        IWAgent[] vGens = ((IWAgentLinker) vListTransf).hGetAgentsLies(vDialogGenerator, null); 
    14761477                                        for (int j = 0; j < vGens.length; j++) { 
    14771478                                                if (vGens[j] != null) { 
     
    15091510                // Code de l'atelier 
    15101511                IWAgent vAg = fRootDialog.hGoToAgent("@@/defaultWspCode"); 
    1511                 String vWspCode = ((IWAgentComputor) vAg).computeAsData(fRootDialog, null).getString(); 
     1512                String vWspCode = ((IWAgentComputor) vAg).computeAsString(fRootDialog, null); 
    15121513 
    15131514                // Construction du path racine pour les sources et générations de 
     
    15321533                        Map vKeyResMap = new HashMap(); 
    15331534                        vAg = fRootDialog.hGoToAgent("@@/keyResSs"); 
    1534                         String vKeyResSs = ((IWAgentComputor) vAg).computeAsData(fRootDialog, null).getString(); 
     1535                        String vKeyResSs = ((IWAgentComputor) vAg).computeAsString(fRootDialog, null); 
    15351536                        vKeyResMap.put(vKeyResSs, new File(fFolderSs.hGetUrlFileFormat())); 
    15361537                        // Ressources pour les generateurs 
Note: See TracChangeset for help on using the changeset viewer.