From d4dc85485dae32f67227d3e3a11774dc2f0dd225 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Thu, 25 Feb 2010 01:22:06 +0100 Subject: [PATCH] Add use of Exception for error management. --- .../classes/fr/devinsy/xid/DomPresenter.class | Bin 2720 -> 2550 bytes .../fr/devinsy/xid/FilePresenter.class | Bin 3210 -> 3044 bytes build/classes/fr/devinsy/xid/Presenter.class | Bin 18357 -> 18538 bytes .../fr/devinsy/xid/StringPresenter.class | Bin 3302 -> 3156 bytes demo/XidDemo.java | 452 +++++++++++------- src/fr/devinsy/xid/DomPresenter.java | 14 +- src/fr/devinsy/xid/FilePresenter.java | 20 +- src/fr/devinsy/xid/Presenter.java | 121 +++-- src/fr/devinsy/xid/StringPresenter.java | 24 +- 9 files changed, 372 insertions(+), 259 deletions(-) diff --git a/build/classes/fr/devinsy/xid/DomPresenter.class b/build/classes/fr/devinsy/xid/DomPresenter.class index 0771c5a509c22791cfd67405e72297206ed69c92..0a5a7e09cde3268d51eb0d4a04b039f3c3052a7c 100644 GIT binary patch delta 647 zcmZXQ%}*0i6vfY*H*Mu*RBTf+CY2PF0EJqk24WGh3Vzc1fuK}Hn=+CbovCg8iVNb# z#6(wb$I3qeKT?S%x-{{BaB1AKa%ns>Lm{$J0tdf0X6lc>eO2`&uzvqCXl#Wc~r^WtGG+K&56P|CSo|IC!{TpqoB)j zM4hxSib;Wy0bQ4=aG(Aq)4khpMj+nw9yY2@+VxuLMdwbuEfDI)vK9qDND zAAY$noUEcpzI#mMTC!gZo9rt!Ib@d-nZ?cRCfnF9Lm6{~qo`JOjN>>`%TJIPFL@(s zS8`bV$d=FK(j)=raK;orDe`l%Wp-l>6bWwC-J_-Iw=~YdBEaE zA__cW2ank#<6*iahHE^b@LX*1gtU43W!+98)8cVDRf_doBET>u?j%m(4@r-4DTlb+ zfxjc;7(OV5rSdY<6_Yd5F`m=H^CiO*u{>>&>}iYXW}WoKwnh?gU0$&|XfbK=w3&>Y Kx*>gsoBsfeFlLPa diff --git a/build/classes/fr/devinsy/xid/FilePresenter.class b/build/classes/fr/devinsy/xid/FilePresenter.class index 3d7ea468503a971c138e03e906a4cd80e8c5f978..ef17491ee549385ca20a678e93d9ed6d424bf70b 100644 GIT binary patch delta 1156 zcmZva?NeJ-5XOHexi>e2Yr#N)@KPwY3Lzv2N|j12N~=vts|B2c9QAl& zJ^G~gpq}%!#R8|+7o62nHlHh6#1sunsT---aw?aJ?MDJU&ydBSMD>`r!L)gS7xj;x z;lMGQK3-A`_vqg}?Jl4`<~`JD@ruH(AZ7Eh)7fPwz;RC4v~bkVN&TI--CxIRHm@_T zJB{wnC@0*EH*DVIjKb%vXN#qx!rRk($>OY@G1^r^uNys0aW^y0TQ+ZVK{8XTt4=Ph ze=-KgrWC5z4ZdUZF1-qWDL+{%WOEr8J85%?8KJeDDwY!YbapZ8q$?fb0p_@DF|WJK zj)p6w6oEzIJe8j+IF2H$H;se(mf3t{K~a-&a!w&t$`|}d%({4HylWsj;6h|<-Xp8G z&GWT$TyvFKR!r!iZ%Bk0Q7wAj*Q&qr#f|HVR=w+K4Oy%y>YpfHWvhrt$LI8b*V6M= zZQDnR#(W_YTN_%4rSmJX@%+N|6(?7+xTSZ!ppUlsiU={R>0g5j>w{Jq-Uw+qoT%C;PV;9Wg@2W7>kR zj+npD7&6O@sl*P^WXRm&)NaTqbNU;iJH(U0i7n3cmpLDtl%veX^#9ige&-+5%df*N zzxc)1JR7c9kLU>ZZ!`Od&T7&D_ZPexOmDO3ntj_WB_f-`(o2(^7ig4o3R6~~j-+@q zvURg`$$+{ym?y#&S>LOiWr0c3Oyh8w42v?nB1_!l8n;>DGxB^%i3hCFEReGzmPoNL z-9wRXMTF}nK$x6}H@$B?5U+Y?@~zTa739(s68~650S{s92|v?9 zS<>0!h9!&3U_-a`?qmJG1LAwZ^-AHPut=1MJjSmke&FfI-}*$9h%?dmM4XM*$~-@n z&bI~f4hOg^s(ns7_bQJJ3p;`117QcX0`5LTNxb?XC6yr#%cDIa7NV+WPe8mvRp@>Q ad$N44XK}OQ*N@S|$AaMQI;y{~{rY&vUc7j4(GkGZRkfgC1H z4B(j%j`9^bk)6V;I;I(7LE37uRv>B{`e!T4RktPL7?`F~@(A6YOpNhn(y!VA4PV^P=2ohAh9PJ(qD; zO9V261qL=IwiivD#TY}V;dLi2| zbdu-Q5v>cG|EgG{Wrkf9r{?&@hUbTHnL$4@lOG=6H*R1FD<z#c;> z$$wK~kBgk(KdD1}TRov{Fj)L^)v|P4Vd#BaGlu+sP=w_K|6c1ExXKXq{EEFXv22&T zs-5?in^mXQ_~B12Cbbxz07y@n{(zB6caY6=Fman!5@KXEFtRh~Cp+BD!U#rbMfo^@ zmx6r*FXJGcU}9LvQdM>f3Utb9r+&nqobmv<#kg`0hjVINeTY4gBRQ>=iEACavTz4c z;T&UyHtKP;gA-rFet^PauMv0;httxPF8S7X zY(G*kO%PI~rHqR^-WDm_jcND}?;}LYhVd1AtU)DUQECw)u!SA3No^8Pwh5`GgXvh; zF-5nrsnb|vqHh$t=%zksb*~C{sFgxThEr)0s*rt%5Swiyk_}XXn`IQQ&Sw5m$f9<@ zb+R85r%&j;yg>{gf^e?3r?U?`o diff --git a/build/classes/fr/devinsy/xid/Presenter.class b/build/classes/fr/devinsy/xid/Presenter.class index 57a5d043b00bde72946dc4d6a9e02704ab44811a..0a5522aaad92b625d9bbbe7386e3f2ce2bd8ecda 100644 GIT binary patch literal 18538 zcmcJ134B!5_5V5d&CHvbypWI(U=SoAB4i;f0-CUe5F`*1Ac3%`I7x;i8ZvP*VNLYpWK_?|bfhGns5^{eS-I%-naE zbI(2Z?B~U2zkKun5lvP1n53A7Z;0g8hBh@cwQSAX(ombXED~x7HAO=alUz)xX9qV0 z^BRLqb$R90XNPK{OerO03yN2-uP9ztxT3JKd<7F1F(ns;n_8m5rs%3*V{6F32J4yp z)vX&ggd!CU+d`OC!sKZT*VTn0Oo7sHq%JSm9IUAi<)QQBv-3*zPyy5QaTQf1l|_rz zR~F7MEgr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4 z4|XRrTZcK;p1B+=Da@Rb$Be1fBuhLKr+x{9d{s|9(&}nY9ZLuyn~V^sL_y&Q03}_* z`uwPkG1Yt3|%#Exj-XbqT+ZgwUS zRk0kT_QSCY$YtVK8D)3TjpK%Hl>J>IiN-as@zflh6qSwN(r@E^JH1IOv+4r)nLB84 zp*9@VN!sp=od$+prYgaA!Zzsq^mRRI9^wpWI~m{FLKRE2^ZO$K&WHR-I0;3KUqg zEyiqC|LuTzs~1Wd3d$+vD?%z^hg(f%85yn58Lf!B7dDV==K5 zLKHDXpAJ`EOu7u3qQ0xu;#kU2r)fkN^d2cM4NNAdrR#8LNIN-Ff!e35bvBSZj|0h( zO82VuYxb%JycVFEcB^3i9@PRj=iB%$V!w=_QE^`d=^ZRrPNN(ZG}^J4rXo#nqN9@L zIS|ElRO`c8Nr+N)hQ@Sk!}cXaJy{;a0vymPjgH&-Q~TNZCaLhtbXXW_vSdx+w}8GG1-2Y2k@Y&^KE zhc)-BGw%WA(s7JzbuPlAlW_~@;*Ms(I6oJRb263VcOfmK<@mMSx5O7;1is~#aw%nr xTb+LdhAdKq=gZf*cuOGpiJpdte*t(>z9#?x diff --git a/build/classes/fr/devinsy/xid/StringPresenter.class b/build/classes/fr/devinsy/xid/StringPresenter.class index 1c1107a615a4dbc58a35665cb3f3ea97723a529b..1a672c71fe424717493d73eea31db1e883ac76a5 100644 GIT binary patch delta 1409 zcma)5&vO%H7=FIZZg#UoN@Ix)(rGhDn})`vs72b)(vo6>NkCe$0a4Os({4?Zm>+GU zK-7~nju$?MLA~_G#Q{2M(lHJ*o|uv0=Eb8I{{v6{sPAsl6sre!cXpqBpZ9y-AK&}^ z>iMZt{qe8w9soFo%7*$ob8EgxDz7E=6(dt9YimYQ3nhvPepKAgH9-n9sFQ2+dah_> zGX)ubhNqVjD+w)~$Si0rM#TW0mk}WLKg68SaFpkSA;&Q%dhr6o5WgpM@jexanfv$SgP!#7SPV^-YdhE0WpyVmYTP7-z5t z7mLg3Q3a<>JT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K zB;7z=(l<%;10=43+7?>BkCuqY*Ki*vV*vqDeFEVIs#1Hil&n(mFtrl^r-ncg!DE3< znBW?ihB=K|*XT#YCU!!3V59Hw!!bF)=6|4>qBjvd{5L0YNE#qWOHi&a!9O=?6$@g1 z+k;Kgs3Up(dy^zdr9o1plW~d)uYsi_D_E41?Uiep?Ej4HK57zZqA1`!;(8w;5?{)D zq@G7-tJewF<)wpCN?qU3mVi2?UZd4kn@^$(*BiwT&|9uJkJL~Vhm3aZb^7w*jlTfb C^9IiV diff --git a/demo/XidDemo.java b/demo/XidDemo.java index 8a35774..24ddb6e 100644 --- a/demo/XidDemo.java +++ b/demo/XidDemo.java @@ -25,187 +25,277 @@ class XidDemo */ public static void main (String[] args) { - System.out.println("Hello World!"); + System.out.println("Hello World!"); + + //test (); + + // + Data datas; + IdData tag; + + + + + // Step #01. + { + System.out.println ("----------------------------"); + + // Populate attributes. + datas = new Data (); + datas.setContent ("name", "Superman"); + + StringBuffer html; + try + { + html = StringPresenter.doXid ("
a name
", datas); + } + catch (Exception exception) + { + System.out.println("Error " + exception.getMessage()); + html = null; + } + System.out.println ("datas = new Data ();"); + System.out.println ("datas.setContent (\"name\", \"Superman\");"); + System.out.println ("+"); + System.out.println ("
a name
"); + System.out.println ("=>"); + System.out.println (html); + } + + + // Step #02. + { + System.out.println ("----------------------------"); + // Populate attributes. + datas = new Data (); + datas.setContent ("lastname", "Spiderman"); + datas.appendAttribute ("lastname", "style", "background: blue;"); + datas.appendAttribute ("lastname", "style", "foreground: red;"); + datas.setAttribute ("lastname", "class", "nameClass"); + + StringBuffer html; + try + { + html = StringPresenter.doXid ("
a last name
", datas); + } + catch (Exception exception) + { + System.out.println("Error " + exception.getMessage()); + html = null; + } + + System.out.println ("datas = new Data ();"); + System.out.println ("datas.setContent (\"lastname\", \"Spiderman\");"); + System.out.println ("datas.appendAttribute (\"lastname\", \"style\", \"background: blue;\");"); + System.out.println ("datas.appendAttribute (\"lastname\", \"style\", \"foreground: red;\");"); + System.out.println ("datas.setAttribute (\"lastname\", \"class\", \"nameClass\");"); + System.out.println ("+"); + System.out.println ("
a last name
"); + System.out.println ("=>"); + System.out.println (html); + } + + + // Step #03. + { + System.out.println ("----------------------------"); + // Populate attributes. + datas = new Data (); + datas.setContent ("words", 0, "alpha"); + datas.setContent ("words", 1, "bravo"); + datas.setContent ("words", 2, "charlie"); + datas.setContent ("words", 3, "delta"); + datas.setContent ("words", 4, "echo"); + datas.setContent ("words", 5, "fox"); + + StringBuffer html; + try + { + html = StringPresenter.doXid ("
    \n
  • a word
  • \n
", datas); + } + catch (Exception exception) + { + System.out.println("Error " + exception.getMessage()); + html = null; + } + + System.out.println ("datas = new Data ();"); + System.out.println ("datas.setContent (\"words\", 0, \"alpha\");"); + System.out.println ("datas.setContent (\"words\", 1, \"bravo\");"); + System.out.println ("datas.setContent (\"words\", 2, \"charlie\");"); + System.out.println ("datas.setContent (\"words\", 3, \"delta\");"); + System.out.println ("datas.setContent (\"words\", 4, \"echo\");"); + System.out.println ("datas.setContent (\"words\", 5, \"fox\");"); + System.out.println ("+"); + System.out.println ("
    "); + System.out.println ("
  • a word
  • "); + System.out.println ("
"); + System.out.println ("=>"); + System.out.println (html); + } + + + // Step #04. + { + System.out.println ("----------------------------"); + // Populate attributes. + datas = new Data (); + datas.setContent ("identity", 0, "last_name", "Jemba"); + datas.setContent ("identity", 0, "first_name", "Epo"); + datas.setContent ("identity", 1, "last_name", "Momon"); + datas.setContent ("identity", 1, "first_name", "Christian"); + datas.setContent ("identity", 2, "last_name", "Tronche"); + datas.setContent ("identity", 2, "first_name", "Christophe"); + + + StringBuffer source = new StringBuffer (); + source.append ("\n"); + source.append (" \n"); + source.append ("
noidJeanReve
"); + + String htmlSource = source.toString (); + StringBuffer html; + try + { + html = StringPresenter.doXid (htmlSource, datas); + } + catch (Exception exception) + { + System.out.println("Error " + exception.getMessage()); + html = null; + } + + System.out.println ("datas = new Data ();"); + System.out.println ("datas.setContent (\"identity\", 0, \"last_name\", \"Jemba\");"); + System.out.println ("datas.setContent (\"identity\", 0, \"first_name\", \"Epo\");"); + System.out.println ("datas.setContent (\"identity\", 1, \"last_name\", \"Momon\");"); + System.out.println ("datas.setContent (\"identity\", 1, \"first_name\", \"Christian\");"); + System.out.println ("datas.setContent (\"identity\", 2, \"last_name\", \"Tronche\");"); + System.out.println ("datas.setContent (\"identity\", 2, \"first_name\", \"Christophe\");"); + + System.out.println ("+"); + System.out.println (htmlSource); + System.out.println ("=>"); + System.out.println (html); + } + + + // Step #05. + { + System.out.println ("----------------------------"); + // Populate attributes. + datas = new Data (); + datas.setContent ("identity", 0, "last_name", "Jemba"); + datas.setContent ("identity", 0, "first_name", "Epo"); + datas.setContent ("identity", 1, "last_name", "Momon"); + datas.setContent ("identity", 1, "first_name", "Christian"); + datas.setContent ("identity", 2, "last_name", "Tronche"); + datas.setContent ("identity", 2, "first_name", "Christophe"); + //datas.setIterationStrategy ("identity", IdsDataByIndex.IterationStrategy.ONLY_ROWS_WITH_ID); + //datas.setIterationStrategy ("identity", IdsDataByIndex.IterationStrategy.ONLY_ROWS_WITHOUT_ID); + //datas.setIterationStrategy ("identity", IdsDataByIndex.IterationStrategy.ALL_ROWS); + + // + StringBuffer source = new StringBuffer (); + source.append ("\n"); + source.append (" \n"); + source.append (" \n"); + source.append (" \n"); + source.append (" \n"); + source.append ("
noidFirst NameLast Name
noidJeanReve
noida first namea last name
noida first name morea last name more
\n"); + String htmlSource = source.toString (); + + System.out.println ("datas = new Data ();"); + System.out.println ("datas.setContent (\"identity\", 0, \"first_name\", \"Epo\");"); + System.out.println ("datas.setContent (\"identity\", 0, \"last_name\", \"Jemba\");"); + System.out.println ("datas.setContent (\"identity\", 1, \"first_name\", \"Christian\");"); + System.out.println ("datas.setContent (\"identity\", 1, \"last_name\", \"Momon\");"); + System.out.println ("datas.setContent (\"identity\", 2, \"first_name\", \"Christophe\");"); + System.out.println ("datas.setContent (\"identity\", 2, \"last_name\", \"Tronche\");"); + + System.out.println ("+"); + System.out.println (htmlSource); + System.out.println ("=>"); + + + // #05.1 + datas.setIterationStrategy ("identities", IdData.IterationStrategy.ONLY_FIRST_ROW); + System.out.println ("ONLY_FIRST_ROW:"); + StringBuffer html; + try + { + html = StringPresenter.doXid (htmlSource, datas); + } + catch (Exception exception) + { + System.out.println(exception.getMessage()); + html = null; + } + System.out.println (html); + System.out.println (""); + + + // #05.2 + datas.setIterationStrategy ("identities", IdData.IterationStrategy.ONLY_FIRST_TWO_ROWS); + System.out.println ("ONLY_FIRST_TWO_ROWS:"); + try + { + html = StringPresenter.doXid (htmlSource, datas); + } + catch (Exception exception) + { + System.out.println("Error " + exception.getMessage()); + html = null; + } + System.out.println (html); + System.out.println (""); - //test (); + + // #05.3 + datas.setIterationStrategy ("identities", IdData.IterationStrategy.ONLY_ROWS_WITH_ID); + System.out.println ("ONLY_ROWS_WITH_ID:"); + try + { + html = StringPresenter.doXid (htmlSource, datas); + } + catch (Exception exception) + { + System.out.println("Error " + exception.getMessage()); + html = null; + } + System.out.println (html); + System.out.println (""); - // - Data datas; - IdData tag; - - - - String htmlSource; - StringBuffer html; - StringBuffer errorMessage; - - // Populate attributes of Test 03. - System.out.println ("----------------------------"); - datas = new Data (); - datas.setContent ("name", "Superman"); - - errorMessage = new StringBuffer (); - html = StringPresenter.doXid ("
a name
", datas, errorMessage); - - System.out.println ("datas = new Data ();"); - System.out.println ("datas.setContent (\"name\", \"Superman\");"); - System.out.println ("+"); - System.out.println ("
a name
"); - System.out.println ("=>"); - System.out.println (html); - - - // Populate attributes of Test 03. - System.out.println ("----------------------------"); - datas = new Data (); - datas.setContent ("lastname", "Spiderman"); - datas.appendAttribute ("lastname", "style", "background: blue;"); - datas.appendAttribute ("lastname", "style", "foreground: red;"); - datas.setAttribute ("lastname", "class", "nameClass"); - - - errorMessage = new StringBuffer (); - html = StringPresenter.doXid ("
a last name
", datas, errorMessage); - - System.out.println ("datas = new Data ();"); - System.out.println ("datas.setContent (\"lastname\", \"Spiderman\");"); - System.out.println ("datas.appendAttribute (\"lastname\", \"style\", \"background: blue;\");"); - System.out.println ("datas.appendAttribute (\"lastname\", \"style\", \"foreground: red;\");"); - System.out.println ("datas.setAttribute (\"lastname\", \"class\", \"nameClass\");"); - System.out.println ("+"); - System.out.println ("
a last name
"); - System.out.println ("=>"); - System.out.println (html); - - - // Populate attributes of Test 03. - System.out.println ("----------------------------"); - datas = new Data (); - datas.setContent ("words", 0, "alpha"); - datas.setContent ("words", 1, "bravo"); - datas.setContent ("words", 2, "charlie"); - datas.setContent ("words", 3, "delta"); - datas.setContent ("words", 4, "echo"); - datas.setContent ("words", 5, "fox"); - - - errorMessage = new StringBuffer (); - html = StringPresenter.doXid ("
    \n
  • a word
  • \n
", datas, errorMessage); - - System.out.println ("datas = new Data ();"); - System.out.println ("datas.setContent (\"words\", 0, \"alpha\");"); - System.out.println ("datas.setContent (\"words\", 1, \"bravo\");"); - System.out.println ("datas.setContent (\"words\", 2, \"charlie\");"); - System.out.println ("datas.setContent (\"words\", 3, \"delta\");"); - System.out.println ("datas.setContent (\"words\", 4, \"echo\");"); - System.out.println ("datas.setContent (\"words\", 5, \"fox\");"); - System.out.println ("+"); - System.out.println ("
    "); - System.out.println ("
  • a word
  • "); - System.out.println ("
"); - System.out.println ("=>"); - System.out.println (html); - - - // Populate attributes of Test 03. - System.out.println ("----------------------------"); - datas = new Data (); - datas.setContent ("identity", 0, "last_name", "Jemba"); - datas.setContent ("identity", 0, "first_name", "Epo"); - datas.setContent ("identity", 1, "last_name", "Momon"); - datas.setContent ("identity", 1, "first_name", "Christian"); - datas.setContent ("identity", 2, "last_name", "Tronche"); - datas.setContent ("identity", 2, "first_name", "Christophe"); - - - errorMessage = new StringBuffer (); - StringBuffer source = new StringBuffer (); - source.append ("\n"); - source.append (" \n"); - source.append ("
noidJeanReve
"); - htmlSource = source.toString (); - html = StringPresenter.doXid (htmlSource, datas, errorMessage); - - System.out.println ("datas = new Data ();"); - System.out.println ("datas.setContent (\"identity\", 0, \"last_name\", \"Jemba\");"); - System.out.println ("datas.setContent (\"identity\", 0, \"first_name\", \"Epo\");"); - System.out.println ("datas.setContent (\"identity\", 1, \"last_name\", \"Momon\");"); - System.out.println ("datas.setContent (\"identity\", 1, \"first_name\", \"Christian\");"); - System.out.println ("datas.setContent (\"identity\", 2, \"last_name\", \"Tronche\");"); - System.out.println ("datas.setContent (\"identity\", 2, \"first_name\", \"Christophe\");"); - - System.out.println ("+"); - System.out.println (htmlSource); - System.out.println ("=>"); - System.out.println (html); - - - // Populate attributes of Test 03. - System.out.println ("----------------------------"); - datas = new Data (); - datas.setContent ("identity", 0, "last_name", "Jemba"); - datas.setContent ("identity", 0, "first_name", "Epo"); - datas.setContent ("identity", 1, "last_name", "Momon"); - datas.setContent ("identity", 1, "first_name", "Christian"); - datas.setContent ("identity", 2, "last_name", "Tronche"); - datas.setContent ("identity", 2, "first_name", "Christophe"); - //datas.setIterationStrategy ("identity", IdsDataByIndex.IterationStrategy.ONLY_ROWS_WITH_ID); - //datas.setIterationStrategy ("identity", IdsDataByIndex.IterationStrategy.ONLY_ROWS_WITHOUT_ID); - //datas.setIterationStrategy ("identity", IdsDataByIndex.IterationStrategy.ALL_ROWS); - - - errorMessage = new StringBuffer (); - source = new StringBuffer (); - source.append ("\n"); - source.append (" \n"); - source.append (" \n"); - source.append (" \n"); - source.append (" \n"); - source.append ("
noidFirst NameLast Name
noidJeanReve
noida first namea last name
noida first name morea last name more
\n"); - htmlSource = source.toString (); - - System.out.println ("datas = new Data ();"); - System.out.println ("datas.setContent (\"identity\", 0, \"first_name\", \"Epo\");"); - System.out.println ("datas.setContent (\"identity\", 0, \"last_name\", \"Jemba\");"); - System.out.println ("datas.setContent (\"identity\", 1, \"first_name\", \"Christian\");"); - System.out.println ("datas.setContent (\"identity\", 1, \"last_name\", \"Momon\");"); - System.out.println ("datas.setContent (\"identity\", 2, \"first_name\", \"Christophe\");"); - System.out.println ("datas.setContent (\"identity\", 2, \"last_name\", \"Tronche\");"); - - System.out.println ("+"); - System.out.println (htmlSource); - System.out.println ("=>"); - - - datas.setIterationStrategy ("identities", IdData.IterationStrategy.ONLY_FIRST_ROW); - System.out.println ("ONLY_FIRST_ROW:"); - html = StringPresenter.doXid (htmlSource, datas, errorMessage); - System.out.println (html); - - System.out.println (""); - datas.setIterationStrategy ("identities", IdData.IterationStrategy.ONLY_FIRST_TWO_ROWS); - System.out.println ("ONLY_FIRST_TWO_ROWS:"); - html = StringPresenter.doXid (htmlSource, datas, errorMessage); - System.out.println (html); - - System.out.println (""); - datas.setIterationStrategy ("identities", IdData.IterationStrategy.ONLY_ROWS_WITH_ID); - System.out.println ("ONLY_ROWS_WITH_ID:"); - html = StringPresenter.doXid (htmlSource, datas, errorMessage); - System.out.println (html); - - System.out.println (""); - datas.setIterationStrategy ("identities", IdData.IterationStrategy.ONLY_ROWS_WITHOUT_ID); - System.out.println ("ONLY_ROWS_WITHOUT_ID:"); - html = StringPresenter.doXid (htmlSource, datas, errorMessage); - System.out.println (html); - - System.out.println (""); - datas.setIterationStrategy ("identities", IdData.IterationStrategy.ALL_ROWS); - System.out.println ("ALL_ROWS:"); - html = StringPresenter.doXid (htmlSource, datas, errorMessage); - System.out.println (html); - - - } + + // #05.4 + datas.setIterationStrategy ("identities", IdData.IterationStrategy.ONLY_ROWS_WITHOUT_ID); + System.out.println ("ONLY_ROWS_WITHOUT_ID:"); + try + { + html = StringPresenter.doXid (htmlSource, datas); + } + catch (Exception exception) + { + System.out.println("Error " + exception.getMessage()); + html = null; + } + System.out.println (html); + System.out.println (""); + + + // #05.5 + datas.setIterationStrategy ("identities", IdData.IterationStrategy.ALL_ROWS); + System.out.println ("ALL_ROWS:"); + try + { + html = StringPresenter.doXid (htmlSource, datas); + } + catch (Exception exception) + { + System.out.println("Error " + exception.getMessage()); + html = null; + } + System.out.println (html); + } + } } diff --git a/src/fr/devinsy/xid/DomPresenter.java b/src/fr/devinsy/xid/DomPresenter.java index 4de127d..cd678a4 100644 --- a/src/fr/devinsy/xid/DomPresenter.java +++ b/src/fr/devinsy/xid/DomPresenter.java @@ -94,29 +94,29 @@ public class DomPresenter extends Presenter /* * */ - public StringBuffer doXid (Data datas, StringBuffer errorOutput) + public StringBuffer doXid (Data datas) throws Exception { - return (doXid (datas.getIdsDataById (), errorOutput)); + return (doXid (datas.getIdsDataById ())); } /* * */ - public StringBuffer doXid (IdsDataById datas, StringBuffer errorOutput) + public StringBuffer doXid (IdsDataById datas) throws Exception { StringBuffer result; if (this.doc == null) { String errorMessage = "source not defined"; - errorOutput.append (errorMessage); logger.error (errorMessage); result = null; + throw new Exception (errorMessage); } else { // Build the web page. - result = Presenter.doXid (this.doc, datas, errorOutput); + result = Presenter.doXid (this.doc, datas); } // @@ -127,11 +127,11 @@ public class DomPresenter extends Presenter /* * Xid a file with data. */ - static public StringBuffer doXid (Document doc, IdsDataById datas, String webappPath, StringBuffer errorOutput) + static public StringBuffer doXid (Document doc, IdsDataById datas, String webappPath) throws Exception { StringBuffer result; - result = Presenter.process (doc, datas, webappPath, errorOutput); + result = Presenter.process (doc, datas, webappPath); // return (result); diff --git a/src/fr/devinsy/xid/FilePresenter.java b/src/fr/devinsy/xid/FilePresenter.java index 8f7b864..ceb9585 100644 --- a/src/fr/devinsy/xid/FilePresenter.java +++ b/src/fr/devinsy/xid/FilePresenter.java @@ -68,16 +68,16 @@ public class FilePresenter extends DomPresenter /* * */ - public StringBuffer doXid (Data datas, StringBuffer errorOutput) + public StringBuffer doXid (Data datas) throws Exception { - return (doXid (datas.getIdsDataById (), errorOutput)); + return (doXid (datas.getIdsDataById ())); } /* * */ - public StringBuffer doXid (IdsDataById datas, StringBuffer errorOutput) + public StringBuffer doXid (IdsDataById datas) throws Exception { StringBuffer result; @@ -89,22 +89,22 @@ public class FilePresenter extends DomPresenter if (source == null) { String errorMessage = "source file not defined"; - errorOutput.append (errorMessage); logger.error (errorMessage); result = null; + throw new Exception (errorMessage); } else if (!source.exists ()) { String errorMessage = "source file defined but not found (" + sourceFilePath + ")"; - errorOutput.append (errorMessage); logger.error (errorMessage); result = null; + throw new Exception (errorMessage); } else if ((this.doc == null) || (this.sourceFileTime != source.lastModified ())) { this.sourceFileTime = source.lastModified (); - this.doc = Presenter.fileToTree (sourceFilePath, errorOutput); + this.doc = Presenter.fileToTree (sourceFilePath); if (this.doc != null) { @@ -113,7 +113,7 @@ public class FilePresenter extends DomPresenter } // Build the web page. - result = Presenter.doXid (doc, datas, errorOutput); + result = Presenter.doXid (doc, datas); // return (result); @@ -123,11 +123,11 @@ public class FilePresenter extends DomPresenter /* * Xid a file without data. */ - static public StringBuffer doXid (String fileName, StringBuffer errorOutput) + static public StringBuffer doXid (String fileName) throws Exception { StringBuffer result; - Document doc = Presenter.fileToTree (fileName, errorOutput); + Document doc = Presenter.fileToTree (fileName); if (doc == null) { @@ -137,7 +137,7 @@ public class FilePresenter extends DomPresenter { Presenter.addMetaTag (doc, "generator", "XID 0.0"); - result = Presenter.doXid (doc, null, errorOutput); + result = Presenter.doXid (doc, null); } // diff --git a/src/fr/devinsy/xid/Presenter.java b/src/fr/devinsy/xid/Presenter.java index be50a68..f71d009 100644 --- a/src/fr/devinsy/xid/Presenter.java +++ b/src/fr/devinsy/xid/Presenter.java @@ -14,6 +14,7 @@ import org.w3c.dom.*; public class Presenter { static final public char INDEX_SEPARATOR = '_'; + static protected int bufferSize = 2048; static protected org.apache.log4j.Logger logger; static @@ -25,17 +26,42 @@ public class Presenter /* * Xid a file with data. */ - static public StringBuffer doXid (Document doc, IdsDataById datas, StringBuffer errorOutput) + static public StringBuffer doXid (Document doc, IdsDataById datas) throws Exception { StringBuffer result; - result = Presenter.process (doc, datas, errorOutput); + result = Presenter.process (doc, datas); // return (result); } + + /* + * + */ + static public int bufferSize() + { + int result; + + result = bufferSize; + + // + return(result); + } + + /* + * + */ + static public void setBufferSize(int value) + { + if (bufferSize > 0) + { + bufferSize = value; + } + } + /* * */ @@ -117,11 +143,11 @@ public class Presenter /* * */ - static protected StringBuffer processChildren (Node node, IdsDataById datas, StringBuffer errorOutput) + static protected StringBuffer processChildren (Node node, IdsDataById datas) throws Exception { StringBuffer result; - result = processChildren (node, datas, "", errorOutput); + result = processChildren (node, datas, ""); // return (result); @@ -133,8 +159,7 @@ public class Presenter */ static protected StringBuffer processChildren (Node node, IdsDataById datas, - String suffix, - StringBuffer errorOutput) + String suffix) throws Exception { StringBuffer result; result = new StringBuffer (); @@ -190,12 +215,12 @@ public class Presenter lineCounter += 1; if (lineCounter == 1) { - result.append (process (children.item (childIndex), datas, suffix, errorOutput)); + result.append (process (children.item (childIndex), datas, suffix)); } } else { - result.append (process (children.item (childIndex), datas, suffix, errorOutput)); + result.append (process (children.item (childIndex), datas, suffix)); } } break; @@ -210,12 +235,12 @@ public class Presenter if ((lineCounter == 1) || (lineCounter == 2)) { - result.append (process (children.item (childIndex), datas, suffix, errorOutput)); + result.append (process (children.item (childIndex), datas, suffix)); } } else { - result.append (process (children.item (childIndex), datas, suffix, errorOutput)); + result.append (process (children.item (childIndex), datas, suffix)); } } break; @@ -230,12 +255,12 @@ public class Presenter if ((attrs2 != null) && (attrs2.getNamedItem ("id") != null)) { - result.append (process (children.item (childIndex), datas, suffix, errorOutput)); + result.append (process (children.item (childIndex), datas, suffix)); } } else { - result.append (process (children.item (childIndex), datas, suffix, errorOutput)); + result.append (process (children.item (childIndex), datas, suffix)); } } break; @@ -249,12 +274,12 @@ public class Presenter if ((attrs2 == null) || (attrs2.getNamedItem ("id") == null)) { - result.append (process (children.item(childIndex), datas, suffix, errorOutput)); + result.append (process (children.item(childIndex), datas, suffix)); } } else { - result.append (process (children.item (childIndex), datas, suffix, errorOutput)); + result.append (process (children.item (childIndex), datas, suffix)); } } break; @@ -262,7 +287,7 @@ public class Presenter case ALL_ROWS: for (int childIndex = 0; childIndex < childrenCount; childIndex++) { - result.append (process (children.item(childIndex), datas, suffix, errorOutput)); + result.append (process (children.item(childIndex), datas, suffix)); } break; } @@ -286,13 +311,12 @@ public class Presenter static protected StringBuffer processElementWithId (Node node, NamedNodeMap attrs, Node idAttr, - IdsDataById datas, - StringBuffer errorOutput) + IdsDataById datas) throws Exception { StringBuffer result; - result = processElementWithId (node, attrs, idAttr, datas, "", errorOutput); + result = processElementWithId (node, attrs, idAttr, datas, ""); // return (result); @@ -311,11 +335,10 @@ public class Presenter * The ID. */ static protected StringBuffer processElementWithId (Node node, - NamedNodeMap attrs, - Node idAttr, - IdsDataById datas, - String suffix, - StringBuffer errorOutput) + NamedNodeMap attrs, + Node idAttr, + IdsDataById datas, + String suffix) throws Exception { StringBuffer result; result = new StringBuffer (); @@ -331,7 +354,7 @@ public class Presenter if (dataCore == null) { - result.append (Presenter.processElementBasically (node, datas, suffix, errorOutput)); + result.append (Presenter.processElementBasically (node, datas, suffix)); } else if (dataCore instanceof IdData) { @@ -373,7 +396,7 @@ public class Presenter if ((data == null) || (data.display () == null)) { - result.append (processChildren (node, datas, suffix, errorOutput)); + result.append (processChildren (node, datas, suffix)); } else { @@ -420,7 +443,7 @@ public class Presenter // Insert data. if ((data == null) || (data.display () == null)) { - result.append (processChildren (node, datas, suffix, errorOutput)); + result.append (processChildren (node, datas, suffix)); } else { @@ -438,7 +461,7 @@ public class Presenter // Manage a Hashmap. IdsDataById data = (IdsDataById) tags.elementAt (nLine); - result.append (Presenter.processElementWithId (node, attrs, idAttr, data, Integer.toString (nLine), errorOutput)); + result.append (Presenter.processElementWithId (node, attrs, idAttr, data, Integer.toString (nLine))); result.append ('\n'); } } @@ -458,11 +481,11 @@ public class Presenter /** * */ - static protected StringBuffer process (Node node, IdsDataById datas, StringBuffer errorOutput) + static protected StringBuffer process (Node node, IdsDataById datas) throws Exception { StringBuffer result; - result = Presenter.process (node, datas, "", errorOutput); + result = Presenter.process (node, datas, ""); // return (result); @@ -473,7 +496,7 @@ public class Presenter * Recursive method that processes a node and any child nodes. * */ - static protected StringBuffer process (Node node, IdsDataById datas, String suffix, StringBuffer errorOutput) + static protected StringBuffer process (Node node, IdsDataById datas, String suffix) throws Exception { logger.debug ("process - started"); String TRANSITIONAL_DTD = "xhtml1-transitional.dtd"; @@ -517,7 +540,7 @@ public class Presenter // Log.write(Log.TRACE,"systemId = " + systemId); } - result.append (Presenter.process (((Document) node).getDocumentElement(), datas, suffix, errorOutput)); + result.append (Presenter.process (((Document) node).getDocumentElement(), datas, suffix)); break; } @@ -535,12 +558,11 @@ public class Presenter attrs, idAttr, datas, - suffix, - errorOutput)); + suffix)); } else { - result.append (Presenter.processElementBasically (node, datas, suffix, errorOutput)); + result.append (Presenter.processElementBasically (node, datas, suffix)); } break; @@ -607,11 +629,11 @@ public class Presenter /* * */ - static StringBuffer processElementBasically (Node node, IdsDataById datas,StringBuffer errorOutput) + static StringBuffer processElementBasically (Node node, IdsDataById datas) throws Exception { StringBuffer result; - result = processElementBasically (node, datas, "", errorOutput); + result = processElementBasically (node, datas, ""); // return (result); @@ -621,7 +643,7 @@ public class Presenter /* * */ - static StringBuffer processElementBasically (Node node, IdsDataById datas, String suffix, StringBuffer errorOutput) + static StringBuffer processElementBasically (Node node, IdsDataById datas, String suffix) throws Exception { StringBuffer result; logger.debug("processElementBasically - started"); @@ -648,7 +670,7 @@ public class Presenter { result.append('>'); - result.append (processChildren (node, datas, suffix, errorOutput)); + result.append (processChildren (node, datas, suffix)); result.append(" needs this possibility. */ - static protected Document fileToTree (String fileName, StringBuffer errorOutput) + static protected Document fileToTree (String fileName) throws Exception { Document result; try { - result = buildTree (new FileInputStream (new File (fileName)), errorOutput); + result = buildTree (new FileInputStream (new File (fileName))); } catch (IOException exception) { String errorMessage = "IOError during parsing." + exception.getMessage (); - errorOutput.append (errorMessage); logger.error (errorMessage); result = null; + throw new Exception (errorMessage, exception); } // diff --git a/src/fr/devinsy/xid/StringPresenter.java b/src/fr/devinsy/xid/StringPresenter.java index a49104f..b2e14f0 100644 --- a/src/fr/devinsy/xid/StringPresenter.java +++ b/src/fr/devinsy/xid/StringPresenter.java @@ -65,15 +65,15 @@ public class StringPresenter extends DomPresenter /* * */ - public StringBuffer doXid (Data datas, StringBuffer errorOutput) + public StringBuffer doXid (Data datas) throws Exception { - return (doXid (datas.getIdsDataById (), errorOutput)); + return (doXid (datas.getIdsDataById ())); } /* * */ - public StringBuffer doXid (IdsDataById datas, StringBuffer errorOutput) + public StringBuffer doXid (IdsDataById datas) throws Exception { StringBuffer result; @@ -82,9 +82,9 @@ public class StringPresenter extends DomPresenter // Build doc from this.html. String htmlSource; if ((this.html.startsWith ("")) || - (this.html.startsWith (""))) + (this.html.startsWith ("")) || + (this.html.startsWith (""))) { htmlSource = html; } @@ -95,11 +95,11 @@ public class StringPresenter extends DomPresenter // StringBufferInputStream is deprecated so we use another solution. // (see http://www.developpez.net/forums/archive/index.php/t-14101.html). - doc = buildTree (new ByteArrayInputStream (htmlSource.getBytes ()), errorOutput); + doc = buildTree (new ByteArrayInputStream (htmlSource.getBytes ())); } StringBuffer htmlTarget; - htmlTarget = Presenter.doXid (doc, datas, errorOutput); + htmlTarget = Presenter.doXid (doc, datas); if (htmlTarget == null) { @@ -134,22 +134,22 @@ public class StringPresenter extends DomPresenter /* * */ - static public StringBuffer doXid (String html, Data datas, StringBuffer errorOutput) + static public StringBuffer doXid (String html, Data datas) throws Exception { - return (doXid (html, datas.getIdsDataById (), errorOutput)); + return (doXid (html, datas.getIdsDataById ())); } /* * Xid a string with html in. */ - static public StringBuffer doXid (String html, IdsDataById datas, StringBuffer errorOutput) + static public StringBuffer doXid (String html, IdsDataById datas) throws Exception { StringBuffer result; StringPresenter presenter = new StringPresenter (html); - result = presenter.doXid (datas, errorOutput); + result = presenter.doXid (datas); // return (result);