Changeset 7466
- Timestamp:
- 11/23/06 18:21:31 (5 years ago)
- Location:
- trunk/Jav_CO/com/scenari/m/co
- Files:
-
- 26 edited
- 1 moved
-
agent/IWAgentLinker.java (moved) (moved from trunk/Jav_CO/com/scenari/m/co/agent/IWAgentAvecLiens.java) (2 diffs)
-
agent/redirect/HAgentRedirect.java (modified) (1 diff)
-
agent/sortie/HAgentSortie.java (modified) (6 diffs)
-
agent/sortie/HDialogSortie.java (modified) (1 diff)
-
agent/source/HAgentSource.java (modified) (1 diff)
-
ant/ResultatTask.java (modified) (1 diff)
-
donnee/IData.java (modified) (1 diff)
-
donnee/composition/XContainerAgentsLies.java (modified) (3 diffs)
-
donnee/inclusion/XWriter.java (modified) (2 diffs)
-
xpath/dom/ZXPath.java (modified) (2 diffs)
-
xpath/dom/ZXPathAgentsLies.java (modified) (2 diffs)
-
xpath/dom/ZXPathMax.java (modified) (2 diffs)
-
xpath/dom/ZXPathMin.java (modified) (2 diffs)
-
xpath/dom/ZXPathMoyenne.java (modified) (2 diffs)
-
xpath/dom/ZXPathResultat.java (modified) (1 diff)
-
xpath/dom/ZXPathResultatAgent.java (modified) (1 diff)
-
xpath/dom/ZXPathResultatDialogue.java (modified) (1 diff)
-
xpath/dom/ZXPathSomme.java (modified) (2 diffs)
-
xpath/dtm/ZXPath.java (modified) (2 diffs)
-
xpath/dtm/ZXPathAgentsLies.java (modified) (2 diffs)
-
xpath/dtm/ZXPathMax.java (modified) (1 diff)
-
xpath/dtm/ZXPathMin.java (modified) (1 diff)
-
xpath/dtm/ZXPathMoyenne.java (modified) (1 diff)
-
xpath/dtm/ZXPathResultat.java (modified) (1 diff)
-
xpath/dtm/ZXPathResultatAgent.java (modified) (1 diff)
-
xpath/dtm/ZXPathResultatDialogue.java (modified) (1 diff)
-
xpath/dtm/ZXPathSomme.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jav_CO/com/scenari/m/co/agent/IWAgentLinker.java
r1710 r7466 44 44 * Agents possédant des liens vers d'autres composants principaux comme les SP. 45 45 */ 46 public interface IWAgent AvecLiens{46 public interface IWAgentLinker { 47 47 48 /**49 * Renvoit la liste statique de tous les agents liés.50 */51 public IWAgent[] hGetAgentsLies() throws Exception;52 53 /**54 * Renvoit la liste dynamique des agents Liés.55 *56 * @return com.scenari.m.co.agent.IWAgent[]57 * @param pDialog58 * com.scenari.m.co.agent.IHDialog59 */60 public IWAgent[] hGetAgentsLies(IHDialog pDialog) throws Exception;61 62 48 /** 63 49 * Renvoit la liste dynamique des agents liés avec certains critères en paramètre. La structure des critères est … … 69 55 */ 70 56 public IWAgent[] hGetAgentsLies(IHDialog pDialog, Object pCriteres) throws Exception; 71 72 /**73 * Renvoit la liste statique de tous les agents liés avec certains critères en paramètre. La structure des critères74 * est spécifique à chaque classe de composant.75 *76 * @return com.scenari.m.co.agent.IWAgent[]77 */78 public IWAgent[] hGetAgentsLies(Object pCritères) throws Exception;79 57 } -
trunk/Jav_CO/com/scenari/m/co/agent/redirect/HAgentRedirect.java
r7458 r7466 87 87 88 88 /** 89 * @see com.scenari.m.co.agent.IWAgentComputor#computeAsData(com.scenari.m.co.dialog.IHDialog, 90 * java.lang.Object) 89 * 91 90 */ 92 91 public IComputedData computeAsData(IHDialog pDialog, Object pArguments) throws Exception { -
trunk/Jav_CO/com/scenari/m/co/agent/sortie/HAgentSortie.java
r7458 r7466 52 52 import com.scenari.m.co.donnee.IComputedData; 53 53 import com.scenari.m.co.instance.IWInstFormation; 54 import com.scenari.s.fw.log.HLogMgr; 54 55 import com.scenari.s.fw.log.HTrace; 55 56 import com.scenari.s.fw.log.HTraceMgr; … … 61 62 62 63 /** Cache en mémoire du résultat. */ 63 protected transient IComputedData f ResultatCache = null;64 protected transient IComputedData fDataCache = null; 64 65 65 66 /** Trace. */ … … 83 84 public IComputedData computeAsData(IHDialog pDialog, Object pArguments) throws Exception { 84 85 85 if (f ResultatCache != null) return fResultatCache;86 if (fDataCache != null) return fDataCache; 86 87 87 88 IComputedData vResult = IComputedData.NULL; … … 102 103 103 104 String vCache = ((HComposantTypeSortie) fComposant.hGetComposantType()).hGetResultatCache(); 104 if (vCache != null) {105 if (vCache != null) { 105 106 if ("*".equals(vCache)) { 106 f ResultatCache = new DataVolatileString(vResult.getString(), vResult.getMime());107 return f ResultatCache;107 fDataCache = new DataVolatileString(vResult.getString(), vResult.getMime()); 108 return fDataCache; 108 109 } else if ("node".equals(vCache)) { 109 f ResultatCache = new DataVolatileNode(vResult.getNode(), vResult.getMime());110 return f ResultatCache;110 fDataCache = new DataVolatileNode(vResult.getNode(), vResult.getMime()); 111 return fDataCache; 111 112 } 112 113 } … … 115 116 116 117 public Node computeAsNode(IHDialog pDialog, Object pArguments) throws Exception { 117 return computeAsData(pDialog, pArguments).getNode(); 118 119 if (fDataCache != null) return fDataCache.getNode(); 120 String vCache = ((HComposantTypeSortie) fComposant.hGetComposantType()).hGetResultatCache(); 121 if (vCache != null) { 122 xComputeCache(vCache, pDialog, pArguments); 123 return fDataCache.getNode(); 124 } 125 126 IData vSource = ((WComposantSortie) fComposant).hGetSource(); 127 128 if (!hIsActif(pDialog)) { 129 return IData.NULL_NODE; 130 } else if (vSource.getLevel() <= IData.LEVEL_STATIQUE) { 131 return ((WComposantSortie) fComposant).hGetSource().getNode(pDialog, this, pArguments); 132 } else { 133 if (((HComposantTypeSortie) fComposant.hGetComposantType()).hGetTransformsList() == null) { 134 return vSource.getNode(pDialog, this, pArguments); 135 } else { 136 return new XDonneeResultatSortie(this, pDialog, pArguments).getNode(); 137 } 138 } 118 139 } 119 140 … … 122 143 */ 123 144 public String computeAsString(IHDialog pDialog, Object pArguments) throws Exception { 124 return computeAsData(pDialog, pArguments).getString(); 145 146 if (fDataCache != null) return fDataCache.getString(); 147 148 String vCache = ((HComposantTypeSortie) fComposant.hGetComposantType()).hGetResultatCache(); 149 if (vCache != null) { 150 xComputeCache(vCache, pDialog, pArguments); 151 return fDataCache.getString(); 152 } 153 154 IData vSource = ((WComposantSortie) fComposant).hGetSource(); 155 156 if (!hIsActif(pDialog)) { 157 return IData.NULL_STRING; 158 } else if (vSource.getLevel() <= IData.LEVEL_STATIQUE) { 159 return ((WComposantSortie) fComposant).hGetSource().getString(pDialog, this, pArguments); 160 } else { 161 if (((HComposantTypeSortie) fComposant.hGetComposantType()).hGetTransformsList() == null) { 162 return vSource.getString(pDialog, this, pArguments); 163 } else { 164 return new XDonneeResultatSortie(this, pDialog, pArguments).getString(); 165 } 166 } 167 } 168 169 protected void xComputeCache(String pCache, IHDialog pDialog, Object pArguments) throws Exception { 170 if (!hIsActif(pDialog)) { 171 fDataCache = IComputedData.NULL; 172 } 173 IData vSource = ((WComposantSortie) fComposant).hGetSource(); 174 if ("*".equals(pCache)) { 175 if (vSource.getLevel() <= IData.LEVEL_STATIQUE) { 176 fDataCache = new DataVolatileString(vSource.getString(pDialog, this, pArguments)); 177 } else { 178 if (((HComposantTypeSortie) fComposant.hGetComposantType()).hGetTransformsList() == null) { 179 try { 180 pDialog.hExecStackPush(this); 181 fDataCache = new DataVolatileString(vSource.getString(pDialog, this, pArguments)); 182 } finally { 183 pDialog.hExecStackPop(); 184 } 185 } else { 186 fDataCache = new DataVolatileString(new XDonneeResultatSortie(this, pDialog, pArguments).getString()); 187 } 188 } 189 } else if ("node".equals(pCache)) { 190 if (vSource.getLevel() <= IData.LEVEL_STATIQUE) { 191 fDataCache = new DataVolatileNode(vSource.getNode(pDialog, this, pArguments)); 192 } else { 193 if (((HComposantTypeSortie) fComposant.hGetComposantType()).hGetTransformsList() == null) { 194 try { 195 pDialog.hExecStackPush(this); 196 fDataCache = new DataVolatileNode(vSource.getNode(pDialog, this, pArguments)); 197 } finally { 198 pDialog.hExecStackPop(); 199 } 200 } else { 201 fDataCache = new DataVolatileNode(new XDonneeResultatSortie(this, pDialog, pArguments).getNode()); 202 } 203 } 204 } else { 205 throw HLogMgr.hNewException("Valeur de cache inconnue '" + pCache + "' définie dans " + this); 206 } 125 207 } 126 208 -
trunk/Jav_CO/com/scenari/m/co/agent/sortie/HDialogSortie.java
r7458 r7466 89 89 //On force le calcul jusque "hGetValue()" pour forcer la calcul cmplete de la donnée et l'execution 90 90 //des ressources sousjacentes. 91 fResult = ((HAgentSortie) fAgent).computeAs Data(this, hGetParam()).getString();91 fResult = ((HAgentSortie) fAgent).computeAsString(this, hGetParam()); 92 92 } else { 93 93 return super.xExecute(); -
trunk/Jav_CO/com/scenari/m/co/agent/source/HAgentSource.java
r7458 r7466 67 67 68 68 /** 69 * @see com.scenari.m.co.agent.IWAgentComputor#computeAsData(com.scenari.m.co.dialog.IHDialog, java.lang.Object)69 * 70 70 */ 71 71 public IComputedData computeAsData(IHDialog pDialog, Object pArguments) throws Exception { -
trunk/Jav_CO/com/scenari/m/co/ant/ResultatTask.java
r7458 r7466 56 56 57 57 if (vAgent != null) { 58 vResult = ((IWAgentComputor) vAgent).computeAs Data(vDialog, fArguments).getString();58 vResult = ((IWAgentComputor) vAgent).computeAsString(vDialog, fArguments); 59 59 if (fResult != null) { 60 60 vProject.setProperty(fResult, vResult); -
trunk/Jav_CO/com/scenari/m/co/donnee/IData.java
r7458 r7466 94 94 /** Donnée null définie par défaut. */ 95 95 public static final IAgentData NULL = new WDonneeNull(); 96 97 /** Donnée null définie par défaut. */ 98 public static final String NULL_STRING = ""; 99 100 /** Donnée null définie par défaut. */ 101 public static final Node NULL_NODE = null; 96 102 97 103 /** -
trunk/Jav_CO/com/scenari/m/co/donnee/composition/XContainerAgentsLies.java
r2271 r7466 41 41 import com.scenari.m.co.agent.IWADialog; 42 42 import com.scenari.m.co.agent.IWAgent; 43 import com.scenari.m.co.agent.IWAgent AvecLiens;43 import com.scenari.m.co.agent.IWAgentLinker; 44 44 45 45 /** … … 80 80 IWAgent vAgent = pContext.wGetAgent(); 81 81 if(fRefAgent != null) vAgent = fIsRefAgentFromDialog ? ((IWADialog)pContext.wGetDialog()).hGoToAgent(fRefAgent) : vAgent.hGetAgentParRef(fRefAgent); 82 while (vAgent != null && !(vAgent instanceof IWAgent AvecLiens)) {82 while (vAgent != null && !(vAgent instanceof IWAgentLinker)) { 83 83 vAgent = vAgent.hGetAgentPere(); 84 84 } … … 86 86 //On récupere la liste des agents lies 87 87 if (vAgent != null) { 88 IWAgent[] vList = ((IWAgent AvecLiens) vAgent).hGetAgentsLies(pContext.fDialog);88 IWAgent[] vList = ((IWAgentLinker) vAgent).hGetAgentsLies(pContext.fDialog, null); 89 89 if (vList != null) { 90 90 XContextElement vNewContext = new XContextElement(pContext); -
trunk/Jav_CO/com/scenari/m/co/donnee/inclusion/XWriter.java
r7458 r7466 49 49 import com.scenari.m.co.dialog.IHDialog; 50 50 import com.scenari.m.co.donnee.HDonneeUtils; 51 import com.scenari.m.co.donnee.IComputedData;52 51 import com.scenari.m.co.service.IWSDialog; 53 52 import com.scenari.m.co.service.IWService; … … 77 76 public class XWriter extends Writer { 78 77 79 protected static final int STATUT_TEXT = 0; 80 81 protected static final int STATUT_TAGOUV = 1; 82 83 protected static final int STATUT_TAGIN = 2; 84 85 protected static final int STATUT_TAGFERM = 3; 86 87 protected static final char[] TAGOUV_DEFAUT = { '[', '!', '[' }; 88 89 protected static final char[] TAGFERM_DEFAUT = { ']', '!', ']' }; 90 91 /** Writer de destination.*/ 92 protected Writer fWriterDest = null; 93 94 /** Dialog en cours.*/ 95 protected IHDialog fDialog = null; 96 97 /** Owner de cette données.*/ 98 protected Object fOwner = null; 99 100 /** Arguments associés à l'appel de la donnée.*/ 101 protected Object fArguments = null; 102 103 /** Statut correspondant au dernier caractere lu.*/ 104 protected int fStatut = STATUT_TEXT; 105 106 /** Nombre de caractères lus du tag.*/ 107 protected int fPosTagCourant = 0; 108 109 /** Tag d'ouverture d'une inclusion.*/ 110 protected char[] fTagOuv = TAGOUV_DEFAUT; 111 112 /** Tag de fermeture d'une inclusion.*/ 113 protected char[] fTagFerm = TAGFERM_DEFAUT; 114 115 /** Buffer de l'inclusion.*/ 116 protected StringBuffer fBuff = null; 117 118 /** Flag si le flux doit être envoyé dans la dest. */ 119 protected boolean fWriteDest = true; 120 121 /** Flag si la source est XML, donc nécessité de décoder les entitées XML avant de traiter les inclusions. */ 122 protected boolean fSrcIsXml = true; 123 124 /** Stack des if imbriqués. */ 125 protected List fStackCond = null; 126 127 /** 128 * 129 */ 130 public XWriter(Writer pWriterDest, IHDialog pDialog, Object pOwner, Object pArguments, boolean pSrcIsXml) { 131 super(); 132 fWriterDest = pWriterDest; 133 fDialog = pDialog; 134 fOwner = pOwner; 135 fArguments = pArguments; 136 fSrcIsXml = pSrcIsXml; 137 } 138 139 /** 140 * Close the stream, flushing it first. Once a stream has been closed, 141 * further write() or flush() invocations will cause an IOException to be 142 * thrown. Closing a previously-closed stream, however, has no effect. 143 * 144 * @exception IOException If an I/O error occurs 145 */ 146 public void close() throws IOException { 147 148 if (fStatut == STATUT_TAGIN || fStatut == STATUT_TAGFERM) { 149 String vInc = fBuff.toString(); 150 fWriterDest.write(fTagOuv); 151 fWriterDest.write(vInc); 152 if (fStatut == STATUT_TAGFERM) { 153 fWriterDest.write(fTagFerm, 0, fPosTagCourant); 154 } 155 HLogMgr.hPublishException("Terminaison anormale d'une donnée de type 'inclusion-dynamique' dans le dialogue : " + fDialog + ". L'inclusion '" + vInc + "' n'a pu être exécutée."); 156 } 157 158 fWriterDest.close(); 159 } 160 161 /** 162 * Flush the stream. If the stream has saved any characters from the 163 * various write() methods in a buffer, write them immediately to their 164 * intended destination. Then, if that destination is another character or 165 * byte stream, flush it. Thus one flush() invocation will flush all the 166 * buffers in a chain of Writers and OutputStreams. 167 * 168 * @exception IOException If an I/O error occurs 169 */ 170 public void flush() throws IOException { 171 fWriterDest.flush(); 172 } 173 174 /** 175 * Write a portion of an array of characters. 176 * 177 * @param pBuf Array of characters 178 * @param pOffset Offset from which to start writing characters 179 * @param pLength Number of characters to write 180 * 181 * @exception IOException If an I/O error occurs 182 */ 183 public void write(char[] pBuf, int pOffset, int pLength) throws IOException { 184 185 int vEnd = pOffset + pLength; 186 for (int i = pOffset; i < vEnd; i++) { 187 write(pBuf[i]); 188 } 189 190 } 191 192 public void write(int pChar) throws IOException { 193 194 switch (fStatut) { 195 case STATUT_TEXT: { 196 if (pChar == fTagOuv[0]) { 197 if (fTagOuv.length == 1) { 198 //On a trouvé un tag d'ouverture 199 if (fBuff == null) { 200 fBuff = new StringBuffer(64); 201 } 202 fStatut = STATUT_TAGIN; 203 } else { 204 fStatut = STATUT_TAGOUV; 205 fPosTagCourant = 1; 206 } 207 208 } else { 209 if (fWriteDest) fWriterDest.write(pChar); 210 } 211 break; 212 } 213 case STATUT_TAGOUV: { 214 if (pChar == fTagOuv[fPosTagCourant]) { 215 fPosTagCourant++; 216 if (fTagOuv.length == fPosTagCourant) { 217 //On a trouvé un tag d'ouverture 218 if (fBuff == null) { 219 fBuff = new StringBuffer(64); 220 } 221 fStatut = STATUT_TAGIN; 222 } 223 } else { 224 //On n'est pas sur un tag d'ouverture 225 if (fWriteDest) fWriterDest.write(fTagOuv, 0, fPosTagCourant); 226 if (pChar == fTagOuv[0]) { 227 fPosTagCourant = 1; 228 } else { 229 fStatut = STATUT_TEXT; 230 if (fWriteDest) fWriterDest.write((char) pChar); 231 } 232 } 233 break; 234 } 235 case STATUT_TAGIN: { 236 if (pChar == fTagFerm[0]) { 237 if (fTagFerm.length == 1) { 238 //On a trouvé le tag de fermeture 239 xExecuteInclusion(); 240 } else { 241 //On entame peut-être le tag de fermeture 242 fStatut = STATUT_TAGFERM; 243 fPosTagCourant = 1; 244 } 245 } else { 246 fBuff.append((char) pChar); 247 } 248 break; 249 } 250 case STATUT_TAGFERM: { 251 if (pChar == fTagFerm[fPosTagCourant]) { 252 fPosTagCourant++; 253 if (fTagFerm.length == fPosTagCourant) { 254 //On a trouvé le tag de fermeture 255 xExecuteInclusion(); 256 } 257 } else { 258 //On n'est pas encore sur le tag de fermeture 259 fBuff.append(fTagFerm, 0, fPosTagCourant); 260 if (pChar == fTagFerm[0]) { 261 fPosTagCourant = 1; 262 } else { 263 fStatut = STATUT_TAGIN; 264 fBuff.append((char) pChar); 265 } 266 } 267 break; 268 } 269 } 270 } 271 272 public void write(String pStr) throws IOException { 273 int vEnd = pStr.length(); 274 for (int i = 0; i < vEnd; i++) { 275 write(pStr.charAt(i)); 276 } 277 } 278 279 public void write(String pStr, int pOffset, int pLength) throws IOException { 280 int vEnd = Math.min(pOffset + pLength, pStr.length()); 281 for (int i = pOffset; i < vEnd; i++) { 282 write(pStr.charAt(i)); 283 } 284 } 285 286 /** 287 * NOTE : l'atribut "argument" DOIT être en derniere position après les 288 * les attrributs "agent" "service" et/ou "dialogue". 289 * NOTE : si le contenu de l'inclusion est vide, le tag d'ouverture est recopié 290 * dans le résultat (escape du tag d'ouveture). 291 * 292 */ 293 public void xExecuteInclusion() throws IOException { 294 295 fStatut = STATUT_TEXT; 296 297 String vInc; 298 if (fSrcIsXml) { 299 int vLen = fBuff.length(); 300 StringBuffer vBuf = new StringBuffer(vLen); 301 for (int i = 0; i < vLen; i++) { 302 char vCh = fBuff.charAt(i); 303 if (vCh == '&' && i < vLen - 3) { 304 char vCh2 = fBuff.charAt(i + 1); 305 if (vCh2 == 'a') { 306 if (fBuff.charAt(i + 2) == 'm' && fBuff.charAt(i + 3) == 'p' && i < vLen - 4 && fBuff.charAt(i + 4) == ';') { 307 vBuf.append('&'); 308 i = i + 4; 309 continue; 310 } 311 if (fBuff.charAt(i + 2) == 'p' && fBuff.charAt(i + 3) == 'o' && i < vLen - 5 && fBuff.charAt(i + 4) == 's' && fBuff.charAt(i + 5) == ';') { 312 vBuf.append('\''); 313 i = i + 5; 314 continue; 315 } 316 } else if (vCh2 == 'l' && fBuff.charAt(i + 2) == 't' && fBuff.charAt(i + 3) == ';') { 317 vBuf.append('<'); 318 i = i + 3; 319 continue; 320 } else if (vCh2 == 'g'&& fBuff.charAt(i + 2) == 't' && fBuff.charAt(i + 3) == ';') { 321 vBuf.append('>'); 322 i = i + 3; 323 continue; 324 } else if (vCh2 == 'q'&& fBuff.charAt(i + 2) == 'u' && i < vLen - 5 && fBuff.charAt(i + 3) == 'o' && fBuff.charAt(i + 4) == 't' && fBuff.charAt(i + 5) == ';') { 325 vBuf.append('\"'); 326 i = i + 5; 327 continue; 328 } 329 } 330 vBuf.append(vCh); 331 } 332 vInc = vBuf.toString(); 333 } else { 334 vInc = fBuff.toString(); 335 } 336 337 try { 338 if (vInc.equals("")) { 339 fWriterDest.write(fTagOuv); 340 } else if (vInc.equals("endif")) { 341 fWriteDest = true; 342 if (fStackCond != null && fStackCond.size() > 0) { 343 //On supprime le dernier if 344 fStackCond.remove(fStackCond.size() - 1); 345 //Si il existe encore un test faux, on bloque toujours l'écriture. 346 for (int i = 0; i < fStackCond.size(); i++) { 347 Boolean vResultIf = (Boolean) fStackCond.get(i); 348 if (vResultIf == Boolean.FALSE) { 349 fWriteDest = false; 350 break; 351 } 352 } 353 } 354 } else if (vInc.equals("else")) { 355 fWriteDest = true; 356 if (fStackCond != null && fStackCond.size() > 0) { 357 //On supprime le dernier if 358 int vPos = fStackCond.size() - 1; 359 Boolean vNewVal = ((Boolean) fStackCond.get(vPos)).booleanValue() ? Boolean.FALSE : Boolean.TRUE; 360 fStackCond.set(vPos, vNewVal); 361 fWriteDest = vNewVal.booleanValue(); 362 if (fWriteDest) { 363 //Si il existe encore un test faux, on bloque toujours l'écriture. 364 for (int i = 0; i < fStackCond.size(); i++) { 365 Boolean vResultIf = (Boolean) fStackCond.get(i); 366 if (vResultIf == Boolean.FALSE) { 367 fWriteDest = false; 368 break; 369 } 370 } 371 } 372 } 373 } else if (fWriteDest) { 374 375 IWAgent vAgent = null; 376 IWService vService = null; 377 IHDialog vDialog = fDialog; 378 String vArgument = null; 379 380 int vOffset = -1; 381 int vEnd = 0; 382 383 vOffset = vInc.indexOf(";arguments="); 384 if (vOffset > 0) { 385 vArgument = vInc.substring(vOffset + 11); 386 vInc = vInc.substring(0, vOffset); 387 } 388 389 // 'argument=' = OBSOLET A VIRER ! 390 vOffset = vInc.indexOf(";argument="); 391 if (vOffset > 0) { 392 vArgument = vInc.substring(vOffset + 10); 393 vInc = vInc.substring(0, vOffset); 394 HLogMgr.hPublishTrace("La syntaxe 'argument=' dans une inclusion dynamique est obsolete et doit etre remplacée par 'arguments='."); 395 } 396 397 if (vInc.startsWith("agent=")) { 398 vOffset = 6; 399 } else { 400 vOffset = vInc.indexOf(";agent="); 401 if (vOffset >= 0) { 402 vOffset += 7; 403 } 404 } 405 if (vOffset > 0) { 406 vEnd = Math.max(vInc.indexOf(';', vOffset), vInc.length()); 407 String vUrl = vInc.substring(vOffset, vEnd); 408 if (fOwner instanceof IWAgent) { 409 vAgent = ((IWAgent) fOwner).hGetAgentParRef(vUrl); 410 } else { 411 throw HLogMgr.hNewException("Impossible d'accéder à un agent dans le contexte de service."); 412 } 413 if (vAgent == null) { 414 //throw HLogMgr.hNewException("L'url '" + vUrl + "' ne pointe sur aucun agent."); 415 return; 416 } else if (!(vAgent instanceof IWAgentComputor)) { 417 throw HLogMgr.hNewException("L'url '" + vUrl + "' pointe sur l'agent '" + vAgent + "' qui ne peut produire de résultat"); 418 } 419 } 420 421 if (vInc.startsWith("service=")) { 422 vOffset = 8; 423 } else { 424 vOffset = vInc.indexOf(";service="); 425 if (vOffset >= 0) { 426 vOffset += 9; 427 } 428 } 429 if (vOffset > 0) { 430 vEnd = Math.max(vInc.indexOf(';', vOffset), vInc.length()); 431 String vUrl = vInc.substring(vOffset, vEnd); 432 vService = ((IWSDialog) fDialog.hGoTo(vUrl)).hGetService(); 433 if (vService == null) { 434 //throw HLogMgr.hNewException("L'url '" + vUrl + "' ne pointe sur aucun service."); 435 return; 436 } else if (!(vService instanceof IWServiceAvecResultat)) { 437 throw HLogMgr.hNewException("L'url '" + vUrl + "' pointe sur le service '" + vService + "' qui ne peut produire de résultat"); 438 } 439 } 440 441 if (vInc.startsWith("dialog=")) { 442 vOffset = 7; 443 } else { 444 vOffset = vInc.indexOf(";dialog="); 445 if (vOffset >= 0) { 446 vOffset += 8; 447 } 448 } 449 450 //'dialogue=' = OBSOLET A VIRER ! 451 // if (vInc.startsWith("dialogue=")) { 452 // vOffset = 9; 453 // HLogMgr.hPublishTrace("La syntaxe 'dialogue=' dans une inclusion dynamique est obsolete et doit etre remplacée par 'dialog='."); 454 // } else { 455 // vOffset = vInc.indexOf(";dialogue="); 456 // if (vOffset >= 0) { 457 // vOffset += 10; 458 // HLogMgr.hPublishTrace("La syntaxe 'dialogue=' dans une inclusion dynamique est obsolete et doit etre remplacée par 'dialog='."); 459 // } 460 // } 461 462 if (vOffset > 0) { 463 vEnd = Math.max(vInc.indexOf(';', vOffset), vInc.length()); 464 String vUrl = vInc.substring(vOffset, vEnd); 465 vDialog = fDialog.hGoTo(vUrl); 466 if (vDialog == null) { 467 //throw HLogMgr.hNewException("L'url '" + vUrl + "' ne pointe sur aucun dialogue."); 468 return; 469 } 470 } 471 472 if (vInc.startsWith("if;")) { 473 IComputedData vRes = IComputedData.NULL; 474 if (vAgent != null) { 475 vRes = ((IWAgentComputor) vAgent).computeAsData(vDialog, vArgument); 476 } else if (vService != null) { 477 vRes = ((IWServiceAvecResultat) vService).hGetResultat(vDialog, vArgument); 478 } else if (vDialog instanceof IWADialog) { 479 if (!(((IWADialog) vDialog).hGetAgent() instanceof IWAgentComputor)) { 480 throw HLogMgr.hNewException("Le dialogue d'agent '" + vDialog + "' ne peut pas produire de résultat"); 481 } 482 vRes = ((IWAgentComputor) ((IWADialog) vDialog).hGetAgent()).computeAsData(vDialog, vArgument); 483 } else if (vDialog instanceof IWSDialog) { 484 if (!(((IWSDialog) vDialog).hGetService() instanceof IWServiceAvecResultat)) { 485 throw HLogMgr.hNewException("Le dialogue de service '" + vDialog + "' ne peut pas produire de résultat"); 486 } 487 vRes = ((IWServiceAvecResultat) ((IWSDialog) vDialog).hGetService()).hGetResultat(vDialog, vArgument); 488 } 489 if (fStackCond == null) fStackCond = new ArrayList(); 490 if (HDonneeUtils.hGetBooleanEvalTrue(vRes.getString())) { 491 fStackCond.add(Boolean.TRUE); 492 } else { 493 fStackCond.add(Boolean.FALSE); 494 fWriteDest = false; 495 } 496 } else { 497 Writer vWriter = fWriterDest; 498 if (vInc.startsWith("escapeXml;")) { 499 vWriter = new HWriterEscapeXml(vWriter, HWriterEscapeXml.ESCAPE_ATTR); 500 } 501 if (vAgent != null) { 502 ((IWAgentComputor) vAgent).computeAsData(vDialog, vArgument).writeValue(vWriter); 503 } else if (vService != null) { 504 ((IWServiceAvecResultat) vService).hGetResultat(vDialog, vArgument).writeValue(vWriter); 505 } else if (vDialog instanceof IWADialog) { 506 if (!(((IWADialog) vDialog).hGetAgent() instanceof IWAgentComputor)) { 507 throw HLogMgr.hNewException("Le dialogue d'agent '" + vDialog + "' ne peut pas produire de résultat"); 508 } 509 ((IWAgentComputor) ((IWADialog) vDialog).hGetAgent()).computeAsData(vDialog, vArgument).writeValue(vWriter); 510 } else if (vDialog instanceof IWSDialog) { 511 if (!(((IWSDialog) vDialog).hGetService() instanceof IWServiceAvecResultat)) { 512 throw HLogMgr.hNewException("Le dialogue de service '" + vDialog + "' ne peut pas produire de résultat"); 513 } 514 ((IWServiceAvecResultat) ((IWSDialog) vDialog).hGetService()).hGetResultat(vDialog, vArgument).writeValue(vWriter); 515 } 516 } 517 } 518 519 // 520 else { 521 //Cas : fWriteDest == false 522 if (vInc.startsWith("if;")) { 523 //Un père est déjà faux, on ajoute une condition à la stack, la valeur n'a aucune importance. 524 fStackCond.add(Boolean.TRUE); 525 } 526 } 527 528 } catch (IOException e) { 529 throw (IOException) HLogMgr.hAddMessage(e, "Echec à l'insertion d'une inclusion : '" + vInc + "'."); 530 } catch (Exception e) { 531 throw (IOException) HLogMgr.hAddMessage(new IOException("Echec à l'insertion d'une inclusion : '" + vInc + "'."), HLogMgr.hGetMessage(e)); 532 } finally { 533 fBuff.setLength(0); 534 } 535 536 } 78 protected static final int STATUT_TEXT = 0; 79 80 protected static final int STATUT_TAGOUV = 1; 81 82 protected static final int STATUT_TAGIN = 2; 83 84 protected static final int STATUT_TAGFERM = 3; 85 86 protected static final char[] TAGOUV_DEFAUT = { '[', '!', '[' }; 87 88 protected static final char[] TAGFERM_DEFAUT = { ']', '!', ']' }; 89 90 /** Writer de destination.*/ 91 protected Writer fWriterDest = null; 92 93 /** Dialog en cours.*/ 94 protected IHDialog fDialog = null; 95 96 /** Owner de cette données.*/ 97 protected Object fOwner = null; 98 99 /** Arguments associés à l'appel de la donnée.*/ 100 protected Object fArguments = null; 101 102 /** Statut correspondant au dernier caractere lu.*/ 103 protected int fStatut = STATUT_TEXT; 104 105 /** Nombre de caractères lus du tag.*/ 106 protected int fPosTagCourant = 0; 107 108 /** Tag d'ouverture d'une inclusion.*/ 109 protected char[] fTagOuv = TAGOUV_DEFAUT; 110 111 /** Tag de fermeture d'une inclusion.*/ 112 protected char[] fTagFerm = TAGFERM_DEFAUT; 113 114 /** Buffer de l'inclusion.*/ 115 protected StringBuffer fBuff = null; 116 117 /** Flag si le flux doit être envoyé dans la dest. */ 118 protected boolean fWriteDest = true; 119 120 /** Flag si la source est XML, donc nécessité de décoder les entitées XML avant de traiter les inclusions. */ 121 protected boolean fSrcIsXml = true; 122 123 /** Stack des if imbriqués. */ 124 protected List fStackCond = null; 125 126 /** 127 * 128 */ 129 public XWriter(Writer pWriterDest, IHDialog pDialog, Object pOwner, Object pArguments, boolean pSrcIsXml) { 130 super(); 131 fWriterDest = pWriterDest; 132 fDialog = pDialog; 133 fOwner = pOwner; 134 fArguments = pArguments; 135 fSrcIsXml = pSrcIsXml; 136 } 137 138 /** 139 * Close the stream, flushing it first. Once a stream has been closed, 140 * further write() or flush() invocations will cause an IOException to be 141 * thrown. Closing a previously-closed stream, however, has no effect. 142 * 143 * @exception IOException If an I/O error occurs 144 */ 145 public void close() throws IOException { 146 147 if (fStatut == STATUT_TAGIN || fStatut == STATUT_TAGFERM) { 148 String vInc = fBuff.toString(); 149 fWriterDest.write(fTagOuv); 150 fWriterDest.write(vInc); 151 if (fStatut == STATUT_TAGFERM) { 152 fWriterDest.write(fTagFerm, 0, fPosTagCourant); 153 } 154 HLogMgr.hPublishException("Terminaison anormale d'une donnée de type 'inclusion-dynamique' dans le dialogue : " + fDialog + ". L'inclusion '" + vInc + "' n'a pu être exécutée."); 155 } 156 157 fWriterDest.close(); 158 } 159 160 /** 161 * Flush the stream. If the stream has saved any characters from the 162 * various write() methods in a buffer, write them immediately to their 163 * intended destination. Then, if that destination is another character or 164 * byte stream, flush it. Thus one flush() invocation will flush all the 165 * buffers in a chain of Writers and OutputStreams. 166 * 167 * @exception IOException If an I/O error occurs 168 */ 169 public void flush() throws IOException { 170 fWriterDest.flush(); 171 } 172 173 /** 174 * Write a portion of an array of characters. 175 * 176 * @param pBuf Array of characters 177 * @param pOffset Offset from which to start writing characters 178 * @param pLength Number of characters to write 179 * 180 * @exception IOException If an I/O error occurs 181 */ 182 public void write(char[] pBuf, int pOffset, int pLength) throws IOException { 183 184 int vEnd = pOffset + pLength; 185 for (int i = pOffset; i < vEnd; i++) { 186 write(pBuf[i]); 187 } 188 189 } 190 191 public void write(int pChar) throws IOException { 192 193 switch (fStatut) { 194 case STATUT_TEXT: { 195 if (pChar == fTagOuv[0]) { 196 if (fTagOuv.length == 1) { 197 //On a trouvé un tag d'ouverture 198 if (fBuff == null) { 199 fBuff = new StringBuffer(64); 200 } 201 fStatut = STATUT_TAGIN; 202 } else { 203 fStatut = STATUT_TAGOUV; 204 fPosTagCourant = 1; 205 } 206 207 } else { 208 if (fWriteDest) fWriterDest.write(pChar); 209 } 210 break; 211 } 212 case STATUT_TAGOUV: { 213 if (pChar == fTagOuv[fPosTagCourant]) { 214 fPosTagCourant++; 215 if (fTagOuv.length == fPosTagCourant) { 216 //On a trouvé un tag d'ouverture 217 if (fBuff == null) { 218 fBuff = new StringBuffer(64); 219 } 220 fStatut = STATUT_TAGIN; 221 } 222 } else { 223 //On n'est pas sur un tag d'ouverture 224 if (fWriteDest) fWriterDest.write(fTagOuv, 0, fPosTagCourant); 225 if (pChar == fTagOuv[0]) { 226 fPosTagCourant = 1; 227 } else { 228 fStatut = STATUT_TEXT; 229 if (fWriteDest) fWriterDest.write((char) pChar); 230 } 231 } 232 break; 233 } 234 case STATUT_TAGIN: { 235 if (pChar == fTagFerm[0]) { 236 if (fTagFerm.length == 1) { 237 //On a trouvé le tag de fermeture 238 xExecuteInclusion(); 239 } else { 240 //On entame peut-être le tag de fermeture 241 fStatut = STATUT_TAGFERM; 242 fPosTagCourant = 1; 243 } 244 } else { 245 fBuff.append((char) pChar); 246 } 247 break; 248 } 249 case STATUT_TAGFERM: { 250 if (pChar == fTagFerm[fPosTagCourant]) { 251 fPosTagCourant++; 252 if (fTagFerm.length == fPosTagCourant) { 253 //On a trouvé le tag de fermeture 254 xExecuteInclusion(); 255 } 256 } else { 257 //On n'est pas encore sur le tag de fermeture 258 fBuff.append(fTagFerm, 0, fPosTagCourant); 259 if (pChar == fTagFerm[0]) { 260 fPosTagCourant = 1; 261 } else { 262 fStatut = STATUT_TAGIN; 263 fBuff.append((char) pChar); 264 } 265 } 266 break; 267 } 268 } 269 } 270 271 public void write(String pStr) throws IOException { 272 int vEnd = pStr.length(); 273 for (int i = 0; i < vEnd; i++) { 274 write(pStr.charAt(i)); 275 } 276 } 277 278 public void write(String pStr, int pOffset, int pLength) throws IOException { 279 int vEnd = Math.min(pOffset + pLength, pStr.length()); 280 for (int i = pOffset; i < vEnd; i++) { 281 write(pStr.charAt(i)); 282 } 283 } 284 285 /** 286 * NOTE : l'atribut "argument" DOIT être en derniere position après les 287 * les attrributs "agent" "service" et/ou "dialogue". 288 * NOTE : si le contenu de l'inclusion est vide, le tag d'ouverture est recopié 289 * dans le résultat (escape du tag d'ouveture). 290 * 291 */ 292 public void xExecuteInclusion() throws IOException { 293 294 fStatut = STATUT_TEXT; 295 296 String vInc; 297 if (fSrcIsXml) { 298 int vLen = fBuff.length(); 299 StringBuffer vBuf = new StringBuffer(vLen); 300 for (int i = 0; i < vLen; i++) { 301 char vCh = fBuff.charAt(i); 302 if (vCh == '&' && i < vLen - 3) { 303 char vCh2 = fBuff.charAt(i + 1); 304 if (vCh2 == 'a') { 305 if (fBuff.charAt(i + 2) == 'm' && fBuff.charAt(i + 3) == 'p' && i < vLen - 4 && fBuff.charAt(i + 4) == ';') { 306 vBuf.append('&'); 307 i = i + 4; 308 continue; 309 } 310 if (fBuff.charAt(i + 2) == 'p' && fBuff.charAt(i + 3) == 'o' && i < vLen - 5 && fBuff.charAt(i + 4) == 's' && fBuff.charAt(i + 5) == ';') { 311 vBuf.append('\''); 312 i = i + 5; 313 continue; 314 } 315 } else if (vCh2 == 'l' && fBuff.charAt(i + 2) == 't' && fBuff.charAt(i + 3) == ';') { 316 vBuf.append('<'); 317 i = i + 3; 318 continue; 319 } else if (vCh2 == 'g' && fBuff.charAt(i + 2) == 't' && fBuff.charAt(i + 3) == ';') { 320 vBuf.append('>'); 321 i = i + 3; 322 continue; 323 } else if (vCh2 == 'q' && fBuff.charAt(i + 2) == 'u' && i < vLen - 5 && fBuff.charAt(i + 3) == 'o' && fBuff.charAt(i + 4) == 't' && fBuff.charAt(i + 5) == ';') { 324 vBuf.append('\"'); 325 i = i + 5; 326 continue; 327 } 328 } 329 vBuf.append(vCh); 330 } 331 vInc = vBuf.toString(); 332 } else { 333 vInc = fBuff.toString(); 334 } 335 336 try { 337 if (vInc.equals("")) { 338 fWriterDest.write(fTagOuv); 339 } else if (vInc.equals("endif")) { 340 fWriteDest = true; 341 if (fStackCond != null && fStackCond.size() > 0) { 342 //On supprime le dernier if 343 fStackCond.remove(fStackCond.size() - 1); 344 //Si il existe encore un test faux, on bloque toujours l'écriture. 345 for (int i = 0; i < fStackCond.size(); i++) { 346 Boolean vResultIf = (Boolean) fStackCond.get(i); 347 if (vResultIf == Boolean.FALSE) { 348 fWriteDest = false; 349 break; 350 } 351 } 352 } 353 } else if (vInc.equals("else")) { 354 fWriteDest = true; 355 if (fStackCond != null && fStackCond.size() > 0) { 356 //On supprime le dernier if 357 int vPos = fStackCond.size() - 1; 358 Boolean vNewVal = ((Boolean) fStackCond.get(vPos)).booleanValue() ? Boolean.FALSE : Boolean.TRUE; 359 fStackCond.set(vPos, vNewVal); 360 fWriteDest = vNewVal.booleanValue(); 361 if (fWriteDest) { 362 //Si il existe encore un test faux, on bloque toujours l'écriture. 363 for (int i = 0; i < fStackCond.size(); i++) { 364 Boolean vResultIf = (Boolean) fStackCond.get(i); 365 if (vResultIf == Boolean.FALSE) { 366 fWriteDest = false; 367 break; 368 } 369 } 370 } 371 } 372 } else if (fWriteDest) { 373 374 IWAgent vAgent = null; 375 IWService vService = null; 376 IHDialog vDialog = fDialog; 377 String vArgument = null; 378 379 int vOffset = -1; 380 int vEnd = 0; 381 382 vOffset = vInc.indexOf(";arguments="); 383 if (vOffset > 0) { 384 vArgument = vInc.substring(vOffset + 11); 385 vInc = vInc.substring(0, vOffset); 386 } 387 388 // 'argument=' = OBSOLET A VIRER ! 389 vOffset = vInc.indexOf(";argument="); 390 if (vOffset > 0) { 391 vArgument = vInc.substring(vOffset + 10); 392 vInc = vInc.substring(0, vOffset); 393 HLogMgr.hPublishTrace("La syntaxe 'argument=' dans une inclusion dynamique est obsolete et doit etre remplacée par 'arguments='."); 394 } 395 396 if (vInc.startsWith("agent=")) { 397 vOffset = 6; 398 } else { 399 vOffset = vInc.indexOf(";agent="); 400 if (vOffset >= 0) { 401 vOffset += 7; 402 } 403 } 404 if (vOffset > 0) { 405 vEnd = Math.max(vInc.indexOf(';', vOffset), vInc.length()); 406 String vUrl = vInc.substring(vOffset, vEnd); 407 if (fOwner instanceof IWAgent) { 408 vAgent = ((IWAgent) fOwner).hGetAgentParRef(vUrl); 409 } else { 410 throw HLogMgr.hNewException("Impossible d'accéder à un agent dans le contexte de service."); 411 } 412 if (vAgent == null) { 413 //throw HLogMgr.hNewException("L'url '" + vUrl + "' ne pointe sur aucun agent."); 414 return; 415 } else if (!(vAgent instanceof IWAgentComputor)) { throw HLogMgr.hNewException("L'url '" + vUrl + "' pointe sur l'agent '" + vAgent + "' qui ne peut produire de résultat"); } 416 } 417 418 if (vInc.startsWith("service=")) { 419 vOffset = 8; 420 } else { 421 vOffset = vInc.indexOf(";service="); 422 if (vOffset >= 0) { 423 vOffset += 9; 424 } 425 } 426 if (vOffset > 0) { 427 vEnd = Math.max(vInc.indexOf(';', vOffset), vInc.length()); 428 String vUrl = vInc.substring(vOffset, vEnd); 429 vService = ((IWSDialog) fDialog.hGoTo(vUrl)).hGetService(); 430 if (vService == null) { 431 //throw HLogMgr.hNewException("L'url '" + vUrl + "' ne pointe sur aucun service."); 432 return; 433 } else if (!(vService instanceof IWServiceAvecResultat)) { throw HLogMgr.hNewException("L'url '" + vUrl + "' pointe sur le service '" + vService + "' qui ne peut produire de résultat"); } 434 } 435 436 if (vInc.startsWith("dialog=")) { 437 vOffset = 7; 438 } else { 439 vOffset = vInc.indexOf(";dialog="); 440 if (vOffset >= 0) { 441 vOffset += 8; 442 } 443 } 444 445 //'dialogue=' = OBSOLET A VIRER ! 446 // if (vInc.startsWith("dialogue=")) { 447 // vOffset = 9; 448 // HLogMgr.hPublishTrace("La syntaxe 'dialogue=' dans une inclusion dynamique est obsolete et doit etre remplacée par 'dialog='."); 449 // } else { 450 // vOffset = vInc.indexOf(";dialogue="); 451 // if (vOffset >= 0) { 452 // vOffset += 10; 453 // HLogMgr.hPublishTrace("La syntaxe 'dialogue=' dans une inclusion dynamique est obsolete et doit etre remplacée par 'dialog='."); 454 // } 455 // } 456 457 if (vOffset > 0) { 458 vEnd = Math.max(vInc.indexOf(';', vOffset), vInc.length()); 459 String vUrl = vInc.substring(vOffset, vEnd); 460 vDialog = fDialog.hGoTo(vUrl); 461 if (vDialog == null) { 462 //throw HLogMgr.hNewException("L'url '" + vUrl + "' ne pointe sur aucun dialogue."); 463 return; 464 } 465 } 466 467 if (vInc.startsWith("if;")) { 468 String vRes = ""; 469 if (vAgent != null) { 470 vRes = ((IWAgentComputor) vAgent).computeAsString(vDialog, vArgument); 471 } else if (vService != null) { 472 vRes = ((IWServiceAvecResultat) vService).hGetResultat(vDialog, vArgument).getString(); 473 } else if (vDialog instanceof IWADialog) { 474 if (!(((IWADialog) vDialog).hGetAgent() instanceof IWAgentComputor)) { throw HLogMgr.hNewException("Le dialogue d'agent '" + vDialog + "' ne peut pas produire de résultat"); } 475 vRes = ((IWAgentComputor) ((IWADialog) vDialog).hGetAgent()).computeAsString(vDialog, vArgument); 476 } else if (vDialog instanceof IWSDialog) { 477 if (!(((IWSDialog) vDialog).hGetService() instanceof IWServiceAvecResultat)) { throw HLogMgr.hNewException("Le dialogue de service '" + vDialog + "' ne peut pas produire de résultat"); } 478 vRes = ((IWServiceAvecResultat) ((IWSDialog) vDialog).hGetService()).hGetResultat(vDialog, vArgument).getString(); 479 } 480 if (fStackCond == null) fStackCond = new ArrayList(); 481 if (HDonneeUtils.hGetBooleanEvalTrue(vRes)) { 482 fStackCond.add(Boolean.TRUE); 483 } else { 484 fStackCond.add(Boolean.FALSE); 485 fWriteDest = false; 486 } 487 } else { 488 Writer vWriter = fWriterDest; 489 if (vInc.startsWith("escapeXml;")) { 490 vWriter = new HWriterEscapeXml(vWriter, HWriterEscapeXml.ESCAPE_ATTR); 491 } 492 if (vAgent != null) { 493 ((IWAgentComputor) vAgent).computeAsData(vDialog, vArgument).writeValue(vWriter); 494 } else if (vService != null) { 495 ((IWServiceAvecResultat) vService).hGetResultat(vDialog, vArgument).writeValue(vWriter); 496 } else if (vDialog instanceof IWADialog) { 497 if (!(((IWADialog) vDialog).hGetAgent() instanceof IWAgentComputor)) { throw HLogMgr.hNewException("Le dialogue d'agent '" + vDialog + "' ne peut pas produire de résultat"); } 498 ((IWAgentComputor) ((IWADialog) vDialog).hGetAgent()).computeAsData(vDialog, vArgument).writeValue(vWriter); 499 } else if (vDialog instanceof IWSDialog) { 500 if (!(((IWSDialog) vDialog).hGetService() instanceof IWServiceAvecResultat)) { throw HLogMgr.hNewException("Le dialogue de service '" + vDialog + "' ne peut pas produire de résultat"); } 501 ((IWServiceAvecResultat) ((IWSDialog) vDialog).hGetService()).hGetResultat(vDialog, vArgument).writeValue(vWriter); 502 } 503 } 504 } 505 506 // 507 else { 508 //Cas : fWriteDest == false 509 if (vInc.startsWith("if;")) { 510 //Un père est déjà faux, on ajoute une condition à la stack, la valeur n'a aucune importance. 511 fStackCond.add(Boolean.TRUE); 512 } 513 } 514 515 } catch (IOException e) { 516 throw (IOException) HLogMgr.hAddMessage(e, "Echec à l'insertion d'une inclusion : '" + vInc + "'."); 517 } catch (Exception e) { 518 throw (IOException) HLogMgr.hAddMessage(new IOException("Echec à l'insertion d'une inclusion : '" + vInc + "'."), HLogMgr.hGetMessage(e)); 519 } finally { 520 fBuff.setLength(0); 521 } 522 523 } 537 524 } -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPath.java
r7458 r7466 45 45 import com.scenari.m.co.agent.IWADialog; 46 46 import com.scenari.m.co.agent.IWAgent; 47 import com.scenari.m.co.agent.IWAgent AvecLiens;47 import com.scenari.m.co.agent.IWAgentLinker; 48 48 import com.scenari.m.co.agent.IWAgentComputor; 49 49 import com.scenari.m.co.dialog.IHDialog; … … 244 244 * 245 245 */ 246 public IWAgent AvecLienswGetRefAgentAvecLiens(XPathContext pCtx, XObject pXObj) throws Exception {246 public IWAgentLinker wGetRefAgentAvecLiens(XPathContext pCtx, XObject pXObj) throws Exception { 247 247 IWAgent vAgent = wGetRefAgent(pCtx, pXObj); 248 while (vAgent != null && !(vAgent instanceof IWAgent AvecLiens)) {248 while (vAgent != null && !(vAgent instanceof IWAgentLinker)) { 249 249 vAgent = vAgent.hGetAgentPere(); 250 250 } 251 return (IWAgent AvecLiens) vAgent;251 return (IWAgentLinker) vAgent; 252 252 } 253 253 -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathAgentsLies.java
r1710 r7466 42 42 43 43 import com.scenari.m.co.agent.IWAgent; 44 import com.scenari.m.co.agent.IWAgent AvecLiens;44 import com.scenari.m.co.agent.IWAgentLinker; 45 45 import com.scenari.m.co.dialog.IHDialog; 46 46 import com.scenari.s.fw.log.HLogMgr; … … 114 114 //On recherche l'AgentAvecLiens 115 115 XObject vXObj = fArgAgentDial.execute(pCtx); 116 IWAgent AvecLiensvAgentPere = wGetRefAgentAvecLiens(pCtx, vXObj);116 IWAgentLinker vAgentPere = wGetRefAgentAvecLiens(pCtx, vXObj); 117 117 118 118 if (vAgentPere != null) { -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathMax.java
r7458 r7466 125 125 vDialog = wGetDialogFromCtx(pCtx); 126 126 } 127 String vVal = ((IWAgentComputor) vNode).computeAs Data(vDialog, null).getString();127 String vVal = ((IWAgentComputor) vNode).computeAsString(vDialog, null); 128 128 vCurentDouble = XString.castToNum(vVal); 129 129 } else { … … 143 143 vDialog = wGetDialogFromCtx(pCtx); 144 144 } 145 String vVal = ((IWAgentComputor) vObj).computeAs Data(vDialog, null).getString();145 String vVal = ((IWAgentComputor) vObj).computeAsString(vDialog, null); 146 146 vCurentDouble = XString.castToNum(vVal); 147 147 } else if (vObj instanceof IWServiceAvecResultat) { -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathMin.java
r7458 r7466 126 126 vDialog = wGetDialogFromCtx(pCtx); 127 127 } 128 String vVal = ((IWAgentComputor) vNode).computeAs Data(vDialog, null).getString();128 String vVal = ((IWAgentComputor) vNode).computeAsString(vDialog, null); 129 129 vCurentDouble = XString.castToNum(vVal); 130 130 } else { … … 144 144 vDialog = wGetDialogFromCtx(pCtx); 145 145 } 146 String vVal = ((IWAgentComputor) vObj).computeAs Data(vDialog, null).getString();146 String vVal = ((IWAgentComputor) vObj).computeAsString(vDialog, null); 147 147 vCurentDouble = XString.castToNum(vVal); 148 148 } else if (vObj instanceof IWServiceAvecResultat) { -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathMoyenne.java
r7458 r7466 129 129 vDialog = wGetDialogFromCtx(pCtx); 130 130 } 131 String vVal = ((IWAgentComputor) vNode).computeAs Data(vDialog, null).getString();131 String vVal = ((IWAgentComputor) vNode).computeAsString(vDialog, null); 132 132 vSum += XString.castToNum(vVal); 133 133 vCount++; … … 147 147 vDialog = wGetDialogFromCtx(pCtx); 148 148 } 149 String vVal = ((IWAgentComputor) vObj).computeAs Data(vDialog, null).getString();149 String vVal = ((IWAgentComputor) vObj).computeAsString(vDialog, null); 150 150 vSum += XString.castToNum(vVal); 151 151 vCount++; -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathResultat.java
r7458 r7466 130 130 vParams = fArgArgument.execute(pCtx).object(); 131 131 } 132 vResult = ((IWAgentComputor) vAgent).computeAs Data(vDialog, vParams).getString();132 vResult = ((IWAgentComputor) vAgent).computeAsString(vDialog, vParams); 133 133 } 134 134 } else { -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathResultatAgent.java
r7458 r7466 119 119 vParams = fArgArgument.execute(pCtx).object(); 120 120 } 121 vResult = vAgent.computeAs Data(vDialog, vParams).getString();121 vResult = vAgent.computeAsString(vDialog, vParams); 122 122 } 123 123 if (vResult != null && vResult.length() > 0) { -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathResultatDialogue.java
r7458 r7466 129 129 } 130 130 if (vAgent != null) { 131 vResult = ((IWAgentComputor) vAgent).computeAs Data(vDialog, vParams).getString();131 vResult = ((IWAgentComputor) vAgent).computeAsString(vDialog, vParams); 132 132 } 133 133 } else if (vDialog instanceof IWSDialog) { -
trunk/Jav_CO/com/scenari/m/co/xpath/dom/ZXPathSomme.java
r7458 r7466 129 129 vDialog = wGetDialogFromCtx(pCtx); 130 130 } 131 String vVal = ((IWAgentComputor) vNode).computeAs Data(vDialog, null).getString();131 String vVal = ((IWAgentComputor) vNode).computeAsString(vDialog, null); 132 132 vSum += XString.castToNum(vVal); 133 133 vCount++; … … 147 147 vDialog = wGetDialogFromCtx(pCtx); 148 148 } 149 String vVal = ((IWAgentComputor) vObj).computeAs Data(vDialog, null).getString();149 String vVal = ((IWAgentComputor) vObj).computeAsString(vDialog, null); 150 150 vSum += XString.castToNum(vVal); 151 151 vCount++; -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPath.java
r7458 r7466 55 55 import com.scenari.m.co.agent.IWADialog; 56 56 import com.scenari.m.co.agent.IWAgent; 57 import com.scenari.m.co.agent.IWAgent AvecLiens;57 import com.scenari.m.co.agent.IWAgentLinker; 58 58 import com.scenari.m.co.agent.IWAgentComputor; 59 59 import com.scenari.m.co.dialog.IHDialog; … … 254 254 * 255 255 */ 256 public IWAgent AvecLienswGetRefAgentAvecLiens(XPathContext pCtx, XObject pXObj) throws Exception {256 public IWAgentLinker wGetRefAgentAvecLiens(XPathContext pCtx, XObject pXObj) throws Exception { 257 257 IWAgent vAgent = wGetRefAgent(pCtx, pXObj); 258 while (vAgent != null && !(vAgent instanceof IWAgent AvecLiens)) {258 while (vAgent != null && !(vAgent instanceof IWAgentLinker)) { 259 259 vAgent = vAgent.hGetAgentPere(); 260 260 } 261 return (IWAgent AvecLiens) vAgent;261 return (IWAgentLinker) vAgent; 262 262 } 263 263 -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathAgentsLies.java
r1710 r7466 48 48 49 49 import com.scenari.m.co.agent.IWAgent; 50 import com.scenari.m.co.agent.IWAgent AvecLiens;50 import com.scenari.m.co.agent.IWAgentLinker; 51 51 import com.scenari.m.co.dialog.IHDialog; 52 52 import com.scenari.s.fw.log.HLogMgr; … … 133 133 //On recherche l'AgentAvecLiens 134 134 XObject vXObj = fArgAgentDial.execute(pCtx); 135 IWAgent AvecLiensvAgentPere = wGetRefAgentAvecLiens(pCtx, vXObj);135 IWAgentLinker vAgentPere = wGetRefAgentAvecLiens(pCtx, vXObj); 136 136 137 137 if (vAgentPere != null) { -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathMax.java
r7458 r7466 146 146 vDialog = wGetDialogFromCtx(pCtx); 147 147 } 148 String vVal = ((IWAgentComputor) vObj).computeAs Data(vDialog, null).getString();148 String vVal = ((IWAgentComputor) vObj).computeAsString(vDialog, null); 149 149 vCurentDouble = hGetStringToNumber(vVal); 150 150 } else if (vObj instanceof IWServiceAvecResultat) { -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathMin.java
r7458 r7466 151 151 vDialog = wGetDialogFromCtx(pCtx); 152 152 } 153 String vVal = ((IWAgentComputor) vObj).computeAs Data(vDialog, null).getString();153 String vVal = ((IWAgentComputor) vObj).computeAsString(vDialog, null); 154 154 vCurentDouble = hGetStringToNumber(vVal); 155 155 } else if (vObj instanceof IWServiceAvecResultat) { -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathMoyenne.java
r7458 r7466 157 157 vDialog = wGetDialogFromCtx(pCtx); 158 158 } 159 String vVal = ((IWAgentComputor) vObj).computeAs Data(vDialog, null).getString();159 String vVal = ((IWAgentComputor) vObj).computeAsString(vDialog, null); 160 160 vSum += hGetStringToNumber(vVal); 161 161 vCount++; -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathResultat.java
r7458 r7466 147 147 } 148 148 } 149 vResult = ((IWAgentComputor) vAgent).computeAs Data(vDialog, vParams).getString();149 vResult = ((IWAgentComputor) vAgent).computeAsString(vDialog, vParams); 150 150 } 151 151 } else { -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathResultatAgent.java
r7458 r7466 136 136 } 137 137 } 138 vResult = vAgent.computeAs Data(vDialog, vParams).getString();138 vResult = vAgent.computeAsString(vDialog, vParams); 139 139 } 140 140 if (vResult != null && vResult.length() > 0) { -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathResultatDialogue.java
r7458 r7466 145 145 } 146 146 if (vAgent != null) { 147 vResult = ((IWAgentComputor) vAgent).computeAs Data(vDialog, vParams).getString();147 vResult = ((IWAgentComputor) vAgent).computeAsString(vDialog, vParams); 148 148 } 149 149 } else if (vDialog instanceof IWSDialog) { -
trunk/Jav_CO/com/scenari/m/co/xpath/dtm/ZXPathSomme.java
r7458 r7466 157 157 vDialog = wGetDialogFromCtx(pCtx); 158 158 } 159 String vVal = ((IWAgentComputor) vObj).computeAs Data(vDialog, null).getString();159 String vVal = ((IWAgentComputor) vObj).computeAsString(vDialog, null); 160 160 vSum += hGetStringToNumber(vVal); 161 161 vCount++;
Note: See TracChangeset
for help on using the changeset viewer.